Preparation and Utilization of Mixed States for Testing Quantum Programs
Due to the growing demand for high-quality quantum programs (QPs), unit testing is employed to check the behavior of QPs. As for quantum inputs of testing, most studies limit test inputs to pure states, whereas mixed states representing probabilistic mixtures of pure states are almost excluded from the test process. Besides, when achieving the input domain coverage, lots of pure-state test cases (PSTCs) with pure states as inputs should be employed, leading to high time costs for testing. To handle that, this article explores using mixed states as test inputs for better utilization of quantum information. From the perspective of input domain coverage, applying mixed-state test cases (MSTCs) replacing PSTCs can simplify the test suite and accordingly promote test efficiency. Owing to the mixture of multiple pure states, a single MSTC is more likely to detect a fault than a PSTC, thereby enhancing test effectiveness. This article then proposes a unit testing framework, including generation and execution of MSTCs. Also, this article presents two guidelines and two parameterized quantum circuits to prepare desired mixed states. Empirical studies evaluate the performance of MSTCs and the experimental results demonstrate that MSCTs generally consume less time and detect more faults than PSTCs.
Authors
- Kai-Yuan Cai (ORCID: https://orcid.org/0000-0002-4546-2407)
- Beibei Yin
- Yuechen Li (ORCID: https://orcid.org/0009-0006-5109-3288)
Institutions
- Beihang University (CN)
Publication Details
- Journal
- ACM Transactions on Software Engineering and Methodology
- Published
- 2025-05-23
- DOI
- https://doi.org/10.1145/3736757
- Citations
- 1
- Primary Topic
- Quantum Information and Cryptography
- Type
- article
- Field-Weighted Citation Impact
- 2.48