Skip to main content
KetQat

Appearance

Topic · advanced

Lattice Surgery

How logical operations are performed on planar surface-code patches by merging and splitting them. Covers logical Pauli product measurements, the lattice-surgery CNOT, space-time cost, Pauli-based computation and the reduction of Clifford+T circuits to Pauli measurements, and routing.

ExpositionMachine-checkedUpdated 2026-12-01 · last verified 2026-12-01

AI-assisted text, machine-checked, not yet reviewed by a person. Citations resolve and an automated pass compared the statements with the cited sources. That is not peer review; check the sources for anything you depend on.

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 Zˉ1Zˉ2\bar{Z}_1 \bar{Z}_2.

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 dd 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 dd 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

DefinitionLattice surgery (merge and split)Established definition

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 Pˉ1\bar{P}_1 and Pˉ2\bar{P}_2 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 dd 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 Pˉ1Pˉ2\bar{P}_1 \bar{P}_2 times stabilizers of the original patches, so the product of their (error-corrected) outcomes is the outcome of a measurement of Pˉ1Pˉ2\bar{P}_1 \bar{P}_2. 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 Pˉ1Pˉ2\bar{P}_1 \bar{P}_2 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 dd code cycles at distance dd.

DefinitionPauli-based computationEstablished definition

A Pauli-based computation (PBC) on nn qubits, as defined by Bravyi, Smith and Smolin, proceeds as follows.

  1. Every qubit is initialised in a single-qubit magic state (a state Clifford-equivalent to the T state).
  2. For j=1,2,…j = 1, 2, \dots (at most nn steps), a non-destructive measurement of a Hermitian Pauli operator PjP_j on the nn qubits is performed, with outcome σj=±1\sigma_j = \pm 1. The choice of PjP_j may depend on σ1,…,σj−1\sigma_1, \dots, \sigma_{j-1} through polynomial-time classical processing.
  3. 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 nn qubits with polynomially many Clifford+T gates, mm of them TT gates, can be simulated by a PBC on mm 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

TheoremLattice surgery measures a logical Pauli productEstablished result

Measure M1,…,MmM_1, \dots, M_m on ρ\rho, obtaining outcomes μ1,…,μm∈{±1}\mu_1, \dots, \mu_m \in \{\pm 1\}, and set λ=ϵ μj1⋯μjr\lambda = \epsilon\, \mu_{j_1} \cdots \mu_{j_r}. Then:

  1. λ\lambda has the distribution of the outcome of measuring LL on ρ\rho: Pr⁡[λ]=Tr⁡(ΠλLρ)\Pr[\lambda] = \tr(\Pi^{L}_{\lambda} \rho) with ΠλL=(I+λL)/2\Pi^{L}_{\lambda} = (I + \lambda L)/2.
  2. For every logical operator QQ of S0S_0 that commutes with all MjM_j, the post-measurement state ρ′\rho' satisfies Tr⁡(Qρ′)=Tr⁡(Q ΠλLρ ΠλL)/Pr⁡[λ]\tr(Q \rho') = \tr(Q\, \Pi^{L}_{\lambda} \rho\, \Pi^{L}_{\lambda}) / \Pr[\lambda], exactly as after an ideal measurement of LL.
  3. Every other logical operator of S0S_0 that commutes with LL 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, L=Pˉ1Pˉ2L = \bar{P}_1 \bar{P}_2 and the MjM_j 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 dd rounds so that the inferred product is reliable.

Holds when
  • Noiseless measurements. S0S_0 is an abelian group of Pauli operators on nn qubits, without −I-I, that includes the single-qubit stabilizers of the seam qubits' initial product state; the input ρ\rho satisfies sρ=ρs \rho = \rho for all s∈S0s \in S_0.
  • LL is a Hermitian Pauli operator that commutes with S0S_0 and is not in ±S0\pm S_0 (a logical operator).
  • M1,…,MmM_1, \dots, M_m are pairwise commuting Hermitian Pauli operators (the new checks), each commuting with LL, and L=ϵ Mj1⋯Mjr sL = \epsilon\, M_{j_1} \cdots M_{j_r}\, s for some subset of them, some s∈S0s \in S_0 and a known sign ϵ=±1\epsilon = \pm 1.
  • Non-degeneracy: when the remaining generators of the group generated by the MjM_j are measured one at a time after P0=Mj1⋯MjrP_0 = M_{j_1} \cdots M_{j_r}, 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 ΠaA=(I+aA)/2\Pi^{A}_{a} = (I + aA)/2 for a Hermitian Pauli operator AA and a=±1a = \pm 1.

