A Strategy of Dynamic Random Testing with Hybrid Distance Metrics for Quantum Programs

Lin Huang, Hanyu Pei, Yuechen Li, Beibei Yin, Kai‐Yuan Cai · 2024

Quantum Computing (QC) leverages quantum mechanics to manipulate quantum information, holding greater potential than classical computing. To fully exploit QC’s potential, it is crucial to ensure the reliability and quality of quantum programs. Research on quantum program testing is still at its early stage, in which some distinctive features of quantum programs, e.g., superposition and entanglement, may be overlooked, and the fault detection capability and testing effectiveness are rather limited. Besides, the input space of quantum programs may exponentially grow when the number of qubits increases, posing great challenges to testing quantum programs. It is imperative to develop a proper testing strategy to effectively select the potential failure-causing test cases and detect faults faster. In this paper, test cases with both basis states and superposition ones are considered and generated to cover more input space. A hybrid distance measurement method based on quantum fidelity and Hamming distance is presented for measuring the similarity among quantum test cases. Furthermore, a Dynamic Random Testing strategy based on Hybrid distance metrics (DRT-H) for quantum programs is proposed, which combines the hybrid distance metrics and the feedback mechanism of the classical Dynamic Random Testing (DRT) strategy to adjust the testing profile and guide the test case selection. Experimental studies demonstrate that the proposed DRT-H strategy outperforms the baseline testing strategies in most cases.

Read the paper · More papers on PaperTik