Lattice Surgery and Defect Braiding
A single surface-code patch is a superb quantum memory and an almost useless quantum computer: it stores a logical qubit in the homology of a two-dimensional lattice, protected from any local error, but it cannot by itself entangle that qubit with a neighbour. Scalable fault-tolerant computation therefore needs a way to couple logical qubits that respects the one hard constraint of real hardware — every operation must be a pattern of nearest-neighbour stabilizer measurements on a fixed planar grid. Lattice surgery and defect braiding are the two canonical answers, both purely topological: nothing quantum ever physically crosses the chip, only the classical description of which stabilizers are switched on. Lattice surgery, introduced by Horsman, Fowler, Devitt and Van Meter in 2012, treats a logical gate as a controlled edit of the boundary between patches. Two patches separated by a gap are merged by turning on the gap stabilizers; individually those new stabilizers fail to commute with the old logical operators, and measuring them collectively realizes a destructive joint Pauli measurement or . A split reverses the merge at the cost of a byproduct operator fixed by the parity of the gap outcomes. From merge and split alone one builds logical CNOT, state injection, and the whole Clifford group. Defect braiding, the older lineage of Kitaev, Bravyi–Kitaev, Raussendorf and Fowler, instead encodes a logical qubit in a pair of holes and enacts a CNOT by dragging one hole in a full loop around another — the computational embodiment of the mutual statistics of the toric code. Both methods are strictly Clifford; universality is imported as magic states. This article builds both machines, proves they realize the gates they claim, and shows why the same outcome that makes them work must be tracked in a classical Pauli frame.
- Lattice surgery couples surface-code patches by merging and splitting them along their boundaries, realizing joint logical Pauli measurements and with only nearest-neighbour stabilizer measurements.
- A rough merge measures (new star stabilizers), a smooth merge (new plaquettes); the random outcome is the logical result and must be tracked in the Pauli frame.
- Defect braiding encodes a logical qubit in a pair of holes and enacts a CNOT by dragging one defect in a full loop around another — the homology that protects the code now performs the gate.
- Both are Clifford-only: they permute Paulis, so by Gottesman–Knill they generate just the Clifford group; a non-Clifford is injected as a distilled magic state and teleported in by surgery.
- Each merge or split runs rounds so its own errors inherit the code's exponential suppression below threshold .
- Surgery displaced braiding because a CNOT costs one ancilla patch, not a large braiding region; braiding survives as the bridge to non-Abelian computation, where braids alone become universal.
- Key idea: logical gates on surface codes are performed topologically — lattice surgery realizes joint Pauli measurements by merging and splitting patch boundaries, and defect braiding realizes CNOT by moving one defect's logical loop around another — both relying only on local stabilizer measurements and classical tracking of measurement-dependent byproduct operators.
Logical gates on surface codes are implemented topologically: lattice surgery realizes joint Pauli measurements by merging and splitting patch boundaries, and defect braiding realizes CNOT by moving one defect's logical loop around another — both relying only on local stabilizer measurements and classical tracking of measurement-dependent byproduct operators.
Where this lives today
Lattice surgery is now the compilation target of essentially every serious fault-tolerant architecture. Litinski's "Game of Surface Codes" represents a whole computation as a schedule of joint Pauli measurements on a 2D floorplan of patches, reducing gate scheduling to a tiling problem and backing the estimates that quote millions of physical qubits for factoring or chemistry — estimates dominated not by the free Cliffords but by the magic-state factories feeding in gates, so surgery and distillation are engineered as one pipeline. The hardware has caught up. In 2024 Google demonstrated below-threshold surface-code memory, logical error falling as distance grew — the exponential suppression this article assumes, made fact. Neutral-atom processors (QuEra) have run surgery-style logical operations on dozens of logical qubits via mid-circuit atom rearrangement, and trapped ions (Quantinuum) real-time decoding. The defect picture lives on as the language of twist defects — dislocations behaving as Ising-like Majorana anyons — braided for extra Cliffords, the bridge to non-Abelian computation where braiding alone is universal.
The physical picture
Think of a surface-code patch as a rectangle of cloth whose two logical threads run between opposite edges: stitches one pair of boundaries, the other, and because the threads cross once they anticommute — that single crossing is the whole logical algebra. Lattice surgery sews two rectangles along a shared edge; the seam is a fresh row of stabilizers, and it can be sewn consistently only if it measures the combined thread — the joint Pauli measurement. Unpicking the seam (the split) returns two rectangles, but the stitching injected a random sign you must remember. Every step is local. A merge just switches on a column of stabilizers and measures them for rounds (the code distance), so faults during the operation are matched and corrected exactly as in the static memory. No quantum amplitude is transported; only the boundary — a classical record of which stabilizers are active — moves. The first figure shows the merge and the joint operator it measures, on real distance-3 patches.
Defects tell the dual story. Punch two holes and switch off the stabilizers inside them; a logical qubit now lives on the pair, with a thread joining them and a loop encircling one. Dragging one hole (by measuring stabilizers along its path) in a full loop around a hole of the opposite type wraps one logical loop irreversibly through the other, forcing the two threads to be re-expressed in terms of each other — precisely the algebra of a CNOT. Microscopically it is the toric code's charge carried once around its flux, collecting the tell-tale . The second figure shows the braid and the gate it produces.
Because the surface code is CSS and both operations merely permute Paulis, everything they build lies inside the Clifford group. The expensive resource is the non-Clifford : it cannot be woven or sewn, but must arrive as a distilled magic state teleported in by a surgery measurement — the seam to magic-state distillation.
The core equations
The stage is the surface code: qubits on the edges of a lattice, one stabilizer per vertex and one per face. Every construction below edits this stabilizer group, and the two check types commute because a vertex and a face share an even number of edges.
where: — vertex (star) stabilizer, a product of on the edges meeting vertex ; — plaquette (face) stabilizer, a product of on the edges bounding face ; — Paulis on the qubit on edge . Reading: the code space is the joint eigenspace of every check, and any overlap on or edges. Logical operators are what the stabilizers cannot detect: non-contractible chains that commute with every check but not with each other. They anticommute because one runs on the lattice, the other on its dual, and the two chains cross an odd number of times.
where: — a non-contractible primal path (between smooth boundaries, or wrapping the torus); — a non-contractible dual path crossing an odd number of times; — the anticommutator. Reading: a single crossing is one shared qubit on which anticommute, so — one logical qubit per handle. A rough merge turns on a column of star operators in the gap and measures them; their seam-product equals the joint logical , so the merge is a projective measurement of that observable with a random outcome.
where: — projector onto the eigenspace of ; — the random outcome, the parity of the new gap star stabilizers; — logical of patch . Reading: the merge is not unitary — it collapses the patches onto a definite joint -parity and hands you a classical bit . The complementary merge runs along smooth (-type) boundaries, where the gap operators are plaquettes and the measured observable is ; the boundary flavour facing the gap picks the measured Pauli.
where: — logical of patch ; — parity of the new gap plaquette stabilizers . Reading: and with single-patch Cliffords generate the full Clifford group — the joint measurement is the entangling ingredient. Splitting restores two independent patches, but re-imposing the removed stabilizers does not commute with the random gap outcomes, so a logical byproduct appears — a parity of the recorded outcomes, corrected in software.
where: — parity of the relevant gap-stabilizer outcomes; — the conditional logical- byproduct applied classically (tracked, not physically). Reading: without the split is a random logical flip; with it is deterministic — the art is the bookkeeping. Defect braiding gives the same Clifford power geometrically: dragging a primal defect once around a dual defect maps the logicals by the Heisenberg action of a CNOT, primal the control, dual the target.
where: — primal (-cut) and dual (-cut) defect qubits, control and target; — the unitary of moving 's loop fully around . Reading: are invariant, so the four maps are exactly . The braid works for one microscopic reason: carrying a toric-code charge once around a flux multiplies the state by , and this monodromy, lifted to logical loops, entangles the defect qubits.
where: — electric charge, a violated star ; — magnetic flux, a violated plaquette . Reading: a full braid is topological — its value depends only on whether the loop encircles the other defect, not on the path's shape or speed. Finally, universality: neither surgery nor Abelian braiding can make a , so it is imported as a distilled magic state and teleported into a data patch by a surgery measurement with a Clifford correction.
where: — the distilled magic state carrying the phase ; — the joint surgery measurement teleporting the gate. Reading: this is the doorway through which the cost of universality — the magic-state factories — enters the floorplan.
The goal is to prove the central claim of lattice surgery — that switching on a column of star stabilizers in the gap between two rough-boundary patches realizes a projective measurement of the joint logical and nothing else logical — by tracking which operators enter and leave the stabilizer group as each new check destroys the individual logicals while sparing their product.
Step 1. Turn on and measure the gap star stabilizers , each a product of on the edges around a vertex bridging the two patches. Their seam-product telescopes — interior edges shared by adjacent stars cancel — leaving the boundary -chains, so up to pre-existing stabilizers. Why: measuring all the gap stars is equivalent to measuring the joint logical .
Step 2. Each gap overlaps (and ) on a single edge, so it anticommutes with each individually. Once the join the stabilizer group, are no longer separately logical — only their product , crossing each on two edges, commutes and survives. Why: the merge fuses the two -logicals into one, so the patch pair is now a single logical qubit — the space collapse a joint measurement must cause.
Step 3. Each returns a random ; the joint eigenvalue is the product , and on the code space and are identified. Why: the logical bit is the global parity, not any single check — which is why it is fault-tolerant only after rounds. *Together, the three steps confirm: the telescoping product gives ; each gap anticommutes with individually but commutes with ; and the merged patch carries exactly one logical qubit with .*
Go deeper · Derivation B · 1 minLogical CNOT from two lattice-surgery measurements
The goal is to assemble a fault-tolerant logical CNOT between a control patch and a target patch from nothing but joint Pauli measurements and single-qubit readout on one ancilla patch, and to show the random outcomes assemble into a deterministic CNOT once their Pauli-frame corrections are applied. We prepare an ancilla in , do with the control then with the target, read the ancilla out, and check the surviving map.
Step 1. Prepare the ancilla in , the eigenstate of ; the initial state is . Why: a fresh ancilla in a stabilizer eigenstate is the reservoir into which the joint measurements spread correlations without disturbing the data.
Step 2. Merge control and ancilla: projects onto a definite parity of with outcome , , entangling control and ancilla in the basis. Why: this is the first of two non-commuting joint measurements — the only way a measurement sequence builds an entangling gate.
Step 3. Merge ancilla and target: projects onto a definite parity of with outcome , , coupling ancilla and target in the basis. Why: a -type then an -type correlation on the ancilla is the skeleton of one-bit gate teleportation.
Step 4. Measure the ancilla in , with outcome , which removes and leaves a CNOT up to byproducts. Absorb the outcomes as a Pauli-frame correction — apply on the target and on the control, tracked classically. Why: anticommutes with the stabilizer just created, so it disentangles the ancilla while revealing nothing about the data — measuring instead would combine with to read out and collapse the target; the byproducts are then deterministic functions of measured bits, so a classical frame update makes the net channel exactly . *Propagating the three projectors and frame corrections gives , , with fixed — precisely the Heisenberg action of .*
Go deeper · Derivation C · 1 minHow braiding one defect around another realizes a CNOT
The goal is to show that dragging a primal defect once around a dual defect performs the identical logical operation as the surgery CNOT above, by tracking how the four logical loops deform under the braid, and to tie this to the mutual statistics of the toric code so the gate's fault tolerance is manifestly topological — identifying each defect's logicals, transporting the primal loop through a full circuit, and reading off the induced map.
Step 1. Fix the logicals: the primal () pair carries (a chain joining its holes) and (a loop around one hole), the dual () pair carries on the dual lattice. Dragging a defect by measuring stabilizers along its path transports its loop rigidly. Why: the qubit lives in the loops' homology, so moving a defect is acting with its logicals — the gate uses the same measurements as error correction.
Step 2. Braid once around . The encircling loop sweeps a tube that, after the full circuit, also links ; homologically the swept loop is times a loop around , so . Why: the loop cannot unlink from without crossing it, so the braid permanently multiplies by — the control-to-target coupling.
Step 3. By the crossing algebra, the conjugate picks up : , while stay invariant (their loops are unlinked). These four maps are exactly , and underneath sits the single passage phase . Why: the same monodromy that gives the toric code its topological order makes the braid an entangling gate, not a relabelling. *The induced map , , fixed, is the Heisenberg action of CNOT; it descends directly from the mutual statistics .*
Limiting cases
The reach and cost of these primitives are set by the code distance, the boundary type, and — most sharply — the Clifford versus non-Clifford divide no amount of surgery or Abelian braiding can bridge.
| Case | Result | Meaning |
|---|---|---|
| Large distance | Logical error per operation falls exponentially in below ; each merge or split runs rounds to build the space–time syndrome history that inherits this protection. | |
| Clifford-only ceiling | Surgery and Abelian braiding generate only the Clifford group; universality needs injected / magic states — a theorem, not an engineering gap. | |
| Space cost of a CNOT | surgery ancilla patch; braiding a full loop region | Surgery couples two patches through one intermediate patch; braiding needs room for one defect to orbit another, costing more qubits and time — the reason surgery won. |
| Abelian vs non-Abelian | (Abelian); (non-Abelian) | Toric-code braiding yields only Abelian phases (Cliffords); braiding-alone universality needs non-Abelian anyons (Ising, Fibonacci). |
Worked examples
1 · Code distance and qubit budget for a fault-tolerant surgery CNOT (fully worked)
A superconducting processor has physical error rate and threshold . Each logical CNOT must fail with probability at most . Using rotated planar patches (qubit count ) and a syndrome round, find the code distance , the physical qubits per patch, and the time of one surgery CNOT.
Step 1. Set the suppression. Below threshold with and . Requiring gives , so the smallest odd distance is (, giving , under budget).
Step 2. Qubits per patch. A rotated planar code of distance uses physical qubits: per logical patch. A surgery CNOT occupies control, target, and one ancilla bus patch, so physical qubits are live during the gate.
Step 3. Wall-clock time. Each merge or split runs rounds; a CNOT is a short merge–split sequence, so rounds end to end. At per round, rounds is per logical CNOT. Result: d = 31, about 1900 physical qubits per patch (≈ 5.8 thousand for the CNOT), ≈ 62 μs per gate — the arithmetic behind million-qubit surface-code resource estimates.
2 · Braiding a CNOT turns a product state into a Bell pair
Take defect qubits (control) in and (target) in . Braid once around and identify the output state, using only the Heisenberg map of equation (6).
Step 1. The input is the unique state stabilized by (the eigenstates of and ).
Step 2. Conjugate each stabilizer by the braid: from equation (6), and , so the output is stabilized by — exactly the stabilizers of a Bell pair.
Step 3. The joint eigenstate of and is , so a single braid entangled two unentangled qubits. Result: braiding e around m maps , the fingerprint of a CNOT on — entanglement created with no two-qubit gate touching a physical qubit, only a defect walked in a circle.
Physics of the portrait
Lattice surgery and defect braiding are two dialects of one language — the topological stabilizer code — and that language has a principal author. Before these gates could exist, someone had to see that a quantum memory could be built from the homology of a lattice.
Origins · 1 minAlexei Kitaev and how this was discovered
Alexei Kitaev is a Russian–American theoretical physicist whose 1997 preprint "Fault-tolerant quantum computation by anyons" reframed the whole problem of protecting quantum information: rather than actively correcting errors on fragile qubits, encode the information in the global, topological degrees of freedom of a two-dimensional medium that local noise cannot reach. His toric code — qubits on the edges of a lattice, a stabilizer for every vertex and face — is the ancestor of every construction here; its and excitations are the charges and fluxes whose mutual statistics are the defect-braiding CNOT. With Sergey Bravyi in 1998 he gave such codes boundaries, the rough and smooth edges that lattice surgery later learned to sew. Kitaev's reach runs far beyond codes — the honeycomb model, Majorana zero modes, the Sachdev–Ye–Kitaev model — but the surface-code lineage is where his ideas became hardware. The techniques here were then made practical by others: Raussendorf, Harrington and Goyal turned defect braiding into a concrete scheme, Fowler and collaborators into a blueprint, and Horsman, Fowler, Devitt and Van Meter invented lattice surgery in 2012 as the leaner successor. All of it is downstream of Kitaev's single move — that topology, not vigilance, is the natural home of a protected qubit.
Going further
Texts and papers. 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) · Bravyi & Kitaev, quant-ph/9811052 (1998) · Kitaev, "Fault-tolerant quantum computation by anyons," Ann. Phys. 303, 2 (2003) · Litinski, "A game of surface codes," Quantum 3, 128 (2019) · Raussendorf, Harrington & Goyal, New J. Phys. 9, 199 (2007) · Preskill, Lecture Notes on Quantum Computation, Ch. 9 · Nielsen & Chuang, Ch. 10. The threshold and scaling are standard results, and the rotated-planar qubit count is exact. Key checkpoints: and follow from shared-edge counts; the telescoping product gives with gap stars anticommuting with ; the surgery-CNOT map is , ; the braiding map yields the Bell-pair output of Worked Example 2; and the worked arithmetic gives , , .
Prerequisites. Toric Code and Topological Order · Anyons and Fractional Statistics · Topological Quantum Computation · Magic State Distillation. Leads to. Magic State Distillation · Non-Abelian Braiding and Fusion Rules · Measurement-Based Quantum Computation · Fibonacci and Ising Anyons.
Ask the tutor: Want to walk the surgery CNOT stabilizer-by-stabilizer, or see how a twist defect braids to a Hadamard? Ask and we will track every Pauli and outcome through the frame.
Is a merge the same as applying a two-qubit gate between the patches?
No, and the difference is the whole point. A two-qubit gate is a deterministic unitary; a merge is a projective measurement of a joint logical operator, with a random outcome that collapses the two qubits' joint parity rather than rotating them. The sequence behaves like a gate only because the outcomes are recorded and their byproducts corrected in the classical Pauli frame; ignore the outcome and you flip logical results at random. Surgery is measurement-based computation in code-patch clothing: measure the right joint observables in order, then fix up the frame.
Why does the boundary type decide whether a merge measures XX or ZZ?
Because the boundary sets which stabilizers you may turn on in the gap. A rough (X-type) boundary is where stars terminate, so bridging two rough boundaries switches on new stars whose seam-product is — a joint measurement. A smooth (Z-type) boundary terminates plaquettes, so two smooth boundaries give — a joint measurement. The logical running into the merged boundary is measured jointly; the conjugate is fused. Choosing boundaries is choosing your measurement basis.
What exactly is the byproduct operator, and why is it never physically applied?
When you split a merged patch, re-imposing the removed stabilizers does not commute with the random gap outcomes recorded during the merge, so the split leaves a logical Pauli — the byproduct — whose type is fixed but whose presence ( or ) is the parity of those outcomes. You do not apply it physically, since a real logical Pauli costs time and risks error; instead you update the Pauli frame, a classical record of pending corrections, and read every future outcome through it. That is how measurement randomness is tamed.
Why has lattice surgery largely replaced defect braiding?
Cost. A braided CNOT needs a code region big enough for one defect to loop fully around another, plus the time to walk it there and back — many qubits idle for many rounds. A surgery CNOT needs only one ancilla patch and a short merge–split sequence. For the same distance, surgery uses fewer qubits and less time per gate and maps cleanly onto a fixed patch tiling a compiler can schedule. Braiding is not wrong — it exposes the gate's topological origin beautifully — but on a scarce qubit budget the leaner primitive wins, which is why modern resource estimates are written in surgery.
If both are Clifford-only, where does the quantum advantage come from?
From magic states injected through surgery. Clifford circuits on stabilizer inputs are efficiently simulable classically (Gottesman–Knill), so surgery and Abelian braiding alone give no speed-up. The non-Clifford ingredient is the gate, which enters as a distilled prepared in its own factory and teleported in by a joint surgery measurement plus an outcome-conditioned Clifford correction. The Cliffords are cheap and protected; the magic states are expensive and dominate the qubit budget. Lattice surgery is the delivery mechanism connecting the cheap protected part to the costly universal part.
Is defect braiding here the same thing as non-Abelian anyon braiding?
No — they share a picture but differ decisively. The surface code's defects are Abelian: braiding an around an multiplies the state by a phase and, lifted to logical loops, gives a Clifford CNOT — but braiding never leaves the Clifford group. Genuine non-Abelian anyons (Ising, Fibonacci) carry a degenerate fusion space where braiding is a non-commuting unitary, and Fibonacci braids are dense in , universal alone. Twist defects sit between: Ising-like Majorana anyons that braid to more Cliffords but still need magic states. The braiding here is the Abelian, Clifford-only cousin.