Create a viable free open source alternative to Magma, Maple, Mathematica, and Matlab.
Some of the 100 packages included:
The Sage Notebook is a web application that provides a convenient interface to Sage commands, components and features. This separates the computational engine from the user's device and operating system.
Simple manipulation of \((3x+4)^5\).
Partial fraction decomposition of \[\frac{x^{3} + 47 \, x^{2} + 122 \, x + 424}{x^{4} - 5 \, x^{3} - 12 \, x^{2} - 76 \, x - 160}\]
2-D plotting is what you would expect.
And style it.
Plus a shifted copy (which passes through the origin).
A symbolic derivative of \(f(x)=x^3e^{-x}\). (from Maxima)
Derivative of a function is again a function, and can be evaluated.
Arbitrary precision numerical values on request (from MPmath).
And a plot (from matplotlib).
Study the multivariate integral \(\displaystyle\int_{-4}^4\int_0^{x^2} y^2-10x^2\,dy\,dx\).
Many possible fields and rings: finite fields, field extensions, algebraic numbers.
Over the integers and rationals powered by Integer Matrix Library (IML).
Subspaces act like vector spaces.
And it is fast.
Many, many more functions for matrices (tab-completion on A, ]]>).
Sage uses a popular language as its own programming language. Python is used to knit together the many different packages in Sage, written in many different languages. New code is typically written in Python, and automatically optimized by translation to C via Cython. A by-product is that Python is always available and integrated.
Most importantly, students learn Python coincidentally.
Fermat's \(4n+1\) Theorem (Gauss): Every prime of the form \(4n+1\) can be written as a sum of two squares (uniquely).
Python's list comprehensions
entirely mimic standard mathematical notation. The prime numbers of the form \(4n + 1\) less than 100. (Perhaps to study Fermat's 4n+1 Theorem.) Mathematically:
\[\{4n+1\mid n\in{\mathbb N}, 4n+1\text{ is prime}, 4n+1\lt 100\}\]
Pythonically:
Now a brute-force check.
Interactive demonstrations are easy to create with the interact
decorator and modified function arguments. Python is the language of Sage, and the language for building interacts.
Behavior of \(f(x)=x^n\) on \((0,1)\) for \(1\leq n\leq 40\) (from a student).
The canonical example.
Digital compression with the singular value decomposition. Note the simple use of an existing Python library.
$\dots$is superb.
Shift-Click
on blue bar to activate. TeX-aware.
We can add text to our notebooks using TeX syntax and dollar signs. Previous multivariate integral:
\int_0^4\int_0^{x^2} y^2-10x^2\,dy\,dx
Can also embed images via the embedded word processor.
SageTeX allows you to call Sage to compute values, expressions or plots for automatic inclusion in your LaTeX document. (And will write your papers for you!)
In your LaTeX source: Today's date, 2012-10-05 = 20121005, factors as \sage{factor(20121005)}.
Final Document: Today's date, 2012-10-05 = 20121005, factors as \(5 \cdot 281 \cdot 14321\).
A huge number of examples are provided for (a) learning to use Sage commands, and (b) to test Sage commands. We call these ``doctests.''
Illustrate tab-completion, help, doctests, source code for .columns()
method. (Using ., ?, ?? plus TAB.)
plot(x^2, (x, -3, 2), color='red')
A = random_matrix(ZZ, 100, 100); A.determinant()
This worksheet available at: http://buzzard.ups.edu/talks.html