Over the last months, I took a break from this blog project in order to write my Master's dissertation on Topology and disorder in spin systems. I since started my PhD at Aalto University in Finland and am working hard on other projects. I finally found some time to able to return with this third blog post, where I will continue with notes from my reading of Heunen and Vicary's Categories for quantum theory, by going over chapter 2, on the linear structure of monoidal categories.

The idea of this post is to show how linear algebraic concepts can be recovered from ideas of category theory. I will cover the concept of scalars as morphisms from the tensor unit to itself, and the categorical generalization of scalar multiplication. I will show how scalars form a commutative monoid. I will cover the idea of a zero object, which generalizes the idea of the zero dimensional vector space to the categorical setting, and I will also go over the concept of enrichment in commutative monoids, or “superposition rules ” in the language of categorical quantum mechanics, which provides an idea of addition of vectors, compatible with the scalar multiplication. The idea of biproducts is also introduced, which in the setting of categories enriched in commutative monoids with zero objects provide a generalization of the idea of the direct sum of vector spaces, and allows for a matrix notation. Finally, I will go over the concept of daggers, which allow for the generalizat ion of adjoints, and for the construction of inner products.

Scalars

In linear algebra, we work with vector spaces over fields. In particular, we can build a vector space \(V_{\mathbb{K}}\) by considering abstract objects, often called vectors, which obey certain axioms, among which is closure under “scalar multiplication ” with objects from a field \(\mathbb{K}\). Transformations between vector spaces that preserve this scalar multiplication, i.e. for two vector spaces \(V_{\mathbb{K}}\) and \(W_{\mathbb{K}}\), an element \(v\in V_{\mathbb{K}}\), a linear transformation is a function \(T:V_{\mathbb{K}}\to W_{\mathbb{K}}\), which for an element of the underlying field \(a\in\mathbb{K}\), is such that \(T(av)=aT(v)\).

Of course, as we have mentioned, we can consider vector spaces as objects, and linear transformations between them as morphisms, in order to construct the category of vector spaces, called Vect \(_{\mathbb{K}}\). More generically than the category of vector spaces, there are many aspects of linear algebra that can be described by monoidal categories. For instance, if we take a top-down approach and start with the monoidal category Hilb , we can extract from it the structure of complex numbers. In particular, the monoidal unit object \(I\) in Hilb , is given by the complex numbers \(\mathbb{C}\), and therefore morphisms \(I\to I\) are linear maps \(f:\mathbb{C}\to\mathbb{C}\). Since this map is linear, it is determined by \(f(1)\), where by linearity we have \(f(s)=sf(1)\). Thus, the space of linear functions over \(\mathbb{C}\) is in exact correspondence with \(\mathbb{C}\) itself.

Furthermore, in general, we often consider morphisms \(I\to I\) in a monoidal category as behaving life a field, and in fact, we use a provocative name:

Definition (Scalars)

In a monoidal category, the scalars are the morphisms \(I\to I\).

Despite not always forming a field, scalars in a monoidal category always form a monoid.

Definition (Monoid)

A monoid is a set \(A\) with a multiplication operation, which we can write as a juxtaposition of elements \(A\), and a chosen unit element \(1\in A\), satisfying for all \(r,s,t\in A\)

  1. An associative law \(r(st)=(rs)t\)
  2. A unit law \(1s=s=s1\).

It should be clear that this is simply a one-element category, but I will delve more deeply into this connection in some later post. The point here is simply that scalars in a category form a monoid under composition.

Besides forming a monoid, one additional property of scalars in a monoidal category is that they are commutative. They form a commutative monoid.

Proof:

Proving this can be done in a complicated or a simple way. The complicated way is to consider the commutative diagram

and noting that the sides of the cube commute by naturality of \(\lambda_{I}\) and \(\rho_{I}\), while the bottom square commutes by the interchange law we mentioned in a previous blog-post. Therefore, the top square must commute as well, and \(st=ts\).

The second, much easier way to prove this is to employ the graphical calculus. The scalars can be drawn as circles, with no inputs or outputs, and therefore, we can write

After the definition of scalars, the next step towards linear algebra, is the definition of a scalar multiplication.

Definition (Scalar multiple)

Given a scalar \(s:I\to I\) and a morphism \(f:A\to B\), the left scalar multiplication \(s\bullet f:A\to B\) is the composite

Lemma

In a monoidal category, let \(s,t:I\to I\) be scalars, and let \(f:A\to B\) and \(g:B\to C\) be morphisms. Then

  1. \(\text{id}_{I}\bullet f=f\)
  2. \(s\bullet t=s\circ t\)
  3. \(s\bullet\left(t\bullet f\right)=\left(s\bullet t\right)\bullet f\)
  4. \(\left(t\bullet g\right)\circ\left(s\bullet f\right)=\left(t\circ s\right)\bullet\left(g\circ f\right)\)

Again, all the statements included in this lemma can be proved straightforwardly using the graphical calculus.

Zero object

Once the scalar structure is defined, one can also consider the concept of “addition of vectors ”, or in the language of quantum mechanics, the concept of superposition. In QM, a linear superposition of qubits \(a,b\in\mathbb{C}^{2}\) is a linear combination \(sa+tb\) with \(s,t\in\mathbb{C}\). In categorical language, superposition is captured by the concept of enrichment by commutative monoids.

