Sage (previously SAGE, System for Algebra and Geometry Experimentation[3]) is a mathematical software with features covering many aspects of mathematics, including algebra, combinatorics, numerical mathematics, number theory, and calculus. Sage is sometimes called sagemath to distinguish it from other uses of the word.
A browser-based notebook for review and re-use of previous inputs and outputs, including graphics and text annotations. Compatible with Firefox, Opera, Konqueror, Google Chrome and Safari. Notebooks can be accessed locally or remotely and the connection can be secured with HTTPS.
William Stein realized when designing Sage that there were many open-source mathematics software already written in different languages, namely C, C++, Common Lisp, Fortran and Python.
Rather than reinventing the wheel, Sage (which is written mostly in Python and Cython) integrates many specialized mathematics software into a common interface, for which a user needs to know only Python. However, Sage contains hundreds of thousands of unique lines of code adding new functions and creating the interface between its components.[10]
Sage development uses both students and professionals for development. The development of Sage is supported by both volunteer work and grants.[11]
Release history
Only the major releases are listed below. Sage practices the "release early, release often" concept, with releases every few weeks or months. In total, there have been over 300 releases, although their frequency has decreased.[12]
Sage versions
Version
Release Date
Description
0.1
January 2005
Included PARI, but not GAP or Singular
0.2–0.4
March to July 2005
Cremona's database, multivariate polynomials, large finite fields and more documentation
0.5–0.7
August to September 2005
Vector spaces, rings, modular symbols, and windows usage
In 2007, Sage won first prize in the scientific software division of Les Trophées du Libre, an international competition for free software.[14] In 2012, it was one of the projects selected for the Google Summer of Code.[15]
Sage has been cited in a variety of publications.[16][17]
Performance
Both binaries and source code are available for Sage from the download page. If Sage is built from source code, many of the included libraries such as ATLAS, FLINT, and NTL will be tuned and optimized for that computer, taking into account the number of processors, the size of their caches, whether there is hardware support for SSE instructions, etc.
Cython can increase the speed of Sage programs, as the Python code is converted into C.[18]
The source code can be downloaded from the downloads page. Although not recommended for end users, development releases of Sage are also available.
Binaries can be downloaded for Linux, OS X and Solaris (both x86 and SPARC).
A live CD containing a bootable Linux operating system is also available. This allows usage of Sage without Linux installation.
Users can use an online version of Sage at sagenb.org, but with a limit to the amount of memory a user can use.
Although Microsoft was sponsoring a native version of Sage for the Windows operating system,[19] as of 2012 there were no plans for a native port, and users of Windows currently have to use virtualization technology such as VirtualBox to run Sage.[20]
Linux distributions in which Sage is available as a package are Mandriva and Arch Linux. It is also available as a dedicated UbuntuPPA.[21] In Gentoo, it's available via layman in the "sage-on-gentoo"[22] overlay. However, Sage can be installed to any Linux distribution.
Gentoo prefix also provides Sage on other operating systems.
Software packages contained in Sage
The philosophy of Sage is to use existing open-source libraries wherever they exist. Therefore it uses many libraries from other projects.
x, a, b, c = var('x, a, b, c')# Note that IPython also supports a faster way to do this, by calling # this equivalent expression starting with a comma:# ,var x a b c log(sqrt(a)).simplify_log()# returns 1/2*log(a)log(a / b).expand_log()# returns log(a) - log(b)sin(a + b).simplify_trig()# returns sin(a)*cos(b) + sin(b)*cos(a)cos(a + b).simplify_trig()# returns -sin(a)*sin(b) + cos(a)*cos(b)(a + b)^5# returns (a + b)^5expand((a + b) ^ 5)# a^5 + 5*a^4*b + 10*a^3*b^2 + 10*a^2*b^3 + 5*a*b^4 + b^5 limit((x ^ 2 + 1) / (2 + x + 3 * x ^ 2), x=Infinity)# returns 1/3limit(sin(x) / x, x=0)# returns 1 diff(acos(x), x)# returns -1/sqrt(-x^2 + 1)f = exp(x) * log(x)f.diff(x,3)# returns e^x*log(x) + 3*e^x/x - 3*e^x/x^2 + 2*e^x/x^3 solve(a * x ^ 2 + b * x + c, x)# returns [x == -1/2*(b + sqrt(-4*a*c + b^2))/a, # x == -1/2*(b - sqrt(-4*a*c + b^2))/a] f = x ^ 2 + 432 / xsolve(f.diff(x)==0, x)# returns [x == 3*I*sqrt(3) - 3, # x == -3*I*sqrt(3) - 3, x == 6]
Differential equations
t = var('t')# define a variable tx = function('x', t)# define x to be a function of that variablede =(diff(x, t) + x ==1)desolve(de,[x, t])# returns (c + e^t)*e^(-t)
Linear algebra
A = matrix([[1,2,3],[3,2,1],[1,1,1]])y = vector([0, -4, -1])A.solve_right(y)# returns (-2, 1, 0)A.eigenvalues()# returns [5, 0, -1] B = matrix([[1,2,3],[3,2,1],[1,2,1]])B.inverse()# returns'''[ 0 1/2 -1/2] [-1/4 -1/4 1] [ 1/2 0 -1/2]'''# Call NumPy for the Moore-Penrose pseudo-inverse, # since Sage does not support that yet.import numpyC = matrix([[1,1],[2,2]])matrix(numpy.linalg.pinv(C))# returns'''[0.1 0.2] [0.1 0.2]'''
Number theory
prime_pi(1000000)# returns 78498, the number of primes less than one million E = EllipticCurve('389a')# construct an elliptic curve from its Cremona labelP, Q = E.gens()7 * P + Q # returns (24187731458439253/244328192262001 : # 3778434777075334029261244/3819094217575529893001 : 1)