---
title: Lattice Surgery in Quantum Computation
url: https://www.emergentmind.com/topics/lattice-surgery
type: topic
---

# Lattice Surgery in Quantum Computation

Searching arXiv for core papers on lattice surgery and related extensions.
Lattice surgery is a measurement-based method for fault-tolerant quantum computation in which logical operations are implemented by temporarily merging and splitting neighboring topological-code patches so that newly measured stabilizers reveal joint logical Pauli observables. Introduced for planar surface codes as a way to preserve strictly two-dimensional nearest-neighbor structure without transversal inter-patch gates or defect braiding, it has since become a general framework spanning rotated and rectangular surface codes, color codes, qudit codes, measurement-based realizations on the Raussendorf lattice, modular architectures, and heterogeneous-code interfaces [1111.4022][2204.13228].

## 1. Origins and architectural role

The original surface-code formulation defined lattice surgery as a way to couple planar code patches by “cutting” and “stitching” their boundaries, thereby enabling universal quantum computation, including magic state injection, while maintaining a strictly 2D nearest-neighbor design. In that formulation, merge and split operations replaced braided logic, and a rotated lattice further reduced qubit count. The paper also showed that an encoded CNOT between two distance 3 logical states is possible with 53 physical qubits, half of that required in any other known construction in 2D [1111.4022].

Subsequent compiler-oriented work reframed lattice surgery as a translation target for inverse-ICM circuits. In that picture, smooth splits create the entangled resource structure associated with multi-target CNOTs, rough merges reconcile repeated logical wires, and measurement-time state injection supplies the non-Clifford basis changes. This made lattice surgery a patch-based compilation model rather than a small collection of ad hoc logical gadgets [1608.05208].

Resource analyses later argued that the patch-based picture is not only locality-preserving but also materially cheaper than defect-and-braid approaches. One study estimated that rotated-patch storage requires about \(3d^2\) physical qubits per logical qubit, compared with about \(12.5d^2\) for double-defect storage, and that an algorithm with \(10^8\) \(T\) gates and 100 logical qubits at physical error rate \(p\sim 10^{-3}\) could be reduced from about \(1.8\times 10^6\) to about \(3.7\times 10^5\) physical qubits while keeping runtime in the same ballpark [1808.06709].

## 2. Primitive operations and logical semantics

At the primitive level, lattice surgery is not a conventional gate model. Rough and smooth merges are non-unitary logical parity measurements, and rough and smooth splits are non-unitary embeddings that change the number of encoded qubits. In the original surface-code construction, rough merge measures \(X_LX_L\), smooth merge measures \(Z_LZ_L\), smooth split maps
\[
\alpha \lvert 0\rangle_L + \beta \lvert 1\rangle_L \longrightarrow \alpha \lvert 00\rangle_L + \beta \lvert 11\rangle_L,
\]
and rough split maps
\[
a\lvert +\rangle + b\lvert -\rangle \longrightarrow a\lvert ++\rangle + b\lvert --\rangle.
\]
These transformations explain why lattice surgery naturally generates Bell and GHZ states and why merge operations are better interpreted as parity projections than as encoded unitaries [1111.4022].

A recurring misconception is that lattice surgery is merely a surface-code way to implement CNOT. A more exact statement is that CNOT is one derived construction built from the deeper primitives of merge and split. The ZX-calculus formalization made this explicit: rough operations correspond to red spiders, smooth operations to green spiders, positive branches correspond to plain spiders, and negative branches correspond to spiders with byproduct \(\pi\)-phase nodes. In that formulation, the lattice-surgery primitives satisfy the axioms of a dagger special commutative associative Frobenius algebra, and branch-dependent corrections are represented natively by ensembles of diagrams rather than by forcing the process into standard circuit notation [1704.08670].

This semantic viewpoint matters operationally. It explains why lattice surgery composes naturally with measurement-based computation, Pauli-frame updates, and teleportation-based non-Clifford primitives, and why the right intermediate representation is often a parity-measurement network rather than a gate list.

## 3. Generalizations beyond homogeneous surface-code patches

