Table of Contents
Fetching ...

Quantum Circuit Optimization with AlphaTensor

Francisco J. R. Ruiz, Tuomas Laakkonen, Johannes Bausch, Matej Balog, Mohammadamin Barekatain, Francisco J. H. Heras, Alexander Novikov, Nathan Fitzpatrick, Bernardino Romera-Paredes, John van de Wetering, Alhussein Fawzi, Konstantinos Meichanetzidis, Pushmeet Kohli

TL;DR

AlphaTensor-Quantum is introduced, a deep reinforcement learning method for optimizing quantum circuits that outperforms existing methods and is capable of finding the best human-designed solutions for relevant quantum computations in a fully automated way.

Abstract

A key challenge in realizing fault-tolerant quantum computers is circuit optimization. Focusing on the most expensive gates in fault-tolerant quantum computation (namely, the T gates), we address the problem of T-count optimization, i.e., minimizing the number of T gates that are needed to implement a given circuit. To achieve this, we develop AlphaTensor-Quantum, a method based on deep reinforcement learning that exploits the relationship between optimizing T-count and tensor decomposition. Unlike existing methods for T-count optimization, AlphaTensor-Quantum can incorporate domain-specific knowledge about quantum computation and leverage gadgets, which significantly reduces the T-count of the optimized circuits. AlphaTensor-Quantum outperforms the existing methods for T-count optimization on a set of arithmetic benchmarks (even when compared without making use of gadgets). Remarkably, it discovers an efficient algorithm akin to Karatsuba's method for multiplication in finite fields. AlphaTensor-Quantum also finds the best human-designed solutions for relevant arithmetic computations used in Shor's algorithm and for quantum chemistry simulation, thus demonstrating it can save hundreds of hours of research by optimizing relevant quantum circuits in a fully automated way.

Quantum Circuit Optimization with AlphaTensor

TL;DR

AlphaTensor-Quantum is introduced, a deep reinforcement learning method for optimizing quantum circuits that outperforms existing methods and is capable of finding the best human-designed solutions for relevant quantum computations in a fully automated way.

Abstract

A key challenge in realizing fault-tolerant quantum computers is circuit optimization. Focusing on the most expensive gates in fault-tolerant quantum computation (namely, the T gates), we address the problem of T-count optimization, i.e., minimizing the number of T gates that are needed to implement a given circuit. To achieve this, we develop AlphaTensor-Quantum, a method based on deep reinforcement learning that exploits the relationship between optimizing T-count and tensor decomposition. Unlike existing methods for T-count optimization, AlphaTensor-Quantum can incorporate domain-specific knowledge about quantum computation and leverage gadgets, which significantly reduces the T-count of the optimized circuits. AlphaTensor-Quantum outperforms the existing methods for T-count optimization on a set of arithmetic benchmarks (even when compared without making use of gadgets). Remarkably, it discovers an efficient algorithm akin to Karatsuba's method for multiplication in finite fields. AlphaTensor-Quantum also finds the best human-designed solutions for relevant arithmetic computations used in Shor's algorithm and for quantum chemistry simulation, thus demonstrating it can save hundreds of hours of research by optimizing relevant quantum circuits in a fully automated way.
Paper Structure (58 sections, 25 equations, 18 figures, 3 tables)

This paper contains 58 sections, 25 equations, 18 figures, 3 tables.