Step 0: the order and the generating set do not matter. Because the MjM_j commute, measuring them one after another (in any order) is the instrument whose operators are the joint spectral projectors ∏jΠμjMj\prod_j \Pi^{M_j}_{\mu_j}. These projectors are the joint eigenprojectors of the abelian group M\mathcal{M} generated by the MjM_j, and they are the same for any generating set of M\mathcal{M}; the outcomes for one generating set are products of the outcomes for another. We may therefore measure P0=Mj1⋯MjrP_0 = M_{j_1} \cdots M_{j_r} first, with outcome μ0=μj1⋯μjr\mu_0 = \mu_{j_1} \cdots \mu_{j_r}, and then further generators Q2,…,QkQ_2, \dots, Q_k that together with P0P_0 generate M\mathcal{M}.

Step 1: measuring P0P_0 is measuring LL. By hypothesis P0=ϵLsP_0 = \epsilon L s with s∈S0s \in S_0, and ss commutes with LL. Since sρ=ρ=ρss\rho = \rho = \rho s,

P0ρ=ϵLsρ=ϵLρ,ρP0=ϵρsL=ϵρL.P_0 \rho = \epsilon L s \rho = \epsilon L \rho, \qquad \rho P_0 = \epsilon \rho s L = \epsilon \rho L .

Hence Πμ0P0ρ Πμ0P0=ΠλLρ ΠλL\Pi^{P_0}_{\mu_0} \rho\, \Pi^{P_0}_{\mu_0} = \Pi^{L}_{\lambda} \rho\, \Pi^{L}_{\lambda} with λ=ϵμ0\lambda = \epsilon \mu_0. The probabilities (traces) agree, which proves part 1, and the conditional state ρ1=ΠλLρ ΠλL/Pr⁡[λ]\rho_1 = \Pi^{L}_{\lambda} \rho\, \Pi^{L}_{\lambda} / \Pr[\lambda] is stabilized by the group G1G_1 generated by S0S_0 and λL\lambda L.

Step 2: the remaining checks. Suppose that before measuring Q=QiQ = Q_i the state ρi−1\rho_{i-1} is stabilized by an abelian group Gi−1G_{i-1}. By the non-degeneracy hypothesis there are two cases.

  • Q∈±Gi−1Q \in \pm G_{i-1}. The outcome is fixed and ΠqQρi−1ΠqQ=ρi−1\Pi^{Q}_{q} \rho_{i-1} \Pi^{Q}_{q} = \rho_{i-1}: nothing changes.
  • QQ anticommutes with some g∈Gi−1g \in G_{i-1}. Let Vq=(I+q Qg)/2V_q = (I + q\, Q g)/\sqrt{2}. Since (Qg)†=gQ=−Qg(Qg)\dagg = gQ = -Qg and (Qg)2=−I(Qg)^2 = -I, VqV_q is unitary with Vq†=(I−q Qg)/2V_q\dagg = (I - q\, Qg)/\sqrt{2}. Using gρi−1=ρi−1=ρi−1gg \rho_{i-1} = \rho_{i-1} = \rho_{i-1} g,
    (I+qQ)ρi−1=(I+q Qg)ρi−1,ρi−1(I+qQ)=ρi−1(I+q gQ)=ρi−1(I−q Qg),(I + qQ)\rho_{i-1} = (I + q\,Qg)\rho_{i-1}, \qquad \rho_{i-1}(I + qQ) = \rho_{i-1}(I + q\,gQ) = \rho_{i-1}(I - q\,Qg) ,
    so ΠqQρi−1ΠqQ=12Vqρi−1Vq†\Pi^{Q}_{q} \rho_{i-1} \Pi^{Q}_{q} = \tfrac{1}{2} V_q \rho_{i-1} V_q\dagg. Each outcome occurs with probability 1/21/2 and the conditional state is Vqρi−1Vq†V_q \rho_{i-1} V_q\dagg, stabilized by qQqQ and by the elements of Gi−1G_{i-1} that commute with QQ.

