SageMath
SageMath is a modern, free algebraic computation system with the mission to be “a viable open-source alternative to Maple, Magma, Mathematica, and Matlab.” It comprises nearly 100 open-source packages in a unified interface. Among its features are a wide variety of mathematical tools, such as calculus, differential equations, various algebraic structures, differential geometry, topology, tensor calculus, and more. It is suitable for both educational purposes and academic research.
Material from a SageMath minicourse for physicists I taught at Unesp/FEG (in Portuguese)
Why use SageMath?
Below are some key points highlighted in the book Elementos de Computação Matemática com SageMath, published by the Brazilian Mathematical Society, in favor of SageMath:
- SageMath integrates the most sophisticated open-source packages and software for symbolic and numerical computation. Among them are the scientific libraries NumPy, SciPy, and matplotlib; the Python-based symbolic math software SymPy; the well-established Maxima; and the computational algebra systems aimed at Group Theory and Number Theory, GAP and Pari GP, respectively. SageMath is also built on the powerful computational statistics software R and hundreds of thousands of exclusive lines of code that add new features to the system. This makes it an excellent alternative to well-known commercial systems.
- SageMath uses Python-based syntax. In recent years, Python has become increasingly popular for its ease of learning and readability. These characteristics have encouraged universities to adopt it as the first programming language for students in Engineering, Computer Science, Physics, and even Mathematics.
- SageMath is free, allowing its use for any purpose (teaching, research, and industry). Therefore, any student, researcher, or professional who receives a Sage program script can view, manipulate, and contribute to improving the results.
- SageMath is open source, meaning its source code can be accessed and modified according to your needs. In practice, if a SageMath command or function does not meet your needs, you can study it, modify it, and use it at your convenience.
SageMath is well-suited for teaching and research in mathematics and computational mathematics. There are several books and hundreds of publications.
- If a bug is noticed by the Sage development team, it is announced on the developer discussion list for public knowledge, while in proprietary software, it may only be fixed in a future version. There is also the risk that the existence of the bug is not made public.
Additionally, there is the SageManifolds project, integrated into SageMath. SageManifolds includes differential geometry and tensor calculus features. Beyond handling differentiable and Riemannian manifolds, it also supports pseudo-Riemannian manifolds, making it highly applicable to General Relativity.
Where to learn?
Tutorials
Tutorial by Michael E. O’Sullivan, San Diego State University
Books
- Computational Mathematics with SageMath (free)
- Sage for Undergraduates, 2nd edition
- Sage para Estudiantes de Pregrado (free)
- Elementos de Computação Matemática com SageMath (in Portuguese)
How to get it?
There are three main ways to use SageMath:
- Online, with CoCalc;
- Via Local installation;
- Executing individual cells on SageMathCell
Examples
Horizons and ergosurfaces of the Kerr spacetime (SageManifolds)