Trisha Shetty (Editor)

SymPy

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit
Repository
  
github.com/sympy/sympy

Written in
  
Development status
  
Active

SymPy

Developer(s)
  
Independent group of people

Initial release
  
2007; 10 years ago (2007)

Stable release
  
1.0 / March 8, 2016; 12 months ago (2016-03-08)

SymPy is a 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 or SymPy Gamma. SymPy is trivial to install and to inspect because it is written entirely in Python with few dependencies. 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.

Contents

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.

SymPy is free software and is licensed under New BSD License. The lead developers are Ondřej Čertík and Aaron Meurer.

Features

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

Currently, the core of SymPy has around 260,000 lines of code (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:

Core capabilities

  • Basic arithmetic: *, /, +, -, **
  • Simplification
  • Expansion
  • Functions: trigonometric, hyperbolic, exponential, roots, logarithms, absolute value, spherical harmonics, factorials and gamma functions, zeta functions, polynomials, hypergeometric, special functions, ...
  • Substitution
  • Arbitrary precision integers, rationals and floats
  • Noncommutative symbols
  • Pattern matching
  • Polynomials

  • Basic arithmetic: division, gcd, ...
  • Factorization
  • Square-free factorization
  • Gröbner bases
  • Partial fraction decomposition
  • Resultants
  • Calculus

  • Limits
  • Differentiation
  • Integration: Implemented Risch-Norman heuristic
  • Taylor (Laurent) Series
  • Solving equations

  • Polynomials
  • Systems of equations
  • Algebraic equations
  • Differential equations
  • Difference equations
  • Discrete math

  • Binomial coefficients
  • Summations
  • Products
  • Number theory: generating prime numbers, primality testing, integer factorization, ...
  • Logic expressions
  • Matrices

  • Basic arithmetic
  • Eigenvalues/eigenvectors
  • Determinants
  • Inversion
  • Solving
  • Geometry

  • Points, lines, rays, segments, ellipses, circles, polygons, ...
  • Intersections
  • Tangency
  • Similarity
  • Plotting

    Note, plotting requires the external matplotlib or Pyglet module.

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

  • Units
  • Classical mechanics
  • Quantum mechanics
  • Gaussian optics
  • Pauli Algebra
  • Statistics

  • Normal distributions
  • Uniform distributions
  • Probability
  • Combinatorics

  • Permutations
  • Combinations
  • Partitions
  • Subsets
  • Permutation group: Polyhedral, Rubik, Symmetric, ...
  • Prufer sequence and Gray Codes
  • Printing

  • Pretty-printing: ASCII/Unicode pretty-printing, LaTeX
  • Code generation: C, Fortran, Python
  • 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 to make SymEngine the underlying engine of Sage too.
  • mpmath: a Python library for arbitrary-precision floating-point arithmetic
  • SympyCore: another Python computer algebra system
  • SfePy: Software for solving systems of coupled partial differential equations (PDEs) by the finite element method in 1D, 2D and 3D.
  • galgebra: Geometric algebra (previously sympy.galgebra).
  • Quameon: Quantum Monte Carlo in Python.
  • Lcapy: Experimental Python package for teaching linear circuit analysis.
  • LaTeX Expression project: Easy LaTeX typesetting of algebraic expressions in symbolic form with automatic substitution and result computation).
  • Symbolic statistical modeling: Adding statistical operations to complex physical models.
  • Dependencies

    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, the 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.
  • Pretty-printing

    Sympy allows outputs to be formatted into a more appealing format through the pprint function. Alternatively, the init_printing() method will enable pretty-printing, so pprint need not be called. Pretty-printing will use unicode symbols when available in the current environment, otherwise it will fall back to ASCII characters.

    References

    SymPy Wikipedia


    Similar Topics