Skip to content
DraconiticResearch
Search Sources API
186,631 studies31 sourcesUpdated 38 min ago
PreprintarXiv licencearXiv

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.

Related

  1. Evaluating the Effect of the Order of Optimization Passes in Quantum Circuit Optimization
    Xiao-Ting Michelle To, Nils Quetschlich, Amr Elsharkawy +3
    arXivPreprintCC BY 4.0Full textQuantum physics & quantum informationarXiv
  2. QBX: A Compiler for 2-local Qubit Hamiltonian Simulation on Quantum Chiplets
    Zikun Li, Zhuoming Chen, Zhihao Jia
    arXivPreprintCC BY 4.0Full textQuantum physics & quantum informationarXiv
  3. GadIR: A Spatial-Topology Preserving Compiler for Quantum Many-Body Systems Simulation
    Xiangyu Ren, Yuexun Huang, Zhaohui Yang +5
    arXivPreprintCC BY-NC-SA 4.0Full textQuantum physics & quantum informationarXiv
  4. Quantum Compiler Design for Fault-Tolerant Quantum Computing
    Chenghong Zhu, Jiahan Chen, Keming He +9
    arXivPreprintarXiv licenceFull textQuantum physics & quantum informationarXiv
  5. Turning Quantum Compiler Configuration Selection Upside Down: A Top-Down Paradigm
    Ming Zhong, Xiangyu Ren, Kangyu Zheng +4
    arXivPreprintCC BY 4.0Full textQuantum physics & quantum informationarXiv
BibTeX
@misc{khan2026retromorphic,
  title = {{Retromorphic Testing of Quantum Compiler Passes}},
  author = {Mushahid Khan and Olivia Di Matteo},
  howpublished = {arXiv},
  year = {2026},
  month = oct,
  doi = {10.48550/arxiv.2610.11195},
  eprint = {2610.11195},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2610.11195},
}
RIS
TY  - UNPB
TI  - Retromorphic Testing of Quantum Compiler Passes
AU  - Mushahid Khan
AU  - Olivia Di Matteo
PY  - 2026
DA  - 2026/10/08
PB  - arXiv
DO  - 10.48550/arxiv.2610.11195
UR  - https://arxiv.org/abs/2610.11195
AB  - 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.
ER  -