The starting point is the notion of a zero object. If we think about linear transformations between two vector spaces \(V\) and \(W\), there is always a zero transformation that sends all elements of \(V\) to the zero vector in \(V\to0_{W}\) . This linear map is characterized by saying that it factors uniquely through the zero-dimensional vector space \(V\to\left\{ 0\right\} \to W\). This is because there is a unique linear map \(\left\{ 0\right\} \to W\), which sends \(0\mapsto0_{W}\) and a unique linear map \(V\to\left\{ 0\right\} \) which sends all vectors \(a\mapsto0\). Beyond the context of Vect \(_{\mathbb{K}}\), there is a categorified notion of this zero object

Definition (Zero object)

An object \(0\) in a category \(C\) is a zero object when it is both initial in terminal, i.e. when there are unique morphisms \(A\to0\) and \(0\to A,\forall A\in\text{Ob}(C)\).

Definition (Zero morphism)

In a category \(C\) with a zero object \(0\), a zero morphism \(0_{A,B}:A\to B\) is the unique morphism factoring through the zero object, i.e. \(A\to0\to B\).

Lemma (Unicity of initial, terminal and zero objects)

Initial, terminal and zero objects are unique up to a unique isomorphism.

Proof

If \(A\) and \(B\) are initial objects, then there are unique morphisms \(f:A\to B,\)\(g:B\to A\), \(\text{id}_{A}:A\to A\) and \(\text{id}_{B}:B\to B\). This means that \(f\circ g=\text{id}_{B}\) and \(g\circ f=\text{id}_{A}\), which means that \(g=f^{-1}\), and thus \(f\) is an isomorphism. \(f\) is unique by construction.

Lemma (Composition with \(0\) gives 0)

Composition with a zero morphism always gives a zero morphism, i.e. \(\forall A,B,C\in\text{Ob}\left(\boldsymbol{C}\right)\), and \(f:A\to B\),

\[\begin{align} f\circ0_{C,A} & =0_{C,B},\\ 0_{B,C}\circ f & =0_{A,C}, \end{align}\]

Proof

\(f\circ0_{C,A}\) is of type \(C\to B\) and factors through the zero object as \(C\to0\to A\to B\). By definition, it must equal \(0_{C,B}\).

Superposition rules

Definition (Superposition rule)

Let \(\boldsymbol{C}\) be a category An operation \(+:\text{Hom}(A,B)\times\text{Hom}(A,B)\to\text{Hom}(A,B)\) which has the following properties:

  1. Commutativity: \(f+g=g+f\)
  2. Associativity: \(\left(f+g\right)+h=\left(f+g\right)+h\)
  3. Units: \(\forall A,B,\exists u_{A,B}:A\to B\) such that \(\forall f:A\to B\), \(f+u_{A,B}=f\)
  4. Addition is compatible with composition: \[\begin{align} \left(g+g'\right)\circ f & =\left(g\circ f\right)+\left(g'\circ f\right),\\ g\circ\left(f+f'\right) & =\left(g\circ f\right)+\left(g\circ f'\right). \end{align}\]
  5. Units are compatible with composition: \(\forall f:A\to B,\forall C,D\in\text{Ob}(\boldsymbol{C}),\) \[\begin{align} u_{C,B} & =f\circ u_{C,A},\\ u_{A,D} & =u_{B,D}\circ f. \end{align}\]

Note that this operation turns the Hom-set \(\text{Hom}(A,B)\) into a commutative monoid. For this reason, a superposition rule is also called an enrichment in commutati ve monoids. The field which studies categories with Hom-set enriched by some structure such as commutative monoids, vector-spaces, etc, is called enriched category theory. I will go at least one other example of an enriched category in a later post, when I get to topological order.

Lemma ( \(0_{A,B}=u_{A,B}\))

In a category \(\boldsymbol{C}\) with a zero object and a superposition rule, \(u_{A,B}=0_{A,B},\forall A,B\in\text{Ob}(\boldsymbol{C})\).

Proof

Since units are compatible with superposition \(u_{A,B}=u_{0,B}\circ u_{A,0}:A\to0\to B\). But the unique map \(A\to0\to B\) is \(0_{A,B}\), therefore \(u_{A,B}=0_{A,B}\).

It is customary to simply write \(0_{A,B}\) for the superposition rule unit, when we work in a category with this zero object.

Definition (Commutative semi-ring with absorbing zero)

A commutative semi-ring with an absorbing zero is a set equipped with commutativ e and associative multiplication \(\times\) and addition \(+\) operations which obey

\[\begin{align} \left(r+s\right)t & =rt+st,\\ r\left(s+t\right) & =rs+rt,\\ s+t & =t+s,\\ s+0 & =s,\\ s0= & 0=0s. \end{align}\]

Lemma

If a monoidal category has a zero object and a superposition rule, its scalars form a commutative semi-ring under \(\circ\) and \(+\).

Proof

The first four properties of the commutative semi-ring are automatically obeyed by the definition and requirements imposed on the superposition rule \(+\). The last property follows from the lemma which states that composition with \(0\) gives 0.

