Table of Contents
Fetching ...

Local Optimization of Quantum Circuits (Extended Version)

Jatin Arora, Mingkuan Xu, Sam Westrick, Pengyu Liu, Dantong Li, Yongshan Ding, Umut A. Acar

TL;DR

This paper tackles the challenge of efficiently optimizing large quantum circuits while providing quality guarantees. It introduces local optimality, formalizes it with Laqe and a rewrite semantics, and then develops the OAC algorithm that uses circuit cutting and a lazy melding strategy to produce locally optimal circuits with a provable linear bound on oracle calls. Empirically, OAC, when paired with an oracle like VOQC, achieves more than an order of magnitude speedups and gate-count reductions competitive with or better than state-of-the-art optimizers across diverse circuit families. The work demonstrates that local optimality is a strong and practical optimization criterion for large quantum circuits and can serve as a scalable amplifier for existing global optimizers, with potential extensions to other gate sets and objectives.

Abstract

Recent advances in quantum architectures and computing have motivated the development of new optimizing compilers for quantum programs or circuits. Even though steady progress has been made, existing quantum optimization techniques remain asymptotically and practically inefficient and are unable to offer guarantees on the quality of the optimization. Because many global quantum circuit optimization problems belong to the complexity class QMA (the quantum analog of NP), it is not clear whether quality and efficiency guarantees can both be achieved. In this paper, we present optimization techniques for quantum programs that can offer both efficiency and quality guarantees. Rather than requiring global optimality, our approach relies on a form of local optimality that requires each and every segment of the circuit to be optimal. We show that the local optimality notion can be attained by a cut-and-meld circuit optimization algorithm. The idea behind the algorithm is to cut a circuit into subcircuits, optimize each subcircuit independently by using a specified "oracle" optimizer, and meld the subcircuits by optimizing across the cuts lazily as needed. We specify the algorithm and prove that it ensures local optimality. To prove efficiency, we show that, under some assumptions, the main optimization phase of the algorithm requires a linear number of calls to the oracle optimizer. We implement and evaluate the local-optimality approach to circuit optimization and compare with the state-of-the-art optimizers. The empirical results show that our cut-and-meld algorithm can outperform existing optimizers significantly, by more than an order of magnitude on average, while also slightly improving optimization quality. These results show that local optimality can be a relatively strong optimization criterion and can be attained efficiently.

Local Optimization of Quantum Circuits (Extended Version)

TL;DR

This paper tackles the challenge of efficiently optimizing large quantum circuits while providing quality guarantees. It introduces local optimality, formalizes it with Laqe and a rewrite semantics, and then develops the OAC algorithm that uses circuit cutting and a lazy melding strategy to produce locally optimal circuits with a provable linear bound on oracle calls. Empirically, OAC, when paired with an oracle like VOQC, achieves more than an order of magnitude speedups and gate-count reductions competitive with or better than state-of-the-art optimizers across diverse circuit families. The work demonstrates that local optimality is a strong and practical optimization criterion for large quantum circuits and can serve as a scalable amplifier for existing global optimizers, with potential extensions to other gate sets and objectives.

Abstract

Recent advances in quantum architectures and computing have motivated the development of new optimizing compilers for quantum programs or circuits. Even though steady progress has been made, existing quantum optimization techniques remain asymptotically and practically inefficient and are unable to offer guarantees on the quality of the optimization. Because many global quantum circuit optimization problems belong to the complexity class QMA (the quantum analog of NP), it is not clear whether quality and efficiency guarantees can both be achieved. In this paper, we present optimization techniques for quantum programs that can offer both efficiency and quality guarantees. Rather than requiring global optimality, our approach relies on a form of local optimality that requires each and every segment of the circuit to be optimal. We show that the local optimality notion can be attained by a cut-and-meld circuit optimization algorithm. The idea behind the algorithm is to cut a circuit into subcircuits, optimize each subcircuit independently by using a specified "oracle" optimizer, and meld the subcircuits by optimizing across the cuts lazily as needed. We specify the algorithm and prove that it ensures local optimality. To prove efficiency, we show that, under some assumptions, the main optimization phase of the algorithm requires a linear number of calls to the oracle optimizer. We implement and evaluate the local-optimality approach to circuit optimization and compare with the state-of-the-art optimizers. The empirical results show that our cut-and-meld algorithm can outperform existing optimizers significantly, by more than an order of magnitude on average, while also slightly improving optimization quality. These results show that local optimality can be a relatively strong optimization criterion and can be attained efficiently.

Paper Structure

This paper contains 43 sections, 16 theorems, 9 equations, 18 figures.

Key Result

lemma 1

For every circuit $C$ where ${C}~\textsf{locally-optimal}_{\Omega}$, there is no $C'$ such that ${C} \overset{\Omega}{\longmapsto} {C'}$.

Figures (18)

  • Figure 1: Syntax of Laqe and well-formed circuits.
  • Figure 2: Definition of local optimality, parameterized by a $\mathbf{cost}$ function, an $\mathbf{oracle}$ optimizer, and a segment length $\Omega$.
  • Figure 3: Local optimization rewrite rules.
  • Figure 4: The figure illustrates how our rewriting semantics optimizes circuits for $\Omega = 2$. The figure implicitly assumes an oracle that removes any two consecutive $H$ and $X$ gates. At each step, our semantics either selects a segment of size $2$ (denoted by green boxes) and performs an optimization, or picks a gate and shifts it left.
  • Figure 5: Algorithm OAC produces locally optimal circuits with respect to a given $\mathbf{oracle}{}$, $\mathbf{cost}{}$, and segment length $\Omega$. To achieve local optimality, OAC only uses the oracle on small segments of length $2\Omega$. The algorithm repeatedly optimizes and compacts the circuit until convergence. The function segopt$()$ implements our optimization algorithm and uses $\mathsf{meld}()$ to efficiently produce segment optimal circuits.
  • ...and 13 more figures

Theorems & Definitions (21)

  • lemma 1
  • lemma 2
  • definition 1
  • Theorem 1: Termination
  • Lemma 2: Segment optimality of meld
  • Theorem 3: Segment optimality algorithm
  • Theorem 4: Efficiency of segment optimization
  • corollary 1: Linear calls to the oracle
  • Lemma 5: Restatement of Lemma \ref{['lem:meld-is-optimal']}, Segment optimality of meld
  • proof
  • ...and 11 more