TensorNetwork on TensorFlow: A Spin Chain Application Using Tree Tensor Networks

Ashley Milsted, Martin Ganahl, Stefan Leichenauer, Jack Hidary, Guifre VidalarXiv 2019

Abstract

Simulating quantum many-body systems is computationally demanding due to the exponential growth of Hilbert space. Tensor Networks (TNs) provide a powerful framework for approximating these states by representing high-dimensional wavefunctions as networks of smaller tensors. This paper introduces TensorNetwork, an open-source library built on TensorFlow that leverages hardware acceleration for TN algorithms. We demonstrate its utility by implementing a Tree Tensor Network (TTN) to find the ground state of quantum spin systems. Our results show a 100x speedup on GPUs compared to traditional CPU-based methods, with energy convergence scaling predictably as $1/\chi^2$.

Introduction

The simulation of quantum many-body systems is a cornerstone of modern condensed matter physics, yet it faces the "curse of dimensionality." As the number of particles increases, the complexity of the system's wavefunction grows exponentially. Tensor Networks (TNs) address this by representing high-dimensional quantum states as contractions of smaller, interconnected tensors, effectively capturing the entanglement structure of the system.

While architectures like Matrix Product States (MPS) are well-established, their efficient implementation on modern hardware (GPUs and TPUs) remains a significant engineering challenge. Most existing physics software is optimized for CPUs using libraries like NumPy. The TensorNetwork library bridges this gap, providing a high-level interface that automatically utilizes TensorFlow's backend for optimized contractions and linear algebra operations on accelerated hardware.

Methods

We focus on the Tree Tensor Network (TTN) architecture. A TTN organizes tensors in a hierarchical, tree-like structure, offering a balance between the simplicity of MPS and the multi-scale capabilities of the Multi-scale Entanglement Renormalization Ansatz (MERA).

Comparison of common tensor network architectures including MPS, MERA, and TTN.

Unlike MERA, which includes "disentangler" tensors to handle short-range entanglement, TTNs are simpler to optimize because they lack closed loops. This acyclic structure allows for the use of iterative energy minimization procedures. We update each tensor (isometry) individually by calculating its "environment"—the contraction of the rest of the network—and performing a Singular Value Decomposition (SVD) to find the optimal local state. By using the TensorNetwork library, these core operations are offloaded to TensorFlow, enabling seamless execution on NVIDIA GPUs.

Experimental Setup

We benchmarked the TTN algorithm on the Transverse-Field Ising Model, a standard model for studying quantum phase transitions. The simulations were performed on various geometries, including a 1D periodic spin chain and a 2D "thin torus" lattice (128 x 5). We varied the bond dimension ($\chi$), which controls the truncation error and computational cost, from 32 to 256 to evaluate scalability and accuracy.

Results and Discussion

The primary advantage of the TensorNetwork library is its performance on accelerated hardware. For a bond dimension of $\chi = 256$, an NVIDIA Tesla V100 GPU outperformed a single CPU by a factor of 100. Even compared to a 32-core CPU cluster, the GPU remained 6x faster. A full sweep of the network, which took nearly 1,000 seconds on a single CPU, was completed in approximately 10 seconds on the GPU.

Furthermore, we observed that the computational cost on GPUs scales closer to $O(\chi^3)$ rather than the theoretical $O(\chi^4)$ for the tested range. This suggests that GPU efficiency minimizes the impact of the highest-order contractions at these scales, making larger simulations more feasible.

Convergence of ground state energy $e(\chi)$ vs $1/\chi^2$.

As shown in the convergence plots, the ground state energy $e(\chi)$ converges linearly with $1/\chi^2$. This predictable error scaling confirms that the TTN successfully approximates the ground state of the Ising model. The model also accurately captured entanglement entropy across different scales, with results stabilizing for bond dimensions above 128.

Conclusion

The TensorNetwork library significantly lowers the barrier to entry for high-performance quantum simulations. By leveraging TensorFlow's backend, physicists can achieve massive speedups on GPUs without deep expertise in GPU programming. Future work will extend these methods to more complex architectures like MERA, where the higher scaling costs ($O(\chi^7)$ or $O(\chi^9)$) make hardware acceleration even more critical for practical research.

Summary updated

BibTeX
@misc{milsted2019tensornetwork,
  author = {Ashley Milsted and Martin Ganahl and Stefan Leichenauer and Jack Hidary and Guifre Vidal},
  title = {{TensorNetwork on TensorFlow: A Spin Chain Application Using Tree Tensor Networks}},
  year = {2019},
  eprint = {1905.01331},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1905.01331},
}
Figure