MerLean-example

42 Rem 19: Shor-Style Measurement as Gauging

This remark demonstrates that the standard Shor-style logical measurement is a special case of the gauging measurement framework. The Shor-style measurement—which involves preparing a GHZ state on auxiliary qubits, entangling via transversal CX gates, and measuring \(X\) on each auxiliary qubit—can be reformulated using the gauging procedure with a specific graph structure: each qubit \(v\) in the support of \(L\) is paired with a dummy vertex \(u_v\) via a cross edge, and all dummy vertices are connected by a path (or star).

Definition 1335 Shor Vertex Type

Given a positive integer \(W = |\operatorname {supp}(L)|\), the vertex type for the Shor-style gauging graph is \(\mathrm{Bool} \times \mathrm{Fin}(W)\), where:

  • \((\mathtt{false}, i)\) represents the \(i\)-th support vertex (qubit \(i\) in \(\operatorname {supp}(L)\)),

  • \((\mathtt{true}, i)\) represents the \(i\)-th dummy vertex \(u_i\).

Definition 1336 Support Vertices

The set of support vertices is

\[ \operatorname {supportVertices}(W) = \{ v \in \mathrm{ShorVertex}(W) \mid v_1 = \mathtt{false}\} . \]
Definition 1337 Dummy Vertices Set

The set of dummy vertices is

\[ \operatorname {dummyVerticesSet}(W) = \{ v \in \mathrm{ShorVertex}(W) \mid v_1 = \mathtt{true}\} . \]
Theorem 1338 Shor-Style Vertex Count

The total number of vertices in the Shor-style gauging graph is \(2W\).

Proof

By simplification using the cardinality of the product type \(\mathrm{Bool} \times \mathrm{Fin}(W)\), we have \(|\mathrm{Bool}| \cdot |\mathrm{Fin}(W)| = 2 \cdot W\).

Theorem 1339 Support Card

The support vertex set has cardinality \(W\): \(|\operatorname {supportVertices}(W)| = W\).

Proof

We simplify the definition of support vertices. We first establish that the filter \(\{ v \in \mathrm{Univ} \mid v_1 = \mathtt{false}\} \) equals the product set \(\{ \mathtt{false}\} \times \mathrm{Fin}(W)\) by extensionality on pairs \((b, i)\). Rewriting with this equality, the cardinality of the product is \(|\{ \mathtt{false}\} | \cdot |\mathrm{Fin}(W)| = 1 \cdot W = W\).

Theorem 1340 Dummy Card

The dummy vertex set has cardinality \(W\): \(|\operatorname {dummyVerticesSet}(W)| = W\).

Proof

We simplify the definition of dummy vertices. We first establish that the filter \(\{ v \in \mathrm{Univ} \mid v_1 = \mathtt{true}\} \) equals the product set \(\{ \mathtt{true}\} \times \mathrm{Fin}(W)\) by extensionality on pairs \((b, i)\). Rewriting with this equality, the cardinality of the product is \(|\{ \mathtt{true}\} | \cdot |\mathrm{Fin}(W)| = 1 \cdot W = W\).

Definition 1341 Shor Edge Path Type

The edge type for the Shor-style gauging graph with path connectivity on dummy vertices is an inductive type with two constructors:

  • \(\mathrm{cross}(i)\) for \(i \in \mathrm{Fin}(W)\): a cross edge connecting \((\mathtt{false}, i)\) to \((\mathtt{true}, i)\),

  • \(\mathrm{dummyPath}(i)\) for \(i \in \mathrm{Fin}(W-1)\): a path edge connecting \((\mathtt{true}, i)\) to \((\mathtt{true}, i+1)\).

Definition 1342 Shor Edge Star Type

The edge type for the Shor-style gauging graph with star connectivity on dummy vertices is an inductive type with two constructors:

  • \(\mathrm{cross}(i)\) for \(i \in \mathrm{Fin}(W)\): a cross edge connecting \((\mathtt{false}, i)\) to \((\mathtt{true}, i)\),

  • \(\mathrm{dummyStar}(i)\) for \(i \in \mathrm{Fin}(W-1)\): a star edge connecting \((\mathtt{true}, 0)\) to \((\mathtt{true}, i+1)\).

