MerLean-example

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

Definition 1365 CSS Code
#

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\),

\[ (\mathtt{check}(i)).\mathtt{zVec} = 0 \quad \lor \quad (\mathtt{check}(i)).\mathtt{xVec} = 0. \]
Definition 1366 X-Check Indices

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\).

Definition 1367 Z-Check Indices

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\).

Theorem 1368 X-Check is Pure X

If \(i \in \operatorname {xCheckIndices}(C)\), then \((\mathtt{check}(i)).\mathtt{zVec} = 0\).

Proof

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.

Theorem 1369 Z-Check is Pure Z

If \(i \in \operatorname {zCheckIndices}(C)\), then \((\mathtt{check}(i)).\mathtt{xVec} = 0\).

Proof

By the definition of \(\operatorname {zCheckIndices}\), membership requires \((\mathtt{check}(i)).\mathtt{xVec} = 0\). Simplifying the filter condition yields the result.

Theorem 1370 X-Checks Commute

For a stabilizer code \(C\) and indices \(i, j \in \operatorname {xCheckIndices}(C)\), the checks \(\mathtt{check}(i)\) and \(\mathtt{check}(j)\) commute.

Proof

This follows directly from the fact that all checks of a stabilizer code pairwise commute.

Theorem 1371 Z-Checks Commute

For a stabilizer code \(C\) and indices \(i, j \in \operatorname {zCheckIndices}(C)\), the checks \(\mathtt{check}(i)\) and \(\mathtt{check}(j)\) commute.

Proof

This follows directly from the pairwise commutation of stabilizer code checks.

Theorem 1372 Pure X Operators Commute

If \(P\) and \(R\) are Pauli operators with \(P.\mathtt{zVec} = 0\) and \(R.\mathtt{zVec} = 0\), then \(P\) and \(R\) commute.

Proof

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.

Theorem 1373 Pure Z Operators Commute

If \(P\) and \(R\) are Pauli operators with \(P.\mathtt{xVec} = 0\) and \(R.\mathtt{xVec} = 0\), then \(P\) and \(R\) commute.

Proof

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.

Theorem 1374 Identity is CSS-Compatible

The identity operator \(1 : \operatorname {PauliOp}(Q)\) satisfies \((1).\mathtt{zVec} = 0 \lor (1).\mathtt{xVec} = 0\).

Proof

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

Definition 1375 Z-Check Incidence
#

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\).

Theorem 1376 Z-Check Boundary Equation

The hypergraph boundary map for Z-check incidence computes the Z-parity at each qubit from a vector of check activations:

\[ (\partial \gamma )(q) = \sum _{i : I} \begin{cases} \gamma _i & \text{if } (\mathtt{checks}(i)).\mathtt{zVec}(q) \neq 0, \\ 0 & \text{otherwise.} \end{cases} \]
Proof

By simplification using the definitions of \(\operatorname {hyperBoundaryMap}\) and \(\operatorname {zCheckIncident}\).

Theorem 1377 Step 1 Gauss Operators are Pure X

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\).

Proof

This follows directly from the fact that hypergraph Gauss’s law operators have zero Z-component.

Theorem 1378 Step 1 Gauss Operators Commute

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))\).

Proof

This follows directly from the general result that hypergraph Gauss’s law operators commute.

Theorem 1379 Step 1: State Preparation via Hypergraph Gauging

The hypergraph whose hyperedges correspond to the Z-type checks of the ancilla CSS code defines a valid hypergraph gauging. Specifically:

  1. The Gauss operators \(A_v\) are all pure X-type: \((\operatorname {hyperGaussLawOp}(v)).\mathtt{zVec} = 0\) for all \(v\).

  2. The Gauss operators mutually commute: \(\operatorname {PauliCommute}(A_v, A_w)\) for all \(v, w\).

Proof

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

Definition 1380 Matching Graph Adjacency
#

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))\).

Theorem 1381 Matching Graph Adjacency is Symmetric

The matching graph adjacency relation is symmetric.

Proof

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\).

Theorem 1382 Matching Graph Adjacency is Irreflexive

No vertex is adjacent to itself in the matching graph.

Proof

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}\).

Definition 1383 Matching Graph
#

The perfect matching graph \(G\) on \(\operatorname {Fin}(n) \oplus \operatorname {Fin}(n)\), defined as the simple graph with adjacency relation \(\operatorname {matchingGraphAdj}(n)\).

Theorem 1384 Matching Graph has \(2n\) Vertices

