skillfed

symengine

Python library providing wrappers to SymEngine

symengine v0.14.1 506.4K downloads/30d#6,286 on PyPI189
Permissive license MIT Active released

What it is and what it does

SymEngine is a Python wrapper around a fast C++ symbolic algebra engine. It provides core symbolic computation capabilities—variable definition, expression expansion, simplification, and algebraic manipulation—without requiring a full computer algebra system. The library is designed for speed and is used where symbolic operations need to be integrated into Python workflows without the overhead of heavier systems.

The package ships pre-built wheels for Python 3.9–3.13 across macOS, Linux, and Windows, reducing install friction for most users. Building from source is possible but requires CMake, the SymEngine C++ library itself, and Cython. Optional dependencies like NumPy and SymPy can enhance functionality. The wrapper is actively maintained and carries no known security vulnerabilities.

Use it for:

  • Expand and simplify algebraic expressions symbolically in mathematical or physics simulations.
  • Integrate symbolic computation into performance-critical Python code where speed matters.
  • Define symbolic variables and perform algebraic operations in numerical computing pipelines.
  • Evaluate floating-point expressions via lambdify when linked against LLVM.
  • Use as a faster alternative to SymPy for core symbolic manipulation tasks.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Python wrappers for SymEngine, a fast C++ symbolic manipulation library, enabling symbolic computation and algebraic operations in Python.

Yes, if you need fast symbolic computation in Python and can accept medium install friction. Pre-built wheels make installation straightforward for Python 3.9–3.13 on common platforms. The MIT license and active maintenance are favorable. No security vulnerabilities are known. Consider it especially if performance of symbolic operations is a bottleneck; otherwise, SymPy may be simpler if speed is not critical.

Install

symengine on PyPI

pip

pip install symengine

uv

uv add symengine

poetry

poetry add symengine

Installing symengine

Before you install

Medium install friction due to compiled C++ dependencies. Pre-built wheels are available for Python 3.9–3.13 on macOS, Linux (x86_64, aarch64, ppc64le), and Windows. Building from source requires CMake ≥ 3.21, SymEngine ≥ 0.14.0, and Cython ≥ 0.29.24. Package is actively maintained with recent commits.

License in practice

MIT-licensed wrapper using LGPL-3.0-or-later (GMP, MPFR, MPC, MPIR), Apache-2.0 (LLVM), BSD-3-Clause (zstd, symengine), and Zlib dependencies in wheels. Permissive overall, but LGPL dependencies require awareness of linking obligations if redistributing binaries.

Quickstart

pip install symengine

from symengine import var
x, y, z = var('x y z')
e = (x + y + z)**2
expanded_e = e.expand()
print(expanded_e)

Requires Python ≥ 3.9 and < 4. Pre-built wheels available for common platforms; building from source requires CMake ≥ 3.21 and SymEngine ≥ 0.14.0.

Verify before relying

  • Whether LLVM linking is recommended or required for typical lambdify use cases.
  • Performance comparison with SymPy or other symbolic libraries for common operations.
  • Whether FLINT linking is available in pre-built wheels or requires source build.

Package facts

License MIT (permissive)
Python support supports the current Python release (<4,>=3.9)
Install friction medium — platform-specific wheel
Runtime dependencies none
Maintenance actively maintained — 480 days since the last release
Last repo commit
First released
Downloads 506,365/month — #6,286 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: symengine-0.14.1-cp310-cp310-macosx_10_13_x86_64.whl; symengine-0.14.1-cp310-cp310-macosx_11_0_arm64.whl; symengine-0.14.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; symengine-0.14.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl; symengine-0.14.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; symengine-0.14.1-cp310-cp310-win_amd64.whl; symengine-0.14.1-cp311-abi3-macosx_10_13_x86_64.whl; symengine-0.14.1-cp311-abi3-macosx_11_0_arm64.whl; symengine-0.14.1-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; symengine-0.14.1-cp311-abi3-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl; symengine-0.14.1-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; symengine-0.14.1-cp311-abi3-win_amd64.whl; symengine-0.14.1-cp311-cp311-macosx_10_13_x86_64.whl; symengine-0.14.1-cp311-cp311-macosx_11_0_arm64.whl; symengine-0.14.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; symengine-0.14.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl; symengine-0.14.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; symengine-0.14.1-cp311-cp311-win_amd64.whl; symengine-0.14.1-cp312-cp312-macosx_10_13_x86_64.whl; symengine-0.14.1-cp312-cp312-macosx_11_0_arm64.whl

License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Topic :: Scientific/EngineeringTopic :: Scientific/Engineering :: MathematicsTopic :: Scientific/Engineering :: Physics

Tags

symbolic math librarysymbolic computation pythonfast symbolic algebraC++ symbolic enginealgebraic expression manipulationsymbolic differentiation integrationcomputer algebra system
symbolic-algebracompiled-extensioncomputer-algebra

More Scientific/Engineering packages