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.
- 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).
- 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.
- 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.
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.
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