MetaMorphQ: Physics-Based Metamorphic Testing of Variational Quantum Circuits

Abstract

Variational Quantum Eigensolvers (VQEs) are central to quantum computing, yet testing them remains challenging due to the oracle problem: the ground-state energy they compute is itself unknown. Existing approaches, such as convergence-based testing, are unreliable and yield high false-positive rates due to optimisation instability. We propose METAMORPHQ, a metamorphic testing framework that derives test oracles directly from quantum mechanical properties of VQE circuits. Exploiting algebraic properties of parametrised rotation gates and diagonal Hamiltonians, we define five physics-based invariants that hold for any correct circuit and can be verified at initialisation without ground-truth outputs. Evaluated on 500 benchmark circuits with 2,469 mutants, METAMORPHQ achieves zero false positives and significantly improves diagnostic effectiveness (Youden's J = 0.57 vs. 0.02 for convergence testing). These results demonstrate that physics-derived invariants provide a practical, oracle-free foundation for testing quantum software, enabling reliable validation of both human- and LLM-generated circuits.

0

Turn this paper into a full lesson

ArcXiv compiles a staged curriculum from this paper: 8-12 lessons across beginner → advanced, synthesised section guides, visuals, flashcards, a quiz, exercises, and on-demand deep dives per section. Grounded in the abstract, never invented.

Discussion (0)

Sign in to join the discussion.

Loading comments…