The ZX-calculus is a rigorous graphical language for reasoning about linear maps between qubits, which are represented as string diagrams called ZX-diagrams.
A ZX-diagram consists of a set of generators called spiders that represent specific tensors.
These are connected together to form a tensor network similar to Penrose graphical notation.
Due to the symmetries of the spiders and the properties of the underlying category, topologically deforming a ZX-diagram (i.e. moving the generators without changing their connections) does not affect the linear map it represents.
In addition to the equalities between ZX-diagrams that are generated by topological deformations, the calculus also has a set of graphical rewrite rules for transforming diagrams into one another.
The ZX-calculus is universal in the sense that any linear map between qubits can be represented as a diagram, and different sets of graphical rewrite rules are complete for different families of linear maps.
ZX-diagrams can be seen as a generalisation of quantum circuit notation, and they form a strict subset of tensor networks which represent general fusion categories and wavefunctions of quantum spin systems.
The ZX-calculus was first introduced by Bob Coecke and Ross Duncan in 2008 as an extension of the categorical quantum mechanics school of reasoning.
They introduced the fundamental concepts of spiders, strong complementarity and most of the standard rewrite rules.
[1][2] In 2009 Duncan and Perdrix found the additional Euler decomposition rule for the Hadamard gate,[3] which was used by Backens in 2013 to establish the first completeness result for the ZX-calculus.
[4] Namely that there exists a set of rewrite rules that suffice to prove all equalities between stabilizer ZX-diagrams, where phases are multiples of
fragment was found,[7] in addition to two different completeness results for the universal ZX-calculus (where phases are allowed to take any real value).
[11] ZX-diagrams consist of green and red nodes called spiders, which are connected by wires.
The first is that ZX-diagrams do not have to conform to the rigid topological structure of circuits, and hence can be deformed arbitrarily.
The second is that ZX-diagrams come equipped with a set of rewrite rules, collectively referred to as the ZX-calculus.
The building blocks or generators of the ZX-calculus are graphical representations of specific states, unitary operators, linear isometries, and projections in the computational basis
Any diagram written by composing generators in this way is called a ZX-diagram.
Two diagrams represent the same linear operator if they consist of the same generators connected in the same ways.
In other words, whenever two ZX-diagrams can be transformed into one another by topological deformation, then they represent the same linear map.
Thus, the controlled-NOT gate can be represented as follows: The following example of a quantum circuit constructs a GHZ-state.
The category of ZX-diagrams is a dagger compact category, which means that it has symmetric monoidal structure (a tensor product), is compact closed (it has cups and caps) and comes equipped with a dagger, such that all these structures suitably interact.
Indeed, all ZX-diagrams are built freely from a set of generators via composition and monoidal product, modulo the equalities induced by the compact structure and the rules of the ZX-calculus given below.
The following table gives the generators together with their standard interpretations as linear maps, expressed in Dirac notation.
This has been used in the software Quantomatic to allow automated rewriting of ZX-diagrams (or more general string diagrams).
[24] In order to formalise the usage of the "dots" to denote any number of wires, such as used in the spider fusion rule, this software uses bang-box notation[25] to implement rewrite rules where the spiders can have any number of inputs or outputs.
A more recent project to handle ZX-diagrams is PyZX, which is primarily focused on circuit optimisation.
The ZX-calculus is only one of several graphical languages for describing linear maps between qubits.
The ZW-calculus was developed alongside the ZX-calculus, and can naturally describe the W-state and Fermionic quantum computing.
-labelled spiders is equivalent to the dagger compact closed category of linear relations over the finite field
outputs in the phase-free ZX-calculus, its X stabilizers form a linear subspace of