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 .