Definition (Linear functor)

Given two categories \(\boldsymbol{C}\) and \(\boldsymbol{D}\), with superposition rules, a functor \(F:\boldsymbol{C}\to\boldsymbol{D}\) is linear when \(F\left(f+g\right)=F(f)+F(g),\forall f,g\in\text{Hom}\left(A,B\right),\forall A,B\in\text{Ob}(\boldsymbol{C})\).

Biproducts

A third important operation in linear algebra, is the direct sum. The direct sum \(V\oplus W\) provides a way to glue together the vector spaces \(V\) and \(W\). The constituent vector spaces are part of the direct sum, and are included in \(V\oplus W\) via the injection maps \(V\to V\oplus W\) and \(W\to V\oplus W\) given by \(a\mapsto\left(a,0\right)\), \(b\mapsto\left(0,b\right)\)respectively. At the same time, the direct sum is completely determined by its parts via the projection maps \(V\oplus W\to V\) and \(V\oplus W\to W\) determined by \(\left(a,b\right)\mapsto a\in V\) and \(\left(a,b\right)\mapsto b\in W\). Furthermore, the reconstruction operation can undo the deconstruction, since \(\left(a,b\right)=\left(a,0\right)+\left(0,b\right)\). Although the notion of biproducts is quite general and does not need an enrichment in commutative monoids, superposition rules help phrase the structure in any category.

Definition (Biproducts in general)

A biproduct is a product which is also a coproduct.

Definition (Biproducts in categories with superposition rules and zero objects)

In a category \(\boldsymbol{C}\) with a zero object \(0\) and a superposition rule \(+\), the biproduct of two objects \(A_{1}\) and \(A_{2}\) is an object \(A_{1}\oplus A_{2}\) equipped with injection morphisms \(i_{n}:A_{n}\to A_{1}\oplus A_{2}\) and projection morphisms \(p_{n}:A_{1}\oplus A_{2}\to A_{n}\) for \(n=1,2\) satisfying

\[\begin{align*} \text{id}_{A_{n}} & =p_{n}\circ i_{n},\\ 0_{A_{n},A_{m}} & =p_{m}\circ i_{n},\text{ for }n\neq m,\\ \text{id}_{A_{1}\oplus A_{2}} & =i_{1}\circ p_{1}+i_{2}\circ p_{2}. \end{align*}\] This generalizes to an arbitrary finite number of objects \(A_{1}\oplus A_{2}\oplus\cdots\oplus A_{n}\). Also, for the biproduct of no objects, we have simply the zero object.

In general, the idea of biproducts is that they allow us to glue objects together in order to form a larger compound object. Injections tell us how original objects form part of the biproduct, and projections show how we can transform the biproduct into the original objects.

Lemma

A biproduct in categories with superposition rules and zero (BCS0) objects is a biproduct in the general sense.

Proof

To show that a biproduct \(A\oplus B\) in a category \(\boldsymbol{C}\) with superposition rule \(+\) and zero object \(0\) is a biproduct, we must show that it is a product and a coproduct. Let us prove that it is a product. Recall, from post 1 that a product is such that, for all \(C\in\text{Ob}(\boldsymbol{C})\) and for all \(f:C\to A\) and \(g:C\to B\), \(\exists!h:C\to A\oplus B,p_{A}'\circ h=f,p_{B}'\circ h=g\).

Now, due to the fact that \(A\oplus B\) is a biproduct in the BCS0 sense, it admits projections \(p_{A},p_{B}\), which we tentatively identify with \(p_{A}'\) and \(p_{B}'\) and injections \(i_{A},i_{B}\). In particular, one can construct the morphism \(i_{A}\circ f+i_{B}\circ g:C\to A\oplus B\). Note that

\[\begin{align} p_{A}\circ\left(i_{A}\circ f+i_{B}\circ g\right) & =p_{A}\circ i_{A}\circ f+p_{A}\circ i_{B}\circ g\nonumber \\ & =f+0_{A,C}\nonumber \\ & =f, \end{align}\] by virtue of the properties of the superposition rule. Similarly

\[\begin{align} p_{B}\circ\left(i_{A}\circ f+i_{B}\circ g\right) & =p_{B}\circ i_{A}\circ f+p_{B}\circ i_{B}\circ g\nonumber \\ & =0_{B,C}+g\nonumber \\ & =g. \end{align}\] Furthermore, suppose there exists another morphism \(h\) which satisfies \(p_{A}\circ h=f\) and \(p_{B}\circ h=g\). Then

\[\begin{align*} h & =\left(i_{A}\circ p_{A}+i_{B}\circ p_{B}\right)\circ h\\ & =i_{A}\circ f+i_{B}\circ g, \end{align*}\] and therefore \(i_{A}\circ f+i_{B}\circ g\) is unique. Therefore, the universal property of the product is satisfied, and the biproduct is indeed a product. The proof that it is a coproduct proceeds identically with all arrows reversed.

Lemma (Unique superposition)

If a category has biproducts, then it has a superposition rule.

Proof

