EinExprs is deeply inspired by opt_einsum and cotengra. Actually most of the contraction path search and slicing algorithms have been rewritten from there. If you happen to be working in Python, you should definetely check out these libraries.

Differences with `opt_einsum`

Although the differences are minimal, any user coming from opt_einsum should be aware that:

  • The "optimal" contraction path solver in opt_einsum is known as Exhaustive in EinExprs.
  • The "random-greedy" contraction path solver in opt_einsum is the Greedy optimizer in EinExprs but with a random choose function.
  • When counting FLOPs, opt_einsum gives a value $\times 2$ higher than the EinExprs.flops counter.[1]

Although we believe there is no similar project in the Julia world, there are some overlapping libraries that may suit you if EinExprs doesn't fit your case.

  • 1We are not sure of the reason behind this mismatch or which package gives the correct answer, but since the factor remains constant, it should not affect when comparing contraction paths during the minimization step.