# Dagger compact category

In category theory, a branch of mathematics, dagger compact categories (or dagger compact closed categories) first appeared in 1989 in the work of Sergio Doplicher and John E. Roberts on the reconstruction of compact topological groups from their category of finite-dimensional continuous unitary representations (that is, Tannakian categories). They also appeared in the work of John Baez and James Dolan as an instance of semistrict k-tuply monoidal n-categories, which describe general topological quantum field theories, for n = 1 and k = 3. They are a fundamental structure in Samson Abramsky and Bob Coecke's categorical quantum mechanics.

## Overview

Dagger compact categories can be used to express and verify some fundamental quantum information protocols, namely: teleportation, logic gate teleportation and entanglement swapping, and standard notions such as unitarity, inner-product, trace, Choi–Jamiolkowsky duality, complete positivity, Bell states and many other notions are captured by the language of dagger compact categories. All this follows from the completeness theorem, below. Categorical quantum mechanics takes dagger compact categories as a background structure relative to which other quantum mechanical notions like quantum observables and complementarity thereof can be abstractly defined. This forms the basis for a high-level approach to quantum information processing.

## Formal definition

A dagger compact category is a dagger symmetric monoidal category $\mathbf {C}$ which is also compact closed, together with a relation to tie together the dagger structure to the compact structure. Specifically, the dagger is used to connect the unit to the counit, so that, for all $A$ in $\mathbf {C}$, the following diagram commutes:
To summarize all of these points:
* A category is closed if it has an internal hom functor; that is, if the hom-set of morphisms between two objects of the category is an object of the category itself (rather than of Set).
* A category is monoidal if it is equipped with an associative bifunctor $\mathbf {C} \otimes \mathbf {C} \to \mathbf {C}$ that is associative, natural and has left and right identities obeying certain coherence conditions.
* A monoidal category is symmetric monoidal, if, for every pair A, B of objects in C, there is an isomorphism $\sigma _{A,B}:A\otimes B\simeq B\otimes A$ that is natural in both A and B, and, again, obeys certain coherence conditions (see symmetric monoidal category for details).
* A monoidal category is compact closed, if every object $A\in \mathbf {C}$ has a dual object $A^{*}$. Categories with dual objects are equipped with two morphisms, the unit $\eta _{A}:I\to A^{*}\otimes A$ and the counit $\varepsilon _{A}:A\otimes A^{*}\to I$, which satisfy certain coherence or yanking conditions.
* A category is a dagger category if it is equipped with an involutive functor $\dagger \colon \mathbf {C} ^{op}\rightarrow \mathbf {C}$ that is the identity on objects, but maps morphisms to their adjoints.
* A monoidal category is dagger symmetric if it is a dagger category and is symmetric, and has coherence conditions that make the various functors natural.
A dagger compact category is then a category that is each of the above, and, in addition, has a condition to relate the dagger structure to the compact structure. This is done by relating the unit to the counit via the dagger:
    $\sigma _{A,A^{*}}\circ \varepsilon _{A}^{\dagger }=\eta _{A}$
shown in the commuting diagram above. In the category FdHilb of finite-dimensional Hilbert spaces, this last condition can be understood as defining the dagger (the Hermitian conjugate) as the transpose of the complex conjugate.

## Examples

The following categories are dagger compact.
* The category FdHilb of finite dimensional Hilbert spaces and linear maps. The morphisms are linear operators between Hilbert spaces. The product is the usual tensor product, and the dagger here is the Hermitian conjugate.
* The category Rel of Sets and relations. The product is, of course, the Cartesian product. The dagger here is just the opposite.
* The category of finitely generated projective modules over a commutative ring. The dagger here is just the matrix transpose.
* The category n-Cob of cobordisms. Here, the n-dimensional cobordisms are the morphisms, the disjoint union is the tensor, and the reversal of the objects (closed manifolds) is the dagger. A topological quantum field theory can be defined as a functor from n-Cob into FdHilb.
* The category Span(C) of spans for any category C with finite limits.
Infinite-dimensional Hilbert spaces are not dagger compact, and are described by dagger symmetric monoidal categories.

## Structural theorems

