## Coalgebraic Quantum Computation

## Frank Roumen

Institute for Mathematics, Astrophysics, and Particle Physics (IMAPP)

Radboud University Nijmegen

F.Roumen@math.ru.nl

Coalgebras generalize various kinds of dynamical systems occuring in mathematics and computer science. Examples of systems that can be modeled as coalgebras include automata and Markov chains. We will present a coalgebraic representation of systems occuring in the field of quantum computation, using convex sets of density matrices as state spaces. This will allow us to derive a method to convert quantum mechanical systems into simpler probabilistic systems with the same probabilistic behaviour.

## 1 Introduction

For studying complex computational systems, it is often helpful to use an abstract description of the systems. This helps to focus on the most important parts of the system under consideration and see similarities and differences between distinct kinds of systems. The notion of a coalgebra, which originated in category theory, gives such an abstract view on dynamical systems. There is a large class of systems that can be described using coalgebras, including finite automata, Turing machines, Markov chains, and differential equations. Moreover one can reason about these system using a unified theory. An overview can be found in [15].

Our aim is to describe systems occuring in the field of quantum computation in the coalgebraic framework. This will facilitate comparison between quantum systems and, for example, deterministic and probabilistic systems. It will also enable us to apply facts from the general theory of coalgebras to quantum mechanical systems. In particular we will see what the minimization procedure from [3] amounts to for quantum coalgebras.

The use of categories in the foundations of quantum physics was initiated in [2], via tensor categories, and in [4], via topoi. Representation of quantum systems with coalgebras is also considered in [1]. However, there are several differences between [1] and our work. We focus on the dynamics of systems via unitary operators, whereas [1] models the dynamics of iterated measurements.

The outline of this paper is as follows. In Section 2 we discuss preliminaries on coalgebras. To illustrate the theory of coalgebras, Section 3 contains a coalgebraic description of probabilistic systems. Some of the constructions in that section are also necessary for understanding quantum systems coalgebraically. The main original contributions are in Sections 4 and 5. Section 4 shows how to represent quantum systems as coalgebras, and discusses the role of final coalgebras in this framework. Finally, in Section 5, the minimization procedure from Section 2 is applied to quantum coalgebras.

## 2 Coalgebras

In this section we will present some preliminary material on coalgebras, which are abstract generalizations of state-based systems. Let F be an endofunctor on a category C . An F-coalgebra consists of an

object X ∈ C and a morphism c : X → F X ( ) in C . The object X is called the state space of the coalgebra, and the morphism c is called the dynamics . The functor F in the definition is a parameter that determines the structure of the dynamics, and hence the kind of system. Coalgebras for a fixed endofunctor constitute a category, in which a morphism from c : X → F X ( ) to d : Y → F Y ( ) is a morphism f : X → Y in C making the following diagram commute.

/d47

/d47

/d15

/d15

/d15

/d15

/d47

