%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% (c) William Stein
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\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{SAGE?}
\author{William Stein}
\date{February 4, 2006\vspace{4ex}\\\includegraphics[width=0.8in]{icon-5.png}}
\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]
\vfill
\t{A Quote from the \sage Mailing List on Thursday, Feb 2}
\vfill
\begin{verbatim}
Dear SAGE community.
My name is Tiziano and I'm from Italy. I'm
writing this mail first of all because I would
like to thank you all for SAGE. It's something
the world was really missing.
[Every free computer algebra system I've tried
has] ``reinvented many times the wheel without
being able to build the car.''
\end{verbatim}
\vfill
{\Large But what is \sage?}
\end{frame}
\begin{frame}[fragile]
\t{Another Email...}
\begin{verbatim}
Dear William,
[...] I think that you are doing a superb work
with Sage, and thank you for it.
Best,
Henri [Cohen] (GP/PARI founder)
\end{verbatim}
{\Huge OK, but what is \sage?}
\end{frame}
\page{
\t{My Story}
\begin{itemize}
\item 1997-98: Hecke and interpreter in C++ (based on other code); for
modular forms research with Buzzard and Mazur.
\item 1998: D. Kohel: ``too bad you have to write interpreter''; vast amount of
Magma code
\item 1998: A. Steel: 2 days in Berkeley teaching me Magma
\item 1999-2004: I wrote {\dblue heaps} of Magma code (3
Sydney visits)
\item 2000: M. Stoll--``Magma -- Everything under one roof''
\item 2004: {\dred Frustration}: Magma is closed source, closed development
model, and expensive; authorship issues; no user-defined objects; hard
to save/load data (no eval command) --
not a {\dblue mainstream} language.
\end{itemize}
}
\page{
\begin{itemize}
\item S. Hillion -- I use Python greatly in my job.
\item Nov 2004: Gonzalo Tornaria (Austin)-- ``if I come up with a new algorithm
what should I implement it in?''
\item Jan 2005: D. Joyner -- winter AMS meeting; SAGE 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,
and many others...}
\item And here we are.
\end{itemize}
}
\begin{frame}[fragile]
\t{SAGE Has {\Huge 3} {\dred Distinct} Complementary Goals}
\begin{enumerate}
\item A {\dblue distribution} of free open source mathematics software.
\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}.
\end{enumerate}
\end{frame}
\page{
\t{1. Distribution of Free Open Source Software}
\begin{itemize}
\item Free self-contained distribution of the very best
open source math software that has an
{\em active} community.
\item \sage tarball: about 39MB; {\em all} GPL or compatible;
{\bf you} can change anything, rebuild, make any changed
versions available, can fork \sage and make your
own variant.
\item Type {\tt sage -sdist } to make distro from your local
modified version of sage. Type {\tt sage -bdist } to make
a binary.
\end{itemize}
}
\begin{frame}
\t{Does Open Source Matter for Math Research?}
\small
``You can read Sylow's Theorem and its proof in Huppert's book in the
library [...] then you can use Sylow's Theorem for the rest of your
life free of charge, but for many computer algebra systems license
fees have to be paid regularly [...]. You press buttons and you get
answers in the same way as you get the bright pictures from your
television set but you cannot control how they were made in either
case.
\vspace{2ex}
With this situation {\dred 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. Not applying
these rules to computer algebra systems that are made for mathematical
research [...] means {\dred moving in a most undesirable direction}.
Most important: Can we expect somebody to believe a result of a
program that he is not allowed to see? Moreover: Do we really want to
charge colleagues in Moldava several years of their salary for a
computer algebra system?
\vspace{2ex}
-- J. Neub\"user in {\bf\LARGE 1993} (he started GAP in 1986).
\end{frame}
\page{
\t{Not-included and Why}
\begin{enumerate}
\item {\dblue Macaulay2} -- I can't compile it with modern libraries, even
after many many hours trying; I'd {\em really} like to use
it in SAGE.
\item {\dblue Gnuplot} -- screwy license (e.g., I 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]
\t{2. A New Computer Algebra System}
\begin{verbatim}
$ ls
algebras databases __init__.py modular schemes
all.py edu interfaces modules sets
categories ext libs monoids structure
coding functions matrix plot tests
crypto groups misc rings version.py
$ cat */*.py */*/*.py | sort | uniq | wc -l
36956
\end{verbatim}
\end{frame}
\page{
\t{3. Cooperation -- Everything Under One Roof}
\SAGE has many interfaces ({\dblue bold included} with \sage):\mbox{}
\begin{itemize}
\item {\dblue GAP} -- groups, discrete math
\item {\dblue Singular} -- polynomial computation
\item {\dblue PARI/GP} -- number theory
\item {\dblue Maxima} -- symbolic manipulation
\item {\dblue mwrank, ec, simon, sea} -- elliptic curves
\item Gnuplot -- 2d and 3d graphics
\item KANT/KASH -- very sophisticated algebraic number theory
\item Magma -- vast high-quality research math environment
\item Maple -- symbolic, educational
\item Mathematica -- symbolic, numerical, educational
\item Octave -- numerical
\end{itemize}
}
\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 IPython: Wonderful Interactive Shell
\item Python: A {\dred Mainstream} Programming Language (many books;
numerous excellent tutorials; constantly being improved by
dozens of developers)
\item Pyrex: {\dred Compiled} Python-Like Extension Language
\item Saving and Loading Objects ({\dblue ZODB} and cPickle)
\end{enumerate}
}
\page{
\t{1. IPython: Wonderful Interactive Shell}
\vspace{2em}
\begin{center}
The author is right here.\\
\vspace{2em}
{\LARGE Go to his talk at 3pm today!}
\end{center}
}
\page{
\t{2. Python: A Mainstream Programming Language}
\begin{itemize}
\item 1991: Guido van Rossum--Dutchman (now at Google)
\item {\dblue Numerous libraries} available for networking,
graphics, video game programming, numerical analysis, etc.
\item Designed to be a {\dblue gluing language} (unlike many languages)
\item {\dblue Easy to read} other people's code (unlike, e.g., Perl, C++)
\item {\dblue Free} and {\dred open source} (unlike, e.g., Java)
\item From Python Advocacy FAQ:
\begin{itemize}
\item Run Web sites
\item Write GUI interfaces
\item Control number-crunching code on supercomputers
\item Build test suites for C or Java code
\end{itemize}
\end{itemize}
}
\begin{frame}
\begin{center}
\includegraphics{guido.jpg}\\
Guido van Rossum
\end{center}
\end{frame}
\begin{frame}[fragile]
\t{3. Pyrex: Compiled Python-Like Extension Language}
\begin{verbatim}
def factorial(n):
cdef mpz_t f
cdef int i
cdef char* s
mpz_init(f)
mpz_set_si(f, n)
for i from 2 <= i <= n:
mpz_mul_si(f, f, i)
s = mpz_get_str(NULL, 16, f)
r = int(s,16)
free(s)
return r
\end{verbatim}
\end{frame}
\begin{frame}
\t{Pyrex is {\dred CRUCIAL} to Success of \SAGE}
\begin{enumerate}
\item Written by Greg Ewing of New Zealand.
\item Code converted to ``human-readable'' C code that
is compiled by a C compiler.
\item Can use any Python functions and objects from
Pyrex and any C libraries.
\item Time-critical \sage code gets implemented
in Pyrex, which is (as fast as) C code, but easier
to read (e.g., since all variables and scopes are explicit).
\end{enumerate}
\end{frame}
\begin{frame}[fragile]
\t{Pyrex Really Works (very robust)!}
\begin{verbatim}
sage: time n=factorial_pure_python(100000)
CPU times: user 78.72 s, sys: 2.64 s, total: 81.37 s
Wall time: 94.89
sage: time n=factorial_ZZ(100000)
CPU times: user 8.56 s, sys: 2.22 s, total: 10.79 s
Wall time: 10.83
MAGMA> time n := Factorial(100000); # MAGMA V2.12-10
Time: 9.030
sage: time n = factorial(100000)
CPU times: user 6.93 s, sys: 0.00 s, total: 6.93 s
Wall time: 6.95
\end{verbatim}
\end{frame}
\begin{frame}[fragile]
\t{4. 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}
\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 (Steven Sivek?)
\end{enumerate}
}
\begin{frame}
\t{Attribution}
\begin{itemize}
\item Whenever possible, files, function docs, and the reference
manual {\dblue state clearly who the author is}.
\item All new code submitted to \sage must be under a GPL compatible
license. Author may optionally keep copyright.
\item {\dgreen Citation:}
William Stein and David Joyner, \emph{SAGE: System for algebra and geometry
experimentation}, Communications in Computer Algebra (SIGSAM Bulletin) (July
2005), {\tt http://sage.sourceforge.net/}.
\item {\dblue VERY Important!} Always cite the underlying backends used
by \sage for your work, e.g., GAP, Singular, PARI, Kash, etc. Ask in
\sage forum and/or use {\tt function??} to view source.
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\t{Example: Came up in work on Birch \& Swinnerton-Dyer}
\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}
\begin{frame}[fragile]
\begin{verbatim}
\end{verbatim}
\end{frame}
\begin{frame}
\end{frame}
\end{document}