Search-Based Quantum Program Testing via Commuting Pauli String
Asmar Muqeet, Shaukat Ali, Paolo Arcaini
TL;DR
SB-QOPS extends prior QOPS by introducing a search-based mechanism to generate test cases defined as weighted Pauli strings drawn from commuting Pauli families, paired with an expectation-value oracle that leverages commutativity to reuse measurements. A two-stage process first constructs commuting families (Pauli Transformation) and then evolves test cases via a linear solution encoding under GA, HC, and 1+1 EA with a fixed budget, guided by a fitness value $|Exp-Obs|$. Large-scale experiments on circuits up to $29$ qubits across IBM, IQM, and Quantinuum demonstrate substantial fault-detection improvements over random search, with GA delivering high fitness and 1+1 EA rapidly identifying failing cases. However, under realistic noise without strong error mitigation, discriminating faulty from equivalent circuits remains challenging, underscoring the need for hardware-integrated mitigation (e.g., ZNE + PEA) to achieve reliable test assessment on real devices. Overall, SB-QOPS proves architecturally portable and more effective than prior approaches, while highlighting practical considerations for error mitigation in quantum software testing.
Abstract
Quantum software testing is important for reliable quantum software engineering. Despite recent advances, existing quantum software testing approaches rely on simple test inputs and statistical oracles, costly program specifications, and limited validation on real quantum computers. To address these challenges, we propose SB-QOPS, a search-based quantum program testing approach via commuting Pauli strings. SB-QOPS, as a direct extension to a previously proposed QOPS approach, redefines test cases in terms of Pauli strings and introduces a measurement-centric oracle that exploits their commutation properties, enabling effective testing of quantum programs while reducing the need for full program specifications. By systematically exploring the search space through an expectation-value-based fitness function, SB-QOPS improves test budget utilization and increases the likelihood of uncovering subtle faults. We conduct a large-scale empirical evaluation on quantum circuits of up to 29 qubits on real quantum computers and emulators. We assess three search strategies: Genetic Algorithm, Hill Climbing, and the (1+1) Evolutionary Algorithm, and evaluate SB-QOPS under both simulated and real noisy conditions. Experiments span three quantum computing platforms: IBM, IQM, and Quantinuum. Results show that SB-QOPS significantly outperforms QOPS, achieving a fault-detection score of 100% for circuits up to 29 qubits, and demonstrating portability across quantum platforms.
