Manuscript Offprint
arXiv:2608.24144StabQ: Quantum Program Analysis via Weighted Stabilizer Representations
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.
2.1 Quantum States, Gates and Circuits
Quantum computation is described as the manipulation of quantum states by quantum gates organized into quantum circuits. A quantum state is represented as a unit vector in a Hilbert space. For an n-qubit system, the state space is given by
where and . Quantum gates are unitary operators acting on one or more qubits, and they serve as the basic building blocks of quantum computation. Each gate transforms a quantum state as
A quantum circuit is an ordered sequence of quantum gates applied to an initial state, typically . The execution of a circuit is expressed as
where each corresponds to a quantum gate. This gate-based model captures the step-wise evolution of quantum states and forms the basis for quantum computation, simulation, and analysis.
111:5
The Pauli operators are a set of single-qubit unitary operators that are central to the analysis of quantum circuits. They are defined as
On a single qubit, X performs a bit flip, Z performs a phase flip, and Y combines the two up to a global phase. For an n-qubit system, an n-qubit Pauli operator is a tensor product of n single-qubit Pauli operators, together with a global phase in . These operators form the Pauli group under multiplication. The Pauli group underlies the stabilizer formalism, in which a quantum state is described by the Pauli operators that stabilize it. Building on the Pauli operators, several elementary gates play a fundamental role in constructing quantum circuits. The Hadamard gate H, phase gate S, and controlled-NOT gate (CNOT) are defined as follows:
The Hadamard gate maps computational basis states to superposition states. The phase gate S applies a relative phase of i to the state. The controlled-NOT gate is a two-qubit operation that flips the target qubit when the control qubit is in state . Together with the Pauli gates, H, S, and CNOT generate the Clifford group, and they play a central role in quantum computation. From a computational perspective, quantum gates are categorized into Clifford and non-Clifford operations. The Clifford group consists of the unitary operators that map the Pauli group to itself under conjugation,
This property keeps Clifford circuits within a structured representation that can be tracked efficiently. Non-Clifford gates fall outside this structure and extend the expressive power of quantum circuits beyond it. A commonly used example is the T gate,
which, together with the Clifford gates, forms a universal gate set for quantum computation. By the Gottesman–Knill theorem [1, 18, 36], quantum circuits composed solely of Clifford gates can be simulated efficiently on classical computers, whereas the inclusion of non-Clifford gates breaks this efficient simulability and enables universal quantum computation. This distinction is fundamental to the origin of quantum computational advantage in the gate-based model. The presence and structure of non-Clifford gates indicate the computational complexity of a quantum circuit, and they are widely used in characterizing quantum resources.
2.2 Stabilizer Formalism
The stabilizer formalism provides a compact algebraic framework for representing and manipulating an important class of quantum states known as stabilizer states. Let denote the -qubit Pauli group generated by tensor products of the single-qubit Pauli operators , , , and , together with the phase factors .
A stabilizer state is specified by an abelian subgroup
that contains independent generators and does not contain . The corresponding quantum state is the unique simultaneous eigenstate of all stabilizer generators,
111:6
Shangzhou Xia, Junjie Luo, Jianjun Zhao
As an example, the Bell state
is a stabilizer state. Its stabilizer group is generated by the Pauli operators
where the leading “+” denotes that the corresponding generator has eigenvalue +1. Throughout this paper, in a Pauli string of the form , the first Pauli operator corresponds to qubit , followed by . Indeed,
The Bell state is therefore characterized uniquely as the simultaneous +1 eigenstate of the generators +XX and +ZZ.
The stabilizer formalism is powerful because Clifford operations preserve the Pauli group under conjugation (1). Clifford evolution can therefore be represented entirely through transformations of the stabilizer generators, which avoids explicit manipulation of exponentially large state vectors.
In practice, stabilizer states are commonly represented using stabilizer tableaux. A stabilizer tableau gives a binary representation of the stabilizer generators through the symplectic formalism. For an n-qubit stabilizer state, each generator can be written as
where denotes the phase factor, and specify the positions of the and components. Under the binary symplectic representation, each generator is encoded by a row vector
where the first n bits form the X mask, the next n bits form the Z mask, and the phase entry stores the associated Pauli phase.
Collecting all generators yields the tableau representation
where records the components of all generators, records the components, and stores the corresponding phase information. As an example, the Bell state is represented as
| r | |||||
|---|---|---|---|---|---|
| +XX | 1 | 1 | 0 | 0 | 0 |
| +ZZ | 0 | 0 | 1 | 1 | 0 |
where the first two columns encode the X components, the next two columns encode the Z components, and the final column records the phase of each stabilizer generator.
In practical simulators, the tableau additionally contains a set of destabilizer generators, giving a complete representation
where S denotes the stabilizer generators and D denotes the corresponding destabilizer generators. The stabilizer component alone determines the represented state, while the destabilizers serve as auxiliary structures that support efficient tableau updates under Clifford evolution.
Stabilizer methods give highly efficient representations for Clifford circuits, but universal quantum computation also requires non-Clifford operations. Unlike Clifford operations, non-Clifford operations do not preserve the Pauli group under conjugation, so Eq. 1 does not hold in general. The stabilizer generators are then no longer closed under evolution, and the conventional stabilizer formalism and tableau propagation techniques become inapplicable.
111:7
For example, the T gate acts by conjugation as
which is no longer a Pauli operator. A stabilizer state therefore evolves into a linear combination of stabilizer states, which the conventional stabilizer formalism can no longer represent or propagate directly.
3 Methodology
We present the design of StabQ, a symbolic execution framework for quantum program analysis based on stabilizer representations. The methodology consists of two main components: (1) symbolic state execution and propagation through the construction of the Tableau Chain, which maintains the evolution of weighted stabilizer representations during program execution, and (2) quantum program analysis mechanisms built upon the resulting symbolic execution representation.
3.1 Workflow

