Symbolic Execution for Quantum Error Correction Programs
Wang Fang, Mingsheng Ying
TL;DR
This work extends symbolic execution to quantum programs with classical control by introducing Quantum Symbolic Execution (QSE) and symbolic stabilizer states, enabling scalable analysis and verification of quantum error correction (QEC) programs. It proves soundness and adequacy theorems and implements a prototype, QuantumSE.jl, capable of handling stabilizer codes such as repetition codes, Kitaev's toric codes, and quantum Tanner codes with over 1000 qubits. By using symbolic measurements and symbolic Pauli gates, QSE avoids exponential path explosion from both measurement outcomes and error enumeration, and it supports conditional Pauli operations without forking paths. Experimental results show competitive bug-finding capability, favorable scaling relative to sampling-based approaches, and a clear roadmap for solver- and technique-driven improvements in future work.
Abstract
We define QSE, a symbolic execution framework for quantum programs by integrating symbolic variables into quantum states and the outcomes of quantum measurements. The soundness of QSE is established through a theorem that ensures the correctness of symbolic execution within operational semantics. We further introduce symbolic stabilizer states, which symbolize the phases of stabilizer generators, for the efficient analysis of quantum error correction (QEC) programs. Within the QSE framework, we can use symbolic expressions to characterize the possible discrete Pauli errors in QEC, providing a significant improvement over existing methods that rely on sampling with simulators. We implement QSE with the support of symbolic stabilizer states in a prototype tool named QuantumSE.jl. Our experiments on representative QEC codes, including quantum repetition codes, Kitaev's toric codes, and quantum Tanner codes, demonstrate the efficiency of QuantumSE.jl for debugging QEC programs with over 1000 qubits. In addition, by substituting concrete values in symbolic expressions of measurement results, QuantumSE.jl is also equipped with a sampling feature for stabilizer circuits. Despite a longer initialization time than the state-of-the-art stabilizer simulator, Google's Stim, QuantumSE.jl offers a quicker sampling rate in the experiments.