Let \(+\) and \(\boxplus\) be two superposition rules, and consider \(f,g:A\to B\) and the biproduct \(A\oplus A\) with projections \(p_{1},p_{2}:A\oplus A\to A\) and injections \(i_{1},i_{2}:A\oplus A\to A\). Then

\[\begin{align} f+g & =\left(f\boxplus0_{A,B}\right)+\left(0_{A,B}\boxplus g\right)\nonumber \\ & =\left(f\circ p_{1}\circ i_{1}\boxplus f\circ p_{1}\circ i_{2}\right)+\left(g\circ p_{2}\circ i_{1}\boxplus g\circ p_{2}\circ i_{2}\right)\nonumber \\ & =f\circ p_{1}\circ\left(i_{1}\boxplus i_{2}\right)+g\circ p_{2}\circ\left(i_{1}\boxplus i_{2}\right)\nonumber \\ & =\left(f\circ p_{1}+g\circ p_{2}\right)\circ\left(i_{1}\boxplus i_{2}\right)\nonumber \\ & =\left(\left(f\circ p_{1}+g\circ p_{2}\right)\circ i_{1}\right)\boxplus\left(\left(f\circ p_{1}+g\circ p_{2}\right)\circ i_{2}\right)\nonumber \\ & =\left(f\circ p_{1}\circ i_{1}+g\circ p_{2}\circ i_{1}\right)\boxplus\left(f\circ p_{1}\circ i_{2}+g\circ p_{2}\circ i_{2}\right)\nonumber \\ & =\left(f+0_{A,B}\right)\boxplus\left(0_{A,B}+g\right)\nonumber \\ & =f\boxplus g. \end{align}\] This means that \(+=\boxplus\), and therefore the superposition rule is unique.

Definition (Biproduct preservation)

A functor \(F\) between two categories \(\boldsymbol{C}\) and \(\boldsymbol{D}\) with zero objects and superposition rules preserves biproducts if \(A\oplus B\) is a biproduct in \(\boldsymbol{C}\) with injections \(i_{A},i_{B}\) and projections \(p_{A},p_{B}\) implies that \(F(A\oplus B)\) is a biproduct in \(\boldsymbol{D}\) with injections \(F(i_{A}),F(i_{B})\) and projections \(F(p_{A}),F(p_{B})\).

Proposition

Let \(\boldsymbol{C}\) be a category with biproducts and a zero object, and suppose that a functor \(F:\boldsymbol{C}\to\boldsymbol{D}\) preserves zero objects. Then \(F\) preserves biproducts if and only if it is linear.

Proof

Let \(F\) preserve biproducts, and let \(\left(A\oplus A,i_{1},i_{2},p_{1},p_{2}\right)\) be a biproduct in \(\boldsymbol{C}\). Note that, by the functoriality axioms \(F(\text{id}_{A\oplus A})=\text{id}_{F(A\oplus A)}\), and since \(F\) preserves biproducts, the image of the biproduct is \(\left(F(A\oplus A),F(i_{1}),F(i_{2}),F(p_{1}),F(p_{2})\right)\), we can split \(\text{id}_{A\oplus A}=i_{1}\circ p_{1}+i_{2}\circ p_{2}\) and \(\text{id}_{F(A\oplus A)}=F(i_{1})\circ F(p_{1})+F(i_{2})\circ F(p_{2})\), or by functoriality \(\text{id}_{F(A\oplus A)}=F(i_{1}\circ p_{1})+F(i_{2}\circ p_{2})\). We have

\[\begin{equation} F(i_{1}\circ p_{1}+i_{2}\circ p_{2})=F(i_{1}\circ p_{1})+F\left(i_{2}\circ p_{2}\right). \end{equation}\] Then, for any morphisms \(f,g:A\to B\), we have

