47 Rem 25: Steane-Style Measurement as Gauging
This remark shows that the Steane-style measurement procedure for stabilizer codes can be decomposed into a composition of gauging operations. For a CSS ancilla code, state preparation uses hypergraph gauging on Z-type check incidence, entangling uses graph gauging on a perfect matching, and readout uses Z measurements (ungauging).
47.1 CSS Stabilizer Codes
A stabilizer code \(C\) is CSS (Calderbank–Shor–Steane) if every check is either purely \(X\)-type or purely \(Z\)-type. Formally, for every check index \(i\),
The X-type check indices of a stabilizer code \(C\) are those indices \(i\) such that \((\mathtt{check}(i)).\mathtt{zVec} = 0\) and \((\mathtt{check}(i)).\mathtt{xVec} \neq 0\).
The Z-type check indices of a stabilizer code \(C\) are those indices \(i\) such that \((\mathtt{check}(i)).\mathtt{xVec} = 0\) and \((\mathtt{check}(i)).\mathtt{zVec} \neq 0\).
If \(i \in \operatorname {xCheckIndices}(C)\), then \((\mathtt{check}(i)).\mathtt{zVec} = 0\).
By the definition of \(\operatorname {xCheckIndices}\), membership requires \((\mathtt{check}(i)).\mathtt{zVec} = 0\). Simplifying the filter condition from the membership hypothesis yields the result directly.
If \(i \in \operatorname {zCheckIndices}(C)\), then \((\mathtt{check}(i)).\mathtt{xVec} = 0\).
By the definition of \(\operatorname {zCheckIndices}\), membership requires \((\mathtt{check}(i)).\mathtt{xVec} = 0\). Simplifying the filter condition yields the result.
For a stabilizer code \(C\) and indices \(i, j \in \operatorname {xCheckIndices}(C)\), the checks \(\mathtt{check}(i)\) and \(\mathtt{check}(j)\) commute.
This follows directly from the fact that all checks of a stabilizer code pairwise commute.
For a stabilizer code \(C\) and indices \(i, j \in \operatorname {zCheckIndices}(C)\), the checks \(\mathtt{check}(i)\) and \(\mathtt{check}(j)\) commute.
This follows directly from the pairwise commutation of stabilizer code checks.
If \(P\) and \(R\) are Pauli operators with \(P.\mathtt{zVec} = 0\) and \(R.\mathtt{zVec} = 0\), then \(P\) and \(R\) commute.
We expand the definition of \(\operatorname {PauliCommute}\) as the symplectic inner product. The symplectic inner product \(\langle P, R \rangle = \sum _v (P.\mathtt{xVec}(v) \cdot R.\mathtt{zVec}(v) + P.\mathtt{zVec}(v) \cdot R.\mathtt{xVec}(v))\). Since \(P.\mathtt{zVec} = 0\) and \(R.\mathtt{zVec} = 0\), each term in the sum vanishes, so the sum equals zero.
If \(P\) and \(R\) are Pauli operators with \(P.\mathtt{xVec} = 0\) and \(R.\mathtt{xVec} = 0\), then \(P\) and \(R\) commute.
We expand the symplectic inner product. Since \(P.\mathtt{xVec} = 0\) and \(R.\mathtt{xVec} = 0\), every term \(P.\mathtt{xVec}(v) \cdot R.\mathtt{zVec}(v) + P.\mathtt{zVec}(v) \cdot R.\mathtt{xVec}(v)\) vanishes, so the total sum is zero.
The identity operator \(1 : \operatorname {PauliOp}(Q)\) satisfies \((1).\mathtt{zVec} = 0 \lor (1).\mathtt{xVec} = 0\).
We choose the left disjunct. By the definition of the identity Pauli operator, \((1).\mathtt{zVec} = 0\).
47.2 Step 1: State Preparation via Hypergraph Gauging
The incidence relation for state preparation: qubit \(q\) is incident to Z-check \(i\) if and only if the check has Z-action at \(q\), i.e., \((\mathtt{checks}(i)).\mathtt{zVec}(q) \neq 0\).
The hypergraph boundary map for Z-check incidence computes the Z-parity at each qubit from a vector of check activations:
By simplification using the definitions of \(\operatorname {hyperBoundaryMap}\) and \(\operatorname {zCheckIncident}\).
The Gauss’s law operators for Z-check hypergraph gauging are all pure X-type: for every vertex \(v\), \((\operatorname {hyperGaussLawOp}(v)).\mathtt{zVec} = 0\).
This follows directly from the fact that hypergraph Gauss’s law operators have zero Z-component.
The Gauss’s law operators for Z-check hypergraph gauging mutually commute: for all vertices \(v, w\), \(\operatorname {PauliCommute}(\operatorname {hyperGaussLawOp}(v), \operatorname {hyperGaussLawOp}(w))\).
This follows directly from the general result that hypergraph Gauss’s law operators commute.
The hypergraph whose hyperedges correspond to the Z-type checks of the ancilla CSS code defines a valid hypergraph gauging. Specifically:
The Gauss operators \(A_v\) are all pure X-type: \((\operatorname {hyperGaussLawOp}(v)).\mathtt{zVec} = 0\) for all \(v\).
The Gauss operators mutually commute: \(\operatorname {PauliCommute}(A_v, A_w)\) for all \(v, w\).
The result is the conjunction of the two properties established above: mutual commutation (from step1_gauss_commute) and pure X-type (from step1_gauss_pure_X).
47.3 Step 2: Entangling via Perfect Matching Graph
The adjacency relation for the perfect matching graph on vertex set \(\operatorname {Fin}(n) \oplus \operatorname {Fin}(n)\): data qubit \(\operatorname {inl}(i)\) is adjacent to ancilla qubit \(\operatorname {inr}(i)\) (and vice versa), with no other edges. Formally, \(p \sim q\) iff there exists \(i : \operatorname {Fin}(n)\) such that \((p = \operatorname {inl}(i) \land q = \operatorname {inr}(i))\) or \((p = \operatorname {inr}(i) \land q = \operatorname {inl}(i))\).
The matching graph adjacency relation is symmetric.
Given \(\langle i, h \rangle \) witnessing \(p \sim q\), we decompose \(h\) into the two cases. In each case, swapping the two components of the conjunction gives the witness for \(q \sim p\).
No vertex is adjacent to itself in the matching graph.
Suppose \(p \sim p\). Then there exists \(i\) such that \(p = \operatorname {inl}(i)\) and \(p = \operatorname {inr}(i)\) (or vice versa), which contradicts \(\operatorname {inl} \neq \operatorname {inr}\).
The perfect matching graph \(G\) on \(\operatorname {Fin}(n) \oplus \operatorname {Fin}(n)\), defined as the simple graph with adjacency relation \(\operatorname {matchingGraphAdj}(n)\).
The matching graph has \(|\operatorname {Fin}(n) \oplus \operatorname {Fin}(n)| = 2n\) vertices.
The cardinality of a sum type is the sum of the cardinalities: \(|\operatorname {Fin}(n)| + |\operatorname {Fin}(n)| = n + n = 2n\).
\(p \sim q\) in the matching graph if and only if there exists \(i : \operatorname {Fin}(n)\) such that \((p = \operatorname {inl}(i) \land q = \operatorname {inr}(i))\) or \((p = \operatorname {inr}(i) \land q = \operatorname {inl}(i))\).
This holds by definitional equality (reflexivity).
For each \(i : \operatorname {Fin}(n)\), \(\operatorname {inl}(i) \sim \operatorname {inr}(i)\) in the matching graph.
We provide the witness \(\langle i, \operatorname {Or.inl}\langle \operatorname {rfl}, \operatorname {rfl}\rangle \rangle \).
For each \(i : \operatorname {Fin}(n)\), \(\operatorname {inr}(i) \sim \operatorname {inl}(i)\) in the matching graph.
We provide the witness \(\langle i, \operatorname {Or.inr}\langle \operatorname {rfl}, \operatorname {rfl}\rangle \rangle \).
No two data qubits are adjacent: \(\neg (\operatorname {inl}(i) \sim \operatorname {inl}(j))\) for all \(i, j\).
Suppose \(\operatorname {inl}(i) \sim \operatorname {inl}(j)\). Then there exists \(k\) with \(\operatorname {inl}(i) = \operatorname {inl}(k)\) and \(\operatorname {inl}(j) = \operatorname {inr}(k)\) (or vice versa), but \(\operatorname {inl}(j) = \operatorname {inr}(k)\) contradicts \(\operatorname {inl} \neq \operatorname {inr}\).
No two ancilla qubits are adjacent: \(\neg (\operatorname {inr}(i) \sim \operatorname {inr}(j))\) for all \(i, j\).
Suppose \(\operatorname {inr}(i) \sim \operatorname {inr}(j)\). Then there exists \(k\) with \(\operatorname {inr}(i) = \operatorname {inr}(k)\) and \(\operatorname {inr}(j) = \operatorname {inl}(k)\) (or a symmetric case), but \(\operatorname {inr} \neq \operatorname {inl}\) gives a contradiction.
Data qubit \(\operatorname {inl}(i)\) is adjacent to \(q\) if and only if \(q = \operatorname {inr}(i)\).
For the forward direction, given \(\langle k, h \rangle \) witnessing adjacency, in the first case \(\operatorname {inl}(i) = \operatorname {inl}(k)\) gives \(i = k\) by injectivity, so \(q = \operatorname {inr}(k) = \operatorname {inr}(i)\). The second case gives \(\operatorname {inl}(i) = \operatorname {inr}(k)\), contradicting \(\operatorname {inl} \neq \operatorname {inr}\). For the reverse direction, if \(q = \operatorname {inr}(i)\) then the result follows from the matching edge lemma.
Ancilla qubit \(\operatorname {inr}(i)\) is adjacent to \(q\) if and only if \(q = \operatorname {inl}(i)\).
Analogous to the data adjacency characterization, using the reverse matching edge.
For each \(i : \operatorname {Fin}(n)\), the vertices \(\operatorname {inl}(i)\) and \(\operatorname {inr}(i)\) are reachable from each other in the matching graph.
Since \(\operatorname {inl}(i) \sim \operatorname {inr}(i)\), adjacency implies reachability.
The matching graph consists of \(n\) connected components: if \(p\) and \(q\) are reachable, then there exists \(i : \operatorname {Fin}(n)\) such that \(p \in \{ \operatorname {inl}(i), \operatorname {inr}(i)\} \) and \(q \in \{ \operatorname {inl}(i), \operatorname {inr}(i)\} \).
From the reachability hypothesis, we obtain a walk from \(p\) to \(q\). We prove by induction on the walk that any walk stays within a single component \(\{ \operatorname {inl}(i), \operatorname {inr}(i)\} \). For the nil walk, \(p = q\) and the component is determined by whether \(p\) is \(\operatorname {inl}(i)\) or \(\operatorname {inr}(i)\). For a cons walk, by the inductive hypothesis the tail of the walk stays in some component \(i\), and the adjacency step must connect to a vertex in the same component (since each vertex is only adjacent to its partner).
47.4 Step 2: Entangling Gauss Operators
The Gauss’s law operators for the matching graph are all pure X-type: \((\operatorname {gaussLawOp}(v)).\mathtt{zVec} = 0\).
This follows from the general result that Gauss’s law operators have zero Z-component.
The Gauss’s law operators for the matching graph all commute.
This is an instance of the general commutation result for Gauss’s law operators.
The product of all Gauss operators on the matching graph equals the logical operator \(L = \prod _v X_v\) on all vertex qubits:
This is an instance of the general Gauss’s law product theorem.
Each Gauss operator on the matching graph is self-inverse: \(A_v^2 = 1\).
This follows from the general fact that every Pauli operator is self-inverse (\(P \cdot P = 1\)).
The logical operator on the matching graph acts as \(X\) on all vertex qubits: \((L).\mathtt{xVec}(\operatorname {inl}(v)) = 1\) for all \(v\).
By simplification using the definition of the logical operator.
The logical operator on the matching graph is pure X-type: \((L).\mathtt{zVec} = 0\).
By simplification using the definition of the logical operator.
47.5 Step 3: Readout via Z Measurements
Edge \(Z\) operators on the matching graph have no \(X\)-support: \((Z_e).\mathtt{xVec} = 0\).
By extensionality and simplification using the definition of \(\operatorname {pauliZ}\).
All edge \(Z\) operators on the matching graph commute with each other.
Both operators are pure Z-type (their \(\mathtt{xVec}\) is zero), so they commute by the pure Z commutation lemma.
Each edge \(Z\) operator satisfies \(Z_e^2 = 1\).
This follows from the general self-inverse property of Pauli operators.
The readout step consists of measuring \(Z\) on each edge qubit. All \(Z\) measurements commute, are self-inverse, and are pure Z-type, which is exactly the ungauging step.
The result is the conjunction of the three properties: commutation, self-inverse, and pure Z-type.
47.6 Composition: Steane-Style Measurement as Gauging
The CX circuit transformation maps \(A_v\) to \(X_v\) on the matching graph:
This is an instance of the general result that the entangling circuit transforms Gauss’s law operators to single-qubit \(X\) operators.
The CX circuit transforms \(X_{\operatorname {inl}(v)}\) back to \(A_v\):
This is an instance of the general result that the entangling circuit transforms single-qubit \(X\) operators to Gauss’s law operators.
The entangling circuit action is involutive on the matching graph: applying it twice returns the original operator.
This is an instance of the general involutivity of the entangling circuit action.
The entangling circuit preserves commutation relations: \(P\) and \(R\) commute if and only if their images under the circuit action commute.
This follows from the general result that the entangling circuit preserves symplectic inner products (and hence commutation), applied symmetrically.
The full Steane-style measurement decomposes into three gauging operations:
Step 1 (State preparation): The hypergraph Gauss operators for Z-check incidence mutually commute and are all pure X-type.
Step 2 (Entangling): The Gauss operators for the matching graph mutually commute, are pure X-type, and the CX circuit transforms \(A_v \mapsto X_{\operatorname {inl}(v)}\).
Step 3 (Readout): The edge \(Z\) operators mutually commute and are self-inverse.
The result is assembled from the three steps: Step 1 uses step1_gauss_commute and step1_gauss_pure_X; Step 2 uses step2_gauss_commute, step2_gauss_pure_X, and step2_cx_transforms_gauss; Step 3 uses step3_edgeZ_commute and step3_edgeZ_self_inverse.
47.7 Ancilla Code Properties
For a CSS code \(C\), every non-identity check belongs to either the X-type check indices or the Z-type check indices: if \(\mathtt{check}(i) \neq 1\) then \(i \in \operatorname {xCheckIndices}(C) \lor i \in \operatorname {zCheckIndices}(C)\).
From the CSS property, either \((\mathtt{check}(i)).\mathtt{zVec} = 0\) or \((\mathtt{check}(i)).\mathtt{xVec} = 0\). In the first case, if \(\mathtt{xVec} = 0\) as well, then the check is the identity, contradicting \(\mathtt{check}(i) \neq 1\); otherwise \(i \in \operatorname {xCheckIndices}\). The second case is analogous, yielding \(i \in \operatorname {zCheckIndices}\).
The number of dummy qubits for state preparation equals the number of X-type checks in the ancilla CSS code.
This holds by definitional equality.
For a CSS code, X-type checks commute with Z-type checks.
This follows directly from the fact that all checks of a stabilizer code pairwise commute.
For a Z-type check index \(i\) and qubit \(q\), the Z-check incidence relation \(\operatorname {zCheckIncident}(\mathtt{check}, q, i)\) holds if and only if \((\mathtt{check}(i)).\mathtt{zVec}(q) \neq 0\).
This holds by definitional equality.
47.8 Degree Analysis
The neighbor set of data vertex \(\operatorname {inl}(i)\) in the matching graph is \(\{ \operatorname {inr}(i)\} \).
By extensionality, membership in the neighbor finset is equivalent to adjacency, which by the data adjacency characterization is equivalent to \(q = \operatorname {inr}(i)\), i.e., membership in the singleton \(\{ \operatorname {inr}(i)\} \).
The neighbor set of ancilla vertex \(\operatorname {inr}(i)\) in the matching graph is \(\{ \operatorname {inl}(i)\} \).
By extensionality, membership in the neighbor finset is equivalent to adjacency, which by the ancilla adjacency characterization is equivalent to \(q = \operatorname {inl}(i)\).
Each data vertex has degree exactly 1 in the matching graph.
Rewriting the degree as the cardinality of the neighbor finset and using the data neighbor set result, \(|\{ \operatorname {inr}(i)\} | = 1\).
Each ancilla vertex has degree exactly 1 in the matching graph.
Rewriting the degree as the cardinality of the neighbor finset and using the ancilla neighbor set result, \(|\{ \operatorname {inl}(i)\} | = 1\).
Every vertex in the matching graph has degree exactly 1.
We case-split on whether \(v = \operatorname {inl}(i)\) or \(v = \operatorname {inr}(i)\). In the first case we apply data_degree, in the second ancilla_degree.
The degree sum of the matching graph is \(2n\):
We split the sum over the sum type \(\operatorname {Fin}(n) \oplus \operatorname {Fin}(n)\). Each data vertex contributes degree 1 and each ancilla vertex contributes degree 1, giving \(n \cdot 1 + n \cdot 1 = 2n\).
The matching graph has exactly \(n\) edges: \(2|E| = 2n\).
By the handshaking lemma, \(2|E| = \sum _v \deg (v) = 2n\).
47.9 Summary
The complete Steane-style measurement decomposition satisfies:
Step 1: All hypergraph Gauss operators commute.
Step 2: All matching graph Gauss operators commute, and the CX circuit maps \(A_v \mapsto X_{\operatorname {inl}(v)}\).
Step 3: All edge \(Z\) operators commute.
Degree bound: Every vertex has degree 1.
Edge count: \(2|E| = 2n\).
The result assembles all the previously established properties: Step 1 commutation, Step 2 commutation and CX transformation, Step 3 commutation, the degree bound, and the edge count.
Now I have the full file. Let me produce the LaTeX translation.