Step 3: logical operators commuting with the checks. Let Q′Q' be a logical operator of S0S_0 that commutes with every MjM_j, hence with every element of M\mathcal{M}. Every element of every GiG_i is a product of elements of S0S_0, of ±L\pm L and of elements of M\mathcal{M} (up to sign), and Q′Q' commutes with all of these; Q′Q' commutes with LL because L=ϵP0sL = \epsilon P_0 s is such a product. So Q′Q' commutes with QQ and gg in Step 2, hence with VqV_q, and Tr⁡(Q′Vqρi−1Vq†)=Tr⁡(Q′ρi−1)\tr(Q' V_q \rho_{i-1} V_q\dagg) = \tr(Q' \rho_{i-1}). By induction Tr⁡(Q′ρ′)=Tr⁡(Q′ρ1)\tr(Q' \rho') = \tr(Q' \rho_1), which is part 2.

Step 4: the other logical operators. If a logical operator Q′Q' of S0S_0 commutes with gg but anticommutes with QQ in Step 2, then Q′Q' anticommutes with QgQg and

Vq†Q′Vq=12(I−q Qg) Q′ (I+q Qg)=12 Q′(I+q Qg)2=q Q′Qg,V_q\dagg Q' V_q = \tfrac{1}{2} (I - q\,Qg)\, Q'\, (I + q\,Qg) = \tfrac{1}{2}\, Q' (I + q\,Qg)^2 = q\, Q' Q g ,

using (I+qQg)2=2q Qg(I + qQg)^2 = 2q\,Qg. So the expectation of Q′Q' after the step equals the expectation of q Q′Qgq\, Q' Q g before it: the information carried by Q′Q' is now carried by the operator q Q′Qgq\, Q' Q g, which differs from Q′Q' by the new stabilizer qQqQ and the old stabilizer gg, with a sign fixed by the outcome qq. This is the Pauli frame update of part 3. The case analysis is exhaustive for the operator being tracked: start from a logical operator Q′Q' that commutes with LL, so that it commutes with G1G_1; the updated representative q Q′Qgq\, Q' Q g commutes with qQqQ and with every element of Gi−1G_{i-1} that commutes with QQ, so by induction the tracked representative always commutes with the current stabilizer group, in particular with gg. (A logical operator that anticommutes with LL loses its expectation at Step 1, exactly as under an ideal measurement of LL.) □\square

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).

TheoremClifford+T circuits as sequences of π/8 Pauli rotationsEstablished result

(a) Rotation form. There are Hermitian Pauli operators P1,…,PtP_1, \dots, P_t on nn qubits and a Clifford unitary CC such that

U  =  C (Pt)π/8⋯(P2)π/8 (P1)π/8,Pj=Dj†ZqjDj,  Dj=Cj−1⋯C0.U \;=\; C\, (P_t)_{\pi/8} \cdots (P_2)_{\pi/8}\, (P_1)_{\pi/8} , \qquad P_j = D_j\dagg Z_{q_j} D_j ,\ \ D_j = C_{j-1} \cdots C_0 .

Followed by computational-basis measurements, the final CC can be absorbed by measuring the Pauli operators C†ZkCC\dagg Z_k C instead of ZkZ_k.

(b) Applying one rotation with a T state. Let a data register be in ∣ψ⟩\ket{\psi} and an extra qubit mm be in the T state. Measure P⊗ZmP \otimes Z_m (outcome s1s_1), then measure mm in the XX basis (outcome s2s_2). Each of the four outcome pairs has probability 1/41/4, and the data register is left in

P[s2=−1]  (P−π/4)[s1=−1]  Pπ/8∣ψ⟩P^{[s_2 = -1]}\; (P_{-\pi/4})^{[s_1 = -1]}\; P_{\pi/8} \ket{\psi}

up to a global phase. The corrections are a Clifford rotation Pπ/4P_{\pi/4} 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.

Holds when
  • The circuit is U=Ct Tqt Ct−1⋯C1 Tq1 C0U = C_t\, T_{q_t}\, C_{t-1} \cdots C_1\, T_{q_1}\, C_0 on nn qubits, with CiC_i Clifford unitaries and TqT_{q} the TT gate on qubit qq; identities hold up to a global phase.
  • PθP_{\theta} denotes exp⁡(−iθP)\exp(-i\theta P) for a Hermitian Pauli operator PP.
Proof · Proof of the π/8 Pauli rotation form and its measurement gadget