Definition 1343 Shor Path Adjacency

Two vertices \(x, y \in \mathrm{ShorVertex}(W)\) are adjacent in the path-connectivity graph if one of the following holds:

  1. \(x_1 \neq y_1\) and \(x_2 = y_2\) (cross edge between support and dummy partner),

  2. \(x_1 = \mathtt{true}\), \(y_1 = \mathtt{true}\), and \(x_2 + 1 = y_2\) (forward path edge),

  3. \(x_1 = \mathtt{true}\), \(y_1 = \mathtt{true}\), and \(y_2 + 1 = x_2\) (backward path edge).

Definition 1344 Shor Path Graph

The Shor-style gauging graph with path connectivity is the simple graph on \(\mathrm{ShorVertex}(W)\) with adjacency relation \(\mathrm{shorPathAdj}\).

Proof that shorPathGraph is a valid simple graph

Symmetry: Let \(x, y\) be vertices with \(\mathrm{shorPathAdj}(x, y)\). We decompose \(h\) into three cases. Case 1: If \(x_1 \neq y_1\) and \(x_2 = y_2\), then \(y_1 \neq x_1\) and \(y_2 = x_2\), so \(\mathrm{shorPathAdj}(y, x)\) holds by the first disjunct. Case 2: If \(x_1 = y_1 = \mathtt{true}\) and \(x_2 + 1 = y_2\), then \(\mathrm{shorPathAdj}(y, x)\) holds by the third disjunct. Case 3: Symmetric to Case 2.

Irreflexivity: Suppose \(\mathrm{shorPathAdj}(x, x)\). Case 1: \(x_1 \neq x_1\), a contradiction. Cases 2 and 3: \(x_2 + 1 = x_2\), which is impossible by integer arithmetic.

Definition 1345 Shor Star Adjacency

Two vertices \(x, y \in \mathrm{ShorVertex}(W)\) are adjacent in the star-connectivity graph if one of the following holds:

  1. \(x_1 \neq y_1\) and \(x_2 = y_2\) (cross edge),

  2. \(x_1 = y_1 = \mathtt{true}\), \(x_2 = 0\), and \(y_2 {\gt} 0\) (outgoing star edge from center),

  3. \(x_1 = y_1 = \mathtt{true}\), \(y_2 = 0\), and \(x_2 {\gt} 0\) (incoming star edge to center).

Definition 1346 Shor Star Graph

The Shor-style gauging graph with star connectivity is the simple graph on \(\mathrm{ShorVertex}(W)\) with adjacency relation \(\mathrm{shorStarAdj}\).

Proof that shorStarGraph is a valid simple graph

Symmetry: We decompose the adjacency into three cases. Case 1: cross edge symmetry follows from \(\mathrm{Ne.symm}\) and equality symmetry. Cases 2 and 3: forward star edges become backward star edges and vice versa.

Irreflexivity: Suppose \(\mathrm{shorStarAdj}(x, x)\). Case 1: \(x_1 \neq x_1\), a contradiction. Cases 2 and 3: \(x_2 = 0\) and \(x_2 {\gt} 0\) simultaneously, which is impossible by integer arithmetic.

Definition 1347 Shor Path Edge Endpoints

The endpoint function for path-connectivity edges maps:

  • \(\mathrm{cross}(i) \mapsto \bigl((\mathtt{false}, i), (\mathtt{true}, i)\bigr)\),

  • \(\mathrm{dummyPath}(i) \mapsto \bigl((\mathtt{true}, i), (\mathtt{true}, i+1)\bigr)\).

Definition 1348 Shor Star Edge Endpoints

The endpoint function for star-connectivity edges (given \(W \ge 1\)) maps:

  • \(\mathrm{cross}(i) \mapsto \bigl((\mathtt{false}, i), (\mathtt{true}, i)\bigr)\),

  • \(\mathrm{dummyStar}(i) \mapsto \bigl((\mathtt{true}, 0), (\mathtt{true}, i+1)\bigr)\).

