Simple heuristics for efficient parallel tensor contraction and quantum circuit simulation

Roman Schutski, Dmitry Kolmakov, Taras Khakhulin, Ivan V. OseledetsarXiv 2020

Abstract

Simulating large-scale quantum circuits on classical hardware is a computationally intensive task primarily governed by the complexity of tensor network contractions. This paper introduces a novel "tree-trimming" heuristic designed to efficiently parallelize these contractions by solving the $\mu$-treewidth deletion problem. By identifying and removing specific nodes from a graph's tree decomposition, the method decomposes massive computations into independent, memory-efficient subtasks. Benchmarks on random quantum circuits demonstrate that this approach can reduce memory requirements by up to four orders of magnitude while maintaining low computational overhead compared to standard local metrics.

Introduction

The simulation of quantum circuits involves massive bookkeeping through tensor contraction. As the number of qubits and gate depth increase, the complexity grows exponentially, a factor directly related to the graph property known as treewidth. To manage this, researchers employ parallel computing by "slicing" the problem—fixing the values of certain variables to create smaller sub-problems that can be solved independently.

Figure 1: The process of sequential tensor contraction, where nodes are merged and edges are eliminated until a single value remains.

The challenge lies in selecting the optimal set of variables to fix. Choosing poorly results in sub-problems that remain too complex for available memory. This selection process is known as the $\mu$-treewidth deletion problem, an NP-complete task. This research explores fast, effective heuristics to find deletion sets that minimize the remaining treewidth of the network.

Methods

The authors represent tensor networks as probabilistic graphical models where tensors are cliques (fully connected subgraphs) and indices are nodes. They evaluated several heuristics for node removal:

  1. Simple Local Metrics: Using node degree (number of neighbors) or betweenness centrality. These are fast but often fail to account for global structure.
  2. Direct Treewidth Minimization: A greedy approach that recalculates the treewidth for every possible node removal. While accurate, it is computationally expensive and slow for large networks.
  3. Tree-Trimming: The primary contribution of this work. This heuristic utilizes an existing Tree Decomposition (TD) of the graph to identify structural bottlenecks.
Figure 3: A tensor network (left) mapped to its corresponding tree decomposition (right), where clusters of nodes are organized into 'bags'.

Tree-trimming identifies the largest "bags" (clusters of nodes) in the TD and removes nodes that form the most significant weighted subtrees. Unlike local metrics, it captures the global structure of the contraction sequence without the prohibitive cost of constant TD recalculation, providing a "non-local" understanding of the computation's complexity.

Key Insights

  • Incremental Gains: Removing a single vertex can only reduce the treewidth of a graph by at most 1. Consequently, effective parallelization is a game of strategic, incremental gains.
  • Global vs. Local: Simple metrics like node degree often fail because they ignore how nodes are reused throughout the contraction process. A node might have few neighbors but be part of a structural "bottleneck" that keeps the treewidth high.
  • TD as a Roadmap: The Tree Decomposition serves as a roadmap of the computation's complexity. By "trimming" the most influential branches of this tree, researchers can systematically collapse the most expensive parts of the calculation.

Results

The heuristics were benchmarked using random quantum circuits, specifically a $7 \times 7$ qubit circuit with a depth of 50, resulting in a network of 723 variables and 1,544 tensors. Key findings include:

  • Memory Efficiency: The tree-trimming heuristic achieved up to $10^4$ times less memory per subtask compared to simple degree-based methods.
  • Computational Performance: Tree-trimming led to a faster decrease in total floating-point operations (FLOPs) as more variables were parallelized.
  • Execution Speed: The execution time for the tree-trimming algorithm grows linearly with the number of removed vertices, making it practical for massive networks where frequent TD recalculation is prohibitively slow.

Conclusion

The tree-trimming heuristic provides a high-performance "sweet spot" between simple local metrics and expensive exact methods. While currently focused on minimizing treewidth and FLOPs, the authors acknowledge that future work must account for physical hardware constraints like communication overhead and memory locality. This approach holds significant promise for broader applications in machine learning and many-body physics simulation.

Summary updated

BibTeX
@misc{schutski2020simple,
  author = {Roman Schutski and Dmitry Kolmakov and Taras Khakhulin and Ivan V. Oseledets},
  title = {{Simple heuristics for efficient parallel tensor contraction and quantum circuit simulation}},
  year = {2020},
  eprint = {2004.10892},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2004.10892},
}
Figure