(a) Up to a global phase, T=diag⁡(1,eiπ/4)=eiπ/8(Z)π/8T = \operatorname{diag}(1, e^{i\pi/4}) = e^{i\pi/8} (Z)_{\pi/8}, so Tq≃(Zq)π/8T_q \simeq (Z_q)_{\pi/8}. For any unitary DD and Hermitian Pauli PP, D†PθD=(D†PD)θD\dagg P_{\theta} D = (D\dagg P D)_{\theta}, because exp⁡\exp commutes with conjugation; if DD is Clifford then D†PDD\dagg P D is again a Hermitian Pauli operator. Write Dj=Cj−1⋯C0D_j = C_{j-1} \cdots C_0 and C=CtCt−1⋯C0C = C_t C_{t-1} \cdots C_0. Inserting DjDj†=ID_j D_j\dagg = I around each TT gate,

U=CtTqtCt−1⋯Tq1C0=C  (Dt†TqtDt)⋯(D1†Tq1D1)≃C (Pt)π/8⋯(P1)π/8,U = C_t T_{q_t} C_{t-1} \cdots T_{q_1} C_0 = C\; \big(D_t\dagg T_{q_t} D_t\big) \cdots \big(D_1\dagg T_{q_1} D_1\big) \simeq C\, (P_t)_{\pi/8} \cdots (P_1)_{\pi/8} ,

with Pj=Dj†ZqjDjP_j = D_j\dagg Z_{q_j} D_j. The middle equality holds because consecutive factors telescope: Dj+1Dj†=CjD_{j+1} D_j\dagg = C_j and CDt†=CtC D_t\dagg = C_t. For the remark on measurements: measuring ZkZ_k on C∣ϕ⟩C\ket{\phi} has the same statistics as measuring C†ZkCC\dagg Z_k C on ∣ϕ⟩\ket{\phi}.

(b) Decompose ∣ψ⟩=∣ψ+⟩+∣ψ−⟩\ket{\psi} = \ket{\psi_+} + \ket{\psi_-} into the ±1\pm 1 eigenspaces of PP, and note Pπ/8∣ψ⟩=e−iπ/8(∣ψ+⟩+eiπ/4∣ψ−⟩)P_{\pi/8}\ket{\psi} = e^{-i\pi/8} (\ket{\psi_+} + e^{i\pi/4}\ket{\psi_-}). The joint state is

∣ψ⟩∣T⟩=12(∣ψ+⟩∣0⟩+eiπ/4∣ψ−⟩∣1⟩)+12(eiπ/4∣ψ+⟩∣1⟩+∣ψ−⟩∣0⟩),\ket{\psi}\ket{T} = \tfrac{1}{\sqrt{2}} \big( \ket{\psi_+}\ket{0} + e^{i\pi/4}\ket{\psi_-}\ket{1} \big) + \tfrac{1}{\sqrt{2}} \big( e^{i\pi/4}\ket{\psi_+}\ket{1} + \ket{\psi_-}\ket{0} \big) ,

where the first bracket has P⊗Z=+1P \otimes Z = +1 and the second −1-1. Each has squared norm 12(∥ψ+∥2+∥ψ−∥2)=12\tfrac{1}{2}(\norm{\psi_+}^2 + \norm{\psi_-}^2) = \tfrac{1}{2}, so s1=±1s_1 = \pm 1 with probability 1/21/2 each. Projecting mm onto (∣0⟩+s2∣1⟩)/2(\ket{0} + s_2 \ket{1})/\sqrt{2} then gives, up to normalisation and global phase,

  • s1=+1s_1 = +1: ∣ψ+⟩+s2 eiπ/4∣ψ−⟩\ket{\psi_+} + s_2\, e^{i\pi/4} \ket{\psi_-}, which is Pπ/8∣ψ⟩P_{\pi/8}\ket{\psi} for s2=+1s_2 = +1 and P Pπ/8∣ψ⟩P\, P_{\pi/8}\ket{\psi} for s2=−1s_2 = -1 (since PP flips the sign of ∣ψ−⟩\ket{\psi_-});
  • s1=−1s_1 = -1: s2 eiπ/4∣ψ+⟩+∣ψ−⟩∝∣ψ+⟩+s2 e−iπ/4∣ψ−⟩s_2\, e^{i\pi/4} \ket{\psi_+} + \ket{\psi_-} \propto \ket{\psi_+} + s_2\, e^{-i\pi/4}\ket{\psi_-}, which is P−π/8∣ψ⟩=P−π/4Pπ/8∣ψ⟩P_{-\pi/8}\ket{\psi} = P_{-\pi/4} P_{\pi/8}\ket{\psi} for s2=+1s_2 = +1 and P P−π/4Pπ/8∣ψ⟩P\, P_{-\pi/4} P_{\pi/8} \ket{\psi} for s2=−1s_2 = -1.

