arXiv Science⌕ 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

Entanglement Detection with Rotationally Covariant Measurements -- From Compton Scattering to Lemonade

The accurate and efficient detection of quantum entanglement remains a central challenge in quantum information science. In this work, we study the detection of entanglement of polarized photons for measurement devices that are specified by rotational covariance. We derive explicit positive operator-valued measures (POVMs) showing that any such (idealized) setting is classified by one real measurable parameter r. In particular, we give a POVM formulation of the Klein-Nishina formula for Compton scattering of polarized photons. We provide an SDP-based entanglement certification method with computable bounds that operates on the full measured statistics, also considering semi-device independent scenarios. Furthermore, we show that, while Bell violations are impossible with two rotationally covariant measurements, EPR steering can still be certified under one-sided symmetry constraints. Finally, we demonstrate how our approach can be applied by analyzing a rotationally covariant showcase experiment using scattered polarized light in a selection of soft drinks. Our results motivate further investigation of entanglement detection with lemonade- based detectors.

quant-ph↗

Simulation of topological superconductors and their competing orders using photon-mediated interactions

Realizing and controlling the unconventional pairing featured by topological superconductors remains a central challenge. We introduce a cavity QED quantum simulator that engineers competing chiral $p_x+ip_y$ and $d_{x^2-y^2}+id_{xy}$ orders by tailoring cavity-mediated couplings between atomic pseudospins that emulate momentum-dependent pairing channels. The desired spatially inhomogeneous cavity-mediated couplings can be engineered in a 2D optical lattice using incommensurate cavity-lattice wavelengths naturally occurring in cavity QED systems. This minimal and fully tunable platform enables controlled state preparation and continuous measurement of superconducting order parameters. To probe this competition, the platform enables selective excitation and direct time-domain detection of Bardasis-Schrieffer modes---collective excitations of the subdominant pairing channel. The same competing channel can have an even stronger impact out of equilibrium, where a sudden quench can drive its growth and abruptly reshape the dominant superconducting order, despite the stability of the dominant order in equilibrium. Together, these results establish cavity QED as a controlled setting for revealing hidden competing orders and exploring nonlinear dynamics of topological superconductivity that remain elusive in solid-state and ultracold-atom systems.

quant-ph↗

Contractivity of time-dependent driven-dissipative systems

Experimentally relevant quantum systems are frequently described by a time-dependent Lindblad master equation in which the dissipation due to interaction with an environment is fixed, but the experimenter has control over the Hamiltonian, which therefore can change with time. A fundamental question that is also of practical relevance is to determine when such systems invariably lose information about their initial state (are exponentially contractive independent of the Hamiltonian) or when the control can be used to prevent this loss of information to some degree. Here, we identify the necessary and sufficient criterion on the dissipator for Hamiltonian-invariant contractivity. If the dissipator does not fulfil this criterion, but by itself is exponentially contractive, we also establish exponential contractivity for sufficiently weak or slow drives and construct examples where strong or fast driving prevents exponential contraction.

quant-ph↗