\documentclass[9pt]{beamer}
\usepackage{comment}
\usepackage{beamerarticle}
\usepackage[utf8x]{inputenc}
\mode<presentation>
{
  \usetheme{Rochester}
 \usecolortheme{crane}
 %\usecolortheme{seahorse}
 \setbeamercovered{transparent}
  % or whatever (possibly just delete it)
}\usepackage{ngerman}

\newcommand{\page}[1]{\frame{#1}}

\usepackage{graphicx}
\usepackage{pstricks}
\usepackage{color}
\usepackage{listings}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{listings}
\usepackage{xspace}  % to allow for text macros that don't eat space 
\newcommand{\field}[1]{\mathbb{#1}}

\newtheorem{thm}{Theorem}[section]

\definecolor{dblackcolor}{rgb}{0.0,0.0,0.0}
\definecolor{dbluecolor}{rgb}{.01,.02,0.29}
\definecolor{dredcolor}{rgb}{0.8,0,0}
\definecolor{dgraycolor}{rgb}{0.50,0.50,0.50}
\newcommand{\dblue}{\color{dbluecolor}\bf}
\newcommand{\dred}{\color{dredcolor}\bf}
\newcommand{\dblack}{\color{dblackcolor}\bf}

\renewcommand{\emph}[1]{{\dblack{#1}}}

\newcommand{\SAGE}{{\color{dbluecolor}\sf Sage}\xspace}
\newcommand{\sage}{\SAGE}


\title{Sage for Number Theorists}
\subtitle{\url{http://www.sagemath.org}}
\author[Stein et al.]{William Stein\inst{1}}
\institute[Universities of Washington]{
 \inst{1}Department of Mathematics\\
 University of Washington, Seattle
}
\date{Bristol, 2007-11-14}
\titlegraphic{\includegraphics[width=0.2\textwidth]{sagelogo.png}}


\AtBeginSection[]
{
   \begin{frame}
       \frametitle{Outline}
       \tableofcontents[currentsection]
   \end{frame}
}

\lstdefinelanguage{Sage}[]{Python}
{morekeywords={True,False,sage},
sensitive=true}

\lstset{frame=none,
          showtabs=False,
          showspaces=False,
          showstringspaces=False,
          commentstyle={\color{dredcolor}},
          keywordstyle={\color{dbluecolor}\bfseries},
          stringstyle ={\color{dgraycolor}\bfseries},
          language = Sage,
          basicstyle=\small
          }

\begin{document}

\begin{frame}
\titlepage
\end{frame}
%
%\begin{frame}{Outline}
%\tableofcontents
%\end{frame}

\section{Introduction}

\begin{frame}[fragile]
\frametitle{A Quote from Neil Sloane from Last Week}
\begin{block}{Neil Sloane}
\small
\begin{verbatim}
From: N. J. A. Sloane <njas@research.att.com>
Date: 8 Nov 2007 06:28
Subject: Re: dumb question about installing pari-gp with fink

I would like to thank everyone who responded to
my question about installing PARI on an iMAC.
 
The consensus was that it would be simplest to install sage,
which includes PARI and many other things.
 
I tried this and it worked!
 
Thanks!
 
Neil
 
(It is such a shock when things actually work!!)
\end{verbatim}
\end{block}
\end{frame}

\begin{frame}
\vfill
\Huge
OK, so what is this ``Sage'' that N.J.A. Sloane is raving about?
\vfill

\end{frame}

\begin{frame} %wstein
\frametitle{Sage: Mission Statement}
\begin{block}{Sage: Mission Statement}
Provide a single open source high-quality {\bf viable
alternative} to \emph{Magma, Mathematica, Maple} and \emph{MATLAB}.
\end{block}

\vfill

Do not reinvent the wheel but \emph{reuse} as much \emph{existing
  building blocks} as possible and make sure the result is
\emph{rigorously tested}, \emph{easy to modify} by the end user and
\emph{very well documented}.

\vfill

Also create a \emph{helpful environment} and community to get help
(mailinglists, irc-channel, meetings, coding sprints).  This helps
not only development but day-to-day research. 
\end{frame}

\begin{frame}
\frametitle{The Inquirer: Mathematics rediscovers the scientific method}
This is from British magazine {\dred The Inquirer} ({\tt http://www.theinquirer.net})!!
\vfill
{\bf Mathematics rediscovers the scientific method}
\vfill
{\small In open source software; By Egan Orion: Wednesday, 24 October 2007}
\vfill
\small
IN AN OPINION published by the American Mathematical Society, David Joyner and William Stein argue that the use of closed, proprietary mathematical software is fundamentally incompatible with the standards of mathematical proof.
\vfill
They note that at least one published article on mathematical theory has relied upon the use of proprietary software to deduce various mathematical facts. They see a disconnect in this practice for the checkability of mathematical reasonings, up to and including the proofs of new mathematical theorems. They write:
\vfill
\begin{quote}``Increasingly, proprietary software and the algorithms used are an essential part of mathematical proofs. To quote J. Neubuser, {\dblue 'with this situation two of the most basic rules of conduct in mathematics are violated: In mathematics information is passed on free of charge and everything is laid open for checking.'}''
\end{quote}
\vfill
It's somewhat {\dblue astonishing to contemplate} that mathematicians even {\dblue got so lazy as to trust the inner workings of closed software algorithms}, but {\dred perhaps all it proves is that they're human too, after all}.
\end{frame}

\begin{frame}[fragile]
\frametitle{What is Sage?}
\SAGE is a very large mathematics software package developed by a
worldwide community of developers.  Sage is:

\begin{enumerate}
\item a {\dblue distribution} of the best free, open-source mathematics
  software available (\SAGE 2.8.12 ships over 50 third-party
  packages) that is easy to compile or install from binaries.
 
\item a {\dblue huge new library}, which uniformly covers the widest
  area of \emph{functionality}, including several new implementations
  not yet found elsewhere.

\item {\dblue interfaces} to almost all existing
  mathematics software packages (including Magma, PARI, Gap, Mathematica, Maple, etc.)

\end{enumerate}
\end{frame}

\begin{frame}[fragile]
\frametitle{Welcome to \SAGE...}
\Huge

\vfill
Welcome to \SAGE:
\vfill
\begin{lstlisting}
-------------------------------------------------------------
| SAGE Version 2.8.12, Release Date: 2007-11-06              
| Type notebook() for the GUI, and license() for information.
-------------------------------------------------------------

sage: EllipticCurve('389a')
Elliptic Curve defined by 
          y^2 + y = x^3 + x^2 - 2*x 
over Rational Field

sage: factor(2^129 + 1)
3^2 * 1033 * 1591582393 * 2932031007403 * 15686603697451
\end{lstlisting}
\vfill
\end{frame}

%
%\begin{frame}
%\frametitle{The Language of Sage}
%\emph{Python} is a powerful modern interpreted programming language.

%\begin{itemize}

%\item ``Python is fast enough for our site and allows us to
%  \emph{produce maintainable features in record times}, with a minimum
%  of developers,'' said Cuong Do, Software Architect, {\dblue
%    YouTube.com.}

%\item ``Google has made no secret of the fact they use Python a lot
%  for a number of internal projects. Even knowing that, once \emph{ I
%    was an employee, I was amazed at how much Python code there
%    actually is in the Google source code system}.'', said Guido van
%  Rossum, {\dblue Google}, creator of Python.

%% well, I wouldn't advertise with Episode II  ;-)
%\item ``Python plays a key role in our production pipeline. Without it
%  a project the size of \emph{Star Wars: Episode II} would have been
%  very difficult to pull off. From crowd rendering to batch processing
%  to compositing, \emph{Python binds all things together},'' said
%  Tommy Burnette, Senior Technical Director, {\dblue Industrial Light
%    \& Magic.}
%\end{itemize}
%\end{frame}

\begin{frame}[fragile]
\frametitle{Python \& Cython: The Languages of Sage}
\framesubtitle{\url{http://www.python.org} and \url{http://www.cython.org}}
\begin{center}
 \includegraphics[width=0.4\textwidth]{python-and-cython.png}
\end{center}
\emph{Python}
\begin{itemize}
\item easy for you to define \emph{your own data types} and methods on it (bitstreams, ciphers, rings, whatever).
\item very clean language that results in \emph{easy to read code}.
\item easy to learn (several good books, some free).
\item a \emph{huge number of libraries}: statistics, networking, databases, bioinformatic, physics, video games,
3d graphics, numerical computation (scipy), and serious ``pure'' mathematics (via \SAGE)
\end{itemize}
\emph{Cython}
\begin{itemize}
\item a Python compiler (and more)
\item allows to mix C and Python which is crucial for fast execution speed
\item makes easy to \emph{use existing C/C++ libraries} from Python.
\item project started by me as a fork of Pyrex
\item Robert Bradshaw (my first Ph.D. student) is the project leader
\end{itemize}
\end{frame}




\section{Capabilities}

\begin{frame}
\frametitle{Some Capabilities}
\framesubtitle{see \url{http://wiki.sagemath.org/cando}}
 \begin{description}

% \item[Linear Algebra] {\dblue fast linear algebra over $\field{Q}$}; dense
%   linear algebra over $\field{F}_q$, very optimized over $\field{F}_2$,
%      and sparse linear algebra solver and echelon form over
%   $\field{F}_q$; numerical dense linear algebra; matrix structure
%   visualisation.  {\dblue Very fast charpoly algorithm.}

 \item[Number Theory] (mwrank, Simon, Lcalc GP/PARI, NTL) {\dred Mordell-Weil groups},
   very fast {\dred quadratic sieve}, {\dred modular symbols for general}
   weight, character, $\Gamma_1(N)$, and $\Gamma_H(N)$, 
   {\dred Kedlaya's point-counting algorithm} (Harvey's fast variant),
    Coleman integration; {\dred Coleman integration and $p$-adic heights}. 
\vfill
 \item[Elliptic Curves] All the standard stuff, plus {\dblue complex and $p$-adic $L$-functions},
  and fast computation of {\dblue $p$-adic heights and regulators for $p
   < 100000$} with new algorithm. 
   \vfill
\item[$p$-adic Numbers] Highly optimized support for arithmetic with a wide range
  of different models of {\dred $p$-adic arithmetic}.
  \vfill
  \item[And much much more...]
\end{description}
\end{frame}


\begin{frame}{Bonus: A Powerful Web-based Graphical User Interface}
\framesubtitle{public notebooks available at \url{http://www.sagenb.org}}
\begin{tabular}{cc}
\begin{minipage}{0.75\textwidth}
\includegraphics[width=1.0\textwidth]{notebook.png}
\end{minipage}  & 
\begin{minipage}{0.25\textwidth}
\begin{itemize}
\item graphical user interface
\item plotting
\item LaTeX typesetting
\item remote access
\item worksheet sharing
\item interface to 3rd party systems, e.g. Magma
\end{itemize}
\end{minipage}
\end{tabular}
\end{frame}


\section{Examples}
%
%\begin{frame}[fragile]
%\frametitle{Basic Finite Field Arithmetic} 
%\begin{itemize}
% \item finite fields $\field{F}_{p^n}$ for arbitrary sizes of $p$ and $n < 2^{32}$.
% \item finite extension fields of order $< 2^{16}$ implemented using Zech logs (fast!)
% \item larger $\field{F}_q$ implemented using Pari's (slow) or NTL's (reasonable) polynomial representation
% \item another option: mp$\field{F}_q$ \\
% \url{http://hyperelliptic.org/SPEED/slides/Gaudry_Thome_mpFq.pdf}
%\end{itemize}
%\begin{lstlisting}
%sage: k.<a> = GF(2^8); k
%Finite Field in a of size 2^8
%sage: P.<x> = GF(3)['x']
%sage: p = P.random_element(degree=5); p
%2*x^5 + 2*x^2 + 2*x + 1
%sage: p/2 # monic
%x^5 + x^2 + x + 2
%sage: k.<a> = GF(3^5, modulus=p)
%sage: k.modulus()
%x^5 + x^2 + x + 2
%\end{lstlisting}
%\end{frame}

%
%\begin{frame}[fragile]
%\frametitle{Dense Linear Algebra over GF(2)} 
%\begin{itemize}
% \item uses M4RI package by Gregory Bard
% \item uses packed representation and Gray-Codes
% \item multiplication \& echolonisation $O(n^3/log(n))$
% \item world's fastest implementation up to about $10000\times 10000$ matrices
%\begin{lstlisting}
%sage: A = random_matrix(GF(2),10000,10000)
%sage: time A.echelonize()   # 32-bit OSX laptop
%CPU times: user 7.00 s, sys: 0.04 s, total: 7.04 s
%Wall time: 7.43
%\end{lstlisting}
%\end{itemize}
%\end{frame}



\begin{frame}[fragile]
\frametitle{Integer Factorization}
\lstset{basicstyle=\tiny}
\begin{description}
 \item[factor] uses PARI
\begin{lstlisting} 
sage: time factor(next_prime(2^40) * next_prime(2^300),verbose=0)
1099511627791 *
203703597633448608626844568840937816105146839366593625063614044935438129\
9763336706183397533
CPU time: 3.77 s,  Wall time: 3.82 s
\end{lstlisting}

 \item[ecm] uses GMP-ECM by Paul Zimmermann et al.

 \begin{lstlisting}
sage: time ecm.factor(next_prime(2^40) * next_prime(2^300))
[1099511627791, 2037035976334486086268445688409378161051468393665936250636140449354381299763336706183397533]
CPU time: 0.19 s,  Wall time: 0.62 s
\end{lstlisting}

 \item[qsieve] uses Bill Hart's quadratic sieve implementation 
\begin{lstlisting}
sage: v,t = qsieve(next_prime(2^90)*next_prime(2^91),time=True)
sage: print v, t[:4]
[1237940039285380274899124357, 2475880078570760549798248507] 4.00
\end{lstlisting}

\item[DistributedFactor] combines ECM, qsieve and trial division; written by Yi Qiang and Robert Bradshaw.
\end{description}
\end{frame}

\begin{frame}[fragile]
\frametitle{LLL Lattice Basis Reduction}

\Large Sage includes several LLL implementations, including PARI's, NTL's, and {\dred Damien Stehle's fpLLL}
(currently the world's best). 
\vfill

\begin{lstlisting}
sage: from sage.libs.fplll.fplll import gen_ntrulike
sage: A = gen_ntrulike(200,130,35)
sage: time B = A.LLL()   # uses fpLLL by Damien Stehle
CPU time: 14.91 s,  Wall time: 15.06
\end{lstlisting}
\end{frame}


\begin{frame}[fragile]
\frametitle{Elliptic Curves for Kids}
\begin{lstlisting}
X = []
for E in cremona_optimal_curves([11..37]):
    X.append(plot(E, thickness=10,
         rgbcolor=(random(),random(),random())))
show(graphics_array(X, 4,5), axes=False)
\end{lstlisting}
\includegraphics[width=1\textwidth,height=0.7\textheight]{kids.png}
\end{frame}


\begin{frame}[fragile]
\frametitle{Elliptic Curves over $\field{F}_q$} 
\Huge

Plot elliptic curves over finite fields:

\begin{lstlisting}
sage: e = EllipticCurve("37a") # Cremona Label
sage: E = e.change_ring(GF(997))
sage: show(E.plot())
\end{lstlisting}
\begin{center}
\includegraphics[width=0.7\textwidth]{ell_curve_modp.png}
\end{center}
\framebreak
\end{frame}


\begin{frame}[fragile]
\Huge
Sage includes a fast SEA implementation.
\vfill

\begin{lstlisting}
sage: k = GF(next_prime(10^20))
sage: E = EllipticCurve(k, 
...   [k.random_element(),k.random_element()])
sage: time E.cardinality()
CPU times: user 0.00 s, sys: 0.02 s, total: 0.02 s
Wall time: 0.56
99999999985979523788
\end{lstlisting}
\end{frame}

\begin{frame}[fragile]
\frametitle{Elliptic Curve and $p$-adic BSD / Iwasawa Theory}
\begin{lstlisting}
sage: E = EllipticCurve('389a')

sage: L = E.padic_lseries(5)
sage: L.series(3)
O(5^5) + O(5^2)*T + (4 + 4*5 + O(5^2))*T^2 
   + (2 + 4*5 + O(5^2))*T^3 + (3 + O(5^2))*T^4 + O(T^5)

sage: E.padic_regulator(5,10)
5^2 + 2*5^3 + 2*5^4 + 4*5^5 + 3*5^6 + 4*5^7 
    + 3*5^8 + 5^9 + O(5^11)

sage: time E.padic_regulator(997,10)
CPU times: user 0.46 s, sys: 0.01 s, total: 0.47 s
740*997^2 + 916*997^3 + 472*997^4 + 325*997^5 + 697*997^6 
  + 642*997^7 + 68*997^8 + 860*997^9 + 884*997^10 + O(997^11)
\end{lstlisting}
\end{frame}

\begin{frame}[fragile]
\frametitle{Modular Symbols}
Sage has the most general implementation of modular symbols 
available, though much remains to be done:

\begin{lstlisting}

sage: M = ModularSymbols(GammaH(13,[3]), weight=4)
sage: print M.basis()
([X^2,(0,1)], [X^2,(0,7)], [X^2,(2,5)], [X^2,(2,8)], ...
sage: factor(charpoly(M.T(2)))
(x - 7) * (x + 7) * (x - 9)^2 * (x + 5)^2 
        * (x^2 - x - 4)^2 * (x^2 + 9)^2
sage: dimension(M.cuspidal_subspace())
12
sage: [a.dimension() for a in M.decomposition(3)]
[1, 1, 2, 2, 4, 4]

\end{lstlisting}

Will soon also have John Cremona's specialized but \emph{insanely fast} implementation for
weight 2 trivial character:
\begin{lstlisting}
sage: import sage.libs.cremona.homspace as jc
sage: time M = jc.ModularSymbolsSpace(20014)
CPU times: user 1.72 s, sys: 0.13 s, total: 1.84 s
sage: time t = M.hecke_matrix(2, convert=False)
CPU times: user 0.79 s, sys: 0.53 s, total: 1.33 s
\end{lstlisting}

\end{frame}

\begin{frame}[fragile]
\frametitle{Graph Theory: sometimes relevant to number theory}
\begin{itemize}
\item builds on NetworkX (Los Alamos's Python graph library)
\item graph isomorphism testing -- Robert Miller's new implementation
\item databases
\item 2d and 3d visualization
\end{itemize}
\begin{lstlisting}
sage: D = graphs.DodecahedralGraph()
sage: D.show3d()
\end{lstlisting}
\vspace{-2em}
\begin{center}
\includegraphics[width=0.4\textwidth]{dodec.png} 
\end{center}
\vspace{-3em}

\begin{lstlisting}
sage: E = D.copy()
sage: gamma = SymmetricGroup(20).random_element()
sage: E.relabel(gamma)
sage: D.is_isomorphic(E)
True
sage: D.radius()
5
\end{lstlisting}
\end{frame}

\begin{frame}[fragile]
\frametitle{Polynomial Arithmetic}
\begin{itemize}
\item Sage mostly currently uses NTL by default
\item Soon use FLINT extensively -- world's fastest univariate polynomial arithmetic for essentially
every bit size and degree (Bill Hart's and David Harvey). 
\end{itemize}
\begin{lstlisting}
sage: from sage.libs.flint.fmpz_poly import Fmpz_poly
sage: deg = 31; c=64
sage: f=Fmpz_poly([ZZ.random_element(2^c) for _ in [1..deg+1]])
sage: g=Fmpz_poly([ZZ.random_element(2^c) for _ in [1..deg+1]])
sage: time for _ in xrange(10^5): w = f*g
CPU time: 1.55 s,  Wall time: 1.67 s
\end{lstlisting}
\begin{itemize}
\item PARI takes 9.85 seconds to do the exact same computation.
\item Sage wrapping NTL takes 9.24 seconds
\item Magma takes 4.68 seconds
\end{itemize}


\begin{comment}

{{{id=6|
from sage.libs.flint.fmpz_poly import Fmpz_poly
}}}

{{{id=7|
deg = 2048; coeff=16
f = Fmpz_poly([ZZ.random_element(2^coeff) for _ in range(deg)])
g = Fmpz_poly([ZZ.random_element(2^coeff) for _ in range(deg)])
}}}

{{{id=8|
%time
for _ in xrange(10^3):
   w = f*g
///
CPU time: 2.31 s,  Wall time: 2.32 s
}}}

{{{id=9|
gp.eval('f = Pol(%s)'%f.list())
_ = gp.eval('g = Pol(%s)'%g.list())
}}}

{{{id=10|
%gp
gettime; for(i=1,10^3,w=f*g); gettime/1000.0
///
80.15800000000000000000000000
}}}

{{{id=18|
%magma
R<x> := PolynomialRing(IntegerRing());
}}}

{{{id=17|
magma.eval('f := R!%s'%f.list())
_ = magma.eval('g := R!%s'%g.list())
}}}

{{{id=16|
%magma
time for i in [1..10^3] do w := f*g; end for;
///
Time: 3.250
}}}

{{{id=15|
# Uses NTL
R.<x> = ZZ[]
ff = R(f.list())
gg = R(g.list())
}}}

{{{id=1|
time for i in xrange(10^3): w = ff*gg
///
CPU time: 5.70 s,  Wall time: 5.79 s
}}}
\end{comment}

\end{frame}

\begin{frame}[fragile]
\frametitle{Commutative Algebra}
\begin{itemize}
 \item Very fast basic arithmetic for multivariate polynomials over $\field{F}_q$.
 \item Fast Groebner basis computation and ideal operations
\end{itemize}
The Fateman benchmark:
\begin{lstlisting}
sage: P.<x,y,z> = PolynomialRing(GF(32003),3)
sage: p = (x + y + z + 1)^20 # the Fateman fastmult benchmark
sage: q = p + 1
sage: t = cputime()
sage: r = p*q
sage: cputime(t)
0.13
\end{lstlisting}
Magma takes 0.360 seconds to do the same calculation (both on linux 64-bit)
\end{frame}

\section{How ?}
\begin{frame} %wstein
\frametitle{History of Sage}
\begin{description}
\item[1997--1999] (\emph{Berkeley}) \emph{HECKE} – C++ (modular forms)
\item[1999--2005] (\emph{Berkeley}, \emph{Harvard}) I wrote over 25,000 lines of \emph{Magma} code. 
\item[] But the languages, devel models, and quality standards of Magma, Mathematica, and Maple are \emph{old-fashioned and painful}.
\item[] I need to be able to \emph{see inside and change anything} in my software 
in order to be the best in the world at my research.
\item[] {\dred For me, Magma is a bad long-term investment}.
\item[Feb 2005] I released \emph{SAGE-0.1} 
\item[Feb 2006] \emph{UCSD SAGE Days 1} workshop – SAGE 1.0.
\item[October 2006] \emph{U Washington SAGE Days 2} workshop.
\item[March 2007] \emph{UCLA SAGE Days 3} workshop.
\item[May 2007] First Sage NSF grant.
\item[June 2007] \emph{U Washington SAGE Days 4} workshop.
\item[October 2007] \emph{Clay Math Institute SAGE Days 5} workshop.
\item[Now] \emph{Heilbronn Institute SAGE Days 6}
\item[Now] \emph{SAGE-2.8.12}; well over \emph{100 contributors to SAGE}.
\end{description}
\end{frame}


\begin{frame}[fragile]
\frametitle{Do not reinvent the wheel:}
{\small
\begin{center}
\begin{tabular}{|l|l|}\hline
Arithmetic &	\emph{GMP, MPFR, Givaro}  \\\hline
Commutative Algebra &	\emph{SINGULAR}  (libSINGULAR) \\\hline
Linear Algebra &	\emph{LinBox, M4RI, IML, fpLLL}\\\hline
Cryptosystems & \emph{GnuTLS, PyCrypto}\\\hline
Integer Factorization & \emph{FLINT-QS, ECM}\\\hline
Group Theory &	\emph{GAP}\\\hline
Combinatorics & \emph{Symmetrica} \\\hline
Graph Theory &	\emph{NetworkX} \\\hline
Number Theory & \emph{PARI, NTL, FLINT, mwrank}\\\hline
Numerical Computation & \emph{GSL, Numpy, Scipy} \\\hline
Calculus, Symbolic Comp. &	\emph{Maxima, Sympy}  \\\hline
Lattice Polytopes & \emph{PALP} \\\hline
User Interface & Sage Notebook, \emph{jsmath, Moin wiki, IPython} \\\hline
Graphics &	\emph{Matplotlib, Tachyon, libgd, Java3d}   \\\hline
Networking & 	\emph{Twisted}  \\\hline
Databases & \emph{ZODB, SQLite}, Python Pickles  \\\hline
Programming Language & \emph{Python, Cython} (compiled) \\\hline
\end{tabular}
\end{center}
}
\end{frame}

\begin{frame}[fragile,allowframebreaks]
\begin{center}
\includegraphics[width=0.7\textwidth]{languages.png} 
\end{center}
A total of nearly 5 million lines of source code (several
hundred person-years).
\framebreak
\begin{center}
\includegraphics[width=0.7\textwidth]{packages.png}
\end{center}
\end{frame}

\begin{frame}[fragile]
\frametitle{SAGE: Lots of new code}

Unique lines of code and docstrings:
\begin{verbatim}
$ cat *.py */*.py ... */*/*/*.pxd |sort |uniq |wc -l
189082
\end{verbatim}

Unique input lines of autotested examples:
\begin{verbatim}
$ cat *.py */*.py ... */*/*/*.pxd | grep "sage:" 
             | sort |uniq |wc -l
26711
\end{verbatim}

Doctesting coverage:
\begin{verbatim}
$ sage -coverage .
...
Overall weighted coverage score:  34.3%
Total number of functions:  17424
\end{verbatim}

\end{frame}

\begin{frame}{MANY Upcoming Workshops}
\frametitle{MANY Upcoming Workshops}
\Large
\vfill
\begin{itemize}
\item {\dblue Jan 5--9, 2008:} Sage Days $6\frac{1}{4}$, AMS meeting in San Diego (booth, sprints)
\vfill
\item {\dblue Feb 5--9, 2008:} Sage Days 7, IPAM (confirmed and funded!)
\vfill
\item {\dblue Feb 29--March 4, 2008:} Sage Days 8, UT Austin -- \emph{Quadratic Forms}
\vfill
\item {\dblue June 2008:} Sage Days 9 in Seattle (tentative)
\vfill
\item {\dblue August 2008:} Sage Days 10 in Vancouver at SFU (tentative) -- 
organized by Nils Bruin
\vfill
\item And many more...
\end{itemize}

\end{frame}





\begin{frame}
\frametitle{Sage Development: Rapid but High Quality}
\Large
\begin{enumerate}
\item All enhancement proposals, bug reports and tasks are available
  on \url{http://trac.sagemath.org}.
  \vfill
\item All discussions happen in the open on {\dred public mailing lists} and
  on a public chat channel.
  \vfill
\item {\dred One stable release per week (!)} on average: release often, release early.
\vfill
\item Code is {\dred refereed}.
\vfill
\item Several different {\dred release managers}. 
\end{enumerate}
\end{frame}
%
%\begin{frame}
%\frametitle{Online Community}
%\Large
%\begin{description}
%\item[sage-devel] development discussions, 213 subscribers, ca. 800
%  messages per month
%\item[sage-support] support requests, 187 subscribers, ca. 200
%  messages per month
%\item[sage-forum] general discussions, 148 subscribers, low traffic
%\item[sage-newbie] basic questions about e.g. programming, 33
%  subscribers, low traffic
%\item[\#sage-devel] channel at irc.freenode.net; very busy during bug
%  squashes, usually at least two \SAGE developers around
%\end{description}
%\end{frame}

\section{Shortcomings and Advantages}

\begin{frame} %wstein
\frametitle{Shortcomings of Sage}
\Large
\begin{enumerate}
\item There are currently {\dred probably less than a thousand} serious users of \SAGE;
  our goal is to have ten thousand serious users by 2009.
  \vfill
\item \SAGE is {\dred not} of high enough quality yet.
\vfill
\item \SAGE is sometimes {\dred much slower} than Magma, Mathematica, etc. 
  \vfill
\end{enumerate}
\end{frame}

\begin{frame} %wstein
\frametitle{Advantages of Sage}
\Large
\begin{enumerate}

\item only general purpose mathematics software
  that {\dred uses a mainstream programing language}.
  \vfill

\item genuinely allows you to use Maple,
  Mathematica, Magma, etc., all {\dred together}.
  \vfill

\item {\dred more functionality out of the box} than any other open
  source mathematics software.
  \vfill

\item \SAGE has a {\dred large supportive and active community}:
 active mailing lists have well over 200 subscribers -- ``very positive vibe''
 \vfill

\item \SAGE development is {\dred done in the open}.
\vfill

\item \SAGE is sometimes {\dred much faster} than Magma, Mathematica, etc. 
\end{enumerate}
\end{frame}


\begin{frame}
\frametitle{A Quote from John Voight's MIT Talk Last Month}
\begin{block}{John Voight}
``Having seemingly eliminated every alternative, {\em we turn to SAGE.}
SAGE includes Pari, so it has number field arithmetic.  It uses Python,
which is a very friendly modern (object-oriented) programming language. It
is free. It incorporates Cython, which easily allows one to write optimized
C code for repeated tasks.
\vfill\vspace{1ex}
Despite being a relatively new system (so some functionality is limited),
since it is open source it is easy to contribute yourself. For example, Carl
Witty recently wrote a package for fast real root isolation. So even though
one must think about issues like how best to coerce between a C int, a
Python integer, and a SAGE Integer, there is a very active development
community willing to help!
\vfill\vspace{1ex}
It has the further advantage that there is a package for
\emph{distributed computing called DSage}...''
\end{block}
\end{frame}



% \begin{frame}[allowframebreaks]
% \frametitle{From John Voight's recent talk about Number Field Enumeration} 
% \begin{block}{Implementation: Pari versus Magma}
% \vfill
% {\bf Speed:} Speed is of the absolute essence--we are doing basic operations zillions of times. Maple and Mathematica cannot compete for this reason.
% \vfill\vspace{1ex}

% {\bf Number field arithmetic:} Bare C lacks number field arithmetic. Pari and
% Magma (based on KANT) do: For ``large examples'', Magma is by far the
% quickest (in our experience). However, in our situation, our
% polynomials are small and both systems have highly optimised
% algorithms for testing irreducibility and computing p-maximal orders.
% \vfill\vspace{1ex}

% {\bf Real root finding:} Magma also has amazingly fast real root finding; it
% is, however, a black box, and there is no fast Newton’s method! Pari
% only computes real roots and lets you to guess if a root is real or
% not.
% \vfill\vspace{1ex}

% {\bf Optimized code:} So it is up to us to implement a lightning fast
% Newton’s method! One can work with the Pari library in C to write
% optimized code. In Magma, one cannot do this without travelling to
% Sydney!
% \vfill\vspace{1ex}

% {\bf Cost:} Magma is not free, hence not on U Vermont machines. Pari is free.
% \vfill\vspace{1ex}

% {\bf Intuitive:} Despite the advantages of Pari as explained above, we find
% it to be often counterintuitive to use and to program.
% \end{block}

% \end{frame}


\begin{frame}[fragile]
\frametitle{Questions?}
\begin{tabular}{cc}
\begin{minipage}{0.7\textwidth}
\includegraphics[width=1.0\textwidth]{class_hierarchy.png}
\end{minipage}
& Thank You!  
\end{tabular} 
\end{frame}

\end{document}