In each case the two outcomes of the XX measurement are equally likely, and the result is P[s2=−1](P−π/4)[s1=−1]Pπ/8∣ψ⟩P^{[s_2 = -1]} (P_{-\pi/4})^{[s_1 = -1]} P_{\pi/8}\ket{\psi}, as claimed. The case analysis was also confirmed by a state-vector computation for a random two-qubit input and P=X⊗YP = X \otimes Y. □\square

Worked Examples

A distance-3 merge, check by check

Use the conventions of the rotated surface code: data qubits at (i,j)(i, j), plaquette (a,b)(a, b) on qubits (a,b),(a,b+1),(a+1,b),(a+1,b+1)(a,b), (a,b{+}1), (a{+}1,b), (a{+}1,b{+}1), XX-type when a+ba + b is even; XX-type two-qubit checks on the top and bottom rows, ZZ-type on the left and right columns; Zˉ\bar{Z} a row and Xˉ\bar{X} a column. Put patch 1 on columns 0–2 and patch 2 on columns 4–6, rows 0–2, so their ZZ-type edges face each other across column 3. The Xˉ\bar{X} strings (columns) run parallel to this seam, so the merge measures Xˉ1Xˉ2\bar{X}_1 \bar{X}_2.

  1. Prepare the seam qubits (0,3),(1,3),(2,3)(0,3), (1,3), (2,3) in ∣0⟩\ket{0}.
  2. Measure the checks of the 3×73 \times 7 rotated patch. Compared with the two separate patches (8 checks each), two ZZ-type edge checks are enlarged: patch 1's Z(1,2)Z(2,2)Z_{(1,2)} Z_{(2,2)} becomes plaquette (1,2)(1,2) and patch 2's Z(0,4)Z(1,4)Z_{(0,4)} Z_{(1,4)} becomes plaquette (0,3)(0,3). Since the seam qubits start in ∣0⟩\ket{0}, the enlarged checks inherit the old values. Four XX-type checks are new: plaquettes (0,2)(0,2) and (1,3)(1,3), the top check X(0,3)X(0,4)X_{(0,3)} X_{(0,4)} and the bottom check X(2,2)X(2,3)X_{(2,2)} X_{(2,3)}. That is 16−2+2+4=20=21−116 - 2 + 2 + 4 = 20 = 21 - 1 checks, as a 21-qubit patch encoding one qubit requires.
  3. Multiply the four new XX checks. Every seam qubit appears exactly twice and cancels, leaving XX on the whole of column 2 and the whole of column 4:
    X(0,2)X(1,2)X(2,2)⋅X(0,4)X(1,4)X(2,4)  =  Xˉ1Xˉ2.X_{(0,2)}X_{(1,2)}X_{(2,2)} \cdot X_{(0,4)}X_{(1,4)}X_{(2,4)} \;=\; \bar{X}_1 \bar{X}_2 .
    Individually the new checks give random outcomes (each anticommutes with the ZZ of a seam qubit, which was a stabilizer), but their product is the logical measurement, as in the theorem.
  4. Split by measuring the three seam qubits in the ZZ 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 21+20=41=2⋅21−121 + 20 = 41 = 2 \cdot 21 - 1 physical qubits. Exchanging the roles of XX and ZZ (facing XX-type edges, seam in ∣+⟩\ket{+}) measures Zˉ1Zˉ2\bar{Z}_1 \bar{Z}_2.

Cost of a CNOT and of a T gate

The lattice-surgery CNOT needs two sequential merges. At distance d=25d = 25 and a syndrome-round time of 1 μs1\,\mu\mathrm{s}, each merge takes about 25 μs25\,\mu\mathrm{s}, so the CNOT takes about 50 μs50\,\mu\mathrm{s} and occupies three patches plus the space between them. A π/8\pi/8 rotation consumes one magic state in one multi-patch measurement, about 25 μs25\,\mu\mathrm{s} if the magic state is ready. A circuit whose 10810^{8} T gates are applied strictly one after another therefore needs at least 108×25 μs=2500 s10^{8} \times 25\,\mu\mathrm{s} = 2500\,\mathrm{s}, 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

