104 Downloads
Updated 30 Apr 2020

Einstein Sommation like Numpy's einsum
Input :
- str : String like 'ik,kj-> ij'
- varargin : Double called
Output :
- Out : Double
Usage :
Matrix multiplication C = A*B
A(ik)*B(kj) = C(ij) -> C=einsum('ik,kj->ij',A,B)
Limitations :
- Taking "diagonal terms" for an nd-array isn't permitted
ex : 'iij,jk -> ik'
- Be careful about approximation error
ex : Doing A^12 with einsum gives you a N_inf(relative_error) around 1E-10

Stephane Nachar - LMT - stephane.nachar@lmt.ens-cachan.fr

Cite As

Stéphane Nachar (2026). einsum (https://github.com/SNachar/einsum), GitHub. Retrieved .

MATLAB Release Compatibility
Created with R2016b
Compatible with R2016b to R2018b
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Versions that use the GitHub default branch cannot be downloaded

Version Published Release Notes
1.0.0

To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.