🤖 AI Summary
Quantum software complexity poses significant challenges to the detection of state discrepancies and reliability in unit testing. To address this, we propose a quantum-centric unit testing framework specifically designed for quantum circuits, featuring a novel inverse test technique integrated with statevector testing and SWAP testing—yielding a hybrid verification methodology compatible with both classical simulation and quantum hardware execution. Empirical evaluation across over 1.79 million mutated circuits demonstrates that our approach substantially reduces both false positive and false negative rates compared to conventional statistical testing. Moreover, statevector and inverse tests achieve high-confidence verification with significantly fewer measurements and markedly improved fault detection capability. This work establishes a new unit testing paradigm for quantum software that offers superior accuracy and efficiency in verification.
📝 Abstract
The increasing complexity of quantum software presents significant challenges for software verification and validation, particularly in the context of unit testing. This work presents a comprehensive study on quantum-centric unit tests, comparing traditional statistical approaches with tests specifically designed for quantum circuits. These include tests that run only on a classical computer, such as the Statevector test, as well as those executable on quantum hardware, such as the Swap test and the novel Inverse test. Through an empirical study and detailed analysis on 1,796,880 mutated quantum circuits, we investigate (a) each test's ability to detect subtle discrepancies between the expected and actual states of a quantum circuit, and (b) the number of measurements required to achieve high reliability. The results demonstrate that quantum-centric tests, particularly the Statevector test and the Inverse test, provide clear advantages in terms of precision and efficiency, reducing both false positives and false negatives compared to statistical tests. This work contributes to the development of more robust and scalable strategies for testing quantum software, supporting the future adoption of fault-tolerant quantum computers and promoting more reliable practices in quantum software engineering.