Each edge \(e\) in the path-connectivity graph connects adjacent vertices: the endpoints of \(e\) are adjacent in \(\mathrm{shorPathGraph}(W)\).

Proof

We case-split on \(e\). For \(\mathrm{cross}(i)\): this is a cross edge, and the adjacency follows from the first disjunct of \(\mathrm{shorPathAdj}\) since \(\mathtt{false} \neq \mathtt{true}\) and the indices agree. For \(\mathrm{dummyPath}(i)\): this is a path edge between dummy vertices, and the adjacency follows from the second disjunct since both components are \(\mathtt{true}\) and \(i + 1 = i + 1\).

Each edge \(e\) in the star-connectivity graph connects adjacent vertices in \(\mathrm{shorStarGraph}(W)\), provided \(W \ge 1\).

Proof

We case-split on \(e\). For \(\mathrm{cross}(i)\): the adjacency follows from the first disjunct of \(\mathrm{shorStarAdj}\) since \(\mathtt{false} \neq \mathtt{true}\) and the indices agree. For \(\mathrm{dummyStar}(i)\): both components are \(\mathtt{true}\), the first index is \(0\), and \(i+1 {\gt} 0\) by \(\mathrm{Nat.succ\_ pos}\), so the second disjunct applies.

Theorem 1351 Path Edge Adjacency Symmetry

For each edge \(e\) of the path-connectivity graph, the reversed pair of endpoints is also adjacent.

Proof

This follows directly from the symmetry of the graph applied to the adjacency of the endpoints.

Theorem 1352 Star Edge Adjacency Symmetry

For each edge \(e\) of the star-connectivity graph (assuming \(W \ge 1\)), the reversed pair of endpoints is also adjacent.

Proof

This follows directly from the symmetry of the graph applied to the adjacency of the endpoints.

Theorem 1353 Path Edge Count

The path-connectivity Shor-style graph has \(2W - 1\) edges:

\[ |\mathrm{ShorEdgePath}(W)| = 2W - 1. \]
Proof

The universe of \(\mathrm{ShorEdgePath}(W)\) is the disjoint union of \(\mathrm{cross}\)-edges and \(\mathrm{dummyPath}\)-edges. We first establish that the image sets of the two constructors are disjoint: if \(e\) is in both images, then a cross edge equals a dummy path edge, which is impossible by constructor disjointness. Using the cardinality of a disjoint union, the total count is \(|\mathrm{Fin}(W)| + |\mathrm{Fin}(W-1)| = W + (W-1) = 2W - 1\), where injectivity of each constructor ensures the image has the same size as the domain.

Theorem 1354 Star Edge Count

The star-connectivity Shor-style graph has \(2W - 1\) edges:

\[ |\mathrm{ShorEdgeStar}(W)| = 2W - 1. \]
Proof

The argument is identical to the path case. The universe of \(\mathrm{ShorEdgeStar}(W)\) decomposes into the disjoint images of \(\mathrm{cross}\) and \(\mathrm{dummyStar}\). By injectivity and disjointness, the count is \(W + (W-1) = 2W - 1\).

Theorem 1355 Path Graph is a Tree

The Shor-style gauging graph with path connectivity has \(0\) independent cycles (it is a tree). This follows from Euler’s formula: \(|E| - |V| + 1 = (2W-1) - 2W + 1 = 0\).

Proof

Assuming \(W \ge 1\), we verify \(2W - 1 + 1 = 2W\) by integer arithmetic.

For \(W \ge 2\), the Shor-style gauging graph is a valid \(\mathrm{GaugingGraphConvention}\) with:

  • Vertex type: \(\mathrm{ShorVertex}(W)\),

  • Graph: \(\mathrm{shorPathGraph}(W)\),

  • Logical support: \(\operatorname {supportVertices}(W)\).

Proof that shorStyleGaugingConvention satisfies the convention

