40 Rem 18: Relation to Lattice Surgery
The gauging measurement procedure generalizes surface code lattice surgery. We formalize three scenarios: standard lattice surgery via a ladder graph, long-range lattice surgery via a dummy grid graph, and LDPC generalization via a bridge graph.
The adjacency relation for the ladder graph on \(2n\) vertices. The vertex set is \(\mathrm{Bool} \times \mathrm{Fin}\, n\). Two vertices \(p = (b_1, i)\) and \(q = (b_2, j)\) are adjacent if \(p \neq q\) and either:
Rung: \(b_1 \neq b_2\) and \(i = j\) (same position, different boundary), or
Rail: \(b_1 = b_2\) and \(|i - j| = 1\) (same boundary, consecutive positions).
For all \(p, q \in \mathrm{Bool} \times \mathrm{Fin}\, n\), if \(\operatorname {ladderAdj}(p, q)\) then \(\operatorname {ladderAdj}(q, p)\).
Let \(\langle h_{\neq }, h_{\lor }\rangle \) be the hypothesis. We have \(q \neq p\) by symmetry of \(\neq \). We case-split on \(h_{\lor }\):
Rung case: We have \(b_1 \neq b_2\) and \(i = j\). By symmetry, \(b_2 \neq b_1\) and \(j = i\).
Rail case: We have \(b_1 = b_2\) and (\(i + 1 = j\) or \(j + 1 = i\)). By symmetry, \(b_2 = b_1\) and the disjunction is swapped.
For all \(p \in \mathrm{Bool} \times \mathrm{Fin}\, n\), \(\neg \operatorname {ladderAdj}(p, p)\).
Suppose \(\operatorname {ladderAdj}(p, p)\). Then \(p \neq p\), which is a contradiction.
The ladder graph connecting two boundary qubit sets of size \(n\). It is a simple graph on the vertex set \(\mathrm{Bool} \times \mathrm{Fin}\, n\) (\(2n\) vertices total), with adjacency given by \(\operatorname {ladderAdj}\): edges consist of rungs (across boundaries) and rails (within each boundary).
\(|\mathrm{Bool} \times \mathrm{Fin}\, n| = 2n\).
By simplification using the cardinality of product types, \(|\mathrm{Bool}| = 2\) and \(|\mathrm{Fin}\, n| = n\).
For each \(i \in \mathrm{Fin}\, n\), the pair \((\mathrm{false}, i)\) and \((\mathrm{true}, i)\) are adjacent in the ladder graph.
Unfolding the definitions, the pair satisfies \(p \neq q\) (since \(\mathrm{false} \neq \mathrm{true}\)) and the rung condition: different boundaries, same position.
For boundary \(b\) and positions \(i, j \in \mathrm{Fin}\, n\) with \(i + 1 = j\), the pair \((b, i)\) and \((b, j)\) are adjacent in the ladder graph.
Unfolding the definitions, the pair satisfies the rail condition: same boundary, consecutive positions. The distinctness \(p \neq q\) follows because \(i \neq j\) (since \(i + 1 = j\) implies \(i {\lt} j\)), which is verified by integer arithmetic.
For \(n \geq 1\), the ladder graph \(\operatorname {LadderGraph}(n)\) is connected.
We show preconnectedness: for any two vertices \(u\) and \(v\), there is a path from \(u\) to \(v\). It suffices to show that every vertex \(w = (b, k)\) is reachable from \((\mathrm{false}, 0)\). We proceed by induction on \(k\):
Base case (\(k = 0\)): \((\mathrm{false}, 0)\) is reachable from itself by reflexivity.
Inductive step: By the induction hypothesis, \((\mathrm{false}, m)\) is reachable. Since \(m + 1 {\lt} n\), the rail edge from \((\mathrm{false}, m)\) to \((\mathrm{false}, m+1)\) extends the path.
This shows \((\mathrm{false}, k)\) is reachable. For \(b = \mathrm{true}\), we use the rung edge from \((\mathrm{false}, k)\) to \((\mathrm{true}, k)\). Nonemptiness holds since \((\mathrm{false}, 0)\) exists when \(n \geq 1\).
Each vertex of the ladder graph has degree at most \(3\). The rung contributes \(1\) neighbor, and each rail direction contributes at most \(1\).
For any vertex \(v\), the neighbor set is contained in the set \(\{ (\neg v_1, v_2),\, (v_1, \min (v_2+1, n-1)),\, (v_1, v_2-1)\} \), which has at most \(3\) elements. Any neighbor \(w\) is either a rung partner (different boundary, same position) or a rail neighbor (same boundary, position differing by \(1\)), and each falls into one of these three candidates. Hence the degree is at most \(3\).
The edge count of the ladder graph is at most \(3n\).
By the handshaking lemma, \(2|E| = \sum _v \deg (v)\). Since each vertex has degree \(\leq 3\) and there are \(2n\) vertices, we have \(\sum _v \deg (v) \leq 2n \cdot 3 = 6n\). Therefore \(|E| \leq 3n\).
For a graph \(G\) with vertex set \(V\), cycle set \(C\), check operators \(\{ s_j\} _{j \in J}\), deformed code data, a cycle condition (each cycle has even incidence with every vertex), and pairwise commuting original checks, all checks of the deformed code pairwise commute:
For the ladder graph, this means the deformed code is a surface code on the union of the two patches: Gauss checks \(A_v\) become vertex stabilizers, flux checks \(B_p\) become face stabilizers, and deformed checks \(\tilde{s}_j\) become boundary stabilizers.
This follows directly from the general pairwise commutation theorem \(\operatorname {allChecks\_ commute}\).
For any vertex \(v \in V\), the Gauss law operator \(A_v = \operatorname {gaussLawOp}(G, v)\) is pure \(X\)-type:
On the ladder graph, \(A_v\) corresponds to the surface code vertex stabilizer: a star of \(X\) operators centered at \(v\).
By extensionality, for each qubit \(q\), the \(Z\)-component of \(\operatorname {gaussLawOp}(G, v)\) is zero by simplification of the definition.
The logical operator equals the product of all Gauss operators:
On the ladder graph where \(V = \operatorname {supp}(\bar{X}_1) \cup \operatorname {supp}(\bar{X}_2)\), this gives \(L = \bar{X}_1 \otimes \bar{X}_2\).
This is the symmetric form of the Gauss law product identity \(\prod _v A_v = L\).
Phase 3 of the gauging procedure measures \(Z_e\) on each edge qubit \(e \in E(G)\). For each edge \(e\), the measured operator \(Z_e^{\mathrm{meas}}\) satisfies three properties:
\(Z_e^{\mathrm{meas}}.\mathrm{xVec} = 0\) (pure \(Z\)-type, does not disturb vertex qubits),
\(\forall \, e',\; \operatorname {PauliCommute}(Z_e^{\mathrm{meas}}, Z_{e'}^{\mathrm{meas}})\) (all mutually commute, can be measured simultaneously),
\(Z_e^{\mathrm{meas}} \cdot Z_e^{\mathrm{meas}} = 1\) (self-inverse, valid projective measurement).
After measuring all \(Z_e\), the edge qubits are projected onto \(Z\) eigenstates, disentangling them from the vertex qubits and recovering the two separate surface code patches.
The three components follow directly from:
\(\operatorname {edgeZOperatorMeasured\_ xVec}\) (the edge \(Z\) operator has no \(X\) support),
\(\operatorname {edgeZ\_ measured\_ commute}\) (edge \(Z\) operators pairwise commute),
\(\operatorname {edgeZOperatorMeasured\_ mul\_ self}\) (each edge \(Z\) operator is self-inverse).
The logical operator \(L = \operatorname {logicalOp}(G)\) has no \(Z\) support:
By extensionality, for each qubit \(q\), the \(Z\)-component of \(\operatorname {logicalOp}(G)\) is zero by simplification of the definition.
The logical operator satisfies \(L \cdot L = 1\).
By extensionality on both the \(X\) and \(Z\) vector components, each component squared is zero in \(\mathbb {F}_2\), giving the identity.
\(|\mathrm{Bool} \times \mathrm{Fin}\, n| = n + n\).
By simplification using cardinalities of product types: \(|\mathrm{Bool}| \cdot |\mathrm{Fin}\, n| = 2n = n + n\).
For a ladder graph \(G\) connecting two boundary qubit sets of size \(n \geq 1\):
\(G\) is connected,
\(|\mathrm{Bool} \times \mathrm{Fin}\, n| = 2n\),
every vertex has degree \(\leq 3\) (constant overhead per qubit),
the edge count is at most \(3n\).
The four components follow directly from the previously established results: connectedness of the ladder graph, vertex count \(2n\), degree bound \(\leq 3\), and edge count bound \(\leq 3n\).
The adjacency relation for the grid graph on \(n \times (D+2)\) vertices. Vertices are \(\mathrm{Fin}\, n \times \mathrm{Fin}\, (D+2)\). Two vertices \(p = (r_1, c_1)\) and \(q = (r_2, c_2)\) are adjacent if \(p \neq q\) and either:
Horizontal: \(r_1 = r_2\) and \(|c_1 - c_2| = 1\) (same row, adjacent columns), or
Vertical: \(c_1 = c_2\) and \(|r_1 - r_2| = 1\) (same column, adjacent rows).
The grid graph connecting two boundary edges with \(D\) columns of dummy ancillas. Column \(0\) is boundary \(1\), column \(D+1\) is boundary \(2\), and columns \(1, \ldots , D\) are dummy ancillas. This is a simple graph on \(\mathrm{Fin}\, n \times \mathrm{Fin}\, (D+2)\).
\(|\mathrm{Fin}\, n \times \mathrm{Fin}\, (D+2)| = n \cdot (D + 2)\).
By simplification using cardinalities of product and \(\mathrm{Fin}\) types.
For \(i \in \mathrm{Fin}\, n\) and \(j, j' \in \mathrm{Fin}\, (D+2)\) with \(j + 1 = j'\), the pair \((i, j)\) and \((i, j')\) are adjacent in the grid graph.
The pair satisfies the horizontal adjacency condition: same row, adjacent columns. Distinctness follows because \(j \neq j'\) (since \(j + 1 = j'\) implies \(j {\lt} j'\)), verified by integer arithmetic.
For \(i, i' \in \mathrm{Fin}\, n\) and \(j \in \mathrm{Fin}\, (D+2)\) with \(i + 1 = i'\), the pair \((i, j)\) and \((i', j)\) are adjacent in the grid graph.
The pair satisfies the vertical adjacency condition: same column, adjacent rows. Distinctness follows because \(i \neq i'\) (since \(i + 1 = i'\)), verified by integer arithmetic.
For \(n \geq 1\), the dummy grid graph \(\operatorname {DummyGridGraph}(n, D)\) is connected.
We show preconnectedness. It suffices to show every vertex \((r, c)\) is reachable from \((0, 0)\). First, we reach \((0, c)\) from \((0, 0)\) by induction on \(c\), using horizontal edges at each step. Then we reach \((r, c)\) from \((0, c)\) by induction on \(r\), using vertical edges at each step. Composing these two paths gives reachability of any vertex from \((0, 0)\). For any two vertices \(u, v\), we have paths from \((0,0)\) to each, giving a path between them by transitivity and symmetry. Nonemptiness holds since \((0, 0)\) exists when \(n \geq 1\).
Each vertex of the grid graph has degree at most \(4\) (up, down, left, right).
For any vertex \(v = (r, c)\), the neighbor set is contained in the set of at most four candidates: \((r, \min (c+1, D+1))\), \((r, c-1)\), \((\min (r+1, n-1), c)\), and \((r-1, c)\). This set has at most \(4\) elements. Any neighbor \(w\) must be horizontally or vertically adjacent, and in either case falls into one of these four candidates. Hence the degree is at most \(4\).
For boundary qubit sets of size \(n\) separated by distance \(D\):
The overhead is \(n\) qubits per column, independent of \(D\).
This follows by ring arithmetic.
The total qubit count decomposes into boundary plus ancilla:
This follows by ring arithmetic.
The edge count of the grid graph satisfies
By the handshaking lemma, \(2|E| = \sum _v \deg (v)\). Since each vertex has degree \(\leq 4\) and there are \(n(D+2)\) vertices, we have \(\sum _v \deg (v) \leq n(D+2) \cdot 4\). Therefore \(|E| \leq 2 \cdot n \cdot (D+2)\).
The adjacency relation for the bridge graph on \(V \oplus V\). Two vertices \(p, q \in V \oplus V\) are adjacent if:
Both in copy 1 (\(\operatorname {inl}(v)\), \(\operatorname {inl}(w)\)): \(G.\operatorname {Adj}(v, w)\),
Both in copy 2 (\(\operatorname {inr}(v)\), \(\operatorname {inr}(w)\)): \(G.\operatorname {Adj}(v, w)\),
Across copies (\(\operatorname {inl}(v)\), \(\operatorname {inr}(w)\) or vice versa): \(v = w\) and \(v \in \operatorname {bridges}\).
For all \(p, q \in V \oplus V\), if \(\operatorname {bridgeAdj}(G, \operatorname {bridges}, p, q)\) then \(\operatorname {bridgeAdj}(G, \operatorname {bridges}, q, p)\).
We match on \(p\) and \(q\). If both are in the same copy, symmetry follows from \(G\)’s symmetry. If they are in different copies, we have \(v = w\) and \(v \in \operatorname {bridges}\); swapping gives \(w = v\) and \(w \in \operatorname {bridges}\) (after substitution).
For all \(p \in V \oplus V\), \(\neg \operatorname {bridgeAdj}(G, \operatorname {bridges}, p, p)\).
Matching on \(p\): if \(p = \operatorname {inl}(v)\) or \(p = \operatorname {inr}(v)\), then \(\operatorname {bridgeAdj}(p, p)\) would require \(G.\operatorname {Adj}(v, v)\), which contradicts the loopless property of \(G\).
The bridge graph: two copies of \(G\) on vertex set \(V \oplus V\), connected by bridge edges at specified vertices in \(\operatorname {bridges} \subseteq V\).
If \(G.\operatorname {Adj}(v, w)\), then \((\operatorname {BridgeGraph}\, G\, \operatorname {bridges}).\operatorname {Adj}(\operatorname {inl}(v), \operatorname {inl}(w))\).
This holds directly by the definition of bridge adjacency for same-copy vertices.
If \(G.\operatorname {Adj}(v, w)\), then \((\operatorname {BridgeGraph}\, G\, \operatorname {bridges}).\operatorname {Adj}(\operatorname {inr}(v), \operatorname {inr}(w))\).
This holds directly by the definition of bridge adjacency for same-copy vertices.
For \(v \in \operatorname {bridges}\), the bridge graph has an edge \(\operatorname {inl}(v) \sim \operatorname {inr}(v)\).
Unfolding the definition of bridge adjacency for cross-copy vertices, the condition \(v = v \land v \in \operatorname {bridges}\) holds by reflexivity and the hypothesis.
\(|V \oplus V| = 2|V|\).
By simplification using the cardinality of sum types and ring arithmetic.
The graph homomorphism \(G \to \operatorname {BridgeGraph}(G, \operatorname {bridges})\) embedding \(G\) as copy 1, via \(v \mapsto \operatorname {inl}(v)\). Paths in \(G\) correspond to paths in the bridge graph within copy 1.
The graph homomorphism \(G \to \operatorname {BridgeGraph}(G, \operatorname {bridges})\) embedding \(G\) as copy 2, via \(v \mapsto \operatorname {inr}(v)\).
If \(G\) is connected and \(\operatorname {bridges}\) is nonempty, then \(\operatorname {BridgeGraph}(G, \operatorname {bridges})\) is connected.
Let \(b \in \operatorname {bridges}\). It suffices to show every vertex \(w \in V \oplus V\) is reachable from \(\operatorname {inl}(b)\).
If \(w = \operatorname {inl}(v)\): Since \(G\) is connected, \(b\) and \(v\) are connected in \(G\). The copy 1 embedding maps this path to a path in the bridge graph from \(\operatorname {inl}(b)\) to \(\operatorname {inl}(v)\).
If \(w = \operatorname {inr}(v)\): First cross the bridge from \(\operatorname {inl}(b)\) to \(\operatorname {inr}(b)\) (using \(b \in \operatorname {bridges}\)). Then, since \(G\) is connected, \(b\) and \(v\) are connected in \(G\). The copy 2 embedding maps this to a path from \(\operatorname {inr}(b)\) to \(\operatorname {inr}(v)\).
Nonemptiness holds since \(\operatorname {inl}(b)\) exists.
If \(v\) and \(w\) are reachable in \(G\), then:
Paths within a copy of \(G\) are paths in the bridge graph.
From the reachability hypothesis, we obtain a walk \(p\) in \(G\) from \(v\) to \(w\) with \(|p| = \operatorname {dist}_G(v, w)\). Mapping \(p\) via the copy 1 embedding gives a walk in the bridge graph of the same length. Since the distance is at most the length of any walk, we conclude \(\operatorname {dist}_{\operatorname {BridgeGraph}}(\operatorname {inl}(v), \operatorname {inl}(w)) \leq |p| = \operatorname {dist}_G(v, w)\).
If \(G\) has the short paths property with bound \(D\) (i.e., for each check \(s_j\), any two vertices \(u, v\) in the \(Z\)-support of \(s_j\) satisfy \(\operatorname {dist}_G(u, v) \leq D\)), and \(G\) is connected, then for any bridge set, vertices in the same copy of the bridge graph also have short paths:
We compute:
where the first inequality is the bridge graph distance bound (since \(u\) and \(v\) are reachable in the connected graph \(G\)), and the second follows from the short paths property.
When \(G\) has a cycle basis where each cycle has weight \(\leq W\), the bridge graph inherits this bound for cycles within each copy:
This follows directly from the low-weight cycle basis property of \(G\).
If \(G\) satisfies short paths with bound \(D\) and low-weight cycles with bound \(W\), and \(G\) is connected with a nonempty bridge set, then the bridge graph provides a valid gauging setup regardless of its Cheeger constant:
\(\operatorname {BridgeGraph}(G, \operatorname {bridges})\) is connected,
Short paths within each copy: \(\operatorname {dist}_{\operatorname {BridgeGraph}}(\operatorname {inl}(u), \operatorname {inl}(v)) \leq D\) for \(u, v\) in the \(Z\)-support of any check,
Low-weight cycles: each cycle in the basis has weight \(\leq W\).
The three components follow from the bridge graph connectivity theorem, the short paths transfer theorem, and the low-weight cycles inheritance, respectively.
For two code blocks with weight-\(W\) logical \(X\) operators, given a connected graph \(G\) satisfying short paths (bound \(D\)) and low-weight cycle basis (bound \(W\)), with a nonempty bridge set:
\(\operatorname {BridgeGraph}(G, \operatorname {bridges})\) is connected,
\(|V \oplus V| = 2|V|\),
Short paths within each copy are preserved (bound \(D\)),
Low-weight cycles within each copy are preserved (bound \(W\)).
This generalizes lattice surgery to arbitrary LDPC codes.
The four components follow from bridge graph connectivity, the vertex count identity \(|V \oplus V| = 2|V|\), the short paths transfer theorem, and the low-weight cycles inheritance, respectively.
For boundary qubit sets of size \(n \geq 1\) separated by distance \(D\):
The grid graph \(\operatorname {DummyGridGraph}(n, D)\) is connected,
\(|\mathrm{Fin}\, n \times \mathrm{Fin}\, (D+2)| = n(D+2)\),
\(n(D+2) = 2n + nD\) (the total decomposes into \(2n\) boundary qubits and \(nD\) ancillas).
The three components follow from the grid graph connectivity theorem, the vertex count formula, and the overhead decomposition identity.
The gauging measurement procedure generalizes lattice surgery in three settings:
Standard lattice surgery (ladder graph): For all \(n \geq 1\), the ladder graph is connected, has \(2n\) vertices, degree \(\leq 3\), and at most \(3n\) edges.
Long-range lattice surgery (grid graph): For all \(n \geq 1\) and \(D \geq 0\), the grid graph is connected and \(n(D+2) = 2n + nD\).
LDPC generalization (bridge graph): For any connected graph \(G\) with nonempty bridge set, the bridge graph is connected with \(2|V|\) vertices.
We prove each part separately:
For the ladder graph with \(n \geq 1\): connectivity, vertex count \(2n\), degree bound \(\leq 3\), and edge bound \(\leq 3n\) follow from the established results.
For the grid graph with \(n \geq 1\): connectivity follows from the grid connectivity theorem, and the decomposition \(n(D+2) = 2n + nD\) follows from the overhead decomposition.
For the bridge graph: connectivity follows from the bridge graph connectivity theorem (using \(G\) connected and bridges nonempty), and the vertex count \(|V \oplus V| = 2|V|\) follows from the cardinality identity.