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.