Connectivity: We use the characterization of connectedness. First, all dummy vertices \((\mathtt{true}, i)\) are mutually reachable via the path: by induction on the indices, if \(a \le b\), we can reach \((\mathtt{true}, \langle b, \cdot \rangle )\) from \((\mathtt{true}, \langle a, \cdot \rangle )\) by following consecutive path edges. For the base case (\(b = 0\)), we must have \(a = 0\) and reachability is reflexive. For the inductive step, we use the inductive hypothesis to reach \((\mathtt{true}, \langle b', \cdot \rangle )\) and then take one path step to \((\mathtt{true}, \langle b'+1, \cdot \rangle )\). Every vertex \((s, i)\) connects to its dummy partner \((\mathtt{true}, i)\) via a cross edge (for \(s = \mathtt{false}\)) or trivially (for \(s = \mathtt{true}\)). Combining these, any two vertices \(x, y\) are reachable: from \(x\) to its dummy partner, through the path, and from the partner of \(y\) back to \(y\). The graph is nonempty since \((\mathtt{false}, 0)\) exists when \(W \ge 2\).

Support nonempty: The vertex \((\mathtt{false}, 0)\) belongs to \(\operatorname {supportVertices}(W)\) since \(W \ge 2\).

Definition 1357 Is Cross Edge

A Boolean classifier for edges: \(\mathrm{isCrossEdge}(e) = \mathtt{true}\) if \(e = \mathrm{cross}(i)\) for some \(i\), and \(\mathtt{false}\) if \(e = \mathrm{dummyPath}(i)\).

Definition 1358 Is Dummy Edge

A Boolean classifier for edges: \(\mathrm{isDummyEdge}(e) = \mathtt{true}\) if \(e = \mathrm{dummyPath}(i)\) for some \(i\), and \(\mathtt{false}\) if \(e = \mathrm{cross}(i)\).

Cross edges and dummy edges partition the edge set: for every edge \(e\), either \(\mathrm{isCrossEdge}(e) = \mathtt{true}\) or \(\mathrm{isDummyEdge}(e) = \mathtt{true}\).

Proof

By case analysis on \(e\): if \(e = \mathrm{cross}(i)\) then \(\mathrm{isCrossEdge}\) returns \(\mathtt{true}\); if \(e = \mathrm{dummyPath}(i)\) then \(\mathrm{isDummyEdge}\) returns \(\mathtt{true}\). This is verified by simplification using the definitions.

Theorem 1360 Edge Partition Exclusivity

Cross edges and dummy edges are mutually exclusive: no edge \(e\) has both \(\mathrm{isCrossEdge}(e) = \mathtt{true}\) and \(\mathrm{isDummyEdge}(e) = \mathtt{true}\).

Proof

By case analysis on \(e\): if \(e = \mathrm{cross}(i)\) then \(\mathrm{isDummyEdge}(e) = \mathtt{false}\); if \(e = \mathrm{dummyPath}(i)\) then \(\mathrm{isCrossEdge}(e) = \mathtt{false}\). In both cases, the conjunction is false.

Theorem 1361 Cross Edge Count

The number of cross edges is \(W\):

\[ |\{ e \in \mathrm{ShorEdgePath}(W) \mid \mathrm{isCrossEdge}(e)\} | = W. \]
Proof

We first establish that the set of cross edges equals the image of \(\mathrm{Fin}(W)\) under the \(\mathrm{cross}\) constructor. By extensionality, an edge \(e\) is in the filter if and only if \(e = \mathrm{cross}(i)\) for some \(i\). Then by injectivity of \(\mathrm{cross}\), the image has cardinality \(|\mathrm{Fin}(W)| = W\).

Theorem 1362 Dummy Path Edge Count

The number of dummy path edges is \(W - 1\):

\[ |\{ e \in \mathrm{ShorEdgePath}(W) \mid \mathrm{isDummyEdge}(e)\} | = W - 1. \]
Proof

We first establish that the set of dummy edges equals the image of \(\mathrm{Fin}(W-1)\) under the \(\mathrm{dummyPath}\) constructor. By extensionality, an edge \(e\) is in the filter if and only if \(e = \mathrm{dummyPath}(i)\) for some \(i\). Then by injectivity of \(\mathrm{dummyPath}\), the image has cardinality \(|\mathrm{Fin}(W-1)| = W - 1\).

