arXiv:2608.24144cs.SCAug 2026

Manuscript Offprint

arXiv:2608.24144

StabQ: Quantum Program Analysis via Weighted Stabilizer Representations

Shangzhou Xia, Junjie Luo, Jianjun Zhao

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

SHANGZHOU XIA, Kyushu University, Japan

JUNJIE LUO, RIKEN Center for Quantum Computing, Japan

JIANJUN ZHAO ∗^{*}, Kyushu University, Japan

Quantum program analysis remains challenging due to the exponentially large state space of quantum programs and the difficulty of precisely characterizing their execution behavior. In particular, non-Clifford operations introduce additional complexity that limits the applicability of stabilizer-based techniques. Although stabilizer representations provide compact descriptions for Clifford circuits, their limited expressiveness prevents them from directly supporting general quantum program analysis. In this work, we propose StabQ, a symbolic execution framework for quantum program analysis based on stabilizer representations. StabQ extends stabilizer-based symbolic execution beyond Clifford-only programs by introducing a symbolic state representation that captures and propagates quantum state evolution while preserving execution semantics. Based on this representation, StabQ constructs a Tableau Chain that represents the evolution of intermediate symbolic states throughout program execution and enables reusable analysis of quantum program executions. Furthermore, StabQ incorporates tableau consolidation and global-phase recovery mechanisms to mitigate symbolic state growth during execution. Building upon the Tableau Chain, StabQ supports multiple quantum program analysis tasks, including quantum state reconstruction, entanglement analysis, and Clifford-property detection. We evaluate StabQ on three benchmark suites—Algorithms, MQT Bench, and QASMBench. The results demonstrate that StabQ constructs semantically consistent symbolic models, accurately preserves quantum state evolution, and effectively supports downstream analysis tasks across diverse quantum programs.

CCS Concepts: • Software and its engineering → Formal software verification; • Computer systems organization → Quantum computing.

Additional Key Words and Phrases: Quantum Programs Analysis, Stabilizer Formalism, Entanglement Analysis

ACM Reference Format:

Shangzhou Xia, Junjie Luo, and Jianjun Zhao. 2018. StabQ: Quantum Program Analysis via Weighted Stabilizer Representations. J. ACM 37, 4, Article 111 (August 2018), 33 pages. https://doi.org/XXXXXXX.XXXXXXX

1 Introduction

In recent years, quantum computing has shown the potential for significant computational advantages across a range of research domains. This progress has motivated the development of general-purpose quantum computing systems. Meanwhile, the emergence of diverse quantum software stacks [20, 31] has made the implementation and execution of quantum programs increasingly accessible. However, the ability to execute a quantum program does not necessarily

∗^{*}Corresponding author: zhao@ait.kyushu-u.ac.jp

Authors' Contact Information: Shangzhou Xia, xia.shangzhou.218@s.kyushu-u.ac.jp, Kyushu University, Fukuoka, Japan; Junjie Luo, junjie.luo@riken.jp, RIKEN Center for Quantum Computing, Wako, Saitama, Japan; Jianjun Zhao, zhao@ait.kyushu-u.ac.jp, Kyushu University, Fukuoka, Japan.

Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from permissions@acm.org.

© 2018 Copyright held by the owner/author(s). Publication rights licensed to ACM.

ACM 1557-735X/2018/8-ART111

https://doi.org/XXXXXXX.XXXXXXX

111:2

Shangzhou Xia, Junjie Luo, Jianjun Zhao

