Metamorphic Testing of Quantum Software based on Stabilizer States
Adri\'an Mar\'in Boyero, Fynn Otto, Albert Rico, Otfried G\"uhne, Malte Lochau
Key points
From the paper's conclusion- We apply our QMT framework to testing the preparation of stabilizer states, which are central to protocols like measurement-based quantum computing or quantum error correction.
Abstract
A major challenge in quantum computing is to systematically check if a quantum program implements its desired functionality. For classical programs, testing is widely used; each test case comprises a pair of sample input and expected output to be compared with the actual output. To increase the number of test cases, however, one has to solve the test-oracle problem: for each additional test input one has to know the correct output. Metamorphic testing tackles this problem by utilizing metamorphic relations between input and output domains to automatically derive new test cases from existing ones. However, adapting metamorphic testing to the quantum realm is not straightforward, since quantum states cannot be directly inspected. We propose a framework of quantum metamorphic testing (QMT) in which the metamorphic relations incorporate the measurement procedures required to assess quantum outputs. We apply our QMT framework to testing the preparation of stabilizer states, which are central to protocols like measurement-based quantum computing or quantum error correction. We utilize structural properties of stabilizer states to systematically derive measurement circuits for new test cases from existing ones. We implement this framework in Qiskit, and demonstrate that it reduces by an order of magnitude the testing run time compared to testing with randomly generated input states. We further show effectiveness by revealing synthetic program faults injected by circuit mutations, as well as a real bug in the Qiskit compiler.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- Toward Circuit-Aware Mutation Testing for Quantum Programs: Exact Visibility and Execution PlanningarXiv · 2026
- Are We Testing the Wrong Quantum Bugs? A Study of Fault Representation Gaps in Quantum Software TestingarXiv · 2026
- Generalizing and Combining Check Constructions: Design-Space Exploration for Fault-Tolerant Quantum State PreparationarXiv · 2026
- IterTestQ: Assembly-Level, Cross-Platform Testing of Quantum Computing PlatformsProceedings of the ACM on Software Engineering · 2026
- QuSema: Detecting Silent Bugs in Quantum Libraries via Quantum-knowledge-enhanced AgentsarXiv · 2026
- Magic state cultivation with lattice-surgery escape on superconducting hardwarearXiv · 2026