SymPy

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search
SymPy
DeveloperSymPy Development Team
Initial release2007; 19 years ago (2007)
Stable release
1.14.0[1] / 27 April 2025; 11 months ago (2025-04-27)
Repository
  • {{URL|example.com|optional display text}}Lua error in Module:EditAtWikidata at line 29: attempt to index field 'wikibase' (a nil value).
Written inPython
Engine
    Lua error in Module:EditAtWikidata at line 29: attempt to index field 'wikibase' (a nil value).
    Operating systemCross-platform
    TypeComputer algebra system
    License3-clause BSD

    SymPy is an open-source Python library for symbolic computation. It provides computer algebra capabilities either as a standalone application, as a library to other applications, or live on the web as SymPy Live[2] or SymPy Gamma.[3] SymPy is simple to install and to inspect because it is written entirely in Python with few dependencies.[4][5][6] This ease of access combined with a simple and extensible code base in a well known language make SymPy a computer algebra system with a relatively low barrier to entry.

    SymPy includes features ranging from basic symbolic arithmetic to calculus, algebra, discrete mathematics, and quantum physics. It is capable of formatting the result of the computations as LaTeX code.[4][5]

    SymPy is free software and is licensed under the 3-clause BSD. The lead developers are Ondřej Čertík and Aaron Meurer. It was started in 2005 by Ondřej Čertík.[7]

    Features

    [edit | edit source]

    The SymPy library is split into a core with many optional modules.

    Currently, the core of SymPy has around 260,000 lines of code[8] (it also includes a comprehensive set of self-tests: over 100,000 lines in 350 files as of version 0.7.5), and its capabilities include:[4][5][9][10][11]

    Core capabilities

    [edit | edit source]

    Polynomials

    [edit | edit source]

    Calculus

    [edit | edit source]

    Solving equations

    [edit | edit source]

    Discrete math

    [edit | edit source]

    Matrices

    [edit | edit source]

    Geometry

    [edit | edit source]

    Plotting

    [edit | edit source]

    Note, plotting requires the external Matplotlib or Pyglet module.

    • Coordinate models
    • Plotting Geometric Entities
    • 2D and 3D
    • Interactive interface
    • Colors
    • Animations

    Physics

    [edit | edit source]

    Statistics

    [edit | edit source]

    Combinatorics

    [edit | edit source]

    Printing

    [edit | edit source]
    [edit | edit source]
    • SageMath: an open source alternative to Mathematica, Maple, MATLAB, and Magma (SymPy is included in Sage)
    • SymEngine: a rewriting of SymPy's core in C++, in order to increase its performance. Work is currently in progress[as of?] to make SymEngine the underlying engine of Sage too.[14]
    • mpmath: a Python library for arbitrary-precision floating-point arithmetic[15]
    • SympyCore: another Python computer algebra system[16]
    • SfePy: Software for solving systems of coupled partial differential equations (PDEs) by the finite element method in 1D, 2D and 3D.[17]
    • GAlgebra: Geometric algebra module (previously sympy.galgebra).[18]
    • Quameon: Quantum Monte Carlo in Python.[19]
    • Lcapy: Experimental Python package for teaching linear circuit analysis.[20]
    • LaTeX Expression project: Easy LaTeX typesetting of algebraic expressions in symbolic form with automatic substitution and result computation.[21]
    • Symbolic statistical modeling: Adding statistical operations to complex physical models.[22]
    • Diofant: a fork of SymPy, started by Sergey B Kirpichev[23]

    Dependencies

    [edit | edit source]

    Since version 1.0, SymPy has the mpmath package as a dependency.

    There are several optional dependencies that can enhance its capabilities:

    • gmpy: If gmpy is installed, SymPy's polynomial module will automatically use it for faster ground types. This can provide a several times boost in performance of certain operations.
    • matplotlib: If matplotlib is installed, SymPy can use it for plotting.
    • Pyglet: Alternative plotting package.

    See also

    [edit | edit source]

    Lua error in mw.title.lua at line 392: bad argument #2 to 'title.new' (unrecognized namespace name 'Portal').

    References

    [edit | edit source]
    1. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    2. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    3. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    4. ^ a b c Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    5. ^ a b c Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    6. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    7. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    8. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    9. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    10. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    11. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    12. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    13. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    14. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    15. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    16. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    17. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    18. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    19. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    20. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    21. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    22. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    23. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    [edit | edit source]