This tutorial will likely take you about 2-3 hours to work through.
Though much of SAGE is implemented using Python, no Python background
is needed to read this tutorial. (Some background on Python will be
needed by the heavy SAGE user, but this is not the place for that.)
If you just want to quickly try out SAGE, this is the place to
start. For example:
sage: 2 + 2
4
sage: factor(2006)
2 * 17 * 59
sage: A = MatrixSpace(QQ, 4)(range(16)); A
[ 0 1 2 3]
[ 4 5 6 7]
[ 8 9 10 11]
[12 13 14 15]
sage: factor(A.charpoly())
x^2 * (x^2 - 30*x - 80)
sage: E = EllipticCurve([1,2,3,4,5]);
sage: E
Elliptic Curve defined by y^2 + x*y + 3*y = x^3 + 2*x^2 + 4*x + 5
over Rational Field
sage: E.anlist(10)
[0, 1, 1, 0, -1, -3, 0, -1, -3, -3, -3]
1.1 Installation
If you do not have SAGE installed on a computer, and just
want to try some SAGE command, you might try the
SAGE online calculator at
http://modular.math.washington.edu/calc.
See the document Installing SAGE in the documentation section of the
main webpage of SAGE [SA] for instructions
on installing SAGE on your computer. Here we merely make
two comments.
- The SAGE download file comes with ``batteries included''. In
other words, although SAGE uses Python, IPython, PARI, GAP,
Singular, Maxima, NTL, GMP, and so on, you do not need to install
them separately as they are included with the SAGE distribution.
However, to use certain SAGE features, e.g., Macaulay or KASH,
you must install the relevant optional SAGE
package. Macaulay and KASH are SAGE packages
(type
sage -optional
for a list of available
optional packages). For the exact versions of the standard
SAGE packages, go to the SAGE website and choose ``Download''
then ``standard''.
- The pre-compiled binary version of SAGE (found on the SAGE
web site) may be easier and quicker to install than the source
code version. Just unpack the file and run
sage
.
You can use SAGE via an interactive shell (Chapter 3),
you can write interpreted
and compiled programs in SAGE (see Section 5.1 and
5.2), and
you can write stand-alone Python scripts that use the SAGE library
(see Section 5.3).
1.3 Longterm Goals for SAGE
- Useful: SAGE's intended audience includes not only
researchers in mathematics but also teachers of mathematics. The aim
is to provide a software that can be used to explore and experiment
with mathematical constructions in algebra, geometry, number theory,
calculus, etc. SAGE will help make it easier to interactively
experiment with mathematical objects.
- Efficient: Be fast. SAGE uses highly-optimized
mature software like GMP, PARI, GAP, and NTL, which is often very
fast at certain operations.
- 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
understand how the calculations work by reading documented source
code. If you use SAGE to do computations in a paper you
publish, you can rest assured that your readers will always have
free access to SAGE and all its source code, and you are even
allowed to archive and re-distribute the version of SAGE you used.
- Easy to compile: SAGE should be easy to compile from
source for Linux, OS X and Windows users. This provides more
flexibility for users to modify the system.
- Cooperation: Provide robust interfaces to most other
computer algebra systems, including PARI, GAP, Singular,
Maxima, KASH, Magma, Maple, and Mathematica. SAGE is meant to
unify existing math software, rather than compete with it. SAGE
is not about reinventing the wheel.
- Well documented: Tutorial, programming guide,
reference manual, and how-to, with numerous examples and
discussion of background mathematics.
- Extensible: Be able to define new data types or derive
from built-in types, and use code written in a range of languages.
- User friendly: Easy to understand what functionality is
provided for a given object and view documentation and source code.
Also attain a high level of user support (maybe similar to what GAP
currently offers its users).
Release 2006.05.25, documentation updated on May 25, 2006.
See About this document... for information on suggesting changes.