The matching graph has \(|\operatorname {Fin}(n) \oplus \operatorname {Fin}(n)| = 2n\) vertices.

Proof

The cardinality of a sum type is the sum of the cardinalities: \(|\operatorname {Fin}(n)| + |\operatorname {Fin}(n)| = n + n = 2n\).

Theorem 1385 Matching Graph Adjacency Characterization

\(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))\).

Proof

This holds by definitional equality (reflexivity).

Theorem 1386 Matching Edge

For each \(i : \operatorname {Fin}(n)\), \(\operatorname {inl}(i) \sim \operatorname {inr}(i)\) in the matching graph.

Proof

We provide the witness \(\langle i, \operatorname {Or.inl}\langle \operatorname {rfl}, \operatorname {rfl}\rangle \rangle \).

Theorem 1387 Matching Edge Reverse

For each \(i : \operatorname {Fin}(n)\), \(\operatorname {inr}(i) \sim \operatorname {inl}(i)\) in the matching graph.

Proof

We provide the witness \(\langle i, \operatorname {Or.inr}\langle \operatorname {rfl}, \operatorname {rfl}\rangle \rangle \).

Theorem 1388 No Data–Data Edges

No two data qubits are adjacent: \(\neg (\operatorname {inl}(i) \sim \operatorname {inl}(j))\) for all \(i, j\).

Proof

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}\).

Theorem 1389 No Ancilla–Ancilla Edges

No two ancilla qubits are adjacent: \(\neg (\operatorname {inr}(i) \sim \operatorname {inr}(j))\) for all \(i, j\).

Proof

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.

Theorem 1390 Data Adjacency Characterization

Data qubit \(\operatorname {inl}(i)\) is adjacent to \(q\) if and only if \(q = \operatorname {inr}(i)\).

Proof

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.

Theorem 1391 Ancilla Adjacency Characterization

Ancilla qubit \(\operatorname {inr}(i)\) is adjacent to \(q\) if and only if \(q = \operatorname {inl}(i)\).

Proof

Analogous to the data adjacency characterization, using the reverse matching edge.

Theorem 1392 Matching Pair Reachable

For each \(i : \operatorname {Fin}(n)\), the vertices \(\operatorname {inl}(i)\) and \(\operatorname {inr}(i)\) are reachable from each other in the matching graph.

Proof

Since \(\operatorname {inl}(i) \sim \operatorname {inr}(i)\), adjacency implies reachability.

Theorem 1393 Matching Components

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)\} \).

Proof

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

Theorem 1394 Step 2 Gauss Operators are Pure X

The Gauss’s law operators for the matching graph are all pure X-type: \((\operatorname {gaussLawOp}(v)).\mathtt{zVec} = 0\).

Proof

This follows from the general result that Gauss’s law operators have zero Z-component.

Theorem 1395 Step 2 Gauss Operators Commute

The Gauss’s law operators for the matching graph all commute.

Proof

This is an instance of the general commutation result for Gauss’s law operators.

Theorem 1396 Step 2 Gauss Product

The product of all Gauss operators on the matching graph equals the logical operator \(L = \prod _v X_v\) on all vertex qubits:

\[ \prod _{v} A_v = L. \]
Proof

This is an instance of the general Gauss’s law product theorem.

Theorem 1397 Step 2 Gauss Self-Inverse

Each Gauss operator on the matching graph is self-inverse: \(A_v^2 = 1\).

Proof

This follows from the general fact that every Pauli operator is self-inverse (\(P \cdot P = 1\)).

Theorem 1398 Step 2 Logical X-Vec

The logical operator on the matching graph acts as \(X\) on all vertex qubits: \((L).\mathtt{xVec}(\operatorname {inl}(v)) = 1\) for all \(v\).

Proof

By simplification using the definition of the logical operator.

Theorem 1399 Step 2 Logical is Pure X

The logical operator on the matching graph is pure X-type: \((L).\mathtt{zVec} = 0\).

Proof

By simplification using the definition of the logical operator.

47.5 Step 3: Readout via Z Measurements

Theorem 1400 Edge Z Operators are Pure Z

Edge \(Z\) operators on the matching graph have no \(X\)-support: \((Z_e).\mathtt{xVec} = 0\).

Proof

By extensionality and simplification using the definition of \(\operatorname {pauliZ}\).

Theorem 1401 Edge Z Operators Commute

All edge \(Z\) operators on the matching graph commute with each other.

Proof

Both operators are pure Z-type (their \(\mathtt{xVec}\) is zero), so they commute by the pure Z commutation lemma.