![image](https://ac.marcodsn.me/arxiv-markdown-images/1408.0050v1-figure-c8d1cdc3-ff76-4c9d-a0df-c6323f373718.jpg)

/d47

The category of F -coalgebras and homomorphisms is denoted CoAlg ( F ) .

An F -coalgebra ω : Ω → F ( Ω ) is said to be final if it is a final object in the category CoAlg ( F ) , i.e. for every coalgebra c : X → F X ( ) there exists a unique coalgebra morphism from c to ω . This unique morphism is called the behaviour morphism of c and is denoted beh c : X → Ω .

Example 1. In theoretical computer science, finite automata provide a mechanical way to describe languages. An alphabet is a finite set, whose elements we call letters or symbols . The set of finite sequences, or words , with entries in an alphabet A is written as A ∗ . This set of words forms a monoid, where the monoid operation is concatenation and the empty word ε acts as an identity element. The monoid A ∗ is the free monoid over A . A language over A is a subset of A ∗ . A deterministic automaton over an alphabet A consists of a set X of states, a transition function δ : X × A → X , and a subset U ⊆ X of accepting states. The transition function δ : X × A → X can be extended to a function from X × A ∗ to X , also denoted δ , by defining δ ( x , ε ) = x and δ ( x au , ) = δ ( δ ( x a , ) , u ) .

Automata are often graphically represented by their state diagrams. In a state diagram, each state of the automaton is drawn as a circle. A transition δ ( x a , ) = y is indicated by an arrow, labeled with the letter a , from the circle x to the circle y . Accepting states are drawn as double circles. As an example, consider the automaton over A = { a b , } with the following diagram.

/d9

/d9

/d47

/d47

![image](https://ac.marcodsn.me/arxiv-markdown-images/1408.0050v1-figure-3acb951f-958b-457f-bbad-373ba31ec109.jpg)

/d111

/d111

/d51

/d51

Here, the set of states is X = { x 0 , x 1 , x 2 , x 3 } , the transition function is completely determined by the arrows in the diagram, and the subset of accepting states is { x 0 , x 3 } .

The transition function and the subset of accepting states of an automaton can be merged into one function of type X → × 2 X A Thus deterministic automata are coalgebras for the endofunctor F X ( ) = 2 × X A on Sets . This functor F has a final coalgebra whose underlying state space is the set P ( A ∗ ) of all languages over A . To endow this set with an automaton structure, define the transition function by δ ( L a , ) = { u ∈ A ∗ | au ∈ L } , and let the subset of accepting states be { L ∈ P ( A ∗ ) | ε ∈ L } . Let c : X → × 2 X A be an arbitrary automaton, with transition function δ and accepting states U . Then the behaviour morphism beh c : X → P ( A ∗ ) assigns to a state x the language { u ∈ A ∗ | δ ( x u , ) ∈ U } . Thus the coalgebraic description gives a convenient way to characterize the language recognized by an automaton.

/d126

/d126

/d74

/d74

/d10

/d10

There are several other systems that can be modeled as coalgebras in such a way that the morphism into the final coalgebra corresponds to the observable behaviour of the system, see [15] for more examples.

Amorphism into the final coalgebra provides a method to obtain an external description of a system, given an internal description. We will now turn our attention to the reverse problem: if we know the behaviour of a system, how do we find a coalgebra having that behaviour? Of course, in practice there are many coalgebras with the same behaviour. We are often interested in the most efficient one, i.e. the coalgebra with the smallest state space among those with the same behaviour. Finding the coalgebra with a minimal state space is known as the problem of minimization. Here we will focus on the special case of minimizations of automata.

Minimal realizations of automata were first constructed in [12]. This was generalized to categorical settings in [6], see also [3, 14] for the coalgebraic version.

Definition 2. A subcoalgebra of a coalgebra c : X → F X ( ) in Sets is a coalgebra d : Y → F Y ( ) with Y ⊆ X for which the inclusion map Y ↪ → X is a coalgebra morphism.

Definition 3. Let c : X → F X ( ) be a coalgebra in Sets , and S ⊆ X . The subcoalgebra of c generated by S is the smallest subcoalgebra 〈 S 〉 of c whose state space includes S . If S is a singleton { } s , then we write 〈 S 〉 = 〈 〉 s .

Example 4. Consider an automaton c : X → × 2 X A , and denote its transition function by δ . For any subset S ⊆ X , the subcoalgebra 〈 S 〉 of c generated by S is obtained by closing S under the transitions of c . Thus the coalgebra 〈 S 〉 has state space

$$\left \{ \delta ( s ) ( u ) \ | \ s \in S, u$$

The observations and transitions are inherited from c .

The behaviour of an automaton together with an initial state is the language recognized by that state. Therefore the minimization problem amounts to the following question: given a language L , what is the minimal automaton recognizing L ?

Proposition 5. Let L be a language over A. The coalgebra with the least number of states recognizing L is the subcoalgebra 〈 L 〉 of the final coalgebra P ( A ∗ ) , with initial state L ∈〈 〉 L .

To generalize this to arbitrary coalgebras, one needs a factorization system on the underlying category. The abstract monos of the factorization system play the role of the subcoalgebras. This is worked out in [3, 13].

## 3 Probabilistic systems

Before representing quantum systems coalgebraically, it is useful to consider probabilistic systems first, because quantum mechanical behaviour is probabilistic.

Transitions to a probability distribution over successor states will be modeled using functors involving the so-called distribution monad . Define a functor D : Sets → Sets sending a set X to the set of finite convex combinations, or probability distributions, on X :

$$\mathcal { D } ( X ) = \{ \varphi \colon X \rightarrow$$

/negationslash

Here supp ( ϕ ) = { x ∈ X | ϕ ( x ) = 0 } is the support of ϕ . An element ϕ of D ( X ) can also be written as a formal sum r 1 x 1 + · · · + rnxn , where { x 1 , . . . , xn } = supp ( ϕ ) and ri = ϕ ( xi ) . On a morphism f : X → Y , the functor D is defined as

$$\mathcal { D } ( f ) ( r _ { 1 } x _ { 1 } + \$$

The functor D is a monad with unit and multiplication

$$\eta$$

↦

$$\begin{array} {$$

↦

We will show how the distribution monad is used in the representation of probabilistic systems by an example.

Example 6. Imagine a particle moving on the following graph.

![image](https://ac.marcodsn.me/arxiv-markdown-images/1408.0050v1-figure-11797edb-5d18-41b0-a9f7-575813fddb9d.jpg)

Let X = { x 0 , x 1 , x 2 , x 3 } be the set of vertices. The particle starts at one of the vertices of the graph. In each time step, the particle can move to one of the two adjacent points. Each of these points is chosen with probability 1 2 . This system can be written as a coalgebra for the distribution monad:

↦

↦

$$\begin{matrix} c \colon X & \rightarrow & \mathcal { D } ( X ) \\ x _ { 0 } & \mapsto & \frac { 1 } { 2 } x _ { 1 } + \frac { 1 } { 2 } x _ { 2 } \\ x _ { 1 } & \mapsto & \frac { 1 } { 2 } x _ { 0 } + \frac { 1 } { 2 } x _ { 3 } \\ x _ { 2 } & \mapsto & \frac { 1 } { 2 } x _ { 0 } + \frac { 1 } { 2 } x _ { 3 } \\ x _ { 3 } & \mapsto & \frac { 1 } { 2 } x _ { 1 } + \frac { 1 } { 2 } x _ { 2 } \end{matrix} \\ \text{chain}.$$

↦

↦

A coalgebra for D is called a Markov chain .

We consider the trajectory of the particle when it starts in the vertex x 0. Let ϕ n ∈ D ( X ) denote the probability distribution over the vertices of the graph after n steps. Then the first few values of ϕ n are:

$$\begin{array} { l l l } \varphi _ { 0 } & = & x _ { 0 } \\ \varphi _ { 1 } & = & \frac { 1 } { 2 } x _ { 1 } + \frac { 1 } { 2 } x _ { 2 } \\ \varphi _ { 2 } & = & \frac { 1 } { 2 } x _ { 0 } + \frac { 1 } { 2 } x _ { 3 } \\ \varphi _ { 3 } & = & \frac { 1 } { 2 } x _ { 1 } + \frac { 1 } { 2 } x _ { 2 } \end{array}$$

We obtain a repetition after three steps, so ϕ 2 n = ϕ 2 for n &gt; 0 and ϕ 2 n + 1 = ϕ 1 for all n ∈ N .

It is reasonable to view the sequence ( ϕ n ) n ∈ N as the behaviour of the Markov chain. However, if we model the system as a D -coalgebra, the morphism into the final coalgebra does not give the desired behaviour. This can be solved by replacing the underlying category Sets of the coalgebra by another category. There are at least two possible replacements known in the literature: [7] proposes to work in the Kleisli category of the monad D , and [16] proposes to work in the category of Eilenberg-Moore algebras for D . The solutions work for coalgebras for several monads, not only for the distribution monad. Both approaches are compared in [10]. Here we will briefly describe how to model probabilistic

systems in the category of Eilenberg-Moore algebras, since this approach will also be used for quantum systems.

↦

An Eilenberg-Moore algebra for the distribution monad is called a convex set. In a convex set X , we can assign to each convex combination ∑ n i = 1 ri = 1 a function X n → X denoted ( x 1 , . . . , xn ) → ∑ n i = 1 ri xi . Ahomomorphism of convex sets preserves all convex combinations and is called a convex or affine map. The category of convex sets and maps is written as Conv , and is also described in [8].

The next result ensures that several functors on the category Conv have a final coalgebra, which enables us to speak about the behaviour of probabilistic systems.

Lemma7. Let C be a category with all products. Fix an object B ∈ C and a set A. The functor F : C → C defined by F ( X ) = B × X A , where X A denotes a power, has a final coalgebra whose underlying state space is the power B A ∗ .

Proof. The projection B A ∗ → B onto the coordinate with index u ∈ A ∗ will be denoted π u . The dynamics is a map ω : B A ∗ → × B ( B A ∗ ) A , whose first component is πε and whose second component in the coordinates a ∈ A u , ∈ A ∗ is π au . We will now prove the finality of ω . Given a coalgebra c = 〈 f , 〈 ga 〉 a ∈ A 〉 : X → B × X A , define beh c : X → B A ∗ as follows: first extend the family of morphisms ( ga ) a ∈ A for a ∈ A to a family ( gu ) u ∈ A ∗ by defining inductively

$$g _ { \varepsilon } \ = \ \text{id}, \\ g _ { a u } \ = \ \ g _ { u } \circ g _ { a }. \\ \dots \dots \ e \dots \ \dots \ \dots \..$$

To show that beh c is the unique such coalgebra morphism, let ϕ : X → B A ∗ be any coalgebra morphism, and denote the component with coordinate u ∈ A ∗ by ϕ u . Induction on the word u ∈ A ∗ proves that ϕ u = f ◦ gu .

Then beh c = 〈 f ◦ gu 〉 u ∈ A ∗ is a coalgebra morphism from c to ω .

Example 8. The coalgebra from Example 6 can also be represented as a coalgebra in Conv , in such a way that the morphism into the final coalgebra yields the list of probability distributions associated to the Markov chain. Fix a set X and take the functor F Y ( ) = D ( X ) × Y on the category Conv , where X is the set of vertices of the graph. Represent the Markov chain as an F -coalgebra d with state space D ( X ) , i.e. a convex map D ( X ) → D ( X ) × D ( X ) . Since D ( X ) is the free convex set on X , it suffices to define d on the set X of generators. Let d x ( ) = ( 1 x c x , ( )) ∈ D ( X ) × D ( X ) . From Lemma 7 it follows that the final F -coalgebra exists and has state space D ( X ) N , so we obtain a map beh d : D ( X ) → D ( X ) N . This behaviour map sends the initial state x 0 ∈ D ( X ) to the list of probability distributions ( ϕ n ) n ∈ N obtained in Example 6.

## 4 Coalgebraic model of quantum computation

In this section we will show how to model discrete quantum systems as coalgebras. We will first introduce two running examples. The first example is the class of quantum automata. This quantum analogue of deterministic automata was defined in [11]. There are two differences between our definition and [11]: we generalize the output projections to effects on a Hilbert space, and we ignore initial states, which is often more convenient for coalgebras.

Definition 9. A quantum language over an alphabet A is a function A ∗ → [ 0 1 . , ] One can think of a quantum language as a fuzzy or probabilistic language. The function assigns to a word in A ∗ the probability that it is in the language.

A quantum automaton over an alphabet A consists of:

- · A complex Hilbert space H ;
- · An effect ε on H , i.e. a linear operator ε : H → H satisfying 0 ≤ ε ≤ id.
- · For each letter a ∈ A , a unitary operator δ a : H → H ;

Define, for each word u ∈ A ∗ , the extended transition operator δ u : H → H inductively by

$$\delta _ { \varepsilon } ( \psi ) = \psi, \\ \delta _ { a u } ( \psi ) = \delta _ { u } ( \delta _ { a } ( \psi ) ).$$

The probability that the word u is accepted by the automaton, starting from initial state ψ with norm 1, is

$$\begin{matrix} & \langle \delta _ { u } \psi | \varepsilon | \delta _ { u } \psi \rangle, \\ & \cdot & \cdot & \cdot & \cdot \end{matrix}$$

The quantum language recognized by a state ψ ∈ H is the function A ∗ → [ 0 1 , ] that sends a word u ∈ A ∗ to the probability that u is accepted by ψ .

that is, the probability that measurement of ε gives 'yes' in state δ ψ u .

The quantum walks form another class of examples of systems, discussed extensively in [17]. See also [9] for coalgebraic versions. We will take the example from the latter reference.

Example 10. Consider a particle walking on the line Z of integers. In addition to the position of the particle on Z , we take its spin into account. Then the Hilbert space modeling the composite system of the particle's spin and position is C 2 ⊗ /lscript 2 ( Z ) . Write the basis vectors in Dirac notation as |↑ k 〉 and |↓ k 〉 . We stipulate that the particle starts in state |↑ 0 . The dynamics of the walk is given by the unitary 〉 operator

↦

$$U \colon \ & | \uparrow k \rangle \quad \mapsto \quad \frac { 1 } { \sqrt { 2 } } | \uparrow k - 1 \rangle + \frac { 1 } { \sqrt { 2 } } | \downarrow k + 1 \rangle \\ & | \downarrow k \rangle \quad \mapsto \quad \frac { 1 } { \sqrt { 2 } } | \uparrow k - 1 \rangle - \frac { 1 } { \sqrt { 2 } } | \downarrow k + 1 \rangle \\ \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \end{cases}$$

↦

Consider a situation in which it is possible to measure the position of the particle, but not the spin. Then the admissible observables are |↑ k 〉〈↑ k | + |↓ k 〉〈↓ k | for k ∈ Z .

If the particle walks during n time steps, then its position can be described using a probability distribution over Z . The probability that we encounter the particle on position k is

$$\langle U ^ { n } ( \uparrow 0 ) | \left ( | \uparrow k \rangle \langle \uparrow k | + | \downarrow k \rangle \langle \downarrow k | \right ) | U ^ { n } ( \uparrow 0 ) \rangle. \\ \text{distribution after $n$ steps by $\varphi_{n}\in\mathcal{D}(\mathbb{Z}$).  The unit distrit}$$

Denote the probability distribution after n steps by ϕ n ∈ D ( Z ) . The unit distribution k is written using Dirac notation as | k 〉 . The first few probability distributions are:

$$\begin{array} { r c l c l } \cdot \cdot & & \cdot & \cdot \\ \varphi _ { 0 } & = & & | 0 \rangle \\ \varphi _ { 1 } & = & & \frac { 1 } { 2 } | - 1 \rangle & + & \frac { 1 } { 2 } | 1 \rangle \\ \varphi _ { 2 } & = & & \frac { 1 } { 4 } | - 2 \rangle & + & \frac { 1 } { 2 } | 0 \rangle & + & \frac { 1 } { 4 } | 2 \rangle \\ \varphi _ { 3 } & = & \frac { 1 } { 8 } | - 3 \rangle & + & \frac { 5 } { 8 } | - 1 \rangle & + & \frac { 1 } { 8 } | 1 \rangle & + & \frac { 1 } { 8 } | 3 \rangle \\ \end{array}$$

We would like to model quantum systems in such a way that the system is a coalgebra for a certain endofunctor, and the morphism into the final coalgebra gives the quantum language or probability distribution determined by the system. To achieve this, we will work with coalgebras in the category Conv of convex algebras. There are two reasons for this. Firstly, we can model computations for both systems in pure states and systems in mixed states. Secondly, the category Conv incorporates both quantum probability via density matrices and the classical probability that is needed for the output.

Let HilbIsomet be the category of Hilbert spaces with isometric embeddings as morphisms. Define a functor DM : HilbIsomet → Conv on objects by letting DM ( H ) be the set of density matrices on the Hilbert space H , and on morphisms by DM ( f : H → K )( ρ ) = f ρ f † .

Let H be a Hilbert space underlying a quantum system, and let S be a set of unitary operators that can be applied to the system. Represent the possible measurements on the system by a subset E of the set of effects E f ( H ) on H . We do not use the entire set E f ( H ) since usually not all effects are possible or interesting. It is often the case that the sum of the effects in E is id. In this case, the subset E is called a test , see [5] for more information. Consider the functor

$$F ( X ) = [ 0, 1 ] ^ { E } \times X ^ { S }$$

on the category Conv . Form the F -coalgebra

↦

The part tr ( ρε ) represents the observations on the coalgebra, since this is the probability that measurement of the effect ε succeeds when the system is in mixed state ρ . The part DM ( U )( ρ ) is the evolution of the system according to the density matrix formalism.

$$f \colon \mathcal { M } ( H ) \ \rightarrow \ \left [ 0, 1 \right ] ^ { E } \times \mathcal { M } ( H ) ^ { S } \\ \rho \ \mapsto \ \left ( \left ( \text{tr} ( \rho \varepsilon ) \right ) _ { \varepsilon \in E }, \left ( \mathcal { D } \mathcal { M } ( U ) ( \rho ) \right ) _ { U \in S } \right ). \\ \varepsilon \right ) \text{ represents the observations on the coalgebra, since this is the probability that measure} \\ \sim \ \right. \ \cdot \ \cdot \ \cdot \ \cdot \ \cdot \ \cdot \ \cdot \ \cdot \ \cdot \ \cdot \ \cdot \ \cdot \ \cdot \ \cdot \ \cdot$$

Wewill now show that (2) has the desired behaviour. First we have to check that the behaviour exists, i.e. that F has a final coalgebra.

The category Conv inherits all products from Sets , so Lemma 7 applies to the functor defined in (1). The functor F has a final coalgebra with the convex set ([ 0 1 , ] E ) S ∗ as state space. The dynamics is a map ([ 0 1 , ] E ) S ∗ → [ 0 1 , ] E × (([ 0 1 , ] E ) S ∗ ) S . The first component of the dynamics is the projection onto the component with the empty word ε as index, and for the second component, the map with index a ∈ S and u ∈ S ∗ is the projection onto component au .

The coalgebra (2) gives a behaviour map beh f : DM ( H ) → ([ 0 1 , ] E ) S ∗ . This map can alternatively be seen as a indexed family of maps DM ( H ) → [ 0 1 , ] for each ε ∈ E and u ∈ S ∗ . The map with index ε and u = u 1 . . . un ∈ S ∗ sends the density matrix ρ to tr ( un . . . u 1 ρ u † 1 . . . u n † ε ) . Physically, if we view effects as yes-no questions about a system, this is the probability that measurement of the effect ε yields outcome 'yes', if the system starts in mixed state ρ and evolves according to the unitary operators u 1, . . . , un . Therefore the final coalgebra semantics corresponds exactly to the physical behaviour.

The construction of the coalgebra (2) involves three parameters: the underlying state space H , the set of unitary operators S , and the set of possible measurements E . By choosing these parameters appropriately we can fit the above examples in this framework.

Example 11. Let ( H , ( δ a ) a ∈ A , ε ) be a quantum automaton. The set of unitaries S is { δ a | a ∈ A } , and the set of possible measurements is the singleton set E = { ε } . The coalgebra (2) becomes

↦

If ψ ∈ H is a state, then the behaviour map DM ( H ) → [ 0 1 , ] A ∗ maps the associated density matrix | ψ 〉〈 ψ | to the quantum language recognized by ψ .

$$\begin{array} { c c c } \mathcal { D M } ( H ) & \rightarrow & [ 0, 1 ] \times \mathcal { D M } ( H ) ^ { A } \\ \rho & \mapsto & \left ( \text{tr} ( \rho \varepsilon ), \left ( \delta _ { a } \rho \delta _ { a } ^ { \dagger } \right ) _ { a \in A } \right ) \\ \text{behaviour map } \mathcal { D M } ( H ) \rightarrow [ 0, 1 ] ^ { A ^ { * } } \text{ maps the associ} \text{:} \end{array}$$

The quantum walk from Example 10 gives a coalgebra

↦

$$\begin{array} { c c c } \mathcal { D } \mathcal { M } ( \mathbb { C } ^ { 2 } \otimes \ell ^ { 2 } ( \mathbb { Z } ) ) & \to & [ 0, 1 ] ^ { \mathbb { Z } } \times \mathcal { D } \mathcal { M } ( \mathbb { C } ^ { 2 } \otimes \ell ^ { 2 } ( \mathbb { Z } ) ) \\ \rho & \mapsto & \left ( ( \mathbf r ( \rho | \uparrow k ) \langle \uparrow k | + \rho | \downarrow k \rangle \langle \downarrow k | ) \right ) _ { k \in \mathbb { Z } }, U \rho U ^ { \dagger } \right ). \end{array}$$

The codomain can be restricted to D ω ( Z ) × DM ( C 2 ⊗ /lscript 2 ( Z )) , because the effects in E sum to id. Here D ω is the infinite distribution monad, defined on objects by

$$\mathcal { D } _ { \omega } ( X ) & = \{ \varphi \colon X \to [ 0, 1 ] \ | \ \text{supp} ( \varphi ) \ \text{is at most countable and } \sum _ { x \in X } \varphi ( x ) = 1 \}. \\ \cdot \quad \cdot \quad \cdot \quad \cdot \quad \cdot \quad \cdot \quad \cdot \quad \cdot \quad \cdot \quad \cdot \quad \cdot \quad \cdot \quad \cdot$$

On morphisms, D ω acts the same as the ordinary distribution monad D .

These examples show that the representation (2) captures many quantum systems in a uniform way.

## 5 Minimization

In Section 2 we presented a procedure to find minimal automata for classical languages. The same method can be used to find minimal realizations for quantum behaviour.

Consider coalgebras for the functor F X ( ) = [ 0 1 , ] E × X S , which was defined in (1). The final coalgebra for F has underlying state space ([ 0 1 , ] E ) S ∗ . Then the minimal realization of a behaviour L ∈ ([ 0 1 , ] E ) S ∗ is the smallest subcoalgebra of ([ 0 1 , ] E ) S ∗ containing L . An interesting feature of this approach is that the minimal coalgebra need not be a quantum coalgebra, even if the behaviour arises from a quantum mechanical system. Since the subcoalgebra of the final coalgebra lies in the category Conv , the minimal realization will certainly be a probabilistic system, but its state space is not necessarily of the form DM ( H ) . Thus minimization gives a procedure for turning quantum systems into simpler systems in Conv which nevertheless have the same behaviour.

Example 12. Weconsider a quantum version of Example 6. The square graph gives rise to the state space C 4 with basis | 0 , 〉 | 1 , 〉 | 2 , 〉 | 3 , and the walk of a quantum particle on the square graph is represented by 〉 the unitary matrix

$$U = \frac { 1 } { \sqrt { 2 } } \left ( \begin{array} { c c c c } 0 & 1 & 1 & 0 \\ 1 & 0 & 0 & 1 \\ 1 & 0 & 0 & - 1 \\ 0 & 1 & - 1 & 0 \end{array} \right ). \\ \text{sure the probability that the particle is in stat}$$

For each vertex k , we can measure the probability that the particle is in state k using the projection | k 〉〈 k | . This leads to the coalgebra

↦

Assume that | 0 〉〈 0 | ∈ DM ( C 4 ) is the initial state. The resulting output stream is

$$f \colon \mathcal { D M } ( \mathbb { C } ^ { 4 } ) \ \to \ \mathcal { D } ( 4 ) \times \mathcal { D M } ( \mathbb { C } ^ { 4 } ) \\ \rho \ \mapsto \ \left ( ( \text{tr} ( \rho | k \rangle \langle k | ) ) _ { k = 0, 1, 2, 3 }, U \rho U ^ { \dagger } \right ). \\ 0 | \in \mathcal { D M } ( \mathbb { C } ^ { 4 } ) \text{ is the initial state. The resulting output stream is}$$

$$\sigma = \left ( | 0 \rangle, \frac { 1 } { 2 } | 1 \rangle + \frac { 1 } { 2 } | 2 \rangle \right ) ^ { \omega }. \\ \dots \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot$$

The minimal coalgebra with this behaviour is the smallest subcoalgebra of D ( 4 ) N containing σ . We shall compute this subcoalgebra by determining the states of D ( 4 ) N that can be reached from σ with the transition structure, and then taking the convex set generated by the reachable states.

The transition structure of the final coalgebra is given by the function tail : D ( 4 ) N → D ( 4 ) N defined by tail ( x 0 , x 1 , x 2 , . . . ) = ( x 1 , x 2 , . . . ) . Applying the tail function repeatedly to σ gives the streams σ and σ ′ = ( 1 2 | 1 〉 + 1 2 | 2 〉 | , 0 〉 ) ω . The convex algebra generated by σ and σ ′ inside D ( 4 ) N is

$$\Psi _ { 1 } \, \partial _ { 2 } \, \Psi _ { 2 } \, \partial _ { 3 } \, \partial _ { 4 } \, \partial _ { 5 } \, \partial _ { 6 } \, \partial _ { 7 } \, \partial _ { 8 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 10 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 1 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 7 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 8 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 10 } \, \partial _ { 10 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 10 } \, \partial _ { 11 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 11 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 10 } \, \partial _ { 1 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 10 } \, \partial _ { 5 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 5 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 10 } \, \partial _ { 7 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 10 } \, \partial _ { 8 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 7 } \, \partial _ { 7 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 7 } \, \partial _ { 8 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 7 } \, \partial _ { 9 } \, \partial _ { 7 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 7 } \, \partial _ { 9 } \, \partial _ { 8 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 7 } \, \partial _ { 7 } \, \partial _ { 7 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 7 } \, \partial _ { 7 } \, \partial _ { 8 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \, \partial _ { 9 } \$$

This is the minimal coalgebra with behaviour σ and hence the minimization of f . The coalgebra structure is obtained as restriction of the final coalgebra D ( 4 ) N . By projecting onto the first coordinate twice we obtain an affine isomorphism between X and [ 0 1 . , ] Therefore a more elementary display of the minimization is

↦

$$\begin{array} { c c c } [ 0, 1 ] & \rightarrow & \mathcal { D } ( 4 ) \times [ 0, 1 ] \\ p & \mapsto & ( p | 0 \rangle + \frac { 1 } { 2 } ( 1 - p ) | 1 \rangle + \frac { 1 } { 2 } ( 1 - p ) | 2 \rangle, 1 - p ) \\ \L \text{ state space } [ 0, 1 ] \text{ of the minimization is more manageable than the or} \\ \text{minimization is not a quantum system anymore since } [ 0 \ 1 ] \text{ is not isome} \end{array}$$

) Observe that the state space [ 0 1 , ] of the minimization is more manageable than the original state space DM ( C 4 ) . The minimization is not a quantum system anymore, since [ 0 1 , ] is not isomorphic to a convex set of density matrices. It can be seen as a probabilistic system with two states, since [ 0 1 , ] ∼ = D ( 2 . ) Thus the behaviour of this quantum mechanical system can be reproduced with a simpler probabilistic system. Note that we only consider the classically observable probabilities as part of the behaviour, not the quantum mechanical amplitudes. Therefore the minimization only contains information about the classically probabilistic behaviour.

## 6 Conclusion

Quantum systems can be represented by using density matrices as states, with unitary operators acting on them as dynamics. We have exploited this fact to model quantum systems as coalgebras in the category Conv of convex sets, with a set of density matrices as state space. A consequence of this representation is that minimization of coalgebras gives a method to transform a quantum system into a probabilistic system that has the same probabilistic behaviour, but a simpler structure.

There are several possibilities for future research. We have only studied minimization of quantum systems empirically through examples. It would be nice to have more general results about the structure of minimal realizations. Moreover it is unclear if quantum systems can also be modeled in such a way that minimization gives a quantum coalgebra again.

Acknowledgements. This work is based on my master's thesis [13]. I would like to thank my thesis supervisor Bart Jacobs for many helpful discussions and comments.

## References

- [1] S. Abramsky (2010): Coalgebras, Chu spaces, and representations of physical systems . In: Proceedings of the 25th Annual IEEE Symposium on Logic in Computer Science, pp. 411-420, doi:10.1109/LICS.2010.35.
- [2] S. Abramsky &amp; B. Coecke (2004): A categorical semantics of quantum protocols . In: Proceedings of the 19th Annual IEEE Symposium on Logic in Computer Science, pp. 415-425, doi:10.1109/LICS.2004.1319636.
- [3] J. Ad´ amek, F. Bonchi, M. H¨ ulsbusch, B. K¨ onig, S. Miliu s &amp; A. Silva (2012): A coalgebraic perspective on minimization and determinization . In Lars Birkedal, editor: Foundations of Software Science and Computational Structures, Lecture Notes in Computer Science 7213, Springer Berlin Heidelberg, pp. 58-73, doi:10.1007/978-3-642-28729-9 4.
- [4] J. Butterfield &amp; C. Isham (1998): A topos perspective on the Kochen-Specker theorem: I. Quantum states as generalized valuations . Int. Jour. Theor. Physics 37(11), pp. 2669-2733, doi:10.1023/A:1026680806775.
- [5] A. Dvureˇ censkij &amp; S. Pulmannov´ a (2000): New Trends in Quantum Structures . Kluwer Academic Publishers, doi:10.1007/978-94-017-2422-7.
- [6] J. Goguen (1972): Minimal realizations of machines in closed categories . Bull. Amer. Math. Soc. 78(5), pp. 777-783, doi:10.1090/S0002-9904-1972-13032-5.

- [7] I. Hasuo, B. Jacobs &amp; A. Sokolova (2007): Generic trace semantics via coinduction . Logical Methods in Computer Science 3(4:11), pp. 1-36.
- [8] B. Jacobs (2010): Convexity, duality and effects . In Cristian Calude &amp; Vladimiro Sassone, editors: Theoretical Computer Science, IFIP Advances in Information and Communication Technology, Springer Boston, pp. 1-19, doi:10.1007/978-3-642-15240-5 1.
- [9] B. Jacobs (2011): Coalgebraic walks, in quantum and Turing computing . In: Lecture Notes in Computer Science, Foundations of Software Science and Computational Structures 6604, pp. 12-26, doi:10.1007/978-3-642-19805-2 2.
- [10] B. Jacobs, A. Silva &amp; A. Sokolova (2012): Trace semantics via determinization . In: Lecture Notes in Computer Science, to appear, Proceedings of CMCS 2012, doi:10.1007/978-3-642-32784-1 7.
- [11] C. Moore &amp; J. Crutchfield (2000): Quantum automata and quantum grammars . Theoretical Computer Science 237(1), pp. 275-306, doi:10.1016/S0304-3975(98)00191-1.
- [12] A. Nerode (1958): Linear automaton transformations . Proc. Amer. Math. Soc. 9(4), pp. 541-544, doi:10.1090/S0002-9939-1958-0135681-9.
- [13] F. Roumen (2012): Coalgebraic semantics for quantum computation . Master's thesis, Radboud University Nijmegen.
- [14] J. Rutten (1998): Automata and coinduction (an exercise in coalgebra) . In D. Sangiorigi &amp; R. de Simone, editors: Proceedings of CONCUR '98, LNCS 1466, Springer, pp. 194-218, doi:10.1007/BFb0055624.
- [15] J. Rutten (2000): Universal coalgebra: a theory of systems . Theoretical Computer Science 249(1), pp. 3-80, doi:10.1016/S0304-3975(00)00056-6.
- [16] A. Silva, F. Bonchi, M. Bonsangue &amp; J. Rutten (2010): Generalizing the powerset construction, coalgebraically . In: Proceedings of the IARCS Annual Conference on Foundations of Software Technology and Theoretical Computer Science, Leibniz International Proceedings in Informatics 8, pp. 272-283, doi:10.4230/LIPIcs.FSTTCS.2010.272.
- [17] S. El´ ıas Venegas-Andraca (2008): Quantum Walks for Computer Scientists . Morgan &amp; Claypool.
Frank Roumen
Coalgebraic Quantum Computation
Coalgebras generalize various kinds of dynamical systems occuring in
mathematics and computer science. Examples of systems that can be modeled as
coalgebras include automata and Markov chains. We will present a coalgebraic
representation of systems occuring in the field of quantum computation, using
convex sets of density matrices as state spaces. This will allow us to derive a
method to convert quantum mechanical systems into simpler probabilistic systems
with the same probabilistic behaviour.