Overview
A planar surface code patch stores one logical qubit using only nearest-neighbour interactions on a square grid. Transversal two-qubit gates between patches would need long-range couplings, and the older approach of moving holes around each other (braiding defects, Raussendorf and Harrington; Fowler and co-authors) uses a large sheet of code per qubit. Lattice surgery (Horsman, Fowler, Devitt and Van Meter) acts on separate patches instead: two patches are merged into one by measuring new checks across the gap between them, and split apart again. The net effect is a measurement of a product of logical Pauli operators, such as .
Measurements of logical Pauli products, preparations of simple states, and a supply of magic states are enough for universal quantum computation, and every Clifford gate can be pushed into the choice of later measurements. This makes lattice surgery the basis of most current surface-code architecture proposals and resource estimates: a computation becomes a schedule of patch merges, each lasting about rounds of syndrome measurement.
Intuition
A surface-code patch is a piece of fabric whose edges come in two kinds. Logical operators are strings that run from one edge to the opposite edge of the same kind. Stitch two patches together along edges of the same kind, and a string that used to cross patch 1 can now be slid across the seam into patch 2: the two strings have become the same logical operator, so their product has turned into a stabilizer of the merged patch. Stabilizers get measured, so the merge reads out that product without reading out either factor. Cutting the fabric again restores two logical qubits, now correlated through the measured product.
Why does this need rounds? A single round of the new seam checks could suffer a measurement error, and then the inferred product would be wrong. Repeating the measurement lets the decoder correct measurement errors the same way it corrects data errors, so one lattice-surgery step costs about as much time as protecting a qubit for a distance's worth of rounds.
Prerequisites
The rotated surface code, the stabilizer formalism, fault-tolerant gadgets, and gate teleportation with T states.
Mathematical Definitions
Consider two surface-code patches, each encoding one logical qubit, placed side by side so that a boundary of patch 1 faces a boundary of the same type of patch 2, with a strip of fresh data qubits (the seam) between them. Let and be the logical operators of the two patches whose strings run parallel to the facing boundaries.
- A merge prepares the seam qubits in a product state that is an eigenstate of the boundary checks being extended, and then measures, for or more rounds, the stabilizers of the single larger patch that covers both patches and the seam. The checks that straddle the seam are new; a subset of them has product equal to times stabilizers of the original patches, so the product of their (error-corrected) outcomes is the outcome of a measurement of . The merged patch encodes one logical qubit.
- A split stops measuring the seam checks, measures the seam qubits individually in the basis that restores the original boundaries, and resumes the stabilizers of the two separate patches. Its outcomes determine a Pauli correction, which is recorded in the Pauli frame rather than applied.
A merge followed by a split implements the logical measurement of and nothing else, up to that Pauli correction; this is stated and proved at the stabilizer level in theorem/lattice-surgery-measures-logical-pauli-products. Merging along a longer path or several patches at once measures products of more than two logical Pauli operators. The construction is due to Horsman, Fowler, Devitt and Van Meter; Vuillot and co-authors describe it as an instance of gauge fixing, and Litinski uses multi-patch merges as the basic operation of a full computing scheme. The repeated rounds are needed because a single faulty round would give a wrong product; each merge therefore takes about code cycles at distance .
A Pauli-based computation (PBC) on qubits, as defined by Bravyi, Smith and Smolin, proceeds as follows.
- Every qubit is initialised in a single-qubit magic state (a state Clifford-equivalent to the T state).
- For (at most steps), a non-destructive measurement of a Hermitian Pauli operator on the qubits is performed, with outcome . The choice of may depend on through polynomial-time classical processing.
- The output is a bit computed classically, in polynomial time, from the outcomes.
The authors show that the model loses no power if the measured operators are required to commute pairwise, and that a circuit on qubits with polynomially many Clifford+T gates, of them gates, can be simulated by a PBC on qubits with polynomial classical processing (their Theorem 2). In this model the qubit count equals the number of magic states consumed, and Clifford gates disappear into the classical choice of measured operators. Surface-code architectures in which every operation is a lattice-surgery Pauli product measurement are a practical relative of PBC that keeps the data qubits; see theorem/clifford-plus-t-circuits-as-pauli-rotations.
Theorems
Measure on , obtaining outcomes , and set . Then:
- has the distribution of the outcome of measuring on : with .
- For every logical operator of that commutes with all , the post-measurement state satisfies , exactly as after an ideal measurement of .
- Every other logical operator of that commutes with is mapped to a different representative, multiplied by a sign that is a known function of the outcomes: a Pauli frame update.
In a merge, and the are the checks of the merged patch that straddle the seam. The statement is the stabilizer-level content of the construction of Horsman and co-authors; the gauge-fixing view of Vuillot and co-authors extends the analysis to faulty measurements, where the merged checks must be repeated for about rounds so that the inferred product is reliable.
- Noiseless measurements. is an abelian group of Pauli operators on qubits, without , that includes the single-qubit stabilizers of the seam qubits' initial product state; the input satisfies for all .
- is a Hermitian Pauli operator that commutes with and is not in (a logical operator).
- are pairwise commuting Hermitian Pauli operators (the new checks), each commuting with , and for some subset of them, some and a known sign .
- Non-degeneracy: when the remaining generators of the group generated by the are measured one at a time after , each lies in plus or minus the current stabilizer group or anticommutes with one of its elements.
Proof · Proof that lattice surgery measures a logical Pauli product
Notation as in the theorem. Write for a Hermitian Pauli operator and .
Step 0: the order and the generating set do not matter. Because the commute, measuring them one after another (in any order) is the instrument whose operators are the joint spectral projectors . These projectors are the joint eigenprojectors of the abelian group generated by the , and they are the same for any generating set of ; the outcomes for one generating set are products of the outcomes for another. We may therefore measure first, with outcome , and then further generators that together with generate .
Step 1: measuring is measuring . By hypothesis with , and commutes with . Since ,
Hence with . The probabilities (traces) agree, which proves part 1, and the conditional state is stabilized by the group generated by and .
Step 2: the remaining checks. Suppose that before measuring the state is stabilized by an abelian group . By the non-degeneracy hypothesis there are two cases.
- . The outcome is fixed and : nothing changes.
- anticommutes with some . Let . Since
and , is unitary with
. Using ,so . Each outcome occurs with probability and the conditional state is , stabilized by and by the elements of that commute with .
Step 3: logical operators commuting with the checks. Let be a logical operator of that commutes with every , hence with every element of . Every element of every is a product of elements of , of and of elements of (up to sign), and commutes with all of these; commutes with because is such a product. So commutes with and in Step 2, hence with , and . By induction , which is part 2.
Step 4: the other logical operators. If a logical operator of commutes with but anticommutes with in Step 2, then anticommutes with and
using . So the expectation of after the step equals the expectation of before it: the information carried by is now carried by the operator , which differs from by the new stabilizer and the old stabilizer , with a sign fixed by the outcome . This is the Pauli frame update of part 3. The case analysis is exhaustive for the operator being tracked: start from a logical operator that commutes with , so that it commutes with ; the updated representative commutes with and with every element of that commutes with , so by induction the tracked representative always commutes with the current stabilizer group, in particular with . (A logical operator that anticommutes with loses its expectation at Step 1, exactly as under an ideal measurement of .)
The non-degeneracy hypothesis is what excludes a merge that accidentally measures a second logical operator: a generator that commuted with the whole current stabilizer group without belonging to it would act as an additional logical measurement. For surface-code merges the hypothesis is checked by the explicit form of the merged code (Vuillot and co-authors).
(a) Rotation form. There are Hermitian Pauli operators on qubits and a Clifford unitary such that
Followed by computational-basis measurements, the final can be absorbed by measuring the Pauli operators instead of .
(b) Applying one rotation with a T state. Let a data register be in and an extra qubit be in the T state. Measure (outcome ), then measure in the basis (outcome ). Each of the four outcome pairs has probability , and the data register is left in
up to a global phase. The corrections are a Clifford rotation and a Pauli operator, so (a) can absorb them into the later rotations by conjugation.
Part (a) is the reduction used by Litinski to express lattice-surgery computation as a sequence of Pauli product measurements; the same idea underlies the Pauli-based computation of Bravyi, Smith and Smolin.
- The circuit is on qubits, with Clifford unitaries and the gate on qubit ; identities hold up to a global phase.
- denotes for a Hermitian Pauli operator .
Proof · Proof of the π/8 Pauli rotation form and its measurement gadget
(a) Up to a global phase, , so . For any unitary and Hermitian Pauli , , because commutes with conjugation; if is Clifford then is again a Hermitian Pauli operator. Write and . Inserting around each gate,
with . The middle equality holds because consecutive factors telescope: and . For the remark on measurements: measuring on has the same statistics as measuring on .
(b) Decompose into the eigenspaces of , and note . The joint state is
where the first bracket has and the second . Each has squared norm , so with probability each. Projecting onto then gives, up to normalisation and global phase,
- : , which is for and for (since flips the sign of );
- : , which is for and for .
In each case the two outcomes of the measurement are equally likely, and the result is , as claimed. The case analysis was also confirmed by a state-vector computation for a random two-qubit input and .
Worked Examples
A distance-3 merge, check by check
Use the conventions of the rotated surface code: data qubits at , plaquette on qubits , -type when is even; -type two-qubit checks on the top and bottom rows, -type on the left and right columns; a row and a column. Put patch 1 on columns 0–2 and patch 2 on columns 4–6, rows 0–2, so their -type edges face each other across column 3. The strings (columns) run parallel to this seam, so the merge measures .
- Prepare the seam qubits in .
- Measure the checks of the rotated patch. Compared with the two separate patches (8 checks each), two -type edge checks are enlarged: patch 1's becomes plaquette and patch 2's becomes plaquette . Since the seam qubits start in , the enlarged checks inherit the old values. Four -type checks are new: plaquettes and , the top check and the bottom check . That is checks, as a 21-qubit patch encoding one qubit requires.
- Multiply the four new checks. Every seam qubit appears exactly twice and cancels,
leaving on the whole of column 2 and the whole of column 4:Individually the new checks give random outcomes (each anticommutes with the of a seam qubit, which was a stabilizer), but their product is the logical measurement, as in the theorem.
- Split by measuring the three seam qubits in the basis and returning to the two separate sets of checks; the seam outcomes fix a Pauli correction.
With one measurement ancilla per check the merged region uses physical qubits. Exchanging the roles of and (facing -type edges, seam in ) measures .
Cost of a CNOT and of a T gate
The lattice-surgery CNOT needs two sequential merges. At distance and a syndrome-round time of , each merge takes about , so the CNOT takes about and occupies three patches plus the space between them. A rotation consumes one magic state in one multi-patch measurement, about if the magic state is ready. A circuit whose T gates are applied strictly one after another therefore needs at least , about 42 minutes, however many Clifford gates it contains. This is why compilers for lattice-surgery machines target the number and the depth of non-Clifford rotations rather than the CNOT count.
Algorithms and Implementations
Input. Control and target in an arbitrary joint state ; an ancilla patch .
Procedure.
- Prepare in .
- Measure (merge and split with ); outcome .
- Measure (merge and split with ); outcome .
- Measure in the basis; outcome .
- Record the corrections if and if in the Pauli frame.
Output. after the corrections. Each of the eight outcome triples occurs with probability , independent of the input.
Why it works. Write . With in , the measurement with outcome leaves with : the ancilla now copies the control in the basis, up to a known flip. Measuring projects onto -type correlations, which, followed by the measurement of , teleports the parity of the ancilla onto the target: the target becomes with , and a phase appears exactly when . Removing and leaves . The correction rule above was also checked by direct state-vector computation over all eight outcome triples.
Cost. Steps 2 and 3 do not commute (they share with and ), so they are sequential: two merges of about code cycles each, plus single-patch preparation and measurement, which take no extra rounds in the accounting of Litinski. Measurement sequences of this kind underlie the lattice-surgery CNOT of Horsman and co-authors. The layout needs the ancilla patch adjacent to both the control and the target.
- Ideal logical preparations and logical Pauli product measurements (in a surface-code machine, merges and splits held for about rounds each).
Computing with Pauli product measurements
Litinski builds a complete scheme on two rules: a tile holds a patch, and any Pauli product measurement between patches that are connected through free tiles costs one time step of about code cycles, while single-patch preparations and measurements cost no time step. With the rotation form, a Clifford+T circuit becomes a sequence of rotations, each a multi-patch measurement against a magic state, and Clifford gates are removed entirely. The data qubits sit in blocks that trade area for speed: a compact block stores qubits in tiles but needs up to nine time steps per magic state, an intermediate block uses tiles and up to five time steps, and a fast block uses tiles and one time step. Measuring a Pauli operator with components requires access to both boundaries of a patch; twist defects provide this (Litinski and von Oppen), and Chamberland and Campbell give protocols that avoid twists in the bulk, together with temporally encoded lattice surgery that protects the measurement outcomes with a classical code across time, so that fewer rounds per measurement are needed.
Routing and layout
Patches that are far apart are connected through ancilla patches, so the layout must leave routing space, and parallel operations compete for it. The ZX calculus describes lattice-surgery operations compactly and can be used to rewrite and verify them (de Beaudrap and Horsman). Beverland, Kliuchnikov and Schoute prepare long-range Bell pairs along edge-disjoint paths of ancilla qubits in constant depth, so many long-range Clifford operations can run in parallel; finding the paths is an edge-disjoint-paths problem on the layout graph. Fowler and Gidney report that lattice surgery lowers the storage overhead by more than a factor of four, and distillation overhead by nearly a factor of five, compared with defect braiding, estimating that algorithms with T gates fit in about physical qubits at gate error near (preprint).
Limitations and Common Pitfalls
- A merge is a measurement, not a unitary. Its outcome is random; gates are built from sequences of measurements plus Pauli corrections tracked in software, and those corrections can change later measurement bases.
- The individual seam checks are random. Only the product of a specific subset is meaningful. Decoding must treat the merge as a code whose stabilizers changed, including the first round in which the new checks have no earlier value.
- "Clifford gates are free" is a statement about logical time. Commuting Cliffords past the rotations changes the Pauli operators to be measured, often into high-weight multi-patch products; it is free only if such products cost no more than simple ones, which depends on the layout and routing space.
- Time steps of cycles are an approximation. Litinski notes the correspondence between a time step and code cycles is not exact, and techniques such as temporal encoding change it.
- Classical latency counts. Pauli corrections and the choice of the next measurement basis after a magic-state measurement depend on decoded outcomes; if decoding is slow the schedule stalls (see decoder backlog).
State of the Art
As of 2026-11:
- Erhard and co-authors (published 2021) performed lattice surgery between two topologically encoded qubits on a ten-qubit trapped-ion processor, creating logical entanglement and teleporting a logical state.
- Lattice surgery has been formulated for colour codes (Landahl and Ryan-Anderson, preprint) and extended to general CSS and quantum LDPC codes, where it provides logical measurements for codes without a planar geometry (Cowtan and Burton; Cross and co-authors).
- The interpretation of merges and splits as gauge fixing (Vuillot and co-authors) is the standard framework for analysing their fault tolerance.