Skip to main content
KetQat

Appearance

Topic · advanced

Category Theory

Categories, functors and natural transformations, monoidal and dagger compact categories and their string diagrams - the part of category theory that categorical quantum mechanics and the ZX-calculus are built on, with teleportation and basis copying as worked examples.

ExpositionMachine-checkedUpdated 2026-12-01 · last verified 2026-12-01

AI-assisted text, machine-checked, not yet reviewed by a person. Citations resolve and an automated pass compared the statements with the cited sources. That is not peer review; check the sources for anything you depend on.

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

DefinitionCategoryEstablished definition

A category C\mathbf{C} consists of

  • a collection of objects A,B,C,…A, B, C, \dots;
  • for every pair of objects a collection C(A,B)\mathbf{C}(A, B) of morphisms f:A→Bf : A \to B;
  • for every f:A→Bf : A \to B and g:B→Cg : B \to C a composite g∘f:A→Cg \circ f : A \to C;
  • for every object an identity idA:A→A\mathrm{id}_A : A \to A,

such that composition is associative, h∘(g∘f)=(h∘g)∘fh \circ (g \circ f) = (h \circ g) \circ f, and unital, f∘idA=f=idB∘ff \circ \mathrm{id}_A = f = \mathrm{id}_B \circ f, for all composable f,g,hf, g, h. A morphism f:A→Bf : A \to B is an isomorphism if some g:B→Ag : B \to A has g∘f=idAg \circ f = \mathrm{id}_A and f∘g=idBf \circ g = \mathrm{id}_B. The opposite category Cop\mathbf{C}^{\mathrm{op}} has the same objects and a morphism B→AB \to A for each f:A→Bf : A \to B, composed in the reverse order.

Examples:

  • Set\mathbf{Set}: sets and functions.
  • FdHilb\mathbf{FdHilb}: 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.
  • CPM\mathbf{CPM}: finite-dimensional Hilbert spaces with completely positive maps between their operator spaces; quantum channels are the trace-preserving morphisms.
  • Rel\mathbf{Rel}: 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.

DefinitionFunctor and natural transformationEstablished definition

A functor F:C→DF : \mathbf{C} \to \mathbf{D} assigns to each object AA of C\mathbf{C} an object FAF A of D\mathbf{D} and to each morphism f:A→Bf : A \to B a morphism Ff:FA→FBF f : F A \to F B such that F(g∘f)=Fg∘FfF(g \circ f) = F g \circ F f and F(idA)=idFAF(\mathrm{id}_A) = \mathrm{id}_{F A}. A contravariant functor is a functor Cop→D\mathbf{C}^{\mathrm{op}} \to \mathbf{D}, reversing the direction of morphisms. For a fixed object AA, the Hom functor C(A,−)\mathbf{C}(A, -) sends BB to the set C(A,B)\mathbf{C}(A, B) and g:B→B′g : B \to B' to the function f↦g∘ff \mapsto g \circ f.

Given functors F,G:C→DF, G : \mathbf{C} \to \mathbf{D}, a natural transformation α:F⇒G\alpha : F \Rightarrow G is a family of morphisms αA:FA→GA\alpha_A : F A \to G A of D\mathbf{D}, one for each object AA of C\mathbf{C}, such that for every f:A→Bf : A \to B

Gf∘αA  =  αB∘Ff(naturality).G f \circ \alpha_A \;=\; \alpha_B \circ F f \qquad \text{(naturality)} .

It is a natural isomorphism if every αA\alpha_A is an isomorphism. Two categories are equivalent if there are functors F:C→DF : \mathbf{C} \to \mathbf{D} and G:D→CG : \mathbf{D} \to \mathbf{C} with GFG F and FGF G naturally isomorphic to the identity functors.

