Mission, history Design, development Features, demo SageTEX, pretty pictures
Sage for fun and profit
John H. Palmieri
Department of Mathematics University of Washington
Sage Days 40, July 9, 2012 IMA, Minneapolis Mission, history Design, development Features, demo SageTEX, pretty pictures Sage
Sage’s mission: Creating a viable free open source alternative to MagmaTM , MapleTM , MathematicaTM , and MatlabTM . In detail: free free open-source open-source Mission, history Design, development Features, demo SageTEX, pretty pictures History
Sage project began by William Stein in 2005: SAGE=“Software for Arithmetic Geometry Experimentation.” See http://wstein.org/mathsoftbio for William Stein’s reminiscences about the early history of Sage. Quickly expanded beyond number theory; attracted more users, developers, funding sagenb.org now has over 90,000 accounts. Sage-Combinat: began migration from MuPAD to Sage in 2008 Mission, history Design, development Features, demo SageTEX, pretty pictures Design
Sage is built around Python, a mainstream general-purpose programming language (with a compiler: Cython) Sage includes about 100 “Sage packages” (a.k.a. spkgs), including many existing open-source packages: (partial list from Nicolas Thi´ery) ATLAS Automatically Tuned Linear Algebra Software BLAS Basic Fortan 77 linear algebra routines Bzip2 High-quality data compressor Cddlib Double Description Method of Motzkin Common Lisp Multi-paradigm and general-purpose programming lang. CVXOPT Convex optimization, linear programming, least squares Cython C-Extensions for Python F2c Converts Fortran 77 to C code Flint Fast Library for Number Theory FpLLL Euclidian lattice reduction FreeType A Free, High-Quality, and Portable Font Engine (partial list from Nicolas Thi´ery) GAP Groups, Algorithms, Programming GD Dynamic graphics generation tool Genus2reduction Curve data computation Gfan Gr¨obnerfans and tropical varieties Givaro C++ library for arithmetic and algebra GMP GNU Multiple Precision Arithmetic Library GMP-ECM Elliptic Curve Method for Integer Factorization GNU TLS Secure networking GSL Gnu Scientific Library JsMath JavaScript implementation of LaTeX (partial list from Nicolas Thi´ery) IML Integer Matrix Library IPython Interactive Python shell LAPACK Fortan 77 linear algebra library Lcalc L-functions calculator Libgcrypt General purpose cryptographic library (partial Libgpg-error Common error values for GnuPG components Linbox C++ linear algebra library Matplotlib Python plotting library Maxima computer algebra system Mercurial Revision control system list from Nicolas Thi´ery) MPFI Multiple Precision Floating-point Interval library MPFR C library for multiple-precision floating-point computations ECLib Cremona’s Programs for Elliptic curves NetworkX Graph theory NTL Number theory C++ library Numpy Numerical linear algebra OpenCDK Open Crypto Development Kit PALP A Package for Analyzing Lattice Polytopes PARI/GP Number theory calculator Pexpect Pseudo-tty control for Python PNG Bitmap image support (partial list from Nicolas Thi´ery) PolyBoRi Polynomials Over Boolean Rings PyCrypto Python Cryptography Toolkit Python Interpreted language Qd Quad-double/Double-double Computation Package R Statistical Computing Readline Line-editing Rpy Python interface to R Scipy Python library for scientific computation Singular fast commutative and noncommutative algebra Scons Software construction tool SQLite Relation database (partial list from Nicolas Thi´ery) Sympow L-function calculator Symmetrica Representation theory Sympy Python library for symbolic computation Tachyon lightweight 3d ray tracer Termcap for writing portable text mode applications Twisted Python networking library Weave Tools for including C/C++ code within Python Zlib Data compression library ZODB Object-oriented database Mission, history Design, development Features, demo SageTEX, pretty pictures Design
Sage provides a common front end to all of these packages, so you don’t even know that you’re using them.
This is not always a good thing.
sage: EllipticCurve([0,0,1,-1,0]).sha()
This computes the Tate-Shafarevich group of a certain elliptic curve. What components of Sage are used to do this?
sage: from sage.misc.citation import get_systems sage: get_systems("EllipticCurve([0,0,1,-1,0]).sha()") [’PARI’, ’Singular’, ’MPFR’, ’ginac’] Mission, history Design, development Features, demo SageTEX, pretty pictures Development
Large and active development community World-wide: http://sagemath.org/development-map.html Google groups sage-devel, sage-combinat-devel, etc. Web site: http://trac.sagemath.org/sage_trac IRC channel “sagemath” Every change to Sage is peer-reviewed (not anonymously) Mission, history Design, development Features, demo SageTEX, pretty pictures Features
A quick demo. Documentation: the reference manual is over 7500 pages long, plus 900 more pages for other documents. . . SageTEX Mission, history Design, development Features, demo SageTEX, pretty pictures SageTEX
\sageplot{plot(sin(1/x^2), (x,.1,.5))}
1
0.5
0 0.1 0.2 0.3 0.4 0.5
-0.5
-1 Mission, history Design, development Features, demo SageTEX, pretty pictures SageTEX
\begin{sagesilent} t = Tachyon(camera_center=(8.5,5,5.5), look_at=(2,0,0), raydepth=6, xres=1500, yres=1500) t.light((10,3,4), 1, (1,1,1)) t.texture(’mirror’, ambient=0.05, diffuse=0.05, specular=.9, opacity=0.9, color=(.8,.8,.8)) t.texture(’grey’, color=(.8,.8,.8), texfunc=1) ## try other values of texfunc! t.plane((0,0,0),(0,0,1),’grey’) t.sphere((4,-1,1), 1, ’mirror’) t.sphere((0,-1,1), 1, ’mirror’) t.sphere((2,-1,1), 0.5, ’mirror’) t.sphere((2,1,1), 0.5, ’mirror’) \end{sagesilent}
\sageplot{t}
yields Mission, history Design, development Features, demo SageTEX, pretty pictures SageTEX Mission, history Design, development Features, demo SageTEX, pretty pictures
Of course, Sage is huge, and I’ve barely scratched the surface. If you’re new to Sage, work through the tutorial., and also take a tour of http://www.sagemath.org some time. I’ll also mention Sage-edu: an active community of mathematicians incorporating Sage into teaching. (Sage Education Days, textbooks, WebWorks, . . . ) Also look into http://aleph.sagemath.org and the Sage app for smartphones. Finally, since I’m a topologist, I will end with this: http://www.nilesjohnson.net/hopf.html. Every frame of this movie was made using Sage, and then the frames were animated with FFmpeg.