\[\begin{align} F(f+g)= & F(f+0_{A,A}+0_{A,A}+g)\nonumber \\ = & F(f\circ p_{1}\circ i_{1}+g\circ p_{2}\circ i_{1}+f\circ p_{1}\circ i_{2}+g\circ p_{2}\circ i_{2})\nonumber \\ = & F\left(\left(f\circ p_{1}+g\circ p_{2}\right)\circ i_{1}+\left(f\circ p_{1}+g\circ p_{2}\right)\circ i_{2}\right)\nonumber \\ = & F\left(\left(f\circ p_{1}+g\circ p_{2}\right)\circ\left(i_{1}+i_{2}\right)\right)\nonumber \\ = & F\left(\left(f\circ p_{1}+g\circ p_{2}\right)\circ\left(i_{1}\circ p_{1}+i_{2}\circ p_{2}\right)\circ\left(i_{1}+i_{2}\right)\right)\nonumber \\ = & F\left(f\circ p_{1}+g\circ p_{2}\right)\circ F\left(i_{1}\circ p_{1}+i_{2}\circ p_{2}\right)\circ F\left(i_{1}+i_{2}\right)\nonumber \\ = & F\left(f\circ p_{1}+g\circ p_{2}\right)\circ F(i_{1}\circ p_{1})+F\left(i_{2}\circ p_{2}\right)\circ F\left(i_{1}+i_{2}\right)\nonumber \\ = & F\left(f\circ p_{1}+g\circ p_{2}\right)\circ\left(F(i_{1}\circ p_{1})+F\left(i_{2}\circ p_{2}\right)\right)\circ F\left(i_{1}+i_{2}\right)\nonumber \\ = & F\left(f\circ p_{1}+g\circ p_{2}\right)\circ F(i_{1}\circ p_{1})\circ F\left(i_{1}+i_{2}\right)\nonumber \\ & +F\left(f\circ p_{1}+g\circ p_{2}\right)\circ F(i_{2}\circ p_{2})\circ F\left(i_{1}+i_{2}\right)\nonumber \\ = & F\left(\left(f\circ p_{1}+g\circ p_{2}\right)\circ i_{1}\circ p_{1}\circ\left(i_{1}+i_{2}\right)\right)\nonumber \\ & +F\left(\left(f\circ p_{1}+g\circ p_{2}\right)\circ i_{2}\circ p_{2}\circ\left(i_{1}+i_{2}\right)\right)\nonumber \\ = & F\left(\left(f\circ p_{1}+g\circ p_{2}\right)\circ i_{1}\circ p_{1}\circ i_{1}\right)\nonumber \\ & +F\left(\left(f\circ p_{1}+g\circ p_{2}\right)\circ i_{2}\circ p_{2}\circ i_{2}\right)\nonumber \\ = & F(f)+F(g). \end{align}\] Conversely, one simply has to note that products are defined in terms of a finite number of equalities involving composition, zero objects and the superposition rule. One can check that these equalities (the axioms of the biproduct) are preserved by linear functors \(F\), from which follows that \(F\) preserves biproducts.

This concludes the proof.

Proposition

Let \(\boldsymbol{C}\) and \(\boldsymbol{D}\) be categories with a zero object and a superposition rule. Let \(F,G:\boldsymbol{C}\to\boldsymbol{D}\) be linear functors preserving the zero object, and let \(\mu:F\Rightarrow G\) be a natural transformation. Then, for all objects \(A,B\), \(\mu_{A\oplus B}\) is determined by \(\mu_{A}\) and \(\mu_{B}\) as

\[\begin{equation} \mu_{A\oplus B}=\left(G\left(i_{A}\right)\circ\mu_{A}\circ F(p_{A})\right)+\left(G\left(i_{B}\right)\circ\mu_{B}\circ F(p_{B})\right). \end{equation}\]

Proof

We have

\[\begin{align} \mu_{A\oplus B} & =\left(G\left(i_{A}\right)\circ G\left(p_{A}\right)+G\left(i_{B}\right)\circ G\left(p_{B}\right)\right)\circ\mu_{A\oplus B}\nonumber \\ & =G\left(i_{A}\right)\circ G\left(p_{A}\right)\circ\mu_{A\oplus B}+G\left(i_{B}\right)\circ G\left(p_{B}\right)\circ\mu_{A\oplus B}\nonumber \\ & =G\left(i_{A}\right)\circ\mu_{A}\circ F(p_{A})+G\left(i_{B}\right)\circ\mu_{B}\circ F(p_{B}). \end{align}\] This completes the proof

Matrices

One hallmark of linear algebra is the ability to write linear maps as matrices. In the categorical setting, any category with biproducts admits a generalized matrix notation.

Definition (Matrix)

For a collection of maps \(f_{m,n}:A_{m}\to B_{n}\), where \(n=1,\dots,N\) and \(m=1,\dots,M\), their matrix can be defined as

\[\begin{equation} \left(f_{m,n}\right)=\begin{pmatrix}f_{1,1} & f_{2,1} & \cdots & f_{M,1}\\ f_{1,2} & f_{2,2} & \cdots & f_{M,2}\\ \vdots & \vdots & \ddots & \vdots\\ f_{1,N} & f_{2,N} & \dots & f_{M,N} \end{pmatrix}:=\sum_{m,n}\left(i_{n}\circ f_{m,n}\circ p_{m}\right). \end{equation}\]

Lemma (Matrix representation)

In a category with biproducts, every morphism \(f:\bigoplus_{m=1}^{M}A_{m}\to\bigoplus_{n=1}^{N}B_{n}\) has a matrix representation.

Proof

Note that

\[\begin{align} f & =\text{id}_{\bigoplus_{n=1}^{N}B_{n}}\circ f\circ\text{id}_{\bigoplus_{m=1}^{M}A_{m}}\nonumber \\ & =\sum_{n=1}^{N}\left(i_{n}\circ p_{n}\right)\circ f\circ\sum_{m=1}^{M}\left(i_{m}\circ p_{m}\right)\nonumber \\ & =\sum_{m=1}^{M}\sum_{n=1}^{N}\left(i_{n}\circ p_{n}\right)\circ f\circ\left(i_{m}\circ p_{m}\right)\nonumber \\ & =\sum_{m=1}^{M}\sum_{n=1}^{N}i_{n}\circ\left(p_{n}\circ f\circ i_{m}\right)\circ p_{m}, \end{align}\] which can be exactly identified with the matrix representation by denoting \(f_{m,n}=p_{n}\circ f\circ i_{m}\).

Corollary (Entries determine matrices)