Although surface codes dominate the practical literature, lattice surgery is not confined to homogeneous qubit patches. In triangular 4.8.8 color codes, lattice surgery realizes the universal set
\[
\{I,\ |0\rangle,\ |+\rangle,\ M_Z,\ M_X,\ S,\ H,\ T|+\rangle,\ \mathrm{CNOT}\},
\]
with transversal \(H\) and \(S\) in a single step, and with per-code-distance qubit cost approximately half that of surface-code lattice surgery. The same work also improved existing surface-code lattice-surgery methods for CNOT, \(H\), and \(S\) [1407.5103].

Qudit lattice surgery extends the framework from qubits to arbitrary finite-dimensional \(\mathbb{Z}_d\) surface codes built on the group algebra \(\mathbb{C}\mathbb{Z}_d\). In that setting, one logical patch encodes a \(d\)-dimensional qudit, smooth split satisfies
\[
\Delta_s:\ |i\rangle_L \mapsto |i\rangle_L\otimes |i\rangle_L,
\]
rough split satisfies
\[
\Delta_r:\ |\delta_i\rangle_L \mapsto |\delta_i\rangle_L\otimes |\delta_i\rangle_L,
\]
and merge outcomes become \(\mathbb{Z}_d\)-valued additive charges rather than binary parities. The formalism remains closely tied to the qudit ZX-calculus and still requires magic state injection for universality [2204.13228].

In the measurement-based Raussendorf lattice, the same ideas appear as operations on 3D cluster-state “boxes.” Interior qubits are measured in the \(X\) basis, exterior qubits in the \(Z\) basis, and the time slice on which a region is turned on determines its logical initialization: switching from \(Z\) to \(X\) on an even slice yields \(\lvert +\rangle_L\), while switching on an odd slice yields \(\lvert 0\rangle_L\). Rough and smooth merges become time-scheduled basis changes on boundaries between boxes [1711.04921].

A further extension couples different CSS codes. Generalized lattice surgery has been used to connect a surface code hosting the main computation to a 3D color code supporting transversal non-Clifford gates. In the explicit construction, interface ancillas are added, boundary \(X\)-checks are enlarged, and new \(Z\)-checks are introduced so that their product equals the desired inter-code logical operator \(\overline Z_B\overline Z_M\). This enables “magic teleportation,” in which a non-Clifford gate prepared transversally in one code is teleported into another through a joint logical measurement, with an overhead model written additively rather than multiplicatively [2503.19758].

## 4. Surface-code protocol engineering, decoding, and \(Y\)-type measurements

Practical lattice surgery requires more than the abstract merge–split picture. One line of work introduced a decoder that corrects both spacelike and timelike errors during lattice-surgery protocols under a biased circuit-level noise model, proposed a twist-free method for arbitrary Pauli measurements that avoids bulk twist defects, and added temporally encoded lattice surgery to reduce both runtime and total space-time cost. In that framework, the runtime of a Pauli-based computation was written as \(T_{\mathrm{PBC}}=(d_m+1)\mu\), emphasizing that lattice-surgery runtime is set jointly by measurement distance and the number of adaptive Pauli measurements [2109.02746].

The most detailed surface-code engineering treatment of \(Y\)-containing measurements took the opposite route and made twist defects explicit. It showed that the most general surface-code lattice-surgery operations require twist defects for direct fault-tolerant measurement of mixed Pauli observables involving \(Y\), supplied a concrete circuit-level protocol with a minimal degree-8 connectivity extension, and introduced ancilla-assisted circuits for weight-five twist checks and elongated stabilizers that fit into a four two-qubit-gate time-step schedule. It also proved, via gauge fixing, a direct \(Y\)-boundary measurement scheme that bypasses the extension stage used in earlier proposals, and reported that the threshold for timelike logical failures is slightly decreased relative to twist-free bulk surgery but that, for CNOT infidelities below \(5\times 10^{-3}\), the performance degradation is mild and preferable over the paper’s proposed twist-free alternative [2201.05678].

Taken together, these results clarify an important point. For direct measurement of generic \(Y\)-containing observables in standard surface-code geometry, twist defects are the natural construction; however, distinct twist-free and temporally encoded protocols can reproduce the same computational power while trading circuit depth, routing, scheduling complexity, and decoder structure in different ways. A plausible implication is that “whether lattice surgery needs twists” is not a yes-or-no question but an architectural choice tied to hardware connectivity, bias regime, and the form of the target Pauli measurements.

## 5. Modular architectures and experimental realizations

