SageMath Documentation

repository·develop·Indexed 25 days ago

https://github.com/sagemath/sage

Open source mathematics software and standard Python library. This documentation covers building SageMath from source on Linux, macOS, and WSL, configuring build options, and using official Docker images for CLI or Jupyter Notebook environments. It also includes developer guides for the build system, directory layout, Meson subprojects, and command-line utilities for dependency management, versioning, and linting.

Tokens
232.2K
Snippets
677
Records
1.3K
Agent score
82%

What's inside SageMath

  1. Overview of sagemath-repl components

    develop

    The sagemath-repl distribution is a lightweight alternative to the full SageMath installation. It focuses on providing the essential tools for interactive mathematical computing and testing:

    • IPython kernel: Allows you to use Sage within an IPython environment.
    • Sage preparser: Handles the preprocessing of Sage expressions.
    • doctester: Provides the testing framework for Sage code.

    Note that this package only provides a subset of the full Sage library modules.

  2. Overview of the Sage development workflow

    develop

    Sage development involves several key stages and specialized knowledge areas:

    • Revision Control: Sage uses Git for all version control. You will need to manage local branches to share changes with the community.
    • GitHub Integration: All changes, bug reports, and enhancement proposals are managed via the Sage repository on GitHub.
    • Coding Conventions: There are specific conventions for writing both code and documentation to maintain consistency across the project.
    • Testing: Testing is a high priority. Every change must be tested using Sage's testing tools (such as doctesting) before being merged to prevent regressions.
    • Documentation: Features are documented in Sage manuals, and technical updates to these manuals are part of the development process.
    • Advanced Development: Deep coding involves working with Python, Cython, or other languages, as well as managing Sage's complex packaging system (third-party and internal distribution packages).
  3. Overview of Numerical Computing in Sage

    develop

    SageMath provides a suite of tools for machine precision floating-point computations. This includes capabilities for:

    • Optimization: Finding minima/maxima of functions.
    • Numerical Linear Algebra: Matrix operations and decompositions using floating-point arithmetic.
    • Differential Equations: Solving Ordinary Differential Equations (ODEs) and Partial Differential Equations (PDEs) numerically.

    The numerical ecosystem in Sage is organized into three main levels of complexity:

    1. High-level Numerical Tools: Uses standard Python/Sage syntax for numerical analysis.
    2. Compiled Code Integration: Allows using C or Fortran code interactively within Sage for performance-critical tasks.
    3. Parallel Computation: Utilizes MPI and parallel programming patterns for distributed numerical tasks.
  4. Explore SageMath thematic tutorials

    develop

    SageMath provides a variety of learning resources categorized by depth and subject matter to help users master different mathematical and programming domains:

    • Demonstrations: Short overviews of features for a specific theme.
    • Quickrefs (Quick Reference Cards): One-page documents containing essential examples and entry points.
    • Primers: Short documents designed to get a user started on a theme in minutes.
    • Tutorials: In-depth guides for comprehensive learning.

    Available thematic areas include:

    • Introduction to Sage: General tutorials and preparatory guides.
    • Python Programming: Sage-specific programming, comprehensions, objects, classes, and functional programming.
    • Calculus and Plotting: Symbolics, basic plotting, advanced 2D plotting, and vector calculus.
    • Algebra: Group theory, Lie algebras, and module theory.
    • Number Theory: RSA, p-adic numbers, and explicit methods.
    • Geometry: Geometric structures and computations.
    • Combinatorics: General combinatorics, coding theory, and structures in coding theory.
    • Algebraic Combinatorics: Symmetric functions, root systems, and abelian sandpile models.
    • Algebraic Structures: Coercion, categories, and implementing algebraic structures.
    • Numerical Computations: Numerical computing and linear programming.
    • Advanced Programming: Cython interfaces and profiling.
  5. Ways to use SageMath

    develop

    SageMath can be used through several different interfaces depending on your workflow:

    • Notebook graphical interface: Launch the Jupyter notebook interface using the command line.
    • Interactive command line: Use the Sage interactive shell for direct command entry.
    • Programs: Write interpreted or compiled programs within the Sage environment.
    • Scripts: Write standalone Python scripts that import and use the Sage library.
    sage -n jupyter
  6. Explore SageMath built-in special functions

    develop

    SageMath provides an extensive library of built-in special functions categorized by mathematical type. You can access these functions through the SageMath environment to perform symbolic or numerical computations.

    Available function categories include:

    • Logarithmic & Trigonometric: sage/functions/log, sage/functions/trig, sage/functions/hyperbolic
    • Transcendental & Error Functions: sage/functions/transcendental, sage/functions/error
    • Polynomials & Orthogonal Functions: sage/functions/orthogonal_polys, sage/functions/jacobi
    • Special Mathematical Functions: sage/functions/special, sage/functions/hypergeometric, sage/functions/airy, sage/functions/bessel, sage/functions/exp_integral, sage/functions/wigner
    • Other Utilities: sage/functions/piecewise, sage/functions/spike_function, sage/functions/prime_pi, sage/functions/min_max
  7. Explore General Hecke Algebras and Hecke Modules

    develop

    SageMath provides functionality for working with modules over Hecke algebras. This includes support for decompositions, degeneracy maps, and related algebraic structures.

    Key components available in this subsystem include:

    • Modules and Submodules: Managing Hecke modules and their sub-structures.
    • Ambient Modules: Working with the surrounding module space.
    • Elements and Operators: Manipulating individual Hecke algebra elements and Hecke operators.
    • Morphisms and Homspaces: Computing spaces of homomorphisms between modules.
    • Degeneracy Maps: Handling maps between different Hecke algebra structures.
    • Algebraic Structures: Defining and interacting with the Hecke algebra itself.

    For practical applications, this functionality is used within the sage.modular.modsym (Modular Symbols) and sage.modular.modfrm (Modular Forms) packages.

  8. Explore SageMath Graph Theory modules

    develop

    SageMath provides a comprehensive suite of tools for graph theory, organized into several functional areas:

    • Graph objects and methods: Core classes for working with different graph types, including undirected graphs (sage/graphs/graph), directed graphs (sage/graphs/digraph), bipartite graphs (sage/graphs/bipartite_graph), and graph views (sage/graphs/views).
    • Constructors and databases: Tools for generating graphs from scratch (generators) or retrieving them from pre-defined databases (e.g., sage/graphs/graph_database, sage/graphs/strongly_regular_db).
    • Hypergraphs: Specialized support for hypergraph generation and incidence structures.
    • Libraries of algorithms: A vast collection of algorithmic implementations covering areas such as coloring, centrality, matching, planarity, spanning trees, and graph decompositions.
    • Low-level implementation: Access to the underlying graph backends and C-based implementations for performance-critical tasks.
  9. Explore SageMath Algebra modules

    develop

    SageMath provides a comprehensive suite of algebraic structures categorized into several main types. You can use these modules to work with:

    • Free associative algebras and quotients: Includes free_algebra, tensor_algebra, and letterplace implementations.
    • Finite dimensional algebras: Support for finite dimensional algebra elements, ideals, and morphisms.
    • Named associative algebras: A wide variety of specific algebras such as CliffordAlgebra, GroupAlgebra, WeylAlgebra, SchurAlgebra, and ClusterAlgebra.
    • Hecke algebras: Implementations including ArikiKoikeAlgebra, IwahoriHeckeAlgebra, and NilCoxeterAlgebra.
    • Graded algebras: Support for graded commutative differential algebras (DGA) and finite GCA.
    • Non-associative algebras: Includes LieAlgebra, JordanAlgebra, OctonionAlgebra, and various free algebras like ShuffleAlgebra or DendriformAlgebra.
  10. Understand SageMath package types and installation

    develop

    SageMath functionality is organized into several categories of packages and features:

    • Standard Packages: These are included in the Sage distribution and are installed automatically if equivalent system packages are not found on your platform.
    • Optional Packages: Additional functionality that is not included by default but can be installed manually.
    • Distribution Packages: Packages that are part of the core Sage library itself.
    • Experimental Packages: Packages providing additional functionality that are still being integrated; these may require developer assistance or may be less stable.
    • External Packages: A comprehensive list of all external software packages integrated with Sage.
  11. Work with Lie Conformal Algebras in SageMath

    develop

    SageMath provides a suite of classes and implementations for working with Lie Conformal Algebras. To interact with these algebras, you can use the core Lie Conformal Algebra classes and various specialized implementations for specific mathematical structures.

    Core Classes:

    • LieConformalAlgebra: The primary class for defining and manipulating Lie conformal algebras.
    • LieConformalAlgebraElement: Represents individual elements within a Lie conformal algebra.

    Specialized Implementations (Examples): SageMath includes several pre-implemented Lie Conformal Algebras that you can use directly for research or testing:

    • AbelianLieConformalAlgebra
    • AffineLieConformalAlgebra
    • BosonicGhostsLieConformalAlgebra
    • FermionicGhostsLieConformalAlgebra
    • FreeBosonsLieConformalAlgebra
    • FreeFermionsLieConformalAlgebra
    • N2LieConformalAlgebra
    • NeveuSchwarzLieConformalAlgebra
    • VirasoroLieConformalAlgebra
    • WeylLieConformalAlgebra

    For more advanced structural work, you can also explore implementations for FinitelyFreelyGeneratedLCA, FreelyGeneratedLieConformalAlgebra, GradedLieConformalAlgebra, and algebras defined via LieConformalAlgebraWithBasis or LieConformalAlgebraWithStructureCoefs.