# Topological Quantum Computing and 3-Manifolds

Torsten Asselmeyer-Maluga
German Aerospace Center (DLR),
Rosa-Luxemburg-Str. 2, D-10178 Berlin, Germany;
<EMAIL_ADDRESS>
OrcidId: 0000-0003-4813-1010

###### Abstract

In this paper, we will present some ideas to use 3D topology for quantum
computing. Topological quantum computing in the usual sense works with an
encoding of information as knotted quantum states of topological phases of
matter, thus being locked into topology to prevent decay. Today, the basic
structure is a 2D system to realize anyons with braiding operations. From the
topological point of view, we have to deal with surface topology. However,
usual materials are 3D objects. Possible topologies for these objects can be
more complex than surfaces. From the topological point of view, Thurston’s
geometrization theorem gives the main description of 3-dimensional manifolds.
Here, complements of knots do play a prominent role and are in principle the
main parts to understand 3-manifold topology. For that purpose, we will
construct a quantum system on the complements of a knot in the 3-sphere. The
whole system depends strongly on the topology of this complement, which is
determined by non-contractible, closed curves. Every curve gives a
contribution to the quantum states by a phase (Berry phase). Therefore, the
quantum states can be manipulated by using the knot group (fundamental group
of the knot complement). The universality of these operations was already
showed by M. Planat et al.

##  1 Introduction

Quantum computing exploits quantum-mechanical phenomena such as superposition
and entanglement to perform operations on data, which in many cases, are
infeasible to do efficiently on classical computers. The basis of this data is
the qubit, which is the quantum analog of the classical bit. Many of the
current implementations of qubits, such as trapped ions and superconductors,
are highly susceptible to noise and decoherence because they encode
information in the particles themselves. Topological quantum computing seeks
to implement a more resilient qubit by utilizing non-Abelian forms of matter
to store quantum information. In such a scheme, information is encoded not in
the quasiparticles themselves, but in the manner in which they interact and
are braided. In topological quantum computing, qubits are initialized as non-
abelian anyons, which exist as their own antiparticles. Then, operations (what
we may think of as quantum gates) are performed upon these qubits through
braiding the worldlines of the anyons. Because of the non-Abelian nature of
these particles, the manner in which they are exchanged matters (similar to
non-commutativity). Another important property of these braids to note is that
local perturbations and noise will not impact the state of the system unless
these perturbations are large enough to create new braids. Finally, a
measurement is taken by fusing the particles. Because anyons are their own
antiparticles, the fusion will result in the annihilation of some of the
particles, which can be used as a measurement. We refer to the book in
[Wang(2010)] for an introduction of these ideas.

However, a limiting factor to use topological quantum computing is the usage
of non-abelian anyons. The reason for this is the abelian fundamental group of
a surface. Quantum operations are non-commutative operators leading to
Heisenberg’s uncertainty relation, for instance. Non-abelian groups are at the
root of these operators. Therefore, if we use non-abelian fundamental groups
instead of abelian groups, then (maybe) we do not need non-abelian states to
realize quantum computing. In this paper, we discuss the usage of (non-
abelian) fundamental groups of 3-manifolds for topological quantum computing.
At first, quantum gates are elements of the fundamental group represented as
$SU(2)$ matrices. The set of possible operations depends strongly on the knot,
i.e., the topology. The fundamental group is a topological invariant, thus
making this representation of quantum gates part of topological quantum
computing. In principle, we have two topological ingredients: the knot and the
fundamental group of the knot complement. The main problem now is how these
two ingredients can be realized in a quantum system. In contrast to
topological quantum computing with anyons, we cannot directly use 3-manifolds
(as submanifolds) like surfaces in the fractional Quantum Hall effect.
Surfaces (or 2-manifolds) embed into a 3-dimensional space like
$\mathbb{R}^{3}$ but 3-manifolds require a 5-dimensional space like
$\mathbb{R}^{5}$ as an embedding space. Therefore, we cannot directly use
3-manifolds. However, as we will argue in the next section, there is a group-
theoretical substitute for a 3-manifolds, the fundamental group of a knot
complement also known as knot group. Then, we will discuss the knot group of
the simplest knot, the trefoil. The knot group is the braid group of three
strands used for anyons too. The 1-qubit gates are given by the representation
of the knot group into the group $SU(2)$. Here, one can get all 1-qubit
operations by this method. For an application of these fundamental group
representations to topological quantum computing, we need a realization of the
fundamental group in a quantum systems. Here, we will refer to the one-to-one
connection between the holonomy of a flat $SU(2)$ connection (i.e., vanishing
curvature) and the representation of fundamental group into $SU(2)$. Here, we
will use the Berry phase but the corresponding Berry connection admits a non-
vanishing curvature. However, we will show that one can rearrange the Berry
connection for two-level systems to get a flat $SU(2)$ connection. Then, the
holonomy along this connection only depends on the topology of the knot
complement so that the manipulation of states are topologically induced. All
$SU(2)$-representation of the knot group form the so-called character variety
which contains important information about the knot complement (see in [Kirk
and Klassen(1990)] for instance). However, the non-triviality of the character
variety can be interpreted that knot groups give the 1-qubit operations. In
Section 6, we will discuss the 2-qubit operations by linking two knots. Here,
every link component carries a representation into $SU(2)$. The relation in
the fundamental group induces the interaction term. The interaction terms are
known from the Ising model. Therefore, finally we get a complete set of
operations to realize any quantum circuit: a 1-qubit operation by the knot
group of the trefoil knot and a 2-qubit operation by the complement of the
link (Hopf link for instance). For the universality of these operations we
refer to the work of M. Planat et al. [Planat et al.(2018)Planat, Aschheim,
Amaral, and Irwin, Planat et al.(2019)Planat, Aschheim, Amaral, and Irwin],
which was the main inspiration of this work. This paper followed the idea to
use knots directly for quantum computing. In the focus is the knot complement
which is the space outside of a knot. Then, the knot is one system and the
space outside is a second system. Currently, the author is working on the
concrete realization of this idea. In this paper, I will present the idea in
an abstract manner to clarify whether knot complements are suitable for
quantum computing from informational point of view.

The usage of knots in physics but also biology is not new. One of the pioneers
is Louis H. Kauffman, and we refer to his book [Kauffman(1994)] for many
relations between knot theory and natural science. Furthermore, note his ideas
about topological information [Kauffman(1995)] (see also in [Kauffman(2005),
Boi(2005)]). Knots are also important models in quantum gravity, see, for
instance, in [Baez(2001)], and in particle physics [Bilson-Thompson et
al.(2007)Bilson-Thompson, Markopoulou, and Smolin, Gresnigt(2018), Asselmeyer-
Maluga(2019)].

##  2 Some Preliminaries and Motivation: 3-Manifolds and Knot Complements

The central concept for the following paper is the concept of a smooth
manifold. To present this work as self-contained as possible, we will discuss
some results in the theory of 2- and 3-dimensional manifolds which is the main
motivation for this paper. At first we will give the formal definition of a
manifold:

  * •

Let $M$ be a Hausdorff topological space covered by a (countable) family of
open sets, ${\mathcal{U}}$, together with homeomorphisms,
$\phi_{U}:U\in{\mathcal{U}}\rightarrow U_{R},$ where $U_{R}$ is an open set of
${\mathbb{R}}^{n}.$ This defines $M$ as a topological manifold. For smoothness
we require that, where defined, $\phi_{U}\cdot\phi_{V}^{-1}$ is smooth in
${\mathbb{R}}^{n},$ in the standard multivariable calculus sense. The family
${\mathcal{A}}=\\{{\mathcal{U}},\phi_{U}\\}$ is called an atlas or a
differentiable structure. Obviously, ${\mathcal{A}}$ is not unique. Two
atlases are said to be compatible if their union is also an atlas. From this
comes the notion of a maximal atlas. Finally, the pair $(M,{\mathcal{A}})$,
with ${\mathcal{A}}$ maximal, defines a smooth manifold of dimension $n$.

  * •

An important extension of this construction yields the notion of smooth
manifold with boundary, $M$, defined as above, but with the atlas such that
the range of the coordinate maps, $U_{R},$ may be open in the half space,
${\mathbb{R}}_{+}^{n}$, that is, the subspace of ${\mathbb{R}}^{n}$ for which
one of the coordinates is non-positive, say $x^{n}\leq 0.$ As a subspace of
${\mathbb{R}}^{n},\ {\mathbb{R}}_{+}^{n}$ has a topologically defined
boundary, namely, the set of points for which $x^{n}=0.$ Use this to define
the (smooth) boundary of $M,\ \partial M,$ as the inverse image of these
coordinate boundary points.

In the following, we will concentrate on the special theory of 2- and
3-manifolds (i.e., manifolds of dimension 2, surfaces, or 3). The
classification of 2-manifolds has been known since the 19th century. In
contrast, the corresponding theory for 3-manifolds based on ideas of Thurston
around 1980 but was completed 10 years ago. In both cases—2- and
3-manifolds—the manifold is decomposed by the operation $M\\#N$, the connected
sum.

Let $M,N$ be two $n$-manifolds with boundaries $\partial M,\partial N$. The
connected sum $M\\#N$ is the procedure of cutting out a disk $D^{n}$ from the
interior $int(M)\setminus D^{n}$ and $int(N)\setminus D^{n}$ with the
boundaries $S^{n-1}\sqcup\partial M$ and $S^{n-1}\sqcup\partial N$,
respectively, and gluing them together along the common boundary component
$S^{n-1}$.

