https://github.com/guilt/einsum
Simple, readable Einstein Summation in Python.
https://github.com/guilt/einsum
einstein-summation einsum machine-learning notation reshape
Last synced: about 1 month ago
JSON representation
Simple, readable Einstein Summation in Python.
- Host: GitHub
- URL: https://github.com/guilt/einsum
- Owner: guilt
- License: mit
- Archived: true
- Created: 2025-07-09T22:45:14.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-07-19T05:24:39.000Z (7 months ago)
- Last Synced: 2025-10-12T10:53:12.106Z (4 months ago)
- Topics: einstein-summation, einsum, machine-learning, notation, reshape
- Language: Python
- Homepage: https://pypi.org/project/python-einsum
- Size: 11.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Einsum
Simple, readable [Einstein Summation](https://en.wikipedia.org/wiki/Einstein_notation) in Python.
```bash
# Install
pip install python-einsum
```
## Simple Example
```python
from 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)
```
## Features
- Easy to Read and Understand
- Supports a variety of Notations
## Development
```bash
# Clone and install
git clone https://github.com/guilt/einsum
cd einsum
pip install -e ".[dev]"
# Run tests
python -m unittest discover tests/ -v
```
## License
MIT License. See [License](LICENSE.md) for details.
## Feedback
Made with ❤️ by [Vibe coding](https://en.wikipedia.org/wiki/Vibe_coding).
* Authors: [Grok 3.0](https://grok.com/), [Claude Sonnet 4](https://anthropic.com/) and [Karthik Kumar Viswanathan](https://github.com/guilt)
* Web : http://karthikkumar.org
* Email : me@karthikkumar.org