World Library  
Flag as Inappropriate
Email this Article


Sage (mathematics software)
Sage logo
Initial release 24 February 2005 (2005-02-24)
Stable release 6.3 (10 August 2014 (2014-08-10)) [1]
Written in Python, Cython
Operating system Cross-platform
Platform Python
Size 411 MB download (Ubuntu 64-bit)[2]
Type Computer algebra system
License GNU General Public License
Website .org.sagemathwww

Sage (previously SAGE, System for Algebra and Geometry Experimentation[3]) is mathematical software with features covering many aspects of mathematics, including algebra, combinatorics, numerical mathematics, number theory, and calculus.

The first version of Sage was released on 24 February 2005 as free and open source software under the terms of the GNU General Public License, with the initial goals of creating an "open source alternative to Magma, Maple, Mathematica, and MATLAB".[4] The originator and leader of the Sage project, William Stein, is a mathematician at the University of Washington.

Sage uses the Python programming language, supporting procedural, functional and object-oriented constructs.


  • Features 1
  • Development 2
    • Release history 2.1
  • Achievements 3
  • Performance 4
  • Licensing and availability 5
  • Software packages contained in Sage 6
  • Usage examples 7
    • Algebra and calculus 7.1
    • Differential equations 7.2
    • Linear algebra 7.3
    • Number theory 7.4
  • Related projects 8
  • See also 9
  • References 10
  • External links 11


The Sage notebook document interface works with most web browsers.
Equation solving and typesetting using the Sage notebook web interface

Features of Sage include:[5]


William A. Stein

William Stein realized when designing Sage that there were many open-source mathematics software packages 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 packages 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 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
0.8 October 2005 Full distribution of GAP, Singular
0.9 November 2005 Maxima and clisp added
1.0 February 2006
2.0 January 2007
3.0 April 2008 Interacts, R interface
4.0 May 2009 Solaris 10 support, 64bit OSX support
5.0 May 2012[13] OSX Lion support
6.0 December 2013 Sage Development moved to Git[14]


  • 2007: first prize in the scientific software division of Les Trophées du Libre, an international competition for free software.[15]
  • 2012: one of the projects selected for the Google Summer of Code.[16]
  • 2013: ACM/SIGSAM Jenks Prize.[17]
  • Sage has been cited in a variety of publications.[18][19]


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.[20]

Licensing and availability

Sage is free software, distributed under the terms of the GNU General Public License version 2+. Sage is available in many ways:

  • 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, but with a limit to the amount of memory a user can use.
  • Users can use an online "single cell" version of Sage at or embed a single sage cell into any web page. Users can also create permalinks to Sage computations using the cell server.[21]
  • A new online Sage notebook is being developed at

Although Microsoft was sponsoring a native version of Sage for the Windows operating system,[22] 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.[23] As of Sage 5.9, it mostly successfully builds on Cygwin.[24]

Linux distributions in which Sage is available as a package are Mandriva, Fedora, and Arch Linux. It is also available as a dedicated Ubuntu PPA.[25] In Gentoo, it's available via layman in the "sage-on-gentoo"[26] 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.

Mathematics packages contained in Sage[27]
Algebra GAP, Maxima, Singular
Algebraic geometry Singular
Arbitrary precision arithmetic MPIR, MPFR, MPFI, NTL, mpmath
Arithmetic geometry PARI/GP, NTL, mwrank, ecm
Calculus Maxima, SymPy, GiNaC
Combinatorics Symmetrica, Sage-Combinat
Linear algebra ATLAS, BLAS, LAPACK, NumPy, LinBox, IML, GSL
Graph theory NetworkX
Group theory GAP
Numerical computation GSL, SciPy, NumPy, ATLAS
Number theory PARI/GP, FLINT, NTL
Statistical computing R, SciPy
Other packages contained in Sage
Command-line shell IPython
Database ZODB, SQLite
Graphical interface Sage Notebook, jsMath
Graphics matplotlib, Tachyon3d, GD, Jmol
Interactive programming language Python
Networking Twisted

Usage examples