imply the ability to understand its behavior. Characterizing how quantum states evolve during execution and identifying the properties exhibited by quantum programs remain challenging tasks. Such characterization still largely relies on manual reasoning by experts with deep knowledge of quantum mechanics. This difficulty stems from the intrinsic complexity of quantum programs. Due to fundamental quantum phenomena such as superposition, entanglement, and probabilistic measurement outcomes, the execution behavior of quantum programs is often difficult to interpret and analyze. Moreover, these effects accumulate as computation progresses, making it increasingly challenging to understand program semantics and verify program behavior. The lack of systematic analysis techniques limits the reliability, maintainability, and trustworthiness of quantum software, creating a major obstacle to the adoption of quantum computing as a general-purpose computing paradigm. Consequently, a dedicated framework capable of systematically modeling and analyzing quantum program execution is needed. Such a framework should provide an expressive representation of quantum states, preserve execution semantics during program evolution, and support diverse analysis tasks over quantum programs. In particular, an effective representation should balance the ability to capture complex quantum behaviors with the computational efficiency required for practical program analysis.

To analyze quantum programs, prior research has explored several approaches from different perspectives. One major direction relies on static analysis techniques, including abstract interpretation [27, 40], type systems [41], and bug detection frameworks [26, 42]. These approaches can efficiently reason about quantum programs and often provide soundness guarantees. However, they typically rely on abstractions that sacrifice state-level precision, which limits their ability to accurately characterize quantum execution behavior. Another direction constructs specialized representations tailored to particular analysis objectives, such as decision diagrams [6], the ZX-calculus [8], and tensor networks [23]. These representations can achieve high precision or efficiency for specific tasks. However, they often require specialized formulations, support only a limited range of analysis objectives, and lack the flexibility needed for general-purpose quantum program analysis. These limitations reveal a fundamental challenge in quantum software engineering: existing approaches either achieve scalability through abstraction or achieve precision through specialized representations, but few provide a unified execution model that supports accurate and efficient analysis across diverse quantum program properties.

Symbolic execution offers a promising approach to addressing this challenge. Similar to classical symbolic execution, a quantum symbolic execution framework requires an efficient symbolic representation of program states together with a propagation mechanism that incrementally updates the representation during program execution. Such a representation should faithfully preserve the semantics of quantum state evolution while remaining sufficiently compact to support scalable analysis. Furthermore, it should serve as a unified intermediate representation on which diverse program analysis tasks can be performed. Among existing quantum state representations, stabilizer representations provide a particularly attractive foundation. Instead of explicitly storing exponentially large state vectors, stabilizer representations describe quantum states using polynomial-size stabilizer tableaux, enabling efficient manipulation of a broad class of quantum states. This compact representation has demonstrated excellent scalability in stabilizer simulators for Clifford circuits [1, 16]. Moreover, stabilizer representations have been successfully employed in several analysis tasks, including Clifford-circuit equivalence checking [33] and entanglement analysis [19]. These results suggest that stabilizer representations naturally combine efficient symbolic state propagation with rich structural information, making them well suited as the underlying representation for symbolic execution. Despite these advantages, existing stabilizer representations remain fundamentally limited when applied to general quantum programs. They naturally represent only stabilizer states generated by Clifford operations, whereas practical quantum programs inevitably

111:3

contain non-Clifford operations required for universal quantum computation. Once non-Clifford operations are encountered, the symbolic state can no longer be maintained using a single stabilizer representation, preventing existing approaches from serving as a general symbolic execution model. Therefore, how to extend stabilizer representations to support both Clifford and non-Clifford operations, and further build a symbolic execution framework for general quantum programs based on such extensions, remains an important research problem that has not yet been fully addressed. Several studies [4, 5] have attempted to extend stabilizer-based methods to non-stabilizer states through stabilizer decomposition techniques. These approaches typically introduce auxiliary magic states and exploit the decomposition of non-stabilizer states into linear combinations of stabilizer states, enabling the simulation of circuits composed of Clifford and non-Clifford operations, such as Clifford+T circuits. By transforming non-stabilizer components into stabilizer-state representations, they effectively handle the evolution of non-stabilizer states under Clifford operations. However, existing stabilizer decomposition approaches primarily focus on improving simulation efficiency and reducing computational overhead. To achieve scalability, many approaches rely on approximation strategies, such as truncating low-weight stabilizer components, which may introduce errors into intermediate state representations. Consequently, these methods are less suitable for precise quantum program analysis tasks that require faithful preservation of program semantics and accurate characterization of intermediate quantum states.

