Challenges
Datasets
Workspaces
Papers
Discussions
Leaderboard
Log inSign up
Challenges
Datasets
Workspaces
Papers
Discussions
Leaderboard
Blog
Job Board
Q3AS

© 2026 Aqora Quantum S.A.S.

TermsPrivacyLegal Notice

arXiv:2611.18838

Metamorphic Testing of Quantum Software based on Stabilizer States

Adrián Marín Boyero, Fynn Otto, Albert Rico, Otfried Gühne, Malte Lochau

quant-phcs.SESubmitted Nov 13, 2026• Announced Nov 17, 2026• 0 citations
arXivHTMLPDF

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.

AI Summary

The paper asks how to generate additional quantum-software tests without independently constructing an output oracle and measurement procedure for each input. It formalizes quantum metamorphic relations as transformations of classical inputs, measurement strategies, and expected outcome distributions, with a composition rule. The application tests graph-state preparation using qubit permutations, local complementation, and CNOT-based graph transformations. Known stabilizer measurements are transported to follow-up tests. Permutations and local complementation preserve Pauli weight; CNOT-based tests instead insert inverse entangling operations before the source measurements. This reuses low-weight checks rather than searching for them anew, a task whose associated minimum-weight decision problem is NP-complete. The Qiskit evaluation uses 24-qubit random graphs postselected to admit stabilizers of weight at most four, with 204 tests per trial. Across 500 runtime trials, independently generated tests take 64.02 seconds on average, versus approximately 2.3–3.48 seconds for metamorphic variants. Across 2,500 mutation trials, mixed-relation variants achieve fault detection comparable to the baseline; median detection time is about 0.27 seconds versus 1.7 seconds. Local complementation alone misses more faults. A separate 1,010-case compiler campaign identifies nontermination in `LookaheadSwap`: 132 compilations time out, or 45.5% of those using that router. This bug is detected by timeouts, not violated metamorphic relations. Stated limitations include dependence on transformation correctness, randomized sampling, and restricted fault models and inputs. Equivalent mutations are undetectable. Hardware-specific noise robustness and extensions beyond stabilizer states remain future work.

Little sign of AI-generated textIncrementalStrong assumptions

Error found: The reported 18–28-fold runtime reduction is established only for postselected graph-state tests with low-weight stabilizers, so the abstract's wording about randomly generated input states needs that qualification. The supplied results do not numerically substantiate the discussion's detection-effectiveness claims across the remaining mutation classes.

Written by gpt-6.1-sol from the paper's full text. Automated: it can be wrong.

DOI
10.48550/arxiv.2611.18838

Related papers

Metamorphic testing of oracle quantum programs

Rui Abreu, João Paulo Fernandes, Luis Llana +1 more

Quantum Computing is regarded with a growing sense of excitement and expectation. While the preliminary evidences of its practical interest accumulate, there are numerous challenges that must be addressed before quantum computing can reach generalized adoption and realize its full potential. One such challenge concerns assessing whether a quantum program is correct, namely in the sense that it implements the desired functionality. In the classical realm, program testing is a well-established approach to find defects in programs. While this approach should inspire quantum software development, porting classical testing techniques to the quantum world is by no means trivial. We propose a novel approach to test quantum programs. Our approach is based on the use of metamorphic relations, which allows us to overcome the well-known quantum measurement problem. We describe a series of exploratory experiments whose results provide evidence of the usefulness of our approach.

•May 18, 2022•73 citations

Metamorphic Testing of Quantum Query Algorithms

Sinhué García-Gil, Luis Llana, José Ignacio Requeno

Testing quantum programs remains challenging due to probabilistic measurement and the difficulty of establishing reliable test oracles. Although metamorphic testing, MT, has been explored in quantum software, its fault-detection effectiveness and input requirements remain insufficiently investigated. To address these challenges, we propose six metamorphic relations, MRs, for three quantum query algorithms: Deutsch-Jozsa, Bernstein-Vazirani, and Simon. We introduce a testing structure that translates these relations into executable tests and integrates with QCRMut to automate mutant generation, test execution, and evaluation. Some MRs also allow checks before measurement, minimising dependence on statistical analysis of measurement outcomes. We systematically evaluate the validity and fault-detection effectiveness of the proposed MRs through three experiments. Exhaustive evaluation confirms their validity for the selected configurations, with mutation scores ranging from 41.80% to 83.59%. We then investigate input reduction across 20 random selections per configuration, finding that all selections reproduce their exhaustive mutation scores within 15 inputs. Finally, we examine larger configurations without exhaustive reference scores, observing mutation-score stabilisation within the evaluated range. These findings demonstrate the fault-detection capability of the proposed MRs and show that reduced input sets can preserve this effectiveness, supporting MT as a promising approach when exhaustive evaluation becomes computationally impractical.

