Lattice Surgery
A surface-code logical qubit is a square patch of physical qubits stabilized by weight-four -type star checks and -type plaquette checks, with two logical operators and carried as strings of Paulis that span the patch between opposite edges. Those edges come in two flavours — smooth, where -strings terminate, and rough, where -strings terminate — and the entire logic of surface-code computation turns out to hang on that distinction. Lattice surgery is the discovery that you can compute simply by editing the stabilizer group at the boundary: bring two patches edge to edge, switch on a row of new checks that bridge the seam, and the two codes fuse into one; stop measuring those checks, and the fused code splits back into two. The move that makes this powerful is that a merge is not passive gluing. When two patches meet along boundaries of the same type, the new seam checks are individually independent, but their product equals a joint logical operator of the two patches. Turning them on and reading their syndromes therefore performs a genuine fault-tolerant measurement of , whose outcome is nothing but the product of the fresh seam syndrome bits. A parity measurement of two logical operators is exactly the primitive that measurement-based circuit identities need to synthesize a CNOT, so all of Clifford computation collapses into a choreography of gluing and ungluing tiles, tracked in a classical Pauli frame and completed by injected magic states for the non-Clifford gate. Because the patches tile a plane edge to edge instead of threading defects through a thicker three-dimensional spacetime, lattice surgery roughly halves the qubit overhead of braiding while preserving the same code distance and threshold — which is why it is the native logic of essentially every planar surface-code architecture built today.
- Lattice surgery does logic on surface-code patches by merging their boundaries (switching on new seam checks) and later splitting them (switching those checks off), never by transversal gates or braiding.
- A merge along boundaries of the same type measures a joint logical Pauli: smooth boundaries give , rough boundaries give , because the product of the seam checks equals that joint operator, .
- The measurement outcome is the product of the freshly measured seam syndrome bits, , and it is recorded in the software Pauli frame, never physically applied.
- A merge then a split realizes a joint logical measurement up to a deterministic Pauli byproduct; two merges plus one ancilla patch build a fault-tolerant CNOT, and with injected magic states this closes a universal Clifford+ set in strictly 2D nearest-neighbour hardware.
- Distance is preserved only at the fault-tolerant operating point — seam width and rounds of syndrome extraction — giving and .
- Key idea: merging two surface-code patches along a shared boundary turns on new stabilizers whose product equals a joint logical operator , so the merge measures that operator fault-tolerantly and the split restores two patches up to a recorded Pauli byproduct — converting every logical Clifford gate into a sequence of two-patch parity measurements.
Merging two surface-code patches along a shared boundary turns on new stabilizers whose product equals a joint logical operator ; the merge thus measures that operator fault-tolerantly, and the subsequent split restores two patches up to a recorded Pauli byproduct — converting all logical Clifford gates into sequences of two-patch parity measurements.
Where this lives today
Lattice surgery has moved from proposal to the default operating model of fault-tolerant hardware. On the theory-and-compilation side, Litinski's Pauli-based-computation framing has become the common language of surface-code resource estimation: an algorithm is compiled into a stream of multi-qubit Pauli-product measurements, each realized by a multi-patch merge–split, and open-source lattice-surgery schedulers optimize the resulting spacetime layout as a tiling problem, feeding magic states from distillation factories into merges to supply the non-Clifford gates. On the hardware side, the ingredients surgery is built from — repeated stabilizer rounds and boundary manipulation — are now demonstrated below threshold: Google's Willow processor showed in 2024 that a surface-code logical qubit's error falls as the distance grows from to to , the scaling surgery relies on, and superconducting and trapped-ion groups have begun running merge–split operations and logical two-qubit gates directly. Neutral-atom platforms, with their movable qubits and long-range reconfigurability, are a particularly natural home: they can shuttle patches into adjacency and perform merges without a fixed 2D wiring constraint, and 2024 logical-processor demonstrations executed transversal and lattice-surgery-style operations on dozens of logical qubits. Across every roadmap, the same accounting recurs — logical qubits are patches, gates are merges, and the dominant cost is the magic-state factories that keep the surgery fed — which is exactly the architecture Horsman and colleagues sketched in 2012.
The physical picture
Picture each logical qubit as a square tile. Two opposite edges are smooth — the places where a -string is allowed to end — and the other two are rough, where a -string ends. Set two tiles side by side and they are two independent logical qubits: their stabilizer groups do not talk to each other, and are four separate logical operators. Now glue the touching edges by switching on a fresh row of parity checks that straddle the seam. Those checks are ordinary weight-four plaquettes — the same kind the hardware already measures for memory — but their collective product is not ordinary at all: it equals the joint logical operator of the two tiles. Reading the seam is therefore reading a logical parity, and that is the whole trick. The first figure shows the two tiles, the seam, and the identity that makes a merge a measurement.
Why is the merge measurement fault-tolerant, and why does it leave half the information untouched? Because the seam is itself a strip of code. The product is a -type object, so it commutes with the conjugate joint operator : the information stored in the basis sails through the merge unmeasured, exactly as a non-destructive measurement of must leave it. Meanwhile the individual and each anticommute with some seam check and so cease to be independent logical operators — the merged tile is a single logical qubit with and . And the whole thing inherits the code's threshold: no error string of weight below the seam width can cross from one patch's logical operator to the other, and no run of measurement faults shorter than rounds can fake the joint outcome. The second figure shows how these merges compose into the workhorse gate — a logical CNOT — and quotes the logical error a single merge costs at distance .
The core equations
A surface-code patch is defined by its stabilizer group: two commuting families of local parity checks whose common eigenspace is the code space. The -type checks live on vertices (stars) and the -type on plaquettes; every physical qubit is touched by both kinds, and the checks all mutually commute because any star and plaquette overlap on an even number of qubits.
where: — -type star check, weight 4 in the bulk and weight 3 at a boundary; — -type plaquette check, weight 4 in the bulk, weight 3 at a boundary; — Pauli operators on physical qubit ; — the vertices and plaquettes of the lattice. Reading: the code is fixed entirely by which local parities are pinned to ; computation will amount to changing that list at the boundary. The single encoded qubit is carried by two logical operators, each a string of single-qubit Paulis that crosses the patch between a matching pair of boundaries. A -string runs rough-to-rough; a -string runs smooth-to-smooth. They anticommute, which is what certifies that the patch stores exactly one qubit rather than zero or two.
where: — a path of qubits joining the two rough boundaries; — a path joining the two smooth boundaries; the two paths cross on an odd number of qubits. Reading: logical information lives in non-local strings, so no local disturbance of weight below can read or corrupt it — the origin of the code's protection and of surgery's fault tolerance. To merge two patches, adjoin their stabilizer groups and add a new set of seam checks that straddle the gap between the facing boundaries. For a smooth merge the seam checks are -type; for a rough merge they are -type. The enlarged group defines one bigger code on the union of the two patches plus the seam.
where: — the stabilizer groups of the two original patches; — the new weight-four seam checks (Z-type for a smooth merge) bridging one boundary qubit of patch 1 to the adjacent boundary qubit of patch 2. Reading: the merge is a purely local edit — a handful of new commuting checks — yet it changes the logical content globally, because their product is not local. That is the crucial identity. Telescoping the seam checks along the seam makes the interior gap qubits cancel in pairs, and the two surviving boundary rows are each a deformation of a logical . The product of every seam check therefore equals the joint logical .
where: — the measured eigenvalue of seam check ; — the inferred joint-parity outcome. Reading: because is literally a product of measured stabilizers, its eigenvalue is determined, not disturbed — the merge is a measurement, and its result is the product of the fresh syndrome bits, a random that must be fed into the Pauli frame. Splitting reverses the merge: stop measuring the seam checks and measure out the seam qubits in the single-qubit basis conjugate to the seam checks. Time-reversal of the stabilizer dynamics returns two clean patches, with the only residue a deterministic Pauli byproduct fixed by the seam-qubit outcomes.
where: — the single-qubit -basis outcome on a seam qubit measured out during the split; — the byproduct exponent. Reading: the byproduct is known exactly from the measurement record and is recorded in software; nothing is physically applied to the qubits, which is why surgery adds no extra gate error. Provided the operation runs at its fault-tolerant operating point, a merge costs no distance: the logical error per surgery scales with the same exponent as static memory.
where: — physical error rate per gate or measurement; — the circuit-level surface-code threshold; — code distance; — seam width; — number of repeated joint-measurement rounds; — an prefactor counting fault paths. Reading: choosing and pins , so surgery buys a logical gate at the price of rounds and no asymptotic loss of protection. Two merges and one ancilla assemble the fundamental entangling gate. An ancilla patch prepared in is joined to the control by a smooth () merge–split and to the target by a rough () merge–split, then read out; the gate-teleportation identity turns the three parity outcomes into a CNOT up to recorded Paulis.
where: — ancilla patch in (); — smooth merge–split measuring the control–ancilla parity; — rough merge–split measuring the ancilla–target parity; — destructive readout of the ancilla; — Pauli byproduct with exponents linear in the outcomes. Reading: every ingredient is a boundary edit or a single-patch readout, so a fault-tolerant CNOT needs nothing beyond the two-body parity checks the hardware already runs.
The goal is to show, operator by operator, that switching on the seam -checks projects the two-patch state onto a definite eigenspace of whose eigenvalue is the product of the measured seam syndromes, while leaving the conjugate information completely untouched — the defining property of a non-destructive joint measurement. We track exactly which operators enter and leave the stabilizer and logical groups, establish the telescoping identity that makes the product of local checks equal a global logical operator, and count the logical degrees of freedom before and after so that "one measurement removes one qubit" becomes explicit.
Step 1. Before the merge the two patches are independent: the logical group is generated by with and operators on different patches commuting, so the pair encodes two logical qubits. Why: this is the clean starting inventory against which every later change is measured — two qubits, four logical operators.
Step 2. Adjoin the seam -checks, . Each commutes with every original stabilizer of both patches, and — because it is -type — it commutes with and , but it anticommutes with and with individually, since a -check overlaps those -strings on an odd number of seam qubits. Measuring the is a projective measurement that fixes their random values . Why: the anticommutation with the individual is precisely what will demote them from logical operators — it is the seam checks eating one logical qubit.
Step 3. Telescope the product. Each is a -string bridging one qubit of patch 1's seam boundary to the adjacent qubit of patch 2's; multiplying all of them, every interior gap qubit appears in two neighbouring checks and cancels as , leaving . Each surviving boundary product is a boundary-parallel -string, deformable through bulk plaquettes to the logical , so . Why: this is the heart of the matter — a product of purely local, individually random checks equals a single global logical operator, so measuring the checks measures the logical.
Step 4. Read off the outcome and count the survivors. Since is a product of measured stabilizers, its eigenvalue is fixed: . The conjugate commutes with every (each -anomaly cancels in the pair) and survives as the merged patch's logical ; survives as its logical . One logical qubit remains, exactly as a non-destructive measurement demands. Why: preserving while fixing is the operational signature that this is a measurement of the parity and not a destruction of the qubits. *The three key checks: the interior seam qubits cancel by telescoping, leaving ; this product commutes with ; and the individual (not ) anticommute with the -type seam checks, so only the joint operators survive as logical operators of the merged patch.*
Go deeper · Derivation B · 2 minA merge and a split compose into a teleported CNOT
The goal is to show that a control–ancilla measurement, an ancilla–target measurement, and a destructive readout of an ancilla prepared in reproduce a logical CNOT from control to target, with all randomness absorbed into a Pauli byproduct that is tracked classically rather than physically applied. The strategy is to feed each joint measurement, supplied by a merge–split, into the standard measurement-based CNOT identity and follow the stabilizer generators through each projection, so that the surviving logical action is unambiguously .
Step 1. Prepare the ancilla. Initialize a fresh patch in , i.e. , by preparing all its data qubits in and running one round of -checks to project into the code space. Why: the stabilizer is the seed the two subsequent parity measurements will convert into control–target entanglement.
Step 2. First merge, control to ancilla. A smooth merge–split measures with outcome ; this entangles control and ancilla in the basis, replacing the independent by their fixed product and the surviving generator . Why: measuring is exactly the "copy the control's eigenvalue onto the ancilla" step of a teleported CNOT.
Step 3. Second merge, ancilla to target. A rough merge–split measures with outcome ; combined with the ancilla's seed, this couples the target's to the control through the ancilla. Why: the measurement is the conjugate half of the identity, propagating the control's action onto the target's amplitude.
Step 4. Disentangle and correct. A destructive readout with outcome removes the ancilla, and the three outcomes fix a Pauli byproduct with , linear in the measurement record. Tracking, not applying, this byproduct leaves precisely . Why: the byproduct is deterministic given the outcomes, so it costs only classical bookkeeping in the Pauli frame — the logical gate itself is exact. *The -then- measurement sequence plus ancilla readout is the gate-teleportation form of CNOT up to Paulis; the ancilla is required because two conjugate bases ( then ) must both be measured, which a single two-patch merge cannot supply.*
Go deeper · Derivation C · 2 minWhy the merge needs width d and about d rounds
The goal is to bound the smallest logical fault that can occur during a merge and to show it equals the static code distance only when the seam is at least qubits wide and the joint measurement is repeated for order rounds. The merge is a genuinely -dimensional code region, so a logical fault can be either a spacelike error string that crosses the seam or a timelike run of measurement errors that fakes the parity; we bound each separately and combine them into an effective distance.
Step 1. Spacelike failure. A chain of data errors that crosses the merge region can connect one patch's logical operator to the other's, producing an undetected logical error. The shortest such crossing chain has weight equal to the seam width , so demanding forbids any sub-distance spacelike crossing. Why: the seam is the one place the two logical operators come near each other, so it must be at least as hard to cross as the patch is to break.
Step 2. Timelike failure. The inferred parity is the product of the seam syndrome bits over time; a run of measurement errors can flip that product and hand the decoder a wrong outcome . Repeating the joint measurement times and resolving by matching over the -D syndrome graph requires to suppress this timelike error to the same order as the spacelike one. Why: a single round of a parity measurement is not fault-tolerant against measurement error; only repetition builds a timelike distance.
Step 3. Combine. The merge region's minimal logical fault is the smallest of the spacelike width, the timelike depth, and the patches' intrinsic distance: . Choosing and yields , so the merge costs rounds of syndrome extraction and leaves the logical-error scaling at — the same exponent as idle memory. Why: this is the operating point that makes surgery "free" in distance, a constant multiple of rounds per logical operation with no asymptotic penalty. *The shortest seam-crossing (or ) error string has weight , the matching-graph timelike separation is , and together these give .*
Limiting cases
Lattice surgery degenerates to, or reproduces, familiar primitives in special regimes of seam width, rounds, and prepared state:
| Case | Result | Meaning |
|---|---|---|
| Bare , one round | or on two physical qubits | reduces to an unencoded two-qubit parity measurement — no fault tolerance; the primitive surgery generalizes |
| Deterministic-outcome merge | already stabilized | if the joint operator is already (e.g. an ancilla in its eigenstate), the outcome is forced and the merge is a pure entangling step with only known corrections |
| Fault-tolerant point | and , identical to static memory — surgery adds no asymptotic distance penalty | |
| Multi-patch merge | one merge spanning patches measures an -body logical Pauli product in a single shot | |
| Braiding equivalence | merge–split defect braid | a CNOT by surgery and by braiding two defects are the same logical operation; surgery uses planar patches and roughly halves the qubits |
Worked examples
1 · Reading the telescoping identity on distance-3 patches (confidence builder)
Two distance-3 patches sit side by side, facing along their smooth boundaries with a single seam column of new -checks. Show concretely that the product of the seam checks is the joint logical , and say what the merge outcome is.
Step 1. Count the seam. A distance-3 patch has three rows, so the seam carries three new weight-four -checks , each bridging a qubit on patch 1's right smooth boundary to the neighbouring qubit on patch 2's left smooth boundary. Each is an ordinary -plaquette — nothing the hardware has not measured before.
Step 2. Multiply and cancel. Form . Every qubit that sits interior to the seam belongs to two vertically adjacent checks, so it appears twice and cancels as . What survives is one column of on patch 1's boundary and one column of on patch 2's boundary: .
Step 3. Recognize the logicals. Each surviving boundary column is a -string parallel to the seam, which slides through the bulk plaquettes to the standard logical of its patch. Hence , and the joint parity is fixed by the three measured bits: . The three seam checks multiply to the joint logical operator, so measuring them measures , with outcome the product — random, and recorded in the Pauli frame. The conjugate commutes with all three checks and survives untouched, confirming the merge is a non-destructive measurement.
2 · Costing a distance-11 lattice-surgery CNOT (fully worked, with numbers)
A planar architecture runs rotated surface-code patches at distance , with physical error rate and threshold . Estimate the qubits, the time, and the logical error of a CNOT built from two merges and one ancilla.
Step 1. Qubits per patch. A rotated distance- surface code uses data qubits and measurement qubits, so physical qubits per patch. At that is physical qubits per logical patch.
Step 2. Qubits for the gate. The CNOT needs the control patch, the target patch, and one ancilla patch, plus a merge corridor of comparable footprint. Three patches alone cost physical qubits, and allotting roughly one patch-area of routing space brings the working total near physical qubits for one logical CNOT.
Step 3. Time. Each merge must repeat its joint measurement for rounds of syndrome extraction to build timelike distance. The two merges (control–ancilla, then ancilla–target) run in sequence, so the gate takes on the order of syndrome-extraction cycles of logical time — the constant-times- overhead that keeps .
Step 4. Logical error. Each merge inherits the memory scaling with exponent , so per merge . Two merges plus readout give a CNOT failure of a few . At a lattice-surgery CNOT costs about physical qubits and cycles for a logical error near — and because braiding the same CNOT would thread defects through a thicker spacetime, surgery reaches this at roughly half the qubit count. Pushing to raises the exponent to and the per-merge error to for only more qubits — the steep return that makes distance the cheapest reliability knob.
Physics of the portrait
Lattice surgery is a young idea with a clear origin: it was named and worked out in a single 2012 paper that asked how to compute with surface-code patches without the qubit-hungry machinery of braided defects. The lead author of that paper is the physicist most identified with the technique.
Origins · 2 minDominic Horsman and how this was discovered
Lattice surgery was introduced in 2012 in Surface code quantum computing by lattice surgery (New J. Phys. 14, 123011) by Dominic Horsman — who published the work under the name Clare Horsman — together with Austin Fowler, Simon Devitt, and Rodney Van Meter. The paper solved a concrete architectural problem. By 2012 the surface code was understood to be the most hardware-friendly quantum error-correcting code, but the accepted way to compute with it was to punch holes (defects) in the lattice and braid them around one another, a construction that is elegant on paper yet costly in qubits and demands a thick, genuinely three-dimensional spacetime of operations. Horsman and colleagues realized that the same logic could be done in the plane by editing the code at its boundaries: bring two patches together, turn on a strip of ordinary parity checks, and the product of those checks is a joint logical operator, so the merge measures it. A merge followed by a split is a fault-tolerant joint measurement, and joint measurements are all one needs to teleport a CNOT — reducing every Clifford gate to gluing and ungluing tiles on a two-dimensional grid. The insight roughly halved the qubit overhead per logical operation and turned quantum compilation into a tiling-and-scheduling problem, which is why lattice surgery underlies essentially every serious planar surface-code architecture and resource estimate today. The picture was sharpened by Austin Fowler's parallel work on the practical surface code, and by Daniel Litinski's 2019 A Game of Surface Codes, which recast whole algorithms as streams of multi-patch Pauli-product measurements fed by magic-state factories. Horsman went on to develop diagrammatic (ZX-calculus) methods for reasoning about exactly these surface-code operations, tightening the link between the algebra of stabilizers and the geometry of patches that lattice surgery first exposed.
Going further
Texts. Nielsen & Chuang, Quantum Computation and Quantum Information (10th anniv. ed.), Ch. 10 (stabilizer and topological codes) · Preskill, Lecture Notes on Quantum Computation, Ch. 7 (topological quantum computation) · Kitaev, Fault-tolerant quantum computation by anyons, Ann. Phys. 303 (2003) · Horsman, Fowler, Devitt & Van Meter, Surface code quantum computing by lattice surgery, New J. Phys. 14, 123011 (2012) · Fowler, Mariantoni, Martinis & Cleland, Surface codes: towards practical large-scale quantum computation, Phys. Rev. A 86, 032324 (2012) · Litinski, A Game of Surface Codes, Quantum 3, 128 (2019) · Watrous, The Theory of Quantum Information (2018), stabilizer-code chapter. The telescoping identity , the split byproduct, and the CNOT construction are the central results of this article. Key consistency checks: the anticommutator follows from odd string crossing; the individual (not ) anticommute with the -type seam checks while and commute; the threshold and the scaling are standard circuit-level surface-code results; the rotated-code count physical qubits per distance- patch and the worked are confirmed in the worked example above; and .
Prerequisites. Stabilizer Formalism · CSS Codes · Code Distance and Logical Operators · Syndrome Measurement and Decoding · Pauli Group and Clifford Group. Leads to. Magic State Distillation · Fault-Tolerant Quantum Computation · Pauli-Based Computation.
Ask the tutor: Ask me to walk the telescoping seam identity on a patch of your chosen distance, or to cost a full CNOT or gate at your hardware's and .
Is a merge really a measurement, or does it just entangle the two patches?
It is a genuine projective measurement of the joint logical operator, not mere entanglement. Switching on the seam checks adds new independent stabilizers whose product equals (smooth) or (rough). Because a product of measured stabilizers has a determined eigenvalue, the joint parity is projected to a definite given by . The conjugate joint operator commutes with every seam check and is left untouched, which is precisely what distinguishes a non-destructive measurement of the parity from a generic entangling operation that would disturb both bases.
What is the difference between a smooth merge and a rough merge?
It is which boundary type you glue, and therefore which joint operator you measure. Smooth boundaries are where -strings terminate; merging two patches along smooth boundaries with -type seam checks measures . Rough boundaries are where -strings terminate; merging along rough boundaries with -type seam checks measures . The two are exact duals under the Hadamard exchange , and having both available — plus single-patch and readouts and a fresh ancilla — is exactly enough to synthesize the full Clifford group.
Why does a CNOT need an ancilla patch instead of a single direct merge?
Because a CNOT teleported from measurements requires two conjugate joint measurements — a and a — and a single two-patch merge can only supply one basis at a time. The ancilla, prepared in , is the intermediary that lets you first measure (control to ancilla) and then (ancilla to target), before being read out in to disentangle itself. The ancilla also solves a routing problem: control and target need never be adjacent, since the ancilla patch and its merge corridors carry the interaction across the chip.
What exactly is the Pauli frame, and why is nothing physically corrected?
The Pauli frame is a classical record of which Pauli operator would need to be applied to make the logical state "textbook," carried in software rather than enacted on the qubits. Every merge yields a random outcome , and every split yields a deterministic byproduct; both are Pauli operators. Rather than physically applying them — which would cost gate time and inject fresh error — you update the frame and reinterpret all future measurement outcomes accordingly. Because Cliffords map Paulis to Paulis, the frame can be pushed through the entire computation and resolved only at the final measurement, so surgery's randomness is free.
Does lattice surgery give a universal gate set by itself?
No — surgery alone yields only Clifford operations: CNOT from two merges, Hadamard by a patch rotation, and the phase gate from an ancilla-mediated sequence. By the Gottesman–Knill theorem, Clifford circuits are efficiently classically simulable, so they cannot be universal. Universality arrives through magic-state injection: a patch holding a distilled state is merged with a data patch by a merge, and a measurement-conditioned Clifford correction completes a gate. The magic-state distillation factories that feed these merges are the dominant resource cost of most fault-tolerant algorithms.
Why is lattice surgery preferred over braiding defects?
Both realize the same logical Clifford gates at the same code distance and threshold, so the choice is about overhead and geometry. Braiding moves logical defects around one another through a thicker, genuinely three-dimensional spacetime of operations, which is qubit-hungry and awkward to route. Surgery keeps everything in the plane: logical qubits are edge-to-edge patches, and a gate is a local boundary edit repeated for rounds. This typically halves the physical-qubit overhead per logical operation, reduces routing to two-dimensional tiling and scheduling, and integrates cleanly with magic-state injection — which is why planar architectures across superconducting, ion, and neutral-atom platforms adopt it.