Sharedwww / talks / 2006-05-04-sage-uw-intro / current.texOpen in CoCalc
Author: William A. Stein
1
2
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3
% (c) William Stein
4
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5
6
\documentclass{beamer}
7
\usepackage{beamerthemesplit}
8
\usepackage{pgfpages}
9
10
%\pgfpagesuselayout{4 on 1}[letterpaper,landscape, border shrink=5mm]
11
%\setbeamercolor{background canvas}{bg=black!5}
12
13
\usepackage{graphicx}
14
\newcommand{\page}[1]{\frame{#1}}
15
16
\usepackage{amsmath}
17
\usepackage{amsfonts}
18
\usepackage{amssymb}
19
\usepackage{amsthm}
20
\usepackage{graphicx}
21
\usepackage{pstricks}
22
\usepackage{color}
23
\definecolor{dbluecolor}{rgb}{0,0,0.6}
24
\definecolor{dredcolor}{rgb}{.5,0.0,0.0}
25
\definecolor{dgreencolor}{rgb}{0,0.4,0}
26
\definecolor{blue}{rgb}{.02, .02, .908}
27
\newcommand{\dred}{\color{dredcolor}\bf}
28
\newcommand{\dblue}{\color{dbluecolor}\bf}
29
\newcommand{\dgreen}{\color{dgreencolor}\bf}
30
%\newcommand{\dred}{\bf}
31
%\newcommand{\dblue}{\bf}
32
%\newcommand{\dgreen}{\bf}
33
34
\usepackage{xspace} % to allow for text macros that don't eat space
35
\newcommand{\SAGE}{{\color{blue}\sf SAGE}\xspace}
36
\newcommand{\sage}{\SAGE}
37
38
\newcommand{\graph}[1]{\includegraphics[width=0.45\textwidth]{#1}}
39
40
\title{SAGE: Software for Algebra and Geometry Experimentation}
41
\author{William Stein}
42
\date{May 4, 2006: UW SAGE Seminar\vspace{4ex}\\\includegraphics[width=1.5in]{icon-5}}
43
\bibliographystyle{amsalpha}
44
\newcommand{\Q}{\mathbb{Q}}
45
\newcommand{\Z}{\mathbb{Z}}
46
\newcommand{\defn}[1]{{\em #1}}
47
% ---- SHA ----
48
\DeclareFontEncoding{OT2}{}{} % to enable usage of cyrillic fonts
49
\newcommand{\textcyr}[1]{%
50
{\fontencoding{OT2}\fontfamily{wncyr}\fontseries{m}\fontshape{n}%
51
\selectfont #1}}
52
\newcommand{\Sha}{{\mbox{\textcyr{Sh}}}}
53
\DeclareMathOperator{\rank}{rank}
54
\DeclareMathOperator{\Vis}{Vis}
55
\DeclareMathOperator{\HH}{H}
56
\DeclareMathOperator{\Ker}{Ker}
57
\DeclareMathOperator{\ord}{ord}
58
\renewcommand{\H}{\HH}
59
\newcommand{\hra}{\hookrightarrow}
60
\newcommand{\isom}{\cong}
61
\newcommand{\ds}{\displaystyle}
62
\renewcommand{\t}[1]{\begin{center}{\large{\dblue #1}}\end{center}}
63
64
65
\begin{document}
66
67
\page{
68
\maketitle
69
}
70
71
\begin{frame}[fragile]
72
\t{What is SAGE?} I started SAGE in early 2005, and it has since
73
mushroomed. There are now dozens of contributors all over the world
74
and an extremely active mailing list. \vfill
75
\begin{enumerate}
76
\item {\dblue Completely \underline{free} and open source.}
77
\vfill
78
79
\item {\dblue A new computer algebra system.} Uses a
80
{\em mainstream} language (unlike Magma, Gap, {\dred Mathematica},
81
{\dred Maple}, etc.)
82
\vfill
83
84
\item {\dblue A new way to use your software.} Use {\em all} your
85
favorite ({\dred commercial} or free) mathematics software
86
{\em together}.
87
\end{enumerate}
88
\vfill
89
\end{frame}
90
91
92
93
\begin{frame}
94
\t{Does Open Source Matter for Math Research?}
95
\small
96
``You can read Sylow's Theorem and its proof in Huppert's book in the
97
library [...] then you can use Sylow's Theorem for the rest of your
98
life free of charge, but for many computer algebra systems license
99
fees have to be paid regularly [...]. You press buttons and you get
100
answers in the same way as you get the bright pictures from your
101
television set but you cannot control how they were made in either
102
case.
103
\vspace{2ex}
104
105
With this situation {\dred two of the most basic rules of conduct in
106
mathematics are violated}: In mathematics {\dblue information is passed on
107
free of charge} and {\dblue everything is laid open for checking}. Not applying
108
these rules to computer algebra systems that are made for mathematical
109
research [...] means {\dred moving in a most undesirable direction}.
110
Most important: Can we expect somebody to believe a result of a
111
program that he is not allowed to see? ''
112
113
\vspace{2ex}
114
115
-- J. Neub\"user in {\bf\LARGE 1993} (he started GAP in 1986).
116
\end{frame}
117
118
119
120
\begin{frame}[fragile]
121
\t{SAGE: A New Computer Algebra System}
122
\begin{verbatim}
123
algebras edu interfaces modular schemes
124
categories ext lfunctions modules sets
125
coding functions libs monoids structure
126
crypto geometry matrix plot tests
127
databases groups misc rings
128
129
$ cat */*.py */*/*.py */*/*/*.py */*.pyx */*/*.pyx |sort|uniq|wc -l
130
58858
131
132
$ cat */*.py */*/*.py */*.pyx */*/*.pyx |sort|uniq|grep "sage: " | wc -l
133
6845 <-------- EXAMPLE INPUT LINES!
134
\end{verbatim}
135
\end{frame}
136
137
\page{
138
\t{Cooperation: ``Everything Under One Roof''}
139
\SAGE has many interfaces ({\dblue bold included} with \sage):\mbox{}
140
141
\begin{itemize}
142
\item {\dblue GAP} (started 1986)-- groups, discrete math
143
\item {\dblue Singular} (started 1987) -- polynomial computation
144
\item {\dblue PARI/GP} (started 1987) -- number theory
145
\item {\dblue Maxima} (started 1967) -- symbolic manipulation
146
\item {\dblue mwrank, ec, simon, sea} -- elliptic curves
147
\item Macaulay2 (started 1993) -- (soon to be included)
148
\item KANT/KASH -- sophisticated algebraic number theory
149
\item Magma (started 1973) -- high-quality research math environment
150
\item Maple -- symbolic, educational
151
\item Mathematica -- symbolic, numerical, educational
152
\item Octave (started 1992) -- numerical analysis
153
\item Specialized: {\blue mwrank, gfan, sympow, ntl, genus2reduction, polymake,
154
lcalc (Rubinstein), dokchitser; more to come...!}
155
\end{itemize}
156
}
157
158
\begin{frame}
159
\t{Python: A Mainstream Programming Language}
160
\begin{itemize}
161
\item Guido van Rossum released first Python in 1991.
162
\item A {\dblue ``gluing language''}, i.e., design to be
163
easier to use libraries and other programs.
164
\item {\dblue VAST range of libraries}: graphics, 3d simulation,
165
web programming, numerical analysis, etc.
166
\item {\dblue Easy to read} code
167
\item {\tt function?} gives documentation about function
168
and {\tt function??} gives the {\bf source code}.
169
\item {\dblue IPython:} Awesome!
170
\end{itemize}
171
\mbox{}\hspace{3in}\includegraphics[width=1in]{guido}
172
\end{frame}
173
174
175
\begin{frame}
176
\t{Pyrex: Compiled Python-like language}
177
\vfill
178
\begin{enumerate}
179
\item Written by {\dred Greg Ewing} of New Zealand.
180
\vfill
181
\item Code converted to C code that
182
is {\dred compiled by a C compiler}.
183
\vfill
184
\item Easy to use C/C++ code and libraries from Pyrex.
185
\vfill
186
\item {\dred Time-critical} \sage code gets implemented
187
in Pyrex, which is (as fast as) C code, but easier
188
to read (e.g., since all variables and scopes are explicit).
189
\end{enumerate}
190
\end{frame}
191
192
\begin{frame}[fragile]
193
\t{Examples: Using other systems...}
194
{\small \begin{verbatim}
195
sage: mathematica('N[Gamma[Pi + I]]') # optional
196
1.0302984069822916 + 1.602604587678414*I
197
sage: G = mathematica('Plot3D[Sin[x]*Cos[y],{x,2,10},{y,2,10}]');
198
sage: G.show();
199
200
sage: gp.zeta(2) # number theory
201
1.644934066848226436472415167
202
sage: gp.factor(2006)
203
[2, 1; 17, 1; 59, 1]
204
205
sage: f = maxima('x*sin(x)^2').integral('x'); f # calculus
206
-(2*x*sin(2*x) + cos(2*x) - 2*x^2)/8
207
208
sage: maple.eval('solve({ 2*x + 3*y = 1, 3*x + 5*y = 1 })')
209
{y = -1, x = 2}
210
211
\end{verbatim}
212
}
213
\end{frame}
214
215
\begin{frame}[fragile]
216
\t{Linear Algebra}
217
{\small \begin{verbatim}
218
sage: A = MatrixSpace(QQ,3)([1,2,3, 4,5,6, 8,10,12]); A
219
[ 1 2 3]
220
[ 4 5 6]
221
[ 8 10 12]
222
sage: A.charpoly().factor()
223
x * (x^2 - 18*x - 15)
224
225
sage: V = QQ^3
226
sage: E = End(V); t = E(A); t
227
Free module morphism defined by the matrix
228
[ 1 2 3]
229
[ 4 5 6]
230
[ 8 10 12]
231
Domain: Vector space of dimension 3 over Rational Field
232
Codomain: Vector space of dimension 3 over Rational Field
233
234
sage: print latex(A)
235
\left(\begin{array}{rrr}
236
1&2&3\\ 4&5&6\\ 8&10&12
237
\end{array}\right)
238
\end{verbatim}}
239
\end{frame}
240
241
\begin{frame}[fragile]
242
\t{Algebraic and Combinatorial Geometry}
243
\begin{verbatim}
244
sage: P.<x,y,z,w> = ProjectiveSpace(3,QQ)
245
sage: C = P.subscheme([y^2-x*z, z^2-y*w, x*w-y*z])
246
sage: len(C.irreducible_components()) # twisted cubic
247
1
248
sage: J = C.defining_ideal()
249
sage: G = J.groebner_fan()
250
sage: len(G.reduced_groebner_bases())
251
8
252
sage: G.fvector()
253
(1, 8, 8)
254
sage: f = prod(J.gens()) # \/-- newton polytope
255
sage: NP = polymake.convex_hull(f.exponents())
256
sage: NP.facets()
257
[(3/2, 5/2, -1, 0), (3, 1, -1, 0), (1, 0, 0, 0),
258
(-3/2, 2, 1, 0), (3, -1, 4, 0), (-3, 1, 5, 0)]
259
\end{verbatim}
260
\end{frame}
261
262
\begin{frame}[fragile]
263
\t{Latex (typesetting)}
264
Any object has a latex representation:
265
{\small \begin{verbatim}
266
sage: R.<t> = PowerSeriesRing(QQ, 't')
267
sage: f = 1/(1-t)
268
sage: f
269
1 + t + t^2 + t^3 + t^4 + t^5 + t^6 + t^7 + t^8 + t^9 +
270
t^10 + t^11 + t^12 + t^13 + t^14 + t^15 + t^16 +
271
t^17 + t^18 + t^19 + O(t^20)
272
sage: print latex(f)
273
1 + t + t^{2} + t^{3} + t^{4} + t^{5} + t^{6} + t^{7}
274
+ t^{8} + t^{9} + t^{10} + t^{11} + t^{12} + t^{13}
275
+ t^{14} + t^{15} + t^{16} + t^{17} + t^{18}
276
+ t^{19} + \cdots
277
sage: view(f)
278
\end{verbatim}}
279
{\tiny $$
280
1 + t + t^{2} + t^{3} + t^{4} + t^{5} + t^{6} + t^{7} + t^{8} + t^{9} + t^{10} + t^{11} + t^{12} + t^{13} + t^{14} + t^{15} + t^{16} + t^{17} + t^{18} + t^{19} + \cdots
281
$$}
282
\end{frame}
283
284
\begin{frame}[fragile]
285
\t{Number Theory: Image of a line segment under $L(E,s)$}
286
\begin{verbatim}
287
sage: E = EllipticCurve('37a')
288
sage: v = E.Lseries_values_along_line(1, 1+10*I, 300)
289
sage: w = [(z[1].real(), z[1].imag()) for z in v]
290
sage: L = line(w, rgbcolor=(0.5,0,0))
291
sage: L.save('line.png')
292
\end{verbatim}
293
\includegraphics[width=5in,height=2.7in]{segimg}
294
\end{frame}
295
296
\begin{frame}[fragile]
297
\t{Saving and Loading Individual Objects}
298
299
Most objects in \sage can easily be loaded and saved
300
in a compressed format. (This is a standard feature of Python!)
301
\begin{verbatim}
302
sage: V = VectorSpace(QQ, 5)
303
sage: W = V.submodule([[1,2,3,4,5],[2,3,4,5,3]]); W
304
Vector space of degree 5 and dimension 2 over Rational Field
305
Basis matrix:
306
[ 1 0 -1 -2 -9]
307
[ 0 1 2 3 7]
308
sage: W.save('W')
309
...quit... and restart
310
sage: load('W')
311
Vector space of degree 5 and dimension 2 over Rational Field
312
Basis matrix:
313
[...]
314
\end{verbatim}
315
\end{frame}
316
317
\begin{frame}
318
\t{SAGE: The Future}
319
\begin{center}
320
\includegraphics[width=0.8\textwidth]{pics/img_1107}\\
321
\end{center}
322
\begin{itemize}
323
\item August 2006: {\dred MSRI grad student Workshop} on Computing
324
with Modular Forms (with SAGE).
325
\item October 7-8, 2006: {\dred SAGE Days 2} HERE!!
326
\item UW {\em startup money}: Generous financial support for SAGE
327
development (hiring a team of {\dblue students}).
328
\item {\dred SAGE users} are coauthors/developers of SAGE.
329
\end{itemize}
330
\end{frame}
331
332
\begin{frame}
333
\vfill
334
\t{Alex Clemesha}
335
\t{Graphics Demo}
336
\vfill
337
\end{frame}
338
339
\begin{frame}
340
\t{Web site}
341
\begin{center}
342
(give a live tour)
343
\end{center}
344
\end{frame}
345
346
\begin{frame}
347
\t{Getting Involved: A specific list of projects}
348
\begin{itemize}
349
\item {\dred HNF over $k[x]$:} Implement Hermite Normal Form (echelon form) for
350
polynomial rings over a field
351
\item {\dred Integer Factorization:}
352
Make a wrapper so can use amazing ECM program easily from SAGE.
353
\item {\dred Auto-tested docs:} a function without examples is broken.
354
\item {\dred Lie Algebras:} Add LIE to SAGE (http://young.sp2mi.univ-poitiers.fr/~marc/LiE/)
355
\item {\dred Randomized automated testing:} Devious code.
356
\item {\dred Linear algebra:} very fast over finite fields / QQ, etc ?
357
\item {\dred Easy:} If $f$ is a maxima-defined function, implement $f(x)$.
358
\item And {\em much} more!
359
\end{itemize}
360
\end{frame}
361
362
\end{document}
363
364