For 2-manifolds, the basic elements are the 2-sphere $S^{2}$, the torus
$T^{2}$ or the Klein bottle $\mathbb{R}P^{2}$. Then, one gets for the
classification of 2-manifolds:

  * •

Every compact, closed, oriented 2-manifold is homeomorphic to either $S^{2}$
or the connected sum

$\underbrace{T^{2}\\#T^{2}\\#\ldots\\#T^{2}}_{g}$

of $T^{2}$ for a fixed genus $g$. Every compact, closed, non-oriented
2-manifold is homeomorphic to the connected sum

$\underbrace{{\mathbb{R}}P^{2}\\#{\mathbb{R}}P^{2}\\#\ldots\\#{\mathbb{R}}P^{2}}_{g}$

of ${\mathbb{R}}P^{2}$ for a fixed genus $g$.

  * •

Every compact 2-manifold with boundary can be obtained from one of these cases
by cutting out the specific number of disks $D^{2}$ from one of the connected
sums.

A connected 3-manifold $N$ is prime if it cannot be obtained as a connected
sum of two manifolds $N_{1}\\#N_{2}$ neither of which is the 3-sphere $S^{3}$
(or, equivalently, neither of which is the homeomorphic to $N$). Examples are
the 3-torus $T^{3}$ and $S^{1}\times S^{2}$, but also the Poincare sphere.
According to the work in [Milnor(1962)], any compact, oriented 3-manifold is
the connected sum of an unique (up to homeomorphism) collection of prime
3-manifolds (prime decomposition). A subset of prime manifolds are the
irreducible 3-manifolds. A connected 3-manifold is irreducible if every
differentiable submanifold $S$ homeomorphic to a sphere $S^{2}$ bounds a
subset $D$ (i.e., $\partial D=S$) which is homeomorphic to the closed ball
$D^{3}$. The only prime but reducible 3-manifold is $S^{1}\times S^{2}$.

For the geometric properties (to meet Thurston’s geometrization theorem) we
need a finer decomposition induced by incompressible tori. A properly embedded
connected surface $S\subset N$ is called 2-sided (The “sides” of $S$ then
correspond to the components of the complement of $S$ in a tubular
neighborhood $S\times[0,1]\subset N$.) if its normal bundle is trivial, and
1-sided if its normal bundle is nontrivial. A 2-sided connected surface $S$
other than $S^{2}$ or $D^{2}$ is called incompressible if for each disk
$D\subset N$ with $D\cap S=\partial D$ there is a disk $D^{\prime}\subset S$
with $\partial D\prime=\partial D$. The boundary of a 3-manifold is an
incompressible surface. Most importantly, the 3-sphere $S^{3}$, $S^{2}\times
S^{1}$ and the 3-manifolds $S^{3}/\Gamma$ with $\Gamma\subset SO(4)$ a finite
subgroup do not contain incompressible surfaces. The class of 3-manifolds
$S^{3}/\Gamma$ (the spherical 3-manifolds) include cases like the Poincare
sphere ($\Gamma=I^{*}$ the binary icosaeder group) or lens spaces
($\Gamma=\mathbb{Z}_{p}$ the cyclic group). Let $K_{i}$ be irreducible
3-manifolds containing incompressible surfaces then we can $N$ split into
pieces (along embedded $S^{2}$)

$N=K_{1}\\#\cdots\\#K_{n_{1}}\\#_{n_{2}}S^{1}\times
S^{2}\\#_{n_{3}}S^{3}/\Gamma\,,$ (1)

where $\\#_{n}$ denotes the $n$-fold connected sum and $\Gamma\subset SO(4)$
is a finite subgroup. The decomposition of $N$ is unique up to the order of
the factors. The irreducible 3-manifolds $K_{1},\ldots,\,K_{n_{1}}$ are able
to contain incompressible tori and one can split $K_{i}$ along the tori into
simpler pieces $K=H\cup_{T^{2}}G$ [Jaco and Shalen(1979)] (called the JSJ
decomposition). The two classes $G$ and $H$ are the graph manifold $G$ and
hyperbolic 3-manifold $H$.

In 1982, W.P. Thurston presented a program intended to classify smooth
3-manifolds and solve the Poincare conjecture by investigating the possible
geometries on such 3-manifolds. For a survey of this topic see in
[Thurston(1997)]. The key ingredient of this classification ansatz is the
concept of a model geometry. Again, in this section, all manifolds are assumed
to be smooth.

A model geometry $(G,X)$ consists of a simply connected manifold $X$ together
with a Lie group $G$ of diffeomorphisms acting transitively on $X$ fulfilling
certain set of conditions. One of these is that there is a $G$-invariant
Riemannian metric. For example, reducing the dimension, we can consider
2-dimensional model geometries of a 2-manifold $X$. From Riemannian geometry,
we know that any $G$-invariant Riemannian metric on $X$ has constant Gaussian
curvature (recall that $G$ must be transitive). A constant scaling of the
metric allows us to normalize the curvature to be $0$, $1$, or $-1$
corresponding to the Euclidean (${\mathbb{E}}^{2}$), spherical ($S^{2}$) and
hyperbolic (${\mathbb{H}}^{2}$) space, respectively. Thus, there are precisely
three two-dimensional model geometries: spherical, Euclidean, and hyperbolic.

It is a surprising fact that there are also a finite number of three-
dimensional model geometries. It turns out that there are eight geometries:
spherical, Euclidean, hyperbolic, mixed spherical-Euclidian, mixed hyperbolic-
Euclidian, and three exceptional cases. A geometric structure on a more
general manifold $M$ (not necessarily simply connected) is defined by a model
geometry $(G,X)$ where $X$ is the universal covering space to $M$, i.e.,
$M=X/\pi_{1}(M)$. This is equivalent to a representation $\pi_{1}(M)\to G$ of
the fundamental group into $G$. Of course a geometric structure on a
3-manifold may not be unique but Thurston explored decompositions into pieces
each of which admit a unique geometric structure. This decomposition proceeds
by splitting $M$ into essentially unique pieces using embedded 2-spheres and
2-tori in such a way that a model geometry can be defined on each piece. Thus,

  * •

Thurston’s Geometrization conjecture can be stated:

The interior of every compact 3-manifold has a canonical decomposition into
pieces (described above), which have one of the eight geometric structures.

In short, every 3-manifold can be uniquely decomposed (long 2-spheres) into
prime manifolds where some of these prime manifolds can be further split
(along 2-tori) into graph $G$ and hyperbolic manifolds $H$. Then, $G,H$ have a
disjoint union of 2-tori as boundary; but how can we construct these manifolds
having a geometric structure? A knot in mathematics is the embedding of a
circle into the 3-sphere $S^{3}$ (or in $\mathbb{R}^{3}$), i.e., a closed
knotted curve. Let $K$ be a prime knot (a knot not decomposable by a sum of
two knots). With $K\times D^{2}$ we denote a thicken knot, i.e. a closed
knotted solid torus. The knot complement $C(K)=S^{3}\setminus\left(K\times
D^{2}\right)$ is a 3-manifold with boundary $\partial C(K)=T^{2}$. It was
shown that prime knots are divided into two classes: hyperbolic knots ($C(K)$
admits a hyperbolic structure) and non-hyperbolic knots ($C(K)$ admits one of
the other seven geometric structures). An embedding of disjoints circles into
$S^{3}$ is called a link $L.$ Then, $C(L)$ is the link complement. Here, the
situation is more complicated: $C(L)$ can admit a geometric structure or it
can be decomposed into pieces with a geometric structure. $C(L),C(K)$ are one
of the main models for $G$ or $H$ for suitable knots and links. If we speak
about 3-manifolds then we have to consider $C(K)$ as one of the basic pieces.
Furthermore, there is the Gordon–Luecke theorem: if two knot complements are
homeomorphic, then the knots are equivalent (see in [Gordon and Luecke(1989)]
for the statement of the exact theorem). Interestingly, knot complements of
prime knots are determined by its fundamental group. For the fundamental
group, one considers closed curves which are not contractible. Furthermore,
two curves are equivalent if one can deform them into each other (homotopy
relation). The concatenation of curves can be made into a group operation up
to deformation equivalence (i.e., homotopy). Formally, it is the set of
homotopy classes $[S^{1},X]$ of maps $S^{1}\to X$ (the closed curves) into a
space $X$ up to homopy, denoted by $\pi_{1}(X)$. The fundamental group
$\pi_{1}(C(K))$ of the knot complement is also known as knot group. Here, we
refer to the books in [Rolfson(1976), Kauffman(1994), Prasolov and
Sossinisky(1997)] for a good introduction into this theory. The main idea of
this paper is the usage of the knot group as substitute for a 3-manifold and
try to use this group for quantum computing.

##  3 Knot Complement of the Trefoil Knot and the Braid Group $B_{3}$

Any knot can be represented by a projection on the plane with no multiple
points which are more than double. As an example let us consider the simplest
knot, the trefoil knot $3_{1}$ (knot with three crossings).

The plane projection of the trefoil is shown in Figure 1. This projection can
be divided into three arcs, around each arc we have a closed curve as
generator of $\pi_{1}(C(3_{1}))$ denoted by $a,b,c$ (see also Figure 2 for the
definition of the generators $a,b$). Now each crossing gives a relation
between the corresponding generators: $c=a^{-1}ba,b=c^{-1}ac,a=b^{-1}cb$,
i.e., we get the knot group

$\pi_{1}(C(3_{1}))=\langle a,b,c|\,c=a^{-1}ba,b=c^{-1}ac,a=b^{-1}cb\rangle$

Then, we substitute the expression $c=a^{-1}ba$ into the other relations to
get a representation of the knot with two generators and one relation. From
relation $a=b^{-1}cb$ we will obtain $a=b^{-1}(a^{-1}ba)b$ or $bab=aba$ and
the other relation $b=c^{-1}ac$ gives nothing new. Finally, we will get the
well-known result

$\pi_{1}(C(3_{1}))=\langle a,b|\,bab=aba\rangle$

However, this group is also well known; it is the braid group $B_{3}$ of three
strands. In general, the braid group $B_{n}$ is generated by
$\left\\{1,\sigma_{1},\ldots,\sigma_{n-1}\right\\}$ subject to the relations
(see in [Prasolov and Sossinisky(1997)])

$\sigma_{i}\sigma_{i+1}\sigma_{i}=\sigma_{i+1}\sigma_{i}\sigma_{i+1}\qquad\sigma_{i}\sigma_{j}=\sigma_{j}\sigma_{i}\quad|i-j|>1$

For $B_{3}$ we have two generators $\sigma_{1},\sigma_{2}$ with one relation
$\sigma_{1}\sigma_{2}\sigma_{1}=\sigma_{2}\sigma_{1}\sigma_{2}$ agreeing with
$\pi_{1}(C(3_{1}))$. The braid group $B_{3}$ has connections to different
areas. Notable is the relation to the modular group $SL(2,\mathbb{Z})$ (the
group of integer $2\times 2$ matrices with unit determinant) generated by

$S=\left(\begin{array}[]{cc}0&1\\\ -1&0\end{array}\right)\qquad
U=\left(\begin{array}[]{cc}1&1\\\ -1&0\end{array}\right)$

It is well-known that $B_{3}$ maps surjectively onto $SL(2,\mathbb{Z})$ via
the map

$\sigma_{1}\mapsto\left(\begin{array}[]{cc}1&1\\\
0&1\end{array}\right)\qquad\sigma_{2}\mapsto\left(\begin{array}[]{cc}1&0\\\
-1&1\end{array}\right)$

However, then $\sigma_{1}\sigma_{2}\sigma_{1}=\sigma_{2}\sigma_{1}\sigma_{2}$
maps to $S$ and $\sigma_{1}\sigma_{2}$ maps to $U$. It is interesting to note
that $(\sigma_{1}\sigma_{2})^{3}$ is in the center $Z$ of $B_{3}$ (i.e., this
elements commutes with all other elements) and
$B_{3}/Z=SL(2,\mathbb{Z})/\left\\{\pm 1\right\\}$, or $B_{3}$ is the central
extension of $PSL(2,\mathbb{Z})=SL(2,\mathbb{Z})/\left\\{\pm 1\right\\}$ (the
$(2,3,\infty)$ triangle group) by the integers $\mathbb{Z}$ (see [Asselmeyer-
Maluga(2019)] for an application of this relation in physics).

Figure 1: The simplest knot, trefoil knot $3_{1}$.  Figure 2: Generators (red
circle) $a,b$ of knot group for trefoil $3_{1}$.

##  4 Using the Trefoil Knot Complement for Quantum Computing

In this section, we will get in touch with quantum computing. The main idea is
the interpretation of the braid group $B_{3}$ as operations (gates) on qubits.
From the mathematical point of view, we have to consider the representation of
$B_{3}$ into $SU(2)$, i.e., a homomorphism

$\phi:B_{3}\to SU(2)$

mapping sequences of generators (called words) into matrices as elements of
$SU(2)$. For completeness we will study some representations. Here, we follow
the work in [Kauffman and Lomonaco(2008)] to illustrate the general theory. At
first, we note that a matrix in $SU(2)$ has the form

$M=\left(\begin{array}[]{cc}z&w\\\
-\bar{w}&\bar{z}\end{array}\right)\qquad|z|^{2}+|w|^{2}=1$

where $z$ and $w$ are complex numbers. Now we choose a well-known basis of
$SU(2)$:

$\boldsymbol{1}=\left(\begin{array}[]{cc}1&0\\\
0&1\end{array}\right)\quad\boldsymbol{i}=\left(\begin{array}[]{cc}i&0\\\
0&-i\end{array}\right)\quad\boldsymbol{j}=\left(\begin{array}[]{cc}0&1\\\
-1&0\end{array}\right)\quad\boldsymbol{k}=\left(\begin{array}[]{cc}0&i\\\
i&0\end{array}\right)$ (2)

so that

$M=a\boldsymbol{1}+b\boldsymbol{i}+c\boldsymbol{j}+d\boldsymbol{k}$

with $a^{2}+b^{2}+c^{2}+d^{2}=1$ (and $z=a+bi,w=c+di$). The algebra of
$\boldsymbol{1},\boldsymbol{i},\boldsymbol{j},\boldsymbol{k}$ are known as
quaternions (with relations $ij=k$, $I^{2}=j^{2}=k^{2}=-1$). In the following,
we will switch between the usual basis $1,i,j,k$ of the quaternions and the
matrix representation with basis
$\boldsymbol{1},\boldsymbol{i},\boldsymbol{j},\boldsymbol{k}$, see (2). Then,
the unit quaternions (of length 1) can be identified with the elements of
$SU(2)$. Pure quaternions are defined by all expressions
$b\boldsymbol{i}+c\boldsymbol{j}+d\boldsymbol{k}$ (i.e., $a=0$). Now, the
homomorphism $\phi$ above is the mapping

$g=\phi(\sigma_{1}),\quad h=\phi(\sigma_{2})$

so that $ghg=hgh$. Let $u,v$ be pure quaternions of length $1$ (unit, pure
quaternions). Now, for $g=a+bu$ and $h=c+dv$ we have to choose

$g=a+bu,\>h=a+bv,\>bu\cdot bv=a^{2}-\frac{1}{2}$

(see in [Kauffman and Lomonaco(2008)] for the proof) for the image of the
homomorphism $\phi$ then the relation of the $B_{3}$ is fulfilled, or we have
a representation of $B_{3}$ into $SU(2)$.

For more practical scenarios this general representation is the following
construction. Let us choose

$g=e^{i\theta}=a+b\text{i}$

where $a=\cos(\theta)$ and $b=\sin(\theta).$ Let

$h=a+b\left[(c^{2}-s^{2}){i}+2cs\cdot{k}\right]$

where $c^{2}+s^{2}=1$ and $c^{2}-s^{2}=\frac{a^{2}-b^{2}}{2b^{2}}$. Then we
are able to rewrite $g,h$ as matrices $G,H$. In principle, the matrices $G,H$
can be obtained from the expressions above by a switch of the basis, i.e.,

$G=\exp(\theta\boldsymbol{i})\qquad
H=a\boldsymbol{1}+b\left[(c^{2}-s^{2})\boldsymbol{i}+2cs\boldsymbol{k}\right]$

Here, we choose $H=FGF^{+}$ and

$G=\left(\begin{array}[]{cc}e^{i\theta}&0\\\
0&e^{-i\theta}\end{array}\right)\qquad F=\left(\begin{array}[]{cc}ic&is\\\
is&-ic\end{array}\right)$

Among this class of representations, there is the simplest example

$g=e^{7\pi i/10},\>f=i\tau+k\sqrt{\tau},\>h=fgf^{-1}$

where $\tau^{2}+\tau=1$. Then, $g,h$ satisfy $ghg=hgh$ the relation of
$B_{3}$. This representation is known as the Fibonacci representation of
$B_{3}$ to $SU(2)$. The Fibonacci representation is dense in $SU(2)$, see
[Wang(2010)]. This representation is generated by the 20th root of unity.
Other dense representations are given by $4r$th roots of unity via recoupling
theory, see Sections 1.3 and 1.4 in [Wang(2010)].

##  5 Knot Group Representations via Berry Phases

In the previous section we discussed, the representations of the knot group
into $SU(2)$ to realize the 1-qubit operations. Central point in this paper is
the representation

$\phi:\pi_{1}\left(C(K)\right)\to SU(2)$

of the knot group. The fundamental group is a topological invariant and we
have to realize this group in a quantum system. In this section, we will
realize these 1-qubit gates, the 2-qubit gate will be described in the next
section. Here, we will discuss the direct realization of the knot group, i.e.,
the fundamental group of the knot complement. We will not discuss the abstract
representation of the group $\pi_{1}(C(K))$ by quantum gates which is also
possible. For that purpose we have to define the fundamental group more
carefully. Let $X$ be a topological space or a manifold. A map
$\gamma:[0,1]\to X$ with $\gamma(0)=\gamma(1)$ is a closed curve. Two curves
$\gamma_{1},\gamma_{2}$ are homotopic $\gamma_{1}\simeq\gamma_{2}$ if there is
a one-parameter family of continuous maps which deform $\gamma_{1}$ to
$\gamma_{2}$. The concatenation $\gamma_{1}\\#\gamma_{2}$ of curves (up to
homotopy) is the group operation making the set of homotopy classes of closed
curves to a group, the fundamental group $\pi_{1}(X)$. Now, we will discuss
the representation of the fundamental group by the holonomy along a closed
curve, i.e., by an integral of a gauge connection or potential along a closed
curve. As shown by Milnor [Milnor(1958)], there is one-to-one relation between
a homomorphism $\pi_{1}(X)\to G$ into the Lie group $G$ and the integral

$\ointop_{\gamma}A\qquad\mbox{with}\qquad dA+A\wedge A=0$

of a flat $G$-connection $A$, i.e., this integral depends only on the homotopy
class of the closed curve $\gamma$. In our case, we will interpret the
representation

$\phi:\pi_{1}\left(C(K)\right)\to SU(2)$

up to conjugation as a flat connection of a $SU(2)$ principal bundle over the
knot complement $C(K)$. Let $P$ be a $SU(2)$ principal fiber bundle over
$C(K)$ with connection $A$ locally represented by a 1-form with values in the
adjoint representation of the Lie algebra $\mathfrak{su}(2)$, i.e.,
$A\in\Lambda^{1}(C(K))\otimes ad(\mathfrak{su}(2))$. The connection is flat if
the curvature

$F=dA+A\wedge A=0$

vanishes. In this case (see Milnor [Milnor(1958)]) the integral

$\ointop_{\gamma}A$

along a closed curve $\gamma:S^{1}\to C(K)$ depends only on the homotopy class
$[\gamma]\in\pi_{1}\left(C(K)\right)$ and the exponential

$\pi_{1}(C(K))\ni\gamma\to\phi(\gamma)=\mathcal{P}\exp\left(\ointop_{\gamma}A\right)\in
SU(2)$

for varying closed curves ($\mathcal{P}$ path ordering operator) gives a
representation $\pi_{1}\left(C(K)\right)\to SU(2)$. However, which quantum
system realized this representation? Let us consider the Hamiltonian

$H=H_{0}+h$

with a non-adiabatic and adiabatic part. The whole Hamiltonian has to fulfill
the usual Schrödinger equation

$i\hbar\frac{\partial}{\partial t}|\psi\rangle=H|\psi\rangle$

and we have to demand that each eigenstate $|k_{n}\rangle$ of the Hamiltonian
$h$ with discrete spectrum

$h|k_{n}\rangle=E_{n}|k_{n}\rangle$

develops independently in time. Then, we have the decomposition

$|\psi\rangle=\sum_{n}a_{n}|k_{n}\rangle$

leading to the solution

$a_{n}=\exp\left(-\frac{i}{\hbar}\int
E_{n}(\tau)d\tau\right)\exp\left(\intop\langle
k_{n}|\frac{\partial}{\partial\tau}|k_{n}\rangle d\tau\right)$

where the second expression is known as geometric phase or Berry phase.
Usually the states are parameterized by some manifold $M$ with coordinates
$x=x(t)$ and we consider a cyclic evolution $x(0)=x(T)$, i.e., closed curves
in $M$. Then, the Berry phase is given by

$\theta_{top}=\ointop_{\gamma}\langle k_{n}|d|k_{n}\rangle$

and the expression $A_{Berry}=\langle k_{n}|d|k_{n}\rangle$ as Berry
connection. This solution is well known and for completeness we described it
here again. At first, the Berry connection is the connection of $U(1)$
principal bundle. Second, the curvature $\Omega=dA_{Berry}$ is non-zero.
Therefore, at the first view we cannot use this connection to represent the
knot group. We need a connection with values in $SU(2)$ to get a
representation for $\phi$ via $\exp(\theta_{top})$. Our idea is now to
rearrange the components of the Berry connection (including the off-diagonal
terms) to produce a $SU(2)$ connection. For that purpose, we will restrict the
system to a 2-level system, $|k_{0}\rangle,|k_{1}\rangle$. Then, we remark
that the Lie algebra $\mathfrak{su}(2)$ is generated by the three Pauli
matrices $\sigma_{x},\sigma_{y},\sigma_{z}$ so that every element is given by
a linear combination $a\cdot\sigma_{x}+b\cdot\sigma_{y}+c\cdot\sigma_{z}$. Now
we arrange the possible connection components $\omega_{nm}=\langle
k_{n}|d|k_{m}\rangle$ into one matrix

$\omega=\left(\begin{array}[]{cc}\langle k_{0}|d|k_{0}\rangle&\langle
k_{0}|d|k_{1}\rangle\\\ \langle k_{1}|d|k_{0}\rangle&\langle
k_{1}|d|k_{1}\rangle\end{array}\right)$

with the decomposition

$\omega=\langle
k_{0}|d|k_{0}\rangle\frac{\boldsymbol{1}+\sigma_{z}}{2}+\langle
k_{1}|d|k_{1}\rangle\frac{\boldsymbol{1}-\sigma_{z}}{2}+\Re(\langle
k_{0}|d|k_{1}\rangle)\sigma_{x}+\Im\langle k_{0}|d|k_{1}\rangle\sigma_{y}$

By using the normalization $\langle k_{n}|k_{m}\rangle=\delta_{nm}$ one gets

$0=d\left(\langle k_{n}|k_{m}\rangle\right)=\omega_{nm}^{*}+\omega_{nm}$

and

$d\omega_{nm}=\sum_{k}\omega_{nk}^{*}\wedge\omega_{km}=-\sum_{k}\omega_{nk}\wedge\omega_{km}$

so that we obtain for the curvature $\Omega$

$\Omega=d\omega+\omega\wedge\omega=0$

Obviously $\omega$ is a connection of a flat $SU(2)$ bundle and the integral

$\ointop_{\gamma}\omega$

depends only on the homotopy class of the closed curve $\gamma$, as we want.
The off-diagonal terms like $\langle k_{0}|d|k_{1}\rangle$ of the connection
$\omega$ can be calculated with respect to the expectation values of $dh$.
Together with the eigenvalues $E_{0},E_{1}$ of $h$ for
$|k_{0}\rangle,|k_{1}\rangle$, respectively, we obtain, for instance,

$\langle k_{0}|d|k_{1}\rangle=\frac{\langle
k_{0}|dh|k_{1}\rangle}{E_{0}-E_{1}}$

Then, the exponential of this integral gives a representation $\phi$ of the
fundamental group into $SU(2).$ Now we go back to the trefoil knot complement
$C(3_{1})$ with fundamental group $\pi_{1}(C(3_{1}))=B_{3}$. Then, the Berry
phases along the two generators $a,b$ (i.e., two closed curves) of the
fundamental group $\pi_{1}\left(C(3_{1})\right)=B_{3}$ generate the 1-Qubit
operations. Via the Berry phases, these operations act on the quantum system
to influence its state. Keeping this idea in mind, we have the following
scheme: consider a qubit on the trefoil knot and consider the two generators
$a,b$ of the knot group (see Figure 2).

If we do manipulations along these two closed curves we are able to influence
the qubit by using the Berry phase. Here, we refer to the work [Zu et
al.(2014)Zu, Wang, He, Zhang, Dai, Wang, and Duan] for ideas to use the Berry
phase for quantum computing.

##  6 Linking and 2-Qubit Operations

In the previous section, we described the appearance of the braid group
$B_{3}$ as fundamental group of the trefoil knot complement. Above we
described the situation that the knot complement of the trefoil knot
determines the operations or quantum gates. In this case, the quantum gates
are braiding operations (used for anyons) for three-strand braids.
Unfortunately, the $SU(2)-$representations of the braid group $B_{3}$ are only
1-qubit gates but one needs at least a 2-qubit gate like CNOT to represent any
quantum circuit. It is known that for 2-qubit operations, one needs elements
of the braid group $B_{6}$. Is there other knot complements having braid
groups as fundamental groups? Unfortunately, the answer is no. Here, is the
line of arguments: every knot complement is determined by the fundamental
group (aspherical space), then the cohomology of knot complements is
determined by the first two groups ($0$th and $1$th), all other groups are
given by duality. But the braid groups $B_{n}$ for $n>3$ have non-trivial
cohomology groups in degree 3 or higher which is impossible for knot
complements.

In the previous sections, we describe the knot complement of the simplest
knot, the trefoil. However, there are more complicated knots. The complexity
of knots is measured by the number of crossings. There is only one knot with
three crossings (trefoil) and with four crossings (figure-8). For the figure-8
knot $4_{1}$ (see Figure 3), the knot group is given by

$\pi_{1}\left(C(4_{1})\right)=\langle a,b\,|\>bab^{-1}ab=aba^{-1}ba\rangle$

admitting a representation $\phi$ into $SU(2)$, see [Kirk and Klassen(1990)].

Figure 3: figure-8 knot $4_{1}$.

Here, we remark that the figure-8 knot is part of a large class, the so-called
hyperbolic knots. Hyperbolic knots are characterized by the property that the
knot complement admits a hyperbolic geometry. Hyperbolic knot complements have
special properties, in particular topology and geometry are connected in a
special way. We will come back to these ideas in our forthcoming work. As
explained above, knot groups admit representations into $SU(2)$ leading to
1-qubit operations. Therefore, we have to change the complexity in another
direction by adding more components, i.e., we have to go from knots to links.
The simplest link is the Hopf link (denoted as $L2a1$, see Figure 4), the
linking of two unknotted curves.

Figure 4: Hopf link $L2a1$.

The knot group is simply

$\pi_{1}\left(C(L2a1)\right)=\langle
a,b\,|\,aba^{-1}b^{-1}=[a,b]=e\rangle=\mathbb{Z}\oplus\mathbb{Z}$

Here, we will discuss a toy model, every component is related to a $SU(2)$
representation, i.e., the knot group $\pi_{1}(C(L2a1))$ is represented as
$SU(2)\otimes SU(2)$ via the Berry connection. Now we associate to each
component of the link a representation and a generator of $SU(2)$ (i.e.,
$\sigma_{x},\sigma_{y}$ or $\sigma_{z}$), say $\sigma_{x}$ to one component
(the generator $a\in\pi_{1}\left(C(L2a1)\right)$) and $\sigma_{z}$ to the
other component (the generator $b\in\pi_{1}\left(C(L2a1)\right)$). By using
the relation between the group commutator and the Lie algebra commutator of
the enveloped Lie algebra $U(SU(2))$, we want to express the relation
$[a,b]=e$ via the exponential of the commutator
$\sigma_{x}\otimes\sigma_{z}-\sigma_{z}\otimes\sigma_{x}$ via the usual
relation between the Lie algebra commutator and this commutator. It induces a
representation

$\pi_{1}\left(C(L2a1)\right)\to SU(2)\otimes SU(2)$

by using the exponential map $\exp(\mathfrak{su}(2)\otimes\mathfrak{su}(2))$.
The relation in $\pi_{1}\left(C(L2a1)\right)$ can be expressed as Lagrangian
multiplier (in the usual way) so that we get the Hamiltonian

$H=\sigma_{x}\otimes\sigma_{z}-\sigma_{z}\otimes\sigma_{x}$

and we get the qubit operation by the exponential

$U=\exp(it(\sigma_{x}\otimes\sigma_{z}-\sigma_{z}\otimes\sigma_{x}))$

for a suitable time $t$. Now we see the principle: we associate a term
$\sigma_{x}\otimes\sigma_{z}$ to an over-crossing between the two components
and a term $\sigma_{z}\otimes\sigma_{x}$ for the under-crossing. In the last
example, we will consider the famous Whitehead link (see Figure 5).

Figure 5: Whitehead link $Wh$.

The knot group is given by

$\pi_{1}\left(C(Wh)\right)=\langle
x,y\>|\>[x,y][x,y^{-1}][x^{-1},y^{-1}][x^{-1},y]=e\rangle$

and as described above we will associate the tensor products of the generators
to the over-crossings or under-crossings between the components. Then, we will
get

$H=2\sigma_{x}\otimes\sigma_{z}-2\sigma_{z}\otimes\sigma_{x}$

with the operation

$U=\exp(i2t(\sigma_{x}\otimes\sigma_{z}-\sigma_{z}\otimes\sigma_{x}))$

with another choice of the time variable.

##  7 Discussion

In this paper, we presented some ideas to use 3-manifolds for quantum
computing. A direct usage for surfaces (related to anyons) is not possible,
but we explained above that the best representative is the fundamental group
of a manifold. The fundamental group is the set of closed curves up to
deformation with concatenation as group operation (also up to deformation).
Every 3-manifold can be decomposed into simple pieces so that every piece
carries a geometric structure (out of eight classes). In principle, the pieces
consist of complements of knots and links. Then, the fundamental group of the
knot complement, known as knot group, is an important invariant of the knot or
link. Why not use this knot group for quantum computing? In [Planat and
Zainuddin(2017), Planat and Rukhsan-Ul-Haq(2017), Planat et al.(2018)Planat,
Aschheim, Amaral, and Irwin, Planat et al.(2019)Planat, Aschheim, Amaral, and
Irwin], M. Planat et al. studied the representation of knot groups and the
usage for quantum computing. Here, we discussed a direct relation between the
knot complement and quantum computing via the Berry phase. The knot group
determines the operations where we fix a suitable $SU(2)$ representation. As a
result, we get all 1-qubit operations for a knot. Then, we discussed the
construction of 2-qubit operations by the linking of two knots. The concrete
realization of these ideas by a device will be shifted to our forthcoming
work.

## Acknowledgments

I acknowledge useful discussions with Michel Planat. Furthermore, I
acknowledge the helpful remarks and questions of the referees leading to
better readability of this paper.

## References

  * [Wang(2010)] Wang, Z.  Topological Quantum Computation; Regional Conference Series in Mathematical/NSF-CBMS; AMS: Providence, Rhode Island, 2010; Volume 112.
  * [Kirk and Klassen(1990)] Kirk, P.; Klassen, E.  Chern-Simons invariants of 3-manifolds and representation spaces of knot groups.  Math. Ann. 1990, 287, 343–367.
  * [Planat et al.(2018)Planat, Aschheim, Amaral, and Irwin] Planat, M.; Aschheim, R.; Amaral, M.; Irwin, K.  Universal quantum computing and three-manifolds.  Symmetry 2018, 10, 773.
  * [Planat et al.(2019)Planat, Aschheim, Amaral, and Irwin] Planat, M.; Aschheim, R.; Amaral, M.; Irwin, K.  Quantum computing, Seifert surfaces and singular fibers.  Quantum Rep. 2019, 1, 3, doi:10.3390/quantum1010003.
  * [Kauffman(1994)] Kauffman, L.  Knots and Physics; Series on Knots and Everything; World Scientific: Singapore, 1994; Volume 1.
  * [Kauffman(1995)] Kauffman, L.  Knot Logic. In Knots and Applications; Kauffman, L., Ed.; Series on Knots and Everything; World Scientific: Singapore, 1995; Volume 6, pp. 1–110.
  * [Kauffman(2005)] Kauffman, L.  Knots. In Geometries of Nature, Living Systems and Human Cognition : New Interactions of Mathematics with Natural Sciences and Humanities; World Scientific: Singapore, 2005; pp. 131–202.
  * [Boi(2005)] Boi, L.  Topological Knot Models. In Geometries of Nature, Living Systems and Human Cognition : New Interactions of Mathematics with Natural Sciences and Humanities; World Scientific: Singapore, 2005; pp. 203–278.
  * [Baez(2001)] Baez, J.  Higher-dimensional Algebra and Planck-scale Physics. In Physics Meets Philosophy at the Planck Scale; Callender, C., Huggett, N., Eds.; Cambridge University Press: Cambridge, UK, 2001; pp. 177–195.
  * [Bilson-Thompson et al.(2007)Bilson-Thompson, Markopoulou, and Smolin] Bilson-Thompson, S.; Markopoulou, F.; Smolin, L.  Quantum Gravity and the Standard Model.  Class. Quant. Grav. 2007, 24, 3975–3994.
  * [Gresnigt(2018)] Gresnigt, N.  Braids, Normed Division Algebras, and Standard Model Symmetries.  Phys. Lett. B 2018, 783, 212–221, doi:10.1016/j.physletb.2018.06.057.
  * [Asselmeyer-Maluga(2019)] Asselmeyer-Maluga, T.  Braids, 3-Manifolds, Elementary Particles: Number Theory and Symmetry in Particle Physics.  Symmetry 2019, 11, 1298, doi:10.3390/sym11101298.
  * [Milnor(1962)] Milnor, J.  A unique decomposition theorem for 3-manifolds.  Amer. J. Math. 1962, 84, doi:10.2307/2372800.
  * [Jaco and Shalen(1979)] Jaco, W.; Shalen, P.  Seifert Fibered Spaces in 3-Manifolds; Academic Press: Cambridge, MA, USA, 1979; Volume 21.
  * [Thurston(1997)] Thurston, W.  Three-Dimensional Geometry and Topology, 2nd ed.; Princeton University Press: Princeton, NJ, USA, 1997.
  * [Gordon and Luecke(1989)] Gordon, C.; Luecke, J.  Knots are determined by their complements.  J. Am. Math. Soc. 1989, 2, 371–415,  doi:10.1090/S0894-0347-1989-0965210-7.
  * [Rolfson(1976)] Rolfson, D.  Knots and Links; Publish or Prish: Berkeley, CA, USA, 1976.
  * [Prasolov and Sossinisky(1997)] Prasolov, V.; Sossinisky, A.  Knots, Links, Braids and 3-Manifolds; AMS: Providence, RI, USA, 1997\.
  * [Kauffman and Lomonaco(2008)] Kauffman, L.; Lomonaco, S.  Topological quantum computing and SU(2) braid group representations.  In Proceedings of the SPIE 6976, Quantum Information and Computation VI, 69760M, Orlando, FL, USA, 24 March 2008; The International Society for Optical Engineering: Bellingham, WA, USA, 2008; Volume 6976, doi:10.1117/12.778068.
  * [Milnor(1958)] Milnor, J.  On the existence of a connection with curvature zero.  Comment. Math. Helv. 1958, 32, 215–223,  doi:10.1007/BF02564579.
  * [Zu et al.(2014)Zu, Wang, He, Zhang, Dai, Wang, and Duan] Zu, C.; Wang, W.B.; He, L.; Zhang, W.G.; Dai, C.Y.; Wang, F.; Duan, L.M.  Experimental Realization of Universal Geometric Quantum Gates with Solid-State Spins.  Nature 2014, 514, 72,  doi:10.1038/nature13729.
  * [Planat and Zainuddin(2017)] Planat, M.; Zainuddin, H.  Zoology of Atlas-Groups: Dessins d’enfants, Finite Geometries and Quantum Commutation.  Mathematics 2017, 5, 6, doi:10.3390/math5010006.
  * [Planat and Rukhsan-Ul-Haq(2017)] Planat, M.; Rukhsan-Ul-Haq.  The Magic of Universal Quantum Computing with Permutations.  Adv. Math. Phys. 2017, 2017, 5287862.


Runners in action

Danel Ahman Andrej Bauer

Faculty of Mathematics and Physics

University of Ljubljana, Slovenia

Runners of algebraic effects, also known as comodels, provide a mathematical
model of resource management. We show that they also give rise to a programming
concept that models top-level external resources, as well as allows programmers
to modularly define their own intermediate “virtual machines”.
We capture the core ideas of programming with runners in an equational calculus $\lambdacoop$, which we equip
with a sound and coherent denotational semantics that guarantees the linear use of
resources and execution of finalisation code. We accompany $\lambdacoop$ with
examples of runners in action, provide a prototype language implementation in OCaml,
as well as a Haskell library based on $\lambdacoop$.

theoremThm. #2#1#3
theoremThm. #2#1#3

propositionProp. #2#1#3
propositionProp. #2#1#3

figureFig. #2#1#3
figureFig. #2#1#3

§ RUNNERS IN ACTION

Let us show examples that demonstrate how runners can be usefully combined to provide flexible
resource management.

We implemented these and other examples in the language Coop and a library
Haskell-Coop, see <ref>.

To make the code more understandable, we do not adhere strictly to the syntax of
$\lambdacoop$, e.g., we use the generic versions of effects [26],
as is customary in programming, and effectful initialisation of
kernel state as discussed in <ref>.

In <ref>, we considered a runner $\mathsf{fileIO}$ for basic file
operations. Let us suppose that $\mathsf{fileIO}$ is implemented by immediate calls to the
operating system. Sometimes, we might prefer to accumulate writes and
commit them all at once, which can be accomplished by interposing between $\mathsf{fileIO}$
and user code the following runner $\mathsf{accIO}$, which accumulates writes in its state:

write s' -> let s = getenv () in setenv (concat s s') $_\tm{string}$