Example: on finite-dimensional vector spaces, the map V→V∗∗V \to V^{**}, v↦(ϕ↦ϕ(v))v \mapsto (\phi \mapsto \phi(v)), is a natural isomorphism from the identity functor to the double-dual functor, while an isomorphism V≅V∗V \cong V^{*} 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

DefinitionMonoidal category and string diagramsEstablished definition

A monoidal category is a category C\mathbf{C} with

  • a functor ⊗:C×C→C\otimes : \mathbf{C} \times \mathbf{C} \to \mathbf{C}, so that (g⊗g′)∘(f⊗f′)=(g∘f)⊗(g′∘f′)(g \otimes g') \circ (f \otimes f') = (g \circ f) \otimes (g' \circ f') (the interchange law) and idA⊗idB=idA⊗B\mathrm{id}_A \otimes \mathrm{id}_B = \mathrm{id}_{A \otimes B};
  • a unit object II;
  • natural isomorphisms αA,B,C:(A⊗B)⊗C→A⊗(B⊗C)\alpha_{A,B,C} : (A \otimes B) \otimes C \to A \otimes (B \otimes C), λA:I⊗A→A\lambda_A : I \otimes A \to A and ρA:A⊗I→A\rho_A : A \otimes I \to A,

satisfying Mac Lane's pentagon equation for α\alpha and the triangle equation relating α\alpha, λ\lambda and ρ\rho. 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 σA,B:A⊗B→B⊗A\sigma_{A,B} : A \otimes B \to B \otimes A with σB,A∘σA,B=id\sigma_{B,A} \circ \sigma_{A,B} = \mathrm{id}, compatible with α\alpha (hexagon equation). Morphisms I→II \to I are scalars; morphisms I→AI \to A are states and A→IA \to I effects.

String diagrams. A morphism f:A1⊗⋯⊗Am→B1⊗⋯⊗Bnf : A_1 \otimes \cdots \otimes A_m \to B_1 \otimes \cdots \otimes B_n is drawn as a box with mm input wires and nn output wires; g∘fg \circ f stacks gg on ff; f⊗f′f \otimes f' places them side by side; the unit II is drawn as no wire; σ\sigma is a crossing of two wires. The interchange law becomes the statement that boxes on separate wires can slide past each other. In (FdHilb,⊗,C)(\mathbf{FdHilb}, \otimes, \C) 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.

DefinitionDagger compact categoryEstablished definition

A dagger on a category is a contravariant functor †\dagger that is the identity on objects and involutive: each f:A→Bf : A \to B has f†:B→Af\dagg : B \to A with (g∘f)†=f†∘g†(g \circ f)\dagg = f\dagg \circ g\dagg, idA†=idA\mathrm{id}_A\dagg = \mathrm{id}_A and f††=ff^{\dagger\dagger} = f. A morphism is unitary if f†=f−1f\dagg = f^{-1}.

A symmetric monoidal category is compact closed if every object AA has a dual object A∗A^{*} with morphisms ηA:I→A∗⊗A\eta_A : I \to A^{*} \otimes A (the cup) and εA:A⊗A∗→I\varepsilon_A : A \otimes A^{*} \to I (the cap) satisfying the snake equations

(εA⊗idA)∘(idA⊗ηA)=idA,(idA∗⊗εA)∘(ηA⊗idA∗)=idA∗,(\varepsilon_A \otimes \mathrm{id}_A) \circ (\mathrm{id}_A \otimes \eta_A) = \mathrm{id}_A, \qquad (\mathrm{id}_{A^{*}} \otimes \varepsilon_A) \circ (\eta_A \otimes \mathrm{id}_{A^{*}}) = \mathrm{id}_{A^{*}},

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 (f⊗g)†=f†⊗g†(f \otimes g)\dagg = f\dagg \otimes g\dagg, the associators, unitors and swap are unitary, and every object has a cup and a cap with εA=ηA†∘σA,A∗\varepsilon_A = \eta_A\dagg \circ \sigma_{A, A^{*}} — the cap is the dagger of the cup, read in the other order.

