Sage (mathematics software)
From Wikipedia, the free encyclopedia
|File:Sage image x squared vs x cubed.gif|
Sage animated .gif, y=x2 (red) vs. y=x3(blue)
|Initial release||24 February 2005|
|Stable release||4.3.1 / January 21, 2010|
|Written in||Python, Cython|
|Type||Computer algebra system|
|License||GNU General Public License|
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." The lead developer of Sage, William Stein, is a mathematician at the University of Washington.
Some of the many features of Sage include.
- A notebook document interface, for review and re-use of previous inputs and outputs, including graphics and text annotations usable from most web browsers including Firefox, Opera, Konqueror, and Safari. A secure connection via HTTPS to the notebook is supported when security or confidentiality are important, and allows Sage to be used both locally and remotely.
- A text-based command line interface using IPython
- The Python programming language supporting procedural, functional and object oriented constructs.
- Support for parallel processing using both multi-core processors found in many modern computers, multiple processors, in addition to distributed computing.
- Calculus using Maxima and SymPy
- Numerical Linear Algebra using the GSL, SciPy and NumPy.
- Sliders and other interactive controls as input for calculations.
- Libraries of elementary and special mathematical functions
- 2D and 3D graphs of both functions and data.
- Matrix and data manipulation tools including support for sparse arrays
- Multivariate statistics libraries, using the functionality of R and SciPy.
- A toolkit for adding user interfaces to calculations and applications.
- Tools for image processing using pylab as well as the Python programming language.
- Graph theory visualization and analysis tools
- Libraries of number theory functions
- Import and export filters for data, images, video, sound, CAD, GIS, document and biomedical formats
- Support for complex number, arbitrary precision and symbolic computation for functions where this is appropriate.
- Technical word processing including formula editing and the ability to embed Sage inside LaTeX documents 
- Network tools for connecting to SQL, Java, .NET, C++, FORTRAN provide by Twisted, This supports a large number of protocols including HTTP, NNTP, IMAP, SSH, IRC, FTP and others.
- Interfaces to some third-party software like Mathematica, Magma, and Maple, which allows users to combine software and compare output and performance. It is thus also a "front-end" to other mathematical tools similar to GNU TeXmacs.
- MoinMoin as a Wiki system for knowledge management.
- Documentation using Sphinx.
- An automated test-suite, which allows for testing on an end-user's computer.
Design Philosophy of Sage
William Stein realized several important facts when designing Sage.
- To create viable alternatives to Magma, Maple, Mathematica, and MATLAB, would take hundreds, or thousands of man-years if one started from the beginning.
- There was a large collection of open-source mathematics software already written, but which was written in different languages (C, C++, Fortran and Python being the most common).
Where no open-source option exists for a particular class of problem, then this would be written in Sage. But Sage does not reinvent the wheel. The same design philosophy is used in commercial mathematics program such as Mathematica, but Sage can use a much wider range of open source software solutions than nonfree software, since some open source licensing imposes restrictions on commercial use of code.
Sage development uses both students and professionals for development. The development of Sage is supported by both volunteer work and grants.
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.
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). The Solaris binaries are currently considered experimental.
- A live CD containing a bootable Linux operating system is also available. This allows Sage to be tried, without being installed.
- Users can use an online version of Sage at sagenb.org, but with a limit to the amount of memory a user can use, as well as security restrictions.
Although Microsoft has been sponsoring a native version of Sage for the Windows operating system since 2008 , users of Windows will currently have to use virtualization technology and run Sage under one of the aforementioned operating systems.
Software packages contained in Sage
As stated above, the philosophy of Sage is to use
|Algebra||GAP, Maxima, Singular|
|Arbitrary Precision Arithmetic||GMP, MPFR, MPFI, NTL|
|Arithmetic Geometry||PARI, NTL, mwrank, ecm|
|Calculus||Maxima, SymPy, GiNaC|
|Linear Algebra||Linbox, IML|
|Numerical computation||GSL, SciPy, NumPy, ATLAS|
|Database||ZODB, Python Pickles, SQLite|
|Graphical Interface||Sage Notebook, jsmath|
|Graphics||Matplotlib, Tachyon3d, GD, Jmol|
|Interactive programming language||Python|
Command interface examples
<source lang="python">x,a,b,c = var('x,a,b,c')
log(sqrt(a)).simplify_log() # returns log(a)/2log(a/b).simplify_log() # returns log(a) - log(b)sin(a+b).simplify_trig() # returns cos(a)*sin(b) + sin(a)*cos(b)cos(a+b).simplify_trig() # returns cos(a)*cos(b) - sin(a)*sin(b)(a+b)ˆ5 # returns (b + a)ˆ5expand((a+b)ˆ5) # returns bˆ5 + 5*a*bˆ4 + 10*aˆ2*bˆ3 +
# 10*aˆ3*bˆ2 + 5*aˆ4*b + aˆ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(1 - xˆ2)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 == (-sqrt(b^2 - 4*a*c) - b)/(2*a),
# x == (sqrt(b^2 - 4*a*c) - b)/(2*a)]
f = xˆ2 + 432/xsolve(f.diff(x)==0,x) # returns [x == 3*sqrt(3)*I - 3,
# x == -3*sqrt(3)*I - 3, x == 6]
<source lang="python">t = var('t') # define a variable tx = function('x',t) # define x to be a function of that variableDE = lambda y: diff(y,t) + y - 1desolve(DE(x(t)), [x,t]) # returns '%e^-t*(%e^t+%c)'</source>
<source lang="python">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.numpy())) # returns [0.1 0.2]
# [0.1 0.2]
<source lang="python">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 (2869/676 : -171989/17576 : 1)
Only the major releases are listed below. Sage practices the "release early, release often" concept, with releases every two to three weeks.
|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|
- Comparison of computer algebra systems
- Comparison of statistical packages
- Comparison of numerical analysis software
- ^ Stein, William (2007-06-12). "SAGE Days 4". http://www.sagemath.org/why/stein-sd4.pdf. Retrieved 2007-08-02.
- ^ Sage documentation
- ^ "Sage Interact functionality". http://wiki.sagemath.org/interact. Retrieved 2008-04-11.
- ^ The TeX Catalogue OnLine, Entry for sagetex, Ctan Edition
- ^ http://facstaff.unca.edu/mcmcclur/Mathematica/Sage/ Calling Sage from Mathematica
- ^ http://facstaff.unca.edu/mcmcclur/Mathematica/Sage/UsingSage.nb A Mathematica notebook to call Sage from Mathematica.
- ^ "Explicit Approaches to Modular Forms and Modular Abelian Varieties". National Science Foundation. 2006-04-14. http://www.nsf.gov/awardsearch/showAward.do?AwardNumber=0555776. Retrieved 2007-07-24.
- ^ "Free Software Brings Affordability, Transparency To Mathematics". Science Daily. December 7, 2007. http://www.sciencedaily.com/releases/2007/12/071206145213.htm. Retrieved 2008-07-20.
|Wikibooks has a book on the topic of|
- Project home page
- Official Sage Documentation Manual, Reference, 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