Theorem 1363 Support-Dummy Cross Adjacency

Each support vertex is adjacent to its dummy partner: for all \(i \in \mathrm{Fin}(W)\),

\[ \mathrm{shorPathGraph}(W).\mathrm{Adj}\bigl((\mathtt{false}, i), (\mathtt{true}, i)\bigr). \]
Proof

Unfolding \(\mathrm{shorPathAdj}\), the first disjunct is satisfied: \(\mathtt{false} \neq \mathtt{true}\) and the indices agree.

Theorem 1364 Cross Edge Matching

Cross edges provide a perfect matching between support and dummy vertices: for each \(i \in \mathrm{Fin}(W)\), the endpoints of \(\mathrm{cross}(i)\) are \((\mathtt{false}, i)\) and \((\mathtt{true}, i)\).

Proof

This holds by reflexivity from the definition of \(\mathrm{shorPathEdgeEndpoints}\).

Theorem 1365 Dummy Subgraph is a Tree

The dummy subgraph is a tree: it has \(W - 1\) edges on \(W\) vertices, satisfying \((W - 1) + 1 = W\).

Proof

This follows by integer arithmetic: \((W - 1) + 1 = W\).

Theorem 1366 GHZ Stabilizers are Dummy Edges

The \(Z\) stabilizers of the GHZ state on \(W\) qubits are \(Z_i Z_{i+1}\) for \(i = 0, \ldots , W-2\). These correspond exactly to the \(Z\) operators on the dummy path edges: for each \(i \in \mathrm{Fin}(W-1)\), there exists an edge \(e\) that is a dummy edge with endpoints \((\mathtt{true}, i)\) and \((\mathtt{true}, i+1)\).

Proof

The witness is \(e = \mathrm{dummyPath}(i)\). By definition, \(\mathrm{isDummyEdge}(\mathrm{dummyPath}(i)) = \mathtt{true}\) and the endpoints are \((\mathtt{true}, i)\) and \((\mathtt{true}, i+1)\), all holding by reflexivity.

Theorem 1367 Gauss’s Law at Dummy Vertex

The Gauss’s law operator at each dummy vertex involves the cross edge to its support partner: for all \(i \in \mathrm{Fin}(W)\),

\[ \mathrm{shorPathGraph}(W).\mathrm{Adj}\bigl((\mathtt{true}, i), (\mathtt{false}, i)\bigr). \]
Proof

Unfolding \(\mathrm{shorPathAdj}\), the first disjunct applies: \(\mathtt{true} \neq \mathtt{false}\) (by \(\mathrm{Bool.noConfusion}\)) and the indices agree.

Theorem 1368 CX Commutation Gives Gauss’s Law

The CX commutation relation \(\mathrm{CX}^\dagger (X \otimes I) \mathrm{CX} = X \otimes X\) gives the Gauss’s law operator. Formally, for each \(i \in \mathrm{Fin}(W)\), both \((\mathtt{false}, i) \sim (\mathtt{true}, i)\) and \((\mathtt{true}, i) \sim (\mathtt{false}, i)\) hold in \(\mathrm{shorPathGraph}(W)\).

Proof

For each \(i\), the first adjacency follows from \(\mathrm{support\_ vertex\_ cross\_ adj}\) and the second from \(\mathrm{gaussLaw\_ at\_ dummy\_ involves\_ cross}\).

Theorem 1369 Shor-Style Gauss’s Law Product

The product of all Gauss’s law operators yields \(L\). Formally, for each vertex \(v\),

\[ \sum _{w \in \mathrm{ShorVertex}(W)} \mathbf{1}_{w = v} = 1 \in \mathbb {Z}/2\mathbb {Z}. \]
Proof

Let \(v\) be given. By simplification, the sum over the indicator function evaluating to \(1\) at \(v\) gives exactly \(1\).

