1- # Introduction
1+ # [ Introduction] ( @ id s_intro)
22
3- Before discussing the implementation and how it can be used on the following pages, let us
4- discuss some of the rationale behind TensorKit.jl .
3+ Before providing a typical "user guide" and discussing the implementation of TensorKit.jl
4+ on the next pages, let us discuss some of the rationale behind this package .
55
6- ## What is a tensor?
6+ ## [ What is a tensor?] ( @ id ss_tensor)
77
88At the very start we should ponder about the most suitable and sufficiently general
99definition of a tensor. A good starting point is the following:
@@ -17,7 +17,7 @@ definition of a tensor. A good starting point is the following:
1717
1818If you think of a tensor as an object with indices, a rank ` N ` tensor has ` N ` indices where
1919every index is associated with the corresponding vector space in that it labels a particular
20- basis in that space. We will return to index notation below .
20+ basis in that space. We will return to index notation at the very end of this manual .
2121
2222As the tensor product of vector spaces is itself a vector space, this implies that a tensor
2323behaves as a vector, i.e. tensors from the same tensor product space can be added and
@@ -26,7 +26,7 @@ field, i.e. there is no meaning in ``ℝ^5 ⊗ ℂ^3``. When all the vector spac
2626product have an inner product, this also implies an inner product for the tensor product
2727space. It is hence clear that the different vector spaces in the tensor product should have
2828some form of homogeneity in their structure, yet they do not need to be all equal and can
29- e.g. have different dimensions. It goes without saying that defining the vector spaces an
29+ e.g. have different dimensions. It goes without saying that defining the vector spaces and
3030their properties will be an important part of the definition of a tensor. As a consequence,
3131this also constitutes a significant part of the implementation, and is discussed in the
3232section on [ Vector spaces] ( @ref ) .
@@ -36,8 +36,8 @@ matrix (or more correctly, a linear map) in order to decompose tensors using lin
3636factorisations (e.g. eigenvalue or singular value decomposition). Henceforth, we use the
3737term "tensor map" as follows:
3838
39- * A tensor map `` t `` is a linear map from a * domain* `` W_1 ⊗ W_2 ⊗ … ⊗ W_{N_2} `` to a
40- * codomain* `` V_1 ⊗ V_2 ⊗ … ⊗ V_{N_1} `` , i.e.
39+ * A tensor map `` t `` is a linear map from a source or * domain*
40+ `` W_1 ⊗ W_2 ⊗ … ⊗ W_{N_2} `` to a target or * codomain* `` V_1 ⊗ V_2 ⊗ … ⊗ V_{N_1} `` , i.e.
4141
4242 `` t:W_1 ⊗ W_2 ⊗ … ⊗ W_{N_2} → V_1 ⊗ V_2 ⊗ … ⊗ V_{N_1}. ``
4343
@@ -47,11 +47,11 @@ matrix multiplication), where the contracted indices correspond to the domain of
4747tensor and the codomain of the second tensor.
4848
4949In order to allow for arbitrary tensor contractions or decompositions, we need to be able to
50- reorganise which vector spaces appear in the domain and the codomain of the tensor map. This
51- amounts to defining canonical isomorphisms between the different ways to order and partition
52- the tensor indices (i.e. the vector spaces). For example, a linear map `` W → V `` is often
53- denoted as a rank 2 tensor in `` V ⊗ W^* `` , where `` W^* `` corresponds to the dual space of
54- ` W ` . This simple example introduces two new concepts.
50+ reorganise which vector spaces appear in the domain and the codomain of the tensor map, and
51+ in which order. This amounts to defining canonical isomorphisms between the different ways
52+ to order and partition the tensor indices (i.e. the vector spaces). For example, a linear
53+ map `` W → V `` is often denoted as a rank 2 tensor in `` V ⊗ W^* `` , where `` W^* `` corresponds
54+ to the dual space of ` W ` . This simple example introduces two new concepts.
5555
56561 . Typical vector spaces can appear in the domain and codomain in different variants, e.g.
5757 as normal space or dual space. In fact, the most generic case is that every vector
@@ -102,7 +102,7 @@ This brings us to our final (yet formal) definition
102102 category of finite dimensional vector spaces. More generally, our concept of a tensor
103103 makes sense, in principle, for any `` \mathbf{Vect} `` -enriched monoidal category. We refer to the section "[ Monoidal categories and their properties (optional)] ( @ref ) ".
104104
105- ## Symmetries and block sparsity
105+ ## [ Symmetries and block sparsity] ( @ id ss_symmetries)
106106
107107Physical problems often have some symmetry, i.e. the setup is invariant under the action of
108108a group `` \mathsf{G} `` which acts on the vector spaces `` V `` in the problem according to a
@@ -112,7 +112,7 @@ number of times every irreducible representation (irrep) `a` of ``\mathsf{G}`` a
112112
113113`` V = \bigoplus_{a} ℂ^{n_a} ⊗ R_a ``
114114
115- with ` R_a ` the space associated with irrep `` a `` of `` \mathsf{G} `` , which itself has
115+ with `` R_a ` ` the space associated with irrep `` a `` of `` \mathsf{G} `` , which itself has
116116dimension `` d_a `` (often called the quantum dimension), and `` n_a `` the number of times
117117this irrep appears in `` V `` . If the unitary irrep `` a `` for `` g ∈ \mathsf{G} `` is given by
118118`` u_a(g) `` , then the group action of `` \mathsf{G} `` on `` V `` is given by the unitary
@@ -125,34 +125,39 @@ by ``∑_a n_a d_a``.
125125
126126The reason of implementing symmetries is to exploit the compuation and memory gains
127127resulting from restricting to tensor maps ``t: W_1 ⊗ W_2 ⊗ … ⊗ W_ {N_2} → V_1 ⊗ V_2 ⊗ … ⊗
128- V_ {N_1}`` that are invariant under the symmetry (i.e. that act as [ intertwiners] ( https://en.wikipedia.org/wiki/Equivariant_map#Representation_theory )
128+ V_ {N_1}`` that are invariant under the symmetry (i.e. that act as
129+ [ intertwiners] ( https://en.wikipedia.org/wiki/Equivariant_map#Representation_theory )
129130between the symmetry action on the domain and the codomain). Indeed, such tensors should be
130131block diagonal because of [ Schur's lemma] ( https://en.wikipedia.org/wiki/Schur%27s_lemma ) ,
131- but only after we couple the individual irreps in the spaces ` W_i ` to a joint irrep. The
132- basis change from the tensor product of irreps in the (co)domain to the joint irrep is
133- implemented by a sequence of Clebsch-Gordan coefficients, also known as a fusion (or
134- splitting) tree. We implement the necessary machinery to manipulate these fusion trees
135- under index permutations and repartitions for arbitrary groups `` \mathsf{G} `` . In
136- particular, this fits with the formalism of monoidal categories discussed below and only
137- requires the * topological* data of the group, i.e. the fusion rules of the irreps, their
138- quantum dimensions and the F-symbol (6j-symbol or more precisely Racah's W-symbol in the
139- case of `` \mathsf{SU}_2 `` ). In particular, we do not need the Clebsch-Gordan coefficients.
132+ but only after we couple the individual irreps in the spaces `` W_i `` to a joint irrep,
133+ which is then again split into the individual irreps of the spaces `` V_i `` . The basis
134+ change from the tensor product of irreps in the (co)domain to the joint irrep isimplemented
135+ by a sequence of Clebsch-Gordan coefficients, also known as a fusion (or splitting) tree.
136+ We implement the necessary machinery to manipulate these fusion trees under index
137+ permutations and repartitions for arbitrary groups `` \mathsf{G} `` . In particular, this fits
138+ with the formalism of monoidal categories, and more specifically fusion categoreis,
139+ discussed below and only requires the * topological* data of the group, i.e. the fusion
140+ rules of the irreps, their quantum dimensions and the F-symbol (6j-symbol or more precisely
141+ Racah's W-symbol in the case of `` \mathsf{SU}_2 `` ). In particular, we do not need the
142+ Clebsch-Gordan coefficients.
140143
141144Further details are provided in [ Sectors, representation spaces and fusion trees] ( @ref ) .
142145
143- ## Monoidal categories and their properties (optional)
146+ ## [ Monoidal categories and their properties (optional) ] ( @ id ss_category )
144147
145148The purpose of this final introductory section (which can safely be skipped), is to explain
146149how certain concepts and terminology from the theory of monoidal categories apply in the
147150context of tensors. In the end, identifying tensor manipulations in TensorKit.jl with
148151concepts from category theory is to put the diagrammatic formulation of tensor networks in
149152the most general context on a firmer footing. The following definitions are mostly based on
150- [ ^ selinger ] and [ `` n `` Lab] ( https://ncatlab.org/ ) , to which we refer for further
153+ [ ^ selinger ] , [ ^ kassel ] and [ `` n `` Lab] ( https://ncatlab.org/ ) , to which we refer for further
151154information. Furthermore, we recommend the nice introduction of [ Beer et al.] ( ^beer )
152155
153156To start, a category `` C `` consists of
154157* a class `` |C| `` of objects `` V `` , `` W `` , …
155- * for each pair of objects `` V `` and `` W `` , a set `` hom(W,V) `` of morphisms `` f:W→V ``
158+ * for each pair of objects `` V `` and `` W `` , a set `` hom(W,V) `` of morphisms `` f:W→V `` ;
159+ for a given map ` f ` , ` W ` is called the * domain* or * source* , and ` V ` the * codomain* or
160+ * target* .
156161* an composition of morphisms `` f:W→V `` and `` g:X→W `` into `` (f ∘ g):X→V `` that is
157162 associative, such that for `` h:Y→X `` we have `` f ∘ (g ∘ h) = (f ∘ g) ∘ h ``
158163* for each object `` V `` , an identity morphism `` \mathrm{id}_V:V→V `` such that
@@ -161,8 +166,9 @@ To start, a category ``C`` consists of
161166In our case, i.e. the category `` \mathbf{Vect} `` (or some subcategory thereof), the objects
162167are vector spaces, and the morphisms are linear maps between these vector spaces with
163168"matrix multiplication" as composition. We refer to these morphisms as tensor maps exactly
164- because there is an operation ` ⊗ ` , the tensor product, that allows to combine objects into
165- new objects. This makes `` \mathbf{Vect} `` into a ** monoidal category** , which has
169+ because there is a binary operation ` ⊗ ` , the tensor product, that allows to combine objects
170+ into new objects. This makes `` \mathbf{Vect} `` into a ** tensor category** , a.k.a
171+ a * monoidal category* , which has
166172* a binary operation on objects `` ⊗: |C| × |C| → |C| ``
167173* a binary operation on morphisms, also denoted as `` ⊗ `` , such that
168174 `` ⊗: hom(W_1,V_1) × hom(W_2,V_2) → hom(W_1 ⊗ W_2, V_1 ⊗ V_2) ``
@@ -174,62 +180,60 @@ new objects. This makes ``\mathbf{Vect}`` into a **monoidal category**, which ha
174180 `` α_{V_1,V_2,V_3}:(V_1 ⊗ V_2) ⊗ V_3 → V_1 ⊗ (V_2 ⊗ V_3) ``
175181 that satisfy certain consistency conditions (coherence axioms), which are known as the
176182 * triangle equation* and * pentagon equation* .
183+ In abstract terms, `` ⊗ `` is a (bi)functor from the product category `` C × C `` to `` C `` .
177184
178185For the category `` \mathbf{Vect} `` , the identity object `` I `` is just the scalar field,
179186which can be identified with a one-dimensional vector space. Every monoidal category is
180- equivalent to a strict monoidal category, where the left and right unitor and associator
187+ equivalent to a strict tensor category, where the left and right unitor and associator
181188act as the identity and their domain and codomain are truly identical. Nonetheless, for
182189tensor maps, we do actually discriminate between `` V `` , `` I ⊗ V `` and `` V ⊗ I `` because
183190this amounts to adding or removing an extra factor ` I ` to the tensor product structure of
184191the (co)domain, i.e. the left and right unitor are analogous to removing extra dimensions
185- of size 1 from an array,and an actual operation is required to do so (this has in fact led
192+ of size 1 from an array, and an actual operation is required to do so (this has in fact led
186193to some controversy in several programming languages that provide native support for
187194multidimensional arrays). For what concerns the associator, the distinction between
188195`` (V_1 ⊗ V_2) ⊗ V_3 `` and `` V_1 ⊗ (V_2 ⊗ V_3) `` is typically absent for simple tensors or
189196multidimensional arrays. However, this grouping can be taken to indicate how to build the
190197fusion tree for coupling irreps to a joint irrep in the case of symmetric tensors. As such,
191198going from one to the other requires a recoupling (F-move) which has a non-trivial action
192- on the reduced blocks. We return to this in the discussion of symmetric tensors.
199+ on the reduced blocks. We return to this in
200+ [ the section on fusion trees] (@ref s_sectorsrepfusion). However, we can already note that
201+ we will always represent tensor products using a canonical order
202+ `` (…((V_1 ⊗ V_2) ⊗ V_3) … ⊗ V_N) `` . A similar approach can be followed to map any tensor
203+ category into a strict tensor category (see Section XI.5 of [ ^ kassel ] ).
193204
194205With these definitions, we have the minimal requirements for defining tensor maps. In
195206principle, we could use a more general definition and define tensor maps as morphism of any
196- monoidal category where the hom-sets are themselves vector spaces, such that we can add
207+ tensor category where the hom-sets are themselves vector spaces, such that we can add
197208morphisms and multiply them with scalars. Such categories are called
198209`` \mathbf{Vect} `` -enriched.
199210
200211In order to make tensor (maps) useful and to define operations with them, we can now
201- introduce additional structure or quantifiers to the monoidal category for which they are
212+ introduce additional structure or quantifiers to the tensor category for which they are
202213the morphisms.
203214
204- ### Braiding
215+ ### [ Braiding] ( @ id sss_braiding)
205216
206217To reorder tensor indices, or, equivalently, to reorder objects in the tensor product
207- `` V_1 ⊗ V_2 ⊗ … V_N `` , we need at the very least a ** braided monoidal category** which
208- has, `` ∀ V, W ∈ |C| `` , a braiding `` σ_{V,W}: V⊗W → W⊗V `` . There is a consistency condition
209- between the braiding and the associator known as the * hexagon equation* . However, for
210- general braidings, there is no unique choice to identify a tensor in `` V⊗W `` and `` W⊗V `` ,
211- as any of the maps `` σ_{V,W} `` , `` σ_{W,V}^{-1} `` , `` σ_{V,W} ∘ σ_{W,V} ∘ σ_{V,W} `` , … and
212- are all different. In order for there to be a unique map from `` V_1 ⊗ V_2 ⊗ … V_N `` to any
213- permutation of the objects in this tensor product, the braiding needs to be * symmetric* ,
214- i.e. `` σ_{V,W} = σ_{W,V}^{-1} `` or, equivalently `` σ_{W,V} ∘ σ_{V,W} = \mathrm{id}_{V⊗W} `` .
215-
216- The resulting category is also referred to as a ** symmetric monoidal category** . In a
217- graphical representation, it means that there is no distinction between over- and under-
218+ `` V_1 ⊗ V_2 ⊗ … V_N `` , we need at the very least a ** braided tensor category** which has, `` ∀ V, W ∈ |C| `` , a braiding `` σ_{V,W}: V⊗W → W⊗V `` . A valid braiding needs to satisfy consistency condition with the associator `` α `` known as the * hexagon equation* .
219+
220+ However, for general braidings, there is no unique choice to identify a tensor in `` V⊗W ``
221+ and `` W⊗V `` , as any of the maps `` σ_{V,W} `` , `` σ_{W,V}^{-1} `` ,
222+ `` σ_{V,W} ∘ σ_{W,V} ∘ σ_{V,W} `` , … mapping from `` V⊗W `` to `` W⊗V `` are all different. In
223+ order for there to be a unique map from `` V_1 ⊗ V_2 ⊗ … V_N `` to any permutation of the
224+ objects in this tensor product, the braiding needs to be * symmetric* , i.e.
225+ `` σ_{V,W} = σ_{W,V}^{-1} `` or, equivalently `` σ_{W,V} ∘ σ_{V,W} = \mathrm{id}_{V⊗W} `` . The
226+ resulting category is then referred to as a ** symmetric tensor category** . In a graphical
227+ representation, it means that there is no distinction between over- and under-
218228crossings and, as such, lines can just cross.
219229
220230For a simple cartesian tensor, permuting the tensor indices is equivalent to applying
221231Julia's function ` permutedims ` on the underlying data. Less trivial braiding
222- implementations arise in the context of symmetric tensors (where the fusion tree needs to
223- be reordered) or in the case of fermions (described using so-called super vector spaces).
232+ implementations arise in the context of tensors with symmetries (where the fusion tree
233+ needs to be reordered) or in the case of fermions (described using so-called super vector
234+ spaces where the braiding is given by the Koszul sign rule).
224235
225- We can extend a braided category with a ** twist** `` θ_V `` , i.e. a family of isomorphisms
226- `` θ_V:V→V `` that satisfy `` θ_{V⊗W} = σ_{W,V} ∘ (θ_W ⊗ θ_V) ∘ σ_{V,W} `` and the resulting
227- category is called a ** balanced** monoidal category. The corresponding graphical
228- representation is that where objects are denoted by ribbons instead of lines, and a twist
229- is consistent with the graphical representation of a twisted ribbon and how it combines
230- with braidings.
231-
232- ### Duals
236+ ### [ Duals] (@id sss_dual)
233237
234238For tensor maps, the braiding structure only allows to reorder the objects within the domain
235239or within the codomain separately. An ** autonomous** or ** rigid** monoidal category is one
@@ -248,10 +252,7 @@ complex vector spaces, using a bra-ket notation and a generic basis ``{|n⟩}``
248252dual basis `` {⟨m|} `` for `` V^* `` (such that `` ⟨m|n⟩ = δ_{m,n} `` ), the unit is
249253`` η_V:ℂ → V ⊗ V^*:λ → λ ∑_n |n⟩ ⊗ ⟨n| `` and the co-unit is
250254`` ϵ_V:V^* ⊗ V → ℂ: ⟨m| ⊗ |n⟩ → δ_{m,n} `` . Note that this does not require an inner
251- product, i.e. no mapping from `` |n⟩ `` to `` ⟨n| `` was defined. Furthermore, note that we
252- used the physics convention, whereas mathematicians would typically interchange the order
253- of `` V `` and `` V^* `` as they appear in the codomain of the unit and in the domain of the co-
254- unit.
255+ product, i.e. no mapping from `` |n⟩ `` to `` ⟨n| `` was defined.
255256
256257For a general tensor map `` t:W_1 ⊗ W_2 ⊗ … ⊗ W_{N_2} → V_1 ⊗ V_2 ⊗ … ⊗ V_{N_1} `` , by
257258successively applying `` η_{W_{N_2}} `` , `` η_{W_{N_2-1}} `` , …, `` η_{W_{1}} `` (and the left or
@@ -260,6 +261,19 @@ right unitor) but no braiding, we obtain a tensor in
260261It does makes sense to define or identify
261262`` (W_1 ⊗ W_2 ⊗ … ⊗ W_{N_2})^* = W_{N_2}^* ⊗ … ⊗ W_{1}^* `` .
262263
264+ In fact, the above exact pairings are known as the left unit and co-unit, and `` V^* `` is the
265+ left dual of `` V `` . There is also a notion of a right dual `` ^*V `` and associated pairings,
266+ the right unit `` η'_V: I → ^*V ⊗ V `` and the right co-unit `` ϵ'_V: V ⊗ *^V → I `` . An
267+ autonomous category ` \mathbf{C} ` is one where every object ` V ` has both a left and right
268+ dual, and in this case they can be proven to be isomorphic. We will never distinguish
269+ between the two and refer simply to ` dual(V) ` for the dual of a vector space.
270+
271+ The braiding of a space and a dual space also follows naturally, it is given by
272+ `` σ_{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} ``
273+
274+
275+
276+
263277In general categories, one can distinguish between a left and right dual, but we always
264278assume that both objects are naturally isomorphic. Equivalently, `` V^{**} ≂ V `` and the
265279category is said to be ** pivotal** . For every morphism `` f:W→V `` , there is then a well
@@ -285,7 +299,16 @@ In the case of a symmetric braiding, most of these difficulties go away and the
285299structure follows. A symmetric monoidal category with duals is known as a ** compact closed
286300category** .
287301
288- ### Adjoints
302+ We can extend a braided category with a ** twist** `` θ_V `` , i.e. a family of isomorphisms
303+ `` θ_V:V→V `` that satisfy `` θ_{V⊗W} = σ_{W,V} ∘ (θ_W ⊗ θ_V) ∘ σ_{V,W} `` and the resulting
304+ category is called a ** balanced** monoidal category. The corresponding graphical
305+ representation is that where objects are denoted by ribbons instead of lines, and a twist
306+ is consistent with the graphical representation of a twisted ribbon and how it combines
307+ with braidings.
308+
309+
310+
311+ ### [ Adjoints] (@id sss_adjoints)
289312
290313
291314## Bibliography
0 commit comments