\documentclass[trans]{beamer}

\usepackage[utf8]{inputenc}

\usepackage{amsmath,amssymb,amsthm,amscd,epsfig,listings}

\newcommand{\mods}[1]{\,(\mathrm{mod}\,{#1})} 
\def\stacksum#1#2{{\stackrel{{\scriptstyle #1}}
{{\scriptstyle #2}}}}
\newcommand{\sep}{\setlength{\fboxsep}{0in}}
\newcommand{\ovb}[2]{\overset{{#1}}{\overbrace{{#2}}}}
\newcommand{\tq}{\,\mid\,}
\newcommand{\Cc}{\mathbf{C}}
\newcommand{\Nn}{\mathbf{N}}
\newcommand{\Zz}{\mathbf{Z}}
\newcommand{\Pp}{\mathbf{P}}
\newcommand{\Rr}{\mathbf{R}}
\newcommand{\Gg}{\mathbf{G}}
\newcommand{\Hh}{\mathbf{H}}
\newcommand{\Qq}{\mathbf{Q}}
\newcommand{\Fp}{\mathbf{F}}
\newcommand{\ra}{\rightarrow}
\newcommand{\sheaf}[1]{\mathcal{{#1}}}
\newcommand{\ideal}[1]{\mathfrak{{#1}}}
\DeclareMathOperator{\rank}{rank}
\DeclareMathOperator{\ord}{ord}
\DeclareMathOperator{\frob}{Fr}
\DeclareMathOperator{\disc}{disc}
\DeclareMathOperator{\Reel}{Re}
\DeclareMathOperator{\Imag}{Im}
\DeclareMathOperator{\card}{Card}
\DeclareMathOperator{\Gal}{Gal}
\DeclareMathOperator{\End}{End}
\DeclareMathOperator{\Tr}{Tr}
\def\multsum{\mathop{\sum\sum}\limits}
\def\sums{\mathop{\sum\Bigl.^{*}}\limits}
\def\sumb{\mathop{\sum\Bigl.^{\flat}}\limits}

\newcommand{\vpause}{\par\medskip\par\pause}

\newcommand{\ssi}{\Leftrightarrow}
\renewcommand{\implies}{\Rightarrow}
\newcommand{\fleche}[1]{\stackrel{{#1}}{\longrightarrow}}

\newcommand{\bul}{$\bullet$ }
\newcommand{\squ}{\hskip 1cm $\square$ }
\newcommand{\slitle}[1]{\begin{center}\large{\underline{{#1}}}\end{center}\vskip
0.5cm}



% \newenvironment{cframe}{\usebackgroundtemplate{\includegraphics[width=\paperwidth]{chameleon.pdf}}}{\end{frame}}

% \newcommand{\cframe}{\usebackgroundtemplate{\includegraphics[width=\paperwidth]{chameleon.pdf}}\begin{frame}}
% \newcommand{\ecframe}{\end{frame}}}

\mode<presentation>
{
  \usetheme{boxes}
%   % or ...

%   \setbeamercovered{transparent}
  % or whatever (possibly just delete it)
}

\begin{document}

% \setbeamertemplate{background}{\includegraphics[width=\paperwidth]{chameleon.pdf}}
% \setbeamertemplate{background}{\includegraphics[width=\paperwidth]{chameleon2.pdf}}


\title[Magma]{Introduction to \textbf{Magma}}
\author{E. Kowalski}

\institute{ETH Zürich}

\begin{frame}
\titlepage
\end{frame}

\begin{frame}
\frametitle{The \textbf{Magma} software}

This is one of the best computational \emph{algebra} package currently
available, \pause both in terms of \emph{what objects} it knows about,
and \emph{how efficiently} it can compute with them.
\par
\pause 
\par
\textbf{Magma} is non-commercial, but not free or open source.  Among
the best existing free software are:
\par
-- \textbf{Pari/GP} for algebraic number theory;
\par
-- \textbf{GAP} for group theory and representation theory;
\par
-- \textbf{Sage}, which tries to combine together many different free
mathematical software for a better user interface, around the language
\textbf{Python}. 

\end{frame}

\begin{frame}
\frametitle{What \textbf{Magma} knows}

\textbf{Magma} has some knowledge of the following types of mathematical
objects (non-exhaustive list):
\par
\pause
\par 
-- Sets, sequences, multisets, tuples, strings;
\par
-- Rings, algebras, fields, including exact rational numbers,
arbitrary (finite) precision real and complex numbers;
\par
-- Finite groups, permutation groups, finitely presented groups, Lie
groups, Coxeter groups;
\par
-- Representation theory of finite and algebraic groups;
\par
-- Number fields, function fields, local fields, finite fields;
\par
-- Modular forms;
\par
-- Schemes for algebraic geometry, commutative algebras (in particular
elliptic curves and modular curves);
\par
-- Codes, graphs, finite geometries...
\end{frame}

\begin{frame}[fragile]
\frametitle{Language}

\textbf{Magma} is also a complete programming language, which is easy to learn
and has very natural constructs to ``express'' mathematical
constructions. For instance
\par
\pause
\lstset{basicstyle=\footnotesize\ttfamily}
\begin{lstlisting}
F:=FiniteField(3); A<x>:=PolynomialRing(F);
liste:=[x^3+a*x^2+b*x+c : a,b,c in F | 
           IsSquarefree(x^3+a*x^2+b*x+c)];
\end{lstlisting}
gives an ordered list of all monic polynomials of degree $3$ in
$\Fp_3[x]$ which are squarefree.
\par
(Note that data in \textbf{Magma} is strongly typed, so one must often
get used to explicit typing and conversions, such as defining $F$ and
$A$ above).

\end{frame}

\begin{frame}
\frametitle{Other features}


\textbf{Magma} also contains databases which make experimentation with
some objects particularly easy:
\par
-- Groups of small order, almost simple groups, transitive permutation
groups of small degree;
\par
-- Graphs, codes and lattices;
\par
-- Elliptic curves...
\par
And its algorithms are usually among the best known, and highly
optimized. 
\pause
For instance, it can compute $L$-functions of hyperelliptic curves in
families using very recent algorithms.
\par
\pause
For many types of objects, \textbf{Magma} also provides a way to get a
``random'' element, which can be very useful for testing and
exploring (though there isn't that much support for probability in
general). 

\end{frame}

\begin{frame}[fragile]
\frametitle{Some code}

Here some sample \textbf{Magma} code that was used to compute the
characteristic polynomial of certain integral matrices, and compute
its Galois group.
\par

\lstset{basicstyle=\small\ttfamily}
\begin{lstlisting}
A<T>:=PolynomialRing(RationalField()); 
E8:=GroupOfLieType("E8",RationalField()); 
gen:=AlgebraicGenerators(E8); 
rho:=AdjointRepresentation(E8); 
g:=Identity(E8); 
for i in gen do g:=g*i ; end for; 
m:=rho(g); 
pol:=CharacteristicPolynomial(m) div (T-1)^8; 
\end{lstlisting}
\pause

Note that it is highly readable for a mathematician. 

\end{frame}


\begin{frame}[fragile]
\frametitle{(cont.)}

\lstset{basicstyle=\small\ttfamily}
\begin{lstlisting}
W:=WeylGroup(E8); 
max:=MaximalSubgroups(W);
for m in max do print("----");
  for c in ConjugacyClasses(m`subgroup) do
    print(CycleStructure(c[3]));
  end for;
end for;
\end{lstlisting}

\end{frame}


\begin{frame}[fragile]
\frametitle{Other examples}


\lstset{basicstyle=\footnotesize\ttfamily}
\begin{lstlisting}
Chebotarev:= function (G)
  C := ConjugacyClasses(G);
  f:=ClassMap(G);
  M := MaximalSubgroups(G);

  // Construct an array indicating which maximal subgroups
  // intersect which conjugacy classes
  J := [ [false : i in [1..#C]] : k in [1..#M] ];
  for k in [1..#M] do
    H := M[k]`subgroup;
    CH := ConjugacyClasses(H);
    for j in [1..#CH] do
      J[k][f(CH[j][3])] := true;
    end for;
  end for;
  
\end{lstlisting}

\end{frame}
\begin{frame}[fragile]
\frametitle{(cont.)}

\lstset{basicstyle=\footnotesize\ttfamily}
\begin{lstlisting}
  // Then loop to compute the invariants
  c:=0.0; s:=0.0;
  for I in Subsets({1..#M}) do
    if #I ne 0 then 
      v:=0;
      for i in [1..#C] do
        if forall(t) {k: k in I | J[k][i]} then
          v:= v + C[i][2]/#G;
        end if;
      end for;
      c := c + (-1)^(#I+1)/(1-v);
      s := s+ (-1)^(#I)/(1-v)*(1-2/(1-v));
    end if;
  end for;
  return([c,s]);
end function;
\end{lstlisting}

\end{frame}

\end{document}

%%% Local Variables: 
%%% mode: latex
%%% TeX-master: t
%%% End: 
