Search arXiv⌕ Search

arXiv · 2610.11195

Retromorphic Testing of Quantum Compiler Passes

Abstract

Quantum compilers play a critical role in transforming high-level quantum programs into optimized, hardware-compatible circuits. However, verifying the correctness of compiler passes remains challenging, as determining the expected output of large, deeply entangled quantum circuits is computationally intractable. This challenge is further amplified when compiler passes modify already complex circuit structures, making manual validation of transformed circuits impractical. In this work, we perform a systematic analysis of unit tests for quantum compiler passes in four quantum programming frameworks (PennyLane, Qiskit, Cirq, and pytket). Our findings indicate validation is dominated by program-content and program-metric assertions, and test circuits are generally small and shallow. Motivated by these observations, we introduce a testing methodology for automated validation of quantum compiler passes based on retromorphic testing and principles from the Hadamard test. This methodology analyzes a compiler pass, test circuit, and expected pass behavior to verify semantic preservation and intended structural modifications. We implement our methods in a framework, RetroQ, and apply it to compiler passes in PennyLane and Qiskit. Experimental evaluation reproduced several existing bugs as well as uncovered previously undetected defects, such as flawed symbolic parameter handling, incorrect commutation logic, failure to recognize self-adjointness of gates, and runtime crashes. These findings highlight the need for compiler-pass-specific testing methodologies to improve the reliability of the evolving quantum software stack.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Mushahid Khan, Olivia Di Matteo. 2026-10-08. Retromorphic Testing of Quantum Compiler Passes. https://arxiv.org/abs/2610.11195

Cite the original work for its findings. Save a collection to share your selection of sources.

KEEP EXPLORING

Related papers

Cavity-mediated cross-cross-resonance gate

We propose a cavity-mediated gate between two transmon qubits or other nonlinear superconducting elements. The gate is realized by driving both qubits at a frequency that is near-resonant with the frequency of the cavity. Since both qubits are subject to a cross-resonant drive, we call this gate a cross-cross-resonance gate. In close analogy with gates between trapped-ion qubits, in phase space, the state of the cavity makes a circle whose area depends on the state of the two qubits, realizing a controlled-phase gate. We propose two schemes for canceling the dominant error, which is the qubit-cavity dispersive coupling. We also show that this cross-cross-resonance gate allows one to realize simultaneous gates between multiple pairs of qubits coupled via the same metamaterial composed of an array of coupled cavities or other linear mediators.

quant-ph↗

Tensors, entanglement, separability, and their complexity

The aim of this paper is to show how to characterize the entanglement and separability of d-partite states, and to obtain both known and new results using the modern theory of tensors. The geometric measure of entanglement of a pure state is one of most natural ways to quantify the entanglement, which is simply related to the spectral norm of a tensor state. On the other hand, the logarithm of the nuclear norm of the state and density tensors can be considered as its ``energy''. We first show that the most geometric measure entangled $d$-partite state has the minimum spectral norm and maximum nuclear norm. Second, we introduce the notion of Hermitian and density tensors, and the subspaces of bi-symmetric and bi-skew-symmetric Hermitian tensors, which correspond to Bosons and Fermions respectively. We show that separable density tensors, and strongly separable bi-symmetric density tensors are characterized by the value (equal to one) of their corresponding nuclear norms. In general, these characterizations are NP-hard to verify. Third, the main result of this paper to show that the above quantities are computed in polynomial time when we restrict our attention to Bosons: symmetric $d$-qubits, or more generally to symmetric $d$-qunits in $\mathbb{C}^n$, and the corresponding bi-symmetric Hermtian density tensors, for a fixed value of $n$.

quant-ph↗

Many-Body Effects in Dark-State Laser Cooling

We develop a unified many-body theory of two-photon dark-state laser cooling, the workhorse for preparing trapped ions close to their motional quantum ground state. For ions with a $Λ$ level structure, driven by Raman lasers, we identify an ion-number-dependent crossover between weak and strong coupling where both the cooling rate and final temperature are simultaneously optimized. We obtain simple analytic results in both extremes: In the weak coupling limit, we show a Lorentzian spin-absorption spectrum determines the cooling rate and final occupation of the motional state, which are both independent of the number of ions. We also highlight the benefit of including an additional spin dependent force in this case. In the strong coupling regime, our theory reveals the role of collective dynamics arising from phonon exchange between dark and bright states, allowing us to explain the enhancement of the cooling rate with increasing ion number. Our analytic results agree closely with exact numerical simulations and provide experimentally accessible guidelines for optimizing cooling in large ion crystals, a key step toward scalable, high-fidelity trapped-ion quantum technologies.

quant-ph↗