Fig. 1. Workflow of StabQ.
We now describe the overall workflow of StabQ as illustrated in Figure 1. Given an input quantum program, StabQ performs symbolic execution by incrementally constructing a Tableau Chain based on the stabilizer formalism. The Tableau Chain serves as an intermediate representation that records the evolution of symbolic quantum states, where each symbolic state is represented as a weighted combination of stabilizer tableaux. In addition, the representation maintains global-phase information introduced during symbolic propagation. This execution model provides a unified foundation for downstream quantum program analysis, enabling property inference and behavioral reasoning over intermediate program states.
The construction process operates at the granularity of individual quantum gates. For each gate, StabQ first applies a Clifford checker ( ) to determine whether the operation belongs to the Clifford group. Clifford operations preserve the stabilizer representation and can therefore be efficiently propagated using standard tableau update rules ( ). For non-Clifford operations, StabQ applies a Pauli-decomposition mechanism ( ), which decomposes the operation into a weighted sum of Pauli operators. These weighted Pauli components are then incorporated into the symbolic state propagation process ( ), enabling the execution model to support general quantum programs beyond the Clifford-only setting. After each gate-level propagation step, StabQ performs global-phase recovery to maintain a consistent phase representation among symbolic states. The recovered phase information is integrated into the corresponding tableau representation.
111:8
Shangzhou Xia, Junjie Luo, Jianjun Zhao
(§4). Subsequently, a tableau consolidation procedure (§5) merges equivalent stabilizer components to reduce redundant symbolic states and control the growth of the Tableau Chain representation. Each updated symbolic state is encapsulated into a Tableau Node and appended to the Tableau Chain, forming a step-wise symbolic execution representation of the input quantum program. After all gates have been processed, the complete Tableau Chain captures the entire symbolic execution history of the program.
Finally, the constructed Tableau Chain is used as a unified intermediate representation for downstream quantum program analysis tasks ( ), including quantum state reconstruction and entanglement characterization. These analysis procedures operate directly on the symbolic representation without requiring repeated quantum state reconstruction, enabling efficient analysis over the complete program execution.
3.2 Stabilizer-Based Tableau Chain Construction
3.2.1 Tableau Node Representation. Due to the efficiency of the stabilizer formalism in modeling quantum state evolution, our framework represents the evolution process of quantum programs through stabilizer-state propagation. Considering that quantum program analysis requires fine-grained analysis at each program step, we introduce a data structure N called a Tableau Node.
where id denotes the program step associated with the current operation. T represents the list of stabilizer tableaux describing the current program state, while W stores the corresponding weights associated with each tableau. Parent and Child are references to the Tableau Nodes corresponding to the previous and subsequent program steps, respectively, thereby linking individual nodes into the Tableau Chain that represents the evolution of the entire quantum program.
At the beginning of program execution, we construct an initial node based on the number of qubits, denoted as , where is defined as a list containing only the stabilizer tableau corresponding to the initial state . Since the initial state consists of a single tableau component, the associated is initialized as a singleton list containing the value 1, representing a weight of 1, indicating that the initial state is represented entirely by this single stabilizer tableau. Subsequent nodes are generated incrementally through the application of quantum operations, thereby capturing the evolution of the program step by step.
The construction of each new node consists of two main stages. In the first stage, T and W are updated according to the quantum operation at the next program step. This update procedure differs depending on whether the operation is a Clifford gate or a non-Clifford gate, and the two corresponding update strategies are detailed in section 3.2.2 and 3.2.3. In the second stage, a global-phase recovery mechanism (section 3.2.4) is applied to adjust W. After this correction, tableaux in T that correspond to the same stabilizer state are identified and merged by aggregating their associated weights (section 3.2.5), enabling an efficient reduction of redundant representations.
Finally, the newly constructed node updates its fields id, Parent, and Child, thereby forming a complete evolutionary chain that represents the execution history of the quantum program.
3.2.2 Clifford Evolution. The evolution of common Clifford gates, such as the Hadamard (H) gate, Pauli-X (X) gate, S gate, and CNOT gate, on a single stabilizer tableau has been extensively studied in prior work [1], and their corresponding transformation rules have been well established. For instance, applying these Clifford operations to the stabilizer representation of a Bell state yields the following evolution behavior:
111:9
The advantage of this representation lies in its compact and intuitive characterization of stabilizer evolution under successive Clifford operations, where the effect of each operation on the quantum state is explicitly traceable at every step. Compared with full circuit-level or state-vector representations, this approach avoids the exponential overhead associated with direct state simulation while preserving the complete semantic structure of the computation. As a result, it provides a scalable yet expressive foundation that facilitates subsequent verification and analysis tasks.
For these common Clifford gates C, we directly adopt the established transformation rules to define the update mechanism of and within :
In this process, since Clifford operations induce a deterministic one-to-one evolution on stabilizer tableaux, each tableau in the parent node can be evolved independently. The associated weights are initially propagated unchanged to the newly generated node. It is worth noting that, during this transformation process, the weight associated with a tableau can be directly propagated to its evolved tableau . This direct inheritance is valid when the quantum state is represented by a single stabilizer tableau. However, when the state is represented as a weighted combination of multiple tableaux, the inherited weight may no longer be sufficient to accurately capture the evolution. In particular, global-phase differences introduced during tableau propagation can affect the relative coefficients among tableau components. Therefore, an additional global-phase recovery mechanism, implemented through the Phase function, is required to adjust the weights accordingly. This process will be described in detail in Section 3.2.4.
In addition to these elementary Clifford gates, quantum programs may also contain composite gates composed of sequences of basic Clifford operations. Since the Clifford group is closed under composition, such composite gates remain Clifford operations and therefore also admit stabilizer tableau evolution. However, explicit stabilizer tableau transformation rules are generally unavailable for such composite gates. Therefore, once a quantum operation is identified as a Clifford operation, we decompose into a sequence of elementary Clifford gates and apply the corresponding tableau evolution rules successively. By evolving each constituent Clifford gate step by step, the overall stabilizer tableau transformation induced by the composite gate can be obtained.
Since all constituent operations are basic Clifford gates, their corresponding tableau transformations can be composed sequentially to obtain the overall evolution induced by the composite gate. Consequently, the stabilizer tableau evolution of can be constructed through the successive application of the update rules for the individual sub-operations. However, each sub-operation may introduce a global-phase change. Although such phase factors do not affect a single stabilizer tableau representation, they influence the coefficients associated with tableaux in our weighted linear-combination framework. Therefore, after each sub-operation, the weight vector is updated using the Phase function, which computes and restores the corresponding phase contribution. This
111:10
Shangzhou Xia, Junjie Luo, Jianjun Zhao
ensures that the accumulated weights remain consistent with the correct quantum-state evolution throughout the decomposition process.
3.2.3 Non-Clifford Evolution. Current research on the stabilizer formalism has primarily focused on the evolution of purely Clifford systems; therefore, its applicability remains limited and cannot fully capture arbitrary quantum operations. To overcome this limitation, we introduce a Pauli decomposition for non-Clifford operations, representing them as weighted combinations of Pauli operators and thereby enabling an extended stabilizer-based evolution framework. For an n-qubit system, we decompose a non-Clifford operation G as follows:
where denotes the Pauli basis of the -qubit Pauli group, and represents the corresponding weight associated with each basis element in the decomposition. In this way, a non-Clifford operation can be represented by two lists, and , corresponding to the set of Pauli components and their associated weights, respectively. Importantly, each element in admits a valid stabilizer tableau transformation, allowing the evolution to be carried out within the stabilizer formalism framework.
Under this Pauli-decomposition framework, we can describe the evolution of the current node when it encounters a non-Clifford operation . Since each Pauli basis element can be regarded as a basic Clifford operation (up to phase), for each tableau and its corresponding weight , we apply the Clifford evolution procedure described in Section 3.2.2:
(13)
During this process, the newly generated node may contain a large number of stabilizer tableaux in along with their associated weights in . However, redundancies may arise due to the presence of equivalent tableaux. To address this issue, we perform an equivalence-checking procedure and merge identical tableaux by aggregating their corresponding weights. A detailed description of this consolidation procedure is provided in Section 3.2.5.
3.2.4 Global Phase Recovery. To ensure phase consistency across tableau transformations, StabQ introduces a support-driven global phase recovery mechanism. Unlike prior formulations that solve Pauli decompositions over a symplectic basis, our implementation operates directly on the amplitude support induced by stabilizer tableaux.
Given a stabilizer tableau , we first extract its computational-basis support and compute the corresponding phase map using the internal tableau phase structure. For a transformed tableau , we similarly compute over .
To account for gate-induced basis permutations and phase distortions, we construct a gate-aware consistency mapping induced by the applied operation . Specifically, describes how basis states and phases are transformed under Clifford gates (e.g., CX, CZ, H, S, ), while non-Clifford gates are handled via their Pauli decomposition.
We then define a transformed reference phase:
111:11
which is aligned with the support of . The global phase correction factor is computed as:
where ranges over the support elements. If the ratio is consistent across all support elements, we obtain a unique global phase correction ; otherwise, we default to .
For Clifford operations, is implemented explicitly as gate-dependent rewrites of bitstrings and phase flips (e.g., CZ induces conditional phase inversion, H induces basis swapping, S induces i-phase accumulation). For non-Clifford gates, we directly apply this procedure to each Pauli-decomposed branch.
Finally, the resulting global phase correction is absorbed into the weight of the corresponding tableau component:
ensuring phase-consistent tableau evolution throughout the Tableau Chain. The entire procedure is implemented by the Phase( ) function.
3.2.5 Tableau Consolidation. The introduction of non-Clifford operations into stabilizer-based state propagation leads to a fundamental representational challenge. While Clifford gates preserve the one-to-one evolution of stabilizer tableaux, non-Clifford gates are expressed in our framework as linear combinations of multiple stabilizer components. As a result, the number of tableaux grows rapidly during circuit propagation, significantly increasing both memory consumption and computational cost.
To address this issue, we introduce a tableau consolidation procedure that reduces redundancy in the symbolic state representation by merging equivalent stabilizer components. A key observation is that the stabilizer subgroup uniquely characterizes the underlying stabilizer state, whereas the destabilizer component serves purely as an auxiliary gauge choice required for maintaining a consistent Clifford update rule. It does not contribute to the physical state representation and is not observable in the stabilizer semantics of the state.
LEMMA 1 (STABILIZER EQUIVALENCE IMPLIES STATE EQUIVALENCE). Let and be two stabilizer groups acting on the same set of qubits. If , then the corresponding stabilizer states are identical up to a global phase, i.e., .
Proof sketch. A stabilizer group S uniquely defines a quantum state as the simultaneous +1 eigenspace of all operators in S. Since stabilizer groups are maximal abelian subgroups of the Pauli group (excluding -I), each valid stabilizer group corresponds to a one-dimensional subspace in the Hilbert space. Therefore, if two stabilizer groups and are identical, they define the same set of stabilizer constraints and hence the same one-dimensional subspace. It follows that their associated stabilizer states differ at most by a global phase, which is physically irrelevant.
Based on this observation, we define an equivalence relation over tableaux induced by their stabilizer structure:
All tableaux belonging to the same equivalence class represent identical stabilizer states and are therefore merged into a single representative. The associated weights are aggregated as
where [S] denotes the equivalence class induced by stabilizer group S.
111:12
Shangzhou Xia, Junjie Luo, Jianjun Zhao
This consolidation preserves the semantic meaning of the symbolic state, while eliminating redundant representations that differ only in their auxiliary destabilizer structure. In particular, since all physically relevant phase information has been explicitly accounted for in the weight domain prior to consolidation as described in Section 3.2.4, the merging operation does not introduce any loss of state information. From an implementation perspective, each tableau is canonicalized with respect to its stabilizer generators, and this canonical stabilizer representation is used as a hash key to group equivalent tableaux. The consolidation step is applied periodically during state propagation, ensuring that the symbolic state size remains controlled even in the presence of repeated non-Clifford expansions.
Overall, tableau consolidation provides a significant reduction in propagation overhead by exploiting the redundancy in stabilizer-based representations induced by non-Clifford decompositions, while maintaining exact consistency at the level of stabilizer state semantics.
3.2.6 Algorithm. This section explains how StabQ builds the complete Tableau Chain model for a target quantum program. Algorithm 1 presents the overall flow of the process.
Given a quantum program P, StabQ first determines the number of qubits and constructs the initial stabilizer tableau , representing the computational basis state (line 1,2). The tableau and its initial weight are encapsulated in the root node (line 4), which serves as the starting point of the Tableau Chain. For each quantum operation op in P, StabQ first determines whether op is a Clifford gate (line 9). If so, the operation is decomposed into a sequence of supported elementary Clifford gates op_list (line 11). Each elementary gate is processed sequentially by first updating the current tableaux list according to the tableau evolution rules (line 14), followed by weight phase recovery (line 15). The resulting tableaux list and weight list become the symbolic state for the next elementary gate in op_list (line 16). Otherwise, if op is a non-Clifford gate, StabQ performs a Pauli decomposition to express the operation as a weighted linear combination of Pauli operators (line 20). Since the resulting Pauli terms are independent, each Pauli operator is processed independently on the current tableaux list (lines 22–25). The corresponding weights are updated according to the Pauli coefficients and the recovered phases (line 25), and all evolved tableaux and weights are aggregated into the new symbolic state (line 26). After processing each quantum operation op, StabQ performs Tableau Consolidation to merge equivalent tableaux and eliminate redundant symbolic states (line 29). The consolidated tableaux list and weight list are encapsulated into a new Tableau Node, which is linked to its predecessor to extend the Tableau Chain (lines 30–32).
After all quantum operations have been processed, the root node , together with all linked Tableau Nodes, forms the complete Tableau Chain, which serves as the symbolic model for subsequent quantum program analysis.
3.2.7 Illustrative Example. To illustrate how the Tableau Chain is constructed and updated during program execution, we consider a simple Bell-state preparation circuit followed by two non-Clifford T gates. Although small in size, this example captures the key mechanisms of the framework, including Clifford propagation, non-Clifford decomposition, global phase recovery, and tableau consolidation. This 2-qubit circuit is defined as
111:13
Algorithm 1: Tableau Chain Construction
Input: target quantum program
Output: the root node of the entire Tableau Chain
1: qubits_num() // Qubits Number of 2: get_tableau() // Generate initial tableau of 3: // Program step counter 4: // Initialize root node 5: 6: for op in do 7: 8: 9: if Clifford_checker(op) then 10: // Decompose into a sequence of basic Clifford operations 11: op_list ← basic_Clifford(op) 12: 13: for gate in op_list do 14: 15: 16: 17: end for 18: else 19: // Decompose into Pauli operations with weights 20: op_list, Pauli_decomposition(op) 21: 22: for gate in op_list do 23: 24: 25: 26: 27: end for 28: end if 29: tableau_consolidation() 30: 31: 32: 33: end for
The evolution under the first two Clifford gates is as follows:
InitialState |00⟩ : ; Destabilizer : ['+IX', '+XI'] ; Destabilizer : ['+IX', '+XI']] (GlobalPhase) ; Destabilizer : ['+IZ', '+XI']] (GlobalPhase)
Upon encountering the non-Clifford T gate, StabQ applies Pauli decomposition to express the operation as a weighted sum of Pauli operators, thereby enabling its integration into the Tableau
111:14
Shangzhou Xia, Junjie Luo, Jianjun Zhao
Chain propagation framework:
where and denote the coefficients associated with the Pauli operators and , respectively. Therefore, the subsequent non-Clifford propagation proceeds as follows:
Stabilizer : ; Destabilizer :
After applying a second T gate, the evolution proceeds as follows:
At this point, we observe that the four generated stabilizer sets contain identical stabilizer components. StabQ therefore performs a tableau consolidation procedure, yielding a simplified tableau representation as follows:
This completes the construction of the Tableau Chain for the entire program. The resulting representation enables static analysis at any execution step in a modular manner. The detailed analysis procedures are presented in the following section.
3.3 Tableau-Based Program Analysis Framework
After constructing the complete program evolution within the stabilizer formalism, we perform a systematic, step-wise analysis over the entire execution trace. Rather than treating the quantum program as a monolithic object, our framework operates directly on the intermediate representations maintained in the Tableau Chain, where each node encodes the symbolic quantum state together with its evolution history under both Clifford and non-Clifford transformations.
At a high level, the analysis is organized into three complementary components. First, we characterize the operational structure of the program by identifying the Clifford or non-Clifford
111:15
nature of each quantum gate, which determines its corresponding evolution rule at the tableau level. Second, we reconstruct and track the symbolic quantum state throughout execution, where each program state is represented as a weighted ensemble of stabilizer tableaux, enabling consistent state interpretation under phase-aware evolution. Third, we analyze entanglement structure across qubits by exploiting the stabilizer dependencies encoded within each tableau representation, allowing efficient extraction of correlation patterns without resorting to full state-vector simulation.
By leveraging the unified tableau representation maintained in the Tableau Chain, all three types of analyses can be performed incrementally at each program step. This provides a fine-grained and semantically rich view of program evolution, and serves as the foundation for the detailed discussions in the following subsections, where we elaborate on Clifford characterization, state reconstruction, and entanglement analysis respectively.
3.3.1 Clifford Property Analysis. To distinguish between Clifford and non-Clifford operations, we begin from the observation that these two classes of quantum gates exhibit fundamentally different computational behaviors within the stabilizer formalism. Clifford operations preserve the Pauli group under conjugation and admit efficient classical simulation, whereas non-Clifford operations are essential for universal quantum computation and introduce non-trivial computational complexity. Therefore, identifying whether a given operation is Clifford or non-Clifford is a prerequisite for understanding the computational structure of a quantum program.
To this end, we adopt an operational verification procedure based on the conjugation action on the Pauli group. For an -qubit system, we construct a generating set of the Pauli group consisting of single-qubit and operators embedded into the full Hilbert space via tensor products with identities on all other qubits, yielding Given a unitary operator , we compute its conjugation action:
and verify whether each resulting operator remains within the Pauli group. In implementation, this is achieved by decomposing into the Pauli basis and checking whether exactly one Pauli term has non-zero weight (up to a global phase and numerical tolerance). An operation is classified as a Clifford operation if and only if all generators are mapped to Pauli operators under conjugation; otherwise, it is identified as a non-Clifford operation. This criterion is sufficient because the Pauli group is generated by single-qubit X and Z operators, while conjugation preserves the group multiplication structure.
Beyond serving as a structural classification, the distinction between Clifford and non-Clifford operations plays a fundamental role in quantum program analysis. Clifford operations induce deterministic stabilizer tableau updates and remain efficiently simulable within the stabilizer formalism. In contrast, non-Clifford operations trigger Pauli-based decompositions that transform a single tableau representation into a weighted ensemble of multiple tableaux, thereby increasing symbolic-state complexity and introducing branching during program evolution. Consequently, the occurrence and distribution of non-Clifford operations provide a direct indication of the non-classical computational resources utilized by a quantum program and help identify regions where classical simulability begins to deteriorate.
During the construction of the Tableau Chain, this analysis enables the framework to effectively distinguish between Clifford and non-Clifford operations and select the corresponding evolution mechanism accordingly. Clifford operations are propagated through deterministic tableau evolution rules, whereas non-Clifford operations invoke the weighted decomposition and propagation procedure described in the previous section. As a result, Clifford-property analysis serves as a fundamental
111:16
Shangzhou Xia, Junjie Luo, Jianjun Zhao
decision point throughout the symbolic evolution process and provides the basis for subsequent procedures such as state reconstruction, global phase recovery, and tableau consolidation.
Furthermore, we compute the proportion of Clifford operations appearing in the quantum program and report it as an analysis metric, referred to as the Clifford Rate:
where denotes the number of Clifford operations in the program and denotes the total number of quantum operations. Since Clifford operations admit efficient stabilizer-based simulation, whereas non-Clifford operations are the primary source of quantum computational complexity, the Clifford Rate provides an informative characterization of the program's simulability and its dependence on non-classical computational resources. A higher Clifford Rate generally indicates that a larger portion of the program remains within the efficiently simulable stabilizer regime, whereas a lower ratio suggests stronger reliance on non-Clifford resources and potentially higher symbolic-analysis complexity.
Overall, this analysis not only guides the selection of appropriate evolution rules during Tableau Chain construction but also provides a quantitative measure of the computational structure and complexity of the quantum program.
3.3.2 Support Analysis and Quantum State Reconstruction. While the Tableau Chain provides an efficient symbolic representation for propagating quantum programs under both Clifford and non-Clifford operations, it primarily captures structural evolution at the level of stabilizer generators rather than explicit quantum state semantics. However, many analysis tasks require access to state-level information that is not directly encoded in the tableau representation. In particular, support analysis is essential for understanding the distribution of computational basis states that contribute to the quantum state, which is crucial for reasoning about sparsity, interference structure, and measurement outcomes. Without explicit support information, the symbolic representation remains disconnected from observable behavior in the computational basis. Furthermore, state reconstruction is necessary to bridge the gap between tableau-level symbolic evolution and amplitude-level quantum semantics. Since non-Clifford operations introduce weighted linear combinations of tableaux, the resulting representation cannot be interpreted as a single stabilizer state. Therefore, reconstructing the full quantum state from tableau ensembles becomes essential for capturing interference effects and for enabling downstream analyses such as entanglement characterization and probability estimation.
We briefly derive the linear constraint formulation used for support extraction from stabilizer tableaux. To simplify the presentation, we first consider the support reconstruction problem for a single tableau. The extension to a weighted collection of tableaux maintained in a Tableau Chain will be discussed subsequently. Let be a stabilizer tableau with stabilizer generators . Each generator is an n-qubit Pauli operator and can be written (up to a global phase) in the standard form
where are binary vectors indicating the support of the and components, respectively, and specifies the phase factor of the Pauli operator.
Consider a computational basis state , where . The action of a Pauli operator on the -th qubit satisfies
111:17
For to belong to the support of the stabilizer state, it must satisfy the stabilizer constraint
Therefore, for a basis state to contribute to a stabilizer-invariant superposition, it must be mapped by the component onto another basis state that remains within the support. This induces a consistency condition that the support is closed under the bit-flip structure defined by , i.e., basis states appear in cosets of the subspace generated by .
After restricting the analysis to a fixed coset representative (i.e., quotienting out the X-induced orbit structure), the bit-flip contribution is absorbed into the support structure, and only the phase constraint remains. In this reduced representation, the stabilizer condition becomes
where encodes the effective sign of the stabilizer generator.
Discarding the global phase (which can be absorbed into generator normalization), we obtain the phase consistency condition
which yields the linear constraint
Stacking all stabilizer generators yields a linear system:
where is formed by stacking vectors , and collects the phase bits .
Therefore, the computational basis support of the stabilizer state is characterized as the solution space of this linear system. In practice, we apply Gaussian elimination over to this linear system, which effectively eliminates the contributions induced by the X components and reduces the problem to solving for the affine solution space of a single stabilizer tableau. This procedure yields the complete computational basis support associated with the given stabilizer tableau. The solution set defines the support of the stabilizer state:
which forms an affine subspace over .
A key property of stabilizer states is that all computational basis states in the support have equal amplitude magnitude. Hence, the state can be expressed as
where denotes the relative phase determined by stabilizer constraints.
To recover , we fix a reference element and set , while the remaining phases are determined by consistency conditions induced by the stabilizer generators. Specifically, X- and Y-type components introduce sign flips and imaginary phase contributions under symplectic propagation, allowing a consistent phase assignment over the entire support.
For a node containing multiple tableaux with associated weights , each tableau is independently reconstructed as
111:18
Shangzhou Xia, Junjie Luo, Jianjun Zhao
and the overall quantum state is obtained via linear combination:
leading to the amplitude expression
This reconstruction procedure provides a mapping from tableau ensembles to explicit quantum state representations, enabling a consistent interpretation of computational basis support and amplitude structure. It thereby serves as the basis for subsequent analyses within the Tableau Chain framework, including entanglement characterization and interference evaluation.
3.3.3 Entanglement Analysis. Given the reconstructed quantum state within the Tableau Chain, we characterize entanglement properties among qubits, which play a central role in understanding quantum correlations, information propagation, and the structural complexity of program evolution. In particular, entanglement analysis provides essential insight into how quantum information is distributed across subsystems, and serves as a key indicator of non-classical behavior in intermediate computational states. In contrast to full state-vector simulation, our framework does not uniformly rely on explicit construction of reduced density matrices. Instead, we exploit the structure of stabilizer-based representations to compute entanglement efficiently whenever possible. In the stabilizer regime, entanglement can be inferred directly from tableau structure without density matrix reconstruction, whereas in more general settings involving tableau ensembles or non-Clifford-induced superpositions, we resort to reduced density matrix purity as a unified quantitative measure. This hybrid design allows us to balance computational efficiency with general applicability, while maintaining consistency with amplitude-level quantum semantics.
We consider a bipartition of the qubit register into subsystem A and its complement B. To quantify entanglement, we use the purity of the reduced state on subsystem A, defined as , as a unified measure of quantum correlation strength. However, the computation of this quantity does not always require explicit construction of the reduced density matrix. Instead, we exploit the structure of the tableau representation to derive more efficient evaluation strategies whenever applicable. Our analysis distinguishes three cases depending on the representational structure of the tableau ensemble.
Case 1: Single Stabilizer State. When the state is represented by a single stabilizer tableau, entanglement between subsystems can be evaluated directly from the stabilizer structure without explicit state-vector reconstruction. This follows the stabilizer entanglement formalism introduced by Fattal et al. [13], which characterizes bipartite entanglement of stabilizer states through the algebraic structure of stabilizer generators.
Let denote a stabilizer tableau on qubits, and let be a subsystem of interest with complement . We represent the stabilizer group in its binary symplectic form , where each row corresponds to an independent stabilizer generator over . To analyze subsystem entanglement, we restrict each generator to subsystem by deleting the columns associated with subsystem . This yields a reduced symplectic representation , which captures the stabilizer constraints that remain observable on subsystem . The entanglement between and is determined by the reduction in the number of independent stabilizer constraints induced by this restriction, which quantifies the loss of locally enforceable degrees of freedom due to correlations across the bipartition. Let denote the subgroup of stabilizers whose support is entirely contained in subsystem . Let denote the number of independent local stabilizer generators. In
111:19
our implementation, is computed by restricting the stabilizer representation to subsystem A and applying Gaussian elimination to identify the independent generators belonging to . The entanglement entropy is then given by
This quantity corresponds, up to local Clifford equivalence, to the number of maximally entangled Bell pairs across the bipartition and is consistent with the stabilizer entanglement entropy formalism [13]. Importantly, this computation operates entirely within the algebraic stabilizer representation, avoiding explicit construction of reduced density matrices and enabling efficient entanglement evaluation directly from the tableau structure.
Case 2: Product-State Tableau Mixture. When the state at a node is represented as a weighted ensemble of stabilizer tableaux with coefficients , we consider the regime in which each tableau induces a product state with respect to the bipartition (e.g., after local Clifford disentangling or when no intra-branch entanglement is present). In this setting, entanglement originates solely from coherent interference between different tableau branches, rather than from correlations within individual branches. Let be a subsystem and its complement. Each tableau defines a pure stabilizer state , whose subsystem restrictions are denoted by and , obtained by projecting the stabilizer structure onto the corresponding qubit subsets and normalizing the resulting states. To capture cross-branch interference effects, we define subsystem overlap matrices
which encode the overlap structure induced by the tableau ensemble on each subsystem. The purity of the reduced density matrix on subsystem A is computed using the swap-trick formulation
This expression arises from expanding the tensor-product structure of and applying the swap operator on subsystem A, which couples cross-branch overlaps within A while contracting complementary contributions on subsystem B. Importantly, all quantities are computed directly from tableau-induced overlaps, avoiding explicit construction of density matrices. This provides an efficient mechanism to capture entanglement generated purely by interference between stabilizer branches in the ensemble representation.
Case 3: General Tableau Ensemble. When the tableau representation contains non-product stabilizer structures and does not satisfy either stabilizer-reducibility (Case 1) or product-ensemble factorization (Case 2), we resort to explicit state reconstruction as a general fallback procedure. In this regime, the full quantum state is reconstructed in the computational basis as
where the amplitudes are obtained from the tableau-chain propagation procedure, which aggregates contributions from all tableau components, including their associated weights and global phase corrections as described in the previous sections.
Given the reconstructed state, the reduced density matrix on subsystem A is obtained via partial trace over subsystem B:
Entanglement can then be evaluated either through the eigenvalue spectrum of or equivalently via Schmidt decomposition. As a computationally efficient scalar proxy, the purity is used when full spectral information is not required. Although this procedure has exponential cost in
111:20
Shangzhou Xia, Junjie Luo, Jianjun Zhao
the worst case due to full state reconstruction, it provides a general and consistent entanglement characterization when neither stabilizer-based nor product-ensemble simplifications are applicable.
This three-level entanglement characterization framework enables systematic analysis across different regimes of the Tableau Chain representation, including stabilizer-dominated, product-ensemble, and general reconstruction settings. By exploiting stabilizer structure whenever available and resorting to full state reconstruction only when necessary, the proposed approach achieves a principled trade-off between computational efficiency and representational generality, while remaining consistent with amplitude-level quantum semantics induced by the tableau-chain propagation model.
4 Experimental Evaluation
To evaluate the effectiveness of our proposed framework, we implement StabQ in Python based on the Qiskit Library [20]. All experiments were run on a MacBook Pro with an Apple M1 Pro chip and 16 GB unified memory. In the experiments, we intend to answer the following questions:
-
RQ1 (Model Correctness): How correctly does StabQ construct Tableau Chains for quantum programs?
-
RQ2 (Program Analysis): How effectively does StabQ support quantum program analysis tasks over Tableau Chains?
-
RQ3 (Scalability): How does StabQ scale with respect to circuit characteristics such as qubit number, gate number, and Clifford rate?
Table 1. Benchmark circuits used in the evaluation of StabQ.
| Benchmark Circuits | Qubits Number | Gates Number | |
|---|---|---|---|
| Algorithms | Amplitude Estimation, Deutsch-Jozsa, Grover, QAOA, QFT, QPEExact, QPEInexact, QWalk, GHZ, VQE | 2 – 14 | 2 – 12327 |
| MQT Bench | GraphState, PortfolioQAOA, PortfolioVQE, QNN, QFTEntangled, RealAmpRandom, Su2-Random, TwoLocalRandom, WState | 2 – 14 | 2 – 532 |
| QASMBench | Adder, Bell, Fredkin, Toffoli, Teleportation, Simon, SAT, QEC, HHL, Qrng, LPN, PEA ... | 2 – 14 | 4 – 689 |
In RQ1, we evaluate the correctness of the Tableau Chain constructed by StabQ. Specifically, we assess whether the proposed symbolic execution model can faithfully capture quantum program semantics by validating that both quantum state reconstruction and entanglement analysis derived from the Tableau Chain are consistent with exact quantum-state simulations. In RQ2, we investigate the effectiveness of StabQ in performing downstream analysis based on the constructed Tableau Chains. Specifically, we evaluate the runtime overhead of two representative categories of downstream analysis tasks: quantum state reconstruction and entanglement analysis. Since support-set computation can be directly derived from reconstructed quantum states, and entanglement analysis relies on purity computation over reduced states, these two categories capture the essential analysis capabilities provided by StabQ. Therefore, we report their performance across benchmark circuits with varying characteristics. In RQ3, we examine the scalability of StabQ under varying circuit characteristics. Specifically, we investigate how factors such as the number of qubits, circuit size (in terms of gate count), and Clifford rate affect the runtime and memory consumption of the framework.
111:21
For correctness evaluation, we use qiskit.quantum_info.Statevector as the ground truth. Existing stabilizer-based simulators are not suitable as correctness baselines because they are primarily designed for Clifford circuits and cannot directly handle general quantum programs containing non-Clifford operations. Since StabQ aims to construct an exact symbolic representation of quantum program evolution rather than an approximate simulation model, we compare the quantum states reconstructed from Tableau Chains with the exact statevectors generated by Qiskit's statevector simulator. This comparison directly evaluates whether StabQ faithfully preserves the semantic evolution of quantum programs. For benchmarks, we evaluate StabQ using three benchmark suites: Algorithms, MQT Bench [28], and QASMBench [22], as summarized in Table 1. All evaluated circuits contain fewer than 15 qubits to ensure feasibility of exact statevector-based simulation.
4.1 Model Correctness
We conducted experiments on benchmark quantum programs. We set a maximum model building time of 2000 seconds, and the results are presented in Table 2.
The experimental results demonstrate that the Tableau Chains constructed by StabQ correctly support the evaluated downstream analysis tasks, including quantum state reconstruction and entanglement analysis. Specifically, we reconstruct quantum statevectors from the Tableau Chains and compare them with the statevectors generated by an exact statevector simulator. Across all evaluated benchmark circuits, the reconstructed states are identical to the simulation results, indicating that StabQ faithfully preserves the semantic evolution of quantum programs during symbolic execution. Furthermore, for entanglement analysis, we validate the purity values computed from the Tableau Chain representation by comparing them with the results obtained through Schmidt decomposition over the complete density matrix. The results show that the purity values derived from StabQ are fully consistent with those obtained from the density-matrix-based approach, further demonstrating that the symbolic representation accurately preserves the entanglement information of quantum states. Compared with direct quantum execution or statevector simulation, constructing a Tableau Chain introduces additional computational overhead because StabQ explicitly maintains symbolic states and execution information at each program step. However, unlike conventional simulation approaches that only provide the final execution result, the constructed Tableau Chain captures the complete evolution history of quantum states and enables multiple downstream analyses over arbitrary intermediate program states after a single model construction process. Therefore, the construction cost represents a trade-off for obtaining a reusable symbolic execution representation that supports comprehensive quantum program analysis. To further evaluate the compactness of the proposed representation, we record the number of tableaux contained in each Tableau Node throughout the entire Tableau Chain and report the maximum value observed for each benchmark family. Although some benchmark families, such as QPEExact, Grover, and QWalk, exhibit relatively low Clifford rates, the number of tableaux remains bounded within practical limits across the evaluated benchmarks and does not exhibit exponential growth in these cases. This suggests that the tableau consolidation strategy effectively contributes to controlling the growth of symbolic representations by merging equivalent tableaux during symbolic execution.
Overall, the results show that StabQ constructs a semantically consistent symbolic execution model while maintaining a compact Tableau Chain in practice. Although circuits with intensive non-Clifford operations may still introduce additional symbolic growth, the proposed representation provides a practical foundation for systematic quantum program analysis by enabling reusable intermediate-state representations.
111:22
Shangzhou Xia, Junjie Luo, Jianjun Zhao
Table 2. Experimental results of model construction and correctness evaluation on representative benchmark quantum programs. Each benchmark family is treated as a single experimental group. We report the ranges of qubit number, gate number, Clifford rate, model construction time (seconds), peak memory usage (MB), and the maximum number of generated tableaux for all circuits whose Tableau Chains are successfully constructed within 2000 seconds.
| Quantum Circuits | Qubit & Gate Number | Clifford Rate | Build Time | Peak Memory | Tableau Number | Analysis Results | |
|---|---|---|---|---|---|---|---|
| State | Entanglement | ||||||
| AE | 2 – 9 | 0.4156 | 0.011 | 67.86 | 4 | ✓ | ✓ |
| 7 – 77 | 0.5714 | 967.8 | 123.7 | 512 | |||
| DJ | 2 – 14 | 1.0000 | 0.001 | 68.89 | 1 | ✓ | ✓ |
| 4 – 40 | 1.0000 | 46.15 | 81.30 | 1 | |||
| Grover | 2 – 9 | 0.5178 | 0.003 | 68.90 | 1 | ✓ | ✓ |
| 2 – 1195 | 1.0000 | 1468 | 170.6 | 64 | |||
| QAOA | 3 – 9 | 0.2000 | 0.070 | 68.09 | 4 | ✓ | ✓ |
| 15 – 45 | 0.2000 | 1253 | 85.50 | 256 | |||
| QFT | 2 – 14 | 0.1875 | 0.010 | 68.75 | 1 | ✓ | ✓ |
| 4 – 112 | 0.7500 | 842.6 | 88.31 | 1 | |||
| QPEExact | 2 – 10 | 0.3636 | 0.005 | 69.28 | 1 | ✓ | ✓ |
| 4 – 66 | 1.0000 | 117.1 | 88.31 | 64 | |||
| QPEInexact | 2 – 9 | 0.3684 | 0.006 | 68.86 | 2 | ✓ | ✓ |
| 57 | 0.7500 | 567.8 | 97.98 | 256 | |||
| QWalk | 3 – 13 | 0.1849 | 0.109 | 69.38 | 4 | ✓ | ✓ |
| 25 – 12327 | 0.7600 | 1212 | 258.7 | 96 | |||
| GHZ | 2 – 14 | 1.0000 | 0.006 | 68.09 | 1 | ✓ | ✓ |
| 2 – 14 | 1.0000 | 0.030 | 69.34 | 1 | |||
| VQE | 3 – 12 | 0.3333 | 0.040 | 69.27 | 8 | ✓ | ✓ |
| 13 – 58 | 0.4737 | 281.5 | 437.6 | 4096 | |||
| GraphState | 3 – 14 | 1.0000 | 0.014 | 69.38 | 1 | ✓ | ✓ |
| 6 – 28 | 1.0000 | 112.4 | 85.50 | 1 | |||
| PQAOA | 3 – 12 | 0.0000 | 0.134 | 85.50 | 8 | ✓ | ✓ |
| 21 – 246 | 0.0000 | 1953 | 1398 | 4096 | |||
| PVQE | 3 – 11 | 0.4286 | 0.211 | 70.19 | 8 | ✓ | ✓ |
| 21 – 209 | 0.7895 | 1457 | 624.1 | 2048 | |||
| QNN | 2 – 12 | 0.3333 | 0.037 | 69.05 | 4 | ✓ | ✓ |
| 15 – 455 | 0.6044 | 1991 | 2148 | 4096 | |||
| QFTEntangled | 2 – 9 | 0.3793 | 0.012 | 67.86 | 4 | ✓ | ✓ |
| 6 – 1008 | 0.8333 | 1667 | 83.50 | 512 | |||
| RAR | 2 – 12 | 0.2727 | 0.020 | 69.03 | 4 | ✓ | ✓ |
| 11 – 246 | 0.8049 | 1069 | 1488 | 4096 | |||
| S2R | 2 – 12 | 0.2727 | 0.040 | 67.95 | 4 | ✓ | ✓ |
| 11 – 246 | 0.8049 | 1415 | 1032 | 4096 | |||
| TLR | 2 – 12 | 0.2727 | 0.036 | 69.31 | 4 | ✓ | ✓ |
| 11 – 246 | 0.8049 | 1061 | 716.4 | 4096 | |||
| WState | 2 – 14 | 0.5094 | 0.012 | 69.41 | 2 | ✓ | ✓ |
| 5 – 53 | 0.6000 | 321.4 | 365.8 | 8192 | |||
| QASMBench | 2 – 13 | 0.3333 | 0.013 | 68.64 | 2 | ✓ | ✓ |
| 4 – 689 | 1.0000 | 430.6 | 106.4 | 128 | |||
111:23
Answer to RQ1: StabQ correctly constructs a semantically consistent Tableau Chain that faithfully captures the execution evolution of quantum programs. The quantum states reconstructed from the generated Tableau Chains exactly match those obtained from an exact statevector simulator across all evaluated benchmark circuits. Furthermore, the purity values computed from the Tableau Chain representation are identical to those obtained through Schmidt decomposition over the complete density matrix, demonstrating that StabQ preserves both state semantics and entanglement information. In addition, the number of tableaux maintained in the Tableau Chain remains bounded in practice, even for benchmark families with relatively low Clifford rates, suggesting that tableau consolidation effectively mitigates symbolic representation growth. These results demonstrate that StabQ constructs reliable and reusable symbolic execution models for downstream quantum program analysis.
4.2 Program Analysis
We evaluate the capability of StabQ in supporting quantum program analysis tasks based on the constructed Tableau Chains using benchmark quantum programs. The experimental results are summarized in Table 3.
For the quantum state reconstruction task, StabQ performs analysis directly on the symbolic representation maintained by the Tableau Chain. Specifically, support analysis, as an essential step in the state recovery process, employs a method based on to determine the computational-basis support of quantum states, and combines it with relative phase reconstruction to recover complete quantum state information. This process enables the analysis module to directly access intermediate quantum states recorded in the Tableau Chain without requiring re-execution of the original quantum program. For the entanglement analysis task, StabQ infers the entanglement properties of intermediate quantum states based on the symbolic states stored in the Tableau Chain. Specifically, we compute the purity of reduced states and compare the results with those obtained through Schmidt decomposition over the corresponding full density matrices. The experimental results show that the purity values computed by StabQ are identical to those obtained from Schmidt decomposition, demonstrating that the Tableau Chain preserves the semantic information required for accurate entanglement inference. For Cases 1 and 3 (Section 3.3.3), StabQ directly performs entanglement analysis on the evaluated states. For Case 2, although the corresponding circuits exhibit product-state structures, the current analysis procedure does not explicitly exploit such structural information, resulting in additional symbolic processing overhead during tableau manipulation.
Overall, the experimental results demonstrate that the Tableau Chain serves not only as a symbolic representation of quantum program execution but also as a unified intermediate representation supporting multiple analysis tasks. Compared with the one-time construction process of the Tableau Chain, subsequent analysis tasks incur significantly lower overhead, highlighting the reusability of the proposed representation in quantum program analysis scenarios. Unlike approaches that require re-executing programs or reconstructing states separately for different analysis tasks, StabQ enables reusable analysis over arbitrary execution steps through a single Tableau Chain construction process.
Answer to RQ2: StabQ effectively supports downstream quantum program analysis tasks through the unified Tableau Chain representation. Once the Tableau Chain is constructed, StabQ enables quantum state reconstruction and entanglement analysis over arbitrary execution steps without requiring repeated program execution or intermediate-state reconstruction. The state reconstruction process leverages support analysis and relative
111:24
Shangzhou Xia, Junjie Luo, Jianjun Zhao
Table 3. Experimental results of quantum state analysis and entanglement analysis on the benchmark quantum programs. We perform both analyses on all circuits in Table 1, with a maximum analysis time of 500 seconds. For each benchmark family, we report the range of analysis time (seconds). For entanglement analysis, we report the entanglement analysis case (Section 3.3.3) and the range of tableau number at the analyzed program step.
| Quantum Circuits | State | Entanglement | ||||
|---|---|---|---|---|---|---|
| Qubit Number | Time | Qubit Number | Case | Tableau Number | Time | |
| AE | 2 – 9 | 0.0006 | 2 – 7 | 2 | 4 | 0.0012 |
| 0.1314 | 256 | 218.77 | ||||
| DJ | 2 – 14 | 0.0003 | 2 – 14 | 1 | 1 | 0.0001 |
| 0.0032 | 0.0001 | |||||
| Grover | 2 – 9 | 0.0003 | 2 – 9 | 1,2 | 1 | 0.0001 |
| 0.4502 | 64 | 19.012 | ||||
| QAOA | 3 – 9 | 0.0016 | 2 – 8 | 2 | 4 | 0.0023 |
| 14.584 | 128 | 212.30 | ||||
| QFT | 2 – 14 | 0.0004 | 2 – 14 | 1 | 1 | 0.0001 |
| 3.0147 | 0.0001 | |||||
| QPEExact | 2 – 10 | 0.0003 | 2 – 10 | 1 | 1 | 0.0001 |
| 0.0008 | 0.0001 | |||||
| QPEInexact | 2 – 9 | 0.0004 | 2 – 8 | 2 | 2 | 0.0003 |
| 0.0673 | 128 | 212.99 | ||||
| QWalk | 3 – 13 | 0.0004 | 3 – 13 | 1,2 | 1 | 0.0001 |
| 0.0059 | 8 | 0.2566 | ||||
| GHZ | 2 – 14 | 0.0004 | 2 – 14 | 1 | 1 | 0.0001 |
| 0.0031 | 0.0001 | |||||
| VQE | 2 – 12 | 0.0012 | 2 – 12 | 3 | 8 | 0.0014 |
| 1.2138 | 3414 | 1.3932 | ||||
| Graphstate | 3 – 14 | 0.0006 | 3 – 14 | 1 | 1 | 0.0001 |
| 3.0851 | 0.0001 | |||||
| PQAOA | 3 – 12 | 0.0011 | 3 – 7 | 2 | 8 | 0.0106 |
| 1.4299 | 128 | 211.84 | ||||
| PVQE | 3 – 11 | 0.0011 | 3 – 7 | 2 | 8 | 0.0104 |
| 1.0739 | 128 | 208.49 | ||||
| QNN | 2 – 12 | 0.0006 | 2 – 12 | 3 | 4 | 0.0007 |
| 1.4682 | 4096 | 1.6140 | ||||
| QFTEntangled | 2 – 9 | 0.0007 | 2 – 9 | 3 | 4 | 0.0008 |
| 14.668 | 512 | 14.822 | ||||
| RAR | 2 – 12 | 0.0006 | 2 – 12 | 3 | 4 | 0.0007 |
| 1.4871 | 4096 | 1.6308 | ||||
| S2R | 2 – 12 | 0.0006 | 2 – 12 | 3 | 4 | 0.0007 |
| 1.4830 | 4096 | 1.6196 | ||||
| TLR | 2 – 12 | 0.0006 | 2 – 12 | 3 | 4 | 0.0007 |
| 1.4828 | 4096 | 1.6085 | ||||
| WState | 2 – 14 | 0.0004 | 2 – 14 | 3 | 2 | 0.0008 |
| 0.0087 | 14 | 0.0098 | ||||
| QASMBench | 2 – 13 | 0.0004 | 2 – 13 | 1,2,3 | 1 | 0.0001 |
| 0.0942 | 128 | 205.57 | ||||
111:25
phase reconstruction to accurately recover state information from symbolic representations. Moreover, the purity values obtained by StabQ for entanglement analysis are consistent with those computed from Schmidt decomposition over full density matrices, demonstrating that the Tableau Chain preserves the semantic information required for entanglement inference. These results demonstrate that Tableau Chain serves as a reusable symbolic intermediate representation for supporting systematic quantum program analysis.
4.3 Scalability with Respect to Circuit Characteristics
Considering that different benchmark circuit families impose different upper bounds on the number of qubits for which a Tableau Chain model can be successfully constructed, we restrict our analysis to the common qubit range of 3 to 9, which is supported across all benchmarks. To reduce variance and enable a consistent cross-benchmark comparison, we aggregate all experimental results within this range. Furthermore, both gate count and Clifford rate are discretized into seven equal-width bins to facilitate a uniform analysis of their impact on construction overhead. The experimental results are summarized in Figure 2.
The results demonstrate that StabQ exhibits good scalability in Tableau Chain model construction across all evaluated benchmarks. Both construction time and peak memory consumption increase with circuit size, while remaining within practical limits across the tested configurations.
As shown in Figures 2a and 2c, construction time increases steadily with both the number of qubits and the number of gates. This trend reflects the growing cost of tableau propagation and symbolic state updates during model construction. In contrast, Figures 2b and 2d indicate that peak memory consumption grows more moderately. Although larger circuits introduce greater variance and occasional high-memory outliers, most benchmarks remain within a relatively stable memory range, suggesting that the Tableau Chain representation maintains favorable memory efficiency.
The effect of the Clifford rate is less straightforward. Figures 2e and 2f show that neither construction time nor peak memory consumption exhibits a monotonic dependence on the Clifford rate. Instead, the overhead varies significantly across different Clifford-rate intervals, indicating that the performance of StabQ is influenced more by the overall symbolic structure of the circuit than by the proportion of Clifford gates alone. The observed non-monotonic behavior suggests that the proposed symbolic representation and tableau consolidation strategy reduce the sensitivity of construction overhead to the proportion of non-Clifford operations. In some cases, circuits with higher Clifford rates even require less construction time, further supporting the idea that symbolic handling of non-Clifford gates, together with tableau consolidation, effectively mitigates their computational overhead during model construction.
Overall, the results suggest that StabQ’s construction cost is largely driven by circuit size, in terms of qubit and gate counts, while the influence of Clifford rate primarily reflects higher-order structural properties of the circuit rather than a direct linear effect.
Answer to RQ3: StabQ demonstrates good scalability in Tableau Chain model construction across the evaluated benchmark circuits. The construction overhead mainly increases with circuit size, including the number of qubits and gates, while the peak memory consumption remains relatively stable within practical limits. The impact of Clifford rate is not directly proportional to the construction cost, suggesting that the overall symbolic structure of the circuit plays a more important role than the Clifford rate alone. These results indicate that the proposed symbolic representation and tableau consolidation strategy effectively control the growth of symbolic states and enable StabQ to construct scalable quantum program models.
111:26
Shangzhou Xia, Junjie Luo, Jianjun Zhao

