Metadata-Version: 2.4
Name: cotengra
Version: 0.8.1
Summary: Hyper optimized contraction trees for large tensor networks and einsums.
Project-URL: Documentation, https://cotengra.readthedocs.io/
Project-URL: Repository, https://github.com/jcmgray/cotengra/
Project-URL: Issues, https://github.com/jcmgray/cotengra/issues
Project-URL: Changelog, https://cotengra.readthedocs.io/en/latest/changelog.html
Author-email: Johnnie Gray <johnniemcgray@gmail.com>
License-Expression: Apache-2.0
License-File: LICENSE.md
Keywords: contraction,einsum,graph,hypergraph,network,partition,tensor
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Python: >=3.10
Requires-Dist: autoray
Provides-Extra: docs
Requires-Dist: astroid; extra == 'docs'
Requires-Dist: furo; extra == 'docs'
Requires-Dist: ipython; extra == 'docs'
Requires-Dist: myst-nb; extra == 'docs'
Requires-Dist: setuptools-scm; extra == 'docs'
Requires-Dist: sphinx; extra == 'docs'
Requires-Dist: sphinx-autoapi; extra == 'docs'
Requires-Dist: sphinx-copybutton; extra == 'docs'
Requires-Dist: sphinx-design; extra == 'docs'
Provides-Extra: recommended
Requires-Dist: cmaes; extra == 'recommended'
Requires-Dist: cotengrust; extra == 'recommended'
Requires-Dist: cytoolz; extra == 'recommended'
Requires-Dist: kahypar; extra == 'recommended'
Requires-Dist: matplotlib; extra == 'recommended'
Requires-Dist: networkx; extra == 'recommended'
Requires-Dist: numpy; extra == 'recommended'
Requires-Dist: opt-einsum; extra == 'recommended'
Requires-Dist: optuna; extra == 'recommended'
Requires-Dist: ray; extra == 'recommended'
Requires-Dist: tqdm; extra == 'recommended'
Description-Content-Type: text/markdown

<p align="left"><img src="https://imgur.com/OM5XyaD.png" alt="cotengra" width="400px"></p>

[![tests](https://github.com/jcmgray/cotengra/actions/workflows/test.yml/badge.svg)](https://github.com/jcmgray/cotengra/actions/workflows/test.yml)
[![codecov](https://codecov.io/gh/jcmgray/cotengra/branch/main/graph/badge.svg?token=Q5evNiuT9S)](https://codecov.io/gh/jcmgray/cotengra)
[![Docs](https://readthedocs.org/projects/cotengra/badge/?version=latest)](https://cotengra.readthedocs.io)
[![PyPI](https://img.shields.io/pypi/v/cotengra?color=teal)](https://pypi.org/project/cotengra/)
[![Anaconda-Server Badge](https://anaconda.org/conda-forge/cotengra/badges/version.svg)](https://anaconda.org/conda-forge/cotengra)
[![Pixi Badge](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/prefix-dev/pixi/main/assets/badge/v0.json)](https://pixi.sh)

`cotengra` is a python library for contracting tensor networks or einsum
expressions involving large numbers of tensors - the main docs can be found
at [cotengra.readthedocs.io](https://cotengra.readthedocs.io/).
Some of the key feautures of `cotengra` include:

* drop-in ``einsum`` and ``ncon`` replacement
* an explicit **contraction tree** object that can be flexibly built, modified and visualized
* a **'hyper optimizer'** that samples trees while tuning the generating meta-paremeters
* **dynamic slicing** for massive memory savings and parallelism
* **simulated annealing** as an alternative optimizing and slicing strategy
* support for **hyper** edge tensor networks and thus arbitrary einsum equations
* **paths** that can be supplied to [`numpy.einsum`](https://numpy.org/doc/stable/reference/generated/numpy.einsum.html), [`opt_einsum`](https://dgasmith.github.io/opt_einsum/), [`quimb`](https://quimb.readthedocs.io/en/latest/) among others
* **performing contractions** with tensors from many libraries via [`autoray`](https://github.com/jcmgray/autoray),
  even if they don't provide `einsum` or `tensordot` but do have (batch) matrix
  multiplication

<p align="center"><img src="https://imgur.com/jMO138y.png" alt="cotengra" width="500px"></p>
