Simple, readable Einstein Summation in Python.
# Install
pip install python-einsumfrom einsum import Einsum
import numpy as np
tensorAb = np.ones((2, 3)) # ab
tensorBd = np.ones((3, 4)) # bd
tensorDc = np.ones((4, 5)) # dc
einsumOp = Einsum("(ab,(bd,dc->bc)->ac)", tensorAb, tensorBd, tensorDc)- Easy to Read and Understand
- Supports a variety of Notations
# Clone and install
git clone https://github.com/guilt/einsum
cd einsum
pip install -e ".[dev]"
# Run tests
python -m unittest discover tests/ -vMIT License. See License for details.
Made with ❤️ by Vibe coding.
- Authors: Grok 3.0, Claude Sonnet 4 and Karthik Kumar Viswanathan
- Web : http://karthikkumar.org
- Email : me@karthikkumar.org