Heuristics for Quantum Compiling with a Continuous Gate Set

Marc Grau Davis, Ethan Smith, Ana Tudor, Koushik Sen, Irfan Siddiqi, Costin IancuarXiv 2019

Abstract

In the Noisy Intermediate-Scale Quantum (NISQ) era, the fidelity of quantum circuits is primarily limited by the error rates of multi-qubit operations, specifically CNOT gates. This paper presents a novel quantum circuit synthesis algorithm that utilizes A* search and numerical optimization to minimize CNOT counts. By incorporating hardware topology constraints directly into the synthesis process and leveraging continuous, parameterized single-qubit gates, the proposed tool achieves a 2.4x average reduction in CNOT gates compared to existing state-of-the-art compilers.

Introduction

Quantum computing hardware is currently constrained by noise and decoherence. The CNOT gate is typically the most error-prone component, making its minimization the primary objective for circuit optimization. Existing compilers often suffer from three main drawbacks: excessive circuit depth, ignorance of hardware topology (requiring costly SWAP gate insertions), and high computational costs for finding optimal gate sequences.

To address these challenges, researchers developed a "topology-aware" synthesis tool. Unlike traditional compilers that rely on discrete gate sets and local "peephole" optimization, this approach treats single-qubit gates as continuous rotations and performs a global search for the most efficient circuit structure that implements a target unitary transformation. This allows the compiler to find global shortcuts that traditional methods often miss.

Methods

The synthesis process is framed as a graph search problem, solved using an optimized A* search algorithm.

Tree Search and Expansion

The search space is structured as a tree where the root node represents an empty circuit. Each expansion step involves adding a CNOT gate—placed according to the specific connectivity of the target hardware—followed by parameterized single-qubit "U3" gates on the involved qubits. This approach ensures that the resulting circuit is natively compatible with the hardware topology from the outset, avoiding the need for subsequent SWAP gate insertions.

Decomposition of a unitary transformation into a sequence of parameterized single-qubit gates and a CNOT gate.

Numerical Optimization and Heuristics

For every candidate circuit structure generated during the search, the algorithm employs the COBYLA (Constrained Optimization BY Linear Approximations) numerical optimizer. The optimizer adjusts the parameters of the U3 gates to minimize the distance between the synthesized circuit's unitary $U(n, \bar{x})$ and the target unitary $U_{target}$. This distance is measured using the Hilbert-Schmidt inner product, with a target fidelity threshold of $10^{-10}$.

To guide the search efficiently, a data-driven heuristic function $f(n)$ is used, which combines the current CNOT count with an estimate of the remaining distance to the target unitary. This heuristic significantly prunes the search space by prioritizing paths that appear most promising based on successful trial runs.

The A* search process for quantum circuit synthesis, showing the expansion of nodes and the selection of successors based on the heuristic function f(n).

Results

The algorithm was evaluated using a diverse suite of benchmarks, including the Quantum Fourier Transform (QFT) for 2-4 qubits, the HHL linear systems algorithm, and various quantum kernels such as Toffoli and Fredkin gates.

  • CNOT Reduction: The tool achieved a 2.4x average reduction in CNOT counts compared to UniversalQ, a leading linear algebra-based compiler. In specific benchmarks, the reduction was as high as 5.3x.
  • Superiority over Hand-Tuning: The algorithm demonstrated an ability to find global shortcuts that human experts might miss. For instance, it synthesized a version of the HHL algorithm for a linear topology using only 3 CNOTs, whereas the standard hand-optimized version required 7.
  • Topology Impact: The impact of hardware constraints was significant. When a circuit synthesized for a "bowtie" layout was re-mapped to a "line" layout using standard tools like QISKit, the CNOT count increased by 53% on average. This validates the advantage of synthesizing directly for the target hardware.
  • Search Efficiency: The A* heuristic proved highly effective at managing the search space. Synthesizing a 3-qubit QFT took approximately 7 minutes, whereas a brute-force search exceeded an hour.
  • Extensibility: The researchers also demonstrated the tool's flexibility by successfully synthesizing qutrit (three-level system) circuits, showing it is not strictly limited to qubits.

Discussion and Limitations

While the proposed heuristic search is highly effective for small-scale "building blocks" (up to 5 qubits), the exponential growth of unitary matrices ($2^n \times 2^n$) poses a significant scalability challenge for larger circuits. Future work will focus on partitioning large circuits into smaller, synthesizable blocks and optimizing the numerical bottleneck by migrating the implementation to C++ or utilizing GPU-accelerated tensor network optimizers. By treating synthesis as a global optimization problem rather than a local rewriting task, this approach paves the way for more efficient quantum algorithm execution on near-term hardware.

Summary updated

BibTeX
@misc{davis2019heuristics,
  author = {Marc Grau Davis and Ethan Smith and Ana Tudor and Koushik Sen and Irfan Siddiqi and Costin Iancu},
  title = {{Heuristics for Quantum Compiling with a Continuous Gate Set}},
  year = {2019},
  eprint = {1912.02727},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1912.02727},
}
Figure