Introduction
Designing a fault-tolerant quantum architecture requires choosing an error-correcting code, a syndrome-extraction procedure, and protocols for implementing logical gates. Comparing these choices often requires circuit-level simulation under physically motivated noise models, since their logical error rates and thresholds are generally difficult to determine analytically. Efficient Clifford simulation tools, such as stim [1], have made it possible to evaluate and compare a wide range of quantum memory experiments and logical Clifford operations.
Extending this capability to non-Clifford operations, which are required for universal quantum computation, remains a challenge. Numerous fault-tolerant protocols have been proposed, either to implement such operations directly or to prepare encoded magic states that enable them through state injection. These include magic state distillation [3 , 4 , 5 ] [2], cultivation [6 , 7 ] , code switching [8 , 9 , 10 , 11 ] , and pieceable fault tolerance [12 ] . Recent constructions have strengthened the prospects for preparing magic states at high rates, including constant-overhead distillation protocols based on codes with nonvanishing encoding rate [11 , 13 , 14 , 15 , 16 , 17 , 18 , 19 , 20 , 21 , 22 , 23 ] . Such approaches reduce the overhead per output by processing many magic states within a growing code block, making their performance at large numbers of logical qubits particularly important to assess.
The need to evaluate these protocols has motivated recent simulation algorithms and software libraries tailored to non-Clifford quantum error correction [24 , 25 , 26 , 27 , 28 ] . These methods substantially extend the range of accessible circuits, but generally retain potentially exponential runtime dependencies. In particular, Surti, Daguerre, and Kim [28 ] establish polynomial scaling in the number of physical qubits for broad families of magic state preparation protocols when the number of logical qubits is fixed. Their complexity also depends on a stabilizer or Pauli decomposition of the target logical state, whose size can grow exponentially with k k k . Consequently, efficient simulation at fixed k k k does not guarantee efficient simulation of high-rate protocols, where the number of logical outputs grows with the block size.
This motivates simulation methods that scale polynomially in both the physical and logical system sizes, even as the number of non-Clifford operations grows. In this work, we identify a broad class of circuits relevant to fault-tolerant magic state preparation that admit such simulation under stochastic Pauli noise.
Summary of results
We identify a class of non-Clifford quantum circuits that admit classical simulation in time polynomial in the number of qubits and the circuit size. The supported operations are:
Preparation of ∣ 0 ⟩ \lvert0\rangle ∣ 0 ⟩ and ∣ + ⟩ \lvert+\rangle ∣ + ⟩ states;
Pauli, CNOT, and T T T gates;
Arbitrary Z Z Z -type Pauli measurements and compatible X X X -type Pauli measurements.
To describe the measurement restriction, we first identify the states generated by the unitary operations above. A third-order phase polynomial (3PP) state is a uniform-magnitude superposition over an affine subspace of computational-basis labels (that is, the solution set of a system of linear equations over F 2 \mathbb{F}_2 F 2 ), with phases specified by a third-order phase polynomial over Z 8 \mathbb{Z}_8 Z 8 . These are exactly the states obtainable from the specified preparations using Pauli, CNOT, and T T T gates. A projective Pauli measurement is compatible with a 3PP state if the post-measurement state is a 3PP state for every outcome having nonzero probability. We call circuits composed of the operations above, with each measurement compatible on every reachable branch, 3PP circuits .
The simulation maintains an exact, efficient representation of the conditional state throughout the circuit and samples intermediate measurement outcomes according to their probabilities. It also supports exact evaluation of computational-basis amplitudes in a fixed global-phase convention, exact Pauli expectation values, computational-basis sampling, and equality testing between represented states up to global phase. Stochastic Pauli noise is incorporated by sampling faults and evolving the corresponding conditional states, provided that measurements remain compatible along the noisy trajectories.
Alongside the phase-polynomial description, we develop an equivalent diagonal-Clifford-and-Pauli (DCP) stabilizer formalism , in which states are uniquely specified, up to global phase, by stabilizing operators generated by Pauli gates and diagonal Clifford gates. We prove that a state is a DCP stabilizer state if and only if it is a 3PP state. We establish structural properties of DCP stabilizer groups, construct efficient tableau representations, and develop efficient update rules for both the tableau and phase-polynomial descriptions.
We give necessary and sufficient conditions for an X X X -type Pauli measurement to be compatible, together with polynomial-time compatibility tests and conditional-state updates. These results extend efficient simulation beyond unitary CNOT-dihedral circuits—circuits made of T T T , CNOT, and Pauli gates [29 ] —to circuits with intermediate measurements and polynomial-time classical feed-forward.
Our main result for quantum error correction reduces compatibility under noise to a condition on the ideal circuit. Theorem 7 shows that, if every ideal X X X measurement is deterministic or anticommutes with a current Z Z Z -type stabilizer, then every measurement remains compatible under arbitrary inserted DCP faults, provided that outcome-dependent operations are restricted to DCP corrections. Thus, these ideal-circuit conditions certify exact polynomial-time simulation of the entire noisy protocol, without a separate analysis of noisy branches. This covers broad families of magic state preparation protocols, including distillation, cultivation, and code switching, as well as non-Clifford logical operations interleaved with syndrome extraction.
Beyond circuits that preserve the DCP state class, we introduce DCP rank : the minimum number of DCP stabilizer states needed to express a state as a linear combination. Such decompositions extend the framework to universal circuit simulation, with a cost that depends on the number of terms. Since every Pauli stabilizer state is a DCP state, DCP rank is no greater than stabilizer rank, although it can still grow exponentially.
Finally, we provide merlin [30 ] , an open-source implementation of our simulation methods. We compare its runtime and memory usage with existing non-Clifford simulation libraries on distillation, cultivation, and code switching circuits. The benchmarks demonstrate improved scaling as the number of logical outputs grows in Bravyi-Haah distillation [3 ] , and simulation of a recent code switching circuit based on a [3 , 5 ] [81] code [16 ] on which all other tested libraries exhaust memory or fail. They also illustrate the complementary strengths of existing methods, which achieve lower per-shot runtimes on the single-output distillation and cultivation examples.
Non-Clifford simulation algorithms
Classical simulation beyond Clifford circuits includes stabilizer decompositions [31 , 32 ] , quasiprobability and Pauli-propagation methods [33 , 34 ] , and hybrid stabilizer–tensor-network representations [35 , 36 ] . Recent work has adapted and optimized these approaches for quantum error correction. Tsim [24 ] combines stabilizer decompositions with ZX-calculus simplification and parametric compilation [37 , 38 ] , while cultivation-specific decompositions tions demonstrate that circuit structure can substantially reduce the number of required Clifford terms [39 , 40 ] . SOFT [41 ] , Clifft [25 ] , and SymFT [27 ] combine stabilizer or Clifford-frame descriptions with explicit coefficients for non-stabilizer degrees of freedom. Other approaches include sparse Pauli-frame representations with truncation [42 ] and polynomial-memory symbolic simulation through auxiliary qubits, as implemented in SyQMA [26 ] .
More specifically exploiting magic-state preparation, Surti, Daguerre, and Kim [28 ] propagate circuit-level Pauli faults into Clifford errors, with complexity depending on a decomposition of the target magic state. Magdalena de la Fuente et al. [43 ] develop a complementary space-time approach for efficiently sampling syndrome statistics in a class of non-Clifford CSS-type circuits. Our approach establishes polynomial-time simulation for circuits preserving the DCP state class, including compatible intermediate measurements, without requiring a small T T T count or a small number of logical magic states.
Simulating CNOT+T T T circuits
The unitary part of 3PP circuits consists of CNOT, T T T , and Pauli gates acting on qubits initialized in ∣ 0 ⟩ \lvert0\rangle ∣ 0 ⟩ or ∣ + ⟩ \lvert+\rangle ∣ + ⟩ . Circuits with this gate set have been studied in several contexts in the quantum information literature.
This gate set is closely related to the Z Z Z -network formulation of Instantaneous Quantum Polynomial-time (IQP) circuits [44 Section 5] . With ∣ + ⟩ \lvert+\rangle ∣ + ⟩ inputs and X X X -basis measurements, Z Z Z -networks generated by CNOT, X X X , and e i θ Z \mathrm{e}^{i\theta Z} e i θ Z are equivalent to IQP sampling up to efficient classical post-processing. Restricting the rotation angles to integer multiples of π / 8 \pi/8 π /8 gives our gate set, up to global phase. For this choice of angles, Shepherd subsequently showed that marginal distributions on logarithmically many output bits can be computed efficiently [45 Theorem 4] .
The unitary group generated by CNOT, T T T , and Pauli gates was subsequently named the CNOT-dihedral group and studied in the contexts of randomized benchmarking and circuit synthesis [29 , 46 , 47 ] . Efficient polynomial representations and composition algorithms were established in [29 ] , while [46 ] developed a finite presentation using phase polynomials.
Here, we characterize when X X X measurements preserve the class of 3PP states and derive efficient conditional-state update rules, enabling simulation of circuits with intermediate measurements satisfying these conditions.
Our DCP stabilizer formalism can be seen as a special case of the monomial stabilizer formalism introduced by Van den Nest [48 ] , whose stabilizers are products of diagonal unitaries and permutation matrices. DCP operators have this form because Pauli X X X operators are permutation matrices. In this framework, each stabilizer state is an equal-magnitude superposition of computational-basis states, connected by the stabilizers’ permutation actions. For DCP states, these actions are binary translations, so the support is an affine subspace. Our phase-polynomial representation satisfies the monomial framework’s sufficient conditions for efficient computational-basis sampling and approximate local expectation values. We additionally provide exact Pauli expectation values and efficient gate and compatible-measurement updates.
More directly, the XS formalism [49 ] uses tensor products of X X X and S S S operators with eighth-root global phases. XS states already admit affine-support, third-order phase-polynomial descriptions, but with additional constraints linking the polynomials to the support. By allowing CZ factors in stabilizers, DCP removes these constraints and captures all third-order phase-polynomial states.
The XP formalism [50 ] further generalizes XS to arbitrary phase precision. Its measurement analysis [50 Section 7 and Appendix F] provides outcome probabilities for XP measurements and updates for diagonal Pauli measurements. For Pauli X X X measurements, its relative-phase calculation corresponds to the discrete derivative of the phase polynomial in our formulation. However, it does not classify when non-diagonal measurements preserve the XP state class. We provide such a classification for DCP states, together with polynomial-time compatibility tests and post-measurement updates.
Note added. While completing this manuscript, we became aware of two independent related works on efficient simulation of noisy non-Clifford quantum error correction. Takada, Bartlett, and Williamson [51 ] develop a Clifford-stabilizer method closely related to our tableau approach. Here, we also describe the states using phase polynomials, establish the equivalence of the two representations, and classify the measurements preserving this state class. Magdalena de la Fuente and Scruby [52 ] instead use a spacetime framework to sample measurement outcomes and bound logical failure rates without explicitly tracking the logical state, whereas our method maintains the conditional state throughout the circuit. Additionally, we provide an open-source implementation and extend our framework to universal simulation through DCP state decompositions (§ 3.5 ). Exploring the precise relationships and practical tradeoffs between these approaches is an interesting direction for future work.
Reading guide
We develop the simulation framework through two complementary descriptions of the same states and circuits. We begin with third-order phase-polynomial states and compatible circuits in Section II, using this representation to construct a simulator in Section III. We then recast these states in the DCP stabilizer formalism in § 2 , leading to an alternative, tableau-based simulator in § 3 . With both descriptions in place, Section VI establishes their applicability to noisy quantum error-correction circuits, and Section VII benchmarks our implementation, merlin, against existing simulators. Finally, Section VIII extends the approach beyond the efficiently simulable class through DCP decompositions, before we discuss further directions in Section IX. Technical proofs and algorithmic details are collected in the appendices.
Readers primarily interested in understanding the simulator can focus on Sections II and III and defer the DCP formalism on a first reading. The stabilizer picture in Sections IV and V provides further structural insights and an alternative way to understand the same states and circuits, as well as an alternative implementation of the simulator.
Phase-polynomial states and circuits
Our simulation framework rests on a simple description of states prepared by Pauli, CNOT, and T T T gates: a uniform superposition over an affine space, with phases specified by a third-order polynomial. We first introduce the CNOT-dihedral group and its phase-polynomial description, then define the corresponding class of third-order phase-polynomial (3PP) states. Finally, we introduce compatible measurements, which preserve this state class, and use them to specify the circuits considered throughout the paper.
The CNOT-dihedral group and phase polynomials
We consider circuits generated by Pauli, CNOT, and T T T gates, whose unitary operations form the third-order CNOT-dihedral group [29 ] .
Definition 1 (Third-order CNOT-dihedral group). The third-order CNOT-dihedral group on n n n qubits is
G 3 = ⟨ X j , CNOT i j , T j : i ≠ j ⟩ / ⟨ ω 8 I ⟩ , (1) G_3 = \langle X_j, \operatorname{CNOT}_{ij}, T_j : i \ne j \rangle/ \langle\omega_8 I \rangle, \tag*{(1)} G 3 = ⟨ X j , CNOT ij , T j : i = j ⟩ / ⟨ ω 8 I ⟩ , (1) where ω 8 = e i π / 4 \omega_8 = e^{i\pi/4} ω 8 = e iπ /4 and T = diag ( 1 , ω 8 ) T = \operatorname{diag}(1,\omega_8) T = diag ( 1 , ω 8 ) . The quotient identifies operators that differ by a power of the global phase ω 8 \omega_8 ω 8 .
Throughout this work, we refer to G 3 G_3 G 3 simply as the CNOT-dihedral group . The name comes from the fact that X X X and T T T generate a dihedral group up to global phase, to which CNOT gates are added. Since Z = T 4 Z = T^4 Z = T 4 and Y = i X Z Y = iXZ Y = i X Z , this group contains all Pauli operators up to global phase.
CNOT-dihedral operators admit an efficient description through their action on computational-basis states. The X X X and CNOT gates implement invertible affine transformations of the bit strings, while T T T gates contribute phases
that are powers of ω 8 \omega_8 ω 8 . Consequently, every U ∈ G 3 U \in G_3 U ∈ G 3 has a unitary representative satisfying
U ∣ x ⟩ = ω 8 p ( x ) ∣ A x ⊕ b ⟩ , x ∈ F 2 n , (2) U|x\rangle= \omega_8^{p(x)} |Ax \oplus b\rangle,\qquad x \in\mathbb{F}_2^n, \tag*{(2)} U ∣ x ⟩ = ω 8 p ( x ) ∣ A x ⊕ b ⟩ , x ∈ F 2 n , (2)
where A ∈ GL ( n , F 2 ) A \in\operatorname{GL}(n,\mathbb{F}_2) A ∈ GL ( n , F 2 ) , b ∈ F 2 n b \in\mathbb{F}_2^n b ∈ F 2 n , and p : F 2 n → Z 8 p : \mathbb{F}_2^n \to\mathbb{Z}_8 p : F 2 n → Z 8 . The phase functions p p p arising in this way are precisely the third-order phase polynomials defined below [4 , 46 , 53 , 54 ] .
Definition 2 (Third-order phase polynomial). A function p : F 2 n → Z 8 p : \mathbb{F}_2^n \to\mathbb{Z}_8 p : F 2 n → Z 8 is a third-order phase polynomial if it can be written as
p ( x ) = d + ∑ i = 1 n a i x i + 2 ∑ 1 ≤ i < j ≤ n b i j x i x j + 4 ∑ 1 ≤ i < j < k ≤ n c i j k x i x j x k , (3) p(x) = d + \sum_{i=1}^{n} a_i x_i + 2\sum_{1 \le i<j \le n} b_{ij}x_i x_j
+ 4\sum_{1 \le i<j<k \le n} c_{ijk}x_i x_j x_k, \tag*{(3)} p ( x ) = d + i = 1 ∑ n a i x i + 2 1 ≤ i < j ≤ n ∑ b ij x i x j + 4 1 ≤ i < j < k ≤ n ∑ c ij k x i x j x k , (3) with d , a i ∈ Z 8 d,a_i \in\mathbb{Z}_8 d , a i ∈ Z 8 , b i j ∈ Z 4 b_{ij} \in\mathbb{Z}_4 b ij ∈ Z 4 , and c i j k ∈ Z 2 c_{ijk} \in\mathbb{Z}_2 c ij k ∈ Z 2 , and where arithmetic is modulo 8 8 8 .
This expression is sometimes called a weighted polynomial [4 , 55 ] , while the term “phase polynomial” is often reserved for expressions of the form
p ( x ) = a 0 + ∑ u ≠ 0 λ u ⟨ u , x ⟩ ( m o d 8 ) , (4) p(x) = a_0 + \sum_{u \ne0} \lambda_u \langle u,x\rangle\pmod8, \tag*{(4)} p ( x ) = a 0 + u = 0 ∑ λ u ⟨ u , x ⟩ ( mod 8 ) , (4)
where the inner product is taken modulo 2 2 2 , and the rest is taken modulo 8 8 8 . We show in Theorem A.1 that these two forms are equivalent, and we therefore use the terms interchangeably.
Within this class, diagonal Clifford operators correspond to a more restricted form.
Definition 3 (Clifford phase polynomial). A function d : F 2 n → Z 8 d : \mathbb{F}_2^n \to\mathbb{Z}_8 d : F 2 n → Z 8 is a Clifford phase polynomial if it has the form
d ( x ) = d 0 + 2 ∑ i α i x i + 4 ∑ i < j β i j x i x j ( m o d 8 ) , (5) d(x) = d_0 + 2\sum_i \alpha_i x_i + 4\sum_{i<j} \beta_{ij}x_i x_j \pmod8, \tag*{(5)} d ( x ) = d 0 + 2 i ∑ α i x i + 4 i < j ∑ β ij x i x j ( mod 8 ) , (5) where d 0 ∈ Z 8 d_0 \in\mathbb{Z}_8 d 0 ∈ Z 8 , α i ∈ Z 4 \alpha_i \in\mathbb{Z}_4 α i ∈ Z 4 , and β i j ∈ F 2 \beta_{ij} \in\mathbb{F}_2 β ij ∈ F 2 .
These are precisely the phase functions of diagonal Clifford operators, up to global phase. Theorem A.3 proves this characterization and gives the equivalent parity-sum form.
Third-order phase-polynomial states
The efficient representation of CNOT-dihedral operators extends to the states they prepare. Indeed, for U ∈ G 3 U \in G_3 U ∈ G 3 on n = m + ℓ n = m + \ell n = m + ℓ qubits,
U ∣ + ⟩ ⊗ m ∣ 0 ⟩ ⊗ ℓ = 1 2 m ∑ x ∈ F 2 m ω 8 p ( ( x , 0 ) ) ∣ A ( x , 0 ) ⊕ b ⟩ (6) U|+\rangle^{\otimes m}|0\rangle^{\otimes\ell}
= \frac{1}{\sqrt{2^m}}\sum_{x\in\mathbb{F}_2^m}\omega_8^{p((x,0))}|A(x,0)\oplus b\rangle \tag*{(6)} U ∣ + ⟩ ⊗ m ∣0 ⟩ ⊗ ℓ = 2 m 1 x ∈ F 2 m ∑ ω 8 p (( x , 0 )) ∣ A ( x , 0 ) ⊕ b ⟩ (6)
where ( x , 0 ) (x,0) ( x , 0 ) is the concatenation of x ∈ F 2 m x \in\mathbb{F}_2^m x ∈ F 2 m and 0 ∈ F 2 ℓ 0 \in\mathbb{F}_2^\ell 0 ∈ F 2 ℓ . Writing p ~ ( x ) : = p ( ( x , 0 ) ) \widetilde{p}(x):=p((x,0)) p ( x ) := p (( x , 0 )) and A ~ \widetilde{A} A for the first m m m columns of A A A , we can rewrite the above equation as
U ∣ + ⟩ ⊗ m ∣ 0 ⟩ ⊗ ℓ = 1 2 m ∑ x ∈ F 2 m ω 8 p ~ ( x ) ∣ A ~ x ⊕ b ⟩ . (7) U|+\rangle^{\otimes m}|0\rangle^{\otimes\ell}=\frac{1}{\sqrt{2^m}}\sum_{x\in\mathbb{F}_2^m}\omega_8^{\widetilde{p}(x)}|\widetilde{A}x\oplus b\rangle. \tag*{(7)} U ∣ + ⟩ ⊗ m ∣0 ⟩ ⊗ ℓ = 2 m 1 x ∈ F 2 m ∑ ω 8 p ( x ) ∣ A x ⊕ b ⟩ . (7)
Since A ~ \widetilde{A} A has full column rank, choose a left inverse L L L satisfying L A ~ = I m L\widetilde{A}=I_m L A = I m and define q ( y ) : = p ~ ( L ( y ⊕ b ) ) q(y):=\widetilde{p}(L(y\oplus b)) q ( y ) := p ( L ( y ⊕ b )) for every y ∈ F 2 n y\in\mathbb{F}_2^n y ∈ F 2 n . Then q ( A ~ x ⊕ b ) = p ~ ( x ) q(\widetilde{A}x\oplus b)=\widetilde{p}(x) q ( A x ⊕ b ) = p ( x ) , and q q q is a third-order phase polynomial by Corollary A.1. Changing variables therefore gives
U ∣ + ⟩ ⊗ m ∣ 0 ⟩ ⊗ ℓ = 1 ∣ S ∣ ∑ x ∈ S ω 8 q ( x ) ∣ x ⟩ , (8) U|+\rangle^{\otimes m}|0\rangle^{\otimes\ell}=\frac{1}{\sqrt{|S|}}\sum_{x\in S}\omega_8^{q(x)}|x\rangle, \tag*{(8)} U ∣ + ⟩ ⊗ m ∣0 ⟩ ⊗ ℓ = ∣ S ∣ 1 x ∈ S ∑ ω 8 q ( x ) ∣ x ⟩ , (8)
where S = b ⊕ Im ( A ~ ) S=b\oplus\operatorname{Im}(\widetilde{A}) S = b ⊕ Im ( A ) . This motivates the following state class.
Definition 4 (3PP states). A third-order phase-polynomial state (3PP state) is a state that is, up to global phase, of the form
∣ ψ ⟩ = 1 ∣ S ∣ ∑ x ∈ S ω 8 q ( x ) ∣ x ⟩ , (9) |\psi\rangle=\frac{1}{\sqrt{|S|}}\sum_{x\in S}\omega_8^{q(x)}|x\rangle, \tag*{(9)} ∣ ψ ⟩ = ∣ S ∣ 1 x ∈ S ∑ ω 8 q ( x ) ∣ x ⟩ , (9) where S ⊆ F 2 n S\subseteq\mathbb{F}_2^n S ⊆ F 2 n is a nonempty affine subspace and q : F 2 n → Z 8 q:\mathbb{F}_2^n\to\mathbb{Z}_8 q : F 2 n → Z 8 is a third-order phase polynomial.
We note that the polynomial associated to a 3PP state is not unique, since its value only matters on the affine support S S S . We present later in Theorem 2 an algorithm to efficiently determine whether two 3PP states, represented by their phase polynomial and support, are equal up to a global phase.
The preparation argument above also has a converse.
Proposition 1 (Preparation of 3PP states). A state is a 3PP state if and only if, up to global phase, it can be prepared from ∣ 0 ⟩ |0\rangle ∣0 ⟩ and ∣ + ⟩ |+\rangle ∣ + ⟩ states by a circuit of Pauli, CNOT, and T T T gates.
Proof. The calculation above proves that every state prepared by such a circuit is a 3PP state. Conversely, let ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ have the form in Definition 4. A uniform superposition over the affine space S S S can be prepared from ∣ 0 ⟩ |0\rangle ∣0 ⟩ and ∣ + ⟩ |+\rangle ∣ + ⟩ states using X X X and CNOT gates: choose an affine parametrization S = b ⊕ Im ( B ) S=b\oplus\operatorname{Im}(B) S = b ⊕ Im ( B ) with B B B of full column rank, extend the columns of B B B to an invertible binary matrix, and implement the resulting affine transformation. Writing q q q in the weighted form above and applying
∏ i T i a i ∏ i < j C S i j b i j ∏ i < j < k C C Z i j k c i j k \prod_i T_i^{a_i}\prod_{i<j} \mathrm{CS}_{ij}^{b_{ij}}\prod_{i<j<k}\mathrm{CCZ}_{ijk}^{c_{ijk}} i ∏ T i a i i < j ∏ CS ij b ij i < j < k ∏ CCZ ij k c ij k
then imprints the phase ω 8 q ( x ) \omega_8^{q(x)} ω 8 q ( x ) up to the global phase ω 8 d \omega_8^d ω 8 d . Since CS and CCZ can themselves be synthesized from T T T and CNOT gates, this gives the required preparation. □ \square □
Keeping track of the affine space S S S and the O ( n 3 ) O(n^3) O ( n 3 ) coefficients of q q q is therefore enough to represent any 3PP state.
Compatible measurements and 3PP circuits
To extend the gate set to measurements, we require each measurement branch to remain within the 3PP state class.
Definition 5 (Compatible measurement). Given a 3PP state ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ , we say that a projective measurement of a Pauli operator is compatible with it if the post-measurement state is a 3PP state for every outcome with nonzero probability.
The need for introducing the notion of compatibility comes from the observation that not every X X X measurement is compatible, as shown in the following simple example.
Example 1. Consider the 3PP state ∣ C C Z ⟩ = C C Z ∣ + ⟩ ⊗ 3 |\mathrm{CCZ}\rangle=\mathrm{CCZ}|+\rangle^{\otimes3} ∣ CCZ ⟩ = CCZ ∣ + ⟩ ⊗ 3 . For an outcome ε ∈ { + 1 , − 1 } \varepsilon\in\{+1,-1\} ε ∈ { + 1 , − 1 } of measuring the first qubit in the X X X basis, the unnormalized post-measurement vector is
∣ ψ ~ ε ⟩ = 1 2 ( 1 + ε X 1 ) ∣ C C Z ⟩ . (10) |\widetilde{\psi}_{\varepsilon}\rangle=\frac{1}{2}(1+\varepsilon X_1)|\mathrm{CCZ}\rangle. \tag*{(10)} ∣ ψ ε ⟩ = 2 1 ( 1 + ε X 1 ) ∣ CCZ ⟩ . (10) The outcome ε = − 1 \varepsilon=-1 ε = − 1 leaves the 3PP state ∣ ψ − ⟩ ∝ ∣ − ⟩ ⊗ ∣ 11 ⟩ |\psi_-\rangle\propto|-\rangle\otimes|11\rangle ∣ ψ − ⟩ ∝ ∣ − ⟩ ⊗ ∣11 ⟩ . The outcome ε = + 1 \varepsilon=+1 ε = + 1 , which also has nonzero probability, leaves
∣ ψ + ⟩ ∝ ∣ + ⟩ ⊗ ( ∣ 00 ⟩ + ∣ 01 ⟩ + ∣ 10 ⟩ ) . (11) |\psi_+\rangle\propto|+\rangle\otimes(|00\rangle+|01\rangle+|10\rangle). \tag*{(11)} ∣ ψ + ⟩ ∝ ∣ + ⟩ ⊗ ( ∣00 ⟩ + ∣01 ⟩ + ∣10 ⟩) . (11) Its computational-basis support has six elements, whereas every affine subspace over F 2 \mathbb{F}_2 F 2 has cardinality a power of two. Thus its support is not affine, so ∣ ψ + ⟩ |\psi_+\rangle ∣ ψ + ⟩ is not a 3PP state and the measurement is incompatible.
The fact that our framework cannot simulate arbitrary X X X measurements is not surprising. Indeed, preparing a ∣ + ⟩ |+\rangle ∣ + ⟩ ancilla state, applying CZ, measuring the input qubit in the X X X basis, and applying an outcome-dependent X X X correction to the ancilla, implements a Hadamard gate (see Figure 1 ). Allowing arbitrary X X X measurements therefore gives universal quantum computation. Consequently, a polynomial-time classical sampler for these circuits would imply BQP ⊆ \subseteq ⊆ BPP.
By contrast, as we discuss in Section IIIB, a Z Z Z -type Pauli measurement automatically preserves the 3PP form: conditioning on a nonzero-probability outcome intersects the affine support with an affine hyperplane and leaves the phase polynomial unchanged.
Together, these closure properties specify the circuits considered in our simulation algorithms.
Figure 1. Hadamard gadget. A CZ gate with a ∣ + ⟩ |+\rangle ∣ + ⟩ ancilla, followed by an X X X measurement of the input qubit and an outcome-dependent X X X correction, leaves the ancilla in the state H ∣ ψ ⟩ H|\psi\rangle H ∣ ψ ⟩ .
Definition 6 (3PP circuit). A 3PP circuit is composed of ∣ 0 ⟩ \lvert0\rangle ∣ 0 ⟩ and ∣ + ⟩ \lvert+\rangle ∣ + ⟩ preparations, Pauli, CNOT, and T T T gates, arbitrary Z Z Z -type Pauli measurements, and X X X -type Pauli measurements that are compatible on every state reachable with nonzero probability. The operations may depend on earlier measurement outcomes through classical feedforward.
Thus every measurement branch of a 3PP circuit can be described using an affine support and a third-order phase polynomial.
Simulation in the phase-polynomial representation
We now describe how to update the phase-polynomial representation under the operations in a 3PP circuit. We represent the current state as
∣ ψ ⟩ = 1 ∣ S ∣ ∑ x ∈ S ω 8 q ( x ) ∣ x ⟩ , S = x 0 ⊕ V , (12) \lvert\psi\rangle= \frac{1}{\sqrt{\lvert S\rvert}}\sum_{x\in S}\omega_8^{q(x)}\lvert x\rangle,\qquad S=x_0\oplus V, \tag*{(12)} ∣ ψ ⟩ = ∣ S ∣ 1 x ∈ S ∑ ω 8 q ( x ) ∣ x ⟩ , S = x 0 ⊕ V , (12)
where S ⊆ F 2 n S\subseteq\mathbb{F}_2^n S ⊆ F 2 n is affine and q q q is a third-order phase polynomial. For the initial state ∣ 0 ⟩ ⊗ a ∣ + ⟩ ⊗ b \lvert0\rangle^{\otimes a}\lvert+\rangle^{\otimes b} ∣ 0 ⟩ ⊗ a ∣ + ⟩ ⊗ b , one takes S = { 0 } a × F 2 b S=\{0\}^a\times\mathbb{F}_2^b S = { 0 } a × F 2 b and q = 0 q=0 q = 0 . Thus, the representation can be initialized and all the updates below can be carried out in polynomial time by linear algebra over F 2 \mathbb{F}_2 F 2 and arithmetic on the coefficients of q q q .
Unitary operations
Every CNOT-dihedral unitary has an affine permutation and a third-order phase polynomial p p p such that
U ∣ x ⟩ = ω 8 p ( x ) ∣ ϕ ( x ) ⟩ , ϕ ( x ) = A x ⊕ b , (13) U\lvert x\rangle=\omega_8^{p(x)}\lvert\phi(x)\rangle,\qquad\phi(x)=Ax\oplus b, \tag*{(13)} U ∣ x ⟩ = ω 8 p ( x ) ∣ ϕ ( x )⟩ , ϕ ( x ) = A x ⊕ b , (13)
where A ∈ F 2 n × n A\in\mathbb{F}_2^{n\times n} A ∈ F 2 n × n is invertible. Applying U U U to Eq. (12) gives the updated data
S ′ = ϕ ( S ) , q ′ ( y ) = q ( ϕ − 1 ( y ) ) + p ( ϕ − 1 ( y ) ) ( m o d 8 ) . (14) S'=\phi(S),\qquad q'(y)=q\left(\phi^{-1}(y)\right)+p\left(\phi^{-1}(y)\right)\pmod8. \tag*{(14)} S ′ = ϕ ( S ) , q ′ ( y ) = q ( ϕ − 1 ( y ) ) + p ( ϕ − 1 ( y ) ) ( mod 8 ) . (14)
The set S ′ S' S ′ is affine, and q ′ q' q ′ is again a third-order phase polynomial by Corollary A.1. In particular, the elementary updates are as follows, where τ a → b ( x ) : = x ⊕ x a e b \tau_{a\to b}(x):=x\oplus x_a e_b τ a → b ( x ) := x ⊕ x a e b :
T a ± 1 : S ′ = S , q ′ ( y ) = q ( y ) ± y a , (15) T_a^{\pm1}:\quad S'=S,\qquad q'(y)=q(y)\pm y_a, \tag*{(15)} T a ± 1 : S ′ = S , q ′ ( y ) = q ( y ) ± y a , (15)
Z a : S ′ = S , q ′ ( y ) = q ( y ) + 4 y a , (16) Z_a:\quad S'=S,\qquad q'(y)=q(y)+4y_a, \tag*{(16)} Z a : S ′ = S , q ′ ( y ) = q ( y ) + 4 y a , (16)
X a : S ′ = S ⊕ e a , q ′ ( y ) = q ( y ⊕ e a ) , (17) X_a:\quad S'=S\oplus e_a,\qquad q'(y)=q(y\oplus e_a), \tag*{(17)} X a : S ′ = S ⊕ e a , q ′ ( y ) = q ( y ⊕ e a ) , (17)
CNOT a → b : S ′ = τ a → b ( S ) , q ′ ( y ) = q ( τ a → b ( y ) ) . (18) \operatorname{CNOT}_{a\to b}:\quad S'=\tau_{a\to b}(S),\qquad q'(y)=q\left(\tau_{a\to b}(y)\right). \tag*{(18)} CNOT a → b : S ′ = τ a → b ( S ) , q ′ ( y ) = q ( τ a → b ( y ) ) . (18)
Updates for arbitrary Pauli operators follow by composing the X a X_a X a and Z a Z_a Z a rules. Global phases may be discarded.
Z-measurements
Let us consider a measurement of a Z Z Z -type Pauli operator Z ( v ) = ∏ a = 1 n Z a v a Z(v)=\prod_{a=1}^n Z_a^{v_a} Z ( v ) = ∏ a = 1 n Z a v a , and encode its measurement outcome as ( − 1 ) μ (-1)^\mu ( − 1 ) μ , with μ ∈ F 2 \mu\in\mathbb{F}_2 μ ∈ F 2 . The projection onto that outcome can be written
∣ ψ μ ′ ⟩ = 1 2 ( 1 + ( − 1 ) μ Z ( v ) ) ∣ ψ ⟩ (19) \lvert\psi'_\mu\rangle=\frac{1}{2}\left(1+(-1)^\mu Z(v)\right)\lvert\psi\rangle \tag*{(19)} ∣ ψ μ ′ ⟩ = 2 1 ( 1 + ( − 1 ) μ Z ( v ) ) ∣ ψ ⟩ (19)
= 1 2 ∣ S ∣ ∑ x ∈ S ( 1 + ( − 1 ) μ + ⟨ v , x ⟩ ) ∣ x ⟩ (20) =\frac{1}{2\sqrt{\lvert S\rvert}}\sum_{x\in S}\left(1+(-1)^{\mu+\langle v,x\rangle}\right)\lvert x\rangle \tag*{(20)} = 2 ∣ S ∣ 1 x ∈ S ∑ ( 1 + ( − 1 ) μ + ⟨ v , x ⟩ ) ∣ x ⟩ (20)
Equation not extracted
(21)
where we used Z ( v ) ∣ x ⟩ = ( − 1 ) ⟨ v , x ⟩ ∣ x ⟩ Z(v)\lvert x\rangle=(-1)^{\langle v,x\rangle}\lvert x\rangle Z ( v ) ∣ x ⟩ = ( − 1 ) ⟨ v , x ⟩ ∣ x ⟩ . Therefore, the phase is only nonzero when ⟨ v , x ⟩ = μ \langle v,x\rangle=\mu ⟨ v , x ⟩ = μ , and the affine support is restricted to that hyperplane:
S μ ′ = S ∩ { x ∈ F 2 n : ⟨ v , x ⟩ = μ } , q μ ′ = q ↾ S μ ′ . (22) S'_\mu=S\cap\{x\in\mathbb{F}_2^n:\langle v,x\rangle=\mu\},\qquad q'_\mu=q\mathord{\upharpoonright}_{S'_\mu}. \tag*{(22)} S μ ′ = S ∩ { x ∈ F 2 n : ⟨ v , x ⟩ = μ } , q μ ′ = q ↾ S μ ′ . (22)
The probability of the outcome is
Pr ( μ ) = ∣ S μ ′ ∣ ∣ S ∣ . (23) \operatorname{Pr}(\mu)=\frac{\lvert S'_\mu\rvert}{\lvert S\rvert}. \tag*{(23)} Pr ( μ ) = ∣ S ∣ ∣ S μ ′ ∣ . (23)
The linear function x ↦ ⟨ v , x ⟩ x\mapsto\langle v,x\rangle x ↦ ⟨ v , x ⟩ is either constant on S S S or balanced on S S S . Consequently, the two outcome probabilities are either 0 and 1, or both 1 / 2 1/2 1/2 . Gaussian elimination determines which case applies and produces an affine description of S μ ′ S'_\mu S μ ′ in polynomial time. A single-qubit Z Z Z -measurement is the special case v = e a v=e_a v = e a .
X-measurements
Recall from Section II C that an X X X -type Pauli measurement is compatible with a 3PP state when every outcome of nonzero probability leaves a 3PP state. We first introduce the discrete derivative and classify single-qubit X X X measurements with their phase-polynomial updates, then extend the results to arbitrary X X X -type Pauli measurements.
Definition 7 (Discrete derivative). Given a function f : V → Z 8 f:V\to\mathbb{Z}_8 f : V → Z 8 , we define its discrete derivative Δ v f \Delta_v f Δ v f w.r.t. v ∈ V v\in V v ∈ V by Δ v f ( x ) : = f ( x ⊕ v ) − f ( x ) ( m o d 8 ) \Delta_v f(x):=f(x\oplus v)-f(x)\pmod8 Δ v f ( x ) := f ( x ⊕ v ) − f ( x ) ( mod 8 ) .
Theorem 1. Consider a 3PP state
∣ ψ ⟩ = 1 ∣ S ∣ ∑ x ∈ S ω 8 q ( x ) ∣ x ⟩ \lvert\psi\rangle=\frac{1}{\sqrt{\lvert S\rvert}}\sum_{x\in S}\omega_8^{q(x)}\lvert x\rangle ∣ ψ ⟩ = ∣ S ∣ 1 x ∈ S ∑ ω 8 q ( x ) ∣ x ⟩ over an affine subspace S = x 0 ⊕ V S=x_0\oplus V S = x 0 ⊕ V with phase polynomial q q q . An X X X measurement on qubit a a a is compatible with ∣ ψ ⟩ \lvert\psi\rangle ∣ ψ ⟩ iff one of the following cases apply. In each case, we get a post-measurement affine subspace S μ ′ ⊆ F 2 n S'_\mu\subseteq\mathbb{F}_2^n S μ ′ ⊆ F 2 n and phase polynomial q μ ′ : S μ ′ → Z 8 q'_\mu:S'_\mu\to\mathbb{Z}_8 q μ ′ : S μ ′ → Z 8 depending on the measurement outcome μ ∈ { 0 , 1 } \mu\in\{0,1\} μ ∈ { 0 , 1 } , which occurs with some probability Pr ( μ ) \operatorname{Pr}(\mu) Pr ( μ ) .
e a ∉ V e_a\notin V e a ∈ / V . In that case, Pr ( μ ) = 1 2 \operatorname{Pr}(\mu)=\frac{1}{2} Pr ( μ ) = 2 1 and the post-measurement state is defined by S μ ′ = S ∪ ( S ⊕ e a ) S'_\mu=S\cup(S\oplus e_a) S μ ′ = S ∪ ( S ⊕ e a ) and the unique phase polynomial q μ ′ q'_\mu q μ ′ with q μ ′ ( x ) = q ( x ) q'_\mu(x)=q(x) q μ ′ ( x ) = q ( x ) and q μ ′ ( x ⊕ e a ) = q ( x ) + 4 μ q'_\mu(x\oplus e_a)=q(x)+4\mu q μ ′ ( x ⊕ e a ) = q ( x ) + 4 μ for all x ∈ S x\in S x ∈ S .
e a ∈ V e_a \in V e a ∈ V and one of the following apply:
(a) Δ e a q ( x ) = 4 f ( x ) ( m o d 8 ) \Delta_{e_a}q(x)=4f(x)\pmod8 Δ e a q ( x ) = 4 f ( x ) ( mod 8 ) for some affine function f : S → F 2 f:S\to\mathbb{F}_2 f : S → F 2 . In that case
Pr ( μ ) = { 0 if f ( x ) ≠ μ for all x ∈ S , 1 if f ( x ) = μ for all x ∈ S , 1 2 otherwise . \operatorname{Pr}(\mu)=
\begin{cases}
0 & \text{if } f(x)\ne\mu\text{ for all }x\in S,\\
1 & \text{if } f(x)=\mu\text{ for all }x\in S,\\
\frac{1}{2} & \text{otherwise}.
\end{cases} Pr ( μ ) = ⎩ ⎨ ⎧ 0 1 2 1 if f ( x ) = μ for all x ∈ S , if f ( x ) = μ for all x ∈ S , otherwise .
and the post-measurement state is defined by S μ ′ = S ∩ { x ∣ f ( x ) = μ ( m o d 2 ) } S'_\mu=S\cap\{x\mid f(x)=\mu\pmod2\} S μ ′ = S ∩ { x ∣ f ( x ) = μ ( mod 2 )} and q ′ ( x ) = q ( x ) q'(x)=q(x) q ′ ( x ) = q ( x ) for all x ∈ S μ ′ x\in S'_\mu x ∈ S μ ′ .
(b) Δ e a q ( x ) = 2 + 4 g ( x ) ( m o d 8 ) \Delta_{e_a}q(x)=2+4g(x)\pmod8 Δ e a q ( x ) = 2 + 4 g ( x ) ( mod 8 ) for some function g : S → F 2 g:S\to\mathbb{F}_2 g : S → F 2 such that 2 g 2g 2 g is a third-order phase polynomial. In that case, Pr ( μ ) = 1 2 \operatorname{Pr}(\mu)=\frac{1}{2} Pr ( μ ) = 2 1 and the post-measurement state is defined by S μ ′ = S S'_\mu=S S μ ′ = S and q ′ ( x ) = q ( x ) − 2 ( − 1 ) μ g ( x ) q'(x)=q(x)-2(-1)^\mu g(x) q ′ ( x ) = q ( x ) − 2 ( − 1 ) μ g ( x ) .
(c) Δ e a q ( x ) = ( − 1 ) h ( x ) d ( m o d 8 ) \Delta_{e_a}q(x)=(-1)^{h(x)}d\pmod8 Δ e a q ( x ) = ( − 1 ) h ( x ) d ( mod 8 ) for some affine function h : S → F 2 h:S\to\mathbb{F}_2 h : S → F 2 and d ∈ { 1 , 3 , 5 , 7 } d\in\{1,3,5,7\} d ∈ { 1 , 3 , 5 , 7 } . In that case, Pr ( μ ) = 1 2 ( 1 + ( − 1 ) μ cos ( d π / 4 ) ) \operatorname{Pr}(\mu)=\frac{1}{2}(1+(-1)^\mu\cos(d\pi/4)) Pr ( μ ) = 2 1 ( 1 + ( − 1 ) μ cos ( d π /4 )) and the post-measurement state is defined by S μ ′ = S S'_\mu=S S μ ′ = S and q ′ ( x ) = q ( x ) + ( 4 μ − d ) h ( x ) q'(x)=q(x)+(4\mu-d)h(x) q ′ ( x ) = q ( x ) + ( 4 μ − d ) h ( x ) .
The proof can be found in Appendix B.
For a general X-type Pauli operator X ( m ) = ∏ j X j m j X(m)=\prod_jX_j^{m_j} X ( m ) = ∏ j X j m j with m ∈ F 2 n ∖ { 0 } m\in\mathbb{F}_2^n\setminus\{0\} m ∈ F 2 n ∖ { 0 } , choose a a a with m a = 1 m_a=1 m a = 1 and set C m = ∏ j ≠ a : m j = 1 CNOT a → j C_m=\prod_{j\ne a:m_j=1}\operatorname{CNOT}_{a\to j} C m = ∏ j = a : m j = 1 CNOT a → j . Then C m X ( m ) C m † = X a C_mX(m)C_m^\dagger=X_a C m X ( m ) C m † = X a , so
I + ( − 1 ) μ X ( m ) 2 = C m † I + ( − 1 ) μ X a 2 C m . (24) \frac{I+(-1)^\mu X(m)}{2}=C_m^\dagger\frac{I+(-1)^\mu X_a}{2}C_m. \tag*{(24)} 2 I + ( − 1 ) μ X ( m ) = C m † 2 I + ( − 1 ) μ X a C m . (24)
Since both C m C_m C m and C m † C_m^\dagger C m † preserve 3PP states, measuring X ( m ) X(m) X ( m ) on ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ has the same compatibility and outcome probabilities as measuring X a X_a X a on C m ∣ ψ ⟩ C_m|\psi\rangle C m ∣ ψ ⟩ . Applying C m † C_m^\dagger C m † to the conditional state gives the original measurement’s conditional state. In the original coordinates, the same cases and update formulas apply with e a e_a e a replaced by m m m and Δ e a q \Delta_{e_a}q Δ e a q replaced by Δ m q \Delta_mq Δ m q ; in particular, case (1) means m ∉ V m\notin V m ∈ / V . We use these case labels for arbitrary X-type Pauli measurements throughout the paper. For m = 0 m=0 m = 0 , the operator is the identity and the outcome is deterministically + 1 +1 + 1 .
Efficient simulation
Theorem 2 (Efficient simulation of 3PP circuits). An n n n -qubit 3PP state admits a representation
∣ ψ ⟩ = 2 − r / 2 ∑ y ∈ F 2 r ω 8 p ( y ) ∣ x 0 ⊕ B y ⟩ , (25) |\psi\rangle=2^{-r/2}\sum_{y\in\mathbb{F}_2^r}\omega_8^{p(y)}|x_0\oplus By\rangle, \tag*{(25)} ∣ ψ ⟩ = 2 − r /2 y ∈ F 2 r ∑ ω 8 p ( y ) ∣ x 0 ⊕ B y ⟩ , (25) where B ∈ F 2 n × r B\in\mathbb{F}_2^{n\times r} B ∈ F 2 n × r has full column rank and p : F 2 r → Z 8 p:\mathbb{F}_2^r\to\mathbb{Z}_8 p : F 2 r → Z 8 is a third-order phase polynomial. This representation requires O ( n 3 ) O(n^3) O ( n 3 ) bits and supports the following operations.
Circuit simulation. Let C C C be a 3PP circuit made of m m m operations acting on at most n n n qubits. There exists a classical algorithm that samples the measurement record according to its exact distribution and maintains the corresponding conditional state, up to global phase, in the form (3.14). Each operation takes O ( n 3 ) O(n^3) O ( n 3 ) expected time, giving a total expected runtime of
O ( m n 3 ) + T c l a s s i c a l , (26) O(mn^3)+T_{\mathrm{classical}}, \tag*{(26)} O ( m n 3 ) + T classical , (26) where T c l a s s i c a l T_{\mathrm{classical}} T classical is the total time required for classical feedforward. The maintained state representation uses O ( n 3 ) O(n^3) O ( n 3 ) bits, excluding storage for the measurement record and classical processing.
Queries on represented states. Given a state in the form (3.14), the following tasks can be performed:
(a) Compute ⟨ x ∣ ψ ⟩ \langle x|\psi\rangle ⟨ x ∣ ψ ⟩ exactly for any x ∈ F 2 n x\in\mathbb{F}_2^n x ∈ F 2 n in O ( n 3 ) O(n^3) O ( n 3 ) time.
(b) Sample x ∈ F 2 n x\in\mathbb{F}_2^n x ∈ F 2 n according to ∣ ⟨ x ∣ ψ ⟩ ∣ 2 |\langle x|\psi\rangle|^2 ∣ ⟨ x ∣ ψ ⟩ ∣ 2 in O ( n 2 ) O(n^2) O ( n 2 ) time.
(c) Compute ⟨ ψ ∣ P ∣ ψ ⟩ \langle\psi|P|\psi\rangle ⟨ ψ ∣ P ∣ ψ ⟩ exactly for any specified Pauli operator P P P in O ( n 3 ) O(n^3) O ( n 3 ) time.
(d) Given a second represented state on the same ordered qubits, decide whether the two states are equal up to global phase in O ( n 4 ) O(n^4) O ( n 4 ) time.
The proof can be found in Appendix C.
The Pauli-expectation claim does not require the corresponding measurement to be compatible; evaluating an expectation value does not require representing the post-measurement state. By linearity, it also gives efficient exact expectations for observables supplied as polynomial-size sums of Pauli operators.
Equality testing should be distinguished from evaluating an arbitrary overlap between two DCP states. Such an overlap generally involves a third-order phase sum, rather than the quadratic sum appearing in Eq. (C.17), and is not covered by the theorem.
For circuits with stochastic Pauli noise, the theorem applies to each sampled fault trajectory, provided that all measurements remain compatible along that trajectory. The represented state and its exact expectation values are conditional on the sampled faults and measurement outcomes.
Our simulation theorem recovers efficient simulation of Clifford circuits. Every Pauli stabilizer state is a 3PP state, and Pauli measurements preserve the stabilizer-state class. While CNOT and S = T 2 S=T^2 S = T 2 are already supported, a Hadamard gate can be implemented by the measurement-based gadget shown in Figure 1 .
For stabilizer inputs, every intermediate state remains a stabilizer state, so this measurement is compatible. Thus any Clifford circuit can be compiled into a 3PP circuit with constant overhead per gate.
Finally, we note that alternative sparse representations of the phase polynomial (for example in the form of Eq. (4) ), can yield better complexity for circuits with
few non-Clifford gates, which we have exploited in our implementation.
The DCP stabilizer formalism
We now develop an equivalent stabilizer description of 3PP states, generalizing the Pauli stabilizer formalism by allowing products of diagonal Clifford and Pauli operators as stabilizers. They provide a Heisenberg-picture representation suited to tracking non-Clifford circuits. We establish the structure and canonical representation of those stabilizer groups, then prove that the states they uniquely specify are exactly the 3PP states.
The stabilizers corresponding to 3PP states belong to the following operator class.
Definition 8 (DCP operator). A DCP operator is a unitary operator U U U on n n n qubits which can be expressed as a product of diagonal Clifford and Pauli operators. Explicitly, the group of DCP operators on n n n qubits is
D n = ⟨ ω 8 I , X i , S i , C Z i j ∣ 1 ≤ i , j ≤ n , i ≠ j ⟩ . (27) \mathcal{D}^{n}=\langle\omega_{8}I, X_i, S_i, \mathrm{CZ}_{ij}\mid1\leq i,j\leq n,\ i\ne j\rangle. \tag*{(27)} D n = ⟨ ω 8 I , X i , S i , CZ ij ∣ 1 ≤ i , j ≤ n , i = j ⟩ . (27)
DCP operators can be efficiently represented using the following normal form.
Proposition 2 (Normal form for DCP operators). Every DCP operator U U U on n n n qubits corresponds to a unique quadruple ( k , s , M , x ) (k,s,M,x) ( k , s , M , x ) where k ∈ Z 8 k\in\mathbb{Z}_8 k ∈ Z 8 , s ∈ Z 4 n s\in\mathbb{Z}_4^n s ∈ Z 4 n , x ∈ F 2 n x\in\mathbb{F}_2^n x ∈ F 2 n , and M M M is an n × n n\times n n × n symmetric matrix over F 2 \mathbb{F}_2 F 2 that is zero on the diagonal, such that
U = ω 8 k D ( s , M ) X ( x ) , (28) U=\omega_8^kD(s,M)X(x), \tag*{(28)} U = ω 8 k D ( s , M ) X ( x ) , (28) where D ( s , M ) D(s,M) D ( s , M ) is the diagonal Clifford operator defined by
D ( s , M ) = S s 1 ⊗ ⋯ ⊗ S s n ⋅ ∏ 1 ≤ i < j ≤ n C Z i j M i j , (29) D(s,M)=S^{s_1}\otimes\cdots\otimes S^{s_n}\cdot\prod_{1\leq i<j\leq n}\mathrm{CZ}_{ij}^{M_{ij}}, \tag*{(29)} D ( s , M ) = S s 1 ⊗ ⋯ ⊗ S s n ⋅ 1 ≤ i < j ≤ n ∏ CZ ij M ij , (29) and X ( x ) X(x) X ( x ) is the Pauli operator defined by
X ( x ) = X x 1 ⊗ ⋯ ⊗ X x n . (30) X(x)=X^{x_1}\otimes\cdots\otimes X^{x_n}. \tag*{(30)} X ( x ) = X x 1 ⊗ ⋯ ⊗ X x n . (30)
We prove this proposition in Appendix D, where we also give explicit formulas to compute certain operations on DCP operators (multiplication, inverse, conjugation and commutator) using the normal form.
Stabilizer groups and stabilizing closure
We now use DCP operators to specify states by their common fixed space. Write
Fix ( U ) = { v ∈ C 2 n ∣ U v = v } (31) \operatorname{Fix}(U)=\{v\in\mathbb{C}^{2^n}\mid Uv=v\} \tag*{(31)} Fix ( U ) = { v ∈ C 2 n ∣ U v = v } (31)
for the space fixed by a unitary operator U U U , and
Fix ( S ) = ⋂ U ∈ S Fix ( U ) (32) \operatorname{Fix}(S)=\bigcap_{U\in S}\operatorname{Fix}(U) \tag*{(32)} Fix ( S ) = U ∈ S ⋂ Fix ( U ) (32)
for the space fixed by a set of operators S S S .
Definition 9 (Maximal DCP stabilizer group and DCP state). Given a state ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ on n n n qubits, its maximal DCP stabilizer group , D ( ψ ) \mathcal{D}(\psi) D ( ψ ) , is the subgroup of D n \mathcal{D}^n D n defined by
D ( ψ ) = { g ∈ D n ∣ ∣ ψ ⟩ ∈ Fix ( g ) } (33) \mathcal{D}(\psi)=\{g\in\mathcal{D}^n\mid|\psi\rangle\in\operatorname{Fix}(g)\} \tag*{(33)} D ( ψ ) = { g ∈ D n ∣ ∣ ψ ⟩ ∈ Fix ( g )} (33)
We call a state ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ a DCP-stabilizer state or for short a DCP state if the space fixed by its DCP-stabilizer group is spanned by ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ itself, that is:
dim Fix ( D ( ψ ) ) = 1 \dim\operatorname{Fix}(\mathcal{D}(\psi))=1 dim Fix ( D ( ψ )) = 1
In other words, a state is a DCP state if it is determined up to global phase by the DCP operators that fix it.
Remark 1. This is analogous to the fact that a state is a (Pauli) stabilizer state if it is determined by its Pauli stabilizer group up to a global phase. Moreover, note that every stabilizer state is a DCP state, but the converse is not true: for example, the state ∣ T ⟩ = T ∣ + ⟩ |T\rangle=T|+\rangle ∣ T ⟩ = T ∣ + ⟩ is a DCP state but not a stabilizer state.
In contrast to the Pauli case, DCP stabilizer groups need not be abelian. For instance, the state ∣ 0 + ⟩ |0+\rangle ∣0 + ⟩ is stabilized by both X 2 X_2 X 2 and C Z 12 \mathrm{CZ}_{12} CZ 12 , but
[ X 2 , C Z 12 ] = Z 1 ≠ I , (34) [X_2,\mathrm{CZ}_{12}]=Z_1\ne I, \tag*{(34)} [ X 2 , CZ 12 ] = Z 1 = I , (34)
where [ g , h ] : = g h g − 1 h − 1 [g,h]:=ghg^{-1}h^{-1} [ g , h ] := g h g − 1 h − 1 denotes the group commutator. More generally, the group commutator of two DCP stabilizers is characterized by the following proposition:
Proposition 3 (Commutators of DCP stabilizers). Let ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ be a nonzero state and g , h ∈ D ( ψ ) g,h\in\mathcal{D}(\psi) g , h ∈ D ( ψ ) . Then
[ g , h ] = ϵ Z ( z ) ∈ D ( ψ ) (35) [g,h]=\epsilon Z(z)\in\mathcal{D}(\psi) \tag*{(35)} [ g , h ] = ϵ Z ( z ) ∈ D ( ψ ) (35) for some ϵ ∈ { + 1 , − 1 } \epsilon\in\{+1,-1\} ϵ ∈ { + 1 , − 1 } and z ∈ F 2 n z\in\mathbb{F}_2^n z ∈ F 2 n .
Proof. By Proposition D.1, we have [ g , h ] = i c Z ( z ) [g,h]=i^cZ(z) [ g , h ] = i c Z ( z ) for some c ∈ Z 4 c\in\mathbb{Z}_4 c ∈ Z 4 and z ∈ F 2 n z\in\mathbb{F}_2^n z ∈ F 2 n . Since g g g and h h h fix ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ , so does their commutator. Therefore
Z ( z ) ∣ ψ ⟩ = i − c ∣ ψ ⟩ . (36) Z(z)|\psi\rangle=i^{-c}|\psi\rangle. \tag*{(36)} Z ( z ) ∣ ψ ⟩ = i − c ∣ ψ ⟩ . (36)
As ∣ ψ ⟩ ≠ 0 |\psi\rangle\ne0 ∣ ψ ⟩ = 0 and Z ( z ) Z(z) Z ( z ) has eigenvalues in { + 1 , − 1 } \{+1,-1\} { + 1 , − 1 } , we obtain i c ∈ { + 1 , − 1 } i^c\in\{+1,-1\} i c ∈ { + 1 , − 1 } .
Another difference from the Pauli case is that distinct DCP groups may fix the same space. For example, the distinct groups
G = ⟨ Z 1 , S 2 ⟩ , H = ⟨ S 1 , Z 2 ⟩ (37) G=\langle Z_1,S_2\rangle,\qquad H=\langle S_1,Z_2\rangle \tag*{(37)} G = ⟨ Z 1 , S 2 ⟩ , H = ⟨ S 1 , Z 2 ⟩ (37)
both have fixed space C ∣ 00 ⟩ \mathbb{C}|00\rangle C ∣00 ⟩ : the + 1 +1 + 1 eigenspace of either Z Z Z or S S S on a single qubit is C ∣ 0 ⟩ \mathbb{C}|0\rangle C ∣0 ⟩ . Consequently, equality of fixed spaces does not imply equality of groups. This motivates identifying groups through their stabilizing closure . Definition 10 (Stabilizing closure). Given a DCP subgroup G ≤ D n G \leq D^n G ≤ D n , its stabilizing closure G ‾ \overline{G} G is the subgroup of D n D^n D n defined by
G ‾ = { g ∈ D n ∣ Fix ( G ) ⊆ Fix ( g ) } . (38) \overline{G}=\{g\in D^n\mid\operatorname{Fix}(G)\subseteq\operatorname{Fix}(g)\}. \tag*{(38)} G = { g ∈ D n ∣ Fix ( G ) ⊆ Fix ( g )} . (38)
That is, G ‾ \overline{G} G is the largest subgroup of D n D^n D n that fixes the same space as G G G .
The stabilizing closure therefore captures exactly the fixed space, as expressed by the following equivalence.
Proposition 4. For any groups G , H ≤ D n G,H\leq D^n G , H ≤ D n , we have Fix ( G ) = Fix ( H ) \operatorname{Fix}(G)=\operatorname{Fix}(H) Fix ( G ) = Fix ( H ) if and only if G ‾ = H ‾ \overline{G}=\overline{H} G = H .
Proof. We first show that taking the stabilizing closure preserves the fixed space:
Fix ( G ‾ ) = Fix ( G ) . (39) \operatorname{Fix}(\overline{G})=\operatorname{Fix}(G). \tag*{(39)} Fix ( G ) = Fix ( G ) . (39)
Since G ⊆ G ‾ G\subseteq\overline{G} G ⊆ G , we have Fix ( G ‾ ) ⊆ Fix ( G ) \operatorname{Fix}(\overline{G})\subseteq\operatorname{Fix}(G) Fix ( G ) ⊆ Fix ( G ) . Conversely, every element of G ‾ \overline{G} G fixes every vector in Fix ( G ) \operatorname{Fix}(G) Fix ( G ) by definition, so Fix ( G ) ⊆ Fix ( G ‾ ) \operatorname{Fix}(G)\subseteq\operatorname{Fix}(\overline{G}) Fix ( G ) ⊆ Fix ( G ) .
If Fix ( G ) = Fix ( H ) \operatorname{Fix}(G)=\operatorname{Fix}(H) Fix ( G ) = Fix ( H ) , then their stabilizing closures coincide by definition. Conversely, if G ‾ = H ‾ \overline{G}=\overline{H} G = H , the identity above gives
Fix ( G ) = Fix ( G ‾ ) = Fix ( H ‾ ) = Fix ( H ) . (40) \operatorname{Fix}(G)=\operatorname{Fix}(\overline{G})=\operatorname{Fix}(\overline{H})=\operatorname{Fix}(H). \tag*{(40)} Fix ( G ) = Fix ( G ) = Fix ( H ) = Fix ( H ) . (40)
In our simulation procedures, any DCP group uniquely fixing the current state can serve as its representation.
Definition 11 (DCP-stabilizer group). Given a DCP state ∣ ψ ⟩ \lvert\psi\rangle ∣ ψ ⟩ and a group G ≤ D n G\leq D^n G ≤ D n , we say that G G G is a DCP-stabilizer group of ∣ ψ ⟩ \lvert\psi\rangle ∣ ψ ⟩ if Fix ( G ) = C ∣ ψ ⟩ \operatorname{Fix}(G)=\mathbb{C}\lvert\psi\rangle Fix ( G ) = C ∣ ψ ⟩ , or equivalently if G ‾ = D ( ψ ) \overline{G}=D(\psi) G = D ( ψ ) .
Canonical representation
To manipulate DCP subgroups, compute their fixed spaces, and use them in a tableau-based simulation algorithm, we first need to develop a canonical representation: a generating set which uniquely determines a DCP subgroup.
We start by separating its purely diagonal elements from the ones that contain X X X operators. By Proposition D.1, the map π : D n → F 2 n \pi:D^n\to\mathbb{F}_2^n π : D n → F 2 n defined by
π ( ω 8 k D ( s , M ) X ( x ) ) = x , (41) \pi\left(\omega_8^kD(s,M)X(x)\right)=x, \tag*{(41)} π ( ω 8 k D ( s , M ) X ( x ) ) = x , (41)
is a group homomorphism. For a subgroup G ≤ D n G\leq D^n G ≤ D n , define
Δ ( G ) : = ker π ∣ G , X ( G ) : = π ( G ) . (42) \Delta(G):=\ker\left.\pi\right|_G,\qquad X(G):=\pi(G). \tag*{(42)} Δ ( G ) := ker π ∣ G , X ( G ) := π ( G ) . (42)
Thus, Δ ( G ) \Delta(G) Δ ( G ) is the subgroup of diagonal elements of G G G , while X ( G ) X(G) X ( G ) is a subspace of F 2 n \mathbb{F}_2^n F 2 n representing the X X X part of each element of G G G . In other words, G G G fits into the short exact sequence
1 → Δ ( G ) → G → π X ( G ) → 1 , (43) 1\to\Delta(G)\to G\xrightarrow{\pi}X(G)\to1, \tag*{(43)} 1 → Δ ( G ) → G π X ( G ) → 1 , (43)
and the first isomorphism theorem gives
G / Δ ( G ) ≅ X ( G ) . (44) G/\Delta(G)\cong X(G). \tag*{(44)} G /Δ ( G ) ≅ X ( G ) . (44)
More explicitly, if h ∈ G h\in G h ∈ G has π ( h ) = x \pi(h)=x π ( h ) = x , then
G ∩ π − 1 ( x ) = h Δ ( G ) = Δ ( G ) h . (45) G\cap\pi^{-1}(x)=h\Delta(G)=\Delta(G)h. \tag*{(45)} G ∩ π − 1 ( x ) = h Δ ( G ) = Δ ( G ) h . (45)
This yields the following generating set for G G G .
Proposition 5 (Generating sets for DCP subgroups). Let G ≤ D n G\leq D^n G ≤ D n , let x ( 1 ) , … , x ( r ) x^{(1)},\ldots,x^{(r)} x ( 1 ) , … , x ( r ) be a basis of X ( G ) X(G) X ( G ) , and choose h j ∈ G h_j\in G h j ∈ G with π ( h j ) = x ( j ) \pi(h_j)=x^{(j)} π ( h j ) = x ( j ) . If δ 1 , … , δ m \delta_1,\ldots,\delta_m δ 1 , … , δ m generate Δ ( G ) \Delta(G) Δ ( G ) , then
G = ⟨ δ 1 , … , δ m , h 1 , … , h r ⟩ . (46) G=\langle\delta_1,\ldots,\delta_m,h_1,\ldots,h_r\rangle. \tag*{(46)} G = ⟨ δ 1 , … , δ m , h 1 , … , h r ⟩ . (46)
Proof. We show that every g ∈ G g\in G g ∈ G is generated by these elements. Write
π ( g ) = ∑ j = 1 r a j x ( j ) , (47) \pi(g)=\sum_{j=1}^{r}a_jx^{(j)}, \tag*{(47)} π ( g ) = j = 1 ∑ r a j x ( j ) , (47)
for a j ∈ F 2 a_j\in\mathbb{F}_2 a j ∈ F 2 , and set h = h 1 a 1 ⋯ h r a r h=h_1^{a_1}\cdots h_r^{a_r} h = h 1 a 1 ⋯ h r a r . Since π ( h ) = π ( g ) \pi(h)=\pi(g) π ( h ) = π ( g ) , the element g h − 1 gh^{-1} g h − 1 belongs to Δ ( G ) \Delta(G) Δ ( G ) . Thus, g = ( g h − 1 ) h g=(gh^{-1})h g = ( g h − 1 ) h belongs to the claimed generated subgroup. The reverse inclusion holds because all the generators belong to G G G .
We next choose canonical coordinates for the diagonal subgroup. Set d = 1 + n + ( n 2 ) d=1+n+\binom{n}{2} d = 1 + n + ( 2 n ) and define ι : ker τ → Z 8 d \iota:\ker\tau\to\mathbb{Z}_8^d ι : ker τ → Z 8 d by
ι ( ω 8 k D ( s , M ) ) = ( k , 2 s , ( 4 M a b ) a < b ) . (48) \iota\left(\omega_8^kD(s,M)\right)=\left(k,2s,(4M_{ab})_{a<b}\right). \tag*{(48)} ι ( ω 8 k D ( s , M ) ) = ( k , 2 s , ( 4 M ab ) a < b ) . (48)
We fix the coordinate order, taking the pairs ( a , b ) (a,b) ( a , b ) in lexicographic order. By the normal form and product formula for DCP operators, ι \iota ι is an injective group homomorphism into the additive group Z 8 d \mathbb{Z}_8^d Z 8 d . Consequently, ι ( Δ ( G ) ) \iota(\Delta(G)) ι ( Δ ( G )) can be seen as a Z 8 \mathbb{Z}_8 Z 8 -submodule of the module Z 8 d \mathbb{Z}_8^d Z 8 d .
Lemma 1. Given generators g 1 , … , g m g_1,\ldots,g_m g 1 , … , g m of a DCP group G ≤ D n G\leq D^n G ≤ D n , generators of Δ ( G ) \Delta(G) Δ ( G ) and lifts of a basis of X ( G ) X(G) X ( G ) can be computed in time polynomial in n n n and m m m .
Proof. We first construct lifts of a basis of X ( G ) X(G) X ( G ) , then recover Δ ( G ) \Delta(G) Δ ( G ) by closing a diagonal subgroup under conjugation. Gaussian elimination on π ( g 1 ) , … , π ( g m ) \pi(g_1),\ldots,\pi(g_m) π ( g 1 ) , … , π ( g m ) , tracking the corresponding operator products, gives elements h 1 , … , h r ∈ G h_1,\ldots,h_r\in G h 1 , … , h r ∈ G whose images form a basis of X ( G ) X(G) X ( G ) . For each a a a , write
π ( g a ) = ⨁ i = 1 r c a i π ( h i ) , δ a = g a ( h 1 c a 1 ⋯ h r c a r ) − 1 . (49) \pi(g_a)=\bigoplus_{i=1}^{r}c_{ai}\pi(h_i),\qquad
\delta_a=g_a\left(h_1^{c_{a1}}\cdots h_r^{c_{ar}}\right)^{-1}. \tag*{(49)} π ( g a ) = i = 1 ⨁ r c ai π ( h i ) , δ a = g a ( h 1 c a 1 ⋯ h r c a r ) − 1 . (49)
Then each δ a \delta_a δ a is diagonal and
G = ⟨ δ 1 , … , δ m , h 1 , … , h r ⟩ . (50) G = \langle\delta_1,\ldots,\delta_m,h_1,\ldots,h_r\rangle. \tag*{(50)} G = ⟨ δ 1 , … , δ m , h 1 , … , h r ⟩ . (50)
To recover Δ ( G ) \Delta(G) Δ ( G ) , start with
N 0 = ⟨ δ a , h i 2 , [ h i , h j ] : 1 ≤ a ≤ m , 1 ≤ i , j ≤ r ⟩ . (51) N_0=\langle\delta_a,h_i^2,[h_i,h_j]:1\le a\le m,\ 1\le i,j\le r\rangle. \tag*{(51)} N 0 = ⟨ δ a , h i 2 , [ h i , h j ] : 1 ≤ a ≤ m , 1 ≤ i , j ≤ r ⟩ . (51)
All these generators are diagonal, since π \pi π takes values in an elementary abelian 2-group. Given a generating set S k S_k S k of N k N_k N k , define
N k + 1 = ⟨ N k , h i d h i − 1 : d ∈ S k , 1 ≤ i ≤ r ⟩ , (52) N_{k+1}=\langle N_k,h_i d h_i^{-1}:d\in S_k,\ 1\le i\le r\rangle, \tag*{(52)} N k + 1 = ⟨ N k , h i d h i − 1 : d ∈ S k , 1 ≤ i ≤ r ⟩ , (52)
using Howell normal form in the coordinates ι \iota ι to reduce the generating set after each step. Every N k N_k N k is contained in Δ ( G ) \Delta(G) Δ ( G ) . Stop when N k + 1 = N k N_{k+1}=N_k N k + 1 = N k and denote the resulting subgroup by N N N .
We now show that N = Δ ( G ) N=\Delta(G) N = Δ ( G ) . At termination, h i N h i − 1 ⊆ N h_iNh_i^{-1}\subseteq N h i N h i − 1 ⊆ N for every i i i ; since N N N is finite, these inclusions are equalities. Moreover, the diagonal generators δ a \delta_a δ a commute with N N N , so N N N is normal in G G G . The quotient G / N G/N G / N is generated by the commuting elements h i N h_iN h i N , each of order at most two, and therefore has at most 2 r 2^r 2 r elements. Since N ⊆ Δ ( G ) N\subseteq\Delta(G) N ⊆ Δ ( G ) , the map π \pi π induces a surjection
G / N ↠ X ( G ) . (53) G/N\twoheadrightarrow X(G). \tag*{(53)} G / N ↠ X ( G ) . (53)
The target has 2 r 2^r 2 r elements, so this map is an isomorphism. Its kernel is Δ ( G ) / N \Delta(G)/N Δ ( G ) / N , proving that N = Δ ( G ) N=\Delta(G) N = Δ ( G ) .
Finally, we verify the polynomial runtime. Set d = 1 + n + ( n 2 ) d=1+n+\binom{n}{2} d = 1 + n + ( 2 n ) . Since ι ( Δ ( G ) ) ≤ Z 8 d \iota(\Delta(G))\le\mathbb{Z}_8^d ι ( Δ ( G )) ≤ Z 8 d , every strict enlargement of N k N_k N k at least doubles its order, and there can be at most 3 d 3d 3 d such enlargements. Howell normal form supplies at most d d d generators after each reduction, so each round involves polynomially many DCP operations and a polynomial-time Howell reduction. The initial Gaussian elimination and construction of N 0 N_0 N 0 are also polynomial in n n n and m m m , completing the proof. □
To specify G G G , we must record not only its diagonal subgroup Δ ( G ) \Delta(G) Δ ( G ) and its space of X X X -parts X ( G ) X(G) X ( G ) , but also which diagonal factors accompany those X X X -parts. For example, ⟨ X ⟩ \langle X\rangle ⟨ X ⟩ and ⟨ − X ⟩ \langle-X\rangle ⟨ − X ⟩ have the same diagonal subgroup { I } \{I\} { I } and the same image F 2 \mathbb{F}_2 F 2 under π \pi π , but are distinct groups.
Choose a basis x ( 1 ) , … , x ( r ) x^{(1)},\ldots,x^{(r)} x ( 1 ) , … , x ( r ) of X ( G ) X(G) X ( G ) . For each basis vector, choose an operator
h j = D j X ( x ( j ) ) ∈ G , (54) h_j=D_jX(x^{(j)})\in G, \tag*{(54)} h j = D j X ( x ( j ) ) ∈ G , (54)
where D j D_j D j is diagonal. Such an operator is called a lift of x ( j ) x^{(j)} x ( j ) , because π ( h j ) = x ( j ) \pi(h_j)=x^{(j)} π ( h j ) = x ( j ) . By Proposition 5, these operators, together with generators of Δ ( G ) \Delta(G) Δ ( G ) , determine G G G .
We now make these choices canonical. First, choose the basis of X ( G ) X(G) X ( G ) in row-reduced echelon form and represent ι ( Δ ( G ) ) \iota(\Delta(G)) ι ( Δ ( G )) in Howell normal form. By Lemma 1, the required generators and lifts can be obtained from arbitrary generators of G G G , so both normal forms can be computed in polynomial time. We recall the definition and relevant properties of Howell normal form in the Howell normal form subsection of Appendix D.
It remains to choose each lift canonically. If h j ′ = D j ′ X ( x ( j ) ) h'_j=D'_jX(x^{(j)}) h j ′ = D j ′ X ( x ( j ) ) is another lift of the same basis vector, then
h j ′ h j − 1 = D j ′ D j − 1 ∈ Δ ( G ) . (55) h'_j h_j^{-1}=D'_jD_j^{-1}\in\Delta(G). \tag*{(55)} h j ′ h j − 1 = D j ′ D j − 1 ∈ Δ ( G ) . (55)
Conversely, multiplying h j h_j h j on the left by any δ ∈ Δ ( G ) \delta\in\Delta(G) δ ∈ Δ ( G ) gives another lift of x ( j ) x^{(j)} x ( j ) . Thus the possible diagonal factors are exactly
{ δ D j : δ ∈ Δ ( G ) } . (56) \{\delta D_j:\delta\in\Delta(G)\}. \tag*{(56)} { δ D j : δ ∈ Δ ( G )} . (56)
Since ι \iota ι turns multiplication of diagonal operators into addition, their coordinate vectors form the additive coset
ι ( D j ) + ι ( Δ ( G ) ) . (57) \iota(D_j)+\iota(\Delta(G)). \tag*{(57)} ι ( D j ) + ι ( Δ ( G )) . (57)
By Lemma D.1, reduction using the Howell normal form selects a unique representative of this coset. It therefore selects one lift independently of the initial choice of h j h_j h j .
Definition 12 (Canonical representation). Let G ≤ D n G\le\mathcal{D}^n G ≤ D n . With the coordinate order fixed as above, the canonical representation of G G G consists of:
the ordered basis x ( 1 ) , … , x ( r ) x^{(1)},\ldots,x^{(r)} x ( 1 ) , … , x ( r ) of X ( G ) X(G) X ( G ) in row-reduced echelon form;
the Howell normal form H H H of ι ( Δ ( G ) ) \iota(\Delta(G)) ι ( Δ ( G )) ;
for each j j j , the lift h j = D j X ( x ( j ) ) ∈ G h_j=D_jX(x^{(j)})\in G h j = D j X ( x ( j ) ) ∈ G whose diagonal coordinate vector satisfies
ι ( D j ) = rem H ( ι ( D j ) ) . (58) \iota(D_j)=\operatorname{rem}_H(\iota(D_j)). \tag*{(58)} ι ( D j ) = rem H ( ι ( D j )) . (58)
Proposition 6 (Uniqueness of the canonical representation). Two DCP subgroups G , G ′ ≤ D n G,G'\le\mathcal{D}^n G , G ′ ≤ D n have the same canonical representation if and only if G = G ′ G=G' G = G ′ .
Proof. We first show that the representation depends only on the group. The row-reduced echelon basis of X ( G ) X(G) X ( G ) and the Howell normal form of ι ( Δ ( G ) ) \iota(\Delta(G)) ι ( Δ ( G )) are uniquely determined. For each basis vector, the diagonal factors of its lifts form one additive coset modulo ι ( Δ ( G ) ) \iota(\Delta(G)) ι ( Δ ( G )) , whose remainder is unique by Lemma D.1. Thus equal groups have equal canonical representations.
Conversely, the representation determines generators of Δ ( G ) \Delta(G) Δ ( G ) and lifts of a basis of X ( G ) X(G) X ( G ) . These generate G G G by Proposition 5, so equal representations determine equal groups. □
Structure of DCP spaces
For the rest of the section, we’ll analyze the structure of the space fixed by DCP groups, and work towards describing an explicit basis of it in Theorem 3 and a characterization of its dimension in Corollary 2. Throughout, let G ≤ D n G \leq\mathcal{D}^n G ≤ D n be a DCP subgroup, let r = dim X ( G ) r = \dim X(G) r = dim X ( G ) , and let
Σ Δ ( G ) : = { v ∈ F 2 n ∣ δ ∣ v ⟩ = ∣ v ⟩ ∀ δ ∈ Δ ( G ) } (59) \Sigma_{\Delta(G)} := \{v \in\mathbb{F}_2^n \mid\delta|v\rangle= |v\rangle\ \forall\delta\in\Delta(G)\} \tag*{(59)} Σ Δ ( G ) := { v ∈ F 2 n ∣ δ ∣ v ⟩ = ∣ v ⟩ ∀ δ ∈ Δ ( G )} (59)
denote the set of computational basis states fixed by every element of Δ ( G ) \Delta(G) Δ ( G ) . Equivalently, it is an algebraic set defined as the common zero set of the phase polynomials of the diagonal operators in Δ ( G ) \Delta(G) Δ ( G ) . Indeed, writing δ ∣ v ⟩ = ω 8 p δ ( v ) ∣ v ⟩ \delta|v\rangle= \omega_8^{p_\delta(v)}|v\rangle δ ∣ v ⟩ = ω 8 p δ ( v ) ∣ v ⟩ , we have
Σ Δ ( G ) = { v ∈ F 2 n : p δ ( v ) = 0 ∀ δ ∈ Δ ( G ) } (60) \Sigma_{\Delta(G)} = \{v \in\mathbb{F}_2^n : p_\delta(v) = 0 \ \forall\delta\in\Delta(G)\} \tag*{(60)} Σ Δ ( G ) = { v ∈ F 2 n : p δ ( v ) = 0 ∀ δ ∈ Δ ( G )} (60)
where the equations are taken modulo 8. It suffices to impose these equations for a generating set of Δ ( G ) \Delta(G) Δ ( G ) , since multiplication of diagonal operators adds their phase polynomials modulo 8. Thus Σ Δ ( G ) \Sigma_{\Delta(G)} Σ Δ ( G ) is an algebraic set of binary solutions to quadratic congruences.
Example 2. As a running example, consider G = ⟨ A , B , C ⟩ G = \langle A, B, C\rangle G = ⟨ A , B , C ⟩ with
A = ω 8 − 1 S 1 X 1 , B = C Z 12 , C = C Z 34 . (61) A = \omega_8^{-1}S_1X_1,\qquad B = \mathrm{CZ}_{12},\qquad C = \mathrm{CZ}_{34}. \tag*{(61)} A = ω 8 − 1 S 1 X 1 , B = CZ 12 , C = CZ 34 . (61)
The generators square to the identity, C C C commutes with A A A and B B B , and [ [ A , B ] ] = Z 2 [\![A,B]\!] = Z_2 [ [ A , B ] ] = Z 2 , which commutes with all three generators. Hence every element has the form A a Z 2 b B c C d A^a Z_2^b B^c C^d A a Z 2 b B c C d with a , b , c , d ∈ F 2 a,b,c,d \in\mathbb{F}_2 a , b , c , d ∈ F 2 , and
X ( G ) = ⟨ e 1 ⟩ , Δ ( G ) = ⟨ Z 2 , C Z 12 , C Z 34 ⟩ . (62) X(G) = \langle e_1\rangle,\qquad\Delta(G) = \langle Z_2,\mathrm{CZ}_{12},\mathrm{CZ}_{34}\rangle. \tag*{(62)} X ( G ) = ⟨ e 1 ⟩ , Δ ( G ) = ⟨ Z 2 , CZ 12 , CZ 34 ⟩ . (62)
The phase polynomials of these diagonal generators are 4 v 2 4v_2 4 v 2 , 4 v 1 v 2 4v_1v_2 4 v 1 v 2 , and 4 v 3 v 4 4v_3v_4 4 v 3 v 4 , respectively. Their common zeros therefore satisfy v 2 = 0 v_2 = 0 v 2 = 0 and v 3 v 4 = 0 v_3v_4 = 0 v 3 v 4 = 0 , with the constraint v 1 v 2 = 0 v_1v_2 = 0 v 1 v 2 = 0 redundant. Consequently,
Σ Δ ( G ) = { ( t , 0 , a , b ) : t , a , b ∈ F 2 , a b = 0 } (63) \Sigma_{\Delta(G)} = \{(t,0,a,b) : t,a,b \in\mathbb{F}_2,\ ab = 0\} \tag*{(63)} Σ Δ ( G ) = {( t , 0 , a , b ) : t , a , b ∈ F 2 , ab = 0 } (63)
= { 0000 , 1000 , 0001 , 1001 , 0010 , 1010 } . (64) = \{0000,1000,0001,1001,0010,1010\}. \tag*{(64)} = { 0000 , 1000 , 0001 , 1001 , 0010 , 1010 } . (64)
Note that this set can be written as a disjoint union of three cosets of X ( G ) X(G) X ( G ) :
\Sigma_{\Delta(G)} = X(G) \mathbin{\mathaccent\cdot\cup} (e_4 + X(G)) \mathbin{\mathaccent\cdot\cup} (e_3 + X(G)). \tag*{(65)}
The goal of this section is to show that this is generally the case, and that the space Fix ( G ) \operatorname{Fix}(G) Fix ( G ) has a basis such that each basis vector is supported on one of the cosets.
Lemma 2. Let ∣ ψ ⟩ ∈ Fix ( G ) |\psi\rangle\in\operatorname{Fix}(G) ∣ ψ ⟩ ∈ Fix ( G ) . Then supp ( ψ ) \operatorname{supp}(\psi) supp ( ψ ) is a disjoint union of cosets of X ( G ) X(G) X ( G ) , and the amplitudes have equal magnitude within each coset. Equivalently, ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ can be written as
∣ ψ ⟩ = ∑ j = 1 k a j ∑ v ∈ X ( G ) b j , v ∣ x j + v ⟩ (66) |\psi\rangle= \sum_{j=1}^{k} a_j \sum_{v\in X(G)} b_{j,v}|x_j+v\rangle \tag*{(66)} ∣ ψ ⟩ = j = 1 ∑ k a j v ∈ X ( G ) ∑ b j , v ∣ x j + v ⟩ (66) for some k ≥ 1 k \geq1 k ≥ 1 , a j ∈ C ∖ { 0 } a_j \in\mathbb{C}\setminus\{0\} a j ∈ C ∖ { 0 } , representatives x j ∈ F 2 n x_j \in\mathbb{F}_2^n x j ∈ F 2 n of distinct cosets, and b j , v ∈ C b_{j,v}\in\mathbb{C} b j , v ∈ C with ∣ b j , v ∣ = 1 |b_{j,v}|=1 ∣ b j , v ∣ = 1 .
Proof. Write ∣ ψ ⟩ = ∑ x α x ∣ x ⟩ |\psi\rangle= \sum_x \alpha_x|x\rangle ∣ ψ ⟩ = ∑ x α x ∣ x ⟩ . We need to show that if α x ≠ 0 \alpha_x \neq0 α x = 0 , then α x + v ≠ 0 \alpha_{x+v} \neq0 α x + v = 0 for all v ∈ X ( G ) v \in X(G) v ∈ X ( G ) . Let x ∈ supp ( ψ ) x \in\operatorname{supp}(\psi) x ∈ supp ( ψ ) , v ∈ X ( G ) v \in X(G) v ∈ X ( G ) and a corresponding stabilizer g v = δ v X ( v ) ∈ G g_v = \delta_vX(v) \in G g v = δ v X ( v ) ∈ G where δ v \delta_v δ v is a diagonal Clifford operator. Writing g v ∣ x ⟩ = λ v ( x ) ∣ x + v ⟩ g_v|x\rangle= \lambda_v(x)|x+v\rangle g v ∣ x ⟩ = λ v ( x ) ∣ x + v ⟩ for some λ v ( x ) ∈ C \lambda_v(x) \in\mathbb{C} λ v ( x ) ∈ C , we get
g v ∣ ψ ⟩ = ∑ x α x g v ∣ x ⟩ = ∑ x α x λ v ( x ) ∣ x + v ⟩ . (67) g_v|\psi\rangle= \sum_x \alpha_x g_v|x\rangle= \sum_x \alpha_x\lambda_v(x)|x+v\rangle. \tag*{(67)} g v ∣ ψ ⟩ = x ∑ α x g v ∣ x ⟩ = x ∑ α x λ v ( x ) ∣ x + v ⟩ . (67)
Since g v ∣ ψ ⟩ = ∣ ψ ⟩ g_v|\psi\rangle= |\psi\rangle g v ∣ ψ ⟩ = ∣ ψ ⟩ , we can compare the coefficients, getting
α x λ v ( x ) = α x + v . (68) \alpha_x\lambda_v(x) = \alpha_{x+v}. \tag*{(68)} α x λ v ( x ) = α x + v . (68)
Since g v g_v g v is unitary, ∣ λ v ( x ) ∣ = 1 |\lambda_v(x)|=1 ∣ λ v ( x ) ∣ = 1 , so taking absolute values gives
∣ α x + v ∣ = ∣ α x ∣ . |\alpha_{x+v}| = |\alpha_x|. ∣ α x + v ∣ = ∣ α x ∣.
The coefficient relation also gives
g v ∣ x ⟩ = ( α x + v / α x ) ∣ x + v ⟩ . (69) g_v|x\rangle= (\alpha_{x+v}/\alpha_x)|x+v\rangle. \tag*{(69)} g v ∣ x ⟩ = ( α x + v / α x ) ∣ x + v ⟩ . (69)
Thus α x + v ≠ 0 \alpha_{x+v}\neq0 α x + v = 0 and x + v ∈ supp ( ψ ) x+v\in\operatorname{supp}(\psi) x + v ∈ supp ( ψ ) . As v v v was arbitrary, the whole coset x + X ( G ) x+X(G) x + X ( G ) is contained in the support of ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ , with equal amplitude magnitudes throughout. Choosing one representative x j x_j x j per support coset and setting a j = α x j a_j=\alpha_{x_j} a j = α x j and b j , v = α x j + v / α x j b_{j,v}=\alpha_{x_j+v}/\alpha_{x_j} b j , v = α x j + v / α x j gives the claimed form with ∣ b j , v ∣ = 1 |b_{j,v}|=1 ∣ b j , v ∣ = 1 .
Lemma 3. Let ∣ ψ ⟩ ∈ Fix ( G ) |\psi\rangle\in\operatorname{Fix}(G) ∣ ψ ⟩ ∈ Fix ( G ) . Then supp ( ψ ) ⊆ Σ Δ ( G ) \operatorname{supp}(\psi) \subseteq\Sigma_{\Delta(G)} supp ( ψ ) ⊆ Σ Δ ( G ) .
Proof. Let ∣ ψ ⟩ = ∑ α x ∣ x ⟩ |\psi\rangle= \sum\alpha_x|x\rangle ∣ ψ ⟩ = ∑ α x ∣ x ⟩ , and δ ∈ Δ ( G ) \delta\in\Delta(G) δ ∈ Δ ( G ) . We write δ ∣ x ⟩ = λ x ∣ x ⟩ \delta|x\rangle= \lambda_x|x\rangle δ ∣ x ⟩ = λ x ∣ x ⟩ for some λ x ∈ C ∖ { 0 } \lambda_x \in\mathbb{C}\setminus\{0\} λ x ∈ C ∖ { 0 } . Then δ ∣ ψ ⟩ = ∣ ψ ⟩ \delta|\psi\rangle= |\psi\rangle δ ∣ ψ ⟩ = ∣ ψ ⟩ implies
∑ x α x λ x ∣ x ⟩ = ∑ x α x ∣ x ⟩ , (70) \sum_x \alpha_x\lambda_x|x\rangle= \sum_x \alpha_x|x\rangle, \tag*{(70)} x ∑ α x λ x ∣ x ⟩ = x ∑ α x ∣ x ⟩ , (70) which implies that λ x = 1 \lambda_x = 1 λ x = 1 for all x x x with α x ≠ 0 \alpha_x \neq0 α x = 0 . Therefore, supp ( ψ ) ⊆ Σ Δ ( G ) \operatorname{supp}(\psi) \subseteq\Sigma_{\Delta(G)} supp ( ψ ) ⊆ Σ Δ ( G ) .
The smallest possible nonempty support allowed by these constraints is a single translation coset.
Definition 13 (Atomic state). A state ∣ ψ ⟩ ∈ Fix ( G ) |\psi\rangle\in\operatorname{Fix}(G) ∣ ψ ⟩ ∈ Fix ( G ) is said to be atomic for G G G if supp ( ψ ) \operatorname{supp}(\psi) supp ( ψ ) is a single coset of X ( G ) X(G) X ( G ) , that is, if there exists x ∈ F 2 n x \in\mathbb{F}_2^n x ∈ F 2 n such that
∣ ψ ⟩ = ∑ v ∈ X ( G ) α v ∣ x + v ⟩ (71) |\psi\rangle= \sum_{v\in X(G)} \alpha_v|x+v\rangle \tag*{(71)} ∣ ψ ⟩ = v ∈ X ( G ) ∑ α v ∣ x + v ⟩ (71) for some α v ∈ C ∖ { 0 } \alpha_v \in\mathbb{C}\setminus\{0\} α v ∈ C ∖ { 0 } .
Atomic states will provide a basis of Fix ( G ) \operatorname{Fix}(G) Fix ( G ) . Let us first establish uniqueness on each coset.
Lemma 4. If ∣ ψ 1 ⟩ , ∣ ψ 2 ⟩ ∈ Fix ( G ) |\psi_1\rangle,|\psi_2\rangle\in\operatorname{Fix}(G) ∣ ψ 1 ⟩ , ∣ ψ 2 ⟩ ∈ Fix ( G ) are atomic and supp ( ψ 1 ) ∩ supp ( ψ 2 ) ≠ ∅ \operatorname{supp}(\psi_1)\cap\operatorname{supp}(\psi_2)\neq\varnothing supp ( ψ 1 ) ∩ supp ( ψ 2 ) = ∅ , then ∣ ψ 2 ⟩ = λ ∣ ψ 1 ⟩ |\psi_2\rangle= \lambda|\psi_1\rangle ∣ ψ 2 ⟩ = λ ∣ ψ 1 ⟩ for some scalar λ \lambda λ with ∣ λ ∣ = 1 |\lambda|=1 ∣ λ ∣ = 1 .
Proof. Two cosets of X ( G ) X(G) X ( G ) that intersect must coincide, so there is some x 0 ∈ F 2 n x_0 \in\mathbb{F}_2^n x 0 ∈ F 2 n with supp ( ψ 1 ) = supp ( ψ 2 ) = x 0 + X ( G ) \operatorname{supp}(\psi_1)=\operatorname{supp}(\psi_2)=x_0+X(G) supp ( ψ 1 ) = supp ( ψ 2 ) = x 0 + X ( G ) . Write ∣ ψ 1 ⟩ = ∑ x α x ( 1 ) ∣ x ⟩ |\psi_1\rangle=\sum_x \alpha_x^{(1)}|x\rangle ∣ ψ 1 ⟩ = ∑ x α x ( 1 ) ∣ x ⟩ and ∣ ψ 2 ⟩ = ∑ x α x ( 2 ) ∣ x ⟩ |\psi_2\rangle=\sum_x \alpha_x^{(2)}|x\rangle ∣ ψ 2 ⟩ = ∑ x α x ( 2 ) ∣ x ⟩ , and let λ = α x 0 ( 2 ) α x 0 ( 1 ) \lambda=\frac{\alpha_{x_0}^{(2)}}{\alpha_{x_0}^{(1)}} λ = α x 0 ( 1 ) α x 0 ( 2 ) . For any y ∈ x 0 + X ( G ) y\in x_0+X(G) y ∈ x 0 + X ( G ) , pick a stabilizer g ∈ G g\in G g ∈ G with π ( g ) = y + x 0 \pi(g)=y+x_0 π ( g ) = y + x 0 . As in the proof of Lemma 2, we have g ∣ x 0 ⟩ = ( α y ( i ) α x 0 ( i ) ) ∣ y ⟩ g|x_0\rangle=\left(\frac{\alpha_y^{(i)}}{\alpha_{x_0}^{(i)}}\right)|y\rangle g ∣ x 0 ⟩ = ( α x 0 ( i ) α y ( i ) ) ∣ y ⟩ for both i = 1 , 2 i=1,2 i = 1 , 2 . Since the left-hand side does not depend on i i i , it follows that α y ( 2 ) = λ α y ( 1 ) \alpha_y^{(2)}=\lambda\alpha_y^{(1)} α y ( 2 ) = λ α y ( 1 ) for all y ∈ x 0 + X ( G ) y\in x_0+X(G) y ∈ x 0 + X ( G ) , that is, ∣ ψ 2 ⟩ = λ ∣ ψ 1 ⟩ |\psi_2\rangle=\lambda|\psi_1\rangle ∣ ψ 2 ⟩ = λ ∣ ψ 1 ⟩ . Since both states have unit norm, ∣ λ ∣ = 1 |\lambda|=1 ∣ λ ∣ = 1 .
Lemma 5
Lemma 5. For every x ∈ Σ Δ ( G ) x\in\Sigma_{\Delta(G)} x ∈ Σ Δ ( G ) , there exists an atomic state ∣ ψ x ⟩ ∈ Fix ( G ) |\psi_x\rangle\in\operatorname{Fix}(G) ∣ ψ x ⟩ ∈ Fix ( G ) with support x + X ( G ) x+X(G) x + X ( G ) . This state is unique up to global phase among atomic states in Fix ( G ) \operatorname{Fix}(G) Fix ( G ) whose support contains x x x .
Proof. Let x ∈ Σ Δ ( G ) x\in\Sigma_{\Delta(G)} x ∈ Σ Δ ( G ) . Let us first construct a state with support x + X ( G ) x+X(G) x + X ( G ) , then show that it is fixed by G G G and establish uniqueness.
For each v ∈ X ( G ) v\in X(G) v ∈ X ( G ) , choose g v ∈ G g_v\in G g v ∈ G with π ( g v ) = v \pi(g_v)=v π ( g v ) = v , taking g 0 = I g_0=I g 0 = I , and define
∣ ψ x ⟩ : = 1 ∣ X ( G ) ∣ ∑ v ∈ X ( G ) g v ∣ x ⟩ . (72) |\psi_x\rangle:=\frac{1}{\sqrt{|X(G)|}}\sum_{v\in X(G)}g_v|x\rangle. \tag*{(72)} ∣ ψ x ⟩ := ∣ X ( G ) ∣ 1 v ∈ X ( G ) ∑ g v ∣ x ⟩ . (72)
Each g v ∣ x ⟩ g_v|x\rangle g v ∣ x ⟩ is a multiple of ∣ x + v ⟩ |x+v\rangle ∣ x + v ⟩ with modulus 1. These computational-basis vectors are distinct as v v v varies, so ∣ ψ x ⟩ |\psi_x\rangle ∣ ψ x ⟩ is normalized and has support exactly x + X ( G ) x+X(G) x + X ( G ) .
To show that ∣ ψ x ⟩ ∈ Fix ( G ) |\psi_x\rangle\in\operatorname{Fix}(G) ∣ ψ x ⟩ ∈ Fix ( G ) , let h ∈ G h\in G h ∈ G and write w = π ( h ) w=\pi(h) w = π ( h ) . For each v ∈ X ( G ) v\in X(G) v ∈ X ( G ) , the operators h g v hg_v h g v and g w + v g_{w+v} g w + v have the same X X X -part, since π ( h g v ) = π ( h ) + π ( g v ) = w + v \pi(hg_v)=\pi(h)+\pi(g_v)=w+v π ( h g v ) = π ( h ) + π ( g v ) = w + v . So
δ h , v : = g w + v − 1 h g v ∈ Δ ( G ) . (73) \delta_{h,v}:=g_{w+v}^{-1}hg_v\in\Delta(G). \tag*{(73)} δ h , v := g w + v − 1 h g v ∈ Δ ( G ) . (73)
Since x ∈ Σ Δ ( G ) x\in\Sigma_{\Delta(G)} x ∈ Σ Δ ( G ) , we have δ h , v ∣ x ⟩ = ∣ x ⟩ \delta_{h,v}|x\rangle=|x\rangle δ h , v ∣ x ⟩ = ∣ x ⟩ , and hence
h g v ∣ x ⟩ = g w + v δ h , v ∣ x ⟩ = g w + v ∣ x ⟩ . (74) hg_v|x\rangle=g_{w+v}\delta_{h,v}|x\rangle=g_{w+v}|x\rangle. \tag*{(74)} h g v ∣ x ⟩ = g w + v δ h , v ∣ x ⟩ = g w + v ∣ x ⟩ . (74)
Summing over v v v and using that v ↦ w + v v\mapsto w+v v ↦ w + v permutes X ( G ) X(G) X ( G ) gives
h ∣ ψ x ⟩ = 1 ∣ X ( G ) ∣ ∑ v ∈ X ( G ) g w + v ∣ x ⟩ = ∣ ψ x ⟩ . (75) h|\psi_x\rangle=\frac{1}{\sqrt{|X(G)|}}\sum_{v\in X(G)}g_{w+v}|x\rangle=|\psi_x\rangle. \tag*{(75)} h ∣ ψ x ⟩ = ∣ X ( G ) ∣ 1 v ∈ X ( G ) ∑ g w + v ∣ x ⟩ = ∣ ψ x ⟩ . (75)
Thus ∣ ψ x ⟩ ∈ Fix ( G ) |\psi_x\rangle\in\operatorname{Fix}(G) ∣ ψ x ⟩ ∈ Fix ( G ) , and its support is a single coset of X ( G ) X(G) X ( G ) , so it is atomic. Finally, any other atomic state in Fix ( G ) \operatorname{Fix}(G) Fix ( G ) whose support contains x x x has support intersecting that of ∣ ψ x ⟩ |\psi_x\rangle ∣ ψ x ⟩ . By Lemma 4, the two states differ only by a global phase, proving uniqueness.
Corollary 1. The set Σ Δ ( G ) \Sigma_{\Delta(G)} Σ Δ ( G ) is a disjoint union of cosets of X ( G ) X(G) X ( G ) .
Proof. We show that every coset of X ( G ) X(G) X ( G ) intersecting Σ Δ ( G ) \Sigma_{\Delta(G)} Σ Δ ( G ) is contained in it. Let x ∈ Σ Δ ( G ) x\in\Sigma_{\Delta(G)} x ∈ Σ Δ ( G ) . By Lemma 5, there exists a state ∣ ψ x ⟩ ∈ Fix ( G ) |\psi_x\rangle\in\operatorname{Fix}(G) ∣ ψ x ⟩ ∈ Fix ( G ) with support x + X ( G ) x+X(G) x + X ( G ) . Since every element of Δ ( G ) \Delta(G) Δ ( G ) is diagonal and fixes ∣ ψ x ⟩ |\psi_x\rangle ∣ ψ x ⟩ , it fixes each computational-basis vector in its support. Therefore
x + X ( G ) = supp ( ψ x ) ⊆ Σ Δ ( G ) . (76) x+X(G)=\operatorname{supp}(\psi_x)\subseteq\Sigma_{\Delta(G)}. \tag*{(76)} x + X ( G ) = supp ( ψ x ) ⊆ Σ Δ ( G ) . (76)
Thus Σ Δ ( G ) \Sigma_{\Delta(G)} Σ Δ ( G ) is a union of cosets of X ( G ) X(G) X ( G ) , and distinct cosets are disjoint.
Theorem 3
Theorem 3 (Atomic basis). Let C 1 , … , C m C_1,\ldots,C_m C 1 , … , C m be the distinct cosets of X ( G ) X(G) X ( G ) contained in Σ Δ ( G ) \Sigma_{\Delta(G)} Σ Δ ( G ) , and for each j j j pick a point x ( j ) ∈ C j x^{(j)}\in C_j x ( j ) ∈ C j . Then the atomic states ∣ ψ x ( 1 ) ⟩ , … , ∣ ψ x ( m ) ⟩ |\psi_{x^{(1)}}\rangle,\ldots,|\psi_{x^{(m)}}\rangle ∣ ψ x ( 1 ) ⟩ , … , ∣ ψ x ( m ) ⟩ defined in Eq. (72) form a basis of Fix ( G ) \operatorname{Fix}(G) Fix ( G ) .
Proof. The states ∣ ψ x ( j ) ⟩ |\psi_{x^{(j)}}\rangle ∣ ψ x ( j ) ⟩ lie in Fix ( G ) \operatorname{Fix}(G) Fix ( G ) by Lemma 5 and are orthonormal because their supports C 1 , … , C m C_1,\ldots,C_m C 1 , … , C m are pairwise disjoint. It remains to show that they span Fix ( G ) \operatorname{Fix}(G) Fix ( G ) .
Let ∣ ψ ⟩ ∈ Fix ( G ) |\psi\rangle\in\operatorname{Fix}(G) ∣ ψ ⟩ ∈ Fix ( G ) . By Lemma 3, supp ( ψ ) ⊆ Σ Δ ( G ) \operatorname{supp}(\psi)\subseteq\Sigma_{\Delta(G)} supp ( ψ ) ⊆ Σ Δ ( G ) . Grouping the computational-basis amplitudes according to the partition Σ Δ ( G ) = C 1 ⊔ ⋯ ⊔ C m \Sigma_{\Delta(G)}=C_1\sqcup\cdots\sqcup C_m Σ Δ ( G ) = C 1 ⊔ ⋯ ⊔ C m of Corollary 1, we may therefore write
∣ ψ ⟩ = ∑ j = 1 m a j ∣ ψ j ⟩ , (77) |\psi\rangle=\sum_{j=1}^{m}a_j|\psi_j\rangle, \tag*{(77)} ∣ ψ ⟩ = j = 1 ∑ m a j ∣ ψ j ⟩ , (77) where a j ∈ C a_j\in\mathbb{C} a j ∈ C and each ∣ ψ j ⟩ |\psi_j\rangle ∣ ψ j ⟩ is a state supported within C j C_j C j . We show that ∣ ψ j ⟩ |\psi_j\rangle ∣ ψ j ⟩ is atomic whenever a j ≠ 0 a_j\ne0 a j = 0 .
Every g ∈ G g\in G g ∈ G preserves each subspace span { ∣ y ⟩ : y ∈ C j } \operatorname{span}\{|y\rangle:y\in C_j\} span { ∣ y ⟩ : y ∈ C j } , since g ∣ y ⟩ g|y\rangle g ∣ y ⟩ is proportional to ∣ y + π ( g ) ⟩ ∈ C j |y+\pi(g)\rangle\in C_j ∣ y + π ( g )⟩ ∈ C j . Comparing the components in these mutually orthogonal subspaces on both sides of g ∣ ψ ⟩ = ∣ ψ ⟩ g|\psi\rangle=|\psi\rangle g ∣ ψ ⟩ = ∣ ψ ⟩ gives
a j g ∣ ψ j ⟩ = a j ∣ ψ j ⟩ . (78) a_jg|\psi_j\rangle=a_j|\psi_j\rangle. \tag*{(78)} a j g ∣ ψ j ⟩ = a j ∣ ψ j ⟩ . (78) Thus, whenever a j ≠ 0 a_j\ne0 a j = 0 , we have ∣ ψ j ⟩ ∈ Fix ( G ) |\psi_j\rangle\in\operatorname{Fix}(G) ∣ ψ j ⟩ ∈ Fix ( G ) . By Lemma 2, its support is a nonempty union of X ( G ) X(G) X ( G ) -cosets contained in C j C_j C j , and therefore equals C j C_j C j . Hence ∣ ψ j ⟩ |\psi_j\rangle ∣ ψ j ⟩ is atomic and, by Lemma 4, proportional to ∣ ψ x ( j ) ⟩ |\psi_{x^{(j)}}\rangle ∣ ψ x ( j ) ⟩ . Consequently,
∣ ψ ⟩ ∈ span { ∣ ψ x ( 1 ) ⟩ , … , ∣ ψ x ( m ) ⟩ } , (79) |\psi\rangle\in\operatorname{span}\{|\psi_{x^{(1)}}\rangle,\ldots,|\psi_{x^{(m)}}\rangle\}, \tag*{(79)} ∣ ψ ⟩ ∈ span { ∣ ψ x ( 1 ) ⟩ , … , ∣ ψ x ( m ) ⟩} , (79) proving the spanning claim.
Corollary 2. The dimension of the space fixed by G G G is given by
dim Fix ( G ) = ∣ Σ Δ ( G ) ∣ 2 r (80) \dim\operatorname{Fix}(G)=\frac{|\Sigma_{\Delta(G)}|}{2^r} \tag*{(80)} dim Fix ( G ) = 2 r ∣ Σ Δ ( G ) ∣ (80)
In particular ∣ Σ Δ ( G ) ∣ |\Sigma_{\Delta(G)}| ∣ Σ Δ ( G ) ∣ is a multiple of 2 r 2^r 2 r .
Proof. By Corollary 1, Σ Δ ( G ) \Sigma_{\Delta(G)} Σ Δ ( G ) is a disjoint union of exactly m = ∣ Σ Δ ( G ) ∣ / 2 r m=|\Sigma_{\Delta(G)}|/2^r m = ∣ Σ Δ ( G ) ∣/ 2 r cosets of X ( G ) X(G) X ( G ) , and by Theorem 3 the corresponding atomic states form a basis of Fix ( G ) \operatorname{Fix}(G) Fix ( G ) , so dim Fix ( G ) = m \dim\operatorname{Fix}(G)=m dim Fix ( G ) = m .
Remark 2. Since Σ Δ ( G ) \Sigma_{\Delta(G)} Σ Δ ( G ) is an algebraic subset of F 2 n \mathbb{F}_2^n F 2 n and not necessarily an affine subset, its cardinality need not be a power of two. This translates to the fact that the dimension of a space stabilized by a DCP group also need not be a power of two.
Example 3. For the group G G G of Example 2, the three cosets of X ( G ) = ⟨ e 1 ⟩ X(G)=\langle e_1\rangle X ( G ) = ⟨ e 1 ⟩ contained in Σ Δ ( G ) \Sigma_{\Delta}(G) Σ Δ ( G ) have representatives
x ( 00 ) = ( 0 , 0 , 0 , 0 ) , x ( 01 ) = ( 0 , 0 , 0 , 1 ) , x ( 10 ) = ( 0 , 0 , 1 , 0 ) . (81) x^{(00)}=(0,0,0,0), \qquad x^{(01)}=(0,0,0,1), \qquad x^{(10)}=(0,0,1,0). \tag*{(81)} x ( 00 ) = ( 0 , 0 , 0 , 0 ) , x ( 01 ) = ( 0 , 0 , 0 , 1 ) , x ( 10 ) = ( 0 , 0 , 1 , 0 ) . (81)
Choose the lifts g 0 = I g_0=I g 0 = I and g e 1 = A = ω 8 − 1 S 1 X 1 g_{e_1}=A=\omega_8^{-1}S_1X_1 g e 1 = A = ω 8 − 1 S 1 X 1 . For each ( a , b ) ∈ { ( 0 , 0 ) , ( 0 , 1 ) , ( 1 , 0 ) } (a,b)\in\{(0,0),(0,1),(1,0)\} ( a , b ) ∈ {( 0 , 0 ) , ( 0 , 1 ) , ( 1 , 0 )} , the construction in Lemma 5 gives
∣ ψ a b ⟩ = 1 ∣ X ( G ) ∣ ∑ v ∈ X ( G ) g v ∣ x ( a b ) ⟩ (82) |\psi_{ab}\rangle=\frac{1}{\sqrt{|X(G)|}}\sum_{v\in X(G)}g_v|x^{(ab)}\rangle \tag*{(82)} ∣ ψ ab ⟩ = ∣ X ( G ) ∣ 1 v ∈ X ( G ) ∑ g v ∣ x ( ab ) ⟩ (82)
= 1 2 ( I + A ) ∣ 00 a b ⟩ (83) =\frac{1}{\sqrt{2}}(I+A)|00ab\rangle \tag*{(83)} = 2 1 ( I + A ) ∣00 ab ⟩ (83)
= 1 2 ( ∣ 00 a b ⟩ + ω 8 ∣ 10 a b ⟩ ) (84) =\frac{1}{\sqrt{2}}\left(|00ab\rangle+\omega_8|10ab\rangle\right) \tag*{(84)} = 2 1 ( ∣00 ab ⟩ + ω 8 ∣10 ab ⟩ ) (84)
= ∣ T ⟩ ⊗ ∣ 0 ⟩ ⊗ ∣ a b ⟩ , (85) =|T\rangle\otimes|0\rangle\otimes|ab\rangle, \tag*{(85)} = ∣ T ⟩ ⊗ ∣0 ⟩ ⊗ ∣ ab ⟩ , (85)
where ∣ T ⟩ = ( ∣ 0 ⟩ + ω 8 ∣ 1 ⟩ ) / 2 |T\rangle=(|0\rangle+\omega_8|1\rangle)/\sqrt{2} ∣ T ⟩ = ( ∣0 ⟩ + ω 8 ∣1 ⟩) / 2 . Here we used A ∣ 00 a b ⟩ = ω 8 − 1 i ∣ 10 a b ⟩ = ω 8 ∣ 10 a b ⟩ A|00ab\rangle=\omega_8^{-1}i|10ab\rangle=\omega_8|10ab\rangle A ∣00 ab ⟩ = ω 8 − 1 i ∣10 ab ⟩ = ω 8 ∣10 ab ⟩ . By Theorem 3, the three states
∣ T ⟩ ⊗ ∣ 000 ⟩ , ∣ T ⟩ ⊗ ∣ 001 ⟩ , ∣ T ⟩ ⊗ ∣ 010 ⟩ (86) |T\rangle\otimes|000\rangle,\qquad|T\rangle\otimes|001\rangle,\qquad|T\rangle\otimes|010\rangle \tag*{(86)} ∣ T ⟩ ⊗ ∣000 ⟩ , ∣ T ⟩ ⊗ ∣001 ⟩ , ∣ T ⟩ ⊗ ∣010 ⟩ (86)
form an orthonormal basis of Fix ( G ) \operatorname{Fix}(G) Fix ( G ) . The dimension of Fix ( G ) \operatorname{Fix}(G) Fix ( G ) is therefore 3 3 3 , which we could also have derived from Corollary 2:
dim Fix ( G ) = ∣ Σ Δ ( G ) ∣ 2 r = 6 2 1 = 3. (87) \dim\operatorname{Fix}(G)=\frac{|\Sigma_{\Delta}(G)|}{2^r}=\frac{6}{2^1}=3. \tag*{(87)} dim Fix ( G ) = 2 r ∣ Σ Δ ( G ) ∣ = 2 1 6 = 3. (87)
Equivalence with 3PP states
We first record the closure property that connects CNOT-dihedral preparation to DCP stabilizers.
Proposition 7 (Stability of D n D^n D n under conjugation). The group D n D^n D n of DCP operators is stable under conjugation by CNOT-dihedral gates. Moreover, given a DCP operator in normal form, its conjugate by an elementary Pauli, CNOT, or T T T gate can be computed in O ( n 2 ) O(n^2) O ( n 2 ) time.
Proof. Recall that
D n = ⟨ ω 8 I , X i , S i , C Z i j ⟩ . (88) D^n=\langle\omega_8 I,X_i,S_i,\mathrm{CZ}_{ij}\rangle. \tag*{(88)} D n = ⟨ ω 8 I , X i , S i , CZ ij ⟩ . (88) Since conjugation respects products, it is enough to check the conjugation of these generators.
Every Pauli operator belongs to D n D^n D n , so conjugation by a Pauli preserves D n D^n D n by the group property.
Next, let U = C N O T c , t U=\mathrm{CNOT}_{c,t} U = CNOT c , t . Conjugation by U U U maps products of X X X operators to products of X X X operators. Moreover, it maps diagonal Clifford operators to diagonal Clifford operators. Indeed, conjugation by a Clifford preserves the Clifford group, while conjugation by a computational-basis permutation preserves diagonality.
Finally, let U = T i U=T_i U = T i . Since T i T_i T i is diagonal, it commutes with every S j S_j S j and C Z j k \mathrm{CZ}_{jk} CZ j k , and it commutes with X j X_j X j for j ≠ i j\ne i j = i . The remaining generator satisfies
T i X i T i † = ω 8 − 1 S i X i ∈ D n . (89) T_iX_iT_i^\dagger=\omega_8^{-1}S_iX_i\in D^n. \tag*{(89)} T i X i T i † = ω 8 − 1 S i X i ∈ D n . (89)
This proves that U g U † ∈ D n UgU^\dagger\in D^n U g U † ∈ D n for every g ∈ D n g\in D^n g ∈ D n and every CNOT-dihedral gate U U U . The same argument applies to their inverses, using
T i † X i T i = ω 8 S i † X i , (90) T_i^\dagger X_iT_i=\omega_8S_i^\dagger X_i, \tag*{(90)} T i † X i T i = ω 8 S i † X i , (90)
so in fact U D n U † = D n UD^nU^\dagger=D^n U D n U † = D n .
To establish the complexity bound, represent g g g by its normal-form coefficients ( k , s , M , x ) (k,s,M,x) ( k , s , M , x ) , requiring O ( n 2 ) O(n^2) O ( n 2 ) entries. Conjugation by T i T_i T i changes only the global phase and the coefficient of S i S_i S i , depending on x i x_i x i , and therefore takes O ( 1 ) O(1) O ( 1 ) time. Conjugation by a single-qubit Pauli changes at most O ( n ) O(n) O ( n ) coefficients: conjugation by Z i Z_i Z i changes only the global phase, while conjugation by X i X_i X i updates the diagonal phase by substituting y i ↦ y i ⊕ 1 y_i\mapsto y_i\oplus1 y i ↦ y i ⊕ 1 . Conjugation by C N O T c , t \mathrm{CNOT}_{c,t} CNOT c , t updates the X X X component by a binary linear transformation and the diagonal phase by substituting y t ↦ y t ⊕ y c y_t\mapsto y_t\oplus y_c y t ↦ y t ⊕ y c . Only the O ( n ) O(n) O ( n ) terms containing y t y_t y t are affected, each producing a bounded number of terms, so this update also takes O ( n ) O(n) O ( n ) time. An arbitrary Pauli operator can be handled using at most n n n single-qubit Pauli conjugations, and each update takes O ( n ) O(n) O ( n ) time, giving an O ( n 2 ) O(n^2) O ( n 2 ) bound.
Theorem 4. A state ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ is a DCP state if and only if it is a 3PP state.
Proof. We first show that every 3PP state is a DCP state. By Proposition 1, it can be prepared from ∣ 0 ⟩ |0\rangle ∣0 ⟩ and ∣ + ⟩ |+\rangle ∣ + ⟩ states using only Pauli, CNOT, and T T T gates. The initial product state is uniquely stabilized by a Pauli subgroup of D n D^n D n . If a DCP group G G G uniquely stabilizes ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ , then U G U † UGU^\dagger U G U † uniquely stabilizes U ∣ ψ ⟩ U|\psi\rangle U ∣ ψ ⟩ . By Proposition 7, this conjugated group remains a DCP group for every gate in the preparation. Hence, the prepared 3PP state is a DCP state.
For the converse direction, let ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ be a DCP state and let G = D ( ψ ) G=D(\psi) G = D ( ψ ) . Since dim Fix ( G ) = 1 \dim\operatorname{Fix}(G)=1 dim Fix ( G ) = 1 , Theorem 3 tells us that ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ is, up to global phase, an atomic state of the form
∣ ψ ⟩ = 2 − r / 2 ∑ v ∈ X ( G ) g v ∣ x 0 ⟩ . (91) |\psi\rangle=2^{-r/2}\sum_{v\in X(G)}g_v|x_0\rangle. \tag*{(91)} ∣ ψ ⟩ = 2 − r /2 v ∈ X ( G ) ∑ g v ∣ x 0 ⟩ . (91) We now show that the phases of this atomic state are given by a third-order phase polynomial. Choose a basis v ( 1 ) , … , v ( r ) v^{(1)},\ldots,v^{(r)} v ( 1 ) , … , v ( r ) of X ( G ) X(G) X ( G ) and lifts g 1 , … , g r ∈ G g_1,\ldots,g_r\in G g 1 , … , g r ∈ G with π ( g i ) = v ( i ) \pi(g_i)=v^{(i)} π ( g i ) = v ( i ) . Write
g i ∣ x ⟩ = ω 8 d i ( x ) ∣ x ⊕ v ( i ) ⟩ , (92) g_i|x\rangle=\omega_8^{d_i(x)}|x\oplus v^{(i)}\rangle, \tag*{(92)} g i ∣ x ⟩ = ω 8 d i ( x ) ∣ x ⊕ v ( i ) ⟩ , (92) where each d i d_i d i is a Clifford phase polynomial. For t ∈ F 2 r t\in\mathbb{F}_2^r t ∈ F 2 r , choose
g v ( t ) = g r t r ⋯ g 1 t 1 , v ( t ) = ⨁ i = 1 r t i v ( i ) . (93) g_{v(t)}=g_r^{t_r}\cdots g_1^{t_1},\qquad v(t)=\bigoplus_{i=1}^r t_iv^{(i)}. \tag*{(93)} g v ( t ) = g r t r ⋯ g 1 t 1 , v ( t ) = i = 1 ⨁ r t i v ( i ) . (93)
Applying these operators successively gives
g v ( t ) ∣ x 0 ⟩ = ω 8 P ( t ) ∣ x 0 ⊕ v ( t ) ⟩ (94) g_v(t)|x_0\rangle= \omega_8^{P(t)}|x_0\oplus v(t)\rangle \tag*{(94)} g v ( t ) ∣ x 0 ⟩ = ω 8 P ( t ) ∣ x 0 ⊕ v ( t )⟩ (94)
P ( t ) = ∑ i = 1 r t i d i ( x 0 ⊕ ⨁ j < i t j v ( j ) ) ( m o d 8 ) . (95) P(t)=\sum_{i=1}^{r}t_i d_i\left(x_0\oplus\bigoplus_{j<i}t_jv^{(j)}\right)\pmod{8}. \tag*{(95)} P ( t ) = i = 1 ∑ r t i d i ( x 0 ⊕ j < i ⨁ t j v ( j ) ) ( mod 8 ) . (95)
Affine substitution preserves Clifford phase polynomials by Corollary A.1, so each substituted d i d_i d i has the form
c i + 2 ∑ j < i a i j t j + 4 ∑ j < k < i b i j k t j t k . (96) c_i+2\sum_{j<i}a_{ij}t_j+4\sum_{j<k<i}b_{ijk}t_jt_k. \tag*{(96)} c i + 2 j < i ∑ a ij t j + 4 j < k < i ∑ b ij k t j t k . (96)
Consequently,
P ( t ) = ∑ i c i t i + 2 ∑ j < i a i j t i t j + 4 ∑ j < k < i b i j k t i t j t k , (97) P(t)=\sum_i c_it_i+2\sum_{j<i}a_{ij}t_it_j+4\sum_{j<k<i}b_{ijk}t_it_jt_k, \tag*{(97)} P ( t ) = i ∑ c i t i + 2 j < i ∑ a ij t i t j + 4 j < k < i ∑ b ij k t i t j t k , (97)
which is a third-order phase polynomial.
Finally, let B B B be the matrix with columns v ( 1 ) , … , v ( r ) v^{(1)},\ldots,v^{(r)} v ( 1 ) , … , v ( r ) and choose a left inverse L L L of B B B over F 2 \mathbb{F}_2 F 2 . Then
q ( x ) = P ( L ( x ⊕ x 0 ) ) (98) q(x)=P(L(x\oplus x_0)) \tag*{(98)} q ( x ) = P ( L ( x ⊕ x 0 )) (98)
is a third-order phase polynomial by affine pullback, and q ( x 0 ⊕ B t ) = P ( t ) q(x_0\oplus Bt)=P(t) q ( x 0 ⊕ B t ) = P ( t ) . Hence, up to global phase,
∣ ψ ⟩ = 2 − r / 2 ∑ x ∈ x 0 ⊕ X ( G ) ω 8 q ( x ) ∣ x ⟩ , (99) |\psi\rangle=2^{-r/2}\sum_{x\in x_0\oplus X(G)}\omega_8^{q(x)}|x\rangle, \tag*{(99)} ∣ ψ ⟩ = 2 − r /2 x ∈ x 0 ⊕ X ( G ) ∑ ω 8 q ( x ) ∣ x ⟩ , (99)
so ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ is a 3PP state.
Remark 3. Although the full DCP stabilizer group of a state can be non-abelian, every DCP state is uniquely stabilized by an abelian DCP subgroup generated by n n n independent commuting involutions. Indeed, by Proposition 1 and Theorem 4, we may write ∣ ψ ⟩ = U ∣ ϕ ⟩ |\psi\rangle=U|\phi\rangle ∣ ψ ⟩ = U ∣ ϕ ⟩ , where ∣ ϕ ⟩ |\phi\rangle ∣ ϕ ⟩ is a product of ∣ 0 ⟩ |0\rangle ∣0 ⟩ and ∣ + ⟩ |+\rangle ∣ + ⟩ states and U U U is a CNOT-dihedral unitary. If P 1 , … , P n P_1,\ldots,P_n P 1 , … , P n are the standard Pauli stabilizer generators of ∣ ϕ ⟩ |\phi\rangle ∣ ϕ ⟩ , then
H = ⟨ U P 1 U † , … , U P n U † ⟩ (100) H=\langle UP_1U^\dagger,\ldots,UP_nU^\dagger\rangle \tag*{(100)} H = ⟨ U P 1 U † , … , U P n U † ⟩ (100)
is a DCP subgroup made of commuting order-2 elements, with Fix ( H ) = span { ∣ ψ ⟩ } \operatorname{Fix}(H)=\operatorname{span}\{|\psi\rangle\} Fix ( H ) = span { ∣ ψ ⟩} .
Simulation in the DCP representation
In this section, we describe how to update the DCP-stabilizer group of a state under the operations of preparing ∣ 0 ⟩ |0\rangle ∣0 ⟩ and ∣ + ⟩ |+\rangle ∣ + ⟩ states, applying Pauli, CNOT and T T T gates, and measuring Z Z Z and certain X X X Pauli operators projectively. We show that each of these operations can be simulated in polynomial time using the canonical representation of the DCP-stabilizer group.
First, note that any product state ∣ 0 ⟩ ⊗ a ⊗ ∣ + ⟩ ⊗ b |0\rangle^{\otimes a}\otimes|+\rangle^{\otimes b} ∣0 ⟩ ⊗ a ⊗ ∣ + ⟩ ⊗ b is a DCP state, since it is stabilized by the DCP group generated by ⟨ Z 1 , … , Z a , X a + 1 , … , X a + b ⟩ \langle Z_1,\ldots,Z_a,X_{a+1},\ldots,X_{a+b}\rangle ⟨ Z 1 , … , Z a , X a + 1 , … , X a + b ⟩ . Thus, we can initialize the DCP-stabilizer group of any product state in polynomial time. The other operations are more complicated and described in the following subsections.
Unitary operations
Let’s consider the following very general fact about describing states in the Heisenberg picture, that is, by considering a set of matrices that stabilize the state:
Proposition 8. Suppose that we have a state ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ and a set of matrices S S S that stabilize it. Consider a unitary operation U U U that is applied to the state. Then, the set of matrices U S U † USU^\dagger U S U † stabilizes the state U ∣ ψ ⟩ U|\psi\rangle U ∣ ψ ⟩ , where
U S U † = { U g U † ∣ g ∈ S } . USU^\dagger=\{UgU^\dagger\mid g\in S\}. U S U † = { U g U † ∣ g ∈ S } .
Moreover, dim Fix ( S ) = dim Fix ( U S U † ) \dim\operatorname{Fix}(S)=\dim\operatorname{Fix}(USU^\dagger) dim Fix ( S ) = dim Fix ( U S U † ) .
Proof. We have that for any L ∈ S L\in S L ∈ S ,
U L U † ( U ∣ ψ ⟩ ) = U L ∣ ψ ⟩ = U ∣ ψ ⟩ , ULU^\dagger(U|\psi\rangle)=UL|\psi\rangle=U|\psi\rangle, U L U † ( U ∣ ψ ⟩) = U L ∣ ψ ⟩ = U ∣ ψ ⟩ ,
so U S U † USU^\dagger U S U † stabilizes U ∣ ψ ⟩ U|\psi\rangle U ∣ ψ ⟩ .
For the second part, note that if { v ( 1 ) , … , v ( r ) } \{v^{(1)},\ldots,v^{(r)}\} { v ( 1 ) , … , v ( r ) } is a basis for Fix ( S ) \operatorname{Fix}(S) Fix ( S ) , then { U v ( 1 ) , … , U v ( r ) } \{Uv^{(1)},\ldots,Uv^{(r)}\} { U v ( 1 ) , … , U v ( r ) } remains linearly independent and lies in Fix ( U S U † ) \operatorname{Fix}(USU^\dagger) Fix ( U S U † ) , so dim Fix ( S ) ≤ dim Fix ( U S U † ) \dim\operatorname{Fix}(S)\leq\dim\operatorname{Fix}(USU^\dagger) dim Fix ( S ) ≤ dim Fix ( U S U † ) . The same argument applies to U † U^\dagger U † , so we also have dim Fix ( U S U † ) ≤ dim Fix ( S ) \dim\operatorname{Fix}(USU^\dagger)\leq\dim\operatorname{Fix}(S) dim Fix ( U S U † ) ≤ dim Fix ( S ) , and thus dim Fix ( S ) = dim Fix ( U S U † ) \dim\operatorname{Fix}(S)=\dim\operatorname{Fix}(USU^\dagger) dim Fix ( S ) = dim Fix ( U S U † ) .
By the conjugation-closure result Proposition 7, we can apply Proposition 8 to update the DCP-stabilizer group directly by conjugating its generators:
Proposition 9 (Updating under Pauli, CNOT, and T T T gates). Let ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ be a state with DCP-stabilizer group D ( ψ ) = ⟨ g 1 , … , g m ⟩ \mathcal{D}(\psi)=\langle g_1,\ldots,g_m\rangle D ( ψ ) = ⟨ g 1 , … , g m ⟩ , and let U U U be a Pauli operator, a CNOT gate, or a T T T (or T † T^\dagger T † ) gate. Then U g 1 U † , … , U g m U † Ug_1U^\dagger,\ldots,Ug_mU^\dagger U g 1 U † , … , U g m U † are DCP operators, by Proposition 7, and
D ( U ψ ) = ⟨ U g 1 U † , … , U g m U † ⟩ . \mathcal{D}(U\psi)=\langle Ug_1U^\dagger,\ldots,Ug_mU^\dagger\rangle. D ( U ψ ) = ⟨ U g 1 U † , … , U g m U † ⟩ .
Proof. Write H = ⟨ U g 1 U † , … , U g m U † ⟩ = U D ( ψ ) U † H=\langle Ug_1U^\dagger,\ldots,Ug_mU^\dagger\rangle=U\mathcal{D}(\psi)U^\dagger H = ⟨ U g 1 U † , … , U g m U † ⟩ = U D ( ψ ) U † . For h ∈ D n h\in\mathcal{D}^n h ∈ D n , h ( U ψ ) = U ψ h(U\psi)=U\psi h ( U ψ ) = U ψ iff ( U † h U ) ψ = ψ (U^\dagger hU)\psi=\psi ( U † h U ) ψ = ψ ; since U † U^\dagger U † is a Pauli operator, CNOT gate, or T T T -type gate, Proposition 7 guarantees U † h U ∈ D n U^\dagger hU\in\mathcal{D}^n U † h U ∈ D n whenever h ∈ D n h\in\mathcal{D}^n h ∈ D n , so this is equivalent to U † h U ∈ D ( ψ ) U^\dagger hU\in\mathcal{D}(\psi) U † h U ∈ D ( ψ ) , i.e. to h ∈ U D ( ψ ) U † = H h\in U\mathcal{D}(\psi)U^\dagger=H h ∈ U D ( ψ ) U † = H . Hence D ( U ψ ) = H \mathcal{D}(U\psi)=H D ( U ψ ) = H .
Z-measurements
When considering the issue of updating the DCP-stabilizer group under Z Z Z -measurements, the following is fundamental:
Lemma 6. Given a DCP operator L L L and a product of Pauli Z Z Z operators z z z , we have that L L L and z z z either commute or anticommute (i.e. L z = ± z L Lz=\pm zL L z = ± z L ).
Proof. Write L = ω 8 k D ( s , M ) X ( x ) L=\omega_8^kD(s,M)X(x) L = ω 8 k D ( s , M ) X ( x ) in the normal form of Proposition 2, and write z = Z ( v ) z=Z(v) z = Z ( v ) for some v ∈ F 2 n v\in\mathbb{F}_2^n v ∈ F 2 n . Since D ( s , M ) D(s,M) D ( s , M ) and z z z are both diagonal, they commute. On the other hand, the Pauli commutation relations give
X ( x ) Z ( v ) = ( − 1 ) ⟨ x , v ⟩ Z ( v ) X ( x ) . X(x)Z(v) = (-1)^{\langle x,v\rangle}Z(v)X(x). X ( x ) Z ( v ) = ( − 1 ) ⟨ x , v ⟩ Z ( v ) X ( x ) .
It follows that L z = ( − 1 ) ⟨ x , v ⟩ z L Lz = (-1)^{\langle x,v\rangle}zL L z = ( − 1 ) ⟨ x , v ⟩ z L , proving the claim.
Just as in the Pauli stabilizer formalism, Lemma 6 lets us split the update rule for measuring a Z Z Z -string z z z into a random and a deterministic case, according to how z z z interacts with the current generators:
Proposition 10 (Updating under Z Z Z -measurements). Let ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ be a DCP state, let G = ⟨ g 1 , … , g m ⟩ G = \langle g_1,\ldots,g_m\rangle G = ⟨ g 1 , … , g m ⟩ be a DCP-stabilizer group for ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ , and let z z z be a product of Pauli Z Z Z operators.
(a) (Random outcome.) Suppose that z z z anticommutes with some element of G G G , and let
K = C G ( z ) = { g ∈ G : g z = z g } . K = C_G(z) = \{g \in G : gz = zg\}. K = C G ( z ) = { g ∈ G : g z = z g } . Measuring z z z yields each outcome ϵ ∈ { + 1 , − 1 } \epsilon\in\{+1,-1\} ϵ ∈ { + 1 , − 1 } with probability 1 2 \frac{1}{2} 2 1 , and
H ϵ = ⟨ K , ϵ z ⟩ H_\epsilon= \langle K,\epsilon z\rangle H ϵ = ⟨ K , ϵz ⟩ is a DCP-stabilizer group for the post-measurement state. In the canonical representation of Definition 12, a generating set for K K K is obtained by retaining all diagonal generators, choosing an anticommuting lift g j g_j g j , and replacing every other anticommuting lift g i g_i g i by g i g j g_i g_j g i g j . Thus the post-measurement update amounts to replacing g j g_j g j by ϵ z \epsilon z ϵz after these row operations.
(b) (Deterministic outcome.) If z z z commutes with every element of G G G , the outcome ϵ ∈ { + 1 , − 1 } \epsilon\in\{+1,-1\} ϵ ∈ { + 1 , − 1 } is determined: it is the unique sign for which ϵ z ∈ D ( ψ ) \epsilon z \in D(\psi) ϵz ∈ D ( ψ ) . The state is unchanged, so G G G remains a DCP-stabilizer group for it.
The proof can be found in the measurement update subsection of Appendix § 2.4.1 .
X-measurements
In the Heisenberg picture, the compatibility criteria and update rules for X X X -measurements closely mirror those of the phase-polynomial picture, described in Theorem 1. For a general X ( m ) X(m) X ( m ) measurement, Eq. (24) lets us conjugate the tableau by C m C_m C m , perform the single-qubit X a X_a X a update below, and conjugate back by C m † C_m^\dagger C m † . The identity measurement leaves the tableau unchanged. Consider a 3PP state ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ with DCP-stabilizer group G G G , and suppose that we measure the single-qubit operator X a X_a X a , obtaining the outcome ϵ = ( − 1 ) μ \epsilon= (-1)^\mu ϵ = ( − 1 ) μ with μ ∈ F 2 \mu\in\mathbb{F}_2 μ ∈ F 2 . Write V = X ( G ) V = X(G) V = X ( G ) , regarded as a vector space over F 2 \mathbb{F}_2 F 2 . Since ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ spans the one-dimensional space Fix ( G ) \operatorname{Fix}(G) Fix ( G ) , it is atomic for G G G by Theorem 3, so its support is a coset S = x 0 ⊕ V S = x_0 \oplus V S = x 0 ⊕ V of V V V . The two top-level cases of Theorem 1 are therefore exactly:
( 1 ) e a ∉ V or ( 2 ) e a ∈ V . (101) (1)\quad e_a \notin V \qquad\text{or}\qquad(2)\quad e_a \in V. \tag*{(101)} ( 1 ) e a ∈ / V or ( 2 ) e a ∈ V . (101)
Let us consider case (1) first. Measurements falling into this case are always compatible with the state and yield each outcome with probability 1 2 \frac{1}{2} 2 1 , so all that remains is to describe how the tableau updates.
Suppose first that v a = 0 v_a = 0 v a = 0 for every v ∈ V v \in V v ∈ V . Then qubit a a a is unentangled from the rest of the system and sits in a computational basis state ∣ σ ⟩ |\sigma\rangle ∣ σ ⟩ , where ( − 1 ) σ (-1)^\sigma ( − 1 ) σ is the deterministic outcome of measuring Z a Z_a Z a . The measurement simply replaces ∣ σ ⟩ |\sigma\rangle ∣ σ ⟩ by ∣ ± ⟩ |\pm\rangle ∣ ± ⟩ , according to the sign of ϵ \epsilon ϵ . On the tableau, we first detach qubit a a a from the generators, replacing each factor S a S_a S a by the scalar i σ i^\sigma i σ and each factor C Z a j CZ_{a_j} C Z a j by Z j σ Z_j^\sigma Z j σ , which does not change their action on the state, and then add the generator ϵ X a \epsilon X_a ϵ X a .
The general case reduces to this one. Since e a ∉ V e_a \notin V e a ∈ / V , Gaussian elimination yields a vector w ∈ F 2 n w \in\mathbb{F}_2^n w ∈ F 2 n with w a = 0 w_a = 0 w a = 0 and ⟨ w , v ⟩ = v a \langle w,v\rangle= v_a ⟨ w , v ⟩ = v a for all v ∈ V v \in V v ∈ V . The circuit C = ∏ i : w i = 1 CNOT i , a C = \prod_{i:w_i=1} \operatorname{CNOT}_{i,a} C = ∏ i : w i = 1 CNOT i , a then clears the a a a -th coordinate of every element of V V V , and it commutes with X a X_a X a . Measuring X a X_a X a is therefore equivalent to applying C C C , measuring X a X_a X a as above, and then applying C † C^\dagger C † . Thus we conjugate the generators by C C C , update them as in the previous paragraph, and conjugate them back by C † C^\dagger C † , all of which takes polynomial time by Proposition 7.
We now turn to case 2, where e a ∈ V e_a \in V e a ∈ V . By the surjectivity of π \pi π , there is some g ∈ G g \in G g ∈ G of the form g = δ ∗ X ( e a ) g = \delta^* X(e_a) g = δ ∗ X ( e a ) , where δ ∗ \delta^* δ ∗ is a diagonal DCP operator. Let E : F 2 n → Z 8 E : \mathbb{F}_2^n \to\mathbb{Z}_8 E : F 2 n → Z 8 denote the phase function of δ ∗ \delta^* δ ∗ , defined by δ ∗ ∣ x ⟩ = ω 8 E ( x ) ∣ x ⟩ \delta^*|x\rangle= \omega_8^{E(x)}|x\rangle δ ∗ ∣ x ⟩ = ω 8 E ( x ) ∣ x ⟩ . This function determines the discrete derivative on which Theorem 1 is based:
Proposition 11. Let q q q be a phase polynomial for ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ , so that, up to global phase,
∣ ψ ⟩ = 1 ∣ S ∣ ∑ x ∈ S ω 8 q ( x ) ∣ x ⟩ , S = x 0 ⊕ V . |\psi\rangle= \frac{1}{\sqrt{|S|}}\sum_{x\in S}\omega_8^{q(x)}|x\rangle,\qquad S = x_0 \oplus V. ∣ ψ ⟩ = ∣ S ∣ 1 x ∈ S ∑ ω 8 q ( x ) ∣ x ⟩ , S = x 0 ⊕ V . Then, for every x ∈ S x \in S x ∈ S ,
Δ e a q ( x ) = E ( x ⊕ e a ) = − E ( x ) ( m o d 8 ) . \Delta_{e_a}q(x) = E(x \oplus e_a) = -E(x)\pmod8. Δ e a q ( x ) = E ( x ⊕ e a ) = − E ( x ) ( mod 8 ) . Proof. Since e a ∈ V e_a \in V e a ∈ V , we have S ⊕ e a = S S \oplus e_a = S S ⊕ e a = S . For x ∈ S x \in S x ∈ S ,
g ∣ x ⟩ = δ ∗ ∣ x ⊕ e a ⟩ = ω 8 E ( x ⊕ e a ) ∣ x ⊕ e a ⟩ , g|x\rangle= \delta^*|x\oplus e_a\rangle= \omega_8^{E(x\oplus e_a)}|x\oplus e_a\rangle, g ∣ x ⟩ = δ ∗ ∣ x ⊕ e a ⟩ = ω 8 E ( x ⊕ e a ) ∣ x ⊕ e a ⟩ , so comparing the amplitudes of ∣ x ⊕ e a ⟩ |x\oplus e_a\rangle ∣ x ⊕ e a ⟩ on both sides of g ∣ ψ ⟩ = ∣ ψ ⟩ g|\psi\rangle= |\psi\rangle g ∣ ψ ⟩ = ∣ ψ ⟩ gives q ( x ) + E ( x ⊕ e a ) = q ( x ⊕ e a ) ( m o d 8 ) q(x) + E(x\oplus e_a) = q(x\oplus e_a)\pmod8 q ( x ) + E ( x ⊕ e a ) = q ( x ⊕ e a ) ( mod 8 ) . Likewise, g − 1 = X ( e a ) ( δ ∗ ) − 1 g^{-1} = X(e_a)(\delta^*)^{-1} g − 1 = X ( e a ) ( δ ∗ ) − 1 fixes ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ and
g − 1 ∣ x ⟩ = ω 8 − E ( x ) ∣ x ⊕ e a ⟩ , g^{-1}|x\rangle= \omega_8^{-E(x)}|x\oplus e_a\rangle, g − 1 ∣ x ⟩ = ω 8 − E ( x ) ∣ x ⊕ e a ⟩ , so that q ( x ) − E ( x ) = q ( x ⊕ e a ) ( m o d 8 ) q(x) - E(x) = q(x\oplus e_a)\pmod8 q ( x ) − E ( x ) = q ( x ⊕ e a ) ( mod 8 ) .
The derivative Δ e a q \Delta_{e_a}q Δ e a q can thus be read off the DCP-stabilizer group, without tracking the phase polynomial itself. Substituting Δ e a q = − E ′ \Delta_{e_a}q = -E' Δ e a q = − E ′ into Theorem 1 gives necessary and sufficient conditions for the compatibility of the measurement in terms of quantities computable from G G G , and Proposition B.1 shows how to decide in polynomial time which of the cases 2a, 2b and 2c applies, if any. What remains is to describe how the DCP-stabilizer group is updated in each of them.
The starting point is the same in all three cases. Since X a = ( δ ∗ ) − 1 g X_a=(\delta^*)^{-1}g X a = ( δ ∗ ) − 1 g and g g g fix ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ , the projection onto the ε \varepsilon ε -eigenspace of X a X_a X a acts on ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ as a diagonal operator:
1 2 ( 1 + ε X a ) ∣ ψ ⟩ = 1 2 ( 1 + ε ( δ ∗ ) − 1 g ) ∣ ψ ⟩ = 1 2 ( 1 + ε ( δ ∗ ) − 1 ) ∣ ψ ⟩ . (102) \begin{aligned}
\frac{1}{2}(1+\varepsilon X_a)|\psi\rangle=\frac{1}{2}(1+\varepsilon(\delta^*)^{-1}g)|\psi\rangle\\
&=\frac{1}{2}(1+\varepsilon(\delta^*)^{-1})|\psi\rangle. \tag*{(102)}
\end{aligned} 2 1 ( 1 + ε X a ) ∣ ψ ⟩ = 2 1 ( 1 + ε ( δ ∗ ) − 1 g ) ∣ ψ ⟩ = 2 1 ( 1 + ε ( δ ∗ ) − 1 ) ∣ ψ ⟩ . (102)
In case 2a, E ( x ) = − Δ e a q ( x ) = 4 f ( x ) ( m o d 8 ) E(x)=-\Delta_{e_a}q(x)=4f(x)\pmod{8} E ( x ) = − Δ e a q ( x ) = 4 f ( x ) ( mod 8 ) on S S S for an affine function f f f , which we write as f ( x ) = c ⊕ ⟨ u , x ⟩ f(x)=c\oplus\langle u,x\rangle f ( x ) = c ⊕ ⟨ u , x ⟩ with c ∈ F 2 c\in\mathbb{F}_2 c ∈ F 2 and u ∈ F 2 n u\in\mathbb{F}_2^n u ∈ F 2 n . Equivalently, δ ∗ \delta^* δ ∗ acts on the support of ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ as the signed Z Z Z -string ( − 1 ) c Z ( u ) (-1)^cZ(u) ( − 1 ) c Z ( u ) . This is the case, for instance, whenever δ ∗ \delta^* δ ∗ is itself a signed product of Z Z Z operators. In general, δ ∗ \delta^* δ ∗ may differ from ( − 1 ) c Z ( u ) (-1)^cZ(u) ( − 1 ) c Z ( u ) by a diagonal operator that fixes every ∣ x ⟩ |x\rangle ∣ x ⟩ with x ∈ S x\in S x ∈ S . As ( δ ∗ ) − 1 ∣ ψ ⟩ = δ ∗ ∣ ψ ⟩ (\delta^*)^{-1}|\psi\rangle=\delta^*|\psi\rangle ( δ ∗ ) − 1 ∣ ψ ⟩ = δ ∗ ∣ ψ ⟩ in this case, Eq. (102) becomes
1 2 ( 1 + ε X a ) ∣ ψ ⟩ = 1 2 ( 1 + ε δ ∗ ) ∣ ψ ⟩ (103) \frac{1}{2}(1+\varepsilon X_a)|\psi\rangle=\frac{1}{2}(1+\varepsilon\delta^*)|\psi\rangle \tag*{(103)} 2 1 ( 1 + ε X a ) ∣ ψ ⟩ = 2 1 ( 1 + ε δ ∗ ) ∣ ψ ⟩ (103)
= 1 2 ( 1 + ( − 1 ) μ + c Z ( u ) ) ∣ ψ ⟩ . (104) =\frac{1}{2}(1+(-1)^{\mu+c}Z(u))|\psi\rangle. \tag*{(104)} = 2 1 ( 1 + ( − 1 ) μ + c Z ( u )) ∣ ψ ⟩ . (104)
Thus, measuring X a X_a X a with outcome μ \mu μ transforms the state exactly as measuring the Z Z Z -string Z ( u ) Z(u) Z ( u ) with outcome ( − 1 ) μ + c (-1)^{\mu+c} ( − 1 ) μ + c . The outcome probabilities and the updated DCP-stabilizer group are therefore given by Proposition 10, and can be computed in polynomial time.
In cases 2b and 2c, the support is unchanged and, by Theorem 1, the difference r = q ′ − q r=q'-q r = q ′ − q between the new and the old phase polynomial is itself a third-order phase polynomial. Writing it as a sum of terms,
r ( x ) = r 0 + ∑ i a i x i + 2 ∑ i < j b i j x i x j + 4 ∑ i < j < k c i j k x i x j x k , r(x)=r_0+\sum_i a_i x_i+2\sum_{i<j}b_{ij}x_i x_j+4\sum_{i<j<k}c_{ijk}x_i x_j x_k, r ( x ) = r 0 + i ∑ a i x i + 2 i < j ∑ b ij x i x j + 4 i < j < k ∑ c ij k x i x j x k ,
adding r r r to the phase polynomial has the same effect on the state, up to the global phase ω 8 r 0 \omega_8^{r_0} ω 8 r 0 , as applying the circuit
U = ∏ i T i a i ∏ i < j CS i j b i j ∏ i < j < k CCZ i j k c i j k . U=\prod_i T_i^{a_i}\prod_{i<j}\operatorname{CS}_{ij}^{b_{ij}}\prod_{i<j<k}\operatorname{CCZ}_{ijk}^{c_{ijk}}. U = i ∏ T i a i i < j ∏ CS ij b ij i < j < k ∏ CCZ ij k c ij k .
By Proposition 8, U G U † UGU^\dagger U G U † is then a DCP-stabilizer group of the post-measurement state. Since CS and CCZ can be synthesized from CNOT and T T T gates, U U U is a circuit of polynomially many such gates, so the new tableau can be computed in polynomial time by conjugating the generators gate by gate, as in Proposition 9.
Applications to quantum error correction
We now establish sufficient conditions for non-Clifford quantum error-correction circuits to admit efficient simulation under stochastic Pauli noise, and more generally under stochastic DCP faults. The main challenge is to ensure that every X X X measurement remains compatible with the 3PP representation, including after earlier faults and measurements have changed the state.
We first identify two useful measurement mechanisms: checks that are deterministic in the absence of noise, and X X X measurements that anticommute with a current Z Z Z -type stabilizer. We prove that in the ideal case, the former are compatible case (2a), and change to other cases with noise, while the latter are compatible case (1). We then prove that circuits whose ideal X X X measurements are either deterministic or case (1) remain compatible throughout arbitrary sequences of DCP faults and measurements. This reduces the analysis of noisy circuits to conditions on their ideal evolution. We apply these results to magic state distillation and transversal computation, DCP observable checks used in magic state cultivation, gauge fixing and code switching, teleportation, and cat-state syndrome extraction.
Deterministic checks and gauge measurements
We begin with measurements whose outcomes are deterministic in the ideal circuit, as occurs for stabilizer checks measured on a logical DCP state. Although faults can make these outcomes random, the following theorem shows that any DCP error preserves measurement compatibility.
Throughout, we use the following notation for the projector onto an affine set A A A :
Π A = ∑ x ∈ A ∣ x ⟩ ⟨ x ∣ . (105) \Pi_A=\sum_{x\in A}|x\rangle\langle x|. \tag*{(105)} Π A = x ∈ A ∑ ∣ x ⟩ ⟨ x ∣. (105)
Theorem 5 (Deterministic measurements under noise). Let ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ be a 3PP state satisfying X ( m ) ∣ ψ ⟩ = ( − 1 ) c 0 ∣ ψ ⟩ X(m)|\psi\rangle=(-1)^{c_0}|\psi\rangle X ( m ) ∣ ψ ⟩ = ( − 1 ) c 0 ∣ ψ ⟩ . Then, measuring X ( m ) X(m) X ( m ) on ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ is a compatible case (2a), and for every DCP error E E E , measuring X ( m ) X(m) X ( m ) on E ∣ ψ ⟩ E|\psi\rangle E ∣ ψ ⟩ is a compatible case (1), (2a) or (2b). Moreover, for every measurement outcome ε = ( − 1 ) s \varepsilon=(-1)^s ε = ( − 1 ) s with nonzero probability, the resulting state is proportional to
E s Π B s ∣ ψ ⟩ (106) E_s\Pi_{B_s}|\psi\rangle \tag*{(106)} E s Π B s ∣ ψ ⟩ (106) where E s E_s E s is DCP and B s ⊆ supp ( ψ ) B_s\subseteq\operatorname{supp}(\psi) B s ⊆ supp ( ψ ) is affine.
Proof. Let us first identify the ideal case. Plugging
∣ ψ ⟩ = 1 ∣ S ∣ ∑ x ∈ S ω 8 q ( x ) ∣ x ⟩ , S = x 0 + V (107) |\psi\rangle=\frac{1}{\sqrt{|S|}}\sum_{x\in S}\omega_8^{q(x)}|x\rangle,\qquad S=x_0+V \tag*{(107)} ∣ ψ ⟩ = ∣ S ∣ 1 x ∈ S ∑ ω 8 q ( x ) ∣ x ⟩ , S = x 0 + V (107)
into
X ( m ) ∣ ψ ⟩ = ( − 1 ) c 0 ∣ ψ ⟩ , (108) X(m)|\psi\rangle=(-1)^{c_0}|\psi\rangle, \tag*{(108)} X ( m ) ∣ ψ ⟩ = ( − 1 ) c 0 ∣ ψ ⟩ , (108)
we get
∑ x ∈ S ω 8 q ( x ) ∣ x ⊕ m ⟩ = ∑ x ∈ S ω 8 q ( x ) + 4 c 0 ∣ x ⟩ . (109) \sum_{x\in S}\omega_8^{q(x)}|x\oplus m\rangle=\sum_{x\in S}\omega_8^{q(x)+4c_0}|x\rangle. \tag*{(109)} x ∈ S ∑ ω 8 q ( x ) ∣ x ⊕ m ⟩ = x ∈ S ∑ ω 8 q ( x ) + 4 c 0 ∣ x ⟩ . (109)
After a change of variable on the left-hand side, we can identify phases on both sides:
q ( x ⊕ m ) = q ( x ) + 4 c 0 , (110) q(x \mathbin{\oplus} m) = q(x) + 4c_0, \tag*{(110)} q ( x ⊕ m ) = q ( x ) + 4 c 0 , (110)
which gives us
Δ m q = 4 c 0 . (111) \Delta_m q = 4c_0. \tag*{(111)} Δ m q = 4 c 0 . (111)
This is case (2a).
Let us now look at the noisy case. Let E E E be a DCP error. We write E = D X ( e ) E = DX(e) E = D X ( e ) where D D D is a diagonal Clifford gate, satisfying D ∣ x ⟩ = ω 8 d ( x ) ∣ x ⟩ D|x\rangle= \omega_8^{d(x)}|x\rangle D ∣ x ⟩ = ω 8 d ( x ) ∣ x ⟩ . The function d d d is a Clifford phase polynomial of the form characterized in Theorem A.3 . Let q ′ q' q ′ be the phase polynomial associated to E ∣ ψ ⟩ E|\psi\rangle E ∣ ψ ⟩ . Relabeling y = x ⊕ e y = x \mathbin{\oplus} e y = x ⊕ e gives
E ∣ ψ ⟩ = 1 ∣ S ∣ ∑ x ∈ S ω 8 q ( x ) D X ( e ) ∣ x ⟩ = 1 ∣ S ∣ ∑ x ∈ S ω 8 q ( x ) + d ( x ⊕ e ) ∣ x ⊕ e ⟩ = 1 ∣ S ∣ ∑ y ∈ S ⊕ e ω 8 q ( y ⊕ e ) + d ( y ) ∣ y ⟩ . (112) \begin{aligned}
E|\psi\rangle
&= \frac{1}{\sqrt{|S|}}\sum_{x\in S}\omega_8^{q(x)}DX(e)|x\rangle\\
&= \frac{1}{\sqrt{|S|}}\sum_{x\in S}\omega_8^{q(x)+d(x\mathbin{\oplus}e)}|x\mathbin{\oplus}e\rangle\\
&= \frac{1}{\sqrt{|S|}}\sum_{y\in S\mathbin{\oplus}e}\omega_8^{q(y\mathbin{\oplus}e)+d(y)}|y\rangle. \tag*{(112)}
\end{aligned} E ∣ ψ ⟩ = ∣ S ∣ 1 x ∈ S ∑ ω 8 q ( x ) D X ( e ) ∣ x ⟩ = ∣ S ∣ 1 x ∈ S ∑ ω 8 q ( x ) + d ( x ⊕ e ) ∣ x ⊕ e ⟩ = ∣ S ∣ 1 y ∈ S ⊕ e ∑ ω 8 q ( y ⊕ e ) + d ( y ) ∣ y ⟩ . (112)
Therefore, q ′ ( x ) = q ( x ⊕ e ) + d ( x ) q'(x) = q(x \mathbin{\oplus} e) + d(x) q ′ ( x ) = q ( x ⊕ e ) + d ( x ) on S ⊕ e S \mathbin{\oplus} e S ⊕ e . This is again a third-order phase polynomial by Corollary A.1 and Theorem A.3 , and
Δ m q ′ = d ( x ⊕ m ) − d ( x ) + q ( x ⊕ e ⊕ m ) − q ( x ⊕ e ) = 4 c 0 + Δ m d ( x ) (113) \begin{aligned}
\Delta_m q'
&= d(x\mathbin{\oplus}m)-d(x)+q(x\mathbin{\oplus}e\mathbin{\oplus}m)-q(x\mathbin{\oplus}e) \\
&= 4c_0+\Delta_m d(x) \tag*{(113)}
\end{aligned} Δ m q ′ = d ( x ⊕ m ) − d ( x ) + q ( x ⊕ e ⊕ m ) − q ( x ⊕ e ) = 4 c 0 + Δ m d ( x ) (113)
By Theorem A.4 , we can write Δ m d \Delta_m d Δ m d as
Δ m d ( x ) = 2 r + 4 ℓ ( x ) (114) \Delta_m d(x) = 2r + 4\ell(x) \tag*{(114)} Δ m d ( x ) = 2 r + 4 ℓ ( x ) (114)
where r ∈ Z 4 r \in\mathbb{Z}_4 r ∈ Z 4 is a constant and ℓ : F 2 n → F 2 \ell:\mathbb{F}_2^n\to\mathbb{F}_2 ℓ : F 2 n → F 2 is linear. We therefore have
Δ m q ′ ( x ) = 4 c 0 + 2 r + 4 ℓ ( x ) (115) \Delta_m q'(x) = 4c_0 + 2r + 4\ell(x) \tag*{(115)} Δ m q ′ ( x ) = 4 c 0 + 2 r + 4 ℓ ( x ) (115)
If r r r is even, then f ( x ) = c 0 + r / 2 + ℓ ( x ) f(x) = c_0 + r/2 + \ell(x) f ( x ) = c 0 + r /2 + ℓ ( x ) (mod 2) is affine and Δ m q ′ ( x ) = 4 f ( x ) \Delta_m q'(x) = 4f(x) Δ m q ′ ( x ) = 4 f ( x ) (mod 8), so we are in case (2a). If r r r is odd, write r = 2 t + 1 r = 2t + 1 r = 2 t + 1 and define the affine Boolean function g ( x ) = c 0 + t + ℓ ( x ) g(x) = c_0 + t + \ell(x) g ( x ) = c 0 + t + ℓ ( x ) (mod 2). Then
Δ m q ′ ( x ) = 2 + 4 g ( x ) ( m o d 8 ) . (116) \Delta_m q'(x) = 2 + 4g(x) \pmod8. \tag*{(116)} Δ m q ′ ( x ) = 2 + 4 g ( x ) ( mod 8 ) . (116)
Moreover, 2 g 2g 2 g is a third-order phase polynomial by the parity-sum characterization in Theorem A.1. Hence this is case (2b).
Let us finally identify the resulting state. For a nonzero outcome ϵ = ( − 1 ) s \epsilon= (-1)^s ϵ = ( − 1 ) s , the post-measurement state is proportional to
∑ x ∈ S ⊕ e ω 8 q ′ ( x ) ( 1 + ( − 1 ) s ω 8 Δ m q ′ ( x ) ) ∣ x ⟩ . (117) \sum_{x\in S\mathbin{\oplus}e}\omega_8^{q'(x)}\left(1+(-1)^s\omega_8^{\Delta_m q'(x)}\right)|x\rangle. \tag*{(117)} x ∈ S ⊕ e ∑ ω 8 q ′ ( x ) ( 1 + ( − 1 ) s ω 8 Δ m q ′ ( x ) ) ∣ x ⟩ . (117)
If r r r is even, the factor in parentheses is
1 + ( − 1 ) s + f ( x ) = 21 { f ( x ) = s } . (118) 1+(-1)^{s+f(x)}=2\mathbf{1}_{\{f(x)=s\}}. \tag*{(118)} 1 + ( − 1 ) s + f ( x ) = 2 1 { f ( x ) = s } . (118)
Defining
B s = { x ∈ S : f ( x ⊕ e ) = s } , (119) B_s=\{x\in S:f(x\mathbin{\oplus}e)=s\}, \tag*{(119)} B s = { x ∈ S : f ( x ⊕ e ) = s } , (119)
the resulting state is therefore proportional to E Π B s ∣ ψ ⟩ E\Pi_{B_s}|\psi\rangle E Π B s ∣ ψ ⟩ . Since f f f is affine, B s B_s B s is affine, and we can take E s = E E_s=E E s = E .
If r r r is odd, we instead have
1 + ( − 1 ) s ω 8 2 + 4 g ( x ) = 1 + i ( − 1 ) s ⊕ g ( x ) = 2 ω 8 − 2 ( s ⊕ g ( x ) ) . (120) 1+(-1)^s\omega_8^{2+4g(x)}=1+i(-1)^{s\mathbin{\oplus}g(x)}=\sqrt{2}\omega_8^{-2(s\mathbin{\oplus}g(x))}. \tag*{(120)} 1 + ( − 1 ) s ω 8 2 + 4 g ( x ) = 1 + i ( − 1 ) s ⊕ g ( x ) = 2 ω 8 − 2 ( s ⊕ g ( x )) . (120)
Define the diagonal operator D s D_s D s by
D s ∣ x ⟩ = ω 8 − 2 ( s ⊕ g ( x ) ) ∣ x ⟩ . (121) D_s|x\rangle=\omega_8^{-2(s\mathbin{\oplus}g(x))}|x\rangle. \tag*{(121)} D s ∣ x ⟩ = ω 8 − 2 ( s ⊕ g ( x )) ∣ x ⟩ . (121)
Since s ⊕ g s\mathbin{\oplus}g s ⊕ g is affine, D s D_s D s is diagonal Clifford by Theorem A.3 . The resulting state is therefore proportional to D s E ∣ ψ ⟩ D_sE|\psi\rangle D s E ∣ ψ ⟩ , so we can take E s = D s E E_s=D_sE E s = D s E and B s = S B_s=S B s = S .
Gauge measurements, by contrast, often have random outcomes even in the ideal circuit. A useful compatibility criterion is anticommutation with a current Z Z Z -type stabilizer: this ensures that the measured X X X operator maps the state’s support to a disjoint affine space, giving case (1).
Theorem 6 (Anticommuting Z Z Z constraint). Let ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ a 3PP states such that Z ( z ) ∣ ψ ⟩ = ( − 1 ) c ∣ ψ ⟩ Z(z)|\psi\rangle=(-1)^c|\psi\rangle Z ( z ) ∣ ψ ⟩ = ( − 1 ) c ∣ ψ ⟩ . Then any measurement X ( m ) X(m) X ( m ) anticommuting with Z ( z ) Z(z) Z ( z ) is a compatible case (1).
Proof. We show m ∉ V m\notin V m ∈ / V , by proving that for any v ∈ V v\in V v ∈ V , v ⋅ z = 0 v\cdot z=0 v ⋅ z = 0 , while m ⋅ z = 1 m\cdot z=1 m ⋅ z = 1 by assumption. Developing the stabilizer equation Z ( z ) ∣ ψ ⟩ = ( − 1 ) c ∣ ψ ⟩ Z(z)|\psi\rangle=(-1)^c|\psi\rangle Z ( z ) ∣ ψ ⟩ = ( − 1 ) c ∣ ψ ⟩ gives us:
Z ( z ) ∣ ψ ⟩ = 1 ∣ S ∣ ∑ x ∈ S ω 8 q ( x ) Z ( z ) ∣ x ⟩ = 1 ∣ S ∣ ∑ x ∈ S ( − 1 ) c ω 8 q ( x ) ∣ x ⟩ (122) \begin{aligned}
Z(z)|\psi\rangle
&=\frac{1}{\sqrt{|S|}}\sum_{x\in S}\omega_8^{q(x)}Z(z)|x\rangle\\
&=\frac{1}{\sqrt{|S|}}\sum_{x\in S}(-1)^c\omega_8^{q(x)}|x\rangle \tag*{(122)}
\end{aligned} Z ( z ) ∣ ψ ⟩ = ∣ S ∣ 1 x ∈ S ∑ ω 8 q ( x ) Z ( z ) ∣ x ⟩ = ∣ S ∣ 1 x ∈ S ∑ ( − 1 ) c ω 8 q ( x ) ∣ x ⟩ (122) On the other hand, we have that Z ( z ) ∣ x ⟩ = ( − 1 ) x ⋅ z ∣ x ⟩ Z(z)|x\rangle=(-1)^{x\cdot z}|x\rangle Z ( z ) ∣ x ⟩ = ( − 1 ) x ⋅ z ∣ x ⟩ . Therefore, we must have for every x ∈ S x\in S x ∈ S , x ⋅ z = ( − 1 ) c x\cdot z=(-1)^c x ⋅ z = ( − 1 ) c .
Now, for v ∈ V v\in V v ∈ V , we can write v = x 0 ⊕ ( x 0 ⊕ v ) v=x_0\mathbin{\oplus}(x_0\mathbin{\oplus}v) v = x 0 ⊕ ( x 0 ⊕ v ) , and develop the dot product over the XOR:
v ⋅ z = ( x 0 ⊕ ( x 0 ⊕ v ) ) ⋅ z = ( x 0 ⋅ z ) ⊕ ( ( x 0 ⊕ v ) ⋅ z ) = c ⊕ c = 0 (123) \begin{aligned}
v\cdot z
&=(x_0\mathbin{\oplus}(x_0\mathbin{\oplus}v))\cdot z \\
&=(x_0\cdot z)\mathbin{\oplus}((x_0\mathbin{\oplus}v)\cdot z) \\
&=c\mathbin{\oplus}c \\
&=0 \tag*{(123)}
\end{aligned} v ⋅ z = ( x 0 ⊕ ( x 0 ⊕ v )) ⋅ z = ( x 0 ⋅ z ) ⊕ (( x 0 ⊕ v ) ⋅ z ) = c ⊕ c = 0 (123) since we have both x 0 ∈ S x_0\in S x 0 ∈ S and x 0 ⊕ v ∈ S x_0\mathbin{\oplus}v\in S x 0 ⊕ v ∈ S . Therefore, m ∉ V m\notin V m ∈ / V , and we are in case (1).
These results identify two common mechanisms for compatible measurements. To cover a full noisy protocol, however, we must also account for the changes induced by earlier measurements. We next show that compatibility persists throughout the circuit whenever every ideal X X X measurement is deterministic or case (1).
Circuits with iterative measurements
To extend the preceding results to circuits with repeated measurements, the key is to track each noisy branch as a DCP error acting on an affine restriction of an ideal branch. This form is preserved throughout the circuit and allows us to establish compatibility using only the ideal measurement conditions.
Theorem 7 (Iterative measurements under noise). Consider a 3PP circuit such that every outcome-dependent correction is DCP. Suppose that every ideal X X X measurement is either a compatible case (1) or deterministic. Then arbitrary inserted DCP faults turn the measurements into compatible cases (1), (2a) or (2b). On every nonzero noisy branch, the resulting state after any given measurement has the form
∣ ϕ ⟩ ∝ E Π A ∣ ψ ⟩ , (124) |\phi\rangle\propto E\Pi_A|\psi\rangle, \tag*{(124)} ∣ ϕ ⟩ ∝ E Π A ∣ ψ ⟩ , (124) where E E E is DCP, A ⊆ supp ( ψ ) A \subseteq\operatorname{supp}(\psi) A ⊆ supp ( ψ ) is an affine space, and ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ is a nonzero ideal branch.
Proof. We prove the statement by induction. At the beginning of the circuit, taking E = I E=I E = I and A = supp ( ψ ) A=\operatorname{supp}(\psi) A = supp ( ψ ) gives the correct form for the state.
Let’s now assume that, at a given stage of the circuit, the state has the form of Eq. (124) . We first consider how faults, unitary gates and Z Z Z measurements transform the state, before analyzing X X X measurements.
A DCP fault F F F replaces E E E by F E FE F E . For a CNOT-dihedral gate U U U such that
U ∣ x ⟩ ∝ ∣ f ( x ) ⟩ , (125) U|x\rangle\propto|f(x)\rangle, \tag*{(125)} U ∣ x ⟩ ∝ ∣ f ( x )⟩ , (125)
with f f f an affine function, we have
U E Π A ∣ ψ ⟩ = ( U E U † ) Π f ( A ) U ∣ ψ ⟩ . (126) UE\Pi_A|\psi\rangle=(UEU^\dagger)\Pi_{f(A)}U|\psi\rangle. \tag*{(126)} U E Π A ∣ ψ ⟩ = ( U E U † ) Π f ( A ) U ∣ ψ ⟩ . (126)
Since U U U normalizes the DCP group, since f ( A ) f(A) f ( A ) is affine, and since ∣ ψ ′ ⟩ = U ∣ ψ ⟩ |\psi'\rangle=U|\psi\rangle ∣ ψ ′ ⟩ = U ∣ ψ ⟩ is the ideal state after the unitary, this preserves the required form.
For a measurement of Z ( v ) Z(v) Z ( v ) , Lemma 6 gives Z ( v ) E = ( − 1 ) c E Z ( v ) Z(v)E=(-1)^cEZ(v) Z ( v ) E = ( − 1 ) c E Z ( v ) for some c ∈ F 2 c\in\mathbb{F}_2 c ∈ F 2 . Thus, commuting the measurement projector through E E E changes the outcome label from s s s to s ⊕ c s\oplus c s ⊕ c . By Eq. (22) , this measurement restricts the support to the affine hyperplane
H = { x ∈ F 2 n : ⟨ v , x ⟩ = s ⊕ c } . (127) H=\{x\in\mathbb{F}_2^n:\langle v,x\rangle=s\oplus c\}. \tag*{(127)} H = { x ∈ F 2 n : ⟨ v , x ⟩ = s ⊕ c } . (127)
The resulting state is therefore proportional to
E Π H Π A ∣ ψ ⟩ = E Π A Π H ∣ ψ ⟩ = E Π A Π H Π H ∣ ψ ⟩ = E Π A ∩ H Π H ∣ ψ ⟩ . (128) E\Pi_H\Pi_A|\psi\rangle=E\Pi_A\Pi_H|\psi\rangle
=E\Pi_A\Pi_H\Pi_H|\psi\rangle
=E\Pi_{A\cap H}\Pi_H|\psi\rangle. \tag*{(128)} E Π H Π A ∣ ψ ⟩ = E Π A Π H ∣ ψ ⟩ = E Π A Π H Π H ∣ ψ ⟩ = E Π A ∩ H Π H ∣ ψ ⟩ . (128)
We take the new ideal reference branch to be ∣ ψ ′ ⟩ ∝ Π H ∣ ψ ⟩ |\psi'\rangle\propto\Pi_H|\psi\rangle ∣ ψ ′ ⟩ ∝ Π H ∣ ψ ⟩ . It is a valid ideal branch, since it corresponds to measuring the previous ideal state ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ and taking the shifted outcome s ⊕ c s\oplus c s ⊕ c , which has nonzero probability of occurring (otherwise, the noisy output would also be zero). Moreover, A ∩ H A\cap H A ∩ H is affine and contained in supp ( ψ ′ ) \operatorname{supp}(\psi') supp ( ψ ′ ) . Thus, the required form is preserved.
Let us now consider a measurement of X ( m ) X(m) X ( m ) with outcome ϵ = ( − 1 ) s \epsilon=(-1)^s ϵ = ( − 1 ) s , and write
P s = I + ( − 1 ) s X ( m ) 2 , (129) P_s=\frac{I+(-1)^sX(m)}{2}, \tag*{(129)} P s = 2 I + ( − 1 ) s X ( m ) , (129)
as well as supp ( ψ ) = x 0 + V \operatorname{supp}(\psi)=x_0+V supp ( ψ ) = x 0 + V and A = a + W A=a+W A = a + W . By the induction hypothesis, ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ is an ideal branch. The measurement on ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ is therefore case (1) or deterministic by assumption. Suppose first that the ideal measurement is deterministic, and that m ∈ W m\in W m ∈ W . Then, A ⊕ m = A A\oplus m=A A ⊕ m = A and we have
[ X ( m ) , Π A ] = 0. (130) [X(m),\Pi_A]=0. \tag*{(130)} [ X ( m ) , Π A ] = 0. (130)
Therefore, if X ( m ) ∣ ψ ⟩ = ( − 1 ) c 0 ∣ ψ ⟩ X(m)|\psi\rangle=(-1)^{c_0}|\psi\rangle X ( m ) ∣ ψ ⟩ = ( − 1 ) c 0 ∣ ψ ⟩ , then
X ( m ) Π A ∣ ψ ⟩ = ( − 1 ) c 0 Π A ∣ ψ ⟩ . (131) X(m)\Pi_A|\psi\rangle=(-1)^{c_0}\Pi_A|\psi\rangle. \tag*{(131)} X ( m ) Π A ∣ ψ ⟩ = ( − 1 ) c 0 Π A ∣ ψ ⟩ . (131)
The normalized restricted state ∣ χ ⟩ ∝ Π A ∣ ψ ⟩ |\chi\rangle\propto\Pi_A|\psi\rangle ∣ χ ⟩ ∝ Π A ∣ ψ ⟩ is a 3PP state, so Theorem 5 gives
P s E ∣ χ ⟩ ∝ E s Π B ∣ χ ⟩ ∝ E s Π B ∣ ψ ⟩ , (132) P_sE|\chi\rangle\propto E_s\Pi_B|\chi\rangle\propto E_s\Pi_B|\psi\rangle, \tag*{(132)} P s E ∣ χ ⟩ ∝ E s Π B ∣ χ ⟩ ∝ E s Π B ∣ ψ ⟩ , (132)
where E s E_s E s is DCP and B ⊆ A B\subseteq A B ⊆ A is affine. We used the fact that Π B Π A = Π B \Pi_B\Pi_A=\Pi_B Π B Π A = Π B (since B ⊆ A B\subseteq A B ⊆ A ). This preserves the required form, and the noisy measurement is case (2a) or (2b).
It remains to consider an ideal case (1) measurement, or an ideal deterministic measurement with m ∉ W m\notin W m ∈ / W . In the first situation, m ∉ V m\notin V m ∈ / V implies m ∉ W m\notin W m ∈ / W , since W ⊆ V W\subseteq V W ⊆ V ; in the second, this holds by assumption. Since supp ( Π A ∣ ψ ⟩ ) = A = a + W \operatorname{supp}(\Pi_A|\psi\rangle)=A=a+W supp ( Π A ∣ ψ ⟩) = A = a + W , and the DCP operator E E E can only translate the support by a constant vector, it means that supp ( E Π A ∣ ψ ⟩ ) = a ′ + W \operatorname{supp}(E\Pi_A|\psi\rangle)=a'+W supp ( E Π A ∣ ψ ⟩) = a ′ + W and m ∉ W m\notin W m ∈ / W implies that the measurement is case (1).
To identify the resulting state, write E = ω 8 k X ( e ) D E=\omega_8^kX(e)D E = ω 8 k X ( e ) D , where D D D is diagonal Clifford. Since X ( e ) X(e) X ( e ) commutes with P s P_s P s , we have
P s E Π A ∣ ψ ⟩ ∝ X ( e ) P s D Π A ∣ ψ ⟩ . (133) P_sE\Pi_A|\psi\rangle\propto X(e)P_sD\Pi_A|\psi\rangle. \tag*{(133)} P s E Π A ∣ ψ ⟩ ∝ X ( e ) P s D Π A ∣ ψ ⟩ . (133)
We therefore first calculate P s D Π A ∣ ψ ⟩ P_sD\Pi_A|\psi\rangle P s D Π A ∣ ψ ⟩ . Writing the phases of ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ and D D D as q q q and d d d , respectively, gives
P s D Π A ∣ ψ ⟩ ∝ ∑ x ∈ A ω 8 q ( x ) + d ( x ) ( ∣ x ⟩ + ( − 1 ) s ∣ x ⊕ m ⟩ ) . (134) P_sD\Pi_A|\psi\rangle\propto\sum_{x\in A}\omega_8^{q(x)+d(x)}\left(|x\rangle+(-1)^s|x\oplus m\rangle\right). \tag*{(134)} P s D Π A ∣ ψ ⟩ ∝ x ∈ A ∑ ω 8 q ( x ) + d ( x ) ( ∣ x ⟩ + ( − 1 ) s ∣ x ⊕ m ⟩ ) . (134)
Its support is the affine set
A ′ = A + ⟨ m ⟩ . (135) A'=A+\langle m\rangle. \tag*{(135)} A ′ = A + ⟨ m ⟩ . (135)
Every y ∈ A ′ y\in A' y ∈ A ′ has a unique expression y = x ⊕ t m y=x\oplus tm y = x ⊕ t m , where x ∈ A x\in A x ∈ A and t ∈ F 2 t\in\mathbb{F}_2 t ∈ F 2 . Moreover, t t t is an affine function of y y y : choose a linear functional λ \lambda λ such that λ ( W ) = 0 \lambda(W)=0 λ ( W ) = 0 and λ ( m ) = 1 \lambda(m)=1 λ ( m ) = 1 . We can then set t ( y ) = λ ( y ⊕ a ) t(y)=\lambda(y\oplus a) t ( y ) = λ ( y ⊕ a ) . Indeed, writing y = a ⊕ w ⊕ t m y=a\oplus w\oplus tm y = a ⊕ w ⊕ t m , we get
λ ( y ⊕ a ) = λ ( w ⊕ t m ) = λ ( w ) ⊕ t λ ( m ) = t . (136) \lambda(y\oplus a)=\lambda(w\oplus tm)=\lambda(w)\oplus t\lambda(m)=t. \tag*{(136)} λ ( y ⊕ a ) = λ ( w ⊕ t m ) = λ ( w ) ⊕ t λ ( m ) = t . (136)
The phase of the noisy output at y y y is therefore
q ( x ) + d ( x ) + 4 s t . (137) q(x) + d(x) + 4st. \tag*{(137)} q ( x ) + d ( x ) + 4 s t . (137)
Let us compare this with an ideal reference output. If the ideal measurement is case (1), choose either outcome ( − 1 ) s 0 (-1)^{s_0} ( − 1 ) s 0 and take ∣ ψ ′ ⟩ ∝ P s 0 ∣ ψ ⟩ |\psi'\rangle\propto P_{s_0}|\psi\rangle ∣ ψ ′ ⟩ ∝ P s 0 ∣ ψ ⟩ . If the ideal measurement is deterministic, take s 0 = c 0 s_0 = c_0 s 0 = c 0 and ∣ ψ ′ ⟩ = ∣ ψ ⟩ |\psi'\rangle= |\psi\rangle ∣ ψ ′ ⟩ = ∣ ψ ⟩ .
Let us now show that the output state has the form
P s E Π A ∣ ψ ⟩ ∝ X ( e ) D ′ Π A ′ ∣ ψ ′ ⟩ (138) P_s E\Pi_A|\psi\rangle\propto X(e)D'\Pi_{A'}|\psi'\rangle \tag*{(138)} P s E Π A ∣ ψ ⟩ ∝ X ( e ) D ′ Π A ′ ∣ ψ ′ ⟩ (138)
for D ′ D' D ′ a diagonal Clifford operator that we will determine, and A ′ ⊆ supp ( ψ ′ ) A' \subseteq\operatorname{supp}(\psi') A ′ ⊆ supp ( ψ ′ ) . This last inclusion is true, since in the ideal case (1), the reference output has support S + ⟨ m ⟩ S + \langle m\rangle S + ⟨ m ⟩ , which contains A ′ = A + ⟨ m ⟩ A' = A + \langle m\rangle A ′ = A + ⟨ m ⟩ because A ⊆ S A \subseteq S A ⊆ S . In the ideal deterministic case, ∣ ψ ′ ⟩ = ∣ ψ ⟩ |\psi'\rangle= |\psi\rangle ∣ ψ ′ ⟩ = ∣ ψ ⟩ and m ∈ V m \in V m ∈ V , so A ′ ⊆ S + ⟨ m ⟩ = S = supp ( ψ ′ ) A' \subseteq S + \langle m\rangle= S = \operatorname{supp}(\psi') A ′ ⊆ S + ⟨ m ⟩ = S = supp ( ψ ′ ) .
To construct D ′ D' D ′ , let us understand the phases of ∣ ψ ′ ⟩ |\psi'\rangle ∣ ψ ′ ⟩ , and compare them to the phases of the output state. If the ideal measurement case is (1), the phase of ∣ ψ ′ ⟩ |\psi'\rangle ∣ ψ ′ ⟩ at y = x ⊕ t m y = x \oplus tm y = x ⊕ t m is q ( x ) + 4 s 0 t q(x) + 4s_0t q ( x ) + 4 s 0 t . If the ideal measurement is deterministic, with outcome c 0 c_0 c 0 , it can only be a case (2a) with Δ m q = 4 c 0 \Delta_m q = 4c_0 Δ m q = 4 c 0 . The relation
q ( x ⊕ m ) = q ( x ) + 4 c 0 (139) q(x \oplus m) = q(x) + 4c_0 \tag*{(139)} q ( x ⊕ m ) = q ( x ) + 4 c 0 (139)
then shows that its phase at y y y is again q ( x ) + 4 s 0 t q(x) + 4s_0t q ( x ) + 4 s 0 t .
The phase difference between the noisy output and this reference state is consequently
d ′ ( y ) = d ( x ) + 4 ( s ⊕ s 0 ) t . (140) d'(y) = d(x) + 4(s \oplus s_0)t. \tag*{(140)} d ′ ( y ) = d ( x ) + 4 ( s ⊕ s 0 ) t . (140)
To show that this defines a diagonal Clifford operator, we express it in terms of y y y . Since x = y ⊕ t m x = y \oplus tm x = y ⊕ t m , we get
d ′ ( y ) = d ( y ⊕ t m ) + 4 ( s ⊕ s 0 ) t = d ( y ) + t Δ m d ( y ) + 4 ( s ⊕ s 0 ) t . (141) \begin{aligned}
d'(y) &= d(y \oplus tm) + 4(s \oplus s_0)t \\
&= d(y) + t\Delta_m d(y) + 4(s \oplus s_0)t. \tag*{(141)}
\end{aligned} d ′ ( y ) = d ( y ⊕ t m ) + 4 ( s ⊕ s 0 ) t = d ( y ) + t Δ m d ( y ) + 4 ( s ⊕ s 0 ) t . (141)
By Theorem A.4 , we can write Δ m d ( y ) = 2 r + 4 ℓ ( y ) \Delta_m d(y) = 2r + 4\ell(y) Δ m d ( y ) = 2 r + 4 ℓ ( y ) , where ℓ \ell ℓ is linear. Thus,
d ′ ( y ) = d ( y ) + 2 r t + 4 t ℓ ( y ) + 4 ( s ⊕ s 0 ) t ( m o d 8 ) . (142) d'(y) = d(y) + 2rt + 4t\ell(y) + 4(s \oplus s_0)t \pmod{8}. \tag*{(142)} d ′ ( y ) = d ( y ) + 2 r t + 4 t ℓ ( y ) + 4 ( s ⊕ s 0 ) t ( mod 8 ) . (142)
Since t t t is affine, this is a Clifford phase polynomial. Letting D ′ D' D ′ be the corresponding diagonal Clifford operator, we obtain
P s E Π A ∣ ψ ⟩ ∝ X ( e ) D ′ Π A ′ ∣ ψ ′ ⟩ . (143) P_s E\Pi_A|\psi\rangle\propto X(e)D'\Pi_{A'}|\psi'\rangle. \tag*{(143)} P s E Π A ∣ ψ ⟩ ∝ X ( e ) D ′ Π A ′ ∣ ψ ′ ⟩ . (143)
This preserves the required form.
Finally, we consider an outcome-dependent DCP correction. Let C n C_n C n and C i C_i C i be the corrections selected by the noisy record and the ideal reference record, respectively. Then
C n E Π A ∣ ψ ⟩ = ( C n E C i † ) ( C i Π A C i † ) C i ∣ ψ ⟩ . (144) C_nE\Pi_A|\psi\rangle= (C_nEC_i^\dagger)(C_i\Pi_A C_i^\dagger)C_i|\psi\rangle. \tag*{(144)} C n E Π A ∣ ψ ⟩ = ( C n E C i † ) ( C i Π A C i † ) C i ∣ ψ ⟩ . (144)
The first factor is DCP. Since C i C_i C i translates computational-basis labels by a fixed vector, the second factor is the projector onto the corresponding affine translate of A A A , which lies within supp ( C i ψ ) \operatorname{supp}(C_i\psi) supp ( C i ψ ) . Moreover, C i ∣ ψ ⟩ C_i|\psi\rangle C i ∣ ψ ⟩ is the ideal branch after its prescribed correction. Thus, outcome-dependent DCP corrections preserve the induction invariant.
Every noisy X X X measurement is therefore case (1), (2a) or (2b).
To apply this theorem, it therefore suffices to verify that every ideal X X X measurement is deterministic or case (1), for example by identifying an anticommuting Z Z Z -type stabilizer. No separate compatibility analysis is needed for each noisy branch. The restriction on feedforward is essential: the theorem allows outcome-dependent DCP corrections, but does not assert noise robustness for arbitrary adaptive choices of CNOT-dihedral gates or measured observables.
We now illustrate this criterion in several quantum error-correction protocols.
Examples
We now apply the preceding results to several classes of quantum error correction circuits.
Magic state distillation and non-Clifford computation
Logical CNOT-dihedral gates implemented by physical CNOT-dihedral circuits, interleaved with CSS stabilizer checks, directly satisfy the hypotheses of Theorem 7: each ideal gate preserves the code space, so the subsequent checks are deterministic. This covers magic state distillation based on (generalized) triorthogonal codes, including transversal and quasitransversal constructions with diagonal Clifford corrections [3 , 4 , 18 , 23 , 55 , 56 ] [2]. It also covers Litinski’s reformulation of these protocols as sequences of Z Z Z -type π / 8 \pi/8 π /8 rotations followed by X X X readouts [5 ] , since these rotations are CNOT-dihedral and the syndrome readouts are ideally deterministic. The same argument applies to recent code constructions supporting logical non-Clifford gates through constant-depth physical circuits of Z Z Z , C Z CZ C Z , and C C Z CCZ C C Z gates, including algebraic geometry constructions [13 , 14 , 15 , 17 , 20 , 21 , 23 ] and quantum LDPC constructions based on cup products [43 , 57 , 58 , 59 , 60 ] . These gates can be used either for magic state preparation or for direct non-Clifford computation; in both settings, subsequent CSS stabilizer checks are ideally deterministic, so Theorem 7 applies.
Clifford checks, cultivation, and non-Pauli codes
The preceding examples rely on Pauli stabilizer checks that are deterministic in the ideal circuit. More generally, checking non-Pauli Clifford observables provides a way to detect errors in magic states, as exploited in distillation protocols based on measuring Clifford checks [56 , 61 , 62 , 63 , 64 ] and magic state cultivation [6 , 7 , 65 ] . We now show how that the same deterministic-check argument extends to DCP observables.
Let M M M be a Hermitian DCP operator satisfying M 2 = I M^2 = I M 2 = I , and suppose M ∣ ψ ⟩ = ϵ 0 ∣ ψ ⟩ M|\psi\rangle= \epsilon_0|\psi\rangle M ∣ ψ ⟩ = ϵ 0 ∣ ψ ⟩ . Preparing an ancilla in ∣ + ⟩ |+\rangle ∣ + ⟩ and applying controlled-M M M gives
∣ 0 ⟩ ∣ ψ ⟩ + ∣ 1 ⟩ M ∣ ψ ⟩ 2 = ∣ 0 ⟩ + ϵ 0 ∣ 1 ⟩ 2 ⊗ ∣ ψ ⟩ , (145) \frac{|0\rangle|\psi\rangle+ |1\rangle M|\psi\rangle}{\sqrt{2}} = \frac{|0\rangle+ \epsilon_0|1\rangle}{\sqrt{2}} \otimes|\psi\rangle, \tag*{(145)} 2 ∣0 ⟩ ∣ ψ ⟩ + ∣1 ⟩ M ∣ ψ ⟩ = 2 ∣0 ⟩ + ϵ 0 ∣1 ⟩ ⊗ ∣ ψ ⟩ , (145)
so the ancilla’s X X X readout is deterministic. Moreover, controlled-M M M admits a CNOT-dihedral realization: controlling X X X , S S S , and C Z CZ C Z gives CNOT, CS, and CCZ, respectively, while controlling an eighth-root global phase gives a power of T T T . Thus, sequences of such ideally deterministic checks satisfy Theorem 7.
For example, the magic state ∣ T ⟩ = T ∣ + ⟩ |T\rangle= T|+\rangle ∣ T ⟩ = T ∣ + ⟩ satisfies W T ∣ T ⟩ = ∣ T ⟩ W_T|T\rangle= |T\rangle W T ∣ T ⟩ = ∣ T ⟩ with
W T = T X T † = X + Y 2 = ω 8 − 1 S X . (146) W_T = TXT^\dagger= \frac{X + Y}{\sqrt{2}} = \omega_8^{-1}SX. \tag*{(146)} W T = T X T † = 2 X + Y = ω 8 − 1 S X . (146)
A controlled-W T W_T W T circuit therefore checks a deterministic Clifford observable. Similarly, the ∣ C C Z ⟩ |CCZ\rangle ∣ C C Z ⟩ state is stabilized by the DCP operators X 1 C Z 23 X_1CZ_{23} X 1 C Z 23 and their permutations. The same reasoning applies to encoded checks whenever their physical implementations have the controlled-DCP form above. This provides a compatibility certificate for such checks in distillation and cultivation, while preparation, growth, and any additional resource-consumption measurements must also satisfy the compatibility conditions.
The argument also applies to syndrome extraction in non-Pauli codes whose stabilizers are Hermitian DCP operators, such as products of X X X operators decorated with C Z CZ C Z gates. These checks are deterministic on ideal code states, even when the stabilizer generators do not commute on the full Hilbert space. Such codes underlie recent protocols for direct non-Clifford computation in two dimensions [59 ] , including syndrome-extraction circuits with just-in-time decoding [43 , 57 , 59 ] .
Not every Clifford-check implementation has this form. In particular, distillation and cultivation protocols using controlled-Hadamard or controlled-SWAP operations [61 , 62 , 63 , 65 ] are not directly covered by the argument above. A change of basis or an alternative implementation may bring a check into DCP form, but compatibility must then be established for the entire transformed circuit.
Gauge fixing, code switching, and teleportation
Consider a CSS subsystem code whose stabilizer eigenvalues are fixed. Measuring a complete set of independent Z Z Z -type gauge operators fixes the gauge qubits in a Z Z Z basis. Each subsequent X X X -type gauge measurement either anticommutes with a currently fixed Z Z Z -type gauge operator, making it a compatible case (1), or has an outcome determined by the stabilizers and earlier X X X -type gauge measurements.
measurements. Thus, successive rounds of Z Z Z - and X X X -type gauge measurements satisfy Theorem 7, establishing compatibility under DCP faults.
The same reasoning applies to CSS gauge fixing used in code switching [9 ] and lattice surgery [66 ] : newly measured X X X -type checks are compatible whenever they anticommute with a current Z Z Z constraint or are already fixed. For example, a lattice-surgery measurement of X ‾ A X ‾ B \overline{X}_A\overline{X}_B X A X B is case (1) whenever block B B B is initialized in ∣ 0 ⟩ L |0\rangle_L ∣0 ⟩ L , since the measured operator anticommutes with the fixed constraint Z ‾ B = + 1 \overline{Z}_B = +1 Z B = + 1 .
State injection provides another simple application. To inject a T T T gate into a 3PP state ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ , prepare an ancilla in ∣ T ⟩ = T ∣ + ⟩ |T\rangle= T|+\rangle ∣ T ⟩ = T ∣ + ⟩ , apply a CNOT from the data to the ancilla, and measure the ancilla in the Z Z Z basis. For outcome s ∈ { 0 , 1 } s \in\{0,1\} s ∈ { 0 , 1 } , the data state is, up to global phase,
∣ ψ s ⟩ = { T ∣ ψ ⟩ , s = 0 , T † ∣ ψ ⟩ , s = 1. (147) |\psi_s\rangle=
\begin{cases}
T|\psi\rangle, & s = 0,\\
T^\dagger|\psi\rangle, & s = 1.
\end{cases} \tag*{(147)} ∣ ψ s ⟩ = { T ∣ ψ ⟩ , T † ∣ ψ ⟩ , s = 0 , s = 1. (147)
Applying the correction S s S^s S s therefore yields T ∣ ψ ⟩ T|\psi\rangle T ∣ ψ ⟩ in both branches. The entire gadget uses only a 3PP ancilla, a CNOT, a Z Z Z measurement, and a diagonal Clifford correction, so it preserves the 3PP representation under DCP faults. Encoded implementations using lattice surgery additionally require checking the compatibility of the physical measurements realizing the logical operations.
Cat-state syndrome extraction
The physical readouts of a deterministic check can have non-deterministic intermediate measurements, as is the case for instance in Shor’s style syndrome extraction [67 , 68 ] . Consider measuring a weight-w w w X X X stabilizer using
∣ c a t w ⟩ = ∣ 0 ⟩ ⊗ w + ∣ 1 ⟩ ⊗ w 2 , (148) |\mathrm{cat}_w\rangle= \frac{|0\rangle^{\otimes w} + |1\rangle^{\otimes w}}{\sqrt{2}}, \tag*{(148)} ∣ cat w ⟩ = 2 ∣0 ⟩ ⊗ w + ∣1 ⟩ ⊗ w , (148)
with each cat qubit controlling the corresponding X X X stabilizer measurement, followed by individual X X X readouts of the cat.
The coupling preserves the cat’s Z i Z j Z_iZ_j Z i Z j constraints. Before each of the first w − 1 w-1 w − 1 readouts, a constraint Z i Z j Z_iZ_j Z i Z j involving the measured qubit and an unread qubit therefore certifies case (1). The product of all readout signs equals the measured syndrome. On an ideal code state, this syndrome is fixed, so the final readout is deterministic conditional on the preceding outcomes. Theorem 7 consequently covers noisy cat-state extraction, even though most individual ancilla outcomes are random.
Benchmarking results
We provide an open-source implementation of our simulator, which we call merlin [30 ] . In this section, we benchmark merlin against existing non-Clifford simulation libraries on a range of magic-state preparation circuits. OOM: Simulator tried to allocate more than 20GB of memory. ERR: Simulator failed with a runtime error.
Table 1. Simulation time for 1000 attempted shots of the 15-to-1 magic state distillation [2], magic state cultivation without the escape stage [6 ] and the code switching protocol from Ref. [16 ] .
Concretely, we compare against Tsim [24 ] , Clifft [25 ] , SymFT [27 ] , and Xtim [28 ] . All benchmarks use a noise parameter p = 10 − 3 p=10^{-3} p = 1 0 − 3 and 1000 attempted shots per circuit. The cultivation benchmarks exclude the escape stage.
While these simulators each use different representations and algorithms, they are all particularly effective when the number of non-stabilizer degrees of freedom remains small. This is a favorable regime for many existing magic-state preparation protocols. At the logical level, the target states often only represent a small number of magic states k k k , with k = 1 k=1 k = 1 being especially simple. These simulators exploit the fact that this simplicity can persist after the protocol is expanded into a noisy physical circuit. However, their cost can increase rapidly as the amount of logical magic grows. In contrast, our approach does not require k k k to remain fixed or small. Our state representation and update rules have polynomial complexity in the physical system size and circuit size, and therefore introduce no exponential dependence on the number of logical magic states k k k .
Figure 2 illustrates this difference using the Bravyi-Haah 3 k + 8 3k+8 3 k + 8 to k k k magic state distillation protocol [3 ] for increasing numbers of logical output magic states k k k . The other simulators exhibit exponentially increasing runtime and/or memory consumption as k k k grows, consistent with the growth of the non-stabilizer representation that they maintain. In contrast, the runtime and memory consumption of merlin grow smoothly with k k k , reflecting the polynomial scaling of our representation.
Figure 2. Comparison of different simulators for 1000 attempted shots of the Bravyi-Haah 3 k + 8 3k+8 3 k + 8 to k k k magic state distillation protocol [3 ] for increasing numbers of logical qubits k k k . (a) Total runtime, including pre-processing. (b) Average time per shot, excluding pre-processing. (c) Peak memory consumption.
Table I reports results for the 15-to-1 magic state distillation [2], magic-state cultivation [6 ] and the code switching protocol for C C Z CCZ C C Z magic states introduced in Ref. [16 ] . The distillation and cultivation circuits have previously been used as benchmark cases for non-Clifford simulators [25 , 27 , 28 ] . They each prepare a single logical magic state and therefore lie in the k = 1 k=1 k = 1 regime, where Xtim, Clifft, and SymFT achieve substantially lower per-shot runtimes than merlin. For the code switching benchmarks, we use the [ [ 27 , 3 , 3 ] ] [\![27, 3, 3]\!] [ [ 27 , 3 , 3 ] ] and [ [ 81 , 3 , 5 ] ] [\![81, 3, 5]\!] [ [ 81 , 3 , 5 ] ] BT code constructions of [16 ] which both encode k = 3 k=3 k = 3 logical qubits. On these circuits, the other simulators’ techniques to keep their non-stabilizer representations compact appear to be less effective. Only Xtim completes the distance-3 simulation, while all other simulator-circuit combinations run out of memory or fail with a runtime error.
These examples highlight the complementary regime targeted by our approach: while specialized methods can have smaller constant factors when the effective non-stabilizer representation remains small, merlin can handle circuits for which such representations cannot be found or become prohibitively large.
Universal simulation
To simulate circuits that leave the DCP state class, we represent the evolving state as a linear combination of DCP states. The analogous construction using Pauli stabilizer states is quantified by stabilizer rank.
Definition 14 (Stabiliser rank [31 ] ). The stabilizer rank χ ( ψ ) \chi(\psi) χ ( ψ ) of a state ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ is the smallest integer χ \chi χ such that ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ can be written as a linear combination ∣ ψ ⟩ = ∑ i = 1 χ c i ∣ φ i ⟩ |\psi\rangle= \sum_{i=1}^{\chi} c_i|\varphi_i\rangle ∣ ψ ⟩ = ∑ i = 1 χ c i ∣ φ i ⟩ of stabiliser states ∣ φ i ⟩ |\varphi_i\rangle ∣ φ i ⟩ with complex coefficients c i c_i c i .
The notion of stabiliser rank easily generalises to DCP rank :
Definition 15 (DCP rank). The DCP rank ζ ( ψ ) \zeta(\psi) ζ ( ψ ) of a state ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ is the smallest integer ζ \zeta ζ such that ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ can be written as a linear combination ∣ ψ ⟩ = ∑ i = 1 ζ c i ∣ φ i ⟩ |\psi\rangle= \sum_{i=1}^{\zeta} c_i|\varphi_i\rangle ∣ ψ ⟩ = ∑ i = 1 ζ c i ∣ φ i ⟩ of DCP states ∣ φ i ⟩ |\varphi_i\rangle ∣ φ i ⟩ with complex coefficients c i c_i c i .
Since stabiliser states are DCP states, we trivially have ζ ( ψ ) ≤ χ ( ψ ) \zeta(\psi) \leq\chi(\psi) ζ ( ψ ) ≤ χ ( ψ ) . Furthermore, if ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ is prepared by a CNOT + T + H +T+H + T + H circuit with h h h Hadamards, then we trivially have ζ ( ψ ) ≤ 2 h \zeta(\psi) \leq2^h ζ ( ψ ) ≤ 2 h . This is because each Hadamard gate can be decomposed into H = ( X + Z ) / 2 H=(X+Z)/\sqrt{2} H = ( X + Z ) / 2 , leaving only gates that preserve DCP states. In general, we expect ζ \zeta ζ to scale exponentially, however there might be decomposition strategies that achieve better scaling than this naive approach. We leave it to future work to investigate this question and improve upon the bounds given here.
Given an explicit decomposition
∣ ψ ⟩ = ∑ j = 1 R c j ∣ φ j ⟩ (149) |\psi\rangle= \sum_{j=1}^{R}c_j|\varphi_j\rangle \tag*{(149)} ∣ ψ ⟩ = j = 1 ∑ R c j ∣ φ j ⟩ (149)
into DCP states, we can compute any computational-basis amplitude by evaluating the amplitude of each term and summing the contributions. By Theorem 2, this requires O ( n 3 R ) O(n^3R) O ( n 3 R ) arithmetic operations. Here R R R denotes the number of terms in the supplied decomposition, which need not achieve the minimum DCP rank ζ ( ψ ) \zeta(\psi) ζ ( ψ ) . The cost of constructing the decomposition must also be accounted for. Throughout, the global-phase convention of each DCP term must be tracked consistently with its coefficient c j c_j c j . Weak simulation, that is, sampling computational-basis outcomes, requires an additional argument. Computing marginal probabilities directly introduces R 2 R^2 R 2 cross terms involving overlaps of projected DCP states, which our polynomial-time algorithms do not generally evaluate. Several approaches have been proposed in the stabilizer-decomposition literature to avoid or mitigate analogous difficulties. For example, Refs. [31 , 32 ] approximate marginal probabilities via a norm estimation technique based on overlaps with carefully chosen random stabiliser states. Ref. [32 ] also proposed a Metropolis-Hastings Markov Chain Monte Carlo method for approximate sampling. Finally, Bravyi and Liu [69 ] introduced the gate-by-gate algorithm for exact sampling without computing marginals. The gate-by-gate algorithm applies directly because it requires only computational-basis amplitudes of circuit prefixes. We describe this construction below.
Suppose ∣ ψ ⟩ = C ∣ 0 ⟩ |\psi\rangle= C|0\rangle ∣ ψ ⟩ = C ∣0 ⟩ is prepared by some CNOT + T + H +T+H + T + H circuit C = U m ⋯ U 1 C=U_m\cdots U_1 C = U m ⋯ U 1 made up of gates U i U_i U i . Our goal is to sample from the distribution P ( x ) : = ∣ ⟨ x ∣ C ∣ 0 ⟩ ∣ 2 P(x) := |\langle x|C|0\rangle|^2 P ( x ) := ∣ ⟨ x ∣ C ∣0 ⟩ ∣ 2 . Let C k = U k ⋯ U 1 C_k=U_k\cdots U_1 C k = U k ⋯ U 1 be the subcircuit containing only the first k k k gates and define the output distribution at time step k k k as P k ( x ) : = ∣ ⟨ x ∣ C k ∣ 0 ⟩ ∣ 2 P_k(x) := |\langle x|C_k|0\rangle|^2 P k ( x ) := ∣ ⟨ x ∣ C k ∣0 ⟩ ∣ 2 . The idea behind gate-by-gate sampling is to start with a sample from the trivial distribution P 0 P_0 P 0 (i.e. the all-zero bitstring) and update it one gate at a time until we arrive at a sample that is distributed according to P m = P P_m=P P m = P . This is because adjacent distributions P k − 1 P_{k-1} P k − 1 and P k P_k P k are closely related since they only differ by a single gate U k U_k U k . Suppose U k U_k U k is a T T T gate on qubit i i i , then
P k ( x ) = ∣ ⟨ x ∣ T i C k − 1 ∣ 0 ⟩ ∣ 2 = ∣ ⟨ x ∣ C k − 1 ∣ 0 ⟩ ∣ 2 = P k − 1 ( x ) , P_k(x)=|\langle x|T_iC_{k-1}|0\rangle|^2=|\langle x|C_{k-1}|0\rangle|^2=P_{k-1}(x), P k ( x ) = ∣ ⟨ x ∣ T i C k − 1 ∣0 ⟩ ∣ 2 = ∣ ⟨ x ∣ C k − 1 ∣0 ⟩ ∣ 2 = P k − 1 ( x ) ,
i.e. the distribution stays the same. For a CNOT between qubits i i i and j j j we have
P k ( x ) = ∣ ⟨ x ∣ CNOT i j C k − 1 ∣ 0 ⟩ ∣ 2 = ∣ ⟨ x ⊕ x i e j ∣ C k − 1 ∣ 0 ⟩ ∣ 2 = P k − 1 ( x ⊕ x i e j ) , (150) \begin{aligned}
P_k(x)&=|\langle x|\operatorname{CNOT}_{ij}C_{k-1}|0\rangle|^2\\
&=|\langle x\oplus x_i e_j|C_{k-1}|0\rangle|^2\\
&=P_{k-1}(x\oplus x_i e_j), \tag*{(150)}
\end{aligned} P k ( x ) = ∣ ⟨ x ∣ CNOT ij C k − 1 ∣0 ⟩ ∣ 2 = ∣ ⟨ x ⊕ x i e j ∣ C k − 1 ∣0 ⟩ ∣ 2 = P k − 1 ( x ⊕ x i e j ) , (150)
so a sample x ∼ P k − 1 x\sim P_{k-1} x ∼ P k − 1 can be updated to x ′ = x ⊕ x i e j ∼ P k x'=x\oplus x_i e_j\sim P_k x ′ = x ⊕ x i e j ∼ P k . Applying a Hadamard on the other hand will require some more work. Without loss of generality, suppose U k U_k U k is a Hadamard on the first qubit. Writing y = ( x 2 , … , x n ) y=(x_2,\ldots,x_n) y = ( x 2 , … , x n ) , we have
P k ( x 1 , y ) = P k ( x 1 ∣ y ) P k ( y ) (151) P_k(x_1,y)=P_k(x_1\mid y)P_k(y) \tag*{(151)} P k ( x 1 , y ) = P k ( x 1 ∣ y ) P k ( y ) (151)
= P k ( x 1 ∣ y ) P k − 1 ( y ) (152) =P_k(x_1\mid y)P_{k-1}(y) \tag*{(152)} = P k ( x 1 ∣ y ) P k − 1 ( y ) (152)
= P k ( x 1 , y ) P k ( 0 , y ) + P k ( 1 , y ) P k − 1 ( y ) , (153) =\frac{P_k(x_1,y)}{P_k(0,y)+P_k(1,y)}P_{k-1}(y), \tag*{(153)} = P k ( 0 , y ) + P k ( 1 , y ) P k ( x 1 , y ) P k − 1 ( y ) , (153)
whenever P k − 1 ( y ) > 0 P_{k-1}(y)>0 P k − 1 ( y ) > 0 . Here P k ( y ) = P k − 1 ( y ) P_k(y)=P_{k-1}(y) P k ( y ) = P k − 1 ( y ) because the Hadamard acts only on the first qubit.
Thus, given a sample ( x 1 , y ) ∼ P k − 1 (x_1,y)\sim P_{k-1} ( x 1 , y ) ∼ P k − 1 , we retain y y y and draw a new first bit according to
Pr ( x 1 ′ = b ∣ y ) = P k ( b , y ) P k ( 0 , y ) + P k ( 1 , y ) , b ∈ { 0 , 1 } . (154) \Pr(x'_1=b\mid y)=\frac{P_k(b,y)}{P_k(0,y)+P_k(1,y)},\qquad b\in\{0,1\}. \tag*{(154)} Pr ( x 1 ′ = b ∣ y ) = P k ( 0 , y ) + P k ( 1 , y ) P k ( b , y ) , b ∈ { 0 , 1 } . (154)
The denominator is positive for every y y y sampled with nonzero probability. Each Hadamard therefore requires two computational-basis amplitude evaluations, whose squared magnitudes give the required probabilities. A circuit containing h h h Hadamards consequently requires 2 h 2h 2 h such evaluations. Let R j R_j R j be the number of terms in a DCP decomposition of the state immediately after the j j j th Hadamard. Excluding the cost of constructing these decompositions and sampling from the resulting probabilities, the amplitude evaluations required for one sample take
O ( n 3 ∑ j = 1 h R j ) (155) O\left(n^3\sum_{j=1}^{h} R_j\right) \tag*{(155)} O ( n 3 j = 1 ∑ h R j ) (155)
arithmetic operations. When using the previously discussed decomposition H = ( X + Z ) / 2 H=(X+Z)/\sqrt{2} H = ( X + Z ) / 2 , we get R j : = 2 j R_j:=2^j R j := 2 j such that
∑ j = 1 h R j = ∑ j = 1 h 2 j = 2 h + 1 − 2 = O ( R h ) . (156) \sum_{j=1}^{h}R_j=\sum_{j=1}^{h}2^j=2^{h+1}-2=O(R_h). \tag*{(156)} j = 1 ∑ h R j = j = 1 ∑ h 2 j = 2 h + 1 − 2 = O ( R h ) . (156)
In other words, the cost of all intermediate amplitude evaluations is asymptotically dominated by the cost of evaluating the final state with R h R_h R h terms. This means that gate-by-gate sampling matches the complexity of strong simulation in that setting. The same conclusion holds for any decomposition strategy whose prefix term counts satisfy ∑ j = 1 h R j = O ( R h ) \sum_{j=1}^{h}R_j=O(R_h) ∑ j = 1 h R j = O ( R h ) .
Discussion
We have developed an exact polynomial-time simulation framework for a broad class of non-Clifford circuits, with no restriction on the number of logical qubits or non-Clifford gates. It rests on two equivalent descriptions: third-order phase-polynomial states, specified by affine supports and polynomial phases, and DCP stabilizer states, which extend the stabilizer picture beyond Pauli operators and yield a tableau-based simulator. We characterize precisely which Pauli measurements preserve this state class and provide efficient tests and update rules supporting intermediate measurements and classical feedforward.
For quantum error correction, a simple condition on the ideal circuit guarantees compatibility under arbitrary inserted DCP faults: each ideal X X X measurement must either be deterministic or anticommute with a fixed Z Z Z -type constraint. This remains sufficient even when noise makes deterministic outcomes random, establishing efficient simulation for protocols involving magic state preparation, non-Pauli checks, and CSS gauge fixing.
Our open-source implementation, merlin [30 ] , makes this framework available for circuit-level simulation. Benchmarks show favorable runtime and memory scaling with the number of logical outputs in Bravyi-Haah distillation, and successful simulation of the distance-5 code switching circuit on which all other tested simulators exhaust memory or fail. On the other hand, existing methods currently achieve lower per-shot runtimes on the single-output distillation and cultivation examples.
A natural next step is to use this framework to evaluate recent proposals for non-Clifford computation with quantum LDPC codes, including transversal gates, code switching, and high-rate magic state preparation, whenever their circuit implementations satisfy our compatibility conditions. Combined with suitable decoders, our simulator could enable direct comparisons of logical error rates, acceptance probabilities, and resource overheads at system sizes beyond the reach of existing methods.
An important direction is to extend the range of supported measurement gadgets. Some magic state distillation protocols based on gate injection, such as the parity-checking constructions of Campbell and Howard [70 ] , fall outside the sufficient conditions of Theorem 7 and therefore require a separate compatibility analysis. Extending our guarantees to cover these protocols would broaden the scope of the simulator. Another possibility is to describe states in a rotated local Clifford basis, potentially bringing Hadamard-based cultivation within the framework [65 , 71 ] . Although such a basis change can map the Hadamard observable to a DCP operator, compatibility must also be established for the transformed preparations, gates, and measurements throughout the protocol.
Finally, the DCP decompositions introduced here suggest a route to circuits that leave the 3PP state class: understanding which fault-tolerant protocols admit small DCP decompositions could extend the practical scope of the simulator beyond the polynomial-time regime established in this work.
Acknowledgments
$ \mathsf{\$} $ .C. is supported by a Department of Computer Science Scholarship from the University of Oxford. M.K. is supported by the Clarendon Fund Scholarship and the Sloane Robinson Scholarship. AP is supported by the Engineering and Physical Sciences Research Council (EP/S021582/1) and PASQUOPS (BMFTFR).
S.C. would like to thank Selwyn Simsek for inspiring conversations, especially for pointing out the fact that DCP operators are invariant under conjugation by CNOT+T T T circuits.
AI usage. AI tools were used to edit the text, assist with proofs, and write significant parts of the software package. The simulation framework, the equivalence between DCP stabilizer and phase-polynomial representations, and the measurement cases motivating the QEC applications were developed by the authors. AI tools helped complete the classification of compatible measurements and refine the proofs. The authors take full responsibility for the results, text, and software.
Phase polynomials
This appendix collects the phase-polynomial facts used throughout the paper. For A ⊆ [ n ] A \subseteq[n] A ⊆ [ n ] , write x A = ∏ i ∈ A x i x_A = \prod_{i \in A} x_i x A = ∏ i ∈ A x i , and regard the binary inner product ⟨ u , x ⟩ \langle u,x\rangle ⟨ u , x ⟩ as an element of { 0 , 1 } ⊆ Z 2 k \{0,1\} \subseteq\mathbb{Z}_{2^k} { 0 , 1 } ⊆ Z 2 k .
Theorem A.1 (Equivalent forms of phase polynomials). Let k ≥ 1 k \ge1 k ≥ 1 . A function q : F 2 n → Z 2 k q : \mathbb{F}_2^n \to\mathbb{Z}_{2^k} q : F 2 n → Z 2 k can be written in the weighted form
q ( x ) = c ∅ + ∑ ∅ ≠ A ⊆ [ n ] ∣ A ∣ ≤ k 2 ∣ A ∣ − 1 c A x A ( m o d 2 k ) (157) q(x) = c_{\varnothing} + \sum_{\substack{\varnothing\ne A \subseteq[n]\\ |A| \le k}} 2^{|A|-1}c_A x_A \pmod{2^k} \tag*{(157)} q ( x ) = c ∅ + ∅ = A ⊆ [ n ] ∣ A ∣ ≤ k ∑ 2 ∣ A ∣ − 1 c A x A ( mod 2 k ) (157) if and only if it can be written as a sum of parity functions,
q ( x ) = a 0 + ∑ u ∈ F 2 n ∖ { 0 } a u ⟨ u , x ⟩ ( m o d 2 k ) . (158) q(x) = a_0 + \sum_{u \in\mathbb{F}_2^n \setminus\{0\}} a_u \langle u,x\rangle\pmod{2^k}. \tag*{(158)} q ( x ) = a 0 + u ∈ F 2 n ∖ { 0 } ∑ a u ⟨ u , x ⟩ ( mod 2 k ) . (158) All coefficients may be taken in Z 2 k \mathbb{Z}_{2^k} Z 2 k , although a coefficient c A c_A c A with A ≠ ∅ A \ne\varnothing A = ∅ only matters modulo 2 k − ∣ A ∣ + 1 2^{k-|A|+1} 2 k − ∣ A ∣ + 1 . In particular, for k = 3 k=3 k = 3 , the weighted form is
c ∅ + ∑ i c i x i + 2 ∑ i < j c i j x i x j + 4 ∑ i < j < ℓ c i j ℓ x i x j x ℓ ( m o d 8 ) . c_{\varnothing} + \sum_i c_i x_i + 2\sum_{i<j} c_{ij}x_i x_j + 4\sum_{i<j<\ell} c_{ij\ell}x_i x_j x_\ell\pmod{8}. c ∅ + i ∑ c i x i + 2 i < j ∑ c ij x i x j + 4 i < j < ℓ ∑ c ij ℓ x i x j x ℓ ( mod 8 ) .
Proof. Repeatedly applying a ⊕ b = a + b − 2 a b a \oplus b = a+b-2ab a ⊕ b = a + b − 2 ab gives, for every nonempty B ⊆ [ n ] B \subseteq[n] B ⊆ [ n ] ,
⨁ i ∈ B x i = ∑ ∅ ≠ A ⊆ B ( − 2 ) ∣ A ∣ − 1 x A . (159) \bigoplus_{i \in B} x_i = \sum_{\varnothing\ne A \subseteq B} (-2)^{|A|-1}x_A. \tag*{(159)} i ∈ B ⨁ x i = ∅ = A ⊆ B ∑ ( − 2 ) ∣ A ∣ − 1 x A . (159)
Modulo 2 k 2^k 2 k , all terms with ∣ A ∣ > k |A|>k ∣ A ∣ > k vanish. Applying Eq. (A.3) to each term in Eq. (A.2) therefore produces a weighted polynomial of the form Eq. (A.1).
Conversely, for every nonempty A ⊆ [ n ] A \subseteq[n] A ⊆ [ n ] , Boolean inclusion–exclusion gives
2 ∣ A ∣ − 1 x A = ∑ ∅ ≠ B ⊆ A ( − 1 ) ∣ B ∣ − 1 ⨁ i ∈ B x i . (160) 2^{|A|-1}x_A = \sum_{\varnothing\ne B \subseteq A} (-1)^{|B|-1}\bigoplus_{i \in B} x_i. \tag*{(160)} 2 ∣ A ∣ − 1 x A = ∅ = B ⊆ A ∑ ( − 1 ) ∣ B ∣ − 1 i ∈ B ⨁ x i . (160)
Each parity on the right is ⟨ ∑ i ∈ B e i , x ⟩ \langle\sum_{i \in B} e_i,x\rangle ⟨ ∑ i ∈ B e i , x ⟩ , where e i e_i e i is the i i i th standard basis vector. Substituting Eq. (A.4) into Eq. (A.1) yields Eq. (A.2).
We call the equivalent functions in Theorem A.1 k k k th-order phase polynomials. The parity-sum form makes closure under changes of binary coordinates immediate.
Corollary A.1 (Affine pullback). If q : F 2 n → Z 2 k q : \mathbb{F}_2^n \to\mathbb{Z}_{2^k} q : F 2 n → Z 2 k is a k k k th-order phase polynomial and ϕ ( y ) = A y ⊕ b \phi(y)=Ay\oplus b ϕ ( y ) = A y ⊕ b is an affine map from F 2 m \mathbb{F}_2^m F 2 m to F 2 n \mathbb{F}_2^n F 2 n , then q ∘ ϕ q\circ\phi q ∘ ϕ is a k k k th-order phase polynomial on F 2 m \mathbb{F}_2^m F 2 m .
Proof. For β ∈ F 2 \beta\in\mathbb{F}_2 β ∈ F 2 and t ∈ { 0 , 1 } t \in\{0,1\} t ∈ { 0 , 1 } , β ⊕ t = β + ( 1 − 2 β ) t \beta\oplus t = \beta+ (1-2\beta)t β ⊕ t = β + ( 1 − 2 β ) t . Hence
⟨ u , A y ⊕ b ⟩ = ⟨ u , b ⟩ + ( 1 − 2 ⟨ u , b ⟩ ) ⟨ A T u , y ⟩ . \langle u,Ay\oplus b\rangle= \langle u,b\rangle+ \left(1-2\langle u,b\rangle\right)\langle A^{\mathsf T}u,y\rangle. ⟨ u , A y ⊕ b ⟩ = ⟨ u , b ⟩ + ( 1 − 2 ⟨ u , b ⟩ ) ⟨ A T u , y ⟩ .
Substitution into the parity-sum form of Theorem A.1 gives another constant plus a sum of parity functions.
We next record how phase polynomials behave under discrete differentiation. For v ∈ F 2 n v \in\mathbb{F}_2^n v ∈ F 2 n , recall that
Δ v q ( x ) = q ( x ⊕ v ) − q ( x ) . \Delta_v q(x) = q(x\oplus v)-q(x). Δ v q ( x ) = q ( x ⊕ v ) − q ( x ) .
Theorem A.2 (Discrete derivatives of phase polynomials). Let q : F 2 n → Z 2 k q : \mathbb{F}_2^n \to\mathbb{Z}_{2^k} q : F 2 n → Z 2 k be a k k k th-order phase polynomial, with k ≥ 2 k \ge2 k ≥ 2 . For every v ∈ F 2 n v \in\mathbb{F}_2^n v ∈ F 2 n , there are a constant r v ∈ Z 2 k r_v \in\mathbb{Z}_{2^k} r v ∈ Z 2 k and a ( k − 1 ) (k-1) ( k − 1 ) st-order phase polynomial q v : F 2 n → Z 2 k − 1 q_v : \mathbb{F}_2^n \to\mathbb{Z}_{2^{k-1}} q v : F 2 n → Z 2 k − 1 such that
Δ v q ( x ) = r v + 2 q v ( x ) ( m o d 2 k ) . (161) \Delta_v q(x) = r_v + 2q_v(x) \pmod{2^k}. \tag*{(161)} Δ v q ( x ) = r v + 2 q v ( x ) ( mod 2 k ) . (161) More generally, an s s s -fold discrete derivative, for 1 ≤ s < k 1 \le s < k 1 ≤ s < k , is a constant plus 2 s 2^s 2 s times a ( k − s ) (k-s) ( k − s ) th-order phase polynomial; every k k k -fold derivative is constant.
Proof. Write q q q in the parity-sum form (A.2). Since
⟨ u , x ⊕ v ⟩ − ⟨ u , x ⟩ = { 0 , ⟨ u , v ⟩ = 0 , 1 − 2 ⟨ u , x ⟩ , ⟨ u , v ⟩ = 1 , \langle u,x\oplus v\rangle-\langle u,x\rangle=
\begin{cases}
0, & \langle u,v\rangle=0,\\
1-2\langle u,x\rangle, & \langle u,v\rangle=1,
\end{cases} ⟨ u , x ⊕ v ⟩ − ⟨ u , x ⟩ = { 0 , 1 − 2 ⟨ u , x ⟩ , ⟨ u , v ⟩ = 0 , ⟨ u , v ⟩ = 1 ,
we obtain
Δ v q ( x ) = ∑ ⟨ u , v ⟩ = 1 a u − 2 ∑ ⟨ u , v ⟩ = 1 a u ⟨ u , x ⟩ ( m o d 2 k ) . (162) \Delta_vq(x)=\sum_{\langle u,v\rangle=1}a_u-2\sum_{\langle u,v\rangle=1}a_u\langle u,x\rangle\pmod{2^k}. \tag*{(162)} Δ v q ( x ) = ⟨ u , v ⟩ = 1 ∑ a u − 2 ⟨ u , v ⟩ = 1 ∑ a u ⟨ u , x ⟩ ( mod 2 k ) . (162)
The first sum is constant. After reducing its coefficients modulo 2 k − 1 2^{k-1} 2 k − 1 , the second sum is a phase polynomial over Z 2 k − 1 \mathbb{Z}_{2^{k-1}} Z 2 k − 1 , proving Eq. (A.5). Iterating this argument proves the remaining statements.
For k = 3 k=3 k = 3 , a discrete derivative is therefore a Clifford phase polynomial. We make the corresponding normal forms explicit.
Theorem A.3 (Clifford phase polynomials). A function d : F 2 n → Z 8 d:\mathbb{F}_2^n\to\mathbb{Z}_8 d : F 2 n → Z 8 is the phase function of a diagonal Clifford operator, up to global phase, if and only if it has either of the equivalent forms
d ( x ) = d 0 + 2 ∑ i α i x i + 4 ∑ i < j β i j x i x j ( m o d 8 ) , (163) d(x)=d_0+2\sum_i\alpha_i x_i+4\sum_{i<j}\beta_{ij}x_ix_j\pmod8, \tag*{(163)} d ( x ) = d 0 + 2 i ∑ α i x i + 4 i < j ∑ β ij x i x j ( mod 8 ) , (163) = d 0 + 2 ∑ u ∈ F 2 n ∖ { 0 } b u ⟨ u , x ⟩ ( m o d 8 ) , (164) =d_0+2\sum_{u\in\mathbb{F}_2^n\setminus\{0\}}b_u\langle u,x\rangle\pmod8, \tag*{(164)} = d 0 + 2 u ∈ F 2 n ∖ { 0 } ∑ b u ⟨ u , x ⟩ ( mod 8 ) , (164) where d 0 ∈ Z 8 d_0\in\mathbb{Z}_8 d 0 ∈ Z 8 , α i , b u ∈ Z 4 \alpha_i,b_u\in\mathbb{Z}_4 α i , b u ∈ Z 4 , and β i j ∈ F 2 \beta_{ij}\in\mathbb{F}_2 β ij ∈ F 2 .
Proof. The diagonal Clifford group is generated, up to global phase, by the S i S_i S i and C Z i j \mathrm{CZ}_{ij} CZ ij gates. Their phase functions are 2 x i 2x_i 2 x i and 4 x i x j 4x_ix_j 4 x i x j , respectively, which proves (A.7). Conversely, every polynomial of that form is implemented by ∏ i S i α i ∏ i < j C Z i j β i j \prod_iS_i^{\alpha_i}\prod_{i<j}\mathrm{CZ}_{ij}^{\beta_{ij}} ∏ i S i α i ∏ i < j CZ ij β ij .
Finally, dividing the nonconstant part of (A.7) by 2 2 2 gives a second-order phase polynomial over Z 4 \mathbb{Z}_4 Z 4 . Applying Theorem A.1 with k = 2 k=2 k = 2 proves its equivalence with (A.8).
Theorem A.4 (Discrete derivatives of Clifford phase polynomials). Let d : F 2 n → Z 8 d:\mathbb{F}_2^n\to\mathbb{Z}_8 d : F 2 n → Z 8 be a Clifford phase polynomial. For every v ∈ F 2 n v\in\mathbb{F}_2^n v ∈ F 2 n , there are r v ∈ Z 4 r_v\in\mathbb{Z}_4 r v ∈ Z 4 and a linear function ℓ v : F 2 n → F 2 \ell_v:\mathbb{F}_2^n\to\mathbb{F}_2 ℓ v : F 2 n → F 2 such that
Δ v d ( x ) = 2 r v + 4 ℓ v ( x ) ( m o d 8 ) . (165) \Delta_vd(x)=2r_v+4\ell_v(x)\pmod8. \tag*{(165)} Δ v d ( x ) = 2 r v + 4 ℓ v ( x ) ( mod 8 ) . (165) Proof. Use Eq. (A.8) and write d ( x ) = d 0 + 2 ∑ u b u ⟨ u , x ⟩ d(x)=d_0+2\sum_u b_u\langle u,x\rangle d ( x ) = d 0 + 2 ∑ u b u ⟨ u , x ⟩ . Eq. (A.6) gives
Δ v d ( x ) = 2 ∑ ⟨ u , v ⟩ = 1 b u − 4 ∑ ⟨ u , v ⟩ = 1 b u ⟨ u , x ⟩ ( m o d 8 ) . \Delta_vd(x)=2\sum_{\langle u,v\rangle=1}b_u-4\sum_{\langle u,v\rangle=1}b_u\langle u,x\rangle\pmod8. Δ v d ( x ) = 2 ⟨ u , v ⟩ = 1 ∑ b u − 4 ⟨ u , v ⟩ = 1 ∑ b u ⟨ u , x ⟩ ( mod 8 ) . Take r v = ∑ ⟨ u , v ⟩ = 1 b u ( m o d 4 ) r_v=\sum_{\langle u,v\rangle=1}b_u\pmod4 r v = ∑ ⟨ u , v ⟩ = 1 b u ( mod 4 ) and
ℓ v ( x ) = ⨁ u : ⟨ u , v ⟩ = 1 b u o d d ⟨ u , x ⟩ . \ell_v(x)=\bigoplus_{\substack{u:\langle u,v\rangle=1\\b_u\ \mathrm{odd}}}\langle u,x\rangle. ℓ v ( x ) = u : ⟨ u , v ⟩ = 1 b u odd ⨁ ⟨ u , x ⟩ . The minus sign is immaterial after multiplication by 4 4 4 modulo 8 8 8 , and ℓ v \ell_v ℓ v is linear.
Classification of compatible X measurements
This appendix proves the classification of compatible X X X measurements and derives the corresponding outcome probabilities and post-measurement states. The proof separates measurements that enlarge the affine support from those acting within it, whose compatibility is determined by the discrete derivative of the phase polynomial.
Theorem 1. Consider a 3PP state
∣ ψ ⟩ = 1 ∣ S ∣ ∑ x ∈ S ω 8 q ( x ) ∣ x ⟩ |\psi\rangle= \frac{1}{\sqrt{|S|}} \sum_{x\in S} \omega_8^{q(x)} |x\rangle ∣ ψ ⟩ = ∣ S ∣ 1 x ∈ S ∑ ω 8 q ( x ) ∣ x ⟩ over an affine subspace S = x 0 ⊕ V S=x_0\oplus V S = x 0 ⊕ V with phase polynomial q q q . An X X X measurement on qubit a a a is compatible with ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ iff one of the following cases apply. In each case, we get a post-measurement affine subspace S μ ′ ⊆ F 2 n S'_\mu\subseteq\mathbb{F}_2^n S μ ′ ⊆ F 2 n and phase polynomial q μ ′ : S μ ′ → Z 8 q'_\mu:S'_\mu\to\mathbb{Z}_8 q μ ′ : S μ ′ → Z 8 depending on the measurement outcome μ ∈ { 0 , 1 } \mu\in\{0,1\} μ ∈ { 0 , 1 } , which occurs with some probability Pr ( μ ) \Pr(\mu) Pr ( μ ) .
e a ∉ V e_a\notin V e a ∈ / V . In that case, Pr ( μ ) = 1 2 \Pr(\mu)=\frac{1}{2} Pr ( μ ) = 2 1 and the post-measurement state is defined by S μ ′ = S ∪ ( S ⊕ e a ) S'_\mu=S\cup(S\oplus e_a) S μ ′ = S ∪ ( S ⊕ e a ) and the unique phase polynomial q μ ′ q'_\mu q μ ′ with q μ ′ ( x ) = q ( x ) q'_\mu(x)=q(x) q μ ′ ( x ) = q ( x ) and q μ ′ ( x ⊕ e a ) = q ( x ) + 4 μ q'_\mu(x\oplus e_a)=q(x)+4\mu q μ ′ ( x ⊕ e a ) = q ( x ) + 4 μ for all x ∈ S x\in S x ∈ S .
e a ∈ V e_a\in V e a ∈ V and one of the following apply:
(a) Δ e a q ( x ) = 4 f ( x ) ( m o d 8 ) \Delta_{e_a}q(x)=4f(x)\pmod8 Δ e a q ( x ) = 4 f ( x ) ( mod 8 ) for some affine function f : S → F 2 f:S\to\mathbb{F}_2 f : S → F 2 . In that case
Pr ( μ ) = { 0 if f ( x ) ≠ μ for all x ∈ S , 1 if f ( x ) = μ for all x ∈ S , 1 2 otherwise , \Pr(\mu)=
\begin{cases}
0 & \text{if }f(x)\ne\mu\text{ for all }x\in S,\\
1 & \text{if }f(x)=\mu\text{ for all }x\in S,\\
\frac{1}{2} & \text{otherwise},
\end{cases} Pr ( μ ) = ⎩ ⎨ ⎧ 0 1 2 1 if f ( x ) = μ for all x ∈ S , if f ( x ) = μ for all x ∈ S , otherwise , and the post-measurement state is defined by S μ ′ = S ∩ { x ∣ f ( x ) = μ ( m o d 2 ) } S'_\mu=S\cap\{x\mid f(x)=\mu\pmod2\} S μ ′ = S ∩ { x ∣ f ( x ) = μ ( mod 2 )} and q μ ′ ( x ) = q ( x ) q'_\mu(x)=q(x) q μ ′ ( x ) = q ( x ) for all x ∈ S μ ′ x\in S'_\mu x ∈ S μ ′ .
(b) Δ e a q ( x ) = 2 + 4 g ( x ) ( m o d 8 ) \Delta_{e_a}q(x)=2+4g(x)\pmod8 Δ e a q ( x ) = 2 + 4 g ( x ) ( mod 8 ) for some function g : S → F 2 g:S\to\mathbb{F}_2 g : S → F 2 such that 2 g 2g 2 g is a third-order phase polynomial. In that case, Pr ( μ ) = 1 2 \Pr(\mu)=\frac{1}{2} Pr ( μ ) = 2 1 and the post-measurement state is defined by S μ ′ = S S'_\mu=S S μ ′ = S and q ′ ( x ) = q ( x ) − 2 ( − 1 ) μ g ( x ) q'(x)=q(x)-2(-1)^\mu g(x) q ′ ( x ) = q ( x ) − 2 ( − 1 ) μ g ( x ) .
(c) Δ e a q ( x ) = ( − 1 ) h ( x ) d ( m o d 8 ) \Delta_{e_a}q(x)=(-1)^{h(x)}d\pmod8 Δ e a q ( x ) = ( − 1 ) h ( x ) d ( mod 8 ) for some affine function h : S → F 2 h:S\to\mathbb{F}_2 h : S → F 2 and d ∈ { 1 , 3 , 5 , 7 } d\in\{1,3,5,7\} d ∈ { 1 , 3 , 5 , 7 } . In that case, Pr ( μ ) = 1 2 ( 1 + ( − 1 ) μ cos ( d π / 4 ) ) \Pr(\mu)=\frac{1}{2}(1+(-1)^\mu\cos(d\pi/4)) Pr ( μ ) = 2 1 ( 1 + ( − 1 ) μ cos ( d π /4 )) and the post-measurement state is defined by S μ ′ = S S'_\mu=S S μ ′ = S and q ′ ( x ) = q ( x ) + ( 4 μ − d ) h ( x ) q'(x)=q(x)+(4\mu-d)h(x) q ′ ( x ) = q ( x ) + ( 4 μ − d ) h ( x ) .
Proof. Let ε : = ( − 1 ) μ \varepsilon:=(-1)^\mu ε := ( − 1 ) μ and consider the projector Π ε = 1 2 ( 1 + ε X a ) \Pi_\varepsilon=\frac{1}{2}(1+\varepsilon X_a) Π ε = 2 1 ( 1 + ε X a ) .
First, suppose that e a ∉ V e_a\notin V e a ∈ / V . Then, S S S and S ⊕ e a S\oplus e_a S ⊕ e a are disjoint, such that
Π ε ∣ ψ ⟩ = 1 2 ∣ S ∣ ( ∑ x ∈ S ω 8 q ( x ) ∣ x ⟩ + ε ∑ x ∈ S ω 8 q ( x ) ∣ x ⊕ e a ⟩ ) (166) \Pi_\varepsilon|\psi\rangle=\frac{1}{2\sqrt{|S|}}\left(\sum_{x\in S}\omega_8^{q(x)}|x\rangle+\varepsilon\sum_{x\in S}\omega_8^{q(x)}|x\oplus e_a\rangle\right) \tag*{(166)} Π ε ∣ ψ ⟩ = 2 ∣ S ∣ 1 ( x ∈ S ∑ ω 8 q ( x ) ∣ x ⟩ + ε x ∈ S ∑ ω 8 q ( x ) ∣ x ⊕ e a ⟩ ) (166)
= 1 2 ∣ S ∣ ( ∑ x ∈ S ω 8 q ( x ) ∣ x ⟩ + ∑ x ∈ S ω 8 q ( x ) + 4 μ ∣ x ⊕ e a ⟩ ) (167) =\frac{1}{2\sqrt{|S|}}\left(\sum_{x\in S}\omega_8^{q(x)}|x\rangle+\sum_{x\in S}\omega_8^{q(x)+4\mu}|x\oplus e_a\rangle\right) \tag*{(167)} = 2 ∣ S ∣ 1 ( x ∈ S ∑ ω 8 q ( x ) ∣ x ⟩ + x ∈ S ∑ ω 8 q ( x ) + 4 μ ∣ x ⊕ e a ⟩ ) (167)
= 1 2 ∣ S ∣ ∑ x ∈ S k ∈ F 2 ω 8 q ( x ) + 4 k μ ∣ x + k e a ⟩ , (168) =\frac{1}{2\sqrt{|S|}}\sum_{\substack{x\in S\\ k\in\mathbb{F}_2}}\omega_8^{q(x)+4k\mu}|x+ke_a\rangle, \tag*{(168)} = 2 ∣ S ∣ 1 x ∈ S k ∈ F 2 ∑ ω 8 q ( x ) + 4 k μ ∣ x + k e a ⟩ , (168)
which remains 3PP. The post-measurement state is given by S μ ′ = S ∪ ( S ⊕ e a ) S'_\mu=S\cup(S\oplus e_a) S μ ′ = S ∪ ( S ⊕ e a ) and the unique phase polynomial q μ ′ q'_\mu q μ ′ with q μ ′ ( x ) = q ( x ) q'_\mu(x)=q(x) q μ ′ ( x ) = q ( x ) and q μ ′ ( x ⊕ e a ) = q ( x ) + 4 μ q'_\mu(x\oplus e_a)=q(x)+4\mu q μ ′ ( x ⊕ e a ) = q ( x ) + 4 μ for all x ∈ S x\in S x ∈ S . Furthermore, Pr ( μ ) = ∣ Π ε ∣ ψ ⟩ ∣ 2 = ∣ S μ ′ ∣ 4 ∣ S ∣ ∥ ∣ ψ ⟩ ∥ 2 = 1 2 \Pr(\mu)=|\Pi_\varepsilon|\psi\rangle|^2=\frac{|S'_\mu|}{4|S|}\lVert|\psi\rangle\rVert^2=\frac{1}{2} Pr ( μ ) = ∣ Π ε ∣ ψ ⟩ ∣ 2 = 4∣ S ∣ ∣ S μ ′ ∣ ∥ ∣ ψ ⟩ ∥ 2 = 2 1 .
Now, suppose e a ∈ V e_a\in V e a ∈ V . In that case,
Π ε ∣ ψ ⟩ = 1 2 ∣ S ∣ ( ∑ x ∈ S ω 8 q ( x ) ∣ x ⟩ + ε ∑ x ∈ S ω 8 q ( x ) ∣ x ⊕ e a ⟩ ) (169) \Pi_\varepsilon|\psi\rangle=\frac{1}{2\sqrt{|S|}}\left(\sum_{x\in S}\omega_8^{q(x)}|x\rangle+\varepsilon\sum_{x\in S}\omega_8^{q(x)}|x\oplus e_a\rangle\right) \tag*{(169)} Π ε ∣ ψ ⟩ = 2 ∣ S ∣ 1 ( x ∈ S ∑ ω 8 q ( x ) ∣ x ⟩ + ε x ∈ S ∑ ω 8 q ( x ) ∣ x ⊕ e a ⟩ ) (169)
= 1 2 ∣ S ∣ ( ∑ x ∈ S ω 8 q ( x ) ∣ x ⟩ + ε ∑ x ∈ S ω 8 q ( x ⊕ e a ) ∣ x ⟩ ) (170) =\frac{1}{2\sqrt{|S|}}\left(\sum_{x\in S}\omega_8^{q(x)}|x\rangle+\varepsilon\sum_{x\in S}\omega_8^{q(x\oplus e_a)}|x\rangle\right) \tag*{(170)} = 2 ∣ S ∣ 1 ( x ∈ S ∑ ω 8 q ( x ) ∣ x ⟩ + ε x ∈ S ∑ ω 8 q ( x ⊕ e a ) ∣ x ⟩ ) (170)
= 1 2 ∣ S ∣ ∑ x ∈ S ω 8 q ( x ) ( 1 + ε ω 8 Δ e a q ( x ) ) ∣ x ⟩ (171) =\frac{1}{2\sqrt{|S|}}\sum_{x\in S}\omega_8^{q(x)}\left(1+\varepsilon\omega_8^{\Delta_{e_a}q(x)}\right)|x\rangle \tag*{(171)} = 2 ∣ S ∣ 1 x ∈ S ∑ ω 8 q ( x ) ( 1 + ε ω 8 Δ e a q ( x ) ) ∣ x ⟩ (171)
An important property of 3PP states is that all basis states in their support have equal probability. In other words, a necessary condition for Π ε ∣ ψ ⟩ \Pi_\varepsilon|\psi\rangle Π ε ∣ ψ ⟩ to remain 3PP is that ∣ ⟨ x ∣ Π ε ∣ ψ ⟩ ∣ = ∣ ⟨ y ∣ Π ε ∣ ψ ⟩ ∣ |\langle x|\Pi_\varepsilon|\psi\rangle|=|\langle y|\Pi_\varepsilon|\psi\rangle| ∣ ⟨ x ∣ Π ε ∣ ψ ⟩ ∣ = ∣ ⟨ y ∣ Π ε ∣ ψ ⟩ ∣ for all x , y x,y x , y with ⟨ x ∣ Π ε ∣ ψ ⟩ ≠ 0 \langle x|\Pi_\varepsilon|\psi\rangle\ne0 ⟨ x ∣ Π ε ∣ ψ ⟩ = 0 and ⟨ y ∣ Π ε ∣ ψ ⟩ ≠ 0 \langle y|\Pi_\varepsilon|\psi\rangle\ne0 ⟨ y ∣ Π ε ∣ ψ ⟩ = 0 . Following Eq. (B.6), this is equivalent to
∣ 1 + ε ω 8 Δ e a q ( x ) ∣ = ∣ 1 + ε ω 8 Δ e a q ( y ) ∣ \left|1+\varepsilon\omega_8^{\Delta_{e_a}q(x)}\right|=\left|1+\varepsilon\omega_8^{\Delta_{e_a}q(y)}\right| 1 + ε ω 8 Δ e a q ( x ) = 1 + ε ω 8 Δ e a q ( y )
for all x , y x,y x , y with 1 + ϵ ω 8 Δ e a q ( x ) ≠ 0 1+\epsilon\omega_8^{\Delta_{e_a}q(x)}\ne0 1 + ϵ ω 8 Δ e a q ( x ) = 0 and 1 + ϵ ω 8 Δ e a q ( y ) ≠ 0 1+\epsilon\omega_8^{\Delta_{e_a}q(y)}\ne0 1 + ϵ ω 8 Δ e a q ( y ) = 0 . Computing those magnitudes, we get:
∣ 1 + ϵ ω 8 Δ e a q ( x ) ∣ = ∣ ω 8 Δ e a q ( x ) / 2 ( ω 8 − Δ e a q ( x ) / 2 + ϵ ω 8 Δ e a q ( x ) / 2 ) ∣ = { 2 ∣ cos ( Δ e a q ( x ) π 8 ) ∣ if ϵ = + 1 , 2 ∣ sin ( Δ e a q ( x ) π 8 ) ∣ if ϵ = − 1. \left|1+\epsilon\omega_8^{\Delta_{e_a}q(x)}\right|=\left|\omega_8^{\Delta_{e_a}q(x)/2}\left(\omega_8^{-\Delta_{e_a}q(x)/2}+\epsilon\omega_8^{\Delta_{e_a}q(x)/2}\right)\right|
=\begin{cases}
2\left|\cos\left(\dfrac{\Delta_{e_a}q(x)\pi}{8}\right)\right| & \text{if }\epsilon=+1,\\
2\left|\sin\left(\dfrac{\Delta_{e_a}q(x)\pi}{8}\right)\right| & \text{if }\epsilon=-1.
\end{cases} 1 + ϵ ω 8 Δ e a q ( x ) = ω 8 Δ e a q ( x ) /2 ( ω 8 − Δ e a q ( x ) /2 + ϵ ω 8 Δ e a q ( x ) /2 ) = ⎩ ⎨ ⎧ 2 cos ( 8 Δ e a q ( x ) π ) 2 sin ( 8 Δ e a q ( x ) π ) if ϵ = + 1 , if ϵ = − 1.
For ϵ = + 1 \epsilon=+1 ϵ = + 1 , this means that the image of Δ e a q \Delta_{e_a}q Δ e a q must be a subset of one of { 0 , 4 } \{0,4\} { 0 , 4 } , { 2 , 4 , 6 } \{2,4,6\} { 2 , 4 , 6 } , { 1 , 4 , 7 } \{1,4,7\} { 1 , 4 , 7 } , or { 3 , 4 , 5 } \{3,4,5\} { 3 , 4 , 5 } . Similarly, for ϵ = − 1 \epsilon=-1 ϵ = − 1 its image must be a subset of one of { 0 , 4 } \{0,4\} { 0 , 4 } , { 0 , 2 , 6 } \{0,2,6\} { 0 , 2 , 6 } , { 0 , 1 , 7 } \{0,1,7\} { 0 , 1 , 7 } , or { 0 , 3 , 5 } \{0,3,5\} { 0 , 3 , 5 } . Since both conditions must hold simultaneously, compatibility requires
Im ( Δ e a q ) ⊆ D for some D ∈ { { 0 , 4 } , { 2 , 6 } , { 1 , 7 } , { 3 , 5 } } . (172) \operatorname{Im}(\Delta_{e_a}q)\subseteq D\quad\text{for some }D\in\bigl\{\{0,4\},\{2,6\},\{1,7\},\{3,5\}\bigr\}. \tag*{(172)} Im ( Δ e a q ) ⊆ D for some D ∈ { { 0 , 4 } , { 2 , 6 } , { 1 , 7 } , { 3 , 5 } } . (172)
We will discuss these cases separately:
(a) Suppose Δ e a q ( x ) ∈ { 0 , 4 } \Delta_{e_a}q(x)\in\{0,4\} Δ e a q ( x ) ∈ { 0 , 4 } for all x ∈ S x\in S x ∈ S , i.e. Δ e a q ( x ) = 4 f ( x ) \Delta_{e_a}q(x)=4f(x) Δ e a q ( x ) = 4 f ( x ) for some function f : S → F 2 f:S\to\mathbb{F}_2 f : S → F 2 . Then,
1 + ϵ ω 8 E ( x ) = { 2 if f ( x ) = μ , 0 otherwise. 1+\epsilon\omega_8^{E(x)}=
\begin{cases}
2 & \text{if }f(x)=\mu,\\
0 & \text{otherwise.}
\end{cases} 1 + ϵ ω 8 E ( x ) = { 2 0 if f ( x ) = μ , otherwise.
Inserting this into Eq. (B.6), we see that basis states with f ( x ) ≠ μ f(x)\ne\mu f ( x ) = μ are removed from the support while the others are scaled by 2 2 2 , giving us
Π ϵ ∣ ψ ⟩ = 1 ∣ S ∣ ∑ x ∈ S f ( x ) = μ ω 8 q ( x ) ∣ x ⟩ . \Pi_\epsilon|\psi\rangle=\frac{1}{\sqrt{|S|}}\sum_{\substack{x\in S\\f(x)=\mu}}\omega_8^{q(x)}|x\rangle. Π ϵ ∣ ψ ⟩ = ∣ S ∣ 1 x ∈ S f ( x ) = μ ∑ ω 8 q ( x ) ∣ x ⟩ .
This state remains 3PP for both outcomes μ = 0 , 1 \mu=0,1 μ = 0 , 1 simultaneously iff f f f is affine. In this case, we can read off that S μ ′ = S ∩ { x ∣ f ( x ) = μ } S'_\mu=S\cap\{x\mid f(x)=\mu\} S μ ′ = S ∩ { x ∣ f ( x ) = μ } and q μ ′ = q q'_\mu=q q μ ′ = q . Furthermore, Pr ( μ ) = ∣ Π ϵ ∣ ψ ⟩ ∣ 2 = ∣ S μ ′ ∣ ∣ S ∣ ∥ ψ ∥ 2 = ∣ S μ ′ ∣ ∣ S ∣ \Pr(\mu)=|\Pi_\epsilon|\psi\rangle|^2=\frac{|S'_\mu|}{|S|}\lVert\psi\rVert^2=\frac{|S'_\mu|}{|S|} Pr ( μ ) = ∣ Π ϵ ∣ ψ ⟩ ∣ 2 = ∣ S ∣ ∣ S μ ′ ∣ ∥ ψ ∥ 2 = ∣ S ∣ ∣ S μ ′ ∣ . Since S S S and S μ ′ S'_\mu S μ ′ are affine spaces differing by a single constraint, this ratio must be either 0 0 0 , 1 1 1 , or 1 2 \frac{1}{2} 2 1 depending on whether f ( x ) = μ f(x)=\mu f ( x ) = μ holds for none, all, or some x ∈ S x\in S x ∈ S .
(b) Suppose Δ e a q ( x ) ∈ { 2 , 6 } \Delta_{e_a}q(x)\in\{2,6\} Δ e a q ( x ) ∈ { 2 , 6 } for all x ∈ S x\in S x ∈ S , i.e. Δ e a q ( x ) = 2 + 4 g ( x ) ( m o d 8 ) \Delta_{e_a}q(x)=2+4g(x)\pmod8 Δ e a q ( x ) = 2 + 4 g ( x ) ( mod 8 ) for some function g : S → F 2 g:S\to\mathbb{F}_2 g : S → F 2 . Then,
1 + ϵ ω 8 Δ e a q ( x ) = 1 + i ϵ ( − 1 ) g ( x ) = 2 ω 8 ϵ ( − 1 ) g ( x ) = 2 ω 8 ϵ ( 1 − 2 g ( x ) ) , 1+\epsilon\omega_8^{\Delta_{e_a}q(x)}=1+i\epsilon(-1)^{g(x)}=\sqrt{2}\omega_8^{\epsilon(-1)^{g(x)}}=\sqrt{2}\omega_8^{\epsilon(1-2g(x))}, 1 + ϵ ω 8 Δ e a q ( x ) = 1 + i ϵ ( − 1 ) g ( x ) = 2 ω 8 ϵ ( − 1 ) g ( x ) = 2 ω 8 ϵ ( 1 − 2 g ( x )) ,
where we used the identities 1 + s i = 2 e i s π / 4 1+si=\sqrt{2}e^{is\pi/4} 1 + s i = 2 e i s π /4 for s ∈ { − 1 , 1 } s\in\{-1,1\} s ∈ { − 1 , 1 } and ( − 1 ) m = 1 − 2 m (-1)^m=1-2m ( − 1 ) m = 1 − 2 m for m ∈ { 0 , 1 } m\in\{0,1\} m ∈ { 0 , 1 } . Inserting this into Eq. (B.6), we get the projected state
Π ϵ ∣ ψ ⟩ = 2 ω 8 ϵ 2 ∣ S ∣ ∑ x ∈ S ω 8 q ( x ) − 2 ϵ g ( x ) ∣ x ⟩ . \Pi_\epsilon|\psi\rangle=\frac{\sqrt{2}\omega_8^\epsilon}{2\sqrt{|S|}}\sum_{x\in S}\omega_8^{q(x)-2\epsilon g(x)}|x\rangle. Π ϵ ∣ ψ ⟩ = 2 ∣ S ∣ 2 ω 8 ϵ x ∈ S ∑ ω 8 q ( x ) − 2 ϵ g ( x ) ∣ x ⟩ .
which remains 3PP iff 2 g 2g 2 g is a valid third-order phase polynomial. In this case, we can read off that S ′ = S S'=S S ′ = S and q ′ ( x ) = q ( x ) − 2 ϵ g ( x ) q'(x)=q(x)-2\epsilon g(x) q ′ ( x ) = q ( x ) − 2 ϵ g ( x ) . Furthermore, Pr ( μ ) = ∣ Π μ ∣ ψ ⟩ ∣ 2 = 1 2 ∥ ψ ∥ 2 = 1 2 \Pr(\mu)=|\Pi_\mu|\psi\rangle|^2=\frac{1}{2}\lVert\psi\rVert^2=\frac{1}{2} Pr ( μ ) = ∣ Π μ ∣ ψ ⟩ ∣ 2 = 2 1 ∥ ψ ∥ 2 = 2 1 .
(c) Suppose Δ e a q ( x ) ∈ { d , − d } \Delta_{e_a}q(x)\in\{d,-d\} Δ e a q ( x ) ∈ { d , − d } for all x ∈ S x\in S x ∈ S where d ∈ { 1 , 3 , 5 , 7 } d\in\{1,3,5,7\} d ∈ { 1 , 3 , 5 , 7 } , i.e. Δ e a q ( x ) = ( − 1 ) h ( x ) d ( m o d 8 ) \Delta_{e_a}q(x)=(-1)^{h(x)}d\pmod8 Δ e a q ( x ) = ( − 1 ) h ( x ) d ( mod 8 ) for some function h : S → F 2 h:S\to\mathbb{F}_2 h : S → F 2 . Then,
1 + ϵ ω 8 Δ e a q ( x ) = ( 1 + ϵ ω 8 d ) ( 1 + ϵ ω 8 ( − 1 ) h ( x ) d 1 + ϵ ω 8 ( − 1 ) h ( x ) + 1 d ) h ( x ) = ( 1 + ϵ ω 8 d ) ( ϵ ω 8 − d ) h ( x ) = ( 1 + ϵ ω 8 d ) ω 8 ( 4 μ − d ) h ( x ) . \begin{aligned}
1+\epsilon\omega_8^{\Delta_{e_a}q(x)}
=(1+\epsilon\omega_8^d)\left(\frac{1+\epsilon\omega_8^{(-1)^{h(x)}d}}{1+\epsilon\omega_8^{(-1)^{h(x)+1}d}}\right)^{h(x)} \\
&=(1+\epsilon\omega_8^d)(\epsilon\omega_8^{-d})^{h(x)} \\
&=(1+\epsilon\omega_8^d)\omega_8^{(4\mu-d)h(x)}.
\end{aligned} 1 + ϵ ω 8 Δ e a q ( x ) = ( 1 + ϵ ω 8 d ) ( 1 + ϵ ω 8 ( − 1 ) h ( x ) + 1 d 1 + ϵ ω 8 ( − 1 ) h ( x ) d ) h ( x ) = ( 1 + ϵ ω 8 d ) ( ϵ ω 8 − d ) h ( x ) = ( 1 + ϵ ω 8 d ) ω 8 ( 4 μ − d ) h ( x ) .
Inserting this into Eq. (B.6), we get the projected state
Π ϵ ∣ ψ ⟩ = 1 + ϵ ω 8 d 2 ∣ S ∣ ∑ x ∈ S ω 8 q ( x ) + ( 4 μ − d ) h ( x ) ∣ x ⟩ . \Pi_\epsilon|\psi\rangle=\frac{1+\epsilon\omega_8^d}{2\sqrt{|S|}}\sum_{x\in S}\omega_8^{q(x)+(4\mu-d)h(x)}|x\rangle. Π ϵ ∣ ψ ⟩ = 2 ∣ S ∣ 1 + ϵ ω 8 d x ∈ S ∑ ω 8 q ( x ) + ( 4 μ − d ) h ( x ) ∣ x ⟩ .
We claim that this state remains 3PP iff h h h is affine over F 2 \mathbb{F}_2 F 2 . First, suppose h h h is affine over F 2 \mathbb{F}_2 F 2 , i.e. h ( x ) = a 0 ⊕ ⨁ i a i x i h(x) = a_0 \oplus\bigoplus_i a_i x_i h ( x ) = a 0 ⊕ ⨁ i a i x i for some a 0 , a i ∈ F 2 a_0,a_i \in\mathbb{F}_2 a 0 , a i ∈ F 2 . Writing a = ( a i ) i a = (a_i)_i a = ( a i ) i , we have
h ( x ) = a 0 ⊕ ⟨ a , x ⟩ = a 0 + ( 1 − 2 a 0 ) ⟨ a , x ⟩ ( m o d 8 ) . h(x) = a_0 \oplus\langle a,x\rangle= a_0 + (1 - 2a_0)\langle a,x\rangle\pmod{8}. h ( x ) = a 0 ⊕ ⟨ a , x ⟩ = a 0 + ( 1 − 2 a 0 ) ⟨ a , x ⟩ ( mod 8 ) .
Thus, h h h has the form of Eq. (A.2), and hence q μ ′ = q + ( 4 μ − d ) h q'_\mu= q + (4\mu-d)h q μ ′ = q + ( 4 μ − d ) h is a third-order phase polynomial. Conversely, note that
h ( x ) = ( 4 μ − d ) − 1 ( q μ ′ ( x ) − q ( x ) ) ( m o d 2 ) . h(x) = (4\mu-d)^{-1}(q'_\mu(x)-q(x)) \pmod{2}. h ( x ) = ( 4 μ − d ) − 1 ( q μ ′ ( x ) − q ( x )) ( mod 2 ) .
Thus, if q μ ′ q'_\mu q μ ′ is a 3PP phase polynomial, then ( 4 μ − d ) − 1 ( q μ ′ − q ) (4\mu-d)^{-1}(q'_\mu-q) ( 4 μ − d ) − 1 ( q μ ′ − q ) must also be one. Reducing mod 2 removes all quadratic and cubic terms, showing that h h h is affine over F 2 \mathbb{F}_2 F 2 . If the measurement is compatible, we can furthermore read off that S μ ′ = S S'_\mu= S S μ ′ = S and
Pr ( μ ) = ∣ Π ε ∣ ψ ⟩ ∣ 2 = ∣ 1 + ε ω 8 d 2 ∣ ψ ⟩ ∣ 2 = 1 2 ( 1 + ε cos ( d π / 4 ) ) . \Pr(\mu) = \lvert\Pi_\varepsilon\lvert\psi\rangle\rvert^2 = \left\lvert\frac{1+\varepsilon\omega_8^d}{2}\lvert\psi\rangle\right\rvert^2 = \frac{1}{2}(1+\varepsilon\cos(d\pi/4)). Pr ( μ ) = ∣ Π ε ∣ ψ ⟩ ∣ 2 = 2 1 + ε ω 8 d ∣ ψ ⟩ 2 = 2 1 ( 1 + ε cos ( d π /4 )) .
In any other case, the measurement cannot be compatible as established in Eq. (B.7).
The measurement classification in Theorem 1 depends on the derivative Δ e a q \Delta_{e_a}q Δ e a q of the phase polynomial in the direction of the measured qubit. Remember that, by Proposition 11 , we can directly construct this derivative from the DCP stabilizer group of ∣ ψ ⟩ \lvert\psi\rangle ∣ ψ ⟩ without having to explicitly track the phase polynomial itself.
More precisely, let ∣ ψ ⟩ \lvert\psi\rangle ∣ ψ ⟩ be a 3PP state with phase polynomial q q q and DCP stabilizer group G G G . Suppose e a ∈ X ( G ) e_a \in X(G) e a ∈ X ( G ) and choose an element g ∈ G g \in G g ∈ G with π ( g ) = e a \pi(g)=e_a π ( g ) = e a .
Write g = X a δ g = X_a\delta g = X a δ , where δ = ω 8 k D ( s , M ) \delta= \omega_8^kD(s,M) δ = ω 8 k D ( s , M ) is diagonal. The stabilizer equation g ∣ ψ ⟩ = ∣ ψ ⟩ g\lvert\psi\rangle=\lvert\psi\rangle g ∣ ψ ⟩ = ∣ ψ ⟩ gives
Δ e a q ( x ) = k + 2 ∑ i s i x i + 4 ∑ i < j M i j x i x j ( m o d 8 ) (173) \Delta_{e_a}q(x) = k + 2\sum_i s_i x_i + 4\sum_{i<j} M_{ij}x_i x_j \pmod{8} \tag*{(173)} Δ e a q ( x ) = k + 2 i ∑ s i x i + 4 i < j ∑ M ij x i x j ( mod 8 ) (173)
for every x ∈ S x \in S x ∈ S . Thus, we can extract Δ e a q \Delta_{e_a}q Δ e a q directly from the normal form of the DCP stabilizer element g g g . Furthermore, given Δ e a q \Delta_{e_a}q Δ e a q , we can distinguish the different cases of Theorem 1 efficiently. To this end, Let S = x 0 ⊕ V S=x_0\oplus V S = x 0 ⊕ V , and let v ( 1 ) , … , v ( r ) v^{(1)},\ldots,v^{(r)} v ( 1 ) , … , v ( r ) be a basis of V V V . Define the restricted derivative
D ~ ( c ) : = Δ e a q ( x 0 ⊕ ⨁ i = 1 r c i v ( i ) ) , c ∈ F 2 r . (174) \widetilde{D}(c):=\Delta_{e_a}q\left(x_0\oplus\bigoplus_{i=1}^{r}c_i v^{(i)}\right), \qquad c\in\mathbb{F}_2^r. \tag*{(174)} D ( c ) := Δ e a q ( x 0 ⊕ i = 1 ⨁ r c i v ( i ) ) , c ∈ F 2 r . (174)
By affine pullback, this is a Clifford phase polynomial, which we write as
D ~ ( c ) = k ~ + 2 ∑ i s ~ i c i + 4 ∑ i < j M ~ i j c i c j ( m o d 8 ) , (175) \widetilde{D}(c)=\widetilde{k}+2\sum_i\widetilde{s}_i c_i+4\sum_{i<j}\widetilde{M}_{ij}c_i c_j \pmod{8}, \tag*{(175)} D ( c ) = k + 2 i ∑ s i c i + 4 i < j ∑ M ij c i c j ( mod 8 ) , (175)
where k ~ ∈ Z 8 \widetilde{k}\in\mathbb{Z}_8 k ∈ Z 8 , s ~ i ∈ Z 4 \widetilde{s}_i\in\mathbb{Z}_4 s i ∈ Z 4 , and M ~ \widetilde{M} M is symmetric over F 2 \mathbb{F}_2 F 2 with zero diagonal.
Proposition B.1. The different cases of Theorem 1 can be decided based on k ~ \widetilde{k} k , s ~ \widetilde{s} s , and M ~ \widetilde{M} M :
Case 2 a 2a 2 a applies iff k ~ ∈ { 0 , 4 } \widetilde{k}\in\{0,4\} k ∈ { 0 , 4 } , s ~ i ∈ { 0 , 2 } \widetilde{s}_i\in\{0,2\} s i ∈ { 0 , 2 } , and M ~ i j = 0 \widetilde{M}_{ij}=0 M ij = 0 .
Case 2 b 2b 2 b applies iff k ~ ∈ { 2 , 6 } \widetilde{k}\in\{2,6\} k ∈ { 2 , 6 } , s ~ i ∈ { 0 , 2 } \widetilde{s}_i\in\{0,2\} s i ∈ { 0 , 2 } , and rank M ~ ≤ 2 \operatorname{rank}\widetilde{M}\le2 rank M ≤ 2 .
Case 2 c 2c 2 c applies iff k ~ \widetilde{k} k is odd, s ~ i ∈ { 0 , − k ~ } ( m o d 4 ) \widetilde{s}_i\in\{0,-\widetilde{k}\}\pmod{4} s i ∈ { 0 , − k } ( mod 4 ) for every i i i , and M ~ i j = s ~ i s ~ j ( m o d 2 ) \widetilde{M}_{ij}=\widetilde{s}_i\widetilde{s}_j\pmod{2} M ij = s i s j ( mod 2 ) for every i < j i<j i < j .
Proof. We begin by giving explicit representations for k ~ \widetilde{k} k , s ~ i \widetilde{s}_i s i , and M ~ i j \widetilde{M}_{ij} M ij in terms of Δ e a q \Delta_{e_a}q Δ e a q . Concretely, noting that D ~ ( 0 ) = k ~ \widetilde{D}(0)=\widetilde{k} D ( 0 ) = k , D ~ ( e i ) = k ~ + 2 s ~ i \widetilde{D}(e_i)=\widetilde{k}+2\widetilde{s}_i D ( e i ) = k + 2 s i , and D ~ ( e i ⊕ e j ) = k ~ + 2 s ~ i + 2 s ~ j + 4 M ~ i j \widetilde{D}(e_i\oplus e_j)=\widetilde{k}+2\widetilde{s}_i+2\widetilde{s}_j+4\widetilde{M}_{ij} D ( e i ⊕ e j ) = k + 2 s i + 2 s j + 4 M ij , we have
k ~ = Δ e a q ( x 0 ) ( m o d 8 ) (176) \widetilde{k}=\Delta_{e_a}q(x_0)\pmod{8} \tag*{(176)} k = Δ e a q ( x 0 ) ( mod 8 ) (176)
2 s ~ i = Δ e a q ( x 0 ⊕ v ( i ) ) − Δ e a q ( x 0 ) ( m o d 8 ) (177) 2\widetilde{s}_i=\Delta_{e_a}q(x_0\oplus v^{(i)})-\Delta_{e_a}q(x_0)\pmod{8} \tag*{(177)} 2 s i = Δ e a q ( x 0 ⊕ v ( i ) ) − Δ e a q ( x 0 ) ( mod 8 ) (177)
4 M ~ i j = Δ e a q ( x 0 ⊕ v ( i ) ⊕ v ( j ) ) − Δ e a q ( x 0 ⊕ v ( i ) ) − Δ e a q ( x 0 ⊕ v ( j ) ) + Δ e a q ( x 0 ) ( m o d 8 ) . (178) 4\widetilde{M}_{ij}=\Delta_{e_a}q(x_0\oplus v^{(i)}\oplus v^{(j)})-\Delta_{e_a}q(x_0\oplus v^{(i)})-\Delta_{e_a}q(x_0\oplus v^{(j)})+\Delta_{e_a}q(x_0)\pmod{8}. \tag*{(178)} 4 M ij = Δ e a q ( x 0 ⊕ v ( i ) ⊕ v ( j ) ) − Δ e a q ( x 0 ⊕ v ( i ) ) − Δ e a q ( x 0 ⊕ v ( j ) ) + Δ e a q ( x 0 ) ( mod 8 ) . (178)
In other words 2 s ~ i = Δ v ( i ) Δ e a q ( x 0 ) 2\tilde{s}_i=\Delta_{v^{(i)}}\Delta_{e_a}q(x_0) 2 s ~ i = Δ v ( i ) Δ e a q ( x 0 ) and 4 M ~ i j = Δ v ( i ) Δ v ( j ) Δ e a q ( x 0 ) 4\widetilde{M}_{ij}=\Delta_{v^{(i)}}\Delta_{v^{(j)}}\Delta_{e_a}q(x_0) 4 M ij = Δ v ( i ) Δ v ( j ) Δ e a q ( x 0 ) are the first and second discrete derivatives of Δ e a q \Delta_{e_a}q Δ e a q at x 0 x_0 x 0 in the directions of V V V ’s basis vectors. Furthermore, we note the following facts about arithmetic over Boolean variables a i ∈ F 2 a_i\in\mathbb{F}_2 a i ∈ F 2 modulo 8:
2 ⨁ i a i = 2 ∑ i a i − 4 ∑ i < j a i a j ( m o d 8 ) (179) 2\bigoplus_i a_i = 2\sum_i a_i-4\sum_{i<j}a_i a_j \pmod8 \tag*{(179)} 2 i ⨁ a i = 2 i ∑ a i − 4 i < j ∑ a i a j ( mod 8 ) (179)
4 ⨁ i a i = 4 ∑ i a i ( m o d 8 ) (180) 4\bigoplus_i a_i = 4\sum_i a_i \pmod8 \tag*{(180)} 4 i ⨁ a i = 4 i ∑ a i ( mod 8 ) (180)
We consider each case separately:
First, suppose that Δ e a q ~ ( c ) = 4 f ( c ) ( m o d 8 ) \Delta_{e_a}\tilde{q}(c)=4f(c)\pmod8 Δ e a q ~ ( c ) = 4 f ( c ) ( mod 8 ) for some affine function f : F 2 r → F 2 f:\mathbb{F}_2^r\to\mathbb{F}_2 f : F 2 r → F 2 . Write f ( c ) = ⨁ i f i c i ⊕ f 0 f(c)=\bigoplus_i f_i c_i\oplus f_0 f ( c ) = ⨁ i f i c i ⊕ f 0 . Using Eq. (B.15), we see that Δ e a q ~ ( c ) = 4 f 0 + 4 ∑ i f i c i ( m o d 8 ) \Delta_{e_a}\tilde{q}(c)=4f_0+4\sum_i f_i c_i\pmod8 Δ e a q ~ ( c ) = 4 f 0 + 4 ∑ i f i c i ( mod 8 ) . We can read off that k ~ : = 4 f 0 ∈ { 0 , 4 } \tilde{k}:=4f_0\in\{0,4\} k ~ := 4 f 0 ∈ { 0 , 4 } , 2 s ~ i : = 4 f i 2\tilde{s}_i:=4f_i 2 s ~ i := 4 f i is even and M ~ i j = 0 \widetilde{M}_{ij}=0 M ij = 0 since there are no quadratic terms.
Conversely, suppose k ~ ∈ { 0 , 4 } \tilde{k}\in\{0,4\} k ~ ∈ { 0 , 4 } , s ~ i ∈ { 0 , 2 } \tilde{s}_i\in\{0,2\} s ~ i ∈ { 0 , 2 } , and M ~ i j = 0 \widetilde{M}_{ij}=0 M ij = 0 . Then f ( c ) : = ( ⨁ i s ~ i 2 c i ) ⊕ k ~ 4 f(c):=\left(\bigoplus_i \frac{\tilde{s}_i}{2}c_i\right)\oplus\frac{\tilde{k}}{4} f ( c ) := ( ⨁ i 2 s ~ i c i ) ⊕ 4 k ~ is affine and D ~ ( c ) = 4 f ( c ) \widetilde{D}(c)=4f(c) D ( c ) = 4 f ( c ) such that case 2a applies.
Suppose Δ e a q ~ ( c ) = 2 + 4 g ( c ) ( m o d 8 ) \Delta_{e_a}\tilde{q}(c)=2+4g(c)\pmod8 Δ e a q ~ ( c ) = 2 + 4 g ( c ) ( mod 8 ) for some function g : F 2 r → F 2 g:\mathbb{F}_2^r\to\mathbb{F}_2 g : F 2 r → F 2 such that 2 g 2g 2 g is a 3PP phase polynomial. Evaluating equations (B.11) and (B.12), we get
k ~ = Δ e a q ~ ( 0 ) = 2 + 4 g ( 0 ) ( m o d 8 ) \tilde{k}=\Delta_{e_a}\tilde{q}(0)=2+4g(0)\pmod8 k ~ = Δ e a q ~ ( 0 ) = 2 + 4 g ( 0 ) ( mod 8 )
2 s ~ i = Δ e a q ~ ( e i ) − Δ e a q ~ ( 0 ) = 4 ( g ( e i ) − g ( 0 ) ) ( m o d 8 ) 2\tilde{s}_i=\Delta_{e_a}\tilde{q}(e_i)-\Delta_{e_a}\tilde{q}(0)=4\bigl(g(e_i)-g(0)\bigr)\pmod8 2 s ~ i = Δ e a q ~ ( e i ) − Δ e a q ~ ( 0 ) = 4 ( g ( e i ) − g ( 0 ) ) ( mod 8 )
showing that k ~ ∈ { 2 , 6 } \tilde{k}\in\{2,6\} k ~ ∈ { 2 , 6 } and that all s ~ i \tilde{s}_i s ~ i are even. Then
4 g ( c ) = Δ e a q ~ ( c ) − 2 = k ~ − 2 + 2 ∑ i s ~ i c i + 4 ∑ i < j M ~ i j c i c j ( m o d 8 ) 4g(c)=\Delta_{e_a}\tilde{q}(c)-2=\tilde{k}-2+2\sum_i\tilde{s}_i c_i+4\sum_{i<j}\widetilde{M}_{ij}c_i c_j\pmod8 4 g ( c ) = Δ e a q ~ ( c ) − 2 = k ~ − 2 + 2 i ∑ s ~ i c i + 4 i < j ∑ M ij c i c j ( mod 8 )
Using Eq. (B.15), we conclude that
g ( c ) = k ~ − 2 4 ⊕ ( ⨁ i s ~ i 2 c i ) ⊕ ( ⨁ i < j M ~ i j c i c j ) . (181) g(c)=\frac{\tilde{k}-2}{4}\oplus\left(\bigoplus_i\frac{\tilde{s}_i}{2}c_i\right)\oplus\left(\bigoplus_{i<j}\widetilde{M}_{ij}c_i c_j\right). \tag*{(181)} g ( c ) = 4 k ~ − 2 ⊕ ( i ⨁ 2 s ~ i c i ) ⊕ ( i < j ⨁ M ij c i c j ) . (181)
In other words, g g g must be a quadratic Boolean function. Therefore, rank M ~ ≤ 2 \operatorname{rank}\widetilde{M}\le2 rank M ≤ 2 by Lemma B.1.
Conversely, suppose k ~ ∈ { 2 , 6 } \tilde{k}\in\{2,6\} k ~ ∈ { 2 , 6 } , s ~ i ∈ { 0 , 2 } \tilde{s}_i\in\{0,2\} s ~ i ∈ { 0 , 2 } , and rank M ~ ≤ 2 \operatorname{rank}\widetilde{M}\le2 rank M ≤ 2 . Define g g g by Eq. (B.16) and use Eq. (B.15) to show
2 + 4 g ( c ) = k ~ + 2 ∑ i s ~ i c i + 4 ∑ i < j M ~ i j c i c j = D ~ ( c ) ( m o d 8 ) . (182) 2+4g(c)=\tilde{k}+2\sum_i\tilde{s}_i c_i+4\sum_{i<j}\widetilde{M}_{ij}c_i c_j=\widetilde{D}(c)\pmod8. \tag*{(182)} 2 + 4 g ( c ) = k ~ + 2 i ∑ s ~ i c i + 4 i < j ∑ M ij c i c j = D ( c ) ( mod 8 ) . (182)
By Lemma B.1, 2 g 2g 2 g is a 3PP phase polynomial such that case 2b applies.
Suppose first that case 2c applies. By absorbing the constant term of the affine function into the sign of d d d , we may write
D ~ ( c ) = k ~ ( − 1 ) h ( c ) , h ( c ) = ⨁ i h i c i , (183) \widetilde{D}(c)=\tilde{k}(-1)^{h(c)},\qquad h(c)=\bigoplus_i h_i c_i, \tag*{(183)} D ( c ) = k ~ ( − 1 ) h ( c ) , h ( c ) = i ⨁ h i c i , (183)
where k ~ \tilde{k} k ~ is odd and h i ∈ F 2 h_i\in\mathbb{F}_2 h i ∈ F 2 . Expanding the parity modulo 8 gives
D ~ ( c ) = k ~ − 2 k ~ ∑ i h i c i + 4 k ~ ∑ i < j h i h j c i c j ( m o d 8 ) . (184) \widetilde{D}(c)=\tilde{k}-2\tilde{k}\sum_i h_i c_i+4\tilde{k}\sum_{i<j}h_i h_j c_i c_j\pmod8. \tag*{(184)} D ( c ) = k ~ − 2 k ~ i ∑ h i c i + 4 k ~ i < j ∑ h i h j c i c j ( mod 8 ) . (184)
Comparing coefficients yields
s ~ i = − k ~ h i ( m o d 4 ) , (185) \tilde{s}_i=-\tilde{k}h_i\pmod4, \tag*{(185)} s ~ i = − k ~ h i ( mod 4 ) , (185)
M ~ i j = h i h j ( m o d 2 ) . (186) \widetilde{M}_{ij}=h_i h_j\pmod2. \tag*{(186)} M ij = h i h j ( mod 2 ) . (186)
Since k ~ \tilde{k} k ~ is odd, we also have h i = s ~ i ( m o d 2 ) h_i=\tilde{s}_i\pmod2 h i = s ~ i ( mod 2 ) , proving the stated conditions.
Conversely, suppose those conditions hold. Define h i : = s ~ i ( m o d 2 ) ∈ F 2 h_i := \tilde{s}_i \pmod2 \in\mathbb{F}_2 h i := s ~ i ( mod 2 ) ∈ F 2 and h ( c ) : = ⨁ i h i c i h(c) := \bigoplus_i h_i c_i h ( c ) := ⨁ i h i c i . The condition s ~ i ∈ { 0 , − k ~ } ( m o d 4 ) \tilde{s}_i \in\{0,-\tilde{k}\} \pmod4 s ~ i ∈ { 0 , − k ~ } ( mod 4 ) implies s ~ i = − k ~ h i ( m o d 4 ) \tilde{s}_i = -\tilde{k}h_i \pmod4 s ~ i = − k ~ h i ( mod 4 ) , while the quadratic condition gives M ~ i j = h i h j ( m o d 2 ) \tilde{M}_{ij} = h_i h_j \pmod2 M ~ ij = h i h j ( mod 2 ) . Therefore,
k ~ ( − 1 ) h ( c ) = k ~ − 2 k ~ ∑ i h i c i + 4 k ~ ∑ i < j h i h j c i c j (187) \tilde{k}(-1)^{h(c)} = \tilde{k} - 2\tilde{k}\sum_i h_i c_i + 4\tilde{k}\sum_{i<j} h_i h_j c_i c_j \tag*{(187)} k ~ ( − 1 ) h ( c ) = k ~ − 2 k ~ i ∑ h i c i + 4 k ~ i < j ∑ h i h j c i c j (187)
= k ~ + 2 ∑ i s ~ i c i + 4 ∑ i < j M ~ i j c i c j (188) = \tilde{k} + 2\sum_i \tilde{s}_i c_i + 4\sum_{i<j}\tilde{M}_{ij}c_i c_j \tag*{(188)} = k ~ + 2 i ∑ s ~ i c i + 4 i < j ∑ M ~ ij c i c j (188)
= D ~ ( c ) ( m o d 8 ) . (189) = \widetilde{D}(c) \pmod8. \tag*{(189)} = D ( c ) ( mod 8 ) . (189)
Thus case 2 c 2c 2 c applies.
Lemma B.1. Let g : F 2 n → F 2 g : \mathbb{F}_2^n \to\mathbb{F}_2 g : F 2 n → F 2 be a quadratic Boolean function given by a bilinear form
g ( x ) = g 0 ⊕ ( ⨁ i a i x i ) ⊕ ( ⨁ i < j M i j x i x j ) g(x) = g_0 \oplus\left(\bigoplus_i a_i x_i\right) \oplus\left(\bigoplus_{i<j} M_{ij}x_i x_j\right) g ( x ) = g 0 ⊕ ( i ⨁ a i x i ) ⊕ ( i < j ⨁ M ij x i x j ) with g 0 ∈ F 2 g_0 \in\mathbb{F}_2 g 0 ∈ F 2 , a ∈ F 2 n a \in\mathbb{F}_2^n a ∈ F 2 n , M ∈ F 2 n × n M \in\mathbb{F}_2^{n \times n} M ∈ F 2 n × n where M M M is symmetric with zero diagonal. Then 2 g 2g 2 g is a 3PP phase polynomial iff rank M ≤ 2 M \le2 M ≤ 2 .
Proof. We first put the quadratic part into canonical coordinates, then determine when the weighted polynomial for 2 g 2g 2 g contains quartic terms. Since M M M is symmetric with zero diagonal, its rank is even, say rank M = 2 t M = 2t M = 2 t . An invertible linear change of coordinates puts g g g into the form
g ^ ( z ) = ℓ ( z ) ⊕ ⨁ i = 1 t z 2 i − 1 z 2 i , z ∈ F 2 n , (190) \hat{g}(z) = \ell(z) \oplus\bigoplus_{i=1}^{t} z_{2i-1}z_{2i}, \qquad z \in\mathbb{F}_2^n, \tag*{(190)} g ^ ( z ) = ℓ ( z ) ⊕ i = 1 ⨁ t z 2 i − 1 z 2 i , z ∈ F 2 n , (190) where ℓ \ell ℓ is affine and may depend on all n n n variables. By affine pullback in both directions, 2 g 2g 2 g is a third-order phase polynomial iff 2 g ^ 2\hat{g} 2 g ^ is one.
Expanding the XOR modulo 8 gives
2 g ^ ( z ) = 2 ℓ ( z ) + 2 ∑ i = 1 t z 2 i − 1 z 2 i − 4 ∑ i = 1 t ℓ ( z ) z 2 i − 1 z 2 i (191) 2\hat{g}(z) = 2\ell(z) + 2\sum_{i=1}^{t}z_{2i-1}z_{2i} - 4\sum_{i=1}^{t}\ell(z)z_{2i-1}z_{2i} \tag*{(191)} 2 g ^ ( z ) = 2 ℓ ( z ) + 2 i = 1 ∑ t z 2 i − 1 z 2 i − 4 i = 1 ∑ t ℓ ( z ) z 2 i − 1 z 2 i (191) − 4 ∑ i < j z 2 i − 1 z 2 i z 2 j − 1 z 2 j ( m o d 8 ) . (192) {}- 4\sum_{i<j}z_{2i-1}z_{2i}z_{2j-1}z_{2j} \pmod8. \tag*{(192)} − 4 i < j ∑ z 2 i − 1 z 2 i z 2 j − 1 z 2 j ( mod 8 ) . (192) The first term is a third-order phase polynomial because ℓ \ell ℓ is affine. The second term has quadratic coefficients divisible by 2. In the third term, the prefactor 4 allows us to expand ℓ \ell ℓ over F 2 \mathbb{F}_2 F 2 , so this term has degree at most three and all coefficients are divisible by 4. Thus, when t ≤ 1 t \le1 t ≤ 1 , every term has the required weighted form.
If t ≥ 2 t \ge2 t ≥ 2 , the last sum contains z 1 z 2 z 3 z 4 z_1z_2z_3z_4 z 1 z 2 z 3 z 4 with coefficient 4 modulo 8. None of the other terms has degree four, so this coefficient cannot cancel. By uniqueness of the multilinear polynomial representation modulo 8, 2 g ^ 2\hat{g} 2 g ^ is then not a third-order phase polynomial. Consequently, 2 g 2g 2 g is a third-order phase polynomial iff t ≤ 1 t \le1 t ≤ 1 , equivalently rank M ≤ 2 M \le2 M ≤ 2 .
Efficient simulation in the phase polynomial representation
This appendix establishes the runtime and memory bounds for simulation in the phase-polynomial representation. We analyze the cost of state updates and compatibility tests, then show how to compute amplitudes and Pauli expectation values, sample computational-basis outcomes, and test equality of represented states.
Theorem 2 (Efficient simulation of 3PP circuits). An n n n -qubit 3PP state admits a representation
∣ ψ ⟩ = 2 − r / 2 ∑ y ∈ F 2 r ω 8 p ( y ) ∣ x 0 ⊕ B y ⟩ , (193) |\psi\rangle= 2^{-r/2}\sum_{y\in\mathbb{F}_2^r}\omega_8^{p(y)}|x_0 \oplus By\rangle, \tag*{(193)} ∣ ψ ⟩ = 2 − r /2 y ∈ F 2 r ∑ ω 8 p ( y ) ∣ x 0 ⊕ B y ⟩ , (193) where B ∈ F 2 n × r B \in\mathbb{F}_2^{n\times r} B ∈ F 2 n × r has full column rank and p : F 2 r → Z 8 p : \mathbb{F}_2^r \to\mathbb{Z}_8 p : F 2 r → Z 8 is a third-order phase polynomial. This representation requires O ( n 3 ) O(n^3) O ( n 3 ) bits and supports the following operations.
Circuit simulation. Let C C C be a 3PP circuit made of m m m operations acting on at most n n n qubits. There exists a classical algorithm that samples the measurement record according to its exact distribution and maintains the corresponding conditional state, up to global phase, in the form (25) . Each operation takes O ( n 3 ) O(n^3) O ( n 3 ) expected time, giving a total expected runtime of
O ( m n 3 ) + T c l a s s i c a l , (194) O(mn^3) + T_{\mathrm{classical}}, \tag*{(194)} O ( m n 3 ) + T classical , (194)
where T c l a s s i c a l T_{\mathrm{classical}} T classical is the total time required for classical feedforward. The maintained state representation uses O ( n 3 ) O(n^3) O ( n 3 ) bits, excluding storage for the measurement record and classical processing.
Queries on represented states. Given a state in the form (25) , the following tasks can be performed:
(a) Compute ⟨ x ∣ ψ ⟩ \langle x|\psi\rangle ⟨ x ∣ ψ ⟩ exactly for any x ∈ F 2 n x \in\mathbb{F}_2^n x ∈ F 2 n in O ( n 3 ) O(n^3) O ( n 3 ) time.
(b) Sample x ∈ F 2 n x \in\mathbb{F}_2^n x ∈ F 2 n according to ∣ ⟨ x ∣ ψ ⟩ ∣ 2 |\langle x|\psi\rangle|^2 ∣ ⟨ x ∣ ψ ⟩ ∣ 2 in O ( n 2 ) O(n^2) O ( n 2 ) time.
(c) Compute ⟨ ψ ∣ P ∣ ψ ⟩ \langle\psi|P|\psi\rangle ⟨ ψ ∣ P ∣ ψ ⟩ exactly for any specified Pauli operator P P P in O ( n 3 ) O(n^3) O ( n 3 ) time.
(d) Given a second represented state on the same ordered qubits, decide whether the two states are equal up to global phase in O ( n 4 ) O(n^4) O ( n 4 ) time.
Proof. We first establish the cost of updating the state representation and checking measurement compatibility, then prove the bounds for queries on represented states. Throughout, we use dense coefficient arrays and ordinary Gaussian elimination, with arithmetic on phase coefficients performed modulo 8.
The affine support is specified by x 0 x_0 x 0 and B B B , requiring O ( n 2 ) O(n^2) O ( n 2 ) bits. The phase polynomial has the weighted form
p ( y ) = d + ∑ i a i y i + 2 ∑ i < j b i j y i y j + 4 ∑ i < j < k c i j k y i y j y k , (195) p(y) = d + \sum_i a_i y_i + 2 \sum_{i<j} b_{ij}y_i y_j + 4 \sum_{i<j<k} c_{ijk}y_i y_j y_k, \tag*{(195)} p ( y ) = d + i ∑ a i y i + 2 i < j ∑ b ij y i y j + 4 i < j < k ∑ c ij k y i y j y k , (195)
where d , a i ∈ Z 8 d,a_i \in\mathbb{Z}_8 d , a i ∈ Z 8 , b i j ∈ Z 4 b_{ij} \in\mathbb{Z}_4 b ij ∈ Z 4 , and c i j k ∈ F 2 c_{ijk} \in\mathbb{F}_2 c ij k ∈ F 2 . Since r ≤ n r \le n r ≤ n , storing these coefficients requires O ( n 3 ) O(n^3) O ( n 3 ) bits.
We will repeatedly use two elementary facts about polynomial updates. First, each substitution y i ↦ y i ⊕ 1 y_i \mapsto y_i \oplus1 y i ↦ y i ⊕ 1 or y i ↦ y i ⊕ y j y_i \mapsto y_i \oplus y_j y i ↦ y i ⊕ y j can be performed in O ( r 2 ) O(r^2) O ( r 2 ) time, since only the O ( r 2 ) O(r^2) O ( r 2 ) monomials containing y i y_i y i are affected, and each produces a bounded number of terms. Second, an affine Boolean function can be expanded as a weighted polynomial modulo 8 in O ( r 3 ) O(r^3) O ( r 3 ) time. Indeed, for a parity of variables,
⨁ i ∈ I y i = ∑ i ∈ I y i − 2 ∑ i < j i , j ∈ I y i y j + 4 ∑ i < j < k i , j , k ∈ I y i y j y k ( m o d 8 ) , (196) \bigoplus_{i\in I} y_i = \sum_{i\in I} y_i - 2\sum_{\substack{i<j\\i,j\in I}} y_i y_j + 4\sum_{\substack{i<j<k\\i,j,k\in I}} y_i y_j y_k \pmod8, \tag*{(196)} i ∈ I ⨁ y i = i ∈ I ∑ y i − 2 i < j i , j ∈ I ∑ y i y j + 4 i < j < k i , j , k ∈ I ∑ y i y j y k ( mod 8 ) , (196)
and an affine constant is incorporated using 1 ⊕ f = 1 − f 1 \oplus f = 1 - f 1 ⊕ f = 1 − f .
We now consider circuit evolution. Preparations append a physical coordinate and, for a ∣ + ⟩ |+\rangle ∣ + ⟩ preparation, a free support coordinate. An X X X gate changes x 0 x_0 x 0 , while a CNOT gate applies the corresponding row operation to x 0 x_0 x 0 and B B B . Neither requires changing p p p . A T T T or Z Z Z gate adds an integer multiple of the affine Boolean function describing the affected physical bit to p p p . These updates, and hence arbitrary Pauli updates, take at most O ( n 3 ) O(n^3) O ( n 3 ) time.
For a Z Z Z -type measurement, write the measured operator as Z ( v ) Z(v) Z ( v ) . Its value on a support point is determined by the affine function
f ( y ) = ⟨ v , x 0 ⊕ B y ⟩ . (197) f(y) = \langle v, x_0 \oplus By\rangle. \tag*{(197)} f ( y ) = ⟨ v , x 0 ⊕ B y ⟩ . (197)
If f f f is constant, the outcome is deterministic and the state is unchanged. Otherwise, each outcome has probability 1 / 2 1/2 1/2 and imposes one affine equation on y y y . Choose a variable with nonzero coefficient in that equation and use O ( r ) O(r) O ( r ) elementary affine substitutions to make the equation a constraint on that variable alone. Applying these substitutions to p p p costs O ( r 3 ) O(r^3) O ( r 3 ) , and updating the support parametrization costs at most O ( n r 2 ) O(nr^2) O ( n r 2 ) . Fixing the constrained variable and removing it therefore gives the conditional-state representation in O ( n 3 ) O(n^3) O ( n 3 ) time.
A measurement of a nonidentity X X X -type Pauli string of weight w w w reduces to a single-qubit measurement by Eq. (24) , using at most 2 ( w − 1 ) 2(w-1) 2 ( w − 1 ) CNOTs in total. Each CNOT updates rows of x 0 x_0 x 0 and B B B in O ( n ) O(n) O ( n ) time and leaves p p p unchanged, so the reduction adds only O ( n 2 ) O(n^2) O ( n 2 ) time. The O ( n 3 ) O(n^3) O ( n 3 ) expected cost established below therefore applies to one original Pauli-string measurement, without changing the operation count m m m or the total runtime. The identity measurement is deterministic and leaves the state unchanged.
Next, consider a proposed measurement of X a X_a X a . Gaussian elimination decides whether e a ∈ im B e_a \in\operatorname{im} B e a ∈ im B in O ( n 3 ) O(n^3) O ( n 3 ) time. If not, the measurement is compatible case (1). For outcome μ \mu μ , append e a e_a e a as a new column of B B B and replace p p p by
p ′ ( y , z ) = p ( y ) + 4 μ z . (198) p'(y,z) = p(y) + 4\mu z. \tag*{(198)} p ′ ( y , z ) = p ( y ) + 4 μ z . (198)
Both outcomes have probability 1 / 2 1/2 1/2 , and the update takes at most O ( n 3 ) O(n^3) O ( n 3 ) time. If e a ∈ im B e_a \in\operatorname{im} B e a ∈ im B , solve B t = e a Bt=e_a B t = e a and construct
D ( y ) = p ( y ⊕ t ) − p ( y ) . (199) D(y)=p(y\oplus t)-p(y). \tag*{(199)} D ( y ) = p ( y ⊕ t ) − p ( y ) . (199)
The translation y ↦ y ⊕ t y\mapsto y\oplus t y ↦ y ⊕ t uses at most r r r elementary substitutions, so constructing D D D costs O ( r 3 ) O(r^3) O ( r 3 ) . By the discrete-derivative property, D D D is a Clifford phase polynomial and therefore has only O ( r 2 ) O(r^2) O ( r 2 ) coefficients.
We now check the three internal-measurement cases and bound their updates. For case (2a), coefficient inspection determines whether D = 4 f D=4f D = 4 f for an affine Boolean function f f f . Conditioning on f ( y ) = μ f(y)=\mu f ( y ) = μ is then the same affine restriction used for Z Z Z measurements, costing O ( n 3 ) O(n^3) O ( n 3 ) time.
For case (2b), coefficient inspection first determines whether D = 2 + 4 g D=2+4g D = 2 + 4 g for a quadratic Boolean function g g g . The compatibility criterion is that the alternating matrix of its quadratic part has rank at most two, which can be checked in O ( r 3 ) O(r^3) O ( r 3 ) time. When this condition holds, binary elimination produces affine ℓ \ell ℓ and linear u , v u,v u , v , such that
g ( y ) = ℓ ( y ) ⊕ u ( y ) v ( y ) . (200) g(y)=\ell(y)\oplus u(y)v(y). \tag*{(200)} g ( y ) = ℓ ( y ) ⊕ u ( y ) v ( y ) . (200)
Here one may take u = v = 0 u=v=0 u = v = 0 when the quadratic part vanishes. Using
2 g = 2 ℓ + 2 u v − 4 ℓ u v ( m o d 8 ) , (201) 2g=2\ell+2uv-4\ell uv\pmod8, \tag*{(201)} 2 g = 2 ℓ + 2 uv − 4 ℓ uv ( mod 8 ) , (201)
we can construct the weighted coefficients of 2 g 2g 2 g in O ( r 3 ) O(r^3) O ( r 3 ) time. For the term 2 u v 2uv 2 uv , only the linear and quadratic parts of the parity expansions of u u u and v v v contribute modulo 8 8 8 . For the term 4 ℓ u v 4\ell uv 4 ℓ uv , it suffices to multiply the affine forms over F 2 \mathbb{F}_2 F 2 . Thus the conditional phase
p ′ = p − 2 ( − 1 ) μ g (202) p'=p-2(-1)^\mu g \tag*{(202)} p ′ = p − 2 ( − 1 ) μ g (202)
can be constructed within the same bound.
For case (2c), let d = D ( 0 ) d=D(0) d = D ( 0 ) . If d d d is odd, the linear coefficients of D D D determine the only possible affine Boolean function h h h with h ( 0 ) = 0 h(0)=0 h ( 0 ) = 0 satisfying
D ( y ) = d ( − 1 ) h ( y ) . (203) D(y)=d(-1)^{h(y)}. \tag*{(203)} D ( y ) = d ( − 1 ) h ( y ) . (203)
Comparing coefficients verifies this identity in polynomial time bounded by O ( r 3 ) O(r^3) O ( r 3 ) . If it holds, expanding h h h and forming
p ′ = p + ( 4 μ − d ) h (204) p'=p+(4\mu-d)h \tag*{(204)} p ′ = p + ( 4 μ − d ) h (204)
also costs O ( r 3 ) O(r^3) O ( r 3 ) . If none of these cases applies, the measurement is incompatible. Consequently, compatibility checking and every compatible conditional-state update take O ( n 3 ) O(n^3) O ( n 3 ) time.
It remains to account for sampling measurement outcomes. The possible probabilities belong to the fixed set
{ 0 , 1 2 , 1 , 2 − 2 4 , 2 + 2 4 } . (205) \left\{0,\frac{1}{2},1,\frac{2-\sqrt{2}}{4},\frac{2+\sqrt{2}}{4}\right\}. \tag*{(205)} { 0 , 2 1 , 1 , 4 2 − 2 , 4 2 + 2 } . (205)
The rational probabilities are sampled directly using fair random bits. For either irrational probability, compare a uniformly random binary expansion with successively refined rational bounds on that probability. After k k k bits and bounds of precision O ( 2 − k ) O(2^{-k}) O ( 2 − k ) , the probability that the comparison remains unresolved is O ( 2 − k ) O(2^{-k}) O ( 2 − k ) . Since the bounds can be computed in time polynomial in k k k , this procedure has constant expected runtime. Combining outcome sampling with the updates above gives O ( n 3 ) O(n^3) O ( n 3 ) expected time per operation and O ( m n 3 ) + T c l a s s i c a l O(mn^3)+T_{\mathrm{classical}} O ( m n 3 ) + T classical expected time for the circuit.
We next establish the costs of queries on represented states. For a computational-basis amplitude, Gaussian elimination decides whether
B y = x ⊕ x 0 (206) By=x\oplus x_0 \tag*{(206)} B y = x ⊕ x 0 (206)
has a solution in O ( n 3 ) O(n^3) O ( n 3 ) time. Since B B B has full column rank, any solution is unique, and
⟨ x ∣ ψ ⟩ = { 2 − r / 2 ω 8 p ( y ) , B y = x ⊕ x 0 , 0 , x ∉ x 0 ⊕ im B . (207) \langle x|\psi\rangle=
\begin{cases}
2^{-r/2}\omega_8^{p(y)}, & By=x\oplus x_0,\\
0, & x\notin x_0\oplus\operatorname{im}B.
\end{cases} \tag*{(207)} ⟨ x ∣ ψ ⟩ = { 2 − r /2 ω 8 p ( y ) , 0 , B y = x ⊕ x 0 , x ∈ / x 0 ⊕ im B . (207)
Evaluating p ( y ) p(y) p ( y ) costs O ( r 3 ) O(r^3) O ( r 3 ) , proving the amplitude bound. For computational-basis sampling, choose y y y uniformly in F 2 r \mathbb{F}_2^r F 2 r and return x 0 ⊕ B y x_0\oplus By x 0 ⊕ B y . This costs O ( n r ) = O ( n 2 ) O(nr)=O(n^2) O ( n r ) = O ( n 2 ) time.
To compute a Pauli expectation, write
P = i κ X ( a ) Z ( b ) . (208) P = i^{\kappa}X(a)Z(b). \tag*{(208)} P = i κ X ( a ) Z ( b ) . (208)
If a ∉ im B a \notin\operatorname{im} B a ∈ / im B , the translated support is disjoint from the original support and the expectation is zero. Otherwise, solve B t = a Bt=a B t = a and expand
⟨ ψ ∣ P ∣ ψ ⟩ = i κ 2 − r ∑ y ∈ F 2 r ω 8 p ( y ) − p ( y ⊕ t ) + 4 ⟨ b , x 0 ⊕ B y ⟩ . (209) \langle\psi|P|\psi\rangle= i^{\kappa}2^{-r}\sum_{y\in\mathbb{F}_2^r}\omega_8^{p(y)-p(y\oplus t)+4\langle b,x_0\oplus By\rangle}. \tag*{(209)} ⟨ ψ ∣ P ∣ ψ ⟩ = i κ 2 − r y ∈ F 2 r ∑ ω 8 p ( y ) − p ( y ⊕ t ) + 4 ⟨ b , x 0 ⊕ B y ⟩ . (209)
Constructing the exponent costs O ( n 3 ) O(n^3) O ( n 3 ) by the translation procedure above. It is a Clifford phase polynomial, so the remaining sum is a quadratic Gauss sum over Z 4 \mathbb{Z}_4 Z 4 . Reduction of the quadratic form by binary elimination evaluates this sum exactly in O ( r 3 ) O(r^3) O ( r 3 ) time, giving the claimed O ( n 3 ) O(n^3) O ( n 3 ) bound. The result can be retained exactly using a root of unity and a power of 2 \sqrt{2} 2 , including the possibility of zero.
Finally, consider equality of two represented states. Gaussian elimination checks whether their affine supports coincide in O ( n 3 ) O(n^3) O ( n 3 ) time. If they do not, the states are unequal. If they do, their support coordinates are related by an invertible affine transformation, which can also be found in O ( n 3 ) O(n^3) O ( n 3 ) time. Decompose this transformation into O ( r 2 ) O(r^2) O ( r 2 ) elementary affine substitutions and apply them to one phase polynomial. Since each substitution costs O ( r 2 ) O(r^2) O ( r 2 ) , expressing both phases in common coordinates costs O ( n 4 ) O(n^4) O ( n 4 ) time.
In these common coordinates, the states are equal up to global phase exactly when their phase difference is constant modulo 8. Uniqueness of the multilinear polynomial representation over Z 8 \mathbb{Z}_8 Z 8 makes this equivalent to the vanishing of every nonconstant coefficient of the difference. Checking these coefficients costs O ( r 3 ) O(r^3) O ( r 3 ) , completing the O ( n 4 ) O(n^4) O ( n 4 ) equality bound.
Algebra of DCP operators
This appendix develops the algebraic tools used to represent and manipulate DCP operators and subgroups. We first prove the normal form and derive explicit formulas for group operations, then describe the Howell normal form and canonical remainders used to construct canonical subgroup representations.
Proposition 2 (Normal form for DCP operators). Every DCP operator U U U on n n n qubits corresponds to a unique quadruple ( k , s , M , x ) (k,s,M,x) ( k , s , M , x ) where k ∈ Z 8 k\in\mathbb{Z}_8 k ∈ Z 8 , s ∈ Z 4 n s\in\mathbb{Z}_4^n s ∈ Z 4 n , x ∈ F 2 n x\in\mathbb{F}_2^n x ∈ F 2 n , and M M M is an n × n n\times n n × n symmetric matrix over F 2 \mathbb{F}_2 F 2 that is zero on the diagonal, such that
U = ω 8 k D ( s , M ) X ( x ) , (210) U=\omega_8^k D(s,M)X(x), \tag*{(210)} U = ω 8 k D ( s , M ) X ( x ) , (210) where D ( s , M ) D(s,M) D ( s , M ) is the diagonal Clifford operator defined by
D ( s , M ) = S s 1 ⊗ ⋯ ⊗ S s n ⋅ ∏ 1 ≤ i < j ≤ n CZ i j M i j , (211) D(s,M)=S^{s_1}\otimes\cdots\otimes S^{s_n}\cdot\prod_{1\le i<j\le n}\operatorname{CZ}_{ij}^{M_{ij}}, \tag*{(211)} D ( s , M ) = S s 1 ⊗ ⋯ ⊗ S s n ⋅ 1 ≤ i < j ≤ n ∏ CZ ij M ij , (211) and X ( x ) X(x) X ( x ) is the Pauli operator defined by
X ( x ) = X x 1 ⊗ ⋯ ⊗ X x n . (212) X(x)=X^{x_1}\otimes\cdots\otimes X^{x_n}. \tag*{(212)} X ( x ) = X x 1 ⊗ ⋯ ⊗ X x n . (212)
Proof. We first prove existence by moving all Pauli X X X factors to the right, then prove uniqueness by comparing the action on computational-basis states.
Every DCP operator can be written as a product of scalar phases, S i S_i S i , CZ i j \operatorname{CZ}_{ij} CZ ij , and X i X_i X i , since Z i = S i 2 Z_i=S_i^2 Z i = S i 2 and Y i = i X i Z i Y_i=iX_iZ_i Y i = i X i Z i . The relations
X i S i = i S i − 1 X i , X i CZ i j = Z j CZ i j X i X_iS_i=iS_i^{-1}X_i,\qquad X_i\operatorname{CZ}_{ij}=Z_j\operatorname{CZ}_{ij}X_i X i S i = i S i − 1 X i , X i CZ ij = Z j CZ ij X i
allow us to move each X i X_i X i past every diagonal generator; generators acting on disjoint qubits commute. The additional factors introduced are diagonal, with Z j = S j 2 Z_j=S_j^2 Z j = S j 2 , and all scalar phases are powers of ω 8 \omega_8 ω 8 . Thus
U = ω 8 k ( ∏ i S i s i ) ( ∏ i < j CZ i j M i j ) X ( x ) . U=\omega_8^k\left(\prod_i S_i^{s_i}\right)\left(\prod_{i<j}\operatorname{CZ}_{ij}^{M_{ij}}\right)X(x). U = ω 8 k ( i ∏ S i s i ) ( i < j ∏ CZ ij M ij ) X ( x ) .
Since S i 4 = I S_i^4=I S i 4 = I , C Z i j 2 = I \mathrm{CZ}_{ij}^2=I CZ ij 2 = I , and X i 2 = I X_i^2=I X i 2 = I , we may take k ∈ Z 8 k\in\mathbb{Z}_8 k ∈ Z 8 , s ∈ Z 4 n s\in\mathbb{Z}_4^n s ∈ Z 4 n , and x ∈ F 2 n x\in\mathbb{F}_2^n x ∈ F 2 n . The exponents M i j M_{ij} M ij uniquely specify a symmetric binary matrix with zero diagonal. This proves existence.
To prove uniqueness, suppose
ω 8 k D ( s , M ) X ( x ) = ω 8 k ′ D ( s ′ , M ′ ) X ( x ′ ) . \omega_8^k D(s,M)X(x)=\omega_8^{k'}D(s',M')X(x'). ω 8 k D ( s , M ) X ( x ) = ω 8 k ′ D ( s ′ , M ′ ) X ( x ′ ) .
Applied to any computational-basis state ∣ z ⟩ |z\rangle ∣ z ⟩ , the two sides produce nonzero multiples of ∣ z ⊕ x ⟩ |z\oplus x\rangle ∣ z ⊕ x ⟩ and ∣ z ⊕ x ′ ⟩ |z\oplus x'\rangle ∣ z ⊕ x ′ ⟩ , respectively. Hence x = x ′ x=x' x = x ′ , and cancelling the common X X X factor gives
ω 8 k D ( s , M ) = ω 8 k ′ D ( s ′ , M ′ ) . \omega_8^kD(s,M)=\omega_8^{k'}D(s',M'). ω 8 k D ( s , M ) = ω 8 k ′ D ( s ′ , M ′ ) .
Both diagonal operators fix ∣ 0 n ⟩ |0^n\rangle ∣ 0 n ⟩ , so evaluating this identity on ∣ 0 n ⟩ |0^n\rangle ∣ 0 n ⟩ gives k = k ′ k=k' k = k ′ in Z 8 \mathbb{Z}_8 Z 8 . For the standard basis vector e i e_i e i ,
D ( s , M ) ∣ e i ⟩ = i s i ∣ e i ⟩ , D(s,M)|e_i\rangle=i^{s_i}|e_i\rangle, D ( s , M ) ∣ e i ⟩ = i s i ∣ e i ⟩ ,
so s i = s i ′ s_i=s'_i s i = s i ′ in Z 4 \mathbb{Z}_4 Z 4 for every i i i . Finally, for i < j i<j i < j ,
D ( s , M ) ∣ e i ⊕ e j ⟩ = i s i + s j ( − 1 ) M i j ∣ e i ⊕ e j ⟩ . D(s,M)|e_i\oplus e_j\rangle=i^{s_i+s_j}(-1)^{M_{ij}}|e_i\oplus e_j\rangle. D ( s , M ) ∣ e i ⊕ e j ⟩ = i s i + s j ( − 1 ) M ij ∣ e i ⊕ e j ⟩ .
Since s = s ′ s=s' s = s ′ , this implies M i j = M i j ′ M_{ij}=M'_{ij} M ij = M ij ′ for every i < j i<j i < j , and therefore M = M ′ M=M' M = M ′ . All four parameters are unique.
Proposition D.1 (Group operations on DCP operators). For s ∈ Z 4 n s\in\mathbb{Z}_4^n s ∈ Z 4 n and M ∈ F 2 n × n M\in\mathbb{F}_2^{n\times n} M ∈ F 2 n × n symmetric with zero diagonal, write
φ s , M ( v ) : = s ⋅ v + 2 ∑ a < b M a b v a v b ( m o d 4 ) , v ∈ F 2 n . (213) \varphi_{s,M}(v):=s\cdot v+2\sum_{a<b}M_{ab}v_av_b\pmod4,\qquad v\in\mathbb{F}_2^n. \tag*{(213)} φ s , M ( v ) := s ⋅ v + 2 a < b ∑ M ab v a v b ( mod 4 ) , v ∈ F 2 n . (213)
so that D ( s , M ) ∣ v ⟩ = i φ s , M ( v ) ∣ v ⟩ D(s,M)|v\rangle=i^{\varphi_{s,M}(v)}|v\rangle D ( s , M ) ∣ v ⟩ = i φ s , M ( v ) ∣ v ⟩ , and let ⊙ \odot ⊙ denote the entrywise product of vectors. Given two DCP operators g 1 = ω 8 k 1 D ( s 1 , M 1 ) X ( x 1 ) g_1=\omega_8^{k_1}D(s_1,M_1)X(x_1) g 1 = ω 8 k 1 D ( s 1 , M 1 ) X ( x 1 ) and g 2 = ω 8 k 2 D ( s 2 , M 2 ) X ( x 2 ) g_2=\omega_8^{k_2}D(s_2,M_2)X(x_2) g 2 = ω 8 k 2 D ( s 2 , M 2 ) X ( x 2 ) , we have the following formulas for their product, inverse, commutator, and conjugation:
g 1 g 2 = ω 8 k 1 + k 2 + 2 φ s 2 , M 2 ( x 1 ) D ( s 1 + s 2 ⊙ ( 1 − 2 x 1 ) + 2 M 2 x 1 , M 1 + M 2 ) X ( x 1 ⊕ x 2 ) . g_1g_2=\omega_8^{k_1+k_2+2\varphi_{s_2,M_2}(x_1)}D\bigl(s_1+s_2\odot(1-2x_1)+2M_2x_1,M_1+M_2\bigr)X(x_1\oplus x_2). g 1 g 2 = ω 8 k 1 + k 2 + 2 φ s 2 , M 2 ( x 1 ) D ( s 1 + s 2 ⊙ ( 1 − 2 x 1 ) + 2 M 2 x 1 , M 1 + M 2 ) X ( x 1 ⊕ x 2 ) .
g 1 − 1 = ω 8 − k 1 + 2 φ − s 1 , M 1 ( x 1 ) D ( ( − s 1 ) ⊙ ( 1 − 2 x 1 ) + 2 M 1 x 1 , M 1 ) X ( x 1 ) . g_1^{-1}=\omega_8^{-k_1+2\varphi_{-s_1,M_1}(x_1)}D\bigl((-s_1)\odot(1-2x_1)+2M_1x_1,M_1\bigr)X(x_1). g 1 − 1 = ω 8 − k 1 + 2 φ − s 1 , M 1 ( x 1 ) D ( ( − s 1 ) ⊙ ( 1 − 2 x 1 ) + 2 M 1 x 1 , M 1 ) X ( x 1 ) .
[ g 1 , g 2 ] : = g 1 g 2 g 1 − 1 g 2 − 1 = i c Z ( z ) , c = φ s 2 , M 2 ( x 1 ) − φ s 1 , M 1 ( x 2 ) ( m o d 4 ) , [g_1,g_2]:=g_1g_2g_1^{-1}g_2^{-1}=i^cZ(z),\qquad c=\varphi_{s_2,M_2}(x_1)-\varphi_{s_1,M_1}(x_2)\pmod4, [ g 1 , g 2 ] := g 1 g 2 g 1 − 1 g 2 − 1 = i c Z ( z ) , c = φ s 2 , M 2 ( x 1 ) − φ s 1 , M 1 ( x 2 ) ( mod 4 ) ,
z = M 2 x 1 + s 2 ⊙ x 1 + M 1 x 2 + s 1 ⊙ x 2 ( m o d 2 ) , z=M_2x_1+s_2\odot x_1+M_1x_2+s_1\odot x_2\pmod2, z = M 2 x 1 + s 2 ⊙ x 1 + M 1 x 2 + s 1 ⊙ x 2 ( mod 2 ) ,
where Z ( z ) : = Z 1 z 1 ⊗ ⋯ ⊗ Z n z n Z(z):=Z_1^{z_1}\otimes\cdots\otimes Z_n^{z_n} Z ( z ) := Z 1 z 1 ⊗ ⋯ ⊗ Z n z n .
g 1 g 2 g 1 − 1 = ω 8 k 2 + 2 c D ( s 2 + 2 z , M 2 ) X ( x 2 ) , g_1g_2g_1^{-1}=\omega_8^{k_2+2c}D(s_2+2z,M_2)X(x_2), g 1 g 2 g 1 − 1 = ω 8 k 2 + 2 c D ( s 2 + 2 z , M 2 ) X ( x 2 ) ,
with ( c , z ) (c,z) ( c , z ) as in the commutator above.
Proof. We first compute how conjugation by X ( x ) X(x) X ( x ) acts on a diagonal DCP operator. We then derive the product and inverse formulas, and obtain the commutator by comparing the products in the two possible orders. For binary vectors v , x v,x v , x , expanding v a ⊕ x a = v a + x a − 2 v a x a v_a\oplus x_a=v_a+x_a-2v_ax_a v a ⊕ x a = v a + x a − 2 v a x a gives
φ s , M ( v ⊕ x ) = φ s , M ( x ) + φ t , M ( v ) ( m o d 4 ) , (214) \varphi_{s,M}(v\oplus x)=\varphi_{s,M}(x)+\varphi_{t,M}(v)\pmod4, \tag*{(214)} φ s , M ( v ⊕ x ) = φ s , M ( x ) + φ t , M ( v ) ( mod 4 ) , (214)
t = s ⊙ ( 1 − 2 x ) + 2 M x ( m o d 4 ) . (215) t=s\odot(1-2x)+2Mx\pmod4. \tag*{(215)} t = s ⊙ ( 1 − 2 x ) + 2 M x ( mod 4 ) . (215)
Indeed, the linear terms contribute s a x a + s a ( 1 − 2 x a ) v a s_a x_a+s_a(1-2x_a)v_a s a x a + s a ( 1 − 2 x a ) v a , while each quadratic term satisfies
2 M a b ( v a ⊕ x a ) ( v b ⊕ x b ) = 2 M a b ( v a v b + v a x b + x a v b + x a x b ) ( m o d 4 ) . 2M_{ab}(v_a\oplus x_a)(v_b\oplus x_b)=2M_{ab}(v_av_b+v_ax_b+x_av_b+x_ax_b)\pmod{4}. 2 M ab ( v a ⊕ x a ) ( v b ⊕ x b ) = 2 M ab ( v a v b + v a x b + x a v b + x a x b ) ( mod 4 ) .
Collecting the constant, linear, and quadratic terms gives Eq. (D.5). Consequently,
X ( x ) D ( s , M ) X ( x ) = i φ s , M ( x ) D ( s ⊙ ( 1 − 2 x ) + 2 M x , M ) . (216) X(x)D(s,M)X(x)=i^{\varphi_{s,M}(x)}D\bigl(s\mathbin{\odot}(1-2x)+2Mx,M\bigr). \tag*{(216)} X ( x ) D ( s , M ) X ( x ) = i φ s , M ( x ) D ( s ⊙ ( 1 − 2 x ) + 2 M x , M ) . (216)
For the product formula, write
g 1 g 2 = ω 8 k 1 + k 2 D ( s 1 , M 1 ) [ X ( x 1 ) D ( s 2 , M 2 ) X ( x 1 ) ] X ( x 1 ⊕ x 2 ) . g_1g_2=\omega_8^{k_1+k_2}D(s_1,M_1)\bigl[X(x_1)D(s_2,M_2)X(x_1)\bigr]X(x_1\oplus x_2). g 1 g 2 = ω 8 k 1 + k 2 D ( s 1 , M 1 ) [ X ( x 1 ) D ( s 2 , M 2 ) X ( x 1 ) ] X ( x 1 ⊕ x 2 ) .
Applying Eq. (D.7) and using
D ( s , M ) D ( s ′ , M ′ ) = D ( s + s ′ , M + M ′ ) D(s,M)D(s',M')=D(s+s',M+M') D ( s , M ) D ( s ′ , M ′ ) = D ( s + s ′ , M + M ′ )
gives the stated expression.
For the inverse formula, note that D ( s 1 , M 1 ) − 1 = D ( − s 1 , M 1 ) D(s_1,M_1)^{-1}=D(-s_1,M_1) D ( s 1 , M 1 ) − 1 = D ( − s 1 , M 1 ) . Hence
g 1 − 1 = ω 8 − k 1 [ X ( x 1 ) D ( − s 1 , M 1 ) X ( x 1 ) ] X ( x 1 ) , g_1^{-1}=\omega_8^{-k_1}\bigl[X(x_1)D(-s_1,M_1)X(x_1)\bigr]X(x_1), g 1 − 1 = ω 8 − k 1 [ X ( x 1 ) D ( − s 1 , M 1 ) X ( x 1 ) ] X ( x 1 ) ,
and another application of Eq. (D.7) gives the result.
To obtain the commutator, let
a 12 = s 1 + s 2 ⊙ ( 1 − 2 x 1 ) + 2 M 2 x 1 , a 21 = s 2 + s 1 ⊙ ( 1 − 2 x 2 ) + 2 M 1 x 2 \begin{aligned}
a_{12}&=s_1+s_2\mathbin{\odot}(1-2x_1)+2M_2x_1,\\
a_{21}&=s_2+s_1\mathbin{\odot}(1-2x_2)+2M_1x_2
\end{aligned} a 12 a 21 = s 1 + s 2 ⊙ ( 1 − 2 x 1 ) + 2 M 2 x 1 , = s 2 + s 1 ⊙ ( 1 − 2 x 2 ) + 2 M 1 x 2
be the linear parameters in the product formulas for g 1 g 2 g_1g_2 g 1 g 2 and g 2 g 1 g_2g_1 g 2 g 1 . Their difference satisfies
a 12 − a 21 = 2 ( M 2 x 1 + s 2 ⊙ x 1 + M 1 x 2 + s 1 ⊙ x 2 ) = 2 z ( m o d 4 ) . a_{12}-a_{21}=2(M_2x_1+s_2\mathbin{\odot}x_1+M_1x_2+s_1\mathbin{\odot}x_2)=2z\pmod{4}. a 12 − a 21 = 2 ( M 2 x 1 + s 2 ⊙ x 1 + M 1 x 2 + s 1 ⊙ x 2 ) = 2 z ( mod 4 ) .
The two products have the same quadratic parameter M 1 + M 2 M_1+M_2 M 1 + M 2 and the same X X X parameter x 1 ⊕ x 2 x_1\oplus x_2 x 1 ⊕ x 2 . Their scalar factors differ by i c i^c i c , where
c = φ s 2 , M 2 ( x 1 ) − φ s 1 , M 1 ( x 2 ) ( m o d 4 ) . c=\varphi_{s_2,M_2}(x_1)-\varphi_{s_1,M_1}(x_2)\pmod{4}. c = φ s 2 , M 2 ( x 1 ) − φ s 1 , M 1 ( x 2 ) ( mod 4 ) .
Since D ( 2 z , 0 ) = Z ( z ) D(2z,0)=Z(z) D ( 2 z , 0 ) = Z ( z ) , it follows that
g 1 g 2 = i c Z ( z ) g 2 g 1 . g_1g_2=i^cZ(z)g_2g_1. g 1 g 2 = i c Z ( z ) g 2 g 1 .
Multiplying on the right by g 1 − 1 g 2 − 1 g_1^{-1}g_2^{-1} g 1 − 1 g 2 − 1 proves the commutator formula.
Finally,
g 1 g 2 g 1 − 1 = [ [ g 1 , g 2 ] ] g 2 = i c Z ( z ) ω 8 k 2 D ( s 2 , M 2 ) X ( x 2 ) = ω 8 k 2 + 2 c D ( s 2 + 2 z , M 2 ) X ( x 2 ) , \begin{aligned}
g_1g_2g_1^{-1}&=[[g_1,g_2]]g_2\\
&=i^cZ(z)\omega_8^{k_2}D(s_2,M_2)X(x_2)\\
&=\omega_8^{k_2+2c}D(s_2+2z,M_2)X(x_2),
\end{aligned} g 1 g 2 g 1 − 1 = [[ g 1 , g 2 ]] g 2 = i c Z ( z ) ω 8 k 2 D ( s 2 , M 2 ) X ( x 2 ) = ω 8 k 2 + 2 c D ( s 2 + 2 z , M 2 ) X ( x 2 ) ,
which proves the conjugation formula.
Howell normal form and canonical remainders
Howell normal form generalizes reduced row-echelon form from fields to rings Z m \mathbb{Z}_m Z m . It provides a canonical generating matrix for a submodule and a reduction procedure for choosing representatives of its cosets. Throughout, we fix the coordinate order and represent elements of Z m \mathbb{Z}_m Z m by integers in { 0 , … , m − 1 } \{0,\ldots,m-1\} { 0 , … , m − 1 } .
Definition D.1 (Howell normal form). Let N ≤ Z m d N\leq\mathbb{Z}_m^d N ≤ Z m d . A matrix H H H with nonzero rows h 1 , … , h r h_1,\ldots,h_r h 1 , … , h r is a Howell normal form of N N N if its rows generate N N N and:
The first nonzero entry of h i h_i h i occurs in column j i j_i j i , with j 1 < ⋯ < j r j_1<\cdots<j_r j 1 < ⋯ < j r .
Each pivot p i : = H i , j i p_i:=H_{i,j_i} p i := H i , j i is a positive divisor of m m m .
Entries above a pivot satisfy 0 ≤ H ℓ , j i < p i 0 \le H_{\ell,j_i} < p_i 0 ≤ H ℓ , j i < p i for ℓ < i \ell< i ℓ < i .
For every j ∈ { 1 , … , d } j \in\{1,\ldots,d\} j ∈ { 1 , … , d } ,
{ a ∈ N : a 1 = ⋯ = a j − 1 = 0 } = span Z m { h i : j i ≥ j } . (217) \{a \in N : a_1 = \cdots= a_{j-1} = 0\} = \operatorname{span}_{\mathbb{Z}_m}\{h_i : j_i \ge j\}. \tag*{(217)} { a ∈ N : a 1 = ⋯ = a j − 1 = 0 } = span Z m { h i : j i ≥ j } . (217)
Zero rows are omitted.
The last condition ensures that cancellations in early coordinates are fully captured by the later rows. For example, over Z 8 \mathbb{Z}_8 Z 8 , the row ( 2 , 1 ) (2,1) ( 2 , 1 ) alone is in echelon form but not Howell form: multiplying it by 4 4 4 gives ( 0 , 4 ) (0,4) ( 0 , 4 ) . The Howell normal form of the module it generates is
H = ( 2 1 0 4 ) . (218) H = \begin{pmatrix} 2 & 1 \\ 0 & 4 \end{pmatrix}. \tag*{(218)} H = ( 2 0 1 4 ) . (218)
Every submodule has a unique Howell normal form. Given an s × d s \times d s × d generating matrix, this form can be computed in polynomial time [72 ] . Thus it depends only on the embedded submodule, not on its chosen generators. Since pivot positions are distinct, it has at most d d d nonzero rows.
The following lemma gives the reduction procedure used to choose canonical DCP lifts.
Lemma D.1 (Canonical remainders). Let N ≤ Z m d N \leq\mathbb{Z}_m^d N ≤ Z m d have Howell normal form H H H , with pivot positions j 1 , … , j r j_1,\ldots,j_r j 1 , … , j r and pivots p 1 , … , p r p_1,\ldots,p_r p 1 , … , p r . Every coset of N N N contains exactly one vector a a a satisfying
0 ≤ a j i < p i ( i = 1 , … , r ) . (219) 0 \leq a_{j_i} < p_i \qquad(i=1,\ldots,r). \tag*{(219)} 0 ≤ a j i < p i ( i = 1 , … , r ) . (219) This vector can be computed by successively reducing the pivot coordinates using the rows of H H H .
Proof. We first construct a reduced representative, then prove its uniqueness.
Start with any representative a a a of the coset. At step i i i , write its current pivot coordinate as
a j i = q i p i + t i , 0 ≤ t i < p i , (220) a_{j_i} = q_i p_i + t_i, \qquad0 \leq t_i < p_i, \tag*{(220)} a j i = q i p i + t i , 0 ≤ t i < p i , (220)
and replace a a a by a − q i h i a-q_i h_i a − q i h i , with arithmetic performed modulo m m m . This preserves the coset and makes the j i j_i j i -th coordinate equal to t i t_i t i . Since h i h_i h i vanishes before column j i j_i j i , previously reduced pivot coordinates remain unchanged. After all rows have been processed, Eq. (D.10) holds.
For uniqueness, suppose a a a and b b b are distinct reduced representatives of the same coset. Then c : = a − b ∈ N c := a-b \in N c := a − b ∈ N . Let j j j be the first nonzero coordinate of c c c . By Eq. (D.8), c c c is a linear combination of rows whose pivots occur at or after j j j . If j j j were not a pivot position, all such rows would vanish in column j j j , a contradiction. Hence j = j i j=j_i j = j i for some i i i , and c j i c_{j_i} c j i is a multiple of p i p_i p i in Z m \mathbb{Z}_m Z m .
Since p i p_i p i divides m m m , the integer a j i − b j i a_{j_i}-b_{j_i} a j i − b j i is therefore divisible by p i p_i p i . But both coordinates lie in { 0 , … , p i − 1 } \{0,\ldots,p_i-1\} { 0 , … , p i − 1 } , so
− ( p i − 1 ) ≤ a j i − b j i ≤ p i − 1. (221) -(p_i-1) \leq a_{j_i}-b_{j_i} \leq p_i-1. \tag*{(221)} − ( p i − 1 ) ≤ a j i − b j i ≤ p i − 1. (221)
The only multiple of p i p_i p i in this interval is zero, contradicting the choice of j j j . Thus the reduced representative is unique. □
Write rem H ( a ) \operatorname{rem}_H(a) rem H ( a ) for this unique representative of a + N a+N a + N . The lemma immediately gives
a ∈ N ⟺ rem H ( a ) = 0 , (222) a \in N \Longleftrightarrow\operatorname{rem}_H(a)=0, \tag*{(222)} a ∈ N ⟺ rem H ( a ) = 0 , (222)
a + N = b + N ⟺ rem H ( a ) = rem H ( b ) . (223) a+N=b+N \Longleftrightarrow\operatorname{rem}_H(a)=\operatorname{rem}_H(b). \tag*{(223)} a + N = b + N ⟺ rem H ( a ) = rem H ( b ) . (223)
Once H H H is known, reduction takes O ( r d ) O(rd) O ( r d ) coordinate operations and integer divisions on representatives smaller than m m m . In particular, for the fixed modulus m = 8 m=8 m = 8 , it takes O ( d 2 ) O(d^2) O ( d 2 ) time. The remainder map need not be linear; it selects representatives of quotient classes without asserting that the quotient splits.
To apply this construction to a DCP subgroup G G G , take
N = ι ( Δ ( G ) ) ≤ Z 8 d , d = 1 + n + ( n 2 ) , (224) N=\iota(\Delta(G))\leq\mathbb{Z}_8^d,\qquad d=1+n+\binom{n}{2}, \tag*{(224)} N = ι ( Δ ( G )) ≤ Z 8 d , d = 1 + n + ( 2 n ) , (224)
and let H H H be its Howell normal form. For a lift h j = D j X ( x ( j ) ) ∈ G h_j=D_jX(x^{(j)})\in G h j = D j X ( x ( j ) ) ∈ G , define D ~ j \widetilde{D}_j D j by
ι ( D ~ j ) = rem H ( ι ( D j ) ) . (225) \iota(\widetilde{D}_j)=\operatorname{rem}_H\bigl(\iota(D_j)\bigr). \tag*{(225)} ι ( D j ) = rem H ( ι ( D j ) ) . (225)
This is a valid diagonal DCP operator: reduction changes ι ( D j ) \iota(D_j) ι ( D j ) by an element of ι ( Δ ( G ) ) \iota(\Delta(G)) ι ( Δ ( G )) , so the result remains in the image of ι \iota ι . Moreover, D ~ j D j − 1 ∈ Δ ( G ) \widetilde{D}_jD_j^{-1}\in\Delta(G) D j D j − 1 ∈ Δ ( G ) , and hence
h ~ j : = D ~ j X ( x ( j ) ) = ( D ~ j D j − 1 ) h j ∈ G . (226) \widetilde{h}_j:=\widetilde{D}_jX(x^{(j)})=(\widetilde{D}_jD_j^{-1})h_j\in G. \tag*{(226)} h j := D j X ( x ( j ) ) = ( D j D j − 1 ) h j ∈ G . (226)
All lifts of x ( j ) x^{(j)} x ( j ) have diagonal coordinate vectors in the same coset of N N N . Therefore h ~ j \widetilde{h}_j h j depends only on G G G , x ( j ) x^{(j)} x ( j ) , and the fixed coordinate order, not on the initial lift.
DCP tableaux: equivalence and update rules
This appendix provides the remaining details for comparing and updating DCP tableaux. We give a polynomial-time test for whether two tableaux represent the same pure state, then prove the stabilizer update rules for Z Z Z -type measurements.
Equivalence of DCP tableaux
The stabilizing closure introduced in § 2 identifies two DCP-stabilizer groups precisely when they have the same fixed space. Here we give a direct polynomial-time test for this equivalence in the pure-state case.
Let G a ≤ D n G_a\leq D^n G a ≤ D n be a DCP-stabilizer group for ∣ ψ a ⟩ |\psi_a\rangle ∣ ψ a ⟩ , a ∈ { 1 , 2 } a\in\{1,2\} a ∈ { 1 , 2 } , and retain a support representative x a ∈ supp ( ψ a ) x_a\in\operatorname{supp}(\psi_a) x a ∈ supp ( ψ a ) . Thus the data to be compared are
T a = ( G a , x a ) , Fix ( G a ) = C ∣ ψ a ⟩ . (227) T_a=(G_a,x_a),\qquad\operatorname{Fix}(G_a)=\mathbb{C}|\psi_a\rangle. \tag*{(227)} T a = ( G a , x a ) , Fix ( G a ) = C ∣ ψ a ⟩ . (227)
Such a representative is already part of the phase-polynomial description in Eq. (25) ; it may equally be carried alongside the canonical group representation. There is no need for separate update rules: its affine support is updated by the rules of Section III.
Set V a = X ( G a ) V_a=X(G_a) V a = X ( G a ) . Since the fixed space of G a G_a G a is one-dimensional, Theorem 3 implies
supp ( ψ a ) = x a ⊕ V a . (228) \operatorname{supp}(\psi_a)=x_a\oplus V_a. \tag*{(228)} supp ( ψ a ) = x a ⊕ V a . (228)
Consequently the supports agree if and only if
V 1 = V 2 and x 1 ⊕ x 2 ∈ V 1 . (229) V_1=V_2\quad\text{and}\quad x_1\oplus x_2\in V_1. \tag*{(229)} V 1 = V 2 and x 1 ⊕ x 2 ∈ V 1 . (229)
Suppose this test passes, write the common space as V V V , and choose a basis v ( 1 ) , … , v ( r ) v^{(1)},\ldots,v^{(r)} v ( 1 ) , … , v ( r ) of V V V . For every i i i , choose lifts
g a , i ∈ G a , π ( g a , i ) = v ( i ) , (230) g_{a,i}\in G_a,\qquad\pi(g_{a,i})=v^{(i)}, \tag*{(230)} g a , i ∈ G a , π ( g a , i ) = v ( i ) , (230)
and define the diagonal quotient
δ i : = g 1 , i g 2 , i − 1 ∈ ker π . (231) \delta_i:=g_{1,i}g_{2,i}^{-1}\in\ker\pi. \tag*{(231)} δ i := g 1 , i g 2 , i − 1 ∈ ker π . (231)
The lifts can be obtained by row reduction of the X X X -parts while carrying the corresponding DCP operators.
Proposition E.1 (Tableau-equivalence criterion). The tableaux T 1 T_1 T 1 and T 2 T_2 T 2 represent the same state up to global phase if and only if Eq. (E.3) holds and every δ i \delta_i δ i acts as the identity on the common support S = x 1 ⊕ V S=x_1\oplus V S = x 1 ⊕ V .
Proof. If the states agree up to global phase, their supports agree, giving Eq. (E.3). Moreover, both g 1 , i g_{1,i} g 1 , i and g 2 , i g_{2,i} g 2 , i fix the same state. Their quotient is diagonal, so it must act as the identity on every computational-basis vector with nonzero amplitude, hence on all of S S S .
Conversely, suppose the stated conditions hold and write
∣ ψ a ⟩ = ∑ x ∈ S α a ( x ) ∣ x ⟩ . (232) |\psi_a\rangle=\sum_{x\in S}\alpha_a(x)|x\rangle. \tag*{(232)} ∣ ψ a ⟩ = x ∈ S ∑ α a ( x ) ∣ x ⟩ . (232)
Decompose each lift as g a , i = D a , i X ( v ( i ) ) g_{a,i}=D_{a,i}X(v^{(i)}) g a , i = D a , i X ( v ( i ) ) , with D a , i D_{a,i} D a , i diagonal, and write D a , i ∣ x ⟩ = d a , i ( x ) ∣ x ⟩ D_{a,i}|x\rangle=d_{a,i}(x)|x\rangle D a , i ∣ x ⟩ = d a , i ( x ) ∣ x ⟩ . The stabilizer equations give
α a ( x ) = d a , i ( x ) α a ( x ⊕ v ( i ) ) . (233) \alpha_a(x)=d_{a,i}(x)\alpha_a\left(x\oplus v^{(i)}\right). \tag*{(233)} α a ( x ) = d a , i ( x ) α a ( x ⊕ v ( i ) ) . (233)
Since δ i = D 1 , i D 2 , i − 1 \delta_i=D_{1,i}D_{2,i}^{-1} δ i = D 1 , i D 2 , i − 1 is the identity on S S S , we have d 1 , i ( x ) = d 2 , i ( x ) d_{1,i}(x)=d_{2,i}(x) d 1 , i ( x ) = d 2 , i ( x ) there. Hence α 1 ( x ) / α 2 ( x ) \alpha_1(x)/\alpha_2(x) α 1 ( x ) / α 2 ( x ) is invariant under translation by every v ( i ) v^{(i)} v ( i ) . These translations connect all points of S S S , so this ratio is constant and ∣ ψ 1 ⟩ |\psi_1\rangle ∣ ψ 1 ⟩ and ∣ ψ 2 ⟩ |\psi_2\rangle ∣ ψ 2 ⟩ differ only by a global phase. □ \square □
It remains only to make the identity test explicit. Write
δ i = ω 8 k i D ( s i , M i ) , (234) \delta_i = \omega_8^{k_i} D(s_i,M_i), \tag*{(234)} δ i = ω 8 k i D ( s i , M i ) , (234)
and let B B B be the matrix with columns v ( 1 ) , … , v ( r ) v^{(1)},\ldots,v^{(r)} v ( 1 ) , … , v ( r ) . Its phase on a basis vector is the Clifford phase polynomial
F i ( x ) = k i + 2 s i ⋅ x + 4 ∑ j < ℓ ( M i ) j ℓ x j x ℓ ( m o d 8 ) . (235) F_i(x) = k_i + 2s_i \cdot x + 4\sum_{j<\ell}(M_i)_{j\ell}x_jx_\ell\pmod8. \tag*{(235)} F i ( x ) = k i + 2 s i ⋅ x + 4 j < ℓ ∑ ( M i ) j ℓ x j x ℓ ( mod 8 ) . (235)
By Corollary A.1 and Theorem A.3 , the restriction c ↦ F i ( x 1 ⊕ B c ) c \mapsto F_i(x_1 \oplus Bc) c ↦ F i ( x 1 ⊕ B c ) has Boolean degree at most two, with its linear and quadratic coefficients divisible by 2 and 4, respectively. It is therefore identically zero if and only if it vanishes at
c = 0 , c = e j , c = e j ⊕ e ℓ ( 1 ≤ j < ℓ ≤ r ) . (236) c=0,\qquad c=e_j,\qquad c=e_j\oplus e_\ell\quad(1\leq j<\ell\leq r). \tag*{(236)} c = 0 , c = e j , c = e j ⊕ e ℓ ( 1 ≤ j < ℓ ≤ r ) . (236)
Thus each diagonal quotient requires only O ( r 2 ) O(r^2) O ( r 2 ) phase evaluations. The support comparison, construction of the lifts, and all phase tests are polynomial-time operations. The result is independent of the chosen lifts: two lifts of the same v ( i ) v^{(i)} v ( i ) differ by a diagonal stabilizer, which acts identically on the corresponding support.
Measurement update rules for DCP tableaux
Proposition 10 (Updating under Z-measurements). Let ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ be a DCP state, let G = ⟨ g 1 , … , g m ⟩ G=\langle g_1,\ldots,g_m\rangle G = ⟨ g 1 , … , g m ⟩ be a DCP-stabilizer group for ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ , and let z z z be a product of Pauli Z operators.
(a) (Random outcome.) Suppose that z z z anticommutes with some element of G G G , and let
K = C G ( z ) = { g ∈ G : g z = z g } . K=C_G(z)=\{g\in G:gz=zg\}. K = C G ( z ) = { g ∈ G : g z = z g } . Measuring z z z yields each outcome ϵ ∈ { + 1 , − 1 } \epsilon\in\{+1,-1\} ϵ ∈ { + 1 , − 1 } with probability 1 2 \frac{1}{2} 2 1 , and
H ϵ = ⟨ K , ϵ z ⟩ H_\epsilon=\langle K,\epsilon z\rangle H ϵ = ⟨ K , ϵz ⟩ is a DCP-stabilizer group for the post-measurement state. In the canonical representation of Definition 12, a generating set for K K K is obtained by retaining all diagonal generators, choosing an anticommuting lift g j g_j g j , and replacing every other anticommuting lift g i g_i g i by g i g j g_ig_j g i g j . Thus the post-measurement update amounts to replacing g j g_j g j by ϵ z \epsilon z ϵz after these row operations.
(b) (Deterministic outcome.) If z z z commutes with every element of G G G , the outcome ϵ ∈ { + 1 , − 1 } \epsilon\in\{+1,-1\} ϵ ∈ { + 1 , − 1 } is determined: it is the unique sign for which ϵ z ∈ D ( ψ ) \epsilon z\in D(\psi) ϵz ∈ D ( ψ ) . The state is unchanged, so G G G remains a DCP-stabilizer group for it.
Proof. Let us first prove (a), starting with the outcome probabilities. Write z = Z ( v ) z=Z(v) z = Z ( v ) , and choose t ∈ G t\in G t ∈ G that anticommutes with z z z . Since t t t fixes ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ and satisfies t † z t = − z t^\dagger zt=-z t † z t = − z , we have
⟨ ψ ∣ z ∣ ψ ⟩ = ⟨ ψ ∣ t † z t ∣ ψ ⟩ = − ⟨ ψ ∣ z ∣ ψ ⟩ . (237) \langle\psi|z|\psi\rangle=\langle\psi|t^\dagger zt|\psi\rangle=-\langle\psi|z|\psi\rangle. \tag*{(237)} ⟨ ψ ∣ z ∣ ψ ⟩ = ⟨ ψ ∣ t † z t ∣ ψ ⟩ = − ⟨ ψ ∣ z ∣ ψ ⟩ . (237)
Thus ⟨ ψ ∣ z ∣ ψ ⟩ = 0 \langle\psi|z|\psi\rangle=0 ⟨ ψ ∣ z ∣ ψ ⟩ = 0 . Hence, using the projector Π ϵ = ( I + ϵ z ) / 2 \Pi_\epsilon=(I+\epsilon z)/2 Π ϵ = ( I + ϵz ) /2 , we have
Pr ( ϵ ) = ⟨ ψ ∣ Π ϵ ∣ ψ ⟩ = 1 2 . (238) \Pr(\epsilon)=\langle\psi|\Pi_\epsilon|\psi\rangle=\frac{1}{2}. \tag*{(238)} Pr ( ϵ ) = ⟨ ψ ∣ Π ϵ ∣ ψ ⟩ = 2 1 . (238)
It remains to show that Fix ( H ϵ ) = C Π ϵ ∣ ψ ⟩ \operatorname{Fix}(H_\epsilon)=\mathbb{C}\Pi_\epsilon|\psi\rangle Fix ( H ϵ ) = C Π ϵ ∣ ψ ⟩ . For the ⊇ \supseteq ⊇ inclusion, every element of K K K commutes with Π ϵ \Pi_\epsilon Π ϵ and fixes ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ , while ( ϵ z ) Π ϵ = Π ϵ (\epsilon z)\Pi_\epsilon=\Pi_\epsilon ( ϵz ) Π ϵ = Π ϵ . Thus, H ϵ H_\epsilon H ϵ fixes Π ϵ ∣ ψ ⟩ \Pi_\epsilon|\psi\rangle Π ϵ ∣ ψ ⟩ , and C Π ϵ ∣ ψ ⟩ ⊆ Fix ( H ϵ ) \mathbb{C}\Pi_\epsilon|\psi\rangle\subseteq\operatorname{Fix}(H_\epsilon) C Π ϵ ∣ ψ ⟩ ⊆ Fix ( H ϵ ) .
We now prove the reverse inclusion. Let ∣ φ ⟩ ∈ Fix ( H ϵ ) |\varphi\rangle\in\operatorname{Fix}(H_\epsilon) ∣ φ ⟩ ∈ Fix ( H ϵ ) . Since t t t anticommutes with z z z , both t 2 t^2 t 2 and t − 1 k t t^{-1}kt t − 1 k t commute with z z z for every k ∈ K k\in K k ∈ K , and therefore belong to K K K . Consequently, ( I + t ) ∣ φ ⟩ (I+t)|\varphi\rangle ( I + t ) ∣ φ ⟩ is fixed by both K K K and t t t . Moreover, G = ⟨ K , t ⟩ G=\langle K,t\rangle G = ⟨ K , t ⟩ . Indeed, every element g ∈ G g\in G g ∈ G either commutes or anticommutes with z z z by Lemma 6. In the first case, g ∈ K g\in K g ∈ K ; in the second, t − 1 g ∈ K t^{-1}g\in K t − 1 g ∈ K , and therefore g ∈ t K g\in tK g ∈ t K and G = ⟨ K , t ⟩ G=\langle K,t\rangle G = ⟨ K , t ⟩ . Hence,
( I + t ) ∣ φ ⟩ ∈ Fix ( G ) = C ∣ ψ ⟩ . (239) (I+t)|\varphi\rangle\in\operatorname{Fix}(G)=\mathbb{C}|\psi\rangle. \tag*{(239)} ( I + t ) ∣ φ ⟩ ∈ Fix ( G ) = C ∣ ψ ⟩ . (239)
Moreover, z ∣ φ ⟩ = ϵ ∣ φ ⟩ z|\varphi\rangle=\epsilon|\varphi\rangle z ∣ φ ⟩ = ϵ ∣ φ ⟩ and z t = − t z zt=-tz z t = − t z , so
∣ φ ⟩ = Π ϵ ( I + t ) ∣ φ ⟩ ∈ C Π ϵ ∣ ψ ⟩ . (240) |\varphi\rangle=\Pi_\epsilon(I+t)|\varphi\rangle\in\mathbb{C}\Pi_\epsilon|\psi\rangle. \tag*{(240)} ∣ φ ⟩ = Π ϵ ( I + t ) ∣ φ ⟩ ∈ C Π ϵ ∣ ψ ⟩ . (240)
This proves the reverse inclusion. Since Π ϵ ∣ ψ ⟩ ≠ 0 \Pi_\epsilon|\psi\rangle\ne0 Π ϵ ∣ ψ ⟩ = 0 , the fixed space is one-dimensional.
We now verify that the stated generator update produces K K K . By Proposition 5, it suffices to obtain generators of Δ ( K ) \Delta(K) Δ ( K ) and lifts of a basis of X ( K ) X(K) X ( K ) . We will show that the diagonal generators can be retained, and that the stated row operations produce the required lifts.
First, every diagonal element of G G G commutes with z z z , so Δ ( K ) = Δ ( G ) \Delta(K)=\Delta(G) Δ ( K ) = Δ ( G ) . Thus the original diagonal generators already generate Δ ( K ) \Delta(K) Δ ( K ) .
It remains to construct lifts of a basis of X ( K ) X(K) X ( K ) . By Lemma 6, an element of G G G with X-part x x x commutes with z = Z ( v ) z=Z(v) z = Z ( v ) exactly when ⟨ x , v ⟩ = 0 \langle x,v\rangle=0 ⟨ x , v ⟩ = 0 . Therefore,
X ( K ) = X ( G ) ∩ v ⊥ . (241) X(K)=X(G)\cap v^{\perp}. \tag*{(241)} X ( K ) = X ( G ) ∩ v ⊥ . (241)
Let g 1 , … , g r g_1,\ldots,g_r g 1 , … , g r be the original lifts, whose X-parts x ( 1 ) , … , x ( r ) x^{(1)},\ldots,x^{(r)} x ( 1 ) , … , x ( r ) form a basis of X ( G ) X(G) X ( G ) . Choose an anticommuting lift g j g_j g j , so that ⟨ x ( j ) , v ⟩ = 1 \langle x^{(j)},v\rangle=1 ⟨ x ( j ) , v ⟩ = 1 . For each i ≠ j i\ne j i = j , define
h i = { g i , ⟨ x ( i ) , v ⟩ = 0 , g i g j , ⟨ x ( i ) , v ⟩ = 1. (242) h_i=
\begin{cases}
g_i, & \langle x^{(i)},v\rangle=0,\\
g_i g_j, & \langle x^{(i)},v\rangle=1.
\end{cases} \tag*{(242)} h i = { g i , g i g j , ⟨ x ( i ) , v ⟩ = 0 , ⟨ x ( i ) , v ⟩ = 1. (242)
Each h i h_i h i commutes with z z z , and its X-part is
y ( i ) = x ( i ) + ⟨ x ( i ) , v ⟩ x ( j ) . (243) y^{(i)}=x^{(i)}+\langle x^{(i)},v\rangle x^{(j)}. \tag*{(243)} y ( i ) = x ( i ) + ⟨ x ( i ) , v ⟩ x ( j ) . (243)
We must show that the vectors y ( i ) y^{(i)} y ( i ) , for i ≠ j i\ne j i = j , form a basis of X ( K ) X(K) X ( K ) . We first show that the y ( i ) y^{(i)} y ( i ) span X ( K ) X(K) X ( K ) . Let x ∈ X ( K ) x\in X(K) x ∈ X ( K ) and expand it in the original basis:
x = ∑ i = 1 r a i x ( i ) . (244) x=\sum_{i=1}^{r}a_i x^{(i)}. \tag*{(244)} x = i = 1 ∑ r a i x ( i ) . (244)
Since ⟨ x , v ⟩ = 0 \langle x,v\rangle=0 ⟨ x , v ⟩ = 0 and ⟨ x ( j ) , v ⟩ = 1 \langle x^{(j)},v\rangle=1 ⟨ x ( j ) , v ⟩ = 1 , we obtain
0 = a j + ∑ i ≠ j a i ⟨ x ( i ) , v ⟩ , (245) 0=a_j+\sum_{i\ne j}a_i\langle x^{(i)},v\rangle, \tag*{(245)} 0 = a j + i = j ∑ a i ⟨ x ( i ) , v ⟩ , (245)
so a j = ∑ i ≠ j a i ⟨ x ( i ) , v ⟩ a_j=\sum_{i\ne j}a_i\langle x^{(i)},v\rangle a j = ∑ i = j a i ⟨ x ( i ) , v ⟩ , where all arithmetic is over F 2 \mathbb{F}_2 F 2 . Substituting this expression gives
x = ∑ i ≠ j a i ( x ( i ) + ⟨ x ( i ) , v ⟩ x ( j ) ) = ∑ i ≠ j a i y ( i ) . (246) x=\sum_{i\ne j}a_i\left(x^{(i)}+\langle x^{(i)},v\rangle x^{(j)}\right)=\sum_{i\ne j}a_i y^{(i)}. \tag*{(246)} x = i = j ∑ a i ( x ( i ) + ⟨ x ( i ) , v ⟩ x ( j ) ) = i = j ∑ a i y ( i ) . (246)
Thus the y ( i ) y^{(i)} y ( i ) span X ( K ) X(K) X ( K ) .
To show linear independence, suppose that ∑ i ≠ j b i y ( i ) = 0 \sum_{i\ne j}b_i y^{(i)}=0 ∑ i = j b i y ( i ) = 0 . Expanding in the original basis gives
∑ i ≠ j b i x ( i ) + ( ∑ i ≠ j b i ⟨ x ( i ) , v ⟩ ) x ( j ) = 0. (247) \sum_{i\ne j}b_i x^{(i)}+\left(\sum_{i\ne j}b_i\langle x^{(i)},v\rangle\right)x^{(j)}=0. \tag*{(247)} i = j ∑ b i x ( i ) + i = j ∑ b i ⟨ x ( i ) , v ⟩ x ( j ) = 0. (247)
Since the x ( i ) x^{(i)} x ( i ) are linearly independent, the coefficient b i b_i b i of each x ( i ) x^{(i)} x ( i ) with i ≠ j i\ne j i = j must vanish. Therefore the y ( i ) y^{(i)} y ( i ) are linearly independent and form a basis of X ( K ) X(K) X ( K ) .
Consequently, the retained diagonal generators together with the lifts h i h_i h i generate K K K . Adding ε z \varepsilon z ε z therefore gives generators of H ε = ⟨ K , ε z ⟩ H_\varepsilon=\langle K,\varepsilon z\rangle H ε = ⟨ K , ε z ⟩ , as claimed.
We now prove (b). Suppose that z z z commutes with every element of G G G . Then z z z preserves Fix ( G ) \operatorname{Fix}(G) Fix ( G ) : if g ∈ G g\in G g ∈ G and ∣ φ ⟩ ∈ Fix ( G ) |\varphi\rangle\in\operatorname{Fix}(G) ∣ φ ⟩ ∈ Fix ( G ) , then g z ∣ φ ⟩ = z ∣ φ ⟩ gz|\varphi\rangle=z|\varphi\rangle g z ∣ φ ⟩ = z ∣ φ ⟩ . Since Fix ( G ) = C ∣ ψ ⟩ \operatorname{Fix}(G)=\mathbb{C}|\psi\rangle Fix ( G ) = C ∣ ψ ⟩ , the state ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ is an eigenvector of z z z , and we have ( ε z ) ∣ ψ ⟩ = ∣ ψ ⟩ (\varepsilon z)|\psi\rangle=|\psi\rangle ( ε z ) ∣ ψ ⟩ = ∣ ψ ⟩ , and hence ε z ∈ D ( ψ ) \varepsilon z\in D(\psi) ε z ∈ D ( ψ ) . The post-measurement state is ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ itself, so its DCP-stabilizer group G G G is unchanged.
References