Table of Contents
Fetching ...

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.

EinExprs: Contraction Paths of Tensor Networks as Symbolic Expressions

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.
Paper Structure (10 sections, 2 equations, 5 figures)

This paper contains 10 sections, 2 equations, 5 figures.

Figures (5)

  • Figure 1: Diagrammatic representation of Equation \ref{['eq:tn-example']} as a Tensor Network.
  • Figure 2: A valid contraction tree of the Tensor Network found in Figure \ref{['fig:tn-example']}. Vertices represent contraction operations, open edges represent initial tensors (except for the final tensor $T$) and closed edges represent intermediate tensors.
  • Figure 3: Illustration of a contraction tree using Makie.jl. Vertices represent tensor contraction operations, with larger sizes and brighter colors for contractions with larger amount of FLOPs. Edges represent intermediate tensors, with larger thickness and brighter colors for larger amount of memory used.
  • Figure 4: Comparison of execution time between EinExprs ($X$-axis) and TensorOperations ($Y$-axis) implementations of the breadth-first exhaustive optimizer. Samples above the dashed line where solved faster with EinExprs than with TensorOperations, and vice-versa. Orange samples had no initial estimation of the contraction cost, while green samples were initialized with the Greedy optimizer.
  • Figure 5: Comparison of execution time between EinExprs ($X$-axis) and OMEinsumContractionOrders ($Y$-axis) implementations of greedy optimizer. Samples above the dashed line where solved faster with EinExprs than with OMEinsumContractionOrders, and vice-versa. The color indicates the number of tensors.