Source-linked AI summary
The ZX calculus is a language for surface code lattice surgery
Niel de Beaudrap, Dominic Horsman
TL;DR
Surface-code lattice surgery uses non-unitary splits and merges that standard circuit notation represents poorly, complicating protocol design and verification. The paper matches these operations, including byproducts, to ZX calculus diagrams and uses diagram rewrites to derive novel CNOT procedures and reduce T-gate overhead.
Problem
Non-unitary lattice-surgery splits and merges are difficult to capture and to design, verify, and compile with standard circuit notation and existing representations.
Source: §1 · pp. 1–2Method
The paper maps lattice-surgery split and merge primitives, including non-deterministic byproducts, to ZX calculus diagrams and applies meaning-preserving diagram rewrites.
Source: §1 · p. 2Results
The paper reports six novel CNOT implementations in lattice surgery and significantly reduced operational overhead for the T-gate implementation.
Source: §1 · p. 2Takeaways & Limitations
The authors present ZX calculus as a visually intuitive language for manipulating and verifying error-corrected lattice-surgery operations at large scales.
Source: §1 · p. 2
Abstract
from arXiv · showhide
A leading choice of error correction for scalable quantum computing is the surface code with lattice surgery. The basic lattice surgery operations, the merging and splitting of logical qubits, act non-unitarily on the logical states and are not easily captured by standard circuit notation. This raises the question of how best to design, verify, and optimise protocols that use lattice surgery, in particular in architectures with complex resource management issues. In this paper we demonstrate that the operations of the ZX calculus -- a form of quantum diagrammatic reasoning based on bialgebras -- match exactly the operations of lattice surgery. Red and green "spider" nodes match rough and smooth merges and splits, and follow the axioms of a dagger special associative Frobenius algebra. Some lattice surgery operations require non-trivial correction operations, which are captured natively in the use of the ZX calculus in the form of ensembles of diagrams. We give a first taste of the power of the calculus as a language for lattice surgery by considering two operations (T gates and producing a CNOT ) and show how ZX diagram re-write rules give lattice surgery procedures for these operations that are novel, efficient, and highly configurable.
1 Introduction
Lattice surgery’s non-unitary split and merge operations are difficult to represent, design, and verify with standard circuit notation and existing representations. The paper connects these primitives to ZX calculus and uses diagram rewrites to derive new CNOT implementations and reduce T-gate overhead.
1 Introduction
- The paper motivates new theoretical tools as useful for organizing quantum-computing components and reasoning about system construction.It situates this need amid the development of small-scale, noisy devices.Source: §1 · p. 1
- Surface-code lattice surgery splits and merges memories through measurements and further stabilizer measurements, respectively.The introduction identifies it as a technique of choice for flexible and efficient resource use in fault-tolerant architectures.Source: §1 · p. 1
- Standard circuits fit poorly because lattice-surgery splits and merges are non-unitary transformations of quantum memories.The lack of a dedicated language makes designing, verifying, and compiling novel surgery patterns difficult; existing representations become unwieldy for these tasks.Source: §1 · pp. 1–2
- ZX calculus directly captures lattice-surgery split and merge primitives, including their non-deterministic byproduct operations.The paper presents it as a language for lattice surgery whose results can be imported for use with surgery.Source: §1 · p. 2
- Six novel CNOT implementations and a significantly reduced T-gate operational overhead demonstrate the use of ZX diagram rewrites for lattice-surgery protocols.The rewrites transform diagrams while preserving their meaning, without requiring exponentially large matrices.Source: §1 · p. 2
- The authors argue that ZX calculus makes error-corrected operations visually intuitive and capable of verification at large scales.They describe it as a natural language and logic for programming large-scale quantum technologies.Source: §1 · p. 2
2 The planar surface code
The planar surface code stores one logical qubit across physical qubits on a two-dimensional lattice, with stabilizers defining its codespace. Logical operators act on or measure the encoded information, while Pauli frames track accumulated errors and surgery-related reference-frame changes.
2 The planar surface code
- For n physical qubits, n − 1 stabilizers fix a subspace encoding one logical degree of freedom.The physical qubits are associated with the edges of a two-dimensional lattice segment.Source: §2 · p. 2
- The codespace is the simultaneous +1 eigenstate of the plaquette stabilizers, which can be measured without changing the encoded lattice state.The paper defines plaquettes as qubit sets on face boundaries or surrounding vertices; boundary stabilizers have weight three rather than four.Source: §2 · p. 2
- Horizontal Z chains between rough boundaries and vertical X chains between smooth boundaries realize logical ZL and XL operators, respectively.Figure 1 depicts these supports on a distance-3 planar code.Source: §2 · p. 2, Figure 1 · p. 3
- Measuring a chain between rough boundaries in the Z basis gives the eigenvalue of logical ZL, distinguishing the encoded |0⟩L and |1⟩L states.The product of measurement results is +1 for |0⟩L and −1 for |1⟩L.Source: §2 · p. 3
- Pauli frames classically track accumulated errors instead of applying noisy physical correction gates, and must also be updated after some surgery operations.A physical Pauli error flips eigenvalues of stabilizers of the opposite type that act on that qubit.Source: §2 · p. 3
3 Lattice surgery
Lattice surgery combines or decomposes planar surface-code memories through rough or smooth merges and splits. These operations change the number of memories and require accounting for changes in their Pauli frames.
3 Lattice surgery
- Lattice-surgery splits map one logical-qubit state to two, while merges map two logical-qubit states to one, with Pauli-frame changes accounted for.The paper represents these effects as CPTP maps on encoded density operators.Source: §3 · p. 3
- Planar codes also use transversal operations, braiding or twisting defects, and code deformation as alternative procedures.The passage contrasts these approaches with lattice surgery and notes transversal operations require more operations and/or connectivity.Source: §3 · p. 3
3.1 Splitting
- A rough split measures intermediate qubits in the Z basis to form two daughter memories, whose new boundary stabilizers may require correction.The daughter memories retain most original stabilizers; boundary stabilizers have weight three instead of four.Source: §3.1 · p. 4, Figure 2 · p. 4
L . The Z(0)
The split and merge procedures change encoded logical observables and Pauli frames according to measurement outcomes. Corrections and outcome-dependent branches can be represented as logical-state transformations.
L . The Z(0)
- After a rough split, the logical Z operator is distributed across the daughter memories, while the logical X operator is copied.The split can be represented as a unitary embedding on density operators after adapting Pauli frames for measurement outcomes.Source: L . The Z(0) · p. 4
- Negative split measurement outcomes produce paired −1 boundary stabilizers, corrected in the Pauli frame by an X chain to a boundary.Choosing either boundary gives equivalent corrections when the same boundary is used for both daughters.Source: L . The Z(0) · p. 4
3.2 Merging
- A rough merge measures the two parent logical X operators jointly, reducing two memories to one and combining their logical computational-basis labels by XOR.Across the join, X-plaquette measurement outcomes implement the joint logical measurement.Source: §3.2 · pp. 4–5
- The rough-merge outcome distinguishes equal from different parent logical X values; a negative outcome admits alternative Pauli-frame corrections.The correction choice determines the child logical operation, with the alternatives differing by a logical Z operation.Source: §3.2 · p. 5
- The rough merge is represented as a CPTP map whose Kraus operators encode the measurement outcome and the chosen child Pauli frame.For the negative outcome, adapting the frame on the left or right yields two stated choices of Kraus operator.Source: §3.2 · p. 5
- A smooth merge prepares an interstitial row in |0⟩ and measures Z plaquettes across the join, with outcome-dependent logical transformations.Its outcome-conditioned Kraus operators include a fixed positive branch and frame-dependent choices for the negative branch.Source: §3.2 · pp. 5–6
4 The ZX calculus
The ZX calculus represents quantum operations as graphs whose colored nodes and connecting edges encode tensors. Its rewrite rules preserve meaning, enabling diagram simplification and derivations such as Pauli propagation through CNOT without matrix calculations.
4.1 Using ZX diagrams to denote tensors
- ZX diagrams use colored nodes for operations, including preparations and projections, and edges for qubits; the graphs denote tensors.Source: §4.1 · p. 6
- Red and green spiders represent operations in complementary bases, and nodes of any degree can be formed by composing them.A spider with angle α represents |0⟩⊗k + eiα|1⟩⊗k for green nodes and |+⟩⊗k + eiα|-⟩⊗k for red nodes.Source: §4.1 · p. 7, §4.2 · p. 8
4.2 Properties of the ZX calculus
- The Spider Law permits same-color nodes to merge while preserving total phase modulo 2π, supporting recursive construction and diagram simplification.When the summed angles are a multiple of 2π, the resulting operation is the identity and the node can be removed.Source: §4.2 · pp. 7–8
4.3 A simple demonstration of how to use the ZX calculus
- ZX rewrites derive Pauli propagation through CNOT: Z commutes with the control and propagates from target to control, while X commutes with target and propagates from control to target.The derivation uses spider rules and the node-interaction rules, without matrix calculations.Source: §4.3 · pp. 8–9
5 Lattice surgery in the ZX calculus
The section identifies lattice surgery splits and merges with ZX diagrams, then extends this correspondence to outcome-dependent operations. Treating merges as Kraus-operator ensembles lets diagram compositions represent procedures and their outcome probabilities.
5 Lattice surgery in the ZX calculus
- Merge operations require ensembles of diagrams to represent outcome-dependent byproducts, which ZX rules can simplify.The operations are represented as Kraus maps, with the Pauli-frame convention determining the negative-branch correction.Source: §5 · pp. 9, 11
- Smooth splits and positive-branch merges correspond to green degree-3 nodes, while rough operations correspond to red degree-3 nodes.The correspondence identifies the operators acting on encoded logical data.Source: §5 · pp. 9–10
- Positive branches of lattice-surgery procedures model ZX equations without projections when degree-2 or degree-3 nodes have zero angle.For the standard CNOT composition, the positive branch is 1/√2 times CNOT and occurs with probability 1/2.Source: §5 · p. 10
- Lattice surgery models randomly constructed simple ZX diagrams, with each diagram’s 2-norm giving the probability of its merge outcomes.The procedures compose rough or smooth merge gadgets with split operations and qubit preparations.Source: §5 · pp. 10, 12
6 Consequences of the equivalence
The section applies ZX rewrites to lattice-surgery implementations of T gates and CNOTs. It describes magic-state merges for rotations and multiple graph-equivalent CNOT procedures, broadening the available surgery patterns.
6.1 Lattice surgery T gate
- ZX rewrites turn the T gate into merging an input with a magic state, with a phase-flip correction when required.Interchanging red and green nodes also gives Rx(π/4) procedures, and smaller-angle rotations can be used in magic-state compilations.Source: §6.1 · pp. 12–13
6.2 Realising CNOT gates
- Topologically equivalent presentations of the CNOT graph yield additional lattice-surgery procedures implementing CNOT in the positive branch.The appendix also gives negative-branch realizations for these procedures and the original construction.Source: §6.2 · p. 13
- The alternative CNOT procedures include rough splitting the target before a smooth merge, Bell-pair-mediated merges, and splits followed by a simulated Bell projection.Only the construction shown in Eqn. (19) had previously appeared in the literature, according to the paper.Source: §6.2 · p. 13
7 Conclusions
The ZX calculus provides a precise description of surface-code lattice-surgery splits and merges, including outcome-dependent Pauli-frame information. The paper identifies compiler and protocol-design uses while limiting its demonstrated scope to surface-code lattice surgery.
7 Conclusions
- Merge outcomes select among possible post-merge diagrams, making Pauli-frame information and its propagation describable in a high-level notation.Some branches differ by logical Pauli corrections, as in the constructed CNOT, though this is not always the case.Source: §7 · p. 14
- Rough and smooth merges and splits satisfy ZX spider structure, enabling multi-surface operations to be described and their effects on encoded data analyzed.The correspondence includes dagger relations, commutativity, specialness, and associativity; negative-branch byproducts help determine which multi-node operations can be deterministic.Source: §7 · p. 14
- The demonstrated correspondence is for surface-code lattice surgery; representing other codes, including colour-code Y-basis merges, remains an open question.The paper identifies representing stabilizer-code use with ZX as further research.Source: §7 · p. 14
- ZX is proposed as a compiler intermediate representation and protocol-design tool, with compiled procedures requiring analysis of operation time-ordering and simultaneity.The paper describes compiling to the operations a device implements and interpreting rewritten diagrams as lattice-surgery procedures.Source: §7 · p. 14
- Applying ZX-compiled lattice surgery to known algorithms and protocols may simplify procedures and provide another logic for analyzing their behavior.The paper presents this as a potential use of the ZX/lattice-surgery equivalence.Source: §7 · pp. 14–15
Appendix
The appendix relates correction operations in the CNOT procedures of Eqns. (19) and (20) to logical Pauli corrections and addresses merge conventions in T-state injection.
Appendix
- The appendix analyzes corrections for the CNOT procedures of Eqns. (19) and (20) as logical Pauli corrections on the control and/or target qubit.It also shows that the choice of convention for adapting merge operations in T-state injection introduces no essential difficulties.Source: Appendix · p. 17
- The correction analysis covers logical Pauli corrections on the control qubit, target qubit, or both.Source: Appendix · p. 17
- The choice of convention for adapting merge operations in T-state injection introduces no essential difficulties.Source: Appendix · p. 17
A. CNOT patterns
The CNOT procedures are described through positive-branch lattice-surgery transformations and their alternative negative-branch outcomes. Across the analyzed cases, those outcomes differ only by heralded logical Pauli operations.
A. CNOT patterns
- Eqns. (19) and (20) describe positive-branch logical-qubit transformations realized through merges, splits, preparations, and projections.The diagram topology can be used to infer the operations involved.Source: A. CNOT patterns · p. 17
- The analyzed procedures also consider alternative transformations for different conventional choices of negative-branch merge Kraus operations.Source: A. CNOT patterns · p. 17
- Negative-branch transformations differ from the positive branch only by logical Pauli operations, which merge outcomes herald and can therefore be tracked or corrected.The procedures are not sensitive to the convention used to adapt the Pauli frame of a child memory in a merge.Source: A. CNOT patterns · p. 17
A.1. Smooth split control, rough merge with target.
The CNOT constructions use either an intermediary Bell pair with merges or splits followed by a simulated Bell measurement. Their nondeterministic outcomes are represented and analyzed through branches.
A.3. Create intermediary Bell pair then merge with control and target.
- An intermediary Bell pair can be prepared from a single-qubit state and a smooth or rough split, then used for a probabilistic CNOT through smooth and rough merges.The two merges may independently yield positive or negative branches; the analysis treats both-positive and both-negative cases, noting mixed cases are similar.Source: §A.3 · p. 18
- The Bell-pair cup is super-normalized, and the red- or green-split preparation choices are treated together because splits produce no logical byproducts.Commuting X and Z nodes changes only an irrelevant global phase.Source: §A.3 · p. 18
A.4. Split control and target, and simulate an intermediary Bell measurement.
- The alternative construction splits control and target, then simulates an intermediary Bell measurement with merge procedures because the measurement cannot be performed deterministically.Both merge and measurement outcomes are nondeterministic; a phase bπ records the measurement result and permits reduction to the positive branch.Source: §A.4 · p. 19
B. Magic state merge patterns
The section considers T-gate teleportation through a magic-state merge and shows that changing the negative-branch convention preserves its interpretation while allowing a simpler protocol.
B. Magic state merge patterns
- For T rotation by merging a magic state with an input qubit, the negative-branch convention introduces no essential difficulty in interpreting the operation as merge-based teleportation.Source: B. Magic state merge patterns · p. 20
- The alternative procedure differs from the other negative-merge convention only by an X operation controlled on the merge outcome.A red π node represents the X operation.Source: B. Magic state merge patterns · p. 20
- The alternative negative-merge convention yields a T-gate teleportation protocol that omits the classically controlled NOT correction.The target and control roles are swapped, while the measured qubit remains the target.Source: B. Magic state merge patterns · p. 20