The ZX-calculus is a rigorous
graphical language for reasoning about
linear map
In mathematics, and more specifically in linear algebra, a linear map (also called a linear mapping, linear transformation, vector space homomorphism, or in some contexts linear function) is a mapping V \to W between two vector spaces that pr ...
s between
qubit
In quantum computing, a qubit () or quantum bit is a basic unit of quantum information—the quantum version of the classic binary bit physically realized with a two-state device. A qubit is a two-state (or two-level) quantum-mechanical system, ...
s, which are represented as
string diagrams called ''ZX-diagrams''. A ZX-diagram consists of a set of generators called ''spiders'' that represent specific
tensor
In mathematics, a tensor is an algebraic object that describes a multilinear relationship between sets of algebraic objects related to a vector space. Tensors may map between different objects such as vectors, scalars, and even other tens ...
s. 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
Category, plural categories, may refer to:
Philosophy and general uses
*Categorization, categories in cognitive science, information science and generally
* Category of being
* ''Categories'' (Aristotle)
* Category (Kant)
* Categories (Peirce) ...
, 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
Complete may refer to:
Logic
* Completeness (logic)
* Completeness of a theory, the property of a theory that every formula in the theory's language or its negation is provable
Mathematics
* The completeness of the real numbers, which implies ...
for different families of linear maps. ZX-diagrams can be seen as a generalisation of
quantum circuit notation.
History
The ZX-calculus was first introduced by
Bob Coecke and Ross Duncan in 2008 as an extension of the
categorical quantum mechanics
Categorical quantum mechanics is the study of quantum foundations and quantum information using paradigms from mathematics and computer science, notably monoidal category theory. The primitive objects of study are physical processes, and the diff ...
school of reasoning. They introduced the fundamental concepts of spiders,
strong complementarity and most of the standard rewrite rules.
In 2009 Duncan and Perdrix found the additional
Euler decomposition rule for the
Hadamard gate
The Hadamard transform (also known as the Walsh–Hadamard transform, Hadamard–Rademacher–Walsh transform, Walsh transform, or Walsh–Fourier transform) is an example of a generalized class of Fourier transforms. It performs an orthogonal ...
,
which was used by Backens in 2013 to establish the first completeness result for the ZX-calculus. Namely that there exists a set of rewrite rules that suffice to prove all equalities between
stabilizer ZX-diagrams, where phases are multiples of
, up to global scalars. This result was later refined to completeness including scalar factors.
Following an incompleteness result, in 2017, a completion of the ZX-calculus for the approximately universal
fragment was found, in addition to two different completeness results for the universal ZX-calculus (where phases are allowed to take any real value).
Also in 2017 the book ''Picturing Quantum Processes'' was released, that builds quantum theory from the ground up, using the ZX-calculus. See also the 2019 book ''Categories for Quantum Theory''.
Informal introduction

ZX-diagrams consist of green and red nodes called ''spiders'', which are connected by ''wires''. Wires may curve and cross, arbitrarily many wires may connect to the same spider, and multiple wires can go between the same pair of nodes. There are also Hadamard nodes, usually denoted by a yellow box, which always connect to exactly two wires.
ZX-diagrams represent linear maps between
qubit
In quantum computing, a qubit () or quantum bit is a basic unit of quantum information—the quantum version of the classic binary bit physically realized with a two-state device. A qubit is a two-state (or two-level) quantum-mechanical system, ...
s, similar to the way in which
quantum circuit
In quantum information theory, a quantum circuit is a model for quantum computation, similar to classical circuits, in which a computation is a sequence of quantum gates, measurements, initializations of qubits to known values, and possibly ...
s represent
unitary maps between qubits. ZX-diagrams differ from quantum circuits in two main ways. 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''. Using these rules, calculations can be performed in the graphical language itself.
Generators
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
and the
Hadamard-transformed basis and
. The colour green (or sometimes white) is used to represent the computational basis and the colour red (or sometimes grey) is used to represent the Hadamard-transformed basis. Each of these generators can furthermore be labelled by a phase, which is a real number from the interval