AlgorithmLogical CNOT by lattice surgeryEstablished result

Input. Control CC and target TT in an arbitrary joint state ∣ψ⟩CT\ket{\psi}_{CT}; an ancilla patch AA.

Procedure.

  1. Prepare AA in ∣+⟩\ket{+}.
  2. Measure ZCZAZ_C Z_A (merge and split CC with AA); outcome s1s_1.
  3. Measure XAXTX_A X_T (merge and split AA with TT); outcome s2s_2.
  4. Measure AA in the ZZ basis; outcome s3s_3.
  5. Record the corrections ZCZ_C if s2=−1s_2 = -1 and XTX_T if s1s3=−1s_1 s_3 = -1 in the Pauli frame.

Output. CNOTC→T∣ψ⟩CT\mathrm{CNOT}_{C \to T} \ket{\psi}_{CT} after the corrections. Each of the eight outcome triples occurs with probability 1/81/8, independent of the input.

Why it works. Write ∣ψ⟩=∑c,tψct∣c⟩C∣t⟩T\ket{\psi} = \sum_{c,t} \psi_{ct} \ket{c}_C \ket{t}_T. With AA in ∣+⟩\ket{+}, the ZCZAZ_C Z_A measurement with outcome s1s_1 leaves ∑ψct∣c⟩C∣c⊕a1⟩A∣t⟩T\sum \psi_{ct} \ket{c}_C \ket{c \oplus a_1}_A \ket{t}_T with (−1)a1=s1(-1)^{a_1} = s_1: the ancilla now copies the control in the ZZ basis, up to a known flip. Measuring XAXTX_A X_T projects ATA T onto ∣++⟩+s2∣−−⟩\ket{++}+s_2\ket{--}-type correlations, which, followed by the ZZ measurement of AA, teleports the parity of the ancilla onto the target: the target becomes ∣t⊕c⊕a1⊕a3⟩\ket{t \oplus c \oplus a_1 \oplus a_3} with (−1)a3=s3(-1)^{a_3} = s_3, and a phase (−1)c(-1)^{c} appears exactly when s2=−1s_2 = -1. Removing XTa1⊕a3X_T^{a_1 \oplus a_3} and ZC[s2=−1]Z_C^{[s_2 = -1]} leaves ∑ψct∣c⟩∣t⊕c⟩\sum \psi_{ct} \ket{c}\ket{t \oplus c}. 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 AA with ZAZ_A and XAX_A), so they are sequential: two merges of about dd 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.

Holds when
  • Ideal logical preparations and logical Pauli product measurements (in a surface-code machine, merges and splits held for about dd rounds each).

Computing with Pauli product measurements

