$npx skillfedfor your agent

opt-einsum

Path optimization of einsum functions.

With conditionsPyPI Python ModulesReleased Sep 202425.2M downloads / mopermissive licensePure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — opt_einsum-3.4.0-py3-none-any.whl
v3.4.0 · released 2024-09-26 · Python >=3.8

Yes, if you work with multi-tensor contractions. The installation is frictionless with no dependencies. The dormant maintenance status (687 days since last release) is a minor concern for long-term compatibility, but the package is marked Production/Stable and has no known vulnerabilities. Install it as a performance tool for existing einsum code rather than as a foundation for new architecture.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Low friction installation with no runtime dependencies.
  • Maintenance is dormant (687 days since last release), though the package is marked Production/Stable and supports current Python versions.

License · maintenance · safety

permissive license (permissive) — MIT license (permissive) allows use in both open-source and commercial projects with minimal restrictions.

last release 2024-09-26 (687 days)

0 known vulnerabilities (OSV.dev, 2026-08-14) · 25,245,905 downloads/mo, #904 on PyPI

Verify before relying

pip install opt_einsum

from opt_einsum import contract

result = contract('pi,qj,ijkl,rk,sl->pqrs', C, C, I, C, C)
  • Whether dormant maintenance status affects long-term compatibility with newer array library versions
  • Performance gains on modern hardware and with current optimization strategies in supported backends
  • Specific performance improvements achievable on typical workloads compared to native einsum implementations
Same gist for agents: .md · .json

What it is and what it does

opt_einsum is a tensor contraction optimizer that reorders einsum operations to minimize intermediate tensor sizes and computation steps. Rather than executing a contraction in the order specified, it analyzes the expression and finds a more efficient path. The package works as a drop-in replacement for einsum functions across supported backends, automatically dispatching work to canonical BLAS, cuBLAS, or other specialized routines when possible.

It is primarily used in scientific computing and machine learning workflows where large tensor operations are common. The package supports inspecting optimization paths, reusing compiled expressions with constant tensors, handling hundreds or thousands of tensors in a single contraction, and computing gradients through supported autodiff libraries. With no runtime dependencies and support for Python 3.8 and later, it integrates cleanly into existing numerical codebases.

Use it for

  • Speed up large tensor contractions in scientific simulations by automatically finding better computation order
  • Optimize model computations involving complex multi-tensor operations across supported backends
  • Compile and reuse contraction expressions with fixed tensor shapes for repeated high-performance computations
  • Debug and inspect the contraction path chosen by einsum to understand performance bottlenecks
  • Handle gradient computation through tensor contractions using supported autodiff frameworks

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you work with multi-tensor contractions.

The installation is frictionless with no dependencies. The dormant maintenance status (687 days since last release) is a minor concern for long-term compatibility, but the package is marked Production/Stable and has no known vulnerabilities. Install it as a performance tool for existing einsum code rather than as a foundation for new architecture.

Install

opt-einsum on PyPI

Before you install

Low friction installation with no runtime dependencies. Maintenance is dormant (687 days since last release), though the package is marked Production/Stable and supports current Python versions.

License in practice

MIT license (permissive) allows use in both open-source and commercial projects with minimal restrictions.

Quickstart

pip install opt_einsum

from opt_einsum import contract

result = contract('pi,qj,ijkl,rk,sl->pqrs', C, C, I, C, C)

Verify before relying

  • Whether dormant maintenance status affects long-term compatibility with newer array library versions
  • Performance gains on modern hardware and with current optimization strategies in supported backends
  • Specific performance improvements achievable on typical workloads compared to native einsum implementations

Package facts

Licensepermissive license permissive
Python supportSupports the current Python release >=3.8
Install frictionLow. Pure-Python wheel
Runtime dependenciesNone
MaintenanceDormant 687 days since the last release
First released
Downloads25,245,905 / month, #904 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Libraries :: Python Modules

Evidence: opt_einsum-3.4.0-py3-none-any.whl

Tags

Capabilities
einsum optimizationtensor contraction ordereinsum performancetensor algebra optimizationeinsum path planningcontraction path optimizereinsum drop-in replacement
Topics
tensor-optimizationnumerical-computing

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “tensor contraction order”

  • opt-einsumOptimizes the contraction order of einsum expressions to dramatically…
  • cotengraCotengra optimizes the contraction order of large tensor networks and…
  • opt-einsum-fxOptimizes PyTorch einsum operations and functions containing them by…

Give your agent the search over MCP, or paste the wish link into any chat.

More Python Modules packages

idna Worth it
PyPI · Python Modules · released Jun 2026

Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.

Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.

BSD-3-Clausepure Python · 3.9+
1.8Bdownloads / mo
setuptools Worth it
PyPI · Python Modules · released Aug 2026

Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.

MITpure Python · 3.10+
1.6Bdownloads / mo
PyYAML Worth it
PyPI · Python Modules · released Sep 2025

PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.

MITcompiled wheel · 3.8+
1.2Bdownloads / mo
pydantic Worth it
PyPI · Python Modules · released May 2026

Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.

MITpure Python · 3.9+
1.1Bdownloads / mo
annotated-types Worth it
PyPI · Python Modules · released Jul 2026

Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.

Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…

MITpure Python · 3.10+
871.3Mdownloads / mo
typing-inspection Worth it
PyPI · Python Modules · released Aug 2026

Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.

MITpure Python · 3.10+
783.0Mdownloads / mo

See also cotengra · opt-einsum-fx · einx · einops · contractions · spo4onnx · accelforge · tensorflow-model-optimization · einshape · autoray

Further reading