In a category with biproducts, morphisms between biproduct objects are equal if and only if their matrix entries \(f_{n,m}\) are equal.

Example (Identity matrix)

Let \(A,B\) be objects in a category \(\boldsymbol{C}\) which admits biproducts. The identity matrix \(\text{id}_{A\oplus B}\) has a matrix representation

\[\begin{equation} \text{id}_{A\oplus B}=\begin{pmatrix}\text{id}_{A} & 0_{B,A}\\ 0_{A,B} & \text{id}_{B} \end{pmatrix}. \end{equation}\]

Proposition (Matrix multiplication)

Matrices multiply as

\[\begin{equation} \left(g_{k,n}\right)\circ\left(f_{m,k}\right)=\sum_{k}g_{k,n}\circ f_{m,k}. \end{equation}\]

Proof

Note that

\[\begin{align} \left(g_{k,n}\right)\circ\left(f_{m,k}\right) & =\left(\sum_{k,n}\left(i_{n}\circ g_{k,n}\circ p_{k}\right)\right)\circ\left(\sum_{m,l}\left(i_{l}\circ f_{m,l}\circ p_{m}\right)\right)\nonumber \\ & =\sum_{k,n,m,l}\left(i_{n}\circ g_{k,n}\circ p_{k}\right)\circ\left(i_{l}\circ f_{m,l}\circ p_{m}\right)\nonumber \\ & =\sum_{k,n,m,l}i_{n}\circ g_{k,n}\circ f_{m,l}\circ p_{m}\delta_{k,l}\nonumber \\ & =\sum_{k,n,m}i_{n}\circ\left(g_{k,n}\circ f_{m,k}\right)\circ p_{m}\nonumber \\ & =\sum_{n,m}i_{n}\circ\left(\sum_{k}g_{k,n}\circ f_{m,k}\right)\circ p_{m}. \end{align}\] This completes the proof.

Observation

We saw that scalar multiplication is distributive over a superposition rule, and one might expect that tensor products distribute similarly over biproducts. Even though this is the case for vector spaces, with \(U\otimes\left(V\oplus W\right)\simeq U\otimes V\oplus U\otimes W\), it is not true for general monoidal categories. Indeed it is not true that \(f\otimes\left(g+h\right)=f\otimes g+f\otimes h\) and not even that \(f\otimes0=0\). This nice interaction requires duals for objects, which I will cover in the next post. In general, the best one can do is the following lemma.

Lemma

In a monoidal category \(\boldsymbol{C}\) with a zero object \(0\), \(0\otimes0\simeq0\).

Proof

Consider the morphisms \(f=0_{I,0}\otimes\text{id}_{0}\circ\lambda_{0}^{-1}:0\to0\otimes0\), and \(g=\lambda_{0}\circ0_{I,0}\otimes\text{id}_{0}:0\otimes0\to0\). These morphisms are unique in either direction since they are compositions of unique morphisms. Furthermore, \(f\circ g=\text{id}_{0\otimes0}\) and \(g\circ f=\text{id}_{0}\), which implies that they are inverses and an isomorphism \(f:0\to0\otimes0\). This is summarized in the commutative diagram

Daggers

One additional concept central to linear algebra is the inner product. A categorified notion of this construction is achieved by the construction of a dagger. A dagger in a category \(\boldsymbol{C}\) is a contravariant involutive endofunctor on \(\boldsymbol{C}\) which is compatible with the monoidal structure. It categorifies the construction of the adjoint of a linear map between Hilbert spaces, which encodes all the information about the inner products.

Let us look at a detailed definition on Hilb . The idea in this context is that any morphism (bounded linear map) \(f:H\to K\) between Hilbert spaces admits a unique adjoint, which is also a bounded linear map \(f^{\dagger}:K\to H\).

Definition (Adjoint)

On Hilb , the functor which takes adjoints \(\dagger:\text{\textbf{Hilb}}\to\text{\textbf{Hilb}}\) is the contravariant functor that takes objects to themselves, and morphisms to their adjoints as bounded linear maps.

For \(\dagger\) to be contravariant, it must satisfy \(\left(g\circ f\right)^{\dagger}=f^{\dagger}\circ g^{\dagger}\), and \(\text{id}_{A}^{\dagger}=\text{id}_{A}\). Furthermore, since it is the identity on objects, then \(\dagger\left(H\right)=H,\forall H\in\text{Ob}(\text{\textbf{Hilb}})\). The involutive condition means that \(\left(f^{\dagger}\right)^{\dagger}=f\) for all morphisms \(f\).

Observation

Knowing all adjoints suffices to reconstruct the inner product on Hilbert spaces. In Hilb , recall that the unit is \(I=\mathbb{C}\). Let \(a,b:\mathbb{C}\to H\) be states of some Hilbert space \(H\). The scalar \(a^{\dagger}\circ b:\mathbb{C}\to H\to\mathbb{C}\) is equal to the inner product \(\left\langle a\right|\left.b\right\rangle \). To see this, note that since \(b\) is \(\mathbb{C}-\)linear, it is determined on \(\mathbb{C}\) by \(b(1)\). Therefore, we have