In this paper, we propose StabQ, a symbolic execution framework for quantum program analysis based on the stabilizer representation. StabQ introduces a symbolic quantum state representation that expresses program states as weighted combinations of stabilizer tableaux. This representation enables incremental state updates during program execution while preserving the semantic information required for subsequent analysis tasks. To extend stabilizer-based symbolic execution beyond the Clifford-only setting, StabQ introduces a Pauli-decomposition mechanism that transforms non-Clifford operations into weighted combinations of Pauli operators. Since Pauli operators admit efficient stabilizer-based transformations, this mechanism allows non-Clifford operations to be integrated into the same symbolic execution process without introducing an additional state representation. Unlike stabilizer decomposition approaches that primarily target simulation efficiency through decomposing non-stabilizer states, StabQ uses this decomposition as an execution-time transformation mechanism. Rather than optimizing the compactness of the final state representation, StabQ explicitly tracks the effects of non-Clifford operations during execution and maintains intermediate symbolic states for downstream program analysis. Based on this symbolic representation, StabQ constructs a Tableau Node for each program execution step. Each node records the symbolic quantum state together with the corresponding tableau components and weights. These nodes are organized into a Tableau Chain, which captures the complete execution history of a quantum program and enables analysis over intermediate program states. To improve scalability, StabQ further incorporates tableau consolidation and global-phase recovery mechanisms. These techniques reduce redundant symbolic representations while maintaining the semantic consistency of state evolution.

Building upon the Tableau Chain, StabQ provides a unified foundation for multiple quantum program analysis tasks, including quantum state reconstruction, entanglement analysis, support-set computation, and Clifford-property detection. By combining symbolic execution with stabilizer-based representations, StabQ enables systematic analysis of quantum programs containing both Clifford and non-Clifford operations. We evaluate StabQ through three experiments. The first evaluates the semantic correctness of the constructed Tableau Chain models by comparing reconstructed quantum states with those obtained from an exact statevector simulator. The second investigates the efficiency of downstream analysis tasks, including quantum state reconstruction.

111:4

Shangzhou Xia, Junjie Luo, Jianjun Zhao

and entanglement analysis. The third studies the scalability of StabQ under different circuit characteristics, including qubit number, circuit size, and Clifford rate. The results demonstrate that StabQ constructs semantically consistent symbolic execution models, supports accurate quantum program analysis, and achieves practical scalability across diverse quantum programs.

Our contributions are summarized as follows:

• We introduce StabQ, a symbolic execution framework for quantum program analysis based on stabilizer representations. StabQ extends stabilizer-based state evolution beyond Clifford-only programs by representing quantum program states as weighted combinations of stabilizer tableaux and by supporting general quantum programs that contain non-Clifford operations.

• We design the Tableau Chain as an intermediate symbolic execution representation that captures the evolution of quantum program states throughout execution. Together with tableau consolidation and global-phase recovery mechanisms, the proposed representation efficiently maintains symbolic states while preserving their semantic consistency.

• We integrate multiple quantum program analysis tasks, including quantum state reconstruction, entanglement analysis, support-set computation, and Clifford-property detection, on top of the Tableau Chain. Extensive experiments demonstrate that StabQ constructs semantically consistent symbolic execution models, enables effective downstream analysis, and achieves practical scalability across diverse quantum programs.

The remainder of the paper is organized as follows. Section 2 offers essential background information on quantum programs and the stabilizer formalism. Section 3 elaborates on the methodology of our approach. Section 4 details the experimental results and the analysis. Section 5 provides an analysis of the current limitations of StabQ and outlines potential directions for future improvement. Section 6 discusses potential threats to the validity of our study. Section 7 reviews work related to our research. Section 8 summarizes the paper and provides concluding remarks.

References (29)