arXiv:2610.36976cs.SEOct 2026

Manuscript Offprint

arXiv:2610.36976

Toward Circuit-Aware Mutation Testing for Quantum Programs: Exact Visibility and Execution Planning

Andriy Miranskyy, Jose Campos

Abstract

Mutation testing assesses test suites by introducing program changes and checking whether tests detect them. In quantum programs, a surviving mutant may leave program behavior unchanged, produce a change hidden by the chosen input or measurement, or remain undetected because statistical evidence is insufficient. We develop a circuit-aware framework to distinguish these causes and guide execution planning and test changes. The framework covers ideal, noiseless programs and mutations that replace one gate or subcircuit. The method traces how a mutation can affect measured outputs and combines established mathematical checks with statistical estimates. For supported cases, we establish conditions under which a test cannot reveal a mutation and exact formulas for its effect when the required state information is available. Under stated assumptions, we bound the mutation score while retaining surviving and unresolved mutants, and identify a restricted circuit family whose mutation effects admit efficient classical classification. The deliverables include a decision procedure, mathematical guarantees, worked examples of test changes and their implementation requirements, and a small-circuit reference implementation for differential expectation tests. These results help testers decide what to execute, what to change, and what remains unknown. The evidence is limited to proofs and executable examples under the ideal model.

1 Introduction

Mutation testing evaluates whether a test suite can detect plausible faults. A mutation is a program change introduced to model such a fault, and a mutant is the modified program that results. A surviving mutant may preserve the declared program semantics or may change behavior without violating the suite's assertions. Whether such survival reveals a testing weakness depends on how the program contract and the oracle treat the behavioral difference. In quantum programs, measurement, finite shots, and the potentially enormous state space further complicate this distinction. A shot is one execution from input preparation through measurement; repeated shots estimate the program's output probabilities or expected measurement outcome.

Consider a one-qubit program that starts in state ∣0⟩|0\rangle (the quantum representation of bit 0), applies a rotation Ry(π/4)R_y(\pi/4), and measures the output bit. A sign-error mutant replaces that rotation by Ry(−π/4)R_y(-\pi/4). For this input, both programs return bit 1 with probability sin⁡2(π/8)≈0.1464\sin^2(\pi/8) \approx 0.1464, so an assertion over those computational-basis frequencies cannot distinguish them, regardless of the shot count. The output states nevertheless differ: an X-basis measurement, labeling the -1 outcome as bit 1, gives probabilities approximately 0.1464 and 0.8536, respectively. If the program’s entire interface is this fixed input and computational-basis output bit, the two implementations are observationally equivalent at that interface. If the output state is available to subsequent quantum operations, changing the measurement can expose a meaningful state difference.

References (79)