Overview
Category theory is the mathematics of composition. A category records things (objects) and processes between them (morphisms) and nothing else except how processes compose. Quantum theory fits this mould well: systems are objects, operations are morphisms, running operations one after another is composition, and placing systems side by side is a second, parallel composition — the tensor product, which makes the category monoidal.
Categorical quantum mechanics, initiated by Abramsky and Coecke, showed that a small amount of extra structure — a dagger (adjoint) and cups and caps that bend wires, forming a dagger compact category, together with biproducts for classical branching — already captures entanglement, teleportation and the Born rule, and that the resulting equations can be proved by drawing pictures. That picture language, the string diagrams of Joyal and Street, is the foundation of the ZX-calculus and of the graphical notation for tensor networks. This page gives the definitions and the theorems those topics rely on; textbook treatments are Heunen and Vicary and Coecke and Kissinger, and the general theory is in Mac Lane.
Intuition
A quantum circuit is already a string diagram: wires are systems, boxes are gates, reading upward is composing in time, and gates on different wires commute past each other. The monoidal-category axioms are exactly the rules that make such drawings unambiguous. One can deform a diagram freely — slide boxes along wires, straighten wires — without changing the map it denotes; that is the content of the coherence theorem.
The Bell state, drawn as a "cup" that creates two wire ends, and the Bell effect, drawn as a "cap", turn the picture into something richer: a wire may now run backwards. The snake equation says that a wire that goes up, turns down through a cap, and up again through a cup is just a straight wire. Read physically, that is teleportation: the state enters on the left, is projected onto a Bell pair together with half of another Bell pair, and comes out on the right. The algebra that verifies teleportation is reduced to pulling a string straight.
Prerequisites
Linear maps, tensor products and adjoints in finite dimensions (linear algebra); the circuit model (quantum circuit model). No prior category theory is assumed.
Mathematical Definitions
Categories, functors, natural transformations
A category consists of
- a collection of objects ;
- for every pair of objects a collection of morphisms ;
- for every and a composite ;
- for every object an identity ,
such that composition is associative, , and unital, , for all composable . A morphism is an isomorphism if some has and . The opposite category has the same objects and a morphism for each , composed in the reverse order.
Examples:
- : sets and functions.
- : finite-dimensional complex Hilbert spaces and linear maps; isomorphisms are invertible linear maps. This is the category in which pure-state quantum mechanics and the ZX-calculus are interpreted.
- : finite-dimensional Hilbert spaces with completely positive maps between their operator spaces; quantum channels are the trace-preserving morphisms.
- : sets and relations, a frequent "toy" model in categorical quantum mechanics.
- A group is a category with one object in which every morphism is an isomorphism.
The definitions are those of chapter I of Mac Lane; the quantum examples are developed in Heunen and Vicary.
A functor assigns to each object of an object of and to each morphism a morphism such that and . A contravariant functor is a functor , reversing the direction of morphisms. For a fixed object , the Hom functor sends to the set and to the function .
Given functors , a natural transformation is a family of morphisms of , one for each object of , such that for every
It is a natural isomorphism if every is an isomorphism. Two categories are equivalent if there are functors and with and naturally isomorphic to the identity functors.
Example: on finite-dimensional vector spaces, the map , , is a natural isomorphism from the identity functor to the double-dual functor, while an isomorphism requires choosing a basis or an inner product and is not natural in this sense. Definitions as in chapters I–II of Mac Lane.
Monoidal structure and string diagrams
A monoidal category is a category with
- a functor , so that (the interchange law) and ;
- a unit object ;
- natural isomorphisms , and ,
satisfying Mac Lane's pentagon equation for and the triangle equation relating , and . By Mac Lane's coherence theorem every diagram built from these isomorphisms commutes, so they can be suppressed; the category is strict when they are identities. A symmetric monoidal category has in addition a natural isomorphism with , compatible with (hexagon equation). Morphisms are scalars; morphisms are states and effects.
String diagrams. A morphism is drawn as a box with input wires and output wires; stacks on ; places them side by side; the unit is drawn as no wire; is a crossing of two wires. The interchange law becomes the statement that boxes on separate wires can slide past each other. In the string diagram of a quantum circuit is the circuit diagram itself, with time running along the wires.
Standard references: chapter VII of Mac Lane for the axioms and coherence; Joyal and Street for the geometric justification of string diagrams; Selinger for a survey of the many variants.
A dagger on a category is a contravariant functor that is the identity on objects and involutive: each has with , and . A morphism is unitary if .
A symmetric monoidal category is compact closed if every object has a dual object with morphisms (the cup) and (the cap) satisfying the snake equations
with associators and unitors suppressed. In string diagrams these say that a wire bent into an S shape can be pulled straight. A dagger compact category is a symmetric monoidal category with a dagger such that , the associators, unitors and swap are unitary, and every object has a cup and a cap with — the cap is the dagger of the cup, read in the other order.
In , the dagger is the Hermitian adjoint, is the dual space (identified with via a chosen basis when convenient), the cup is the unnormalised maximally entangled state and the cap is . Bending a wire turns a map into its transpose, and the snake equations are the algebraic core of teleportation: Abramsky and Coecke used this structure to give an abstract account of teleportation and entanglement swapping. The axioms in the form above follow Selinger, who also showed that the completely positive maps form a dagger compact category built from any dagger compact category; the coherence theory of compact closed categories goes back to Kelly and Laplaza. A textbook account is Heunen and Vicary.
Theorems
For every object of the map
is a bijection. Its inverse sends to the transformation with components for . The bijection is natural in both and .
Taking shows that natural transformations are exactly the maps "precompose with some ", so if and only if the functors and are naturally isomorphic: an object is determined, up to unique isomorphism compatible with this identification, by how it maps to everything else. The dual statement uses . This is the principle behind specifying a quantum system by its operational behaviour — by all the ways it can be prepared or tested — rather than by its internal description. Statement and proof: section III.2 of Mac Lane.
- is a locally small category (each is a set) and is a functor.
Proof · Proof of the Yoneda lemma
Write , so is . Let and, for , with .
is natural. For and ,
using that preserves composition.
. , since preserves identities.
. Let be natural and . For , naturality at applied to gives
because . Hence .
Corollary on objects. For , the element of corresponding to is some , and . Composition of such transformations corresponds to composition of the 's in reverse order, and identity to identity, so a natural isomorphism corresponds to mutually inverse morphisms between and .
Naturality of the bijection in and is a routine check of the same kind; see section III.2 of Mac Lane.
For (planar) monoidal categories: a well-typed equation between such terms follows from the axioms of a monoidal category if and only if the two string diagrams are related by a planar deformation that keeps the boxes and wire endpoints in order (an isotopy fixing the boundary). For symmetric monoidal categories the same holds with wires allowed to cross and pass through each other in three dimensions; for compact closed categories, wires may in addition bend up and down, cups and caps being turning points.
The planar and symmetric cases are due to Joyal and Street; coherence for compact closed categories goes back to Kelly and Laplaza, who proved it for diagrams over a simple signature (the fully general graphical statement is not proved in the literature surveyed by Selinger). Selinger surveys the precise statements for many variants (braided, traced, pivotal, dagger), noting which are proved in full and which only in special cases. Coherence concerns equations valid in every category of the kind; a specific model such as qubits in satisfies many more equations, which is why calculi such as the ZX-calculus add rewrite rules on top of the topological moves.
- Morphisms are terms built from generating boxes, identities, composition and tensor product (and, in the variants, swaps, cups, caps and daggers); the equations considered are those valid in all categories of the given kind, not in one particular model.
Let the cup be and the cap be . Then:
- Snake equations. and as maps .
- Transpose trick. For every linear map , .
- Dagger compactness. , and for the swap ; with the Hermitian adjoint as dagger, is a dagger compact category.
With the normalised Bell state , item 1 says that projecting systems 1 and 2 of onto leaves on system 3, with probability amplitude : the postselected branch of teleportation. The other outcomes differ by a Pauli (or Weyl–Heisenberg) operator on the cap, which by item 2 moves through the wire as a transposed correction on the output. This is the abstract analysis of Abramsky and Coecke; the axiomatics are those of Selinger, and diagrammatic treatments are in Coecke and Kissinger.
- with a fixed orthonormal basis , used to identify with its dual; (not normalised); transpose is taken in this basis.
Proof · Proof that finite-dimensional Hilbert spaces form a dagger compact category
Snake equations. By linearity it suffices to evaluate on a basis vector :
The second equation is the same computation with the roles of the first and third tensor factors exchanged: .
Transpose trick. With ,
and , so the two vectors are equal.
Dagger compactness. The Hermitian adjoint reverses composition, fixes identities, is involutive and satisfies ; it is the identity on objects. The swap is unitary, and with the standard identifications and the associators and unitors are identities, hence unitary. The cap is the adjoint of the cup by definition, , and because is symmetric, so as the axiom requires (here is identified with through the basis). Together with item 1 this verifies the axioms of a dagger compact category as stated by Selinger.
A dagger-Frobenius monoid on an object is a monoid whose adjoint comonoid satisfies the Frobenius law .
Theorem (Coecke, Pavlovic and Vicary). Every orthogonal basis of a finite-dimensional Hilbert space defines a commutative dagger-Frobenius monoid, and every commutative dagger-Frobenius monoid in arises in this way from an orthogonal basis. The basis is orthonormal exactly when the monoid is special, and then the comultiplication copies and the counit deletes the basis vectors :
For the computational basis of a qubit, is the map and composites of , , , are the phase-free Z spiders of the ZX-calculus; the Hadamard basis gives the X spiders. A pair of such structures for mutually unbiased bases, and the laws relating them, is the starting point of Coecke and Duncan. The proof is not reproduced here. A textbook treatment is in Heunen and Vicary.
- Frobenius monoids are taken in with the Hermitian adjoint as dagger; "special" means that multiplication composed with comultiplication is the identity.
Worked Examples
Teleporting a qubit by straightening a wire
Let and . Then
Apply the cap on systems 1 and 2: the term contributes (from ), contributes nothing ( is orthogonal to both and ), contributes nothing, and contributes . The result is on system 3, which is the first snake equation. With normalised Bell states the same branch has amplitude , i.e. probability ; the other three Bell outcomes are the cap preceded by , or on system 1, and by the transpose trick these slide onto system 3, where the usual Pauli correction undoes them — see quantum teleportation.
A functor that forgets global phases
Define on by $F A = $ the operators on and, for a linear map , . Then and , so is a functor from pure-state processes to completely positive maps. It is not injective on morphisms: for unitary and any real , . The functor identifies exactly the processes that no experiment can distinguish, which is the categorical version of "global phases are unobservable". Selinger generalises this to a construction that applies to any dagger compact category.
The copy map does not clone
For the computational basis of a qubit the special commutative dagger-Frobenius structure has comultiplication . It copies and , but on it gives
the overlap being . A linear map can copy the vectors of one orthonormal basis but no more, which is the no-cloning theorem seen from the categorical side: the Frobenius structure is the choice of which basis is "classical".
Applications
- The ZX-calculus. Spiders are the Frobenius structures of the Z and X bases, and the calculus is a dagger compact category presented by generators and rewrite rules (Coecke and Duncan); see ZX-calculus, ZX diagrams and spider fusion.
- Protocols. Teleportation, gate teleportation and entanglement swapping are consequences of the snake equations (Abramsky and Coecke); compare the circuit-level descriptions under quantum communication.
- Mixed states and channels. Completely positive maps form a dagger compact category in their own right (Selinger), so the same diagrams describe quantum channels.
- Tensor networks. The graphical notation of tensor networks is the string-diagram calculus of with chosen bases.
Limitations and Common Pitfalls
- Coherence is about all models at once. Diagram deformation proves only equations true in every monoidal (or compact) category. Equations specific to qubits need extra rules, and completeness of such rule sets is a separate theorem for each calculus.
- Duals are not canonical in without a basis. Identifying with , and hence the cup with , depends on a basis, and the transpose in the transpose trick is taken in that basis; the basis-independent statement uses the dual space and the conjugate.
- Normalisation. The cup has norm ; snake equations hold exactly for this unnormalised vector, and physical protocols carry the factors as probabilities of postselected branches.
- Direction conventions. Some texts read diagrams bottom-to-top, others left-to-right; some put the dual on the left of , others on the right. Check before transcribing equations between sources.
- Abstraction has a cost. The categorical formulation explains why protocols work and supports automated rewriting, but it does not by itself provide new complexity bounds or numerical methods.
Related Research
Group theory supplies the symmetry structures that appear as phase groups of spiders, the ZX-calculus develops the graphical rewriting in detail, and topology and homology shares with this topic the idea that only the shape of a diagram, not its embedding, carries information.