EinExprs: Contraction Paths of Tensor Networks as Symbolic Expressions
Sergio Sanchez-Ramirez, Jofre Vallès-Muns, Artur Garcia-Saez
TL;DR
The paper tackles the costly problem of selecting contraction paths in Tensor Networks, which directly impacts computational resources. It introduces EinExprs.jl, a Julia-based framework that represents contraction paths as symbolic expressions (contraction trees) and exposes their partial order for visualization and experimentation. The project implements Exhaustive, Greedy, and Hypergraph-Partitioning optimization strategies, demonstrating up to multi-order-of-magnitude speedups over leading baselines and enabling fast composition of optimizers. The approach supports large-scale quantum tensor-network simulations and provides a foundation for future improvements, including additional optimizers and post-optimization techniques. Overall, EinExprs advances both the theory and practice of contraction-path optimization by unifying symbolic representations, visualization, and modular optimization methods.
Abstract
Tensor Networks are graph representations of summation expressions in which vertices represent tensors and edges represent tensor indices or vector spaces. In this work, we present EinExprs.jl, a Julia package for contraction path optimization that offers state-of-art optimizers. We propose a representation of the contraction path of a Tensor Network based on symbolic expressions. Using this package the user may choose among a collection of different methods such as Greedy algorithms, or an approach based on the hypergraph partitioning problem. We benchmark this library with examples obtained from the simulation of Random Quantum Circuits (RQC), a well known example where Tensor Networks provide state-of-the-art methods.