By nesting the runners, and calling the outer $\tm{write}$ (the one of $\mathsf{fileIO}$) only in the finalisation
code for $\mathsf{accIO}$, the accumulated writes are commited all at once:

using fileIO @ (open "hello.txt") run
using accIO @ (return "") run
write "Hello, world."; write "Hello, again."
finally  return x @ s -> write s; return x
finally  return x @ fh -> ... , raise QuotaExceeded @ fh -> ... , kill IOError -> ...

Above, $\mathsf{accIO}$ implements the same signature as $\mathsf{fileIO}$ and
thus intercepts operations without the user code being aware of it.
This kind of invisibility
can be more generally used to implement instrumentation:

using  ..., op x -> let c = getenv () in setenv (c+1); op x, ... $_\tm{int}$ @ (return 0) run
finally  return x @ c -> report_cost c; return x, ...

Here the interposed runner implements all operations of some enveloping runner,
by simply forwarding them,
while also measuring computational cost
by counting the total number of operation calls,
which is then reported during finalisation.

[ML-style references]

Continuing with the theme of nested runners, they can also be used to implement abstract
and safe interfaces to low-level resources. For instance, suppose we have a low-level
implementation of a memory heap that potentially allows unsafe memory access, and we would
like to implement ML-style references on top of it. A good first attempt is the runner

