All published worksheets from http://sagenb.org
Image: ubuntu2004
Creating an Open Source Alternative to
Magma, Maple, Mathematica, and MATLAB
William Stein, Professor of Mathematics, University of Washington
Mission Statement
Create an open source alternative to Magma, Maple, Mathematica, and Matlab.
Firefox <--> Internet Explorer, Opera Open Office, Latex <--> Microsoft Office Linux <--> Microsoft Windows PostgreSQL, MySQL <--> Oracle, Microsoft SQLserver GIMP <--> Photoshop Sage <--> Magma, Maple, Mathematica, Matlab |
History of Sage
- I started Sage at Harvard in January 2005.
- Sage-1.0 released February 2006 at Sage Days 1 (UC San Diego).
- Nearly 30 Sage Days Workshops (!) at UCLA, UW, Cambridge, Bristol, Austin, France, San Diego, Seattle, MSRI, ..., Barcelona, ...
- Sage won first prize in the Trophees du Libre (November 2007)
- Funding from Microsoft, Univ of Washington, UC San Diego, NSF, DoD, Google, Sun, private donations, etc.
- Hundreds of other people subsequently got involved in Sage's development, and the scope of the project has widened to cover all mathematical computation. There is interest from all areas of mathematics, physics, engineering, etc. (Developer mailing list has 1184 subscribers and about 50 messages/day... and sage-support has 1718 subscribers.)
- About 8,000 downloads per month. (Probably most users do not download sage themselves.)
What is Sage?
- Sage = Python + Math
- A unified self-contained distribution of open source mathematical software.
- Nearly a half million lines of new Python (and Cython) code/documentation that implements new capabilities and algorithms.
- Over 100,000 lines of automated tests.
- A "cloud" application like GMail or Google Docs: http://sagenb.org (over 33,000 accounts); of course, Sage also runs on your desktop.
Tour of the http://sagemath.org website
- Google page search
- Documentation
- Live Chat: http://sagemath.org/help-irc.html
- Downloading and Installing Sage
- Developer map
Sage is about building the car instead of reinventing the wheel
- Sage uses Python, a mainstream programming language, instead of inventing a custom mathematics language
- Use straightforward method to link programs together -- C library and pseudotty's, instead of XML servers/OpenMath. We implement all conversion routines, instead of expecting upstream to do it: we make them communicate with Sage, whether they want to or not.
- Give copious credit to contributors and be very developer friendly (easily build from source).
- Reuse, improve, and contribute to existing libraries and projects (e.g., Scipy, Numpy, R, ATLAS, CVXopt, GSL), instead of starting over and competing with them.
- Make the GUI using a web browser: the world of Java and Javascript is available and Sage integrates with the web.
And now a demo...
Interfaces
The following opens a single persistent running copy of Mathematica:
Lisp, Gap, etc.
Moving from Mathematica to Maple (via Sage):
You can also open a connection to a remote copy of Mathematica (or Maple, etc.):
The above just happened in Seattle. But otherwise it is nearly indistinguishable from working locally.
Very Big Numbers
Very big numbers: In less than a second, Sage exactly computes , which has over 5 million digits.
Multiplying huge numbers is also fast:
and a matrix with a big determinant:
Symbolic Calculus
Sage does Calculus:
Graph Theory
Sage can do graph theory:
Sage contains many unique and deep algorithms:
Statistics
Sage includes R, scipy.stats, and GSL (=Gnu Scientific Library).
There is also a C library interface to R:
Scipy is a large Python library included in Sage with statistics functions:
GSL is a C library in Sage, which also has a lot of highly optimized statistical functions. It can only be used from Cython, though.
Sage also has its own native statistics functionality:
Sage has a new Generalized Hidden Markov Models Library.
This is a complete new implementation in Sage -- useful for math biology, computer learning, etc.:
Fortran!
Example here: http://sagenb.org/home/pub/1708/
Matrices
Exact linear algebra: great support for very sophisticated algorithms over , finite fields, , etc.
And numerical linear algebra:
Very Deep, Cutting Edge Mathematics
- Number theory
- Combinatorics
- Algebraic topology
Number theory - Verify that the 5-part of the Shafarevich-Tate group of a rank 2 curve is trivial:
Algebraic topology -- Examples of computing homology groups:
FemHub -- a customized Sage
See http://femhub.org/
3-Dimensional Plots
Sage can draw 3d plots:
Sage can plot Yoda:
And if you're really serious, the language of Sage is Python, so you can also use:
- Mayavi: Python interface to VTK
- Chaco: interact 2d graphics system developed at Enthought (local Austin company)
- VisIt: https://wci.llnl.gov/codes/visit/manuals.html (python bindings)
- ParaView: http://www.cmake.org/Wiki/ParaView/Python_Scripting
- VPython: http://vpython.org/
- PyGame: http://www.pygame.org/news.html
Key take-away points:
- FOSS: 100% free open source GPL software: good for clusters, sharing, research, collaboration
- Python: mainstream, scientific-computing friendly programming language
- Cython: optimized Python to C/C++ compiler we develop with support for C/C++ datatypes
- Interfaces: to control Matlab, Octave, Mathematica, etc., from Sage
- Self contained: can have many copies of Sage at once, so no "dependency hell"
- Peer reviewed: get your code refereed
- Web based: notebook interface
Questions?