Metamorphic Testing of Quantum Software based on Stabilizer States
Adrián Marín Boyero, Fynn Otto, Albert Rico, Otfried Gühne, Malte Lochau
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.
Create a lesson
Metadata
- Categories
- quant-ph, cs.SE
Related papers
Stabilizer-Restricted Antidistinguishability in Quantum Computation with Magic States
Shared title terminologyquant-phSelman Ipek
Exact approach to double- and triple-excitation bound state in open quantum systems
Shared title terminologyquant-phX. S. Sun, H. T. Cui, Y. A. Yan et al.
Quantum State Preparation from Nonreversible Markov Chains via Spectral Filtering
Shared title terminologyquant-phWael Drif
Ground-State Chiral Quantum Clusters
Shared title terminologyquant-phMatteo Massaro, Adolfo del Campo
Optimizing Locally Equivalent Graph States in Quantum Computing Using Greedy Best-First Search
Shared title terminologyquant-phSora Harada, Ryo Kuroiwa, Shin Nishio et al.
Quantum Cyclic XYZ Stabilizer Codes
Shared title terminologyquant-phAlessio Baldelli, Francisco Lázaro, Davide Orsucci et al.