Title: The ZX calculus is a language for surface code lattice surgery,
Abstract: Quantum computing is moving rapidly to the point of deployment of technology.
Functional quantum devices will require the ability to correct error in order
to be scalable and effective. A leading choice of error correction, in
particular for modular or distributed architectures, is the surface code with
logical two-qubit operations realised via "lattice surgery". These operations
consist of "merges" and "splits" acting non-unitarily on the logical states and
are not easily captured by standard circuit notation. This raises the question
of how best to reason about lattice surgery in order efficiently to use quantum
states and operations 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 designed using category theory, 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 can 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 surgery by considering two operations
(magic state use 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.