\[\begin{equation} a^{\dagger}(b(1))=\left\langle 1\right|\left.a^{\dagger}\left(b(1)\right)\right\rangle =\left\langle a\right|\left.b\right\rangle . \end{equation}\] This means that the functor \(\dagger\) contains all the information required to reconstruct the inner products on the Hilbert spaces. Since the functor is defined in terms of inner products in the first place, then knowing \(\dagger\) is equivalent to knowing the inner products. This suggests a generalization of the idea of inner products to arbitrary categories.

Definition (Dagger)

A dagger on a category \(C\) is an involutive contravariant functor \(\dagger:C\to C\) that is the identity on objects.

Definition (Dagger category)

A dagger category is a category equipped with a dagger.

A contravariant functor is therefore a dagger exactly when

\[\begin{align} \left(g\circ f\right)^{\dagger} & =f^{\dagger}\circ g^{\dagger},\\ \text{id}_{A}^{\dagger} & =\text{id}_{A},\\ \left(f^{\dagger}\right)^{\dagger} & =f. \end{align}\]

Definition (Involutive monoid)

A one-object dagger category is also called an involutive monoid. It can also be thought of as a set, which in addition to satisfying the monoid axioms with respect to a product \(\cdot:M\times M\to M\) , is also equipped with a function \(\dagger:M\to M\) such that, \(\forall a,b\in M\)\(\left(ab\right)^{\dagger}=b^{\dagger}a^{\dagger}\) and \(\left(a^{\dagger}\right)^{\dagger}=a\).

Definition (Names in a dagger category)

In a dagger category, several names are given to special morphisms, generalizing the nomenclature of bounded linear maps between Hilbert spaces. A morphism \(f:A\to B\) in a dagger category \(C\) is

  1. the adjoint of \(g:B\to A\), when \(g=f^{\dagger}\)
  2. self-adjoint, when \(f=f^{\dagger}\) and \(A=B\)
  3. idempotent when \(f=f\circ f\)
  4. a projection if it is idempotent and self-adjoint
  5. unitary when \(f^{\dagger}\circ f=\text{id}_{A}\) and \(f\circ f^{\dagger}=\text{id}_{B}\)
  6. an isometry when \(f^{\dagger}\circ f=\text{id}_{A}\)
  7. a partial isometry when \(f^{\dagger}\circ f\) is a projection
  8. positive when \(f=g^{\dagger}\circ g\) for some morphism \(g:A\to C\), and \(A=B\)

It is desirable for constructions to be compatible with important structures of certain categories. For instance, the dagger is an important structure, and it is useful, for example, for the zero morphisms to be compatible with the dagger. This compatibility actually comes for free

Lemma (Dagger and zero morphism)

In a dagger category with a zero object \(0_{A,B}^{\dagger}=0_{B,A}\).

Proof

From the functoriality of dagger

\[\begin{equation} 0_{A,B}^{\dagger}=\left(A\to0\to B\right)^{\dagger}=\left(B\to0\to A\right)=0_{B,A}. \end{equation}\]

Lemma (Dagger and zero objects)

In a dagger category, if an object is initial or terminal, it is a zero object.

Proof

If \(A\) is an initial object, \(\text{Hom}\left(A,B\right)\) is composed of a single morphism for every object \(B\). The dagger functor gives an isomorphism \(\text{Hom}\left(A,B\right)\simeq\text{Hom}\left(B,A\right)\) and therefore \(\text{Hom}\left(B,A\right)\) also has a single morphism for every object \(B\). Therefore \(A\) is also terminal, and since it is initial and terminal it is a zero object. The argument works mutatis mutandis when \(A\) is a terminal object.

Definition (Monoidal dagger category)

A monoidal dagger category \(C\) is a category that is also monoidal, such that \(\left(f\otimes g\right)^{\dagger}=f^{\dagger}\otimes g^{\dagger},\forall f,g\in C(A,B),\forall A,B\in\text{Ob}(C)\), and such that all components of the associator \(\alpha\) and unitors \(\rho\) and \(\lambda\) are unitary.

Definition (Braided monoidal dagger category)

A braided monoidal dagger category is a monoidal dagger category equipped with a unitary braiding.

Definition (Symmetric monoidal dagger category)

A symmetric monoidal dagger category is a braided monoidal dagger category for which the braiding is a symmetry.

Taking daggers in the graphical calculus can be performed by flipping the graphical representation about a horizontal axis. To help differentiate between a morphism \(f\) and its adjoint, morphisms are usually drawn in a way which breaks the symmetry. For instance

Note that the adjoint is represented purely by the orientation of the wedge.

Example

A unitary morphism obeys

Observation

A dagger induces a correspondence between states \(a:I\to A\) and effects \(a^{\dagger}:A\to I\).

Observation

The inner product is represented as

The second equality is simply a very suggestive form of writing the inner product which mimics, up to a 90 degree rotation, the Dirac bra-ket notation. Indeed, the graphical calculus for monoidal dagger categories can be thought of as a generalizing, to the categorical context, the Dirac notation.

The final subject covered here is that of dagger biproducts, which allow for the generalization of the conjugate transpose matrix.

Definition (Dagger biproducts)

