Quantum Computing (QC) promises computational speedup over classic computing. However, noise exists in near-term quantum computers. Quantum software testing (for gaining confidence in quantum software's correctness) is inevitably impacted by noise, i.e., it is impossible to know if a test case failed due to noise or real faults. Existing testing techniques test quantum programs without considering noise, i.e., by executing tests on ideal quantum computer simulators. Consequently, they are not directly applicable to test quantum software on real quantum computers or noisy simulators. Thus, we propose a noise-aware approach (named
QOIN) to alleviate the noise effect on test results of quantum programs.
QOINemploys machine learning techniques (e.g., transfer learning) to learn the noise effect of a quantum computer and filter it from a program's outputs. Such filtered outputs are then used as the input to perform test case assessments (determining the passing or failing of a test case execution against a test oracle). We evaluated
QOINon IBM's 23 noise models, Google's two available noise models, and Rigetti's Quantum Virtual Machine, with six real-world and 800 artificial programs. We also generated faulty versions of these programs to check if a failing test case execution can be determined under noise. Results show that
QOINcan reduce the noise effect by more than
80%on most noise models. We used an existing test oracle to evaluate
QOIN's effectiveness in quantum software testing. The results showed that
QOINattained scores of
99%,
75%, and
86%for precision, recall, and F1-score, respectively, for the test oracle across six real-world programs. For artificial programs,
QOINachieved scores of
93%,
79%, and
86%for precision, recall, and F1-score respectively. This highlights
QOIN's effectiveness in learning noise patterns for noise-aware quantum software testing.
In this paper we describe a quantum computing simulation library named QC|pp). In the state-of-the-art most of the available libraries and simulators make use of the structural modeling of quantum circuits which requires a high memory consumption and huge runtime. Indeed, under the structural modeling framework, the simulation of quantum computers for n qubits entails multiplication of sparse 2n. x 2nsize matrices with vectors of dimension 2n, thus making this a memory-bound application. Through QC|pp) we propose a behavioral modeling framework of quantum circuits to reduce memory consumption, increase performance and allow for testing our simulator on more qubits. We will also present the results obtained by testing our library on simulating Grover's algorithm.