Context-Aware Unit Testing for Quantum Subroutines
Mykhailo Klymenko, Thong Hoang, Samuel A. Wilkinson, Bahar Goldozian, Suyu Ma, Xiwei Xu, Qinghua Lu, Muhammad Usman, Liming Zhu

TL;DR
This paper proposes a context-aware approach to unit testing quantum subroutines, addressing quantum-specific challenges with probabilistic assertions and demonstrating its application on quantum algorithms.
Contribution
It introduces a novel framework for quantum unit testing that incorporates context-awareness to improve efficiency and accuracy.
Findings
Effective unit testing of quantum subroutines demonstrated on a three-qubit GHZ state preparation.
Applied framework to subroutines within Shor's algorithm, showing practical feasibility.
Trade-offs between accuracy, coverage, and efficiency analyzed.
Abstract
Software testing is a critical component of the classical software development lifecycle, and this principle is expected to hold true for quantum software as it evolves toward large-scale production and adherence to industry standards. Developing and testing quantum software presents unique challenges due to the non-deterministic nature of quantum information, the high dimensionality of the underlying Hilbert space, complex hardware noise, and the inherent non-local properties of quantum systems. In this work, we model quantum subroutines as parametrized quantum channels and explore the feasibility of creating practical unit tests using probabilistic assertions, combined with either quantum tomography or statistical tests. To address the computational complexity associated with unit testing in quantum systems, we propose incorporating context-awareness into the testing process. The…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
