Skip to content

Commit 5fcd236

Browse files
authored
Various docs fixes and improvements (#409)
1 parent 9a4a96f commit 5fcd236

11 files changed

Lines changed: 19 additions & 16 deletions

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*-old
66
__pycache__
77
.ipynb*
8-
Manifest.toml
8+
*Manifest.toml
99
.vscode
1010
experimental
1111
refs

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ TensorKitFiniteDifferencesExt = "FiniteDifferences"
3636
TensorKitMooncakeExt = "Mooncake"
3737

3838
[workspace]
39-
projects = ["test"]
39+
projects = ["test", "docs"]
4040

4141
[compat]
4242
Adapt = "4"

docs/Project.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
name = "TensorKitDocs"
2+
13
[deps]
24
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
35
DocumenterInterLinks = "d12716ef-a0f6-4df4-a9f1-a5a34e75c656"
@@ -8,11 +10,12 @@ TensorKit = "07d1fe3e-3e46-537d-9eac-e9e13d0d4cec"
810
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
911
WignerSymbols = "9f57e263-0b3d-5e2e-b1be-24f2bb48858b"
1012

13+
[sources]
14+
TensorKit = {path = ".."}
15+
1116
[compat]
1217
Documenter = "1"
1318
DocumenterInterLinks = "1"
14-
LinearAlgebra = "1"
15-
Random = "1"
1619
SUNRepresentations = "0.3"
1720
Test = "1"
1821
WignerSymbols = "1,2"

docs/make.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22
if Base.active_project() != joinpath(@__DIR__, "Project.toml")
33
using Pkg
44
Pkg.activate(@__DIR__)
5-
Pkg.develop(PackageSpec(; path = joinpath(@__DIR__, "..")))
65
Pkg.resolve()
76
Pkg.instantiate()
87
end
98

109
using Documenter
1110
using Random
1211
using TensorKit
13-
using TensorKit: FusionTreePair, Index2Tuple
12+
using TensorKit: FusionTreePair, FusionTreeBlock, Index2Tuple
1413
using TensorKit.TensorKitSectors
1514
using TensorKit.MatrixAlgebraKit
1615
using DocumenterInterLinks

docs/src/appendix/symmetric_tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
In this tutorial, we will demonstrate how to construct specific [`TensorMap`](@ref)s which are relevant to some common physical systems, with an increasing degree of complexity.
44
We will assume the reader is somewhat familiar with [the notion of a *tensor map*](@ref ss_whatistensor) and has a rough idea of [what it means for a tensor map to be *symmetric*](@ref ss_symmetries).
5-
In going through these examples we aim to provide a relatively gentle introduction to the meaning of [symmetry sectors](@ref ss_sectors) and [vector spaces](@ref ss_rep) within the context of TensorKit.jl, [how to initialize a `TensorMap` over a given vector space](@ref ss_tensor_construction) and finally how to manually set the data of a [symmetric `TensorMap`](@ref ss_tutorial_symmetries).
5+
In going through these examples we aim to provide a relatively gentle introduction to the meaning of [symmetry sectors](@ref ss_sectors) and [vector spaces](@ref ss_representationtheory) within the context of TensorKit.jl, [how to initialize a `TensorMap` over a given vector space](@ref ss_tensor_construction) and finally how to manually set the data of a [symmetric `TensorMap`](@ref ss_tutorial_symmetries).
66
We will keep our discussion as intuitive and simple as possible, only adding as many technical details as strictly necessary to understand each example.
77
When considering a different physical system of interest, you should then be able to adapt these recipes and the intuition behind them to your specific problem at hand.
88

docs/src/lib/sectors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ frobenius_schur_indicator
9797
twist(::Sector)
9898
Base.isreal(::Type{<:Sector})
9999
TensorKitSectors.sectorscalartype
100-
deligneproduct(::Sector, ::Sector)
100+
deligneproduct(::Any, ::Any, ::Any, ::Vararg{Any})
101101
```
102102

103103
We have also the following methods that are specific to certain types of sectors and serve as accessors to their fields:

docs/src/lib/tensors.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ Random.randexp(::Type, V::TensorMapSpace)
5555
as well as a `similar` constructor
5656
```@docs
5757
Base.similar(::AbstractTensorMap, args...)
58+
similar_diagonal(::AbstractTensorMap, args...)
5859
```
5960

6061
### Specific constructors

docs/src/man/gradedspaces.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ With [`hassector(V, a)`](@ref) one can check if `V` contains a sector `a` with `
102102
Finally, `dim(V)` returns the total dimension of the space `V`, i.e. ``∑_a n_a d_a`` or thus `dim(V) = sum(dim(V, a) * dim(a) for a in sectors(V))`.
103103
Note that a representation space `V` has certain sectors `a` with dimensions `n_a`, then its dual `V'` will report to have sectors `dual(a)`, and `dim(V', dual(a)) == n_a`.
104104
There is a subtelty regarding the difference between the dual of a representation space ``R_a^*``, on which the conjugate representation acts, and the representation space of the irrep `dual(a) == conj(a)` that is isomorphic to the conjugate representation, i.e. ``R_{\overline{a}} ≂ R_a^*`` but they are not equal.
105-
We return to this in the section on [fusion trees](@ref ss_fusiontrees).
105+
We return to this in the section on [fusion trees](@ref sss_fusiontrees).
106106
This is true also in more general fusion categories beyond the representation categories of groups.
107107

108108
Other methods for `ElementarySpace`, such as [`dual`](@ref), [`fuse`](@ref) and [`flip`](@ref) also work.
@@ -118,7 +118,7 @@ The function [`dims(W, as)`](@ref) returns the corresponding tuple with degenera
118118
[`hassector(W, as)`](@ref) is equivalent to `dim(W, as) > 0`.
119119
Finally, there is the function [`blocksectors(W)`](@ref) which returns a list (of type `Vector`) with all possible "block sectors" or total/coupled sectors that can result from fusing the individual uncoupled sectors in `W`.
120120
Correspondingly, [`blockdim(W, a)`](@ref) counts the total degeneracy dimension of the coupled sector `a` in `W`.
121-
The machinery for computing this is the topic of the next section on [Fusion trees](@ref ss_fusiontrees), but first, it's time for some examples.
121+
The machinery for computing this is the topic of the next section on [Fusion trees](@ref sss_fusiontrees), but first, it's time for some examples.
122122

123123
## Examples
124124

docs/src/man/sectors.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ This means the following methods should be implemented for a new sector type `I
9292

9393
* `Base.iterate(::Type{SectorValues{I}} [, state])` should implement the iterator interface so as to enable iterating over all values of the sector `I` according to the canonical order defined by `isless`.
9494
* `Base.IteratorSize(::Type{SectorValues{I}})` should return `HasLength()` if the number of different values of sector `I` is finite and rather small, and `SizeUnknown()` or `IsInfinite()` otherwise.
95-
This is used to encode the degeneracies of the different sectors in a `GradedSpace` object efficiently, as discussed in the next section on [Graded spaces](@ref ss_rep).
95+
This is used to encode the degeneracies of the different sectors in a `GradedSpace` object efficiently, as discussed in the next section on [Graded spaces](@ref ss_representationtheory).
9696
* If `IteratorSize(::Type{SectorValues{I}}) == HasLength()`, then `Base.length(::Type{SectorValues{I}})` should return the number of different values of sector `I`.
9797

9898
Furthermore, the standard definitions `Base.IteratorEltype(::Type{SectorValues{I}}) = HasEltype()` and `Base.eltype(::Type{SectorValues{I}}) = I` are provided by default in TensorKitSectors.jl.
@@ -330,7 +330,7 @@ The storage benefits for small `N` are not only due to a smaller integer type in
330330
Base.IteratorSize(::Type{SectorValues{<:ZNIrrep}}) = HasLength()
331331
Base.IteratorSize(::Type{SectorValues{<:LargeZNIrrep}}) = SizeUnknown()
332332
```
333-
As a result, the `GradedSpace` implementation (see next section on [Graded spaces](@ref ss_rep)) to store general direct sum objects ``V = ⨁_a ℂ^{n_a} ⊗ R_{a}`` will use a very different internal representation for those two cases.
333+
As a result, the `GradedSpace` implementation (see next section on [Graded spaces](@ref ss_representationtheory)) to store general direct sum objects ``V = ⨁_a ℂ^{n_a} ⊗ R_{a}`` will use a very different internal representation for those two cases.
334334

335335
We furthermore define some aliases for the first (and most commonly used `ℤ{N}` irreps)
336336
```julia

docs/src/man/spaces.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ InnerProductStyle(ℂ^5)
142142
When creating tensors with indices in `ℝ^n` that have complex data, a one-time warning will be printed, but most operations should continue to work nonetheless.
143143

144144
One more important concrete implementation of `ElementarySpace` with a `EuclideanInnerProduct()` is the [`GradedSpace`](@ref) type, which is used to represent a graded complex vector space, where the grading is provided by the irreducible representations of a group, or more generally, the simple objects of a unitary fusion category.
145-
We refer to the subsection on [graded spaces](@ref ss_rep) on the [next page](@ref s_sectorsrepfusion) for further information about `GradedSpace`.
145+
We refer to the subsection on [graded spaces](@ref ss_representationtheory) on the [next page](@ref s_sectorsrepfusion) for further information about `GradedSpace`.
146146

147147
## Operations with elementary spaces
148148

@@ -176,7 +176,7 @@ A second type of operation with elementary spaces is the function [`flip(V::Elem
176176
`flip(V)` is different from `dual(V)` in the case of [`GradedSpace`](@ref).
177177
It is useful to flip a tensor index from a ket to a bra (or vice versa), by contracting that index with a unitary map from `V1` to `flip(V1)`.
178178

179-
While we provide some trivial examples here, we refer to the section on [graded spaces](@ref ss_rep) for examples where `flip` acts non-trivially and produces results that are different than `dual`.
179+
While we provide some trivial examples here, we refer to the section on [graded spaces](@ref ss_representationtheory) for examples where `flip` acts non-trivially and produces results that are different than `dual`.
180180

181181
```@repl tensorkit
182182
flip(ℂ^4)

0 commit comments

Comments
 (0)