
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  (c)  William Stein
%  (c) 2006, Justin C. Walker
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\documentclass{beamer}
\usepackage{beamerthemesplit}
\usepackage{graphicx}
\newcommand{\page}[1]{\frame{#1}}

\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{graphicx} 
\usepackage{pstricks} 
\usepackage{color}
\definecolor{dbluecolor}{rgb}{0,0,0.6}
\definecolor{dredcolor}{rgb}{.5,0.0,0.0}
\definecolor{dgreencolor}{rgb}{0,0.4,0}
\definecolor{blue}{rgb}{.02, .02, .908}
\newcommand{\dred}{\color{dredcolor}\bf}
\newcommand{\dblue}{\color{dbluecolor}\bf}
\newcommand{\dgreen}{\color{dgreencolor}\bf}
%\newcommand{\dred}{\bf}
%\newcommand{\dblue}{\bf}
%\newcommand{\dgreen}{\bf}

\usepackage{xspace}  % to allow for text macros that don't eat space 
\newcommand{\SAGE}{{\color{blue}\sf SAGE}\xspace}
\newcommand{\sage}{\SAGE}

\newcommand{\graph}[1]{\includegraphics[width=0.45\textwidth]{#1}}

\title{A Brief Introduction to SAGE}
\author{Justin C. Walker}
\date{February 22, 2006\vspace{4ex}\\\includegraphics[width=0.8in]{icon-5}\newline\newline\newline\Tiny Power Corrupts; PowerPoint Corrupts Absolutely}
\bibliographystyle{amsalpha}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\defn}[1]{{\em #1}}
% ---- SHA ----
\DeclareFontEncoding{OT2}{}{} % to enable usage of cyrillic fonts
  \newcommand{\textcyr}[1]{%
    {\fontencoding{OT2}\fontfamily{wncyr}\fontseries{m}\fontshape{n}%
     \selectfont #1}}
\newcommand{\Sha}{{\mbox{\textcyr{Sh}}}}
\DeclareMathOperator{\rank}{rank}
\DeclareMathOperator{\Vis}{Vis}
\DeclareMathOperator{\HH}{H}
\DeclareMathOperator{\Ker}{Ker}
\DeclareMathOperator{\ord}{ord}
\renewcommand{\H}{\HH}
\newcommand{\hra}{\hookrightarrow}
\newcommand{\isom}{\cong}
\newcommand{\ds}{\displaystyle}
\renewcommand{\t}[1]{\begin{center}{\large\bf #1}\end{center}}


\begin{document}

\page{
\maketitle
}

\begin{frame}[fragile]
\t{\Large \SAGE is $\ldots$}
\begin{itemize}
\item {\dblue S}oftware for {\dblue A}lgebra and {\dblue G}eometry  {\dblue E}xperimentation.
\item Free software
\item A language for writing programs
\item A high-level calculator, using your terminology
\end{itemize}
\begin{center}
\includegraphics[width=1.5in]{me_sk8}\
\end{center}
\end{frame}

\begin{frame}[fragile]
\t{\Large\SAGE is $\ldots$}

\begin{itemize}
\item A {\dblue distribution} of free open source mathematics software.
\begin{itemize}
\item \href{http://modular.ucsd.edu/sage/}{\tiny http://modular.ucsd.edu/sage/}
\end{itemize}
\item A {\dblue new computer algebra system} (very structural like Gap and Magma;
object-oriented; user extensible; do things right).
\item A {\dblue better way} to use all your favorite ({\dred commercial} or free) 
mathematics software {\em together}.\
\item Why this rather than {\dred Your Favorite CAS}?
\end{itemize}
\end{frame}

\begin{frame}[fragile]
\t{\Large You can use \SAGE in several ways:}
\begin{itemize}
\item Experiment
\item Accumulate data to inform intuition
\item Prove a theorem!
\end{itemize}
\end{frame}

\begin{frame}[fragile]
\t{\Large A Plug (MSRI/\SAGE)}
\begin{itemize}
\item Summer Graduate Workshop in Computational Number Theory (MSRI, 7/31-8/11, 2006)
\item Details on the website
\begin{itemize}
\item  \href{http://www.msri.org/calendar/sgw/WorkshopInfo/392/show_sgw}{\tiny http://www.msri.org/calendar/sgw/WorkshopInfo/392/show\_sgw}
\end{itemize}
\item Check out the book 
\begin{itemize}
\item \href{http://modular.ucsd.edu/edu/fall05/168/notes/modular_forms_book}{\tiny http://modular.ucsd.edu/edu/fall05/168/notes/modular\_forms\_book}
\end{itemize}
\end{itemize}
\end{frame}

\page{
\t{\SAGE's History}\begin{itemize}
\item William Stein: Seven years of computation
\begin{itemize}
\item Hecke: Open Source
\item Magma: Closed Source
\end{itemize}
\item Jan 2005: Stein and D. Joyner talk at the winter AMS meeting; SAGE is born 

\item {\bf One year} of work with many people:\vspace{2ex}\\
{\large
David Kohel, David Joyner, 
Iftikhar Burhanuddin, John Cremona, 
Martin Albrecht, Wilson Cheung,
Alex Clemesha, Neal Harris, Naqi Jaffery, 
Kiran Kedlaya, David Kirkby,
Jon Hanke, Gregg Musiker,
Kyle Schalm, Steven Sivek, 
Justin Walker, Mark Watkins, 
Joe Wetherell, Karim Belebas,
John Tate, and many others...}
\end{itemize}
}

\page{
\t{Computer Algebra Systems}
\t{1. Closed/Commercial({\dred\$})}
\begin{itemize}
\item Mathematica
\begin{itemize}
\item                      \href{http://www.wolfram.com}{\tiny http://www.wolfram.com}
\end{itemize}
\item Maple
\begin{itemize}
\item                      \href{http://www.maplesoft.com}{\tiny http://www.maplesoft.com}
\end{itemize}
\item Magma
\begin{itemize}
\item                      \href{http://magma.maths.usyd.edu.au/magma/}{\tiny http://magma.maths.usyd.edu.au/magma/}
\end{itemize}
\item Matlab
\begin{itemize}
\item \href{http://www.mathworks.com}{\tiny http://www.mathworks.com}
\end{itemize}
\end{itemize}
}

\page{
\t{2. Closed/Free}
\begin{itemize}
\item Kash/Kant  - Algebraic Number Theory
\begin{itemize}
\item                      \href{http://www.math.tu-berlin.de/~kant/}{\tiny http://www.math.tu-berlin.de/~kant/}
\end{itemize}
\item CoCoA - Commutative Algebra/Algebraic Geometry
\begin{itemize}
\item                      \href{http://cocoa.dima.unige.it}{\tiny http://cocoa.dima.unige.it}
\end{itemize}
\end{itemize}
}

\page{
\t{3. Open (Freely available, with source)}

\begin{itemize}

\item {\dblue GAP}        - Group Theory, Discrete Math

\begin{itemize}
\item                     \href{http://www.gap-system.org}{\tiny http://www.gap-system.org}
\end{itemize}

\item {\dblue Macaulay2}  - Commutative Algebra, Algebraic Geometry. 

\begin{itemize}
\item First cut at Macaulay2 support (Kiran Kedlaya) is in 1.0.x.
\item                      \href{http://www.math.uiuc.edu/Macaulay2/}{\tiny http://www.math.uiuc.edu/Macaulay2/}
\end{itemize}

\item {\dblue Maxima} -- Symbolic Manipulation (Macsyma's Child)
\begin{itemize}
\item                      \href{http://maxima.sourceforge.net}{\tiny http://maxima.sourceforge.net}
\end{itemize}
\end{itemize}
}

\page{
\t{3. Open (Freely available, with source) Continued$\ldots$}
\begin{itemize}
\item {\dblue NTL}        - Number Theory library (C++)
\begin{itemize}
\item                      \href{http://www.shoup.net}{\tiny http://www.shoup.net}
\end{itemize}
\item {\dblue Octave}     - Numerical computations, Matlab-like
\begin{itemize}
\item                      \href{http://www.octave.org}{\tiny http://www.octave.org}
\end{itemize}
\item {\dblue Pari/GP}    - Number Theory
\begin{itemize}
\item                      \href{http://pari.math.u-bordeaux.fr}{\tiny http://pari.math.u-bordeaux.fr}
\end{itemize}
\item {\dblue Singular}   - Commutative Algebra, Algebraic Geometry
\begin{itemize}
\item                      \href{http://www.singular.uni-kl.de}{\tiny http://www.singular.uni-kl.de}
\end{itemize}
\end{itemize}
}

\page{
\t{4. Other programs (Open) - these do one job}
\begin{itemize}
\item {\dblue mwrank}     - The famous 'mwrank'; see John Cremona's home page
\begin{itemize}
\item                      \href{http://www.maths.nott.ac.uk/personal/jec/}{\tiny http://www.maths.nott.ac.uk/personal/jec/}
\end{itemize}
\item ec, simon, sea - Elliptic Curves
\item NZMATH - Python-based Number Theory package
\begin{itemize}
\item                      \href{http://tnt.math.metro-u.ac.jp/nzmath/}{\tiny http://tnt.math.metro-u.ac.jp/nzmath/}
\end{itemize}
\end{itemize}
}

\page{
\t{Not Included With \SAGE}
\begin{enumerate}
\item {\dblue Gnuplot} -- screwy license (e.g., we wanted to change C source
so paths not hard coded, but this is not allowed!)
\item {\dblue KASH} -- closed source (but {\dgreen FREE} and {\em very} powerful)
\item {\dblue Magma} -- expensive and closed source ({\dgreen the 
dominant system} in arithmetic geometry)
\item {\dblue Mathematica / Maple} -- expensive and closed source 
\end{enumerate}
But {\dred using these} from \SAGE is supported!
}

\begin{frame}[fragile]
\begin{verbatim}
sage: (-2006).factor()
-1 * 2 * 17 * 59
sage: (-2006).factor(algorithm="kash")
-1 * 2 * 17 * 59
sage: gap(-2006).FactorsInt()
[ -2, 17, 59 ]
sage: pari(-2006).factor()
[-1, 1; 2, 1; 17, 1; 59, 1]
sage: maxima(-2006).factor()
-2*17*59
sage: kash(-2006).Factorization()
[ <2, 1>, <17, 1>, <59, 1> ], extended by: ext1 := -1
sage: magma(-2006).Factorization()
[ <2, 1>, <17, 1>, <59, 1> ]
sage: maple(-2006).ifactor()
-``(2)*``(17)*``(59)
sage: mathematica(-2006).FactorInteger()
{{-1, 1}, {2, 1}, {17, 1}, {59, 1}}
\end{verbatim}
\end{frame}

\page{
\t{Non-math \SAGE Components}
\begin{enumerate}
\item {\dblue IPython}: Wonderful Interactive Shell
\item {\dblue Python}: A {\dred Mainstream} Programming Language (many books;
numerous excellent tutorials; constantly being improved by 
hundreds of developers)
\item {\dblue Pyrex}: {\dred Compiled} Python-Like Extension Language
\item Saving and Loading Objects ({\dblue ZODB} and {\dblue cPickle})
\end{enumerate}
}

\begin{frame}[fragile]
\t{Saving and Loading Objects}

Almost any individual object in \sage can easily be loaded and saved
in a compressed format, as can sessions.  This requires almost
{\dblue no programmer support}, even for very complicated objects.
\begin{verbatim}
sage: E = EllipticCurve([1,2,3,4,5])
sage: time v = E.anlist(10^5)
CPU times: user 1.03 s, sys: 0.22 s, total: 1.25 s
Wall time: 1.59
sage: E.save('E')
sage: quit
Exiting SAGE (CPU time 0m1.45s, Wall time 0m25.36s).
was@form:~/sd/talk$ sage
sage: F = load('E')
sage: time v = F.anlist(10^5)
CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
Wall time: 0.00
\end{verbatim}
\end{frame}

\begin{frame}[fragile]
\t{Good Documentation is a Goal}
\begin{itemize}
\item Language supports it
\item Documentation on the website
\begin{itemize}
\item        \href{http://modular.ucsd.edu/sage/documentation.html}{\tiny http://modular.ucsd.edu/sage/documentation.html}
\end{itemize}
\begin{itemize}
\item Tutorial
\item Reference Manual (800+ pages)
\item Programming Guide
\item Examples
\end{itemize}
\end{itemize}
\end{frame}

\page{
\t{Help System}
\begin{enumerate}
\item {\tt function?} gives documentation about function (extracted
from source code)
\item {\tt function??} gives the {\bf source code} of function
\item Because Python is so readable, {\tt function??} is incredibly
useful and users frequently use it. 
\item {\tt help(module or object)} gives man-page like docs
\item {\dred TO DO:} full text search
\end{enumerate}
}

\begin{frame}[fragile]
\t{\Large\TeX-friendly}
You can do the following:
\begin{itemize}
\item Embed \SAGE code in your document
\item Execute this code (semi-)automatically, to produce up-to-date results
\item Gonzalo Tornaria, Joe Wetherell, and others designed and 
implemented this at the SAGE Days coding sprint
\end{itemize}
Here's an Example$\ldots$
\end{frame}

\begin{frame}[fragile]
\t{\Large\TeX'ing with \SAGE}
\begin{itemize}
\item Create \emph{foo.tex}
\item Get \emph{sagetex.sty}, \emph{sagetex.py}
\item Create your masterpiece:
\begin{quote}
\begin{verbatim}
Now we evaluate the following block:
\begin{sageblock}
# do some stuff
E = EllipticCurve("37a")
# more stuff
\end{sageblock}
Now the elliptic curve $E$ given by $\sage{E}$ 
has discriminant $\sage{E.discriminant()}$.
\end{verbatim}
\end{quote}
\end{itemize}
\end{frame}

\begin{frame}[fragile]
\t{\Large\TeX'ing with \SAGE (continued)}
\begin{itemize}
\item Run ``pdflatex foo.tex''
\item Run ``sage foo.sage''
\item Run ``pdflatex foo.tex'' (again, as with, e.g., \emph{bibtex})
\item Et voila:
\includegraphics[width=5in]{ST-Ex}\
\end{itemize}

\end{frame}

\begin{frame}[fragile]
\t{\Large Some Real-world Examples}
\begin{itemize}
\item Some Computations related to the Birch \& Swinnerton-Dyer Conjecture
\item Finding Elliptic Curves (searching the Cremona Database)
\item The Congruent Number Problem
\end{itemize}
These are due to William Stein and others; see the \sage documentation website for details.
\end{frame}

\begin{frame}[fragile]
\t{Example: From Stein's work on Birch \& Swinnerton-Dyer}
See Stein et. alia, ``Computational Verification of the Birch and Swinnerton-Dyer Conjecture for Individual Elliptic Curves'', Math. Comp, ....
\end{frame}

\begin{frame}[fragile]
\begin{verbatim}
sage: E = EllipticCurve('225a'); E
--->  Elliptic Curve defined by y^2 + y = x^3 +1 over Rational Field
sage: f = E.division_polynomial(5); f
--->  5*x^12 + 475*x^9 - 375*x^6 - 3125*x^3 - 625
sage: F = f.factor(); F
--->  (5) * (x^4 + 5*x^3 - 10*x - 5) * (x^8 - 5*x^7 + 25*x^6 
--->     - 20*x^5 + 55*x^4 - 50*x^3 + 100*x^2 - 50*x + 25)
sage: F.unit()
--->  5
sage: h = F[1][0]; h
--->  x^8 - 5*x^7 + 25*x^6 - 20*x^5 + 55*x^4 - 50*x^3 + 100*x^2 - 50*x + 25
sage: G = h.galois_group(); G
--->  Transitive group number 2 of degree 8
sage: G.gens()
--->  ((1,2,3,8)(4,5,6,7), (1,5)(2,6)(3,7)(4,8))
sage: G.order()
--->  8
\end{verbatim}
\end{frame}

\end{document}