Theorem 1402 Edge Z Operators are Self-Inverse

Each edge \(Z\) operator satisfies \(Z_e^2 = 1\).

Proof

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.

Proof

The result is the conjunction of the three properties: commutation, self-inverse, and pure Z-type.

47.6 Composition: Steane-Style Measurement as Gauging

Theorem 1404 CX Circuit Transforms Gauss to Pauli X

The CX circuit transformation maps \(A_v\) to \(X_v\) on the matching graph:

\[ \operatorname {entanglingCircuitAction}(A_v) = X_{\operatorname {inl}(v)}. \]
Proof

This is an instance of the general result that the entangling circuit transforms Gauss’s law operators to single-qubit \(X\) operators.

Theorem 1405 CX Circuit Transforms Pauli X to Gauss

The CX circuit transforms \(X_{\operatorname {inl}(v)}\) back to \(A_v\):

\[ \operatorname {entanglingCircuitAction}(X_{\operatorname {inl}(v)}) = A_v. \]
Proof

This is an instance of the general result that the entangling circuit transforms single-qubit \(X\) operators to Gauss’s law operators.

Theorem 1406 CX Circuit is Involutive

The entangling circuit action is involutive on the matching graph: applying it twice returns the original operator.

Proof

This is an instance of the general involutivity of the entangling circuit action.

Theorem 1407 CX Circuit Preserves Commutation

The entangling circuit preserves commutation relations: \(P\) and \(R\) commute if and only if their images under the circuit action commute.

Proof

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:

  1. Step 1 (State preparation): The hypergraph Gauss operators for Z-check incidence mutually commute and are all pure X-type.

  2. 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)}\).

  3. Step 3 (Readout): The edge \(Z\) operators mutually commute and are self-inverse.

Proof

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)\).

Proof

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}\).

Theorem 1410 Dummy Qubit Count

The number of dummy qubits for state preparation equals the number of X-type checks in the ancilla CSS code.

Proof

This holds by definitional equality.

Theorem 1411 X-Check and Z-Check Commute

For a CSS code, X-type checks commute with Z-type checks.

Proof

This follows directly from the fact that all checks of a stabilizer code pairwise commute.

Theorem 1412 Z-Check Boundary Structure

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\).

Proof

This holds by definitional equality.

47.8 Degree Analysis

Theorem 1413 Data Neighbor Set

The neighbor set of data vertex \(\operatorname {inl}(i)\) in the matching graph is \(\{ \operatorname {inr}(i)\} \).

Proof

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)\} \).

Theorem 1414 Ancilla Neighbor Set

The neighbor set of ancilla vertex \(\operatorname {inr}(i)\) in the matching graph is \(\{ \operatorname {inl}(i)\} \).

Proof

By extensionality, membership in the neighbor finset is equivalent to adjacency, which by the ancilla adjacency characterization is equivalent to \(q = \operatorname {inl}(i)\).

Theorem 1415 Data Degree is One

Each data vertex has degree exactly 1 in the matching graph.

Proof

Rewriting the degree as the cardinality of the neighbor finset and using the data neighbor set result, \(|\{ \operatorname {inr}(i)\} | = 1\).

Theorem 1416 Ancilla Degree is One

Each ancilla vertex has degree exactly 1 in the matching graph.

Proof

Rewriting the degree as the cardinality of the neighbor finset and using the ancilla neighbor set result, \(|\{ \operatorname {inl}(i)\} | = 1\).

Theorem 1417 Matching Graph Degree Equals One

Every vertex in the matching graph has degree exactly 1.

Proof

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.

Theorem 1418 Matching Graph Degree Sum

The degree sum of the matching graph is \(2n\):

\[ \sum _{v} \deg (v) = 2n. \]
Proof

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\).

Theorem 1419 Matching Graph Edge Count

The matching graph has exactly \(n\) edges: \(2|E| = 2n\).

Proof

By the handshaking lemma, \(2|E| = \sum _v \deg (v) = 2n\).

47.9 Summary

The complete Steane-style measurement decomposition satisfies:

  1. Step 1: All hypergraph Gauss operators commute.

  2. Step 2: All matching graph Gauss operators commute, and the CX circuit maps \(A_v \mapsto X_{\operatorname {inl}(v)}\).

  3. Step 3: All edge \(Z\) operators commute.

  4. Degree bound: Every vertex has degree 1.

  5. Edge count: \(2|E| = 2n\).

Proof

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.