Algebra and calculus

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)^5
expand((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/3
limit(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 / x
solve(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 t
x = function('x', t) # define x to be a function of that variable
de = (diff(x, t) + x == 1)
desolve(de, [x, t]) # returns (c + e^t)*e^(-t)

Linear algebra

A = matrix()
y = vector([0, -4, -1])
A.solve_right(y) # returns (-2, 1, 0)
A.eigenvalues() # returns [5, 0, -1]

B = matrix()
B.inverse() # returns
'''[   0  1/2 -1/2]
   [-1/4 -1/4    1]
   [ 1/2    0 -1/2]'''

# same matrix, but over the ring of doubles (not rationals, as above)
sage: B = matrix(RDF, )
sage: B.inverse()
[-5.55111512313e-17                0.5               -0.5]
[             -0.25              -0.25                1.0]
[               0.5                0.0               -0.5]

# Call NumPy for the Moore-Penrose pseudo-inverse, 
# since Sage does not support that yet.

import numpy
C = matrix()
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 label
P, Q = E.gens()
7 * P + Q # returns (24187731458439253/244328192262001 : 
          # 3778434777075334029261244/3819094217575529893001 : 1)

sage: E2 = EllipticCurve(CC, [0,0,-2,1,1])
sage: E2
Elliptic Curve defined by y^2 + (-2.00000000000000)*y = 
         x^3 + 1.00000000000000*x + 1.00000000000000 over 
         Complex Field with 53 bits of precision
sage: E2.j_invariant()

Related projects

  • Sagemath Cloud computational mathematics in the cloud
  • Sage Math for Android to access Sagemath Cloud from Android
  • LMFDB database of L-functions, modular forms, and related objects
  • FindStat database of combinatorial statistics

See also


  1. ^ "Sage 6.3 Changelog". Retrieved 2014-08-18. 
  2. ^ "Sage Download". 
  3. ^ Stein, William. "SAGE: A Computer System for Algebra and Geometry Experimentation". Retrieved 30 March 2012. 
  4. ^ Stein, William (2007-06-12). "SAGE Days 4". Archived from the original on 2007-06-27. Retrieved 2007-08-02. 
  5. ^ "Sage documentation". 
  6. ^ "Sage Interact functionality". Retrieved 2008-04-11. 
  7. ^ "Using SageTeX". 
  8. ^ "Using Compiled Code Interactively". Sage Documentation. Retrieved 14 July 2011. 
  9. ^ "Calling Sage from Mathematica". 
  10. ^ "days7 - Sage Wiki". 2008-11-14. Retrieved 2013-12-09. 
  11. ^ "Sage – Acknowledgement". Retrieved 2010-07-13. 
  12. ^ "Sage Download - src-old". Retrieved 17 July 2011. 
  13. ^ "sage-5.0.txt". Retrieved 17 May 2012. 
  14. ^ "Installing and using Sage just got even easier". Retrieved 12 July 2014. 
  15. ^ "Free Software Brings Affordability, Transparency To Mathematics". Science Daily. December 7, 2007. Retrieved 2008-07-20. 
  16. ^ "Sage Mathematical Software System". Retrieved 9 June 2012. 
  17. ^ "SIGSAM: Awards and prizes". Retrieved 2 Aug 2013. 
  18. ^ "Publications Citing Sage". Retrieved 14 July 2011. 
  19. ^ "Publications Citing Sage-Combinat". Retrieved 14 July 2011. 
  20. ^ "Cython, Sage, and the Need for Speed". 
  21. ^ "About the Sage Cell Server". Retrieved 2013-12-09. 
  22. ^ "Sage – Acknowledgment". 
  23. ^ Stein, William (16 March 2012). "Re: Question about Sage".  
  24. ^ "Information for the port to Cygwin". Retrieved 12 June 2013. 
  25. ^ "Sage : “AIMS” team". 
  26. ^ "sage-on-gentoo". 
  27. ^ "Sage Standard Packages". Retrieved 10 June 2012. 

External links

  • Project home page
  • Official Sage documentation, reference, and tutorials
  • Sage introduction videos
  • Use Sage online in your web browser
  • Free software brings affordability, transparency to mathematics
  • AMS Notices Opinion – Open Source Mathematical Software
  • W. Stein's blog post on history of Sage
  • Sage
  • Sage Math at the Google Play store
  • Sage Android package at the F-Droid repository
This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.

Copyright © World Library Foundation. All rights reserved. eBooks from Project Gutenberg are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.