Skip to content

Commit a71a380

Browse files
committed
chore: support typst backend for docs
1 parent cdf66fb commit a71a380

8 files changed

Lines changed: 58 additions & 157 deletions

File tree

docs/Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[deps]
22
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
33
DocumenterInterLinks = "d12716ef-a0f6-4df4-a9f1-a5a34e75c656"
4+
DocumenterTypst = "d7fd56dd-41bc-4b2d-b658-79a5840b2e09"
45
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
56
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
67
SUNRepresentations = "1a50b95c-7aac-476d-a9ce-2bfc675fc617"
@@ -11,6 +12,7 @@ WignerSymbols = "9f57e263-0b3d-5e2e-b1be-24f2bb48858b"
1112
[compat]
1213
Documenter = "1"
1314
DocumenterInterLinks = "1"
15+
DocumenterTypst = "0.1"
1416
LinearAlgebra = "1"
1517
Random = "1"
1618
SUNRepresentations = "0.3"

docs/make.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1+
using Pkg
2+
13
# if examples is not the current active environment, switch to it
24
if Base.active_project() != joinpath(@__DIR__, "Project.toml")
3-
using Pkg
45
Pkg.activate(@__DIR__)
56
Pkg.develop(PackageSpec(; path = joinpath(@__DIR__, "..")))
67
Pkg.resolve()
78
Pkg.instantiate()
89
end
910