In FdHilb\mathbf{FdHilb}, the dagger is the Hermitian adjoint, A∗A^{*} is the dual space (identified with AA via a chosen basis {∣i⟩}\{\ket{i}\} when convenient), the cup is the unnormalised maximally entangled state ∑i∣i⟩∣i⟩\sum_i \ket{i}\ket{i} and the cap is ∑i⟨i∣⟨i∣\sum_i \bra{i}\bra{i}. 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

TheoremYoneda lemmaEstablished result

For every object AA of C\mathbf{C} the map

Nat(C(A,−), F)  ⟶  FA,α⟼αA(idA)\mathrm{Nat}\big(\mathbf{C}(A, -),\, F\big) \;\longrightarrow\; F A, \qquad \alpha \longmapsto \alpha_A(\mathrm{id}_A)

is a bijection. Its inverse sends x∈FAx \in F A to the transformation with components αBx(f)=(Ff)(x)\alpha^{x}_B(f) = (F f)(x) for f:A→Bf : A \to B. The bijection is natural in both AA and FF.

Taking F=C(A′,−)F = \mathbf{C}(A', -) shows that natural transformations C(A,−)⇒C(A′,−)\mathbf{C}(A, -) \Rightarrow \mathbf{C}(A', -) are exactly the maps "precompose with some g:A′→Ag : A' \to A", so A≅A′A \cong A' if and only if the functors C(A,−)\mathbf{C}(A, -) and C(A′,−)\mathbf{C}(A', -) 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 C(−,A)\mathbf{C}(-, A). 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.

Holds when
  • C\mathbf{C} is a locally small category (each C(A,B)\mathbf{C}(A, B) is a set) and F:C→SetF : \mathbf{C} \to \mathbf{Set} is a functor.
Proof · Proof of the Yoneda lemma

Write hA=C(A,−)h^{A} = \mathbf{C}(A, -), so hAgh^{A} g is f↦g∘ff \mapsto g \circ f. Let Θ(α)=αA(idA)\Theta(\alpha) = \alpha_A(\mathrm{id}_A) and, for x∈FAx \in FA, Ψ(x)=αx\Psi(x) = \alpha^{x} with αBx(f)=(Ff)(x)\alpha^{x}_B(f) = (F f)(x).

Ψ(x)\Psi(x) is natural. For g:B→B′g : B \to B' and f:A→Bf : A \to B,