Figures (18)

  • Figure 1: Pipeline of AlphaTensor-Quantum. We first extract the non-Clifford components of an input circuit and represent them as a symmetric signature tensor$\mathcal{T}$, a binary tensor depicted as a cube of solid and transparent blocks. We then use AlphaTensor-Quantum to find a low-rank Waring decomposition of that tensor, that is, a set of factors (displayed as columns of blocks) that can be mapped back into an optimized quantum circuit with reduced T-count. In general, there is a one-to-one correspondence between factors and T gates, but AlphaTensor-Quantum can also group factors into gadgets (highlighted in green and blue)---constructions that can be equivalently implemented with fewer T gates than the sum of the factors.
  • Figure 2: Illustration of gadgetization in TensorGame. Nodes in the tree correspond to states, and the number in each node is the immediate reward associated to the action leading to that node. In state (i), the last played action is labeled "a", and state (ii) is reached after playing another action (labeled "b"). From state (ii), playing action "c" leads to state (iii), incurring an additional $-1$ reward. If action "ab" is played instead from state (ii), the reward leading to state (iiib) is $0$ because the move completes a CS gadget (blue path). Similarly, the sequence of moves in the green path completes a Toffoli gadget, and thus the immediate reward in state (vii) is $+4$ so that the last seven actions jointly receive a reward of $-2$ (see \ref{['subsec:system_description']} for details on the gadgetization patterns). With its ability to plan, from state (i) the agent may decide to play actions in the green or blue paths and benefit from the adjusted rewards, or to play other actions that are not part of a gadget (black dashed paths). In this way, AlphaTensor-Quantum can automatically find trade-offs between playing actions that are part of a gadget and actions that are not.
  • Figure 3: Results of AlphaTensor-Quantum on the Mod $5_4$ circuit. (1) The original quantum circuit, which can be implemented with $4$ Toffoli gates (with an equivalent cost of $8$ T gates). (2) The compiled circuit, which has been split into Clifford gates and a subcircuit of just CNOT and T gates (in the highlighted box). (2a) The Waring decomposition corresponding to the highlighted CNOT+T circuit: each T gate corresponds precisely to one of the factors displayed as columns of blocks. (2b) The signature tensor formed from this decomposition. (2c) An alternative Waring decomposition of the tensor found by the RL agent. Again, each factor corresponds one-to-one to a T gate; however in this case the seven factors are grouped into a single Toffoli gadget. (2d) The quantum circuit obtained from this new decomposition. (3) The optimized circuit after having applied AlphaTensor-Quantum, which can be implemented using Clifford gates and a single Toffoli gate (i.e., its equivalent T-count is $2$).
  • Figure 4: Number of Toffoli gates of the optimized circuits found by AlphaTensor-Quantum. (a) For multiplication in finite fields of order $2^m$, AlphaTensor-Quantum finds efficient circuits that significantly outperform the original construction, which scales like $\mathcal{O}(m^2)$. The number of Toffoli gates matches the best known lower bound of the classical circuits barbulescu2012finding for some values of $m$, and scales as $\sim m^{\log_2(3)}$, showing that AlphaTensor-Quantum found an algorithm with the same complexity as Karatsuba's method karatsuba1962multiplication, a classical algorithm for multiplication on finite fields for which a quantum version has not been reported in the literature. (The baselines marked with $\dagger$ are classical circuits, and hence not directly comparable, as naive translations of classical to quantum circuits commonly introduce overheads. To compare, we assume the number of effective Toffoli gates is the number of 1-bit AND gates in the classical circuit.) (b) For binary addition, AlphaTensor-Quantum halves the cost of the circuits from cuccaro2004new matching the state-of-the-art circuits from gidney2018halving. Remarkably, it does so automatically without any prior knowledge of the measurement-based uncomputation technique, which was crucial to their results.
  • Figure 5: An example in which measurement-based uncomputation tricks can be recovered by AlphaTensor-Quantum. Here, a portion of the NC Toff$_3$ circuit is mapped to three CCZ gates, a pair of which share two inputs (in the highlighted box), by the Hadamard gadgetization process (detailed in \ref{['app:subsec:compilation']}). AlphaTensor-Quantum optimizes this pair by expressing it as a single gadget, saving one Toffoli gate with respect to the original construction. This kind of optimization happens often because CCZ gates can usually be moved freely along the circuit, as the corresponding unitary matrix will be diagonal after compilation. This is reminiscent of the temporary logical-AND construction from gidney2018halving, although some patterns with more than two CCZ gates can also be combined in this way.
  • ...and 13 more figures