Two surface code patches — merge to perform a joint measurement
Control A:
Target B:
Merge type:
Step-by-step merge protocol
0. Setup
1. Init ancilla
2. Activate merge
3. Measure rounds
4. Outcome
5. Split
Pick initial states for the two patches and a merge type, then press Next → to begin.
Joint outcome
—
Run the protocol to see the measured eigenvalue.
step 0 / 5
How two merges build a full logical CNOT
Horsman, Fowler, Devitt & Van Meter (2012) — "Surface code quantum computing by lattice surgery"
1
Initialize an ancilla patch A between Control C and Target T, prepared in |+⟩L.
2
X-merge C with A (join along smooth boundaries) → fault-tolerantly measure X_C ⊗ X_A = m₁.
3
Split C and A back into independent patches.
4
Z-merge A with T (join along rough boundaries) → fault-tolerantly measure Z_A ⊗ Z_T = m₂.
5
Split A and T back into independent patches.
6
Measure ancilla A directly in the X basis → outcome m₃. Discard A.
7
Apply Pauli corrections to C and T conditioned on (m₁, m₂, m₃) — these are classically-controlled, free, and instantaneous. Net result: CNOT₍C→T₎, exactly as if the gate had been applied directly — but built entirely from joint Pauli measurements.
Why this matters: this is exactly the mechanism Google and IBM use for logical two-qubit gates on real superconducting surface code chips. There is no native "logical CNOT instruction" — only measurement, merging, and splitting. The interactive demo on the left shows step 2 and step 4 individually: a single merge-measure-split cycle is the atomic operation this entire protocol is built from.