arXiv:2608.24320cs.LOAug 2026

Manuscript Offprint

arXiv:2608.24320

QisMC: A Model Checker for QISKIT Program Debugging

Aochu Dai, Mingsheng Ying

AOCHU DAI, Department of Computer Science and Technology, Tsinghua University, China

MINGSHENG YING, Centre for Quantum Software and Information, University of Technology Sydney, Australia

We present QisMC, the first quantum model checker dedicated to debugging Qiskit programs. On the theoretical side, we introduce the notion of quantum-classical transition system and a quantum computation tree logic (qCTL) grounded in Birkhoff-von Neumann logic for modeling the behaviors and specifying the properties of Qiskit programs, respectively. On the implementation side, QisMC provides an end-to-end framework encompassing transition system generation, logical formula representation, and model checking algorithms, and it efficiently performs image computation based on decision diagrams. These methods and design principles give QisMC advantages over previous Qiskit program debuggers, including a unified property specification language, a fully automated and exhaustive verification process, and the ability to generate counterexamples. Extensive illustrative examples and benchmark evaluations demonstrate the practicality, efficiency, and scalability of QisMC in verifying realistic quantum programs.

CCS Concepts: • Computer systems organization → Quantum computing; • Theory of computation → Verification by model checking; • Software and its engineering → Model checking.

Additional Key Words and Phrases: Quantum program debugging, Quantum temporal logic

1 Introduction

Recent advances in quantum computing [1, 64] are driving quantum programs beyond the conventional model of static circuits consisting of fixed sequences of unitary operations, toward richer forms of quantum-classical interaction. Mid-circuit measurements allow a program to acquire classical information during execution and use it to dynamically determine subsequent quantum operations through classical feedforward, conditional operations, and control flow. Programs exhibiting such behaviors are commonly referred to as dynamic quantum circuits/programs [20, 70]. Such dynamic behaviors have already emerged in several important quantum computing tasks. For example, quantum error correction repeatedly performs syndrome measurements and uses their outcomes for classical decoding and subsequent operations. Similar quantum-classical interactions are also prevalent in protocols such as quantum teleportation [60], LOCC [17], and distributed quantum computing [11]. Meanwhile, mainstream quantum programming frameworks such as Qiskit have begun to provide direct programming support for mid-circuit measurements, classical variables, and structured control flow, together with evolving support for their transpilation and execution on quantum hardware [46]. Consequently, the behavior of modern quantum programs is determined not only by operations on quantum states, but also by classical information obtained from measurements and the different execution paths selected accordingly.

However, such dynamic quantum-classical interactions also pose new challenges for the verification and debugging of quantum programs. First, specifying the intended behavior of a program is itself nontrivial. For static quantum circuits, correctness can often be characterized by input-output relations or properties of quantum states at particular program locations. For programs involving branches and loops, however, correctness may additionally concern how quantum states evolve along execution paths—for example, whether a property is always preserved, whether a particular quantum state is eventually reachable, or whether one property continues to hold until another event occurs. Second, when a program violates its intended property, merely

Authors' Contact Information: Aochu Dai, dac22@mails.tsinghua.edu.cn, Department of Computer Science and Technology, Tsinghua University, Beijing, China; Mingsheng Ying, Centre for Quantum Software and Information, University of Technology Sydney, Sydney, Australia, Mingsheng.Ying@uts.edu.au.

A. Dai and M. Ying

reporting verification failure provides limited assistance for debugging. Developers also need to understand along which execution the property is violated and which program locations and operations contribute to the violation. Existing techniques and tools based on quantum program testing [32, 41, 61], runtime assertions [48–50], and static analysis [45, 59] have demonstrated the ability to detect various classes of quantum program bugs [63]. However, they typically focus on particular program points, bounded executions, or specific classes of program properties, and do not simultaneously provide exhaustive reasoning over complex control flow, temporal specification, and diagnostic information that explains the execution leading to a property violation.

These two requirements align closely with the core strengths of model checking in classical hardware and software verification. Model checking allows developers to specify expected system behaviors over different execution paths using temporal logic and automatically determine whether a given property holds through systematic exploration of the state space [4]. More importantly, when a property is violated, a model checker can typically generate a counterexample execution that leads to the violation, allowing developers to trace a concrete execution path to locate and understand the error. This diagnostic capability has long made model checking an effective technique for debugging, as emphasized by Clarke, Emerson and Sifakis in their 2007 ACM A.M. Turing Award Lecture [19]. Model checking therefore provides a natural framework for addressing the two challenges in quantum programming discussed above: temporal logic specifies correctness requirements across program locations and execution paths, while counterexamples turn verification failures into concrete diagnostic information for debugging.

Prior work has extended model checking to quantum systems and developed several quantum temporal logics and verification frameworks [26, 31, 35, 73]. However, as discussed in Section 2, existing approaches provide limited support for integrating quantum-state properties, realistic program control flow, and effective debugging within a unified workflow. To address these limitations, we present QisMC, a model checker for debugging Qiskit programs based on model-checking techniques and Birkhoff-von Neumann quantum logic. QisMC extends the classical model-checking workflow of temporal specification, exhaustive verification, and counterexample-guided debugging to quantum programs that combine quantum operations with classical control flow. To this end, we define a new quantum temporal logic, qCTL, based on Birkhoff-von Neumann quantum logic, and develop an end-to-end workflow encompassing automatic model construction from Qiskit programs, property specification and verification, and counterexample-guided debugging. We next outline the two key design ideas underlying QisMC.

• Specification: For expressing more sophisticated properties of Qiskit programs, QisMC employs a carefully designed classical-quantum computation tree logic (qCTL) that incorporates Boolean-valued classical formulas with quantum atomic propositions defined over Hilbert subspaces. Recall that in Birkhoff-von Neumann logic [9, 16], a quantum proposition corresponds to a Hilbert subspace of the system, and a quantum state ρ\rho satisfies a proposition PP if tr(Pρ)=1\text{tr}(P\rho) = 1, where tr\text{tr} denotes the trace operation. This subspace-based formalism naturally captures many properties central to quantum computing, e.g. state equivalence, termination, reachability, and valid codeword spaces in quantum error correction. Indeed, such properties have already been used in prior work on quantum program debugging and testing [43, 48, 61]. In this work, they are extended to the temporal setting. As will be illustrated from our motivating example in Subsection 1.1, qCTL formulas can effectively express practical temporal properties of quantum programs.

• Debugging: QisMC provides an end-to-end workflow for counterexample-guided debugging of Qiskit programs. Through its Python interface, users can construct the transition system, define quantum and classical propositions, and associate properties with program locations through inline annotations. QisMC then employs the bidirectional quantum fixed-point iterations introduced in Section 5.1 to determine the satisfaction of quantum propositions at different program locations. Based on these results, the qCTL model-checking problem is reduced to a conventional CTL problem and automatically encoded for NuSMV [18], which performs exhaustive model checking and generates a counterexample when the specification is violated. Finally, QisMC maps the counterexample from the transition-system level back to the original Qiskit program, producing a source-level execution path that leads to the property violation and provides concrete diagnostic information for debugging.

References (48)