-
Notifications
You must be signed in to change notification settings - Fork 56
Some more documentation progress #345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,8 +40,8 @@ Several more concrete sector types can be found in other packages such as | |
| [CategoryData.jl](https://github.com/QuantumKitHub/CategoryData.jl), | ||
| [QWignerSymbols.jl](https://github.com/lkdvos/QWignerSymbols.jl), ...: | ||
|
|
||
| Some of these types are parameterized by a type parameter that represents a group. | ||
| We therefore also provide a number of types to represent groups: | ||
| Some of these types are parameterized by a type parameter that represents a group. We | ||
| therefore also provide a number of types to represent groups: | ||
|
|
||
| ```@docs | ||
| TensorKitSectors.Group | ||
|
|
@@ -54,17 +54,17 @@ TensorKitSectors.Dihedral | |
| TensorKitSectors.ProductGroup | ||
| ``` | ||
|
|
||
| The following types are used to characterise different properties of the different types | ||
| of sectors: | ||
| The following types are used to characterise different properties of the different types of | ||
| sectors: | ||
|
|
||
| ```@docs | ||
| FusionStyle | ||
| BraidingStyle | ||
| UnitStyle | ||
| ``` | ||
|
|
||
| Finally, the following auxiliary types are defined to facilitate the implementation | ||
| of some of the methods on sectors: | ||
| Finally, the following auxiliary types are defined to facilitate the implementation of some | ||
| of the methods on sectors: | ||
|
|
||
| ```@docs | ||
| TensorKitSectors.SectorValues | ||
|
|
@@ -73,8 +73,8 @@ TensorKitSectors.SectorProductIterator | |
|
|
||
| ## Useful constants | ||
|
|
||
| The following constants are defined to facilitate obtaining the type associated | ||
| with the group elements or the irreducible representations of a given group: | ||
| The following constants are defined to facilitate obtaining the type associated with the | ||
| group elements or the irreducible representations of a given group: | ||
|
|
||
| ```@docs | ||
| Irrep | ||
|
|
@@ -83,8 +83,8 @@ GroupElement | |
|
|
||
| ## Methods for characterizing and manipulating `Sector` objects | ||
|
|
||
| The following methods can be used to obtain properties such as topological data | ||
| of sector objects, or to manipulate them or create related sectors: | ||
| The following methods can be used to obtain properties such as topological data of sector | ||
| objects, or to manipulate them or create related sectors: | ||
|
|
||
| ```@docs | ||
| unit | ||
|
|
@@ -107,8 +107,8 @@ TensorKitSectors.sectorscalartype | |
| deligneproduct(::Sector, ::Sector) | ||
| ``` | ||
|
|
||
| We have also the following methods that are specific to certain types of sectors | ||
| and serve as accessors to their fields: | ||
| We have also the following methods that are specific to certain types of sectors and serve | ||
| as accessors to their fields: | ||
|
|
||
| ```@docs | ||
| charge | ||
|
|
@@ -121,8 +121,15 @@ Furthermore, we also have one specific method acting on groups, represented as t | |
| × | ||
| ``` | ||
|
|
||
| Because we sometimes want to customize the string representation of our sector types, | ||
| we also have the following method: | ||
| Mapping between sectors and linear indices is only used for sectors `I` for which | ||
| `Base.IteratorSize(values(I)) == HasLength()`. In that case, we map an index `i` to a sector | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this true? I can call e.g.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The original reason for that method is that in the spaces, instead of a
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But yes, it is true. There is a default |
||
| `c` via `c = getindex(values(I), i)`, and provide an inverse mapping | ||
| ```@docs | ||
| TensorKitSectors.findindex | ||
| ``` | ||
|
|
||
| Because we sometimes want to customize the string representation of our sector types, we | ||
| also have the following method: | ||
|
|
||
| ```@docs | ||
| TensorKitSectors.type_repr | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -21,8 +21,8 @@ ProductSpace | |||||
| HomSpace | ||||||
| ``` | ||||||
|
|
||||||
| together with the following specific type for encoding the inner product structure of | ||||||
| a space: | ||||||
| together with the following specific type for encoding the inner product structure of a | ||||||
| space: | ||||||
|
|
||||||
| ```@docs | ||||||
| InnerProductStyle | ||||||
|
|
@@ -110,16 +110,16 @@ isepimorphic | |||||
| isisomorphic | ||||||
| ``` | ||||||
|
|
||||||
| Inserting trivial space factors or removing such factors for `ProductSpace` instances | ||||||
| can be done with the following methods. | ||||||
| Inserting trivial space factors or removing such factors for `ProductSpace` instances can be | ||||||
| done with the following methods. | ||||||
| ```@docs | ||||||
| insertleftunit(::ProductSpace, ::Val{i}) where {i} | ||||||
| insertrightunit(::ProductSpace, ::Val{i}) where {i} | ||||||
| removeunit(::ProductSpace, ::Val{i}) where {i} | ||||||
| ``` | ||||||
|
|
||||||
| There are also specific methods for `HomSpace` instances, that are used in determining | ||||||
| the resuling `HomSpace` after applying certain tensor operations. | ||||||
| There are also specific methods for `HomSpace` instances, that are used in determining the | ||||||
| resuling `HomSpace` after applying certain tensor operations. | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This suggestion I can also not commit directly. Very strange. |
||||||
|
|
||||||
| ```@docs | ||||||
| flip(W::HomSpace{S}, I) where {S} | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -38,11 +38,11 @@ TensorMap{T}(::UndefInitializer, V::TensorMapSpace) | |||||||||
| ``` | ||||||||||
|
|
||||||||||
| The resulting object can then be filled with data using the `setindex!` method as discussed | ||||||||||
| below, using functions such as `VectorInterface.zerovector!`, `rand!` or `fill!`, or it can | ||||||||||
| be used as an output argument in one of the many methods that accept output arguments, or | ||||||||||
| in an `@tensor output[...] = ...` expression. | ||||||||||
| below, using functions such as `VectorInterface.zerovector!`, `rand!` or `fill!`, or it can | ||||||||||
| be used as an output argument in one of the many methods that accept output arguments, or in | ||||||||||
| an `@tensor output[...] = ...` expression. | ||||||||||
|
|
||||||||||
| Alternatively, a `TensorMap` can be constructed by specifying its data, codmain and domain | ||||||||||
| Alternatively, a `TensorMap` can be constructed by specifying its data, codomain and domain | ||||||||||
| in one of the following ways: | ||||||||||
| ```@docs | ||||||||||
| TensorMap(data::AbstractDict{<:Sector,<:AbstractMatrix}, V::TensorMapSpace) | ||||||||||
|
|
@@ -98,8 +98,9 @@ domainind | |||||||||
| allind | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| In `TensorMap` instances, all data is gathered in a single `AbstractVector`, which has an internal structure into blocks associated to total coupled charge, within which live subblocks | ||||||||||
| associated with the different possible fusion-splitting tree pairs. | ||||||||||
| In `TensorMap` instances, all data is gathered in a single `AbstractVector`, which has an | ||||||||||
| internal structure into blocks associated to total coupled charge, within which live | ||||||||||
| subblocks associated with the different possible fusion-splitting tree pairs. | ||||||||||
|
|
||||||||||
| To obtain information about the structure of the data, you can use: | ||||||||||
| ```@docs | ||||||||||
|
|
@@ -110,7 +111,8 @@ hasblock(::AbstractTensorMap, ::Sector) | |||||||||
| fusiontrees(t::AbstractTensorMap) | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| Data can be accessed (and modified) in a number of ways. To access the full matrix block associated with the coupled charges, you can use: | ||||||||||
| Data can be accessed (and modified) in a number of ways. To access the full matrix block | ||||||||||
| associated with the coupled charges, you can use: | ||||||||||
| ```@docs | ||||||||||
| block | ||||||||||
| blocks | ||||||||||
|
|
@@ -128,7 +130,7 @@ Base.getindex(::AbstractTensorMap, ::FusionTree, ::FusionTree) | |||||||||
| Base.setindex!(::AbstractTensorMap, ::Any, ::FusionTree, ::FusionTree) | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| For a tensor `t` with `FusionType(sectortype(t)) isa UniqueFusion`, fusion trees are | ||||||||||
| For a tensor `t` with `FusionType(sectortype(t)) isa UniqueFusion`, fusion trees are | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
| completely determined by the outcoming sectors, and the data can be accessed in a more | ||||||||||
| straightforward way: | ||||||||||
| ```@docs | ||||||||||
|
|
@@ -155,25 +157,25 @@ Random.randexp! | |||||||||
| The operations that can be performed on an `AbstractTensorMap` can be organized into the | ||||||||||
| following categories: | ||||||||||
|
|
||||||||||
| * *vector operations*: these do not change the `space` or index strucure of a tensor and | ||||||||||
| can be straightforwardly implemented on on the full data. All the methods described in | ||||||||||
| * *vector operations*: these do not change the `space` or index strucure of a tensor and can | ||||||||||
| be straightforwardly implemented on on the full data. All the methods described in | ||||||||||
|
Comment on lines
+160
to
+161
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
| [VectorInterface.jl](https://github.com/Jutho/VectorInterface.jl) are supported. For | ||||||||||
| compatibility reasons, we also provide implementations for equivalent methods from | ||||||||||
| LinearAlgebra.jl, such as `axpy!`, `axpby!`. | ||||||||||
|
|
||||||||||
| * *index manipulations*: these change (permute) the index structure of a tensor, which | ||||||||||
| affects the data in a way that is fully determined by the categorical data of the | ||||||||||
| `sectortype` of the tensor. | ||||||||||
|
|
||||||||||
| * *(planar) contractions* and *(planar) traces* (i.e., contractions with identity tensors). | ||||||||||
| Tensor contractions correspond to a combination of some index manipulations followed by | ||||||||||
| a composition or multiplication of the tensors in their role as linear maps. | ||||||||||
| Tensor contractions are however of such important and frequency that they require a | ||||||||||
| dedicated implementation. | ||||||||||
| Tensor contractions correspond to a combination of some index manipulations followed by a | ||||||||||
| composition or multiplication of the tensors in their role as linear maps. Tensor | ||||||||||
| contractions are however of such important and frequency that they require a dedicated | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
| implementation. | ||||||||||
|
|
||||||||||
| * *tensor factorisations*, which relies on their identification of tensors with linear maps | ||||||||||
| between tensor spaces. The factorisations are applied as ordinary matrix factorisations | ||||||||||
| to the matrix blocks associated with the coupled charges. | ||||||||||
| between tensor spaces. The factorisations are applied as ordinary matrix factorisations to | ||||||||||
| the matrix blocks associated with the coupled charges. | ||||||||||
|
Comment on lines
+177
to
+178
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There's another "factorisation" in the line above |
||||||||||
|
|
||||||||||
| ### Index manipulations | ||||||||||
|
|
||||||||||
|
|
@@ -220,20 +222,22 @@ contract! | |||||||||
|
|
||||||||||
| ## `TensorMap` factorizations | ||||||||||
|
|
||||||||||
| The factorisation methods are powered by [MatrixAlgebraKit.jl](https://github.com/QuantumKitHub/MatrixAlgebraKit.jl) | ||||||||||
| and all follow the same strategy. The idea is that the `TensorMap` is interpreted as a linear | ||||||||||
| map based on the current partition of indices between `domain` and `codomain`, and then the | ||||||||||
| entire range of MatrixAlgebraKit functions can be called. | ||||||||||
| Factorizing a tensor according to a different partition of the indices is possible | ||||||||||
| by prepending the factorization step with an explicit call to [`permute`](@ref) or [`transpose`](@ref). | ||||||||||
| The factorisation methods are powered by | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
| [MatrixAlgebraKit.jl](https://github.com/QuantumKitHub/MatrixAlgebraKit.jl) and all follow | ||||||||||
| the same strategy. The idea is that the `TensorMap` is interpreted as a linear map based on | ||||||||||
| the current partition of indices between `domain` and `codomain`, and then the entire range | ||||||||||
| of MatrixAlgebraKit functions can be called. Factorizing a tensor according to a different | ||||||||||
| partition of the indices is possible by prepending the factorization step with an explicit | ||||||||||
| call to [`permute`](@ref) or [`transpose`](@ref). | ||||||||||
|
|
||||||||||
| For the full list of factorizations, see [Decompositions](@extref MatrixAlgebraKit). | ||||||||||
|
|
||||||||||
| Additionally, it is possible to obtain truncated versions of some of these factorizations | ||||||||||
| through the [`MatrixAlgebraKit.TruncationStrategy`](@ref) objects. | ||||||||||
|
|
||||||||||
| The exact truncation strategy can be controlled through the strategies defined in [Truncations](@extref MatrixAlgebraKit), | ||||||||||
| but for `TensorMap`s there is also the special-purpose scheme: | ||||||||||
| The exact truncation strategy can be controlled through the strategies defined in | ||||||||||
| [Truncations](@extref MatrixAlgebraKit), but for `TensorMap`s there is also the | ||||||||||
| special-purpose scheme: | ||||||||||
|
|
||||||||||
| ```@docs | ||||||||||
| truncspace | ||||||||||
|
|
||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since American English is preferred in the docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somehow I cannot commit this suggestion directly so I'll have to change it manually.