•Nov 12, 2026•0 citations

MorphQ: Metamorphic Testing of the Qiskit Quantum Computing Platform

Matteo Paltenghi, Michael Pradel

As quantum computing is becoming increasingly popular, the underlying quantum computing platforms are growing both in ability and complexity. Unfortunately, testing these platforms is challenging due to the relatively small number of existing quantum programs and because of the oracle problem, i.e., a lack of specifications of the expected behavior of programs. This paper presents MorphQ, the first metamorphic testing approach for quantum computing platforms. Our two key contributions are (i) a program generator that creates a large and diverse set of valid (i.e., non-crashing) quantum programs, and (ii) a set of program transformations that exploit quantum-specific metamorphic relationships to alleviate the oracle problem. Evaluating the approach by testing the popular Qiskit platform shows that the approach creates over 8k program pairs within two days, many of which expose crashes. Inspecting the crashes, we find 13 bugs, nine of which have already been confirmed. MorphQ widens the slim portfolio of testing techniques of quantum computing platforms, helping to create a reliable software stack for this increasingly important field.

arXiv:2206.01111•ACM/IEEE International Conference on Software Engineering: Companion Proceedings (ICSE-Companion)•May 1, 2023•117 citations

MorphQ++: A Reproducibility Study of Metamorphic Testing on Quantum Compilers

Linsey Kitt, Myra B. Cohen

Quantum computing has been rapidly expanding, and many platforms for writing programs that can be compiled and run on quantum hardware (or simulated) are being developed. As with any compiler, transformation correctness is paramount as the machine readable code must maintain program semantics. Quantum programs are challenging to test given a lack of benchmark programs and the difficulty of defining an oracle. MorphQ solves both of these challenges by (1) generating syntactically correct quantum programs and (2) using metamorphic testing to avoid the oracle problem. However, Qiskit, the compiler it was built for, is rapidly evolving. This paper is a reproducibility study of the MorphQ platform, which we call MorphQ++. We have updated the core MorphQ engine to work on a newer version of Qiskit and added new metamorphic transformations. We find that our overall results are similar: we find a portion of the original faults (which were not yet fixed) and the distributions of types are not very different. Our new transformations lead to several new faults, suggesting there is room to expand the core framework. Additionally, we note the lack of power of the metamorphic relations in this context and suggest the need for more sophisticated relations and/or oracle evaluations.

IEEE/ACM International Conference on Automated Software Engineering Workshops (ASEW)•Oct 27, 2024•8 citations

Regression testing of an evolving quantum platform

Linsey Kitt

Quantum computing is a field that has drawn a lot of attention over the years as it has shown great potential to solve new problems and has seen rapid development. To meet the demands of this rapid development, software engineering researchers have been studying methods to address the unique challenges presented by the probabilistic nature of quantum computing in its software platforms. One important aspect of this is understanding how to test and validate quantum software platforms when the expected outputs when running a program are not always known. Recent research using metamorphic testing was able to detect 13 faults in the Qiskit quantum computing platform; however, this is a rapidly evolving platform. Since their work, Qiskit has already advanced ahead several versions, which brings up more questions regarding research for quantum software platforms: do these tools researchers create hold up across versions of these frequently-updated platforms, and how much work does it take to maintain and extend these tools? In this thesis, we study the ease of regression testing in the context of this quantum computing platform. We update to the latest version of Qiskit, extend two existing metamorphic transformations on a metamorphic testing platform for Qiskit, add six new metamorphic transformations, and perform a set of metamorphic testing runs to analyze how our changes perform. In doing so, we were able to discover five additional new faults on the Qiskit platform; however, we also uncovered several challenges, which we synthesize for the reader. We also offer discussion on where the future work of metamorphic testing on quantum software platforms may lead based on our challenges and successes during this process.

•Jan 1, 2024•0 citations