The full Shor-style/gauging correspondence consists of five properties:

  1. There are \(W\) cross edges,

  2. There are \(W - 1\) dummy path edges,

  3. Each cross edge \(\mathrm{cross}(i)\) has endpoints \((\mathtt{false}, i)\) and \((\mathtt{true}, i)\),

  4. Each dummy path edge \(\mathrm{dummyPath}(i)\) has endpoints \((\mathtt{true}, i)\) and \((\mathtt{true}, i+1)\),

  5. The total edge count is \(2W - 1\).

Proof

The five components follow directly from the previously established results: \(\mathrm{cross\_ edge\_ count}\) for (1), \(\mathrm{dummy\_ path\_ edge\_ count}\) for (2), \(\mathrm{cross\_ edge\_ matching}\) for (3), reflexivity for (4), and \(\mathrm{shorStyle\_ edge\_ count\_ path}\) for (5).

Theorem 1371 Star Center Adjacency

For \(W \ge 2\), the star center \((\mathtt{true}, 0)\) is adjacent to every other dummy vertex \((\mathtt{true}, j+1)\) for \(j \in \mathrm{Fin}(W-1)\).

Proof

Unfolding \(\mathrm{shorStarAdj}\), the second disjunct applies: both components are \(\mathtt{true}\), the first index is \(0\), and \(j + 1 {\gt} 0\) by \(\mathrm{Nat.succ\_ pos}\).

Theorem 1372 Star Same Edge Count

The star graph has the same number of edges as the path variant:

\[ |\mathrm{ShorEdgeStar}(W)| = |\mathrm{ShorEdgePath}(W)|. \]
Proof

Rewriting both sides using \(\mathrm{shorStyle\_ edge\_ count\_ star}\) and \(\mathrm{shorStyle\_ edge\_ count\_ path}\), both equal \(2W - 1\).

Definition 1373 Shor Path GraphWithCycles

The Shor-style path graph as a\(\mathrm{GraphWithCycles}\) instance with cycle type \(\mathrm{Empty}\) (since the graph is a tree with \(0\) independent cycles). The instance consists of:

  • Graph: \(\mathrm{shorPathGraph}(W)\),

  • Edge endpoints: \(\mathrm{shorPathEdgeEndpoints}(W)\),

  • Edge adjacency and symmetry from the established theorems,

  • Cycles: the empty function from \(\mathrm{Empty}\) (no cycles).

Theorem 1374 Gauss’s Law Product: All-Ones Vertex Support

The product of all Gauss’s law vertex supports on the Shor path graph equals the all-ones vector:

\[ \mathrm{gaussLaw\_ product\_ vertexSupport}(\mathrm{ShorPathGraphWithCycles}(W)) = \mathbf{1}. \]
Proof

This follows directly from \(\mathrm{gaussLaw\_ product\_ vertexSupport\_ all\_ ones}\) applied to the \(\mathrm{ShorPathGraphWithCycles}(W)\) instance.

Theorem 1375 Gauss’s Law Product: Zero Edge Support

The product of all Gauss’s law edge supports on the Shor path graph is zero:

\[ \mathrm{gaussLaw\_ product\_ edgeSupport}(\mathrm{ShorPathGraphWithCycles}(W)) = 0. \]
Proof

This follows directly from \(\mathrm{gaussLaw\_ product\_ edgeSupport\_ zero}\) applied to the \(\mathrm{ShorPathGraphWithCycles}(W)\) instance.

Theorem 1376 Gauss’s Law Product is \(L\)

Combined result: the product of all Gauss’s law operators on the Shor path graph yields \(L\). That is, the vertex support product is the all-ones vector and the edge support product is zero:

\[ \mathrm{gaussLaw\_ product\_ vertexSupport} = \mathbf{1} \quad \text{and} \quad \mathrm{gaussLaw\_ product\_ edgeSupport} = 0. \]
Proof

This follows directly from \(\mathrm{gaussLaw\_ product\_ is\_ L}\) applied to the \(\mathrm{ShorPathGraphWithCycles}(W)\) instance, which combines the two previous results.