(αB′x∘hAg)(f)=F(g∘f)(x)=(Fg)((Ff)(x))=(Fg∘αBx)(f),\big(\alpha^{x}_{B'} \circ h^{A} g\big)(f) = F(g \circ f)(x) = (F g)\big((F f)(x)\big) = \big(F g \circ \alpha^{x}_{B}\big)(f),

using that FF preserves composition.

Θ∘Ψ=id\Theta \circ \Psi = \mathrm{id}. Θ(αx)=(FidA)(x)=x\Theta(\alpha^{x}) = (F \mathrm{id}_A)(x) = x, since FF preserves identities.

Ψ∘Θ=id\Psi \circ \Theta = \mathrm{id}. Let α\alpha be natural and x=αA(idA)x = \alpha_A(\mathrm{id}_A). For f:A→Bf : A \to B, naturality at ff applied to idA\mathrm{id}_A gives

αB(f)=αB(hAf (idA))=(Ff)(αA(idA))=(Ff)(x)=αBx(f),\alpha_B(f) = \alpha_B\big(h^{A} f\,(\mathrm{id}_A)\big) = (F f)\big(\alpha_A(\mathrm{id}_A)\big) = (F f)(x) = \alpha^{x}_B(f),

because hAf(idA)=f∘idA=fh^{A} f(\mathrm{id}_A) = f \circ \mathrm{id}_A = f. Hence α=αx\alpha = \alpha^{x}.

Corollary on objects. For F=hA′F = h^{A'}, the element of hA′A=C(A′,A)h^{A'}A = \mathbf{C}(A', A) corresponding to α\alpha is some g:A′→Ag : A' \to A, and αB(f)=f∘g\alpha_B(f) = f \circ g. Composition of such transformations corresponds to composition of the gg's in reverse order, and identity to identity, so a natural isomorphism hA≅hA′h^{A} \cong h^{A'} corresponds to mutually inverse morphisms between AA and A′A'.

Naturality of the bijection in AA and FF is a routine check of the same kind; see section III.2 of Mac Lane.

TheoremCoherence of string diagrams for monoidal categoriesEstablished result

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 FdHilb\mathbf{FdHilb} satisfies many more equations, which is why calculi such as the ZX-calculus add rewrite rules on top of the topological moves.

Holds when
  • 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.
TheoremFinite-dimensional Hilbert spaces form a dagger compact categoryEstablished result

Let the cup be η=∣Ω⟩:C→A⊗A\eta = \ket{\Omega} : \C \to A \otimes A and the cap be ε=⟨Ω∣:A⊗A→C\varepsilon = \bra{\Omega} : A \otimes A \to \C. Then:

  1. Snake equations. (⟨Ω∣⊗I)(I⊗∣Ω⟩)=I(\bra{\Omega} \otimes I)(I \otimes \ket{\Omega}) = I and (I⊗⟨Ω∣)(∣Ω⟩⊗I)=I(I \otimes \bra{\Omega})(\ket{\Omega} \otimes I) = I as maps A→AA \to A.
  2. Transpose trick. For every linear map f:A→Af : A \to A, (I⊗f)∣Ω⟩=(fT⊗I)∣Ω⟩(I \otimes f)\ket{\Omega} = (f^{T} \otimes I)\ket{\Omega}.
  3. Dagger compactness. ε=η†\varepsilon = \eta\dagg, and η=σ∘η\eta = \sigma \circ \eta for the swap σ\sigma; with the Hermitian adjoint as dagger, (FdHilb,⊗,C)(\mathbf{FdHilb}, \otimes, \C) is a dagger compact category.

With the normalised Bell state ∣Φ+⟩=∣Ω⟩/d\ket{\Phi^{+}} = \ket{\Omega}/\sqrt{d}, item 1 says that projecting systems 1 and 2 of ∣ψ⟩1∣Φ+⟩23\ket{\psi}_1 \ket{\Phi^{+}}_{23} onto ∣Φ+⟩12\ket{\Phi^{+}}_{12} leaves ∣ψ⟩\ket{\psi} on system 3, with probability amplitude 1/d1/d: the postselected branch of teleportation. The other outcomes differ by a Pauli (or Weyl–Heisenberg) operator UU 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.

Holds when
  • A=CdA = \C^{d} with a fixed orthonormal basis {∣i⟩}i=1d\{\ket{i}\}_{i=1}^{d}, used to identify AA with its dual; ∣Ω⟩=∑i∣i⟩∣i⟩∈A⊗A\ket{\Omega} = \sum_{i} \ket{i}\ket{i} \in A \otimes A (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 ∣k⟩\ket{k}:

(⟨Ω∣⊗I)(I⊗∣Ω⟩)∣k⟩=(⟨Ω∣⊗I)∑j∣k⟩∣j⟩∣j⟩=∑i,j⟨i∣k⟩⟨i∣j⟩ ∣j⟩=∑jδjk∣j⟩=∣k⟩.(\bra{\Omega} \otimes I)(I \otimes \ket{\Omega})\ket{k} = (\bra{\Omega} \otimes I) \sum_{j} \ket{k}\ket{j}\ket{j} = \sum_{i, j} \braket{i}{k}\braket{i}{j}\, \ket{j} = \sum_{j} \delta_{jk} \ket{j} = \ket{k} .

The second equation is the same computation with the roles of the first and third tensor factors exchanged: (I⊗⟨Ω∣)(∣Ω⟩⊗I)∣k⟩=∑i,j∣j⟩⟨j∣i⟩⟨i∣k⟩=∣k⟩(I \otimes \bra{\Omega})(\ket{\Omega} \otimes I)\ket{k} = \sum_{i,j} \ket{j}\braket{j}{i}\braket{i}{k} = \ket{k}.

Transpose trick. With fji=⟨j∣f∣i⟩f_{ji} = \bra{j} f \ket{i},

(I⊗f)∣Ω⟩=∑i∣i⟩⊗f∣i⟩=∑i,jfji ∣i⟩∣j⟩,(fT⊗I)∣Ω⟩=∑jfT∣j⟩⊗∣j⟩=∑i,j(fT)ij ∣i⟩∣j⟩,(I \otimes f)\ket{\Omega} = \sum_{i} \ket{i} \otimes f\ket{i} = \sum_{i, j} f_{ji}\, \ket{i}\ket{j}, \qquad (f^{T} \otimes I)\ket{\Omega} = \sum_{j} f^{T}\ket{j} \otimes \ket{j} = \sum_{i, j} (f^{T})_{ij}\, \ket{i}\ket{j} ,

and (fT)ij=fji(f^{T})_{ij} = f_{ji}, so the two vectors are equal.

Dagger compactness. The Hermitian adjoint reverses composition, fixes identities, is involutive and satisfies (f⊗g)†=f†⊗g†(f \otimes g)\dagg = f\dagg \otimes g\dagg; it is the identity on objects. The swap σ(∣a⟩∣b⟩)=∣b⟩∣a⟩\sigma(\ket{a}\ket{b}) = \ket{b}\ket{a} is unitary, and with the standard identifications (A⊗B)⊗C=A⊗(B⊗C)(A \otimes B) \otimes C = A \otimes (B \otimes C) and C⊗A=A\C \otimes A = A the associators and unitors are identities, hence unitary. The cap is the adjoint of the cup by definition, ε=⟨Ω∣=∣Ω⟩†\varepsilon = \bra{\Omega} = \ket{\Omega}\dagg, and σ∣Ω⟩=∣Ω⟩\sigma\ket{\Omega} = \ket{\Omega} because ∣Ω⟩\ket{\Omega} is symmetric, so ε=η†∘σ\varepsilon = \eta\dagg \circ \sigma as the axiom requires (here A∗A^{*} is identified with AA through the basis). Together with item 1 this verifies the axioms of a dagger compact category as stated by Selinger.

TheoremCommutative dagger-Frobenius algebras are orthogonal basesPeer-reviewed result

A dagger-Frobenius monoid on an object AA is a monoid (μ:A⊗A→A, u:I→A)(\mu : A \otimes A \to A,\ u : I \to A) whose adjoint comonoid (δ=μ†, e=u†)(\delta = \mu\dagg,\ e = u\dagg) satisfies the Frobenius law (id⊗μ)(δ⊗id)=δμ=(μ⊗id)(id⊗δ)(\mathrm{id} \otimes \mu)(\delta \otimes \mathrm{id}) = \delta\mu = (\mu \otimes \mathrm{id})(\mathrm{id} \otimes \delta).

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 FdHilb\mathbf{FdHilb} 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 ∣ei⟩\ket{e_i}:

δ∣ei⟩=∣ei⟩⊗∣ei⟩,e∣ei⟩=1.\delta\ket{e_i} = \ket{e_i} \otimes \ket{e_i}, \qquad e\ket{e_i} = 1 .

For the computational basis of a qubit, δ\delta is the map ∣i⟩↦∣i⟩∣i⟩\ket{i} \mapsto \ket{i}\ket{i} and composites of μ\mu, δ\delta, uu, ee 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.

Holds when
  • Frobenius monoids are taken in (FdHilb,⊗,C)(\mathbf{FdHilb}, \otimes, \C) 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 ∣ψ⟩=a∣0⟩+b∣1⟩\ket{\psi} = a\ket{0} + b\ket{1} and ∣Ω⟩=∣00⟩+∣11⟩\ket{\Omega} = \ket{00} + \ket{11}. Then

∣ψ⟩1∣Ω⟩23=a∣000⟩+a∣011⟩+b∣100⟩+b∣111⟩.\ket{\psi}_1 \ket{\Omega}_{23} = a\ket{000} + a\ket{011} + b\ket{100} + b\ket{111} .

Apply the cap ⟨Ω∣12=⟨00∣+⟨11∣\bra{\Omega}_{12} = \bra{00} + \bra{11} on systems 1 and 2: the term a∣000⟩a\ket{000} contributes a∣0⟩3a\ket{0}_3 (from ⟨00∣\bra{00}), a∣011⟩a\ket{011} contributes nothing (∣01⟩\ket{01} is orthogonal to both ∣00⟩\ket{00} and ∣11⟩\ket{11}), b∣100⟩b\ket{100} contributes nothing, and b∣111⟩b\ket{111} contributes b∣1⟩3b\ket{1}_3. The result is a∣0⟩+b∣1⟩=∣ψ⟩a\ket{0} + b\ket{1} = \ket{\psi} on system 3, which is the first snake equation. With normalised Bell states the same branch has amplitude 1/21/2, i.e. probability 1/41/4; the other three Bell outcomes are the cap preceded by XX, ZZ or XZXZ 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 FF on FdHilb\mathbf{FdHilb} by $F A = $ the operators on AA and, for a linear map ff, Ff(ρ)=fρf†F f (\rho) = f \rho f\dagg. Then F(g∘f)(ρ)=gfρf†g†=(Fg∘Ff)(ρ)F(g \circ f)(\rho) = g f \rho f\dagg g\dagg = (F g \circ F f)(\rho) and F(id)=idF(\mathrm{id}) = \mathrm{id}, so FF is a functor from pure-state processes to completely positive maps. It is not injective on morphisms: for UU unitary and any real θ\theta, F(eiθU)(ρ)=UρU†=F(U)(ρ)F(e^{i\theta} U)(\rho) = U\rho U\dagg = F(U)(\rho). 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 δ∣i⟩=∣i⟩∣i⟩\delta \ket{i} = \ket{i}\ket{i}. It copies ∣0⟩\ket{0} and ∣1⟩\ket{1}, but on ∣+⟩=(∣0⟩+∣1⟩)/2\ket{+} = (\ket{0} + \ket{1})/\sqrt2 it gives

δ∣+⟩=12(∣00⟩+∣11⟩)  ≠  ∣+⟩∣+⟩=12(∣00⟩+∣01⟩+∣10⟩+∣11⟩),\delta\ket{+} = \tfrac{1}{\sqrt2}(\ket{00} + \ket{11}) \;\ne\; \ket{+}\ket{+} = \tfrac12(\ket{00} + \ket{01} + \ket{10} + \ket{11}),

the overlap being ⟨+∣⟨+∣ δ∣+⟩=12⋅12⋅2=12\bra{+}\bra{+}\,\delta\ket{+} = \tfrac{1}{\sqrt2}\cdot\tfrac12 \cdot 2 = \tfrac{1}{\sqrt2}. 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 FdHilb\mathbf{FdHilb} 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 FdHilb\mathbf{FdHilb} without a basis. Identifying A∗A^{*} with AA, and hence the cup with ∑i∣i⟩∣i⟩\sum_i \ket{i}\ket{i}, 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 ∑i∣i⟩∣i⟩\sum_i \ket{i}\ket{i} has norm d\sqrt d; snake equations hold exactly for this unnormalised vector, and physical protocols carry the factors 1/d1/d 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 η:I→A∗⊗A\eta : I \to A^{*} \otimes A, 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.

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.

Open in the knowledge graph

Contributions about this record

Nobody has published a contribution about it yet.

Publish a result, reproduction or commentPropose a correction to this page

References

  1. Saunders Mac Lane (1978). Categories for the Working Mathematician. Springer New York (Graduate Texts in Mathematics 5). doi:10.1007/978-1-4757-4721-8
  2. André Joyal, Ross Street (1991). The geometry of tensor calculus, I. Advances in Mathematics 88 (1), 55-112. doi:10.1016/0001-8708(91)90003-P
  3. G. M. Kelly, M. L. Laplaza (1980). Coherence for compact closed categories. Journal of Pure and Applied Algebra 19, 193-213. doi:10.1016/0022-4049(80)90101-2
  4. Samson Abramsky, Bob Coecke (2004). A categorical semantics of quantum protocols. Proceedings of the 19th Annual IEEE Symposium on Logic in Computer Science, 415-425. doi:10.1109/LICS.2004.1319636arXiv:quant-ph/0402130
  5. Peter Selinger (2007). Dagger Compact Closed Categories and Completely Positive Maps. Electronic Notes in Theoretical Computer Science 170, 139-163. doi:10.1016/j.entcs.2006.12.018
  6. Peter Selinger (2010). A Survey of Graphical Languages for Monoidal Categories. New Structures for Physics, Lecture Notes in Physics 813, 289-355 (Springer). doi:10.1007/978-3-642-12821-9_4arXiv:0908.3347
  7. Bob Coecke, Dusko Pavlovic, Jamie Vicary (2013). A new description of orthogonal bases. Mathematical Structures in Computer Science 23 (3), 555-567. doi:10.1017/S0960129512000047arXiv:0810.0812
  8. Bob Coecke, Ross Duncan (2011). Interacting quantum observables: categorical algebra and diagrammatics. New Journal of Physics 13, 043016. doi:10.1088/1367-2630/13/4/043016arXiv:0906.4725
  9. Bob Coecke, Aleks Kissinger (2017). Picturing Quantum Processes. Cambridge University Press. doi:10.1017/9781316219317
  10. Chris Heunen, Jamie Vicary (2019). Categories for Quantum Theory. Oxford University Press. doi:10.1093/oso/9780198739623.001.0001

Contributors

  • KetQat maintainers · @ketqatConceptualization; Supervision (CRediT roles)
  • Claude (AI drafting assistant)Writing, original draft (CRediT roles)

Review history

  1. Automated source check · Pass with notes · 2026-12-01 · Independent automated verification pass (AI, not the drafting session)

    Topic body only (embedded records carry their own review states). Re-derived the worked examples: teleportation by applying the cap to |psi>|Omega> (result a|0> + b|1>, normalised amplitude 1/2, probability 1/4, Pauli branches via the transpose trick); the functor f -> f rho f^dag (functoriality, identifies exactly maps equal up to a global phase); the copy map on |+> (overlap 1/sqrt2) and that a linear map copies only mutually orthogonal vectors. Overview compared with the Abramsky-Coecke arXiv:quant-ph/0402130 abstract; CPM, coherence and Frobenius statements compared with Selinger 2007 (author-hosted PDF), Selinger arXiv:0908.3347 and Coecke-Pavlovic-Vicary arXiv:0810.0812. Crossref metadata of all cited references match.

    The overview said a dagger and cups and caps alone already capture the Born rule; in Abramsky and Coecke the scalars and Born rule come from compact closure together with biproducts (abstract of arXiv:quant-ph/0402130). Added 'together with biproducts for classical branching'.

Revision history

  1. 2026-12-01Content release 2.1.0: 35 more topics, an independent source check of every record, intake hardening (#17)80537b7e

Current revision 8e62a1a1a3359dee. Source file knowledge/records/topic/category-theory.md in the content repository (readable there once it is public).