In a dagger category with a zero object and a superposition rule, a dagger biproduct of objects \(A\) and \(B\) is a biproduct \(A\oplus B\) whose injections and projections satisfy \(i_{A}^{\dagger}=p_{A}\) and \(i_{B}^{\dagger}=p_{B}\).

Lemma (Adjoint of a matrix)

In a dagger category \(\boldsymbol{C}\) with dagger biproducts, the adjoint of a matrix is its conjugate transpose

\[\begin{equation} \begin{pmatrix}f_{1,1} & f_{2,1} & \cdots & f_{M,1}\\ f_{1,2} & f_{2,2} & \cdots & f_{M,2}\\ \vdots & \vdots & \ddots & \vdots\\ f_{1,N} & f_{2,N} & \dots & f_{M,N} \end{pmatrix}^{\dagger}=\begin{pmatrix}f_{1,1}^{\dagger} & f_{1,2}^{\dagger} & \cdots & f_{1,N}^{\dagger}\\ f_{2,1}^{\dagger} & f_{2,2}^{\dagger} & \cdots & f_{2,N}^{\dagger}\\ \vdots & \vdots & \ddots & \vdots\\ f_{M,1}^{\dagger} & f_{M,2}^{\dagger} & \dots & f_{M,N}^{\dagger} \end{pmatrix}. \end{equation}\]

Proof

The proof follows from expanding the matrix form

\[\begin{align} \left(f_{mn}\right)^{\dagger} & =\left(\sum_{m,n}i_{n}\circ f_{n,m}\circ p_{m}\right)^{\dagger}\nonumber \\ & =\left(\sum_{m,n}i_{n}\circ f_{n,m}\circ i_{m}^{\dagger}\right)^{\dagger}\nonumber \\ & =\sum_{p,q}i_{p}\circ\left(i_{q}^{\dagger}\circ\left(\sum_{m,n}i_{n}\circ f_{n,m}\circ i_{m}^{\dagger}\right)\circ i_{p}\right)^{\dagger}\circ i_{q}^{\dagger}\nonumber \\ & =\sum_{p,q}i_{p}\circ\left(\sum_{m,n}i_{q}^{\dagger}\circ i_{n}\circ f_{n,m}\circ i_{m}^{\dagger}\circ i_{p}\right)^{\dagger}\circ i_{q}^{\dagger}\nonumber \\ & =\sum_{m,n}\sum_{p,q}\delta_{q,n}\delta_{m,p}i_{p}\circ\left(f_{n,m}\right)^{\dagger}\circ i_{q}^{\dagger}\nonumber \\ & =\sum_{p,q}i_{p}\circ\left(f_{q,p}\right)^{\dagger}\circ i_{q}^{\dagger}. \end{align}\] This concludes the proof.

Corollary

In a dagger category with dagger biproducts, daggers distribute over addition

\[\begin{equation} \left(f+g\right)^{\dagger}=f^{\dagger}+g^{\dagger}. \end{equation}\]

Proof

We can compute

\[\begin{align} \left(f+g\right)^{\dagger} & =\left(\begin{pmatrix}f & g\end{pmatrix}\circ\begin{pmatrix}\text{id}_{A}\\ \text{id}_{B} \end{pmatrix}\right)^{\dagger}\nonumber \\ & =\begin{pmatrix}\text{id}_{A}\\ \text{id}_{B} \end{pmatrix}^{\dagger}\circ\begin{pmatrix}f & g\end{pmatrix}^{\dagger}\nonumber \\ & =\begin{pmatrix}\text{id}_{A} & \text{id}_{B}\end{pmatrix}\circ\begin{pmatrix}f^{\dagger}\\ g^{\dagger} \end{pmatrix}\nonumber \\ & =f^{\dagger}+g^{\dagger}. \end{align}\] This concludes the proof.

More to come

With the continued aim towards the necessary category theory for an understandin g some notions of topologically ordered phases of matter, I am still following Chris Heunen and Jamie Vicary's book on categorical quantum mechanics. In the next post I will move on to chapter 3 and introduce dual objects, which in graphical terms endow diagrams with directional arrows, as well as units and co-units allowing one to bend wires in the vertical direction. These structures have already a very beautiful interpretation in the categorica l quantum mechanics, as generating Bell states, etc, which I do not believe I will go over. But more notably, they allow the introduction of much richer structure like twisting in braided monoidal categories, and more types of categories such as pivotal categories, compact categories, ribbon categories, etc.

I will now keep following Heunen and Vicary's book to chapter 4. After this point, one could proceed and introduce the graphical calculus for monoids and co-monoids, Frobenius and Hopf algebras, and eventually get to the ZX-calculus which is a diagrammatic language for quantum computation. In particular I have already written some notes on the connection of the ZX-calculus with measurement based quantum computation. On the other hand, I will move directly into more category theory and move explicitly in the direction of understanding the language of topological order by establishing connections with the physical picture of anyons and topological defects, and starting to move towards unitary modular tensor categories. This second approach is the one I shall follow. After some connecting interlude using “An invitation to topological orders and category theory ” by Kong and Zhang, I will delve into a book which arrived into my doorstep just this week “Topological Quantum ” by Steven H. Simon.

← Back to blog