ref x -> let h = getenv () in
let (r,h') = malloc h x in
setenv h'; return r,
get r -> let h = getenv () in memread h r,
put (r, x) -> let h = getenv () in memset h r x $_\tm{heap}$

which has the desired interface, but still suffers from three deficiencies that can be
addressed with further language support. First, abstract types would let us hide the
fact that references are just memory locations, so that the user code could never devise
invalid references or otherwise misuse them. Second, our simple typing discipline forces
all references to hold the same type, but in reality we want them to have different types.
This could be achieved through quantification over types in the low-level implementation of
the heap, as we have done in the Haskell-Coop library using Haskell's $\mathsf{forall}$.
Third, user code could hijack a reference and
misuse it out of the scope of the runner, which is difficult to prevent. In practice the
problem does not occur because, so to speak, the runner for references is at the very top level,
from which user code cannot escape.

[Monotonic state]

Nested runners can also implement access restrictions to resources,
with applications in security [8]. For example, we can restrict
the references from the previous example to be used monotonically by associating
a preorder with each reference, which assignments then have to obey.
This idea is similar to how monotonic state is implemented in the $\mathrm{F}^{*}$
language [2], except that we make dynamic checks where
$\mathrm{F}^{*}$ statically uses dependent types.

While we could simply modify the previous example, it is better to implement a new runner which
is nested inside the previous one, so that we obtain a modular solution that works with
any runner implementing operations $\tm{ref}$, $\tm{get}$, and $\tm{put}$:

mref x rel -> let r = ref x in
let m = getenv () in
setenv (add m (r,rel)); return r,
mget r -> get r,
mput (r, y) -> let x = get r in
$\,$let m = getenv () in
$\,$match (sel m r) with
$\,$| inl rel -> if (rel x y) then put (r, y)
$\,\,$else raise MonotonicityViolation
$\,$| inr () -> kill NoPreoderFound $_{\tm{map} (\tm{ref}, \tm{intRel})}$

The runner's state is a map from references to preorders on integers. The co-operation $\tm{mref~x~rel}$ creates a new
reference $\tm{r}$ initialised with $\tm{x}$ (by calling $\tm{ref}$ of the outer runner), and
then adds the pair $\tm{(r,rel)}$ to the map stored in the runner's state. Reading is delegated to the outer runner, while assignment
first checks that the new state is larger than the old one, according to the associated preorder. If the
preorder is respected, the runner proceeds with assignment (again delegated to the outer runner), otherwise it reports a
monotonicity violation. We may not assume that every reference has an associated preorder,
because user code could pass to $\tm{mput}$ a reference that was created earlier outside
the scope of the runner. If this happens, the runner simply kills the offending user code with
a signal.

Another form of modularity is achieved by pairing runners. Given two runners
$\tmrunner{(\tm{op}\,x \mapsto K_{\tm{op}})_{\tm{op} \in \sig_1}}{C_1}$ and
$\tmrunner{(\tm{op'}\,x \mapsto K_{\tm{op'}})_{\tm{op'} \in \sig_2}}{C_2}$, e.g., for state
and file operations, we can use them side-by-side by combining them into a single runner
with operations $\sig_1 + \sig_2$ and kernel state $C_1 \times C_2$, as follows (the
co-operations $\tm{op}'$ of the second runner are treated symmetrically):

op x -> let (c,c') = getenv () in
kernel ($K_\op$ x) @ c finally
return y @ c” -> return (inl (inl y, c”)),
(raise e @ c” -> return (inl (inr e, c”)))$_{e \in E_\op}$,
(kill s -> return (inr s))$_{s \in S_1}$
return (inl (inl y, c”)) -> setenv (c”, c'); return y,
return (inl (inr e, c”)) -> setenv (c”, c'); raise e,
return (inr s) -> kill s,
op' x -> ... , ... $_{C_1 \times C_2}$

Notice how the inner $\tmkw{kernel}$ context switch passes to the co-operation $K_\op$
only its part of the combined state, and
how it returns the result of $K_\op$ in a reified form (which requires treating exceptions and signals
as values). The outer $\tmkw{user}$ context switch then receives this reified result, updates the combined state,
and forwards the result (return value, exception, or signal) in unreified form.

[1]
Ahman, D.: Library Haskell-Coop. Available at
<https://github.com/danelahman/haskell-coop> (2019)

[2]
Ahman, D., Fournet, C., Hritcu, C., Maillard, K., Rastogi, A., Swamy, N.:
Recalling a witness: foundations and applications of monotonic state.
PACMPL  2(POPL),  65:1–65:30 (2018)

[3]
Bauer, A., Pretnar, M.: An effect system for algebraic effects and handlers.
Logical Methods in Computer Science  10(4) (2014)

[4]
Bauer, A., Pretnar, M.: Programming with algebraic effects and handlers. J.
Log. Algebr. Meth. Program.  84(1),  108–123 (2015)

[5]
Bauer, A.: What is algebraic about algebraic effects and handlers? CoRR
abs/1807.05923 (2018)

[6]
Bauer, A.: Programming language coop. Available at
<https://github.com/andrejbauer/coop> (2019)

[7]
Benton, N., Kennedy, A.: Exceptional syntax. Journal of Functional Programming
11(4),  395–410 (2001)

[8]
Delignat-Lavaud, A., Fournet, C., Kohlweiss, M., Protzenko, J.,
Rastogi, A., Swamy, N., Zanella-Beguelin, S., Bhargavan, K., Pan,
J., Zinzindohoue, J.K.: Implementing and proving the tls 1.3 record layer.
In: 2017 IEEE Symp. on Security and Privacy (SP). pp. 463–482 (2017)

[9]
Dolan, S., Eliopoulos, S., Hillerström, D., Madhavapeddy, A.,
Sivaramakrishnan, K.C., White, L.: Concurrent system programming with effect
handlers. In: Wang, M., Owens, S. (eds.) Trends in Functional Programming.
pp. 98–117. Springer International Publishing, Cham (2018)

[10]
Foster, J.N., Greenwald, M.B., Moore, J.T., Pierce, B.C., Schmitt, A.:
Combinators for bidirectional tree transformations: A linguistic approach to
the view-update problem. ACM Trans. Program. Lang. Syst.  29(3)

[11]
Hyland, M., Plotkin, G., Power, J.: Combining effects: Sum and tensor. Theor.
Comput. Sci.  357(1–3),  70–99 (2006)

[12]
Kammar, O., Lindley, S., Oury, N.: Handlers in action. In: Proc. of 18th ACM
SIGPLAN Int. Conf. on Functional Programming, ICFP 2013. ACM (2013)

[13]
Katsumata, S., Rivas, E., Uustalu, T.: Interaction laws of monads and comonads.
CoRR  abs/1912.13477 (2019)

[14]
Kiselyov, O., Ishii, H.: Freer monads, more extensible effects. In: Proc. of
2015 ACM SIGPLAN Symp. on Haskell. pp. 94–105. Haskell '15, ACM (2015)

[15]
Koopman, P., Fokker, J., Smetsers, S., van Eekelen, M., Plasmeijer, R.:
Functional Programming in Clean. University of Nijmegen (1998), draft

[16]
Leijen, D.: Structured asynchrony with algebraic effects. In: Proceedings of
the 2nd ACM SIGPLAN International Workshop on Type-Driven Development,
TyDe@ICFP 2017, Oxford, UK, September 3, 2017. pp. 16–29. ACM (2017)

[17]
Leijen, D.: Algebraic effect handlers with resources and deep finalization.
Tech. Rep. MSR-TR-2018-10, Microsoft Research (April 2018)

[18]
Leijen, D.: Programming with implicit values, functions, and control (or,
implicit functions: Dynamic binding with lexical scoping). Tech. Rep.
MSR-TR-2019-7, Microsoft Research (March 2019)

[19]
Levy, P.B.: Call-By-Push-Value: A Functional/Imperative Synthesis, Semantics
Structures in Computation, vol. 2. Springer (2004)

[20]
Miltner, A., Maina, S., Fisher, K., Pierce, B.C., Walker, D., Zdancewic, S.:
Synthesizing symmetric lenses. Proc. ACM Program. Lang.  3(ICFP),
95:1–95:28 (2019)

[21]
Møgelberg, R.E., Staton, S.: Linear usage of state. Logical Methods in
Computer Science  10(1) (2014)

[22]
Moggi, E.: Computational lambda-calculus and monads. In: Proc. of 4th Ann.
Symp. on Logic in Computer Science, LICS 1989. pp. 14–23. IEEE (1989)

[23]
Moggi, E.: Notions of computation and monads. Inf. Comput.  93(1),
55–92 (1991)

[24]
O'Connor, R.: Functor is to lens as applicative is to biplate: Introducing
multiplate. CoRR  abs/1103.2841 (2011)

[25]
Plotkin, G., Power, J.: Semantics for algebraic operations. In: Proc. of 17th
Conf. on the Mathematical Foundations of Programming Semantics, MFPS XVII.
ENTCS, vol. 45, pp. 332–345. Elsevier (2001)

[26]
Plotkin, G., Power, J.: Algebraic operations and generic effects. Appl.
Categor. Struct. (1),  69–94 (2003)

[27]
Plotkin, G., Power, J.: Tensors of comodels and models for operational
semantics. In: Proc. of 24th Conf. on Mathematical Foundations of Programming
Semantics, MFPS XXIV. ENTCS, vol. 218, pp. 295–311. Elsevier (2008)

[28]
Plotkin, G.D., Power, J.: Notions of computation determine monads. In: Proc. of
5th Int. Conf. on Foundations of Software Science and Computation Structures,
FOSSACS 2002. LNCS, vol. 2303, pp. 342–356. Springer (2002)

[29]
Plotkin, G.D., Pretnar, M.: A logic for algebraic effects. In: Proc. of 23th
Ann. IEEE Symp. on Logic in Computer Science, LICS 2008. pp. 118–129. IEEE

[30]
Plotkin, G.D., Pretnar, M.: Handling algebraic effects. Logical Methods in
Computer Science  9(4:23) (2013)

[31]
Power, J., Shkaravska, O.: From comodels to coalgebras: State and arrays.
Electr. Notes Theor. Comput. Sci.  106,  297–314 (2004)

[32]
Power, J.: Enriched Lawvere theories. Theory Appl. Categ  6(7),
83–93 (1999)

[33]
Pretnar, M.: The Logic and Handling of Algebraic Effects. Ph.D. thesis, School
of Informatics, University of Edinburgh (2010)

[34]
Saleh, A.H., Karachalias, G., Pretnar, M., Schrijvers, T.: Explicit effect
subtyping. In: Proc. of 27th European Symposium on Programming, ESOP 2018.
pp. 327–354. LNCS, Springer (2018)

[35]
Uustalu, T.: Stateful runners of effectful computations. Electr. Notes Theor.
Comput. Sci.  319,  403–421 (2015)

[36]
Wadler, P.: The essence of functional programming. In: Sethi, R. (ed.) Proc. of
19th Ann. ACM SIGPLAN-SIGACT Symp. on Principles of Programming
Languages, POPL 1992. pp. 1–14. ACM (1992)

Open Access This chapter is licensed under the terms of the Creative CommonsAttribution 4.0 International License (<http://creativecommons.org/licenses/by/4.0/>), which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made.

.28em plus .1em minus .1em The images or other third party material in this chapter are included in the chapter's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the chapter's Creative Commons license and your intendeduse is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder.

seccntformat#1 the#1:

§ TYPING RULES OF $\LAMBDACOOP$

In this appendix we give the complete typing rules for $\lambdacoop$. We refer to
<ref> for the syntax of types, values,
and user and kernel computations.

For each operation symbol $\op \in \Ops$, we assume a given and fixed operation signature

\begin{equation*}
\op : \tysigop{A_\op}{B_\op}{E_\op},
\end{equation*}

and for each ground constant $\tmconst{f}$, we assume
a signature $\tmconst{f} : (A_1,\ldots,A_n) \to B$,
both of which the typing rules refer to without further ado.

Values, and user and kernel computations each have a typing and a subtyping judgement of the

\begin{align*}
&\Gamma \types V : X,
& &\Gamma \types M : \tyuser{X}{\Ueff},
& &\Gamma \types K : \tykernel{X}{\Keff},\\
&X \sub Y,
& &\tyuser{X}{\Ueff} \sub \tyuser{Y}{\Veff},
& &\tykernel{X}{\Keff} \sub \tykernel{Y}{\Leff}.
\end{align*}

where $\Gamma$ is the customary typing context assigning value types to variables.
The subtyping rules are given in <ref>, and the
typing rules in <ref>.

Sub-Ground A A

X X'

Y Y'

X ×Y X' ×Y'

X X'

Y Y'

X + Y X' + Y'

X' X

Y Y''

XY X'Y''

X' X

Y Y''

XY X'Y''

_1' ⊆_1

_2 ⊆_2'

S ⊆S'

C ≡C'

_1_2SC _1'_2'S'C'

X X'

E ⊆E'

X(, E) X'(', E')

X X'

E ⊆E'

S ⊆S'

C ≡C'

X(, E, S, C) X'(', E', S', C')

ΓV : X

X X'

ΓV : X'

ΓM : X

X X''

ΓM : X''

ΓK : X

X X''

ΓM : X''

Subtyping and subsumption rules.

Γ(x) ≡X

Γx : X

(ΓV_i : A_i)_1 ≤i ≤n

Γf(V_1, …, V_n) : B

ΓV : X

ΓW : Y

ΓVW : XY

ΓV : X

Γ[X,Y]V : X + Y

ΓW : Y

Γ[X,Y]W : X + Y

Γ, x X M : Y

Γx : XM : XY

Γ, x X K : Y

Γx : XK : XY

Γ, x A_K_: B_(', E_, S, C)

Γ(op x ↦K_op)_op ∈ΣC :

Value typing rules.

ΓV : X

ΓV : X

ΓV : XY

ΓW : X

ΓVW : Y

ΓM : X(,E)

Γ, x X N : Y(,E')

ΓN_e : Y(,E')
)_e ∈E

{ x ↦N,
(e ↦N_e)_e ∈E }

: Y(,E')

ΓV : XY

Γ, x X, y Y M : Z

ΓVxy ↦M : Z

ΓV :
Γ[Z]V : Z

ΓV : X + Y

Γ, x X M : Z

Γ, y Y N : Z

ΓVx ↦M, y ↦N : Z

ΓV : A_

Γ, x B_M : X

Γ⊢N_e : X
)_e ∈E_

ΓopXVx MN e E_ : X

e ∈E

Γ[X]e : X(, E)

F ≡{ x c ↦N,
(e c ↦N_e)_e ∈E,
(s ↦N_s)_s ∈S

ΓV : 'SC

ΓW : C

ΓM : X(, E)

Γ, x X, c C N : Y(', E')

Γ, c C N_e : Y(', E')
)_e ∈E

ΓN_s : Y(', E')
)_s ∈S

ΓVWMF : Y(', E')

F ≡{ x c ↦N,
(e c ↦N_e)_e ∈E,
(s ↦N_s)_s ∈S

ΓK : X(, E, S, C)

ΓW : C

Γ, x X, c C N : Y(, E')

Γ, c C N_e : Y(, E')
)_e ∈E

ΓN_s : Y(, E')
)_s ∈S

ΓKWF : Y(, E')

User typing rules.

ΓV : X

Γ[C]V : X(, E, S, C)

ΓV : XY

ΓW : X

ΓVW : Y

ΓK : X(, E, S, C)

Γ, x X L : Y(, E', S, C)

ΓL_e : Y(, E', S, C)
)_e ∈E

{ x ↦L,
(e ↦L_e)_e ∈E }

: Y(, E', S, C)

ΓV : XY

Γ, x X, y Y K : Z

ΓVxy ↦K : Z

ΓV :
Γ[Z C]V : Z(, E, S, C)

ΓV : X + Y

Γ, x X K : Z

Γ, y Y L : Z

ΓVx ↦K, y ↦L : Z

≡(, E, S, C)

ΓV : A_

Γ, x B_K : X

Γ⊢L_e : X
)_e ∈E_

ΓopXVx KL e E_ : X

e ∈E

Γ[X C]e : X(, E, S, C)

s ∈S

Γ[X C]s : X(, E, S, C)

Γ, c C K : X(, E, S, C)

Γ[C]c K : X(, E, S, C)

ΓV : C

ΓK : X(, E, S, C)

ΓVK : X(, E, S, C)

≡(, E', S, C)

ΓM : X(, E)

Γ, x X K : Y

ΓL_e : Y
)_e ∈E

{ x ↦K,
(e ↦L_e)_e ∈E

: Y

Kernel typing rules.

§ EQUATIONAL THEORY OF $\LAMBDACOOP$

Values, user and kernel computations each have an equality judgement

\begin{equation*}
\Gamma \types V \equiv W : X
\qquad
\Gamma \types M \equiv N : \tyuser{X}{\Ueff}
\qquad
\Gamma \types K \equiv L  : \tyuser{X}{\Keff}.
\end{equation*}

It is presupposed that we only compare well-typed expressions with the indicated types.
For the most part, the context and the type annotation will play no part in the equation,
and so we shall drop them when no confusion can arise.

The computational equations are displayed in <ref>.
These can be read left-to-right as evaluation rules that explain the operational meaning
of computations. The remaining equations are displayed in <ref>.

We omit standard equations which specify how substitution is performed, as well
as equations stating that equality is a congruence with respect to all the term

\begin{align*}
\tmapp{(\tmfun{x \of X}{M})}{V} &\equiv M[V/x]
\\[1ex]
\tmtry{(\tmreturn{V})}{H} &\equiv N[V/x]
\\
\tmtry{(\tmraise[X]{e})}{H} &\equiv N_{e}
\\
\tmtry{(
\tmop{op}{X}{V}{\tmcont x M}{\tmexccont {N'} {e'} {E_\op}}
)}{H} &\equiv \\
\tmop{op}{X}{V}{\tmcont x {\tmtry{&M}{H}}}{\left(\tmtry{N'_{e'}}{H}\right)_{e' \in E_\op}}
\\[1ex]
\tmmatch{\tmpair{V}{W}}{\tmpair{x}{y} \mapsto M} &\equiv
M[V/x, W/y]
\\
\tmmatch[X]{V}{} &\equiv
\\
\mathllap{
\tmmatch{(\tminl[X,Y]{V})}{\tminl{x} \mapsto M, \tminr{y} \mapsto N}
} &\equiv
\\
\mathllap{
\tmmatch{(\tminr[X,Y]{W})}{\tminl{x} \mapsto M, \tminr{y} \mapsto N}
} &\equiv
\\[1ex]
\tmrun{V}{W}{(\tmreturn{V'})}{F} &\equiv N[V'/x, W/c]
\\
\tmrun{V}{W}{(\tmraise[X]{e})}{F} &\equiv N_{e}[W/c]
\\
\omit\rlap{$
\tmkw{using}\; R \at W \;\tmkw{run}\;
\tmop{op}{X}{V}{\tmcont x M}{\tmexccont {N'} {e'} {E_\op}}
\;\tmkw{finally}\; F \equiv $}
\\
\quad\tmkernel{K_\op[V/x]}{W}{F'}
\\
\shortintertext{\hfil \parbox{0.6\textwidth}{
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{equation*}
\text{where\ } F' \defeq
\begin{aligned}[t]
\{
&\tmreturn{x} \at c' \mapsto (\tmrun{R}{c'}{M}{F}), \\
\tmraise{e'} \at c' \mapsto (\tmrun{R}{c'}{N'_{e'}}{F})
\right)_{e' \in E_\op},\\
\tmkill{s} \mapsto N_s
\right)_{s \in S}
\}
\end{aligned}
\end{equation*}
\\
\tmkernel{(\tmreturn[C]{V})}{W}{F} &\equiv N[V/x, W/c] \\
\tmkernel{(\tmraise[X \at C]{e})}{W}{F} &\equiv N_{e}[W/c] \\
\tmkernel{(\tmkill[X \at C]{s})}{W}{F} &\equiv N_{s} \\
\tmkernel{(\tmgetenv[C]{\tmcont c K})}{W}{F} &\equiv \tmkernel{K[W/c]}{W}{F} \\
\tmkernel{(\tmsetenv{V}{K})}{W}{F} &\equiv \tmkernel{K}{V}{F}
\\
\omit\rlap{$
\tmkernel{\tmop{op}{X}{V}{\tmcont x K}{\tmexccont L {e'} {E_\op}}}{W}{F}
\equiv $}
\\
\tmop{op}{X}{V}{\tmcont x {\tmkernel{K}{W}{&F}}}{
\left(
\tmkernel{L_{e'}}{W}{F}
\right)_{e' \in E_\op}}
\end{align*}

\begin{align*}
F &\defeq
\{ \tmreturn{x} \at c \mapsto N,
(\tmraise{e} \at c \mapsto N_e)_{e \in E},
(\tmkill{s} \mapsto N_s)_{s \in S}
\}
\\
H &\defeq
\{ \tmreturn{x} \mapsto N,
(\tmraise{e} \mapsto N_e)_{e \in E}
\}
\\
R &\defeq \tmrunner{(\tm{op}\,x \mapsto K_{\tm{op}})_{\tm{op} \in \sig}}{C}
\end{align*}

Computational equations (user mode).

\begin{align*}
\tmapp{(\tmfunK{x \of X}{K})}{V} &\equiv K[V/x]
\\[1ex]
\tmtry{(\tmreturn{V})}{G} &\equiv L[V/x]
\\
\tmtry{(\tmraise[X \at C]{e})}{G} &\equiv L_{e}
\\
\tmtry{(\tmkill[X \at C]{s})}{G} &\equiv \tmkill[X \at C]{s}
\\
\tmtry{(
\tmop{op}{X}{V}{\tmcont x K}{\tmexccont {L'} {e'} {E_\op}}
)}{G} &\equiv \\
\tmop{op}{X}{V}{\tmcont x {\tmtry{&K}{G}}}{\left(\tmtry{L'_{e'}}{G}\right)_{e' \in E_\op}}
\\
\tmtry{(\tmgetenv[C]{\tmcont c K})}{G} &\equiv \tmgetenv[C]{\tmcont c {\tmtry{K}{G}}}
\\
\tmtry{(\tmsetenv{V}{K})}{G} &\equiv \tmsetenv{V}{\tmtry{K}{G}}
\\[1ex]
\tmmatch{\tmpair{V}{W}}{\tmpair{x}{y} \mapsto K} &\equiv
K[V/x, W/y]
\\
\tmmatch[X \at C]{V}{} &\equiv
\\
\tmmatch{(\tminl[X,Y]{V})}{\tminl{x} \mapsto K, \tminr{y} \mapsto L} &\equiv
\\
\tmmatch{(\tminr[X,Y]{W})}{\tminl{x} \mapsto K, \tminr{y} \mapsto L} &\equiv
\\[1ex]
\tmuser{(\tmreturn{V})}{G} &\equiv L[V/x]
\\
\tmuser{(\tmraise[X]{e})}{G} &\equiv L_e
\\
\tmuser{(
\tmop{op}{X}{V}{\tmcont x M}{\tmexccont {N'} {e'} {E_\op}}
)}{G} &\equiv \\
\tmop{op}{X}{V}{\tmcont x {\tmuser{&M}{G}}}{\left(\tmuser{N'_{e'}}{G} \right)_{e' \in E_\op}}
\end{align*}

Abbreviation: $G \defeq \{ \tmreturn{x} \mapsto L, (\tmraise{e} \mapsto L_e)_{e \in E} \}$

Computational equations (kernel mode).

\begin{gather*}
V \equiv \tmunit : \tyunit \qquad\qquad
\tmfun{x \of A}{\tmapp{V}{x}} \equiv V \qquad\qquad
\tmfunK{x \of A}{\tmapp{V}{x}} \equiv V
\\
\tmtry{M}{
\{ \tmreturn{x} \mapsto \tmreturn{x},
(\tmraise{e} \mapsto \tmraise[X]{e})_{e \in E}
\}
\equiv M
\\
\tmtry{K}{
\{ \tmreturn{x} \mapsto \tmreturn{x},
(\tmraise{e} \mapsto \tmraise[X \at C]{e})_{e \in E}
\}
\equiv K
\\[1ex]
\begin{aligned}
\tmgetenv[C]{\tmcont c {\tmsetenv{c}{K}}} &\equiv K
\\
\tmsetenv{V}{\tmgetenv[C]{\tmcont c K}} &\equiv
\tmsetenv{V}{K[V/c]}
\\
\tmsetenv{V}{\tmsetenv{W}{K}} &\equiv \tmsetenv{W}{K}
\\
\tmgetenv[C]{\tmcont c {\tmkill[X \at C]{s}}} &\equiv
\tmkill[X \at C]{s}
\\
\tmsetenv{V}{\tmkill[X \at C]{s}} &\equiv
\tmkill[X \at C]{s}
\\
\tmgetenv[C]{\tmcont c {\tmop{op}{X}{V}{\tmcont x K}{\tmexccont L e {E_\op}}}}
&\equiv \\
\tmop{op}{X}{V}{\tmcont x {\tmgetenv[C]{&\tmcont c K}}}{\left(\tmgetenv[C]{\tmcont c {L_e}}\right)_{e \in E_\op}}
\\
\tmsetenv{V}{\tmop{op}{X}{V}{\tmcont x K}{\tmexccont L e {E_\op}}}
&\equiv \\
\tmop{op}{X}{&V}{\tmcont x {\tmsetenv{V}{K}}}{\left(\tmsetenv{V}{L_e}\right)_{e \in E_\op}}
\end{aligned}
\end{gather*}

Other equations (for $\eta$-expansion and the kernel theory from <ref>).