MorphQ++: A Reproducibility Study of Metamorphic Testing on Quantum Compilers

Linsey Kitt, Myra B. Cohen

Quantum computing has been rapidly expanding, and many platforms for writing programs that can be compiled and run on quantum hardware (or simulated) are being developed. As with any compiler, transformation correctness is paramount as the machine readable code must maintain program semantics. Quantum programs are challenging to test given a lack of benchmark programs and the difficulty of defining an oracle. MorphQ solves both of these challenges by (1) generating syntactically correct quantum programs and (2) using metamorphic testing to avoid the oracle problem. However, Qiskit, the compiler it was built for, is rapidly evolving. This paper is a reproducibility study of the MorphQ platform, which we call MorphQ++. We have updated the core MorphQ engine to work on a newer version of Qiskit and added new metamorphic transformations. We find that our overall results are similar: we find a portion of the original faults (which were not yet fixed) and the distributions of types are not very different. Our new transformations lead to several new faults, suggesting there is room to expand the core framework. Additionally, we note the lack of power of the metamorphic relations in this context and suggest the need for more sophisticated relations and/or oracle evaluations.

•Oct 27, 2024•5 citations
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.
The paper asks how to generate additional quantum-software tests without independently constructing an output oracle and measurement procedure for each input. It formalizes quantum metamorphic relations as transformations of classical inputs, measurement strategies, and expected outcome distributions, with a composition rule.
The application tests graph-state preparation using qubit permutations, local complementation, and CNOT-based graph transformations. Known stabilizer measurements are transported to follow-up tests. Permutations and local complementation preserve Pauli weight; CNOT-based tests instead insert inverse entangling operations before the source measurements. This reuses low-weight checks rather than searching for them anew, a task whose associated minimum-weight decision problem is NP-complete.
The Qiskit evaluation uses 24-qubit random graphs postselected to admit stabilizers of weight at most four, with 204 tests per trial. Across 500 runtime trials, independently generated tests take 64.02 seconds on average, versus approximately 2.3–3.48 seconds for metamorphic variants. Across 2,500 mutation trials, mixed-relation variants achieve fault detection comparable to the baseline; median detection time is about 0.27 seconds versus 1.7 seconds. Local complementation alone misses more faults. A separate 1,010-case compiler campaign identifies nontermination in LookaheadSwap: 132 compilations time out, or 45.5% of those using that router. This bug is detected by timeouts, not violated metamorphic relations.
Stated limitations include dependence on transformation correctness, randomized sampling, and restricted fault models and inputs. Equivalent mutations are undetectable. Hardware-specific noise robustness and extensions beyond stabilizer states remain future work.
Quantum Computing is regarded with a growing sense of excitement and expectation. While the preliminary evidences of its practical interest accumulate, there are numerous challenges that must be addressed before quantum computing can reach generalized adoption and realize its full potential. One such challenge concerns assessing whether a quantum program is correct, namely in the sense that it implements the desired functionality. In the classical realm, program testing is a well-established approach to find defects in programs. While this approach should inspire quantum software development, porting classical testing techniques to the quantum world is by no means trivial. We propose a novel approach to test quantum programs. Our approach is based on the use of metamorphic relations, which allows us to overcome the well-known quantum measurement problem. We describe a series of exploratory experiments whose results provide evidence of the usefulness of our approach.
Testing quantum programs remains challenging due to probabilistic measurement and the difficulty of establishing reliable test oracles. Although metamorphic testing, MT, has been explored in quantum software, its fault-detection effectiveness and input requirements remain insufficiently investigated. To address these challenges, we propose six metamorphic relations, MRs, for three quantum query algorithms: Deutsch-Jozsa, Bernstein-Vazirani, and Simon. We introduce a testing structure that translates these relations into executable tests and integrates with QCRMut to automate mutant generation, test execution, and evaluation. Some MRs also allow checks before measurement, minimising dependence on statistical analysis of measurement outcomes. We systematically evaluate the validity and fault-detection effectiveness of the proposed MRs through three experiments. Exhaustive evaluation confirms their validity for the selected configurations, with mutation scores ranging from 41.80% to 83.59%. We then investigate input reduction across 20 random selections per configuration, finding that all selections reproduce their exhaustive mutation scores within 15 inputs. Finally, we examine larger configurations without exhaustive reference scores, observing mutation-score stabilisation within the evaluated range. These findings demonstrate the fault-detection capability of the proposed MRs and show that reduced input sets can preserve this effectiveness, supporting MT as a promising approach when exhaustive evaluation becomes computationally impractical.
As quantum computing is becoming increasingly popular, the underlying quantum computing platforms are growing both in ability and complexity. Unfortunately, testing these platforms is challenging due to the relatively small number of existing quantum programs and because of the oracle problem, i.e., a lack of specifications of the expected behavior of programs. This paper presents MorphQ, the first metamorphic testing approach for quantum computing platforms. Our two key contributions are (i) a program generator that creates a large and diverse set of valid (i.e., non-crashing) quantum programs, and (ii) a set of program transformations that exploit quantum-specific metamorphic relationships to alleviate the oracle problem. Evaluating the approach by testing the popular Qiskit platform shows that the approach creates over 8k program pairs within two days, many of which expose crashes. Inspecting the crashes, we find 13 bugs, nine of which have already been confirmed. MorphQ widens the slim portfolio of testing techniques of quantum computing platforms, helping to create a reliable software stack for this increasingly important field.
Quantum computing has been rapidly expanding, and many platforms for writing programs that can be compiled and run on quantum hardware (or simulated) are being developed. As with any compiler, transformation correctness is paramount as the machine readable code must maintain program semantics. Quantum programs are challenging to test given a lack of benchmark programs and the difficulty of defining an oracle. MorphQ solves both of these challenges by (1) generating syntactically correct quantum programs and (2) using metamorphic testing to avoid the oracle problem. However, Qiskit, the compiler it was built for, is rapidly evolving. This paper is a reproducibility study of the MorphQ platform, which we call MorphQ++. We have updated the core MorphQ engine to work on a newer version of Qiskit and added new metamorphic transformations. We find that our overall results are similar: we find a portion of the original faults (which were not yet fixed) and the distributions of types are not very different. Our new transformations lead to several new faults, suggesting there is room to expand the core framework. Additionally, we note the lack of power of the metamorphic relations in this context and suggest the need for more sophisticated relations and/or oracle evaluations.
Quantum computing is a field that has drawn a lot of attention over the years as it has shown great potential to solve new problems and has seen rapid development. To meet the demands of this rapid development, software engineering researchers have been studying methods to address the unique challenges presented by the probabilistic nature of quantum computing in its software platforms. One important aspect of this is understanding how to test and validate quantum software platforms when the expected outputs when running a program are not always known. Recent research using metamorphic testing was able to detect 13 faults in the Qiskit quantum computing platform; however, this is a rapidly evolving platform. Since their work, Qiskit has already advanced ahead several versions, which brings up more questions regarding research for quantum software platforms: do these tools researchers create hold up across versions of these frequently-updated platforms, and how much work does it take to maintain and extend these tools? In this thesis, we study the ease of regression testing in the context of this quantum computing platform. We update to the latest version of Qiskit, extend two existing metamorphic transformations on a metamorphic testing platform for Qiskit, add six new metamorphic transformations, and perform a set of metamorphic testing runs to analyze how our changes perform. In doing so, we were able to discover five additional new faults on the Qiskit platform; however, we also uncovered several challenges, which we synthesize for the reader. We also offer discussion on where the future work of metamorphic testing on quantum software platforms may lead based on our challenges and successes during this process.
Quantum computing has been rapidly expanding, and many platforms for writing programs that can be compiled and run on quantum hardware (or simulated) are being developed. As with any compiler, transformation correctness is paramount as the machine readable code must maintain program semantics. Quantum programs are challenging to test given a lack of benchmark programs and the difficulty of defining an oracle. MorphQ solves both of these challenges by (1) generating syntactically correct quantum programs and (2) using metamorphic testing to avoid the oracle problem. However, Qiskit, the compiler it was built for, is rapidly evolving. This paper is a reproducibility study of the MorphQ platform, which we call MorphQ++. We have updated the core MorphQ engine to work on a newer version of Qiskit and added new metamorphic transformations. We find that our overall results are similar: we find a portion of the original faults (which were not yet fixed) and the distributions of types are not very different. Our new transformations lead to several new faults, suggesting there is room to expand the core framework. Additionally, we note the lack of power of the metamorphic relations in this context and suggest the need for more sophisticated relations and/or oracle evaluations.