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

Variational quantum compiling with double Q-learning

Zhimin He, Lvzhou Li, Shenggen Zheng, Yongyao Li, Haozhen SituarXiv 2021

Introduction

In the current "Noisy Intermediate-Scale Quantum" (NISQ) era, quantum computers are powerful but limited by physical constraints and high error rates. Executing a quantum algorithm requires "compiling"—the process of translating a theoretical unitary operation into a sequence of physical gates supported by the hardware. Traditional manual compilation is labor-intensive and often results in suboptimal, "bloated" circuits. This paper introduces a Variational Quantum Compiling (VQC) approach that leverages Double Q-learning to automate the discovery of efficient, hardware-aware quantum circuits.

Methodology: Circuit Design as a Game

The researchers frame the compilation process as a Markov Decision Process (MDP), where an artificial intelligence agent "plays" a game to build the most efficient circuit.

The Reinforcement Learning framework: (a) the state-action graph representing circuit construction, (b) an example circuit structure, and (c) the iterative training loop.

The RL Agent

The core of the system is a Double Q-learning algorithm. Standard Q-learning can suffer from overestimation bias; by using two separate functions to estimate gate values, Double Q-learning provides a more stable training process.

  • State Space: Defined by the current gate type, the target qubit, and the current circuit depth.
  • Action Space: Selecting a gate from the hardware's "native alphabet" and assigning it to specific qubits.
  • Exploration: An $\epsilon$-greedy strategy ensures the agent explores diverse circuit structures before converging on optimal patterns.

Reward and Fidelity

The agent's primary goal is to maximize the Fidelity between the generated circuit $V$ and the target unitary $U$. This is achieved by calculating the overlap between the two operations.

The quantum circuit used to calculate the overlap (fidelity) between the target unitary $U$ and the compiled circuit $V$, serving as the reward signal for the agent.

To further optimize for NISQ hardware, the authors implemented a CNOT penalty. Since two-qubit gates are the primary source of noise and decoherence, rewarding the agent for using fewer CNOTs encourages the discovery of "sparse" circuits that are more robust against errors.

Key Insights and Results

The RL-based compiler demonstrates several advantages over traditional template-based methods:

  1. Hardware Awareness: By restricting the agent's action space to the specific connectivity of a chip (e.g., the IBM 'Ibmq_ourense'), the compiler automatically generates circuits that require no further swapping or routing.
  2. Significant Gate Reduction: In tests such as the 3-qubit W-state preparation (WSP3), the agent discovered a 7-gate solution, whereas standard templates required over 50 gates. Similar efficiency gains were seen in compiling the Toffoli (CCNOT) gate.
  3. Scalability: For larger systems (4-8 qubits), the authors introduced a "block" strategy, using pre-defined gate sequences to manage the growing search space without sacrificing the benefits of RL optimization.

Conclusion

By treating quantum compilation as a reinforcement learning problem, this work moves away from rigid, human-designed templates toward flexible, automated architecture. The resulting circuits are shorter, more hardware-efficient, and inherently more resistant to noise, paving the way for more complex algorithms to run on near-term quantum hardware.

Reference: He, Z., Li, L., Zheng, S., Li, Y., & Situ, H. (2021). Variational quantum compiling with double Q-learning. arXiv:2103.11611v1 [quant-ph].

Summary updated

BibTeX
@misc{he2021variational,
  author = {Zhimin He and Lvzhou Li and Shenggen Zheng and Yongyao Li and Haozhen Situ},
  title = {{Variational quantum compiling with double Q-learning}},
  year = {2021},
  eprint = {2103.11611},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2103.11611},
}
Figure