Skip to content

Commit 227b5f3

Browse files
Juthoborisdevoslkdvos
authored
Some more documentation progress (#345)
* updating sectors part 1 * major doc restructuring and update * fix setup block and do format after all * Commit first batch of suggestions. Co-authored-by: Boris De Vos <143942306+borisdevos@users.noreply.github.com> * More suggestions committed Co-authored-by: Boris De Vos <143942306+borisdevos@users.noreply.github.com> * address review comments * adjust header level * update tensormanipulations section * fix type restriction on tensorcat * capitalise references * leftover typos and cleaner sentences * missed some citations * reformat markdown lines * Apply suggestions from code review [skip ci] Co-authored-by: Boris De Vos <143942306+borisdevos@users.noreply.github.com> * `AbstractTensorMap{T, S}` --------- Co-authored-by: Boris De Vos <143942306+borisdevos@users.noreply.github.com> Co-authored-by: Lukas Devos <ldevos98@gmail.com> Co-authored-by: Boris De Vos <boris.devos@ugent.be>
1 parent 7dc8fe6 commit 227b5f3

21 files changed

Lines changed: 2869 additions & 4284 deletions

docs/LocalPreferences.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[SUNRepresentations]
2+
display_mode = "dimension"

docs/make.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,18 @@ using DocumenterInterLinks
77

88
links = InterLinks(
99
"MatrixAlgebraKit" => "https://quantumkithub.github.io/MatrixAlgebraKit.jl/stable/",
10-
"TensorOperations" => "https://quantumkithub.github.io/TensorOperations.jl/stable/"
10+
"TensorOperations" => "https://quantumkithub.github.io/TensorOperations.jl/stable/",
11+
"TensorKitSectors" => "https://quantumkithub.github.io/TensorKitSectors.jl/dev/"
1112
)
1213

1314
pages = [
1415
"Home" => "index.md",
1516
"Manual" => [
1617
"man/intro.md", "man/tutorial.md",
17-
"man/spaces.md", "man/sectors.md", "man/tensors.md",
18+
"man/spaces.md", "man/symmetries.md",
19+
"man/sectors.md", "man/gradedspaces.md",
20+
"man/fusiontrees.md", "man/tensors.md",
21+
"man/tensormanipulations.md",
1822
],
1923
"Library" => [
2024
"lib/sectors.md", "lib/fusiontrees.md",

docs/src/appendix/categories.md

Lines changed: 476 additions & 783 deletions
Large diffs are not rendered by default.

docs/src/appendix/symmetric_tutorial.md

Lines changed: 339 additions & 665 deletions
Large diffs are not rendered by default.

docs/src/index.md

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,34 +8,23 @@ CurrentModule = TensorKit
88

99
## Package summary
1010

11-
TensorKit.jl aims to be a generic package for working with tensors as they appear throughout
12-
the physical sciences. TensorKit implements a parametric type [`Tensor`](@ref) (which is
13-
actually a specific case of the type [`TensorMap`](@ref)) and defines for these types a
14-
number of vector space operations (scalar multiplication, addition, norms and inner
15-
products), index operations (permutations) and linear algebra operations (multiplication,
16-
factorizations). Finally, tensor contractions can be performed using the `@tensor` macro
17-
from [TensorOperations.jl](https://github.com/QuantumKitHub/TensorOperations.jl).
18-
19-
Currently, most effort is oriented towards tensors as they appear in the context of quantum
20-
many-body physics and in particular the field of tensor networks. Such tensors often have
21-
large dimensions and take on a specific structure when symmetries are present. By employing
22-
concepts from category theory, we can represent and manipulate tensors with a large
23-
variety of symmetries, including abelian and non-abelian symmetries, fermionic statistics,
24-
as well as generalized (a.k.a. non-invertible or anyonic) symmetries.
25-
26-
At the same time, TensorKit.jl focusses on computational efficiency and performance. The
27-
underlying storage of a tensor's data can be any `DenseArray`. When the data is stored
28-
in main memory (corresponding to `Array`), multiple CPUs can be leveraged as many
29-
operations come with multithreaded implementations, either by distributing the different
30-
blocks in case of a structured tensor (i.e. with symmetries) or by using multithreading
31-
provided by the package [Strided.jl](https://github.com/Jutho/Strided.jl). Support for
32-
storing and manipulating tensors on NVidia and AMD GPUs is currently being developed,
33-
whereas support for distributed arrays is planned for the future.
11+
TensorKit.jl aims to be a generic package for working with tensors as they appear throughout the physical sciences.
12+
TensorKit implements a parametric type [`Tensor`](@ref) (which is actually a specific case of the type [`TensorMap`](@ref)) and defines for these types a number of vector space operations (scalar multiplication, addition, norms and inner products), index operations (permutations) and linear algebra operations (multiplication, factorizations).
13+
Finally, tensor contractions can be performed using the `@tensor` macro from [TensorOperations.jl](https://github.com/QuantumKitHub/TensorOperations.jl).
14+
15+
Currently, most effort is oriented towards tensors as they appear in the context of quantum many-body physics and in particular the field of tensor networks.
16+
Such tensors often have large dimensions and take on a specific structure when symmetries are present.
17+
By employing concepts from category theory, we can represent and manipulate tensors with a large variety of symmetries, including abelian and non-abelian symmetries, fermionic statistics, as well as generalized (a.k.a. non-invertible or anyonic) symmetries.
18+
19+
At the same time, TensorKit.jl focusses on computational efficiency and performance.
20+
The underlying storage of a tensor's data can be any `DenseArray`.
21+
When the data is stored in main memory (corresponding to `Array`), multiple CPUs can be leveraged as many operations come with multithreaded implementations, either by distributing the different blocks in case of a structured tensor (i.e. with symmetries) or by using multithreading provided by the package [Strided.jl](https://github.com/Jutho/Strided.jl).
22+
Support for storing and manipulating tensors on Nvidia and AMD GPUs is currently being developed, whereas support for distributed arrays is planned for the future.
3423

3524
## Contents of the manual
3625

3726
```@contents
38-
Pages = ["man/intro.md", "man/spaces.md", "man/sectors.md", "man/tensors.md"]
27+
Pages = ["man/intro.md", "man/spaces.md", "man/symmetries.md", "man/sectors.md", "man/gradedspaces.md", "man/fusiontrees.md", "man/tensors.md", "man/tensormanipulations.md"]
3928
Depth = 2
4029
```
4130

docs/src/lib/fusiontrees.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ braid(f::FusionTree{I,N}, levels::NTuple{N,Int}, p::NTuple{N,Int}) where {I<:Sec
3131
permute(f::FusionTree{I,N}, p::NTuple{N,Int}) where {I<:Sector,N}
3232
```
3333

34-
These can be composed to implement elementary manipulations of fusion-splitting tree pairs,
35-
according to the following methods
34+
These can be composed to implement elementary manipulations of fusion-splitting tree pairs, according to the following methods
3635

3736
```julia
3837
# TODO: add documentation for the following methods
@@ -44,9 +43,8 @@ TensorKit.cycleclockwise
4443
TensorKit.cycleanticlockwise
4544
```
4645

47-
Finally, these are used to define large manipulations of fusion-splitting tree pairs, which
48-
are then used in the index manipulation of `AbstractTensorMap` objects. The following methods
49-
defined on fusion splitting tree pairs have an associated definition for tensors.
46+
Finally, these are used to define large manipulations of fusion-splitting tree pairs, which are then used in the index manipulation of `AbstractTensorMap` objects.
47+
The following methods defined on fusion splitting tree pairs have an associated definition for tensors.
5048
```@docs
5149
repartition(::FusionTree{I,N₁}, ::FusionTree{I,N₂}, ::Int) where {I<:Sector,N₁,N₂}
5250
transpose(::FusionTree{I}, ::FusionTree{I}, ::IndexTuple{N₁}, ::IndexTuple{N₂}) where {I<:Sector,N₁,N₂}

docs/src/lib/sectors.md

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,7 @@ TimeReversed
3535
ProductSector
3636
```
3737

38-
Several more concrete sector types can be found in other packages such as
39-
[SUNRepresentations.jl](https://github.com/QuantumKitHub/SUNRepresentations.jl),
40-
[CategoryData.jl](https://github.com/QuantumKitHub/CategoryData.jl),
41-
[QWignerSymbols.jl](https://github.com/lkdvos/QWignerSymbols.jl), ...:
38+
Several more concrete sector types can be found in other packages such as [SUNRepresentations.jl](https://github.com/QuantumKitHub/SUNRepresentations.jl), [CategoryData.jl](https://github.com/QuantumKitHub/CategoryData.jl), [QWignerSymbols.jl](https://github.com/lkdvos/QWignerSymbols.jl), ...:
4239

4340
Some of these types are parameterized by a type parameter that represents a group.
4441
We therefore also provide a number of types to represent groups:
@@ -54,17 +51,15 @@ TensorKitSectors.Dihedral
5451
TensorKitSectors.ProductGroup
5552
```
5653

57-
The following types are used to characterise different properties of the different types
58-
of sectors:
54+
The following types are used to characterize different properties of the different types of sectors:
5955

6056
```@docs
6157
FusionStyle
6258
BraidingStyle
6359
UnitStyle
6460
```
6561

66-
Finally, the following auxiliary types are defined to facilitate the implementation
67-
of some of the methods on sectors:
62+
Finally, the following auxiliary types are defined to facilitate the implementation of some of the methods on sectors:
6863

6964
```@docs
7065
TensorKitSectors.SectorValues
@@ -73,8 +68,7 @@ TensorKitSectors.SectorProductIterator
7368

7469
## Useful constants
7570

76-
The following constants are defined to facilitate obtaining the type associated
77-
with the group elements or the irreducible representations of a given group:
71+
The following constants are defined to facilitate obtaining the type associated with the group elements or the irreducible representations of a given group:
7872

7973
```@docs
8074
Irrep
@@ -83,8 +77,7 @@ GroupElement
8377

8478
## Methods for characterizing and manipulating `Sector` objects
8579

86-
The following methods can be used to obtain properties such as topological data
87-
of sector objects, or to manipulate them or create related sectors:
80+
The following methods can be used to obtain properties such as topological data of sector objects, or to manipulate them or create related sectors:
8881

8982
```@docs
9083
unit
@@ -107,8 +100,7 @@ TensorKitSectors.sectorscalartype
107100
deligneproduct(::Sector, ::Sector)
108101
```
109102

110-
We have also the following methods that are specific to certain types of sectors
111-
and serve as accessors to their fields:
103+
We have also the following methods that are specific to certain types of sectors and serve as accessors to their fields:
112104

113105
```@docs
114106
charge
@@ -121,8 +113,14 @@ Furthermore, we also have one specific method acting on groups, represented as t
121113
×
122114
```
123115

124-
Because we sometimes want to customize the string representation of our sector types,
125-
we also have the following method:
116+
Mapping between sectors and linear indices is only used for sectors `I` for which `Base.IteratorSize(values(I)) == HasLength()`.
117+
In that case, we map an index `i` to a sector `c` via `c = getindex(values(I), i)`, and provide an inverse mapping
118+
119+
```@docs
120+
TensorKitSectors.findindex
121+
```
122+
123+
Because we sometimes want to customize the string representation of our sector types, we also have the following method:
126124

127125
```@docs
128126
TensorKitSectors.type_repr
@@ -133,4 +131,3 @@ Finally, we provide functionality to compile all revelant methods for a sector:
133131
```@docs
134132
TensorKitSectors.precompile_sector
135133
```
136-

docs/src/lib/spaces.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,22 @@ ProductSpace
2121
HomSpace
2222
```
2323

24-
together with the following specific type for encoding the inner product structure of
25-
a space:
24+
together with the following specific type for encoding the inner product structure of a space:
2625

2726
```@docs
2827
InnerProductStyle
2928
```
3029

3130
## Useful constants
3231

33-
The following constants are defined to easily create the concrete type of `GradedSpace`
34-
associated with a given type of sector.
32+
The following constants are defined to easily create the concrete type of `GradedSpace` associated with a given type of sector.
3533

3634
```@docs
3735
Vect
3836
Rep
3937
```
4038

41-
In this respect, there are also a number of type aliases for the `GradedSpace` types
42-
associated with the most common sectors, namely
39+
In this respect, there are also a number of type aliases for the `GradedSpace` types associated with the most common sectors, namely
4340

4441
```julia
4542
const ZNSpace{N} = Vect[ZNIrrep{N}]
@@ -110,16 +107,15 @@ isepimorphic
110107
isisomorphic
111108
```
112109

113-
Inserting trivial space factors or removing such factors for `ProductSpace` instances
114-
can be done with the following methods.
110+
Inserting trivial space factors or removing such factors for `ProductSpace` instances can be done with the following methods.
111+
115112
```@docs
116113
insertleftunit(::ProductSpace, ::Val{i}) where {i}
117114
insertrightunit(::ProductSpace, ::Val{i}) where {i}
118115
removeunit(::ProductSpace, ::Val{i}) where {i}
119116
```
120117

121-
There are also specific methods for `HomSpace` instances, that are used in determining
122-
the resuling `HomSpace` after applying certain tensor operations.
118+
There are also specific methods for `HomSpace` instances, that are used in determining the resulting `HomSpace` after applying certain tensor operations.
123119

124120
```@docs
125121
flip(W::HomSpace{S}, I) where {S}

0 commit comments

Comments
 (0)