(a) Distribution of the model building time of StabQ on benchmark circuits grouped by qubit number.

(b) Distribution of the peak memory of StabQ on benchmark circuits grouped by qubit number.

(c) Distribution of the model building time of StabQ on benchmark circuits grouped by gate number.

(d) Distribution of the peak memory of StabQ on benchmark circuits grouped by gate number.

(e) Distribution of the model building time of StabQ on benchmark circuits grouped by Clifford rate.

(f) Distribution of the peak memory of StabQ on benchmark circuits grouped by Clifford rate.
Fig. 2. Time and memory overhead of StabQ model construction across benchmark circuits. The box plots show the distributions of model building time and peak memory consumption when the benchmark circuits are grouped by qubit number, gate number, and Clifford rate. The y-axes of the time overhead are logarithmic.
5 Discussion
The experimental results reveal several key factors influencing the overall scalability behavior of StabQ, along with its operational boundaries and potential directions for further improvement.
First, although StabQ leverages the stabilizer formalism for circuit evolution, the introduction of non-Clifford operations can still lead to an exponential growth in the number of tableaux, thereby imposing significant pressure on both construction time and memory consumption. While existing tableau consolidation techniques can partially alleviate this issue, an optimal consolidation strategy remains an open problem. Specifically, we formalize this challenge as follows:
PROBLEM 1. Given a set of stabilizer groups , where each stabilizes a quantum state , and a set of complex coefficients satisfying , we define the linear
111:27
combination state
We aim to determine whether there exists a stabilizer group such that is stabilized by , i.e.,
and if such a stabilizer group exists, how to construct from and .
This problem has been repeatedly encountered in the optimization of StabQ, and we illustrate it using two representative examples as follows:
EXAMPLE 1.
EXAMPLE 2.
Second, we observe that the global phase recovery process may admit a more efficient formulation. The key observation is that stabilizer composition induces a finite symbolic space, where each Pauli string is restricted to I, X, Y, Z. Moreover, since non-Clifford operations are handled via Pauli decomposition, the evolution can ultimately be reduced to a finite set of Clifford operations. This suggests that a pattern-matching-based strategy may improve efficiency. However, ensuring soundness of such an approach remains challenging, and therefore it is not adopted in the current framework.
Third, we consider Case 2 of the entanglement analysis (Section 3.3.3). Although this setting exhibits a tensor-product-like structure within each tableau branch, our experiments show that the current processing strategy is less efficient than that used for Case 3. This indicates that the handling of Case 2 is not yet optimal in the current framework, and improving its processing strategy remains an important direction for future work.
Overall, the above observations suggest that the scalability of StabQ is primarily governed by structural properties of quantum circuits rather than individual gate-level characteristics. In particular, the interaction between non-Clifford operations and tableau evolution plays a central role in determining computational overhead, while global structural features such as symbolic redundancy and entanglement organization further influence performance. These findings highlight that improving StabQ requires not only optimizing low-level operations such as tableau consolidation and phase recovery, but also developing more structure-aware strategies that better capture higher-level circuit characteristics.
6 Threats to Validity
We discuss the potential threats to the validity of our study from four perspectives.
Internal Validity. The correctness of StabQ depends on the implementation of several core components, including stabilizer propagation, Pauli decomposition, global-phase recovery, and tableau consolidation. Errors in these components may affect the correctness of the constructed Tableau Chain and downstream analysis results. To mitigate this threat, we validate the correctness of the constructed symbolic models by reconstructing quantum states from Tableau Chains and comparing them with the exact statevectors generated by a Qiskit statevector simulator.
111:28
Shangzhou Xia, Junjie Luo, Jianjun Zhao
External Validity. The generalizability of our evaluation may be affected by the characteristics and scale of the selected benchmark programs. Although our experiments include multiple benchmark suites with diverse circuit structures and Clifford rates, the evaluated circuits remain limited in scale due to the complexity of symbolic representations that involve non-Clifford operations. Moreover, StabQ is currently implemented as a research prototype and does not fully exploit all possible engineering optimizations. Therefore, the reported performance reflects the effectiveness of the proposed symbolic execution approach rather than the maximum efficiency achievable by a fully optimized implementation. Future work will investigate advanced symbolic reduction techniques and evaluate StabQ on larger-scale quantum applications.
Construct Validity. We evaluate StabQ based on symbolic model correctness, downstream analysis capability, and scalability. However, these metrics may not fully capture all aspects of a symbolic execution framework. For example, the number of tableaux is used as an indicator of growth in symbolic representation, but it does not fully characterize memory consumption or computational complexity. In addition, our evaluation of downstream analysis focuses on quantum state reconstruction and entanglement analysis, while other potential quantum program analysis tasks remain unexplored.
Conclusion Validity. Our conclusions are derived from the experimental results obtained on the evaluated benchmark programs. Although the correctness of reconstructed states and entanglement properties is verified against exact references, the observed performance trends may vary for different circuit structures, qubit scales, and Clifford rates. Therefore, the conclusions should be interpreted within the scope of the evaluated benchmarks.
7 Related Work
This work is closely related to three major lines of research: static analysis techniques for quantum programs, specialized semantic models for quantum program analysis, and applications of the stabilizer formalism.
7.1 Static Analysis of Quantum Programs
A substantial body of work applies classical static analysis techniques to quantum programs. These efforts have primarily focused on two fundamental analysis objectives: support analysis, which determines the qubits involved in quantum computation, and entanglement analysis, which infers entanglement relationships among qubits. Yu and Palsberg [40] proposed a quantum abstract interpretation based on projection abstractions, representing quantum states as tuples of low-dimensional projections rather than full density matrices. This abstraction enables efficient state propagation while preserving only support information for subsequent analysis. Perdrix [27] pioneered an abstract interpretation that over-approximates entanglement relations among qubits as a partition of the quantum system. Honda [19] refined this direction by tracking abstract stabilizer information to approximate entanglement more precisely. Xia and Zhao [38] proposed a static analysis approach that constructs an entanglement connectivity graph directly from quantum program code, enabling the inference of entanglement relationships among qubits throughout quantum state evolution. Type-system-based approaches such as Twist [41] combine static reasoning with runtime checks to enforce purity of quantum data, while linters and bug detectors such as QChecker [42] and LintQ [26] detect common bug patterns in real-world quantum programs through abstraction- and pattern-based static checks.
These static analysis approaches provide efficient analysis with formal soundness guarantees in many cases. However, due to the use of abstraction, they may sacrifice precision and introduce false positives, limiting their applicability to fine-grained quantum program analysis. Moreover, existing approaches are typically designed for specific analysis objectives and rely on task-specific
111:29
semantic models. Developing a unified representation that supports diverse quantum program analysis tasks remains challenging, limiting its generality and extensibility.
7.2 Specialized Models for Quantum Program Analysis
Another line of work builds dedicated semantic models for particular analysis tasks. Decision-diagram-based representations [6, 25, 35, 37] have been widely explored for quantum circuit simulation and equivalence checking due to their ability to compactly encode structured quantum states and operations. The ZX-calculus [8, 9, 21] provides a graphical rewriting framework that represents quantum circuits as algebraic graphs and applies sound rewrite rules for circuit optimization and equivalence checking. Tensor-network-based approaches [23] exploit structural properties of quantum circuits, such as limited connectivity and small treewidth, to enable efficient classical simulation through tensor contraction. Quantum Markov chain-based approaches [10, 14, 39] model quantum programs as state-transition systems and enable reachability analysis and model checking of quantum behaviors. Tree-automata-based approaches [2, 7] provide symbolic representations of sets of quantum states and support automated verification of quantum circuits through automata-based reasoning.
Although these semantic models provide powerful abstractions for quantum program analysis, many of them are adapted from general-purpose computational models or mathematical frameworks originally developed outside quantum computing. Consequently, applying these models to quantum programs often requires additional abstractions, constraints, or domain-specific adaptations to capture quantum-specific properties. In contrast, the stabilizer formalism originates directly from quantum information theory and exploits the algebraic structure of quantum states and operations, providing inherent advantages for analyzing quantum-specific properties.
7.3 Stabilizer Formalism and Its Applications
The stabilizer formalism [18], originating in quantum error-correction theory, has become a fundamental framework for constructing and analyzing quantum error-correcting codes and fault-tolerant quantum computation [15, 29, 30]. Beyond its original applications, the stabilizer formalism has also emerged as an efficient representation for quantum states and operations, particularly in the context of Clifford circuits. Gottesman and Knill's theorem demonstrates that Clifford circuits can be efficiently simulated classically by tracking stabilizer generators rather than explicitly manipulating exponentially large state vectors. Based on this principle, various stabilizer-based simulators, such as the Aaronson-Gottesman simulator [1] and Stim [16], have been developed to achieve scalable simulation of large-scale Clifford circuits.
Due to its compact representation and algebraic structure, the stabilizer formalism has also been explored for quantum program analysis and verification tasks. In particular, stabilizer-based approaches have been extensively studied for quantum entanglement analysis, where the structure of stabilizer generators is leveraged to characterize entanglement relationships among qubits [11, 13, 17, 19, 34]. Beyond quantum state analysis, Fang and Ying [12] integrated stabilizer representations into existing quantum program symbolic execution techniques [3] and applied their approach to quantum error-correction programs, thereby significantly improving the efficiency of formal verification. Tan et al. [32] proposed HornBro, a quantum program repair framework that combines stabilizer-based representations with the Z3 solver for fault localization and automated repair. These studies demonstrate that stabilizer representations provide compact and structured abstractions for analyzing quantum programs.
However, existing stabilizer-based applications remain fundamentally constrained by the Clifford restriction. Non-Clifford operations violate the closure property of stabilizer representations, preventing conventional stabilizer frameworks from directly preserving quantum state evolution.
111:30
Shangzhou Xia, Junjie Luo, Jianjun Zhao
in general quantum programs. Therefore, extending stabilizer-based representations to support non-Clifford operations while preserving their efficiency remains an important challenge.
Several studies [4, 5] have attempted to address this limitation through stabilizer decomposition techniques. These approaches introduce auxiliary magic states and represent non-stabilizer states as linear combinations of stabilizer states, thereby enabling the simulation of quantum circuits containing both Clifford and non-Clifford operations, such as Clifford+T circuits. By decomposing non-stabilizer components into stabilizer-state representations, they effectively extend stabilizer-based simulation beyond the Clifford-only setting.
Nevertheless, existing stabilizer decomposition approaches primarily target efficient quantum simulation rather than symbolic analysis of quantum programs. To achieve scalability, many approaches reduce simulation overhead through approximation techniques, such as truncating low-weight stabilizer components, which may introduce errors into intermediate state representations. As a result, these approaches are not directly suitable for quantum program analysis tasks that require faithful preservation of execution semantics and precise characterization of intermediate quantum states. Moreover, stabilizer decomposition methods typically focus on representing non-stabilizer states during simulation, rather than maintaining a symbolic representation of the entire program execution process.
Different from these approaches, StabQ focuses on constructing an exact symbolic representation of quantum program evolution based on stabilizer representations. Instead of approximating non-stabilizer states or decomposing states after they are generated, StabQ transforms non-Clifford operations during symbolic propagation and explicitly maintains their effects throughout program execution. This design enables stabilizer-based symbolic execution of general quantum programs that contain both Clifford and non-Clifford operations while preserving the semantic information required for downstream quantum program analysis.
8 Conclusion
In this paper, we presented StabQ, a symbolic execution framework for quantum program analysis based on stabilizer representations. StabQ extends the applicability of stabilizer-based representations beyond Clifford-only programs by enabling symbolic state propagation in quantum programs that contain non-Clifford operations. Through a Pauli-decomposition mechanism, StabQ transforms non-Clifford operations into weighted Pauli components and integrates them into a unified symbolic execution process based on weighted stabilizer tableaux. Based on this representation, StabQ constructs a Tableau Chain that captures the evolution of quantum program states throughout execution. Each Tableau Chain node records an intermediate symbolic state, allowing multiple analysis tasks to be performed over different execution stages without repeatedly reconstructing quantum states. Building upon the Tableau Chain, StabQ supports various quantum program analysis tasks, including quantum state reconstruction, entanglement analysis, support-set computation, and Clifford-property detection. To improve the scalability and maintainability of symbolic representations, StabQ incorporates tableau consolidation and global-phase recovery mechanisms. These techniques reduce redundant symbolic states and preserve the semantic information required for accurate downstream analysis. Our experimental evaluation demonstrates that StabQ constructs semantically consistent symbolic execution models and faithfully preserves quantum program behavior. Across diverse benchmark suites and circuit characteristics, the reconstructed quantum states and entanglement properties are consistent with exact reference results, demonstrating the correctness of the proposed representation. Furthermore, the results show that the Tableau Chain provides a reusable intermediate representation that effectively supports downstream quantum program analysis. Our study also identifies several limitations of the current framework. In particular, symbolic representation growth remains challenging for programs with intensive non-Clifford
111:31
operations, global-phase recovery introduces additional computational overhead, and certain entanglement structures require more specialized analysis strategies. These observations motivate future research on structure-aware symbolic representations, more efficient tableau consolidation techniques, and advanced optimization strategies for large-scale quantum programs.
Overall, StabQ provides a practical foundation for symbolic execution of quantum programs by extending stabilizer representations to support general quantum computations. By combining the compactness of stabilizer representations with explicit execution-state tracking, StabQ bridges the gap between efficient quantum state representation and systematic quantum program analysis in the presence of both Clifford and non-Clifford operations.
9 Data Availability
Our framework is publicly available at https://github.com/Xzore19/StabQ.
Acknowledgments
This work was supported by JST SPRING Grant No. JPMJSP2136, JST Moonshot R&D Grant No. JPMJMS256E and JSPS KAKENHI Grants JP24K14908, JP26K02892, JP26K23820.
References
[1] Scott Aaronson and Daniel Gottesman. 2004. Improved simulation of stabilizer circuits. Phys. Rev. A 70 (Nov 2004), 052328. Issue 5. doi:10.1103/PhysRevA.70.052328
[2] Parosh Aziz Abdulla, Yo-Ga Chen, Yu-Fang Chen, Lukáš Holík, Ondřej Lengál, Jyun-Ao Lin, Fang-Yi Lo, and Wei-Lun Tsai. 2025. Verifying Quantum Circuits with Level-Synchronized Tree Automata. Proc. ACM Program. Lang. 9, POPL, Article 32 (Jan. 2025), 31 pages. doi:10.1145/3704868
[3] Fabian Bauer-Marquart, Stefan Leue, and Christian Schilling. 2023. symQV: Automated Symbolic Verification of Quantum Programs. In Formal Methods (Lecture Notes in Computer Science), Marsha Chechik, Joost-Pieter Katoen, and Martin Leucker (Eds.). Springer, Germany, 181–198. doi:10.1007/978-3-031-27481-7_12 25th International Symposium on Formal Methods, FM 2023 ; Conference date: 06-03-2023 Through 10-03-2023.
[4] Sergey Bravyi, Dan Browne, Padraic Calpin, Earl Campbell, David Gosset, and Mark Howard. 2019. Simulation of quantum circuits by low-rank stabilizer decompositions. Quantum 3 (Sept. 2019), 181. doi:10.22331/q-2019-09-02-181
[5] Sergey Bravyi and David Gosset. 2016. Improved Classical Simulation of Quantum Circuits Dominated by Clifford Gates. Phys. Rev. Lett. 116 (Jun 2016), 250501. Issue 25. doi:10.1103/PhysRevLett.116.250501
[6] Lukas Burgholzer and Robert Wille. 2021. Advanced Equivalence Checking for Quantum Circuits. IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems 40, 9 (2021), 1810–1824. doi:10.1109/TCAD.2020.3032630
[7] Yu-Fang Chen, Kai-Min Chung, Ondřej Lengál, Jyun-Ao Lin, and Wei-Lun Tsai. 2023. AutoQ: An Automata-Based Quantum Circuit Verifier. In Computer Aided Verification, Constantin Enea and Akash Lal (Eds.). Springer Nature Switzerland, Cham, 139–153.
[8] Bob Coecke and Ross Duncan. 2011. Interacting quantum observables: categorical algebra and diagrammatics. New Journal of Physics 13, 4 (apr 2011), 043016. doi:10.1088/1367-2630/13/4/043016
[9] Bob Coecke, Dominic Horsman, Aleks Kissinger, and Quanlong Wang. 2022. Kindergarten quantum mechanics graduates ...or how I learned to stop gluing LEGO together and love the ZX-calculus. Theoretical Computer Science 897 (2022), 1–22. doi:10.1016/j.tcs.2021.07.024
[10] Aochu Dai and Mingsheng Ying. 2024. QReach: A Reachability Analysis Tool for Quantum Markov Chains. In Computer Aided Verification, Arie Gurfinkel and Vijay Ganesh (Eds.). Springer Nature Switzerland, Cham, 520–532.
[11] Matthias Englbrecht and Barbara Kraus. 2020. Symmetries and entanglement of stabilizer states. Phys. Rev. A 101 (Jun 2020), 062302. Issue 6. doi:10.1103/PhysRevA.101.062302
[12] Wang Fang and Mingsheng Ying. 2024. Symbolic Execution for Quantum Error Correction Programs. Proc. ACM Program. Lang. 8, PLDI, Article 189 (June 2024), 26 pages. doi:10.1145/3656419
[13] David Fattal, Toby S. Cubitt, Yoshihisa Yamamoto, Sergey Bravyi, and Isaac L. Chuang. 2004. Entanglement in the stabilizer formalism. (6 2004). arXiv:quant-ph/0406168
[14] Yuan Feng, Ernst Moritz Hahn, Andrea Turrini, and Lijun Zhang. 2015. QPMC: A Model Checker for Quantum Programs and Protocols. In FM 2015: Formal Methods, Nikolaj Bjørner and Frank de Boer (Eds.). Springer International Publishing, Cham, 265–272.
[15] Austin G. Fowler, Matteo Mariantoni, John M. Martinis, and Andrew N. Cleland. 2012. Surface codes: Towards practical large-scale quantum computation. Phys. Rev. A 86 (Sep 2012), 032324. Issue 3. doi:10.1103/PhysRevA.86.032324
111:32
Shangzhou Xia, Junjie Luo, Jianjun Zhao
[16] Craig Gidney. 2021. Stim: a fast stabilizer circuit simulator. Quantum 5 (2021), 497. doi:10.22331/q-2021-07-06-497
[17] S. Glancy, E. Knill, and H. M. Vasconcelos. 2006. Entanglement purification of any stabilizer state. Phys. Rev. A 74 (Sep 2006), 032319. Issue 3. doi:10.1103/PhysRevA.74.032319
[18] Daniel Gottesman. 1997. Stabilizer Codes and Quantum Error Correction. arXiv:quant-ph/9705052 [quant-ph] https://arxiv.org/abs/quant-ph/9705052
[19] Kentaro Honda. 2015. Analysis of Quantum Entanglement in Quantum Programs using Stabilizer Formalism. Electronic Proceedings in Theoretical Computer Science 195 (Nov. 2015), 262–272. doi:10.4204/eptcs.195.19
[20] IBM. 2022. Qiskit. https://qiskit.org/.
[21] Aleks Kissinger and John van de Wetering. 2020. PyZX: Large Scale Automated Diagrammatic Reasoning. EPTCS 318 (2020), 229–241. arXiv:1904.04735 [quant-ph] doi:10.4204/EPTCS.318.14
[22] Ang Li, Samuel Stein, Sriram Krishnamoorthy, and James Ang. 2023. QASMBench: A Low-Level Quantum Benchmark Suite for NISQ Evaluation and Simulation. ACM Transactions on Quantum Computing 4, 2, Article 10 (Feb. 2023), 26 pages. doi:10.1145/3550488
[23] Igor L. Markov and Yaoyun Shi. 2008. Simulating Quantum Computation by Contracting Tensor Networks. SIAM J. Comput. 38, 3 (2008), 963–981. arXiv:https://doi.org/10.1137/050644756 doi:10.1137/050644756
[24] Michael A Nielsen and Isaac L Chuang. 2010. Quantum computation and quantum information. Cambridge university press.
[25] Philipp Niemann, Robert Wille, David Michael Miller, Mitchell A. Thornton, and Rolf Drechsler. 2016. QMDDs: Efficient Quantum Function Representation and Manipulation. Trans. Comp.-Aided Des. Integ. Cir. Sys. 35, 1 (Jan. 2016), 86–99. doi:10.1109/TCAD.2015.2459034
[26] Matteo Paltenghi and Michael Pradel. 2024. Analyzing Quantum Programs with LintQ: A Static Analysis Framework for Qiskit. Proc. ACM Softw. Eng. 1, FSE, Article 95 (July 2024), 23 pages. doi:10.1145/3660802
[27] Simon Perdrix. 2008. Quantum Entanglement Analysis Based on Abstract Interpretation. In Proceedings of the 15th International Symposium on Static Analysis (Valencia, Spain) (SAS '08). Springer-Verlag, Berlin, Heidelberg, 270–282. doi:10.1007/978-3-540-69166-2_18
[28] Nils Quetschlich, Lukas Burgholzer, and Robert Wille. 2023. MQT Bench: Benchmarking Software and Design Automation Tools for Quantum Computing. Quantum 7 (July 2023), 1062. doi:10.22331/q-2023-07-20-1062
[29] P.W. Shor. 1996. Fault-tolerant quantum computation. In Proceedings of 37th Conference on Foundations of Computer Science. 56–65. doi:10.1109/SFCS.1996.548464
[30] Andrew Steane. 1996. Multiple-particle interference and quantum error correction. Proceedings of the Royal Society A: Mathematical, Physical and Engineering Sciences 452, 1954 (11 1996), 2551–2577. arXiv:https://royalsocietypublishing.org/rspa/article-pdf/452/1954/2551/998878/rspa.1996.0136.pdf doi:10.1098/rspa.1996.0136
[31] Krysta Svore, Alan Geller, Matthias Troyer, John Azariah, Christopher Granade, Bettina Heim, Vadym Kliuchnikov, Mariia Mykhailova, Andres Paz, and Martin Roetteler. 2018. Q#: Enabling Scalable Quantum Computing and Development with a High-level DSL. In Proceedings of the Real World Domain Specific Languages Workshop 2018 (RWDSL2018). ACM. doi:10.1145/3183895.3183901
[32] Siwei Tan, Liqiang Lu, Debin Xiang, Tianyao Chu, Congliang Lang, Jintao Chen, Xing Hu, and Jianwei Yin. 2025. HornBro: Homotopy-Like Method for Automated Quantum Program Repair. Proc. ACM Softw. Eng. 2, FSE, Article FSE034 (June 2025), 23 pages. doi:10.1145/3715751
[33] Dimitrios Thanos, Tim Coopmans, and Alfons Laarman. 2023. Fast Equivalence Checking of Quantum Circuits of Clifford Gates. In Automated Technology for Verification and Analysis: 21st International Symposium, ATVA 2023, Singapore, October 24–27, 2023, Proceedings, Part II (Singapore, Singapore). Springer-Verlag, Berlin, Heidelberg, 199–216. doi:10.1007/978-3-031-45332-8_10
[34] Géza Tóth and Otfried Gühne. 2005. Entanglement detection in the stabilizer formalism. Phys. Rev. A 72 (Aug 2005), 022340. Issue 2. doi:10.1103/PhysRevA.72.022340
[35] Yuan-Hung Tsai, Jie-Hong R. Jiang, and Chiao-Shan Jhang. 2021. Bit-Slicing the Hilbert Space: Scaling Up Accurate Quantum Circuit Simulation. In 2021 58th ACM/IEEE Design Automation Conference (DAC). 439–444. doi:10.1109/DAC18074.2021.9586191
[36] Maarten Van Den Nes. 2010. Classical simulation of quantum computation, the Gottesman-Knill theorem, and slightly beyond. Quantum Info. Comput. 10, 3 (March 2010), 258–271.
[37] Ziyuan Wang, Bin Cheng, Longxiang Yuan, and Zhengfeng Ji. 2025. FeynmanDD: Quantum Circuit Analysis with Classical Decision Diagrams. In Computer Aided Verification, Ruzica Piskac and Zvonimir Rakamarić (Eds.). Springer Nature Switzerland, Cham, 28–52.
[38] Shangzhou Xia and Jianjun Zhao. 2023. Static Entanglement Analysis of Quantum Programs. In 2023 IEEE/ACM 4th International Workshop on Quantum Software Engineering (Q-SE). 42–49. doi:10.1109/Q-SE59154.2023.00013
111:33
[39] Mingsheng Ying and Yuan Feng. 2021. Model Checking Quantum Systems: Principles and Algorithms. Cambridge University Press.
[40] Nengkun Yu and Jens Palsberg. 2021. Quantum abstract interpretation. In Proceedings of the 42nd ACM SIGPLAN International Conference on Programming Language Design and Implementation (Virtual, Canada) (PLDI 2021). Association for Computing Machinery, New York, NY, USA, 542–558. doi:10.1145/3453483.3454061
[41] Charles Yuan, Christopher McNally, and Michael Carbin. 2022. Twist: sound reasoning for purity and entanglement in Quantum programs. Proc. ACM Program. Lang. 6, POPL, Article 30 (Jan. 2022), 32 pages. doi:10.1145/3498691
[42] Pengzhan Zhao, Xiongfei Wu, Zhuo Li, and Jianjun Zhao. 2023. QChecker: Detecting Bugs in Quantum Programs via Static Analysis. In 2023 IEEE/ACM 4th International Workshop on Quantum Software Engineering (Q-SE). 50–57. doi:10.1109/Q-SE59154.2023.00014