Because SAGEis a new system, we begin by explaining the main longterm
goals for SAGE. These have not all been attained, though
authors have done much since work on SAGEstarted in 2004.
- Efficient: Be very fast - comparable to or faster than
anything else available. This is very difficult, since many systems
are closed source, algorithms are sometimes not published, and
finding fast algorithms is often extremely difficult (years of work,
Ph.D. theses, luck, etc.).
- Free and open source: The source code must be freely
available and readable, so users can understand what the system is
really doing and more easily extend it. Just as mathematicians gain
a deeper understanding of a theorem by carefully reading or at least
skimming the proof, people who do computations should be able to
understanding how the calculations work by reading documented source
code.
- Easy to compile: SAGEshould be relatively easy to compile
from source for Linux and OS X users. This provides more
flexibility in modifying the system.
- Comprehensive:
Implement enough algorithms to be really useful.
- Tools: Provide robust interfaces to some of the
functionality of PARI, GAP, GMP, Macaulay 2, mwrank, and NTL. These
are all are GPL'd and SAGEprovides (or will provide) a unified
interface for using them.
- Platforms: Linux, OS X, Windows (cygwin).
(Solaris is not supported.)
- Well documented: Reference manual, API reference with
examples for every function, and at least one published book. Make
documentation and source a peer reviewed package, so authors can get
academic credit similar to the credit they get for a journal
publication.
- Extensible: Be able to define new data
types or derive from builtin types, and make code written in your
favorite language part of the system.
- User friendly: The hope is to eventually attain a high level of user
support. (The GAP Forum email list is an ideal example of the
support it is hoped that SAGEcan attain.)
There are pros and cons.
The primary implementation language of SAGEis Python (see [Py]).
Building a mathematics framework using Python has several advantages.
- Object persistence is very easy in Python. There is
extensive support in Python for saving arbitrary objects you have
computed to disk files or a database.
- Excellent support for documentation of functions and packages
right in the source code, including automatic extraction of
documentation and automatic testing of all examples. The handbook
examples are tested and guaranteed to work as indicated.
- Memory management: Python now has a well though out and robust
memory manager and garbage collector that correctly deals with
circular references, and allows for local variables in files.
- Python has many packages available now that would be immediately
useful to users of SAGE:
numerical analysis and linear algebra, 2D and 3D graphics,
networking (for distributed computation), database support, etc.
- Portability: Python is very easy
to compile from source on most platforms in 2 minutes.
- Exception handling: Python has a sophisticated and well
thought out system of exception handling, whereby programs
gracefully recover even if errors occur in code they call.
- Debugger: Python includes a debugger, so when code fails
for some reason, the user receives an error message, extensive stack
trace, and can inspect the state of all relevant variables and move
up and down the stack.
- Profiler: There is a Python profiler, which runs code
and creates a report detailing how many times and for how long each
function was called.
- A Language: Instead of writing a new language for
mathematics as was done for MAGMA, Maple, Mathematica, MATLAB,
GP/PARI, GAP, Macaulay 2, SIMATH, etc., we use the Python
language, which is a popular and well thought-out computer
language that is being actively developed and optimized by hundreds
of skilled software engineers.
3.2.2 Disadvantages of using Python
Everybody who does mathematics using Python runs into these problems:
Rather than writing a new language, we use the Python language exactly
as is, and write a pre-parser for IPython so that the command line
behavior of IPython is what a mathematician expects. However, one
must still obey the standard Python rules when writing packages that
will be imported into SAGE.
If you would like to contribute to SAGE, your help will be greatly
appreciated! It can range from python code to simply adding a section
or two to the SAGEreference manual. Just email William Stein
at was@math.ucsd.edu
and see the SAGEwebsite. In particular, look at the issue tracker
on the SAGEwebpage which lists features and bugs.
If you write a paper using SAGE,
please reference computations done with SAGEby including
[SJ] in your bibliography.
If you happen to have just read straight through this tutorial, and
have some sense of how long it took you, please let me know, so I can
add that information to a future version.
Have fun with SAGE!
Release 0.6.alpha2, documentation updated on August 27, 2005.
See About this document... for information on suggesting changes.