Litinski builds a complete scheme on two rules: a tile holds a d×dd \times d patch, and any Pauli product measurement between patches that are connected through free tiles costs one time step of about dd code cycles, while single-patch preparations and measurements cost no time step. With the rotation form, a Clifford+T circuit becomes a sequence of π/8\pi/8 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 nn qubits in 1.5n+31.5n + 3 tiles but needs up to nine time steps per magic state, an intermediate block uses 2n+42n + 4 tiles and up to five time steps, and a fast block uses 2n+8n+12n + \sqrt{8n} + 1 tiles and one time step. Measuring a Pauli operator with YY 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 10810^{8} T gates fit in about 3.7×1053.7 \times 10^{5} physical qubits at gate error near 10−310^{-3} (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 dd cycles are an approximation. Litinski notes the correspondence between a time step and dd 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.

Open in the knowledge graph

Contributions about this record

Nobody has published a contribution about it yet.

Publish a result, reproduction or commentPropose a correction to this page

References

  1. Dominic Horsman, Austin G. Fowler, Simon Devitt, Rodney Van Meter (2012). Surface code quantum computing by lattice surgery. New Journal of Physics 14, 123011. doi:10.1088/1367-2630/14/12/123011arXiv:1111.4022
  2. Austin G. Fowler, Matteo Mariantoni, John M. Martinis, Andrew N. Cleland (2012). Surface codes: Towards practical large-scale quantum computation. Physical Review A 86, 032324. doi:10.1103/PhysRevA.86.032324arXiv:1208.0928
  3. Christophe Vuillot, Lingling Lao, Ben Criger, … Barbara M. Terhal (2019). Code deformation and lattice surgery are gauge fixing. New Journal of Physics 21, 033028. doi:10.1088/1367-2630/ab0199arXiv:1810.10037
  4. Daniel Litinski (2019). A Game of Surface Codes: Large-Scale Quantum Computing with Lattice Surgery. Quantum 3, 128. doi:10.22331/q-2019-03-05-128arXiv:1808.02892
  5. Daniel Litinski, Felix von Oppen (2018). Lattice Surgery with a Twist: Simplifying Clifford Gates of Surface Codes. Quantum 2, 62. doi:10.22331/q-2018-05-04-62arXiv:1709.02318
  6. Austin G. Fowler, Craig Gidney (2018). Low overhead quantum computation using lattice surgery. arXiv:1808.06709
  7. Sergey Bravyi, Graeme Smith, John A. Smolin (2016). Trading Classical and Quantum Computational Resources. Physical Review X 6, 021043. doi:10.1103/PhysRevX.6.021043arXiv:1506.01396
  8. Christopher Chamberland, Earl T. Campbell (2022). Universal Quantum Computing with Twist-Free and Temporally Encoded Lattice Surgery. PRX Quantum 3, 010331. doi:10.1103/PRXQuantum.3.010331arXiv:2109.02746
  9. Michael Beverland, Vadym Kliuchnikov, Eddie Schoute (2022). Surface Code Compilation via Edge-Disjoint Paths. PRX Quantum 3, 020342. doi:10.1103/PRXQuantum.3.020342arXiv:2110.11493
  10. Niel de Beaudrap, Dominic Horsman (2020). The ZX calculus is a language for surface code lattice surgery. Quantum 4, 218. doi:10.22331/q-2020-01-09-218arXiv:1704.08670
  11. Andrew J. Landahl, Ciaran Ryan-Anderson (2014). Quantum computing by color-code lattice surgery. arXiv:1407.5103
  12. Alexander Erhard, Hendrik Poulsen Nautrup, Michael Meth, … Thomas Monz (2021). Entangling logical qubits with lattice surgery. Nature 589, 220-224. doi:10.1038/s41586-020-03079-6arXiv:2006.03071
  13. Alexander Cowtan, Simon Burton (2024). CSS code surgery as a universal construction. Quantum 8, 1344. doi:10.22331/q-2024-05-14-1344arXiv:2301.13738
  14. Andrew W. Cross, Zhiyang He, Patrick J. Rall, Theodore J. Yoder (2024). Improved QLDPC Surgery: Logical Measurements and Bridging Codes. arXiv preprint. arXiv:2407.18393
  15. Robert Raussendorf, Jim Harrington (2007). Fault-tolerant quantum computation with high threshold in two dimensions. Physical Review Letters 98, 190504. doi:10.1103/PhysRevLett.98.190504arXiv:quant-ph/0610082
  16. Daniel Gottesman (1997). Stabilizer Codes and Quantum Error Correction. PhD thesis, California Institute of Technology. arXiv:quant-ph/9705052

Contributors

  • KetQat maintainers · @ketqatConceptualization; Supervision (CRediT roles)
  • Claude (AI drafting assistant)Writing, original draft (CRediT roles)

Review history

  1. Automated source check · Pass · 2026-12-01 · Independent automated verification pass (AI, not the drafting session)

    Topic body only (embedded records carry their own states). Distance-3 merge example re-derived check by check from the rotated-surface-code conventions (enlarged Z checks at plaquettes (1,2) and (0,3), four new X checks, 20 checks on 21 qubits, product of new X checks equal to column 2 times column 4, 41 qubits with ancillas); timing example recomputed (50 us CNOT, 1e8 x 25 us = 2500 s). Litinski block sizes and time steps (1.5n+3/9, 2n+4/5, 2n+sqrt(8n)+1/1) compared with arXiv:1808.02892 Sec. 3 summary; Fowler-Gidney factors 4 and 5 and 3.7e5 qubits compared with arXiv:1808.06709 abstract; Erhard et al. compared with arXiv:2006.03071 abstract. Other attributions checked against reference titles only.

Revision history

  1. 2026-12-01Content release 2.1.0: 35 more topics, an independent source check of every record, intake hardening (#17)80537b7e
  2. 2026-11-30KetQat Commons: free learning paths, knowledge records, research problems, literature intake (#14)571c9b10

Current revision 1926d4b6904a0f13. Source file knowledge/records/topic/lattice-surgery.md in the content repository (readable there once it is public).