1011
using Documenter
12+
using DocumenterTypst
1113
using Random
1214
using TensorKit
1315
using TensorKit: FusionTreePair, Index2Tuple
@@ -61,6 +63,7 @@ makedocs(;
6163
format = Documenter.HTML(;
6264
prettyurls = true, mathengine, assets = ["assets/custom.css"]
6365
),
66+
# format = DocumenterTypst.Typst(),
6467
pages = pages,
6568
pagesonly = true,
6669
plugins = [links]

docs/src/appendix/categories.md

Lines changed: 22 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ To morphisms, we associate boxes with an incoming and outgoing line denoting the
2727
The flow from source to target, and thus the direction of morphism composition ``f ∘ g`` (sometimes known as the flow of time) can be chosen left to right (like the arrow in ``f:W→V``), right to left (like the composition order ``f ∘ g``, or the matrix product), bottom to top (quantum field theory convention) or top to bottom (quantum circuit convention).
2828
Throughout this manual, we stick to this latter convention (which is not very common in manuscripts on category theory):
2929

30-
```@raw html
31-
<img src="../img/diagram_morphism.svg" alt="composition" class="color-invertible"/>
32-
```
30+
![composition](img/diagram_morphism.svg)
3331

3432
The direction of the arrows, which become important once we introduce duals, are also subject to convention, and are here chosen to follow the arrow in ``f:W→V``, i.e. the source comes in and the target goes out.
3533
Strangely enough, this is opposite to the most common convention.
@@ -95,9 +93,7 @@ Similarly, the identity object ``I`` can be added or removed at will, and when d
9593
Note that any consistent way of inserting the associator or left or right unitor to convert a graphical representation to a diagram of compositions and tensor products of morphisms gives rise to the same result, by virtue of Mac Lane's coherence theorem.
9694
Using the horizontal direction (left to right) to stack tensor products, this gives rise to the following graphical notation for the tensor product of two morphisms, and for a general morphism ``t`` between a tensor product of objects in source and target:
9795

98-
```@raw html
99-
<img src="../img/diagram-tensorproduct.svg" alt="tensorproduct" class="color-invertible"/>
100-
```
96+
![tensorproduct](img/diagram-tensorproduct.svg)
10197

10298
Another relevant example is the category ``\mathbf{SVect}_𝕜``, which has as objects *super vector spaces* over ``𝕜``, which are vector spaces with a ``ℤ₂`` grading, i.e. they are decomposed as a direct sum ``V = V_0 ⊕ V_1``.
10399
Furthermore, the morphisms between two super vector spaces are restricted to be grading preserving, i.e. ``f∈ \mathrm{Hom}_{\mathbf{SVect}}(W,V)`` has ``f(W_0) ⊂ V_0`` and ``f(W_1) ⊂ V_1``.
@@ -151,28 +147,22 @@ Indeed, it can be shown that for any category which has duals for objects ``V``
151147

152148
Graphically, we represent the exact pairing and snake rules as
153149

154-
```@raw html
155-
<img src="../img/diagram-leftdual.svg" alt="left dual" class="color-invertible"/>
156-
```
150+
![left dual](img/diagram-leftdual.svg)
157151

158152
Note that we denote the dual objects ``{}^{∨}V`` as a line ``V`` with arrows pointing in the opposite (i.e. upward) direction.
159153
This notation is related to quantum field theory, where anti-particles are (to some extent) interpreted as particles running backwards in time.
160154

161155
These exact pairings are known as the left evaluation and coevaluation, and ``{}^{∨}V`` is the left dual of ``V``.
162156
Likewise, we can also define a right dual ``V^{∨}`` of ``V`` and associated pairings, the right evaluation ``\tilde{ϵ}_V: V ⊗ V^{∨} → I`` and coevaluation ``\tilde{η}_V: I → V^{∨} ⊗ V``, satisfying
163157

164-
```@raw html
165-
<img src="../img/diagram-rightdual.svg" alt="right dual" class="color-invertible"/>
166-
```
158+
![right dual](img/diagram-rightdual.svg)
167159

168160
In particular, one could choose ``\tilde{ϵ}_{{}^{∨}V} = ϵ_V`` and thus define ``V`` as the right dual of ``{}^{∨}V``.
169161
While there might be other choices, this choice must at least be isomorphic, such that ``({}^{∨}V)^{∨} ≂ V``.
170162

171163
If objects ``V`` and ``W`` have left (respectively right) duals, then for a morphism ``f ∈ \mathrm{Hom}(W,V)``, we furthermore define the left (respectively right) *transpose* ``{}^{∨}f ∈ \mathrm{Hom}({}^{∨}V, {}^{∨}W)`` (respectively ``f^{∨} ∈ \mathrm{Hom}(V^{∨}, W^{∨})``) as
172164

173-
```@raw html
174-
<img src="../img/diagram-transpose.svg" alt="transpose" class="color-invertible"/>
175-
```
165+
![transpose](img/diagram-transpose.svg)
176166

177167
where on the right we also illustrate the mapping from ``t ∈ \mathrm{Hom}(W_1 ⊗ W_2 ⊗ W_3, V_1 ⊗ V_2)`` to a morphism in ``\mathrm{Hom}(I, V_1 ⊗ V_2 ⊗ {}^{∨} W_3 ⊗ {}^{∨} W_2 ⊗ {}^{∨} W_1)``.
178168

@@ -211,9 +201,7 @@ and a right trace as
211201

212202
They are graphically represented as
213203

214-
```@raw html
215-
<img src="../img/diagram-trace.svg" alt="trace" class="color-invertible"/>
216-
```
204+
![trace](img/diagram-trace.svg)
217205

218206
and they do not need to coincide.
219207
Note that ``\mathrm{tr}_{\mathrm{l}}(f) = \mathrm{tr}_{\mathrm{r}}(f*)`` and that ``\mathrm{tr}_{\mathrm{l}/\mathrm{r}}(f∘g) = \mathrm{tr}_{\mathrm{l}/\mathrm{r}}(g∘f)``.
@@ -241,15 +229,11 @@ We also have ``λ_V ∘ τ_{V,I} = ρ_{V,I}``, ``ρ_V ∘ τ_{I,V} = λ_{V}`` an
241229

242230
The braiding isomorphism ``τ_{V,W}`` and its inverse are graphically represented as the lines ``V`` and ``W`` crossing over and under each other:
243231

244-
```@raw html
245-
<img src="../img/diagram-braiding.svg" alt="braiding" class="color-invertible"/>
246-
```
232+
![braiding](img/diagram-braiding.svg)
247233

248234
such that we have
249235

250-
```@raw html
251-
<img src="../img/diagram-braiding2.svg" alt="braiding relations" class="color-invertible"/>
252-
```
236+
![braiding relations](img/diagram-braiding2.svg)
253237

254238
where the expression on the right hand side, ``τ_{W,V}∘τ_{V,W}`` can generically not be simplified.
255239
Hence, for general braidings, there is no unique choice to identify a tensor in ``V⊗W`` and ``W⊗V``, as the isomorphisms ``τ_{V,W}``, ``τ_{W,V}^{-1}``, ``τ_{V,W} ∘ τ_{W,V} ∘ τ_{V,W}``, … mapping from ``V⊗W`` to ``W⊗V`` can all be different.
@@ -262,9 +246,7 @@ Less trivial braiding implementations arise in the context of tensors with symme
262246

263247
The braiding of a space and a dual space also follows naturally, it is given by ``τ_{V^*,W} = λ_{W ⊗ V^*} ∘ (ϵ_V ⊗ \mathrm{id}_{W ⊗ V^*}) ∘ (\mathrm{id}_{V^*} ⊗ τ_{V,W}^{-1} ⊗ \mathrm{id}_{V^*}) ∘ (\mathrm{id}_{V^*⊗ W} ⊗ η_V) ∘ ρ_{V^* ⊗ W}^{-1}``, i.e.
264248

265-
```@raw html
266-
<img src="../img/diagram-braidingdual.svg" alt="braiding dual" class="color-invertible"/>
267-
```
249+
![braiding dual](img/diagram-braidingdual.svg)
268250

269251
**Balanced categories** ``C`` are braided categories that come with a **twist** ``θ``, a natural transformation from the identity functor ``1_C`` to itself, such that ``θ_V ∘ f = f ∘ θ_W`` for all morphisms ``f ∈ \mathrm{Hom}(W,V)``, and for which the main requirement is that
270252

@@ -287,9 +269,7 @@ and
287269
where we omitted the necessary left and right unitors and associators.
288270
Graphically, the twists and their inverse (for which we refer to [^Turaev]) are then represented as
289271

290-
```@raw html
291-
<img src="../img/diagram-twists.svg" alt="twists" class="color-invertible"/>
292-
```
272+
![twists](img/diagram-twists.svg)
293273

294274
The graphical representation also makes it straightforward to verify that ``(θ^{\mathrm{l}}_V)^* = θ^{\mathrm{r}}_{V^*}``, ``(θ^{\mathrm{r}}_V)^* = θ^{\mathrm{l}}_{V^*}`` and ``\mathrm{tr}_{\mathrm{l}}( θ^{\mathrm{r}}_V ) = \mathrm{tr}_{\mathrm{r}}( θ^{\mathrm{l}}_V )``.
295275

@@ -309,9 +289,7 @@ Alternatively, one can start from a balanced and rigid category (e.g. with a lef
309289

310290
or graphically
311291

312-
```@raw html
313-
<img src="../img/diagram-pivotalfromtwist.svg" alt="pivotal from twist" class="color-invertible"/>
314-
```
292+
![pivotal from twist](img/diagram-pivotalfromtwist.svg)
315293

316294
where we have drawn ``θ`` as ``θ^{\mathrm{l}}`` on the left and as ``θ^{\mathrm{r}}`` on the right, but in this case the starting assumption was that they are one and the same, and we defined the pivotal structure so as to make it compatible with the graphical representation.
317295
This construction of the pivotal structure can than be used to define the trace, which is spherical, i.e.
@@ -350,9 +328,7 @@ Finally, we will also use the term *isometry* for a morphism ``f:W→V`` which h
350328

351329
In the graphical representation, the dagger of a morphism can be represented by mirroring the morphism around a horizontal axis, and then reversing all arrows (bringing them back to their original orientation before the mirror operation):
352330

353-
```@raw html
354-
<img src="../img/diagram-dagger.svg" alt="dagger" class="color-invertible"/>
355-
```
331+
![dagger](img/diagram-dagger.svg)
356332

357333
where for completeness we have also depicted the graphical representation of the transpose, which is a very different operation.
358334
In particular, the dagger does not reverse the order of the tensor product.
@@ -474,9 +450,7 @@ In the context of a unitary fusion category, on which we now focus, the correspo
474450

475451
Graphically, we represent these relations as
476452

477-
```@raw html
478-
<img src="../img/diagram-fusion.svg" alt="fusion" class="color-invertible"/>
479-
```
453+
![fusion](img/diagram-fusion.svg)
480454

481455
and also refer to the inclusion and projection maps as splitting and fusion tensor, respectively.
482456

@@ -524,18 +498,14 @@ which defines the *F-symbol*, i.e. the matrix elements of the associator
524498
Note that the left hand side represents a map in ``\mathrm{Hom}(d′,d)``, which must be zero if ``d′`` is different from ``d``, hence the ``δ_{d,d′}`` on the right hand side.
525499
In a strict category, or in the graphical notation, the associator ``α`` is omitted and these relations thus represent a unitary basis transform between the basis of inclusion maps ``X_{d,(eμν)}^{abc}`` and ``\tilde{X}_{d,(fκλ)}^{abc}``, which is also called an F-move, i.e. graphically:
526500

527-
```@raw html
528-
<img src="../img/diagram-Fmove.svg" alt="Fmove" class="color-invertible"/>
529-
```
501+
![Fmove](img/diagram-Fmove.svg)
530502

531503
The matrix ``F^{abc}_d`` is thus a unitary matrix.
532504
The pentagon coherence equation can also be rewritten in terms of these matrix elements, and as such yields the celebrated pentagon equation for the F-symbols.
533505
In a similar fashion, the unitors result in ``N^{a1}_{b} = N^{1a}_b = δ^{a}_b`` (where we have now written ``1`` instead of ``I`` for the unit object) and the triangle equation leads to additional relations between the F- symbols involving the unit object.
534506
In particular, if we identify ``X^{1a}_{a,1}:a→(1⊗a)`` with ``λ_a^†`` and ``X^{a1}_{a,1}:a→(a⊗1)`` with ``ρ_a^†``, the triangle equation and its collaries imply that ``[F^{1ab}_{c}]_{(11μ)}^{(cν1)} = δ^{ν}_{μ}``, and similar relations for ``F^{a1b}_c`` and ``F^{ab1}_c``, which are graphically represented as
535507

536-
```@raw html
537-
<img src="../img/diagram-Fmove1.svg" alt="Fmove1" class="color-invertible"/>
538-
```
508+
![Fmove1](img/diagram-Fmove1.svg)
539509

540510
In the case of group representations, i.e. the category ``\mathbf{Rep}_{\mathsf{G}}``, the splitting and fusion tensors are known as the Clebsch-Gordan coefficients, especially in the case of ``\mathsf{SU}_2``.
541511
An F-move amounts to a recoupling and the F-symbols can thus be identified with the *6j-symbols* (strictly speaking, Racah's W-symbol for ``\mathsf{SU}_2``).
@@ -560,9 +530,7 @@ If ``a``and ``\bar{a}`` are distinct, we can essentially choose ``Z_{\bar{a}}``
560530
However, for ``a=\bar{a}``, the value of ``χ_a`` cannot be changed, but must satisfy ``χ_a^2 = 1``, or thus ``χ_a = ±1``.
561531
This value is a topological invariant known as the *Frobenius-Schur indicator*. Graphically, we represent this isomorphism and its relations as
562532

563-
```@raw html
564-
<img src="../img/diagram-Zisomorphism.svg" alt="Zisomorphism" class="color-invertible"/>
565-
```
533+
![Zisomorphism](img/diagram-Zisomorphism.svg)
566534

567535
We can now discuss the relation between the exact pairing and the fusion and splitting tensors.
568536
Given that the (left) coevaluation ``η_a ∈ \mathrm{Hom}(1, a⊗a^*)``, we can define the splitting tensor as
@@ -578,15 +546,11 @@ Hence, both the quantum dimensions and the Frobenius-Schur indicator are encoded
578546
Hence, they do not represent new independent data.
579547
Again, the graphical representation is more enlightning:
580548

581-
```@raw html
582-
<img src="../img/diagram-ZtoF.svg" alt="ZtoF" class="color-invertible"/>
583-
```
549+
![ZtoF](img/diagram-ZtoF.svg)
584550

585551
With these definitions, we can now also evaluate the action of the evaluation map on the splitting tensors, namely
586552

587-
```@raw html
588-
<img src="../img/diagram-splittingfusionrelation.svg" alt="splittingfusionrelation" class="color-invertible"/>
589-
```
553+
![splittingfusionrelation](img/diagram-splittingfusionrelation.svg)
590554

591555
where again bar denotes complex conjugation in the second line, and we introduced two new families of matrices ``A^{ab}_c`` and ``B^{ab}_c``, whose entries are composed out of entries of the F-symbol, namely
592556

@@ -602,9 +566,7 @@ and
602566

603567
Composing the left hand side of first graphical equation with its dagger, and noting that the resulting element ``f ∈ \mathrm{End}(a)`` must satisfy ``f = d_a^{-1} \mathrm{tr}(f) \mathrm{id}_a``, i.e.
604568

605-
```@raw html
606-
<img src="../img/diagram-Brelation.svg" alt="Brelation" class="color-invertible"/>
607-
```
569+
![Brelation](img/diagram-Brelation.svg)
608570

609571
allows to conclude that ``∑_ν [B^{ab}_c]^{ν}_{μ} \overline{[B^{ab}_c]^{ν}_{μ′}} = \delta_{μ,μ′}``, i.e. ``B^{ab}_c`` is a unitary matrix.
610572
The same result follows for ``A^{ab}_c`` in analogue fashion.
@@ -640,9 +602,7 @@ We can then express ``τ_{a,b}`` in terms of its matrix elements as
640602

641603
or graphically
642604

643-
```@raw html
644-
<img src="../img/diagram-braidingR.svg" alt="braidingR" class="color-invertible"/>
645-
```
605+
![braidingR](img/diagram-braidingR.svg)
646606

647607
The hexagon coherence axiom for the braiding and the associator can then be reexpressed in terms of the F-symbols and R-symbols.
648608

@@ -654,9 +614,7 @@ We can now compute the twist, which for simple objects needs to be scalars (or i
654614

655615
or graphically
656616

657-
```@raw html
658-
<img src="../img/diagram-simpletwist.svg" alt="simpletwist" class="color-invertible"/>
659-
```
617+
![simpletwist](img/diagram-simpletwist.svg)
660618

661619
Henceforth, we reserve ``θ_a`` for the scalar value itself. Note that ``θ_a = θ_{\bar{a}}`` as our category is spherical and thus a ribbon category, and that the defining relation of a twist implies
662620

@@ -666,9 +624,7 @@ Henceforth, we reserve ``θ_a`` for the scalar value itself. Note that ``θ_a =
666624

667625
If ``a = \bar{a}``, we can furthermore relate the twist, the braiding and the Frobenius- Schur indicator via ``θ_a χ_a R^{aa}_1 =1``, because of
668626

669-
```@raw html
670-
<img src="../img/diagram-twistfrobeniusschur.svg" alt="twistfrobeniusschur" class="color-invertible"/>
671-
```
627+
![twistfrobeniusschur](img/diagram-twistfrobeniusschur.svg)
672628

673629
For the recurring example of ``\mathbf{Rep}_{\mathsf{G}}``, the braiding acts simply as the swap of the two vector spaces on which the representations are acting and is thus symmetric, i.e. ``τ_{b,a} ∘ τ_{a,b} = \mathrm{id}_{a⊗b}``.
674630
All the twists are simply ``θ_a = 1``.

0 commit comments

Comments
 (0)