NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Quantum Compiling with Reinforcement Learning on a Superconducting Processor

Z. T. Wang, Qiuhao Chen, Yuxuan Du, Z. H. Yang, Xiaoxia Cai, Kaixuan Huang, Jingning Zhang, Kai Xu, Jun Du, Yinan Li, Yuling Jiao, Xingyao Wu, Wu Liu, Xiliang Lu, Huikai Xu, Yirong Jin, Ruixia Wang, Haifeng Yu, S. P. ZhaoarXiv 2024 · DOI

Introduction

In the current "Noisy Intermediate-Scale Quantum" (NISQ) era, quantum computing is a race against decoherence. Qubits possess extremely short coherence times, and gate operations are inherently prone to errors. To execute algorithms successfully, the resulting quantum circuits must be as compact as possible. However, quantum compiling—the translation of high-level algorithms into hardware-native gate sequences—is an NP-hard problem. Standard compilers typically rely on local heuristics that often produce sub-optimal, lengthy gate sequences, leading to cumulative noise that destroys quantum information before a computation can complete.

To address this, researchers have developed a reinforcement learning (RL)-based quantum compiler that "codesigns" software with specific hardware constraints. By moving beyond local optimizations to a global search strategy, this approach discovers novel, hardware-efficient circuit structures that significantly boost execution fidelity on real superconducting hardware.

Methods

The proposed compiler utilizes a two-stage approach consisting of precompilation and inference, followed by variational fine-tuning.

  1. Deep Q-Network (DQN): During the precompilation phase, an RL agent is trained to understand the "value" of various quantum gate sequences. Using a ResNet-style architecture, the agent learns to predict the number of steps required to reach a target unitary matrix from a given state. This training involves billions of synthetic examples (e.g., 27.4 billion for 3-qubit systems).
  2. AQ* Search: During inference, the trained DQN guides a heuristic search algorithm called AQ*. Instead of an exhaustive search, the agent uses its learned intuition to prioritize promising paths, drastically reducing the search space and finding shorter gate sequences.
  3. Variational RL (VRL) Fine-tuning: Once a discrete gate sequence is identified, a variational post-processing toolkit fine-tunes the continuous parameters of single-qubit gates while keeping the "expensive" two-qubit gates fixed, further optimizing fidelity.
Overview of the RL-based quantum compiling pipeline, showing the Deep Q-network guiding the generation of gate sequences for a quantum processor.

Experimental Results

The compiler was tested on a 9-qubit superconducting processor with tunable couplers. A primary benchmark was the 3-qubit Quantum Fourier Transform (QFT). The RL compiler discovered a circuit using only seven CZ gates, nearly half the 15 gates required by the industry-standard Qiskit compiler.

The Fidelity-Length Paradox

A key insight from this research is the "Fidelity-Length Paradox": a circuit with lower theoretical mathematical fidelity can actually yield higher experimental fidelity. This occurs because the RL compiler produces significantly shorter circuits; the reduction in hardware noise from fewer gates outweighs slight mathematical approximation errors. On the 3-qubit QFT task, the RL-compiled circuit achieved an experimental fidelity of $F_2 \approx 0.834$, compared to $F_2 \approx 0.739$ for Qiskit.

Comparison of performance metrics between Qiskit and the RL compiler, demonstrating significant reductions in gate count (N2) and improvements in experimental fidelity.

Topological Awareness

The RL agent is trained specifically on the hardware's connectivity map. When compiling gates between non-adjacent qubits, the RL compiler reduced the gate count by over 80% compared to standard methods, which typically rely on heavy SWAP gate overhead.

Discussion and Future Work

While the RL-based compiler demonstrates superior circuit optimization, it faces scalability challenges. The training data requirements grow exponentially with the number of qubits, and the compilation process itself is currently slower than heuristic-based methods. Future research will focus on developing symmetry-aware architectures and incorporating supervised learning to penalize redundant sequences, aiming to extend these global optimization benefits to larger-scale quantum systems.

Summary updated

BibTeX
@misc{wang2024quantum,
  author = {Z. T. Wang and Qiuhao Chen and Yuxuan Du and Z. H. Yang and Xiaoxia Cai and Kaixuan Huang and Jingning Zhang and Kai Xu and Jun Du and Yinan Li and Yuling Jiao and Xingyao Wu and Wu Liu and Xiliang Lu and Huikai Xu and Yirong Jin and Ruixia Wang and Haifeng Yu and S. P. Zhao},
  title = {{Quantum Compiling with Reinforcement Learning on a Superconducting Processor}},
  year = {2024},
  eprint = {2406.12195},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2406.12195},
}
Figure