In modular surface-code architectures, the boundary stabilizers needed for lattice surgery become inter-module operations. A Bell-measurement-based protocol recast modular lattice surgery so that all non-local operations are Bell measurements, reducing the standard entanglement consumption from \(2d-1\) Bell pairs per syndrome round to \(d\), confining interface noise to the interface, and mitigating distance-reducing hook errors by alternating between two valid syndrome-extraction schedules. Circuit-level simulations for logical Bell-state preparation reported a typical \(\sim 40\%\) entanglement-rate saving at fixed logical error rate [2510.13541].

The first direct hardware realization of lattice surgery between topologically encoded logical qubits used a 10-qubit trapped-ion processor implementing two 4-qubit surface-code logical qubits. That experiment demonstrated rough and smooth surgery, generated a logical Bell state with fidelity \(58.0(1.6)\%\) raw and \(75.3(1.6)\%\) post-selected, and used the same parity-measurement primitive for logical teleportation, achieving teleported-state fidelities up to \(87(2)\%\) raw and \(97(1)\%\) post-selected for \(\lvert 0_L\rangle\) [2006.03071].

A later planar superconducting processor realized lattice-surgery operations between two distance-three surface-code logical qubits during repeated syndrome extraction. After leakage rejection, the logical qubits exhibited per-cycle error rates \(0.0365(2)\) and \(0.0282(1)\). Joint initialization and lattice splitting were used to prepare a logical Bell state with decoded fidelity lower bound \(0.532_{-1}^{+1}\) and post-selected fidelity lower bound \(0.925_{-5}^{+5}\), and magic-state injection plus gate teleportation implemented continuous non-Clifford rotations about the logical \(X\) axis, including a post-selected logical \(R_X(\pi/4)\) fidelity of \(0.943_{-9}^{+10}\) conditioned on no detected errors [2606.06598].

A complementary superconducting-architecture study of logical teleportation between two planar patches compared fully modular and depleted schedules, found that the depleted distance-three protocol improves logical teleportation infidelity by about a factor of \(\sim 2\), concluded that the optimal interface is a single column of data qubits, and estimated an effective threshold of \(\lambda_{\rm th}\approx 0.55\) relative to its reference error model. The same work argued that adaptive in-sequence decision logic is beneficial only if control latency is on the few-hundred-nanosecond scale and that the depleted schedule is not a scalable replacement for modular protocols at larger distance [2606.15190].

## 6. Compilation, routing, and verification

Once lattice surgery is treated as a compilation target, its geometry becomes a constrained optimization problem. The decision problem of determining whether a lattice-surgery translation can achieve its theoretical optimum area is NP-complete, and the corresponding optimization problem is NP-hard via reduction from 3-partition. In the formal abstraction used for that proof, multi-target CNOT columns become vertical patch chains, repeated qubit labels enforce horizontal adjacency constraints, and exact optimization reduces to minimizing the bounding box of the planar patch layout [1702.00591].

Scheduling many surgeries over time adds a second layer of complexity. A later study reduced two-body lattice-surgery scheduling with instruction decomposition to embedding paths in a 3D voxel lattice, where valid paths must satisfy a kink-parity condition. Its Dijkstra-projection heuristic searches only in 2D while lifting paths into 3D, has path-search complexity \(O(n^2\log n)\), and on a SELECT benchmark derived from qubitization-based quantum phase estimation improved throughput by \(2.7\times\) over look-ahead BFS [2401.15829].

At the program-analysis level, lattice surgery can be modeled as dynamic graph connectivity. In \(\mathcal{Q}_{LS}\), a logical qubit at location \(l\) has type \(qbit(l)\), multi-qubit measurements become path-existence obligations on an architecture graph \(G=(V,E)\), and a static type system extracts a command sequence of allocations, deallocations, and merge constraints. The resulting soundness theorem states that a well-typed program will not get stuck because a required surgery path is unavailable, and type checking is reduced to offline dynamic connectivity [2409.00529].

These results make clear that lattice surgery is not only a code-deformation technique but also a software problem. Placement, routing, timing, and static correctness are all first-class concerns. A common high-level description—“measure a joint parity by merging two patches”—suppresses the fact that scalable use of lattice surgery requires nontrivial compiler heuristics, formal verification, and architecture-specific routing policies.

Source: https://www.emergentmind.com/topics/lattice-surgery