Selinger showed that dagger compact categories admit a Joyal-Street style diagrammatic language and proved that dagger compact categories are complete with respect to finite dimensional Hilbert spaces i.e. an equational statement in the language of dagger compact categories holds if and only if it can be derived in the concrete category of finite dimensional Hilbert spaces and linear maps. There is no analogous completeness for Rel or n-Cob.
This completeness result implies that various theorems from Hilbert spaces extend to this category. For example, the no-cloning theorem implies that there is no universal cloning morphism. Completeness also implies far more mundane features as well: dagger compact categories can be given a basis in the same way that a Hilbert space can have a basis. Operators can be decomposed in the basis; operators can have eigenvectors, etc.. This is reviewed in the next section.

## Basis

The completeness theorem implies that basic notions from Hilbert spaces carry over to any dagger compact category. The typical language employed, however, changes. The notion of a basis is given in terms of a coalgebra. Given an object A from a dagger compact category, a basis is a comonoid object $(A,\delta ,\varepsilon )$. The two operations are a copying or comultiplication δ: A → A ⊗ A morphism that is cocommutative and coassociative, and a deleting operation or counit morphism ε: A → I . Together, these obey five axioms:
Comultiplicativity:
    $(1_{A}\otimes \varepsilon )\circ \delta =1_{A}=(\varepsilon \otimes 1_{A})\circ \delta$
Coassociativity:
    $(1_{A}\otimes \delta )\circ \delta =(\delta \otimes 1_{A})\circ \delta$
Cocommutativity:
    $\sigma _{A,A}\circ \delta =\delta$
Isometry:
    $\delta ^{\dagger }\circ \delta =1_{A}$
Frobenius law:
    $(\delta ^{\dagger }\otimes 1_{A})\circ (1_{A}\otimes \delta )=\delta \circ \delta ^{\dagger }$
To see that these relations define a basis of a vector space in the traditional sense, write the comultiplication and counit using bra–ket notation, and understanding that these are now linear operators acting on vectors $|j\rangle$ in a Hilbert space H:
    ${\begin{aligned}\delta :H&\to H\otimes H\\|j\rangle &\mapsto |j\rangle \otimes |j\rangle =|jj\rangle \\\end{aligned}}$
and
    ${\begin{aligned}\varepsilon :H&\to \mathbb {C} \\|j\rangle &\mapsto 1\\\end{aligned}}$
The only vectors $|j\rangle$ that can satisfy the above five axioms must be orthogonal to one-another; the counit then uniquely specifies the basis. The suggestive names copying and deleting for the comultiplication and counit operators come from the idea that the no-cloning theorem and no-deleting theorem state that the only vectors that it is possible to copy or delete are orthogonal basis vectors.

## General results

Given the above definition of a basis, a number of results for Hilbert spaces can be stated for compact dagger categories. We list some of these below, taken from unless otherwise noted.
* A basis can also be understood to correspond to an observable, in that a given observable factors on (orthogonal) basis vectors. That is, an observable is represented by an object A together with the two morphisms that define a basis: $(A,\delta ,\varepsilon )$.
* An eigenstate of the observable $(A,\delta ,\varepsilon )$ is any object $\psi$ for which
       $\delta \circ \psi =\psi \otimes \psi$
    Eigenstates are orthogonal to one another.
* An object $\psi$ is complementary to the observable $(A,\delta ,\varepsilon )$ if
       $\delta ^{\dagger }\circ ({\overline {\psi }}\otimes \psi )=\varepsilon ^{\dagger }$
    (In quantum mechanics, a state vector $\psi$ is said to be complementary to an observable if any measurement result is equiprobable. viz. an spin eigenstate of S$_x$ is equiprobable when measured in the basis S$_z$, or momentum eigenstates are equiprobable when measured in the position basis.)
* Two observables $(A,\delta _{X},\varepsilon _{X})$ and $(A,\delta _{Z},\varepsilon _{Z})$ are complementary if
       $\delta _{Z}^{\dagger }\circ \delta _{X}=\varepsilon _{Z}\circ \varepsilon _{X}^{\dagger }$
* Complementary objects generate unitary transformations. That is,
       $\delta ^{\dagger }\circ (\psi \otimes 1_{A})$
    is unitary if and only if $\psi$ is complementary to the observable $(A,\delta ,\varepsilon )$