Skip to content

Commit 002e1d8

Browse files
Jutholkdvos
andauthored
WIP: implementation of DiagonalTensorMap (#174)
* start implementation of DiagonalTensorMap * further progress on DiagonalTensorMap [skip ci] * more fixes and first tests * a bit more functionality and tests * resolve conflict in Project.toml * finegrain homespace permutation and selection * fix and add more tests * implement suggestions and more tests * replace compose with mul! and compose_dest * Also rename testfile * Extend `mul!` to include `alfa` and `beta` * Add TensorOperations specializations * Add show for Diagonal * changelog, docs and final fixes --------- Co-authored-by: Lukas Devos <[email protected]>
1 parent 7033560 commit 002e1d8

22 files changed

+667
-467
lines changed

Changelog.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,24 @@ Features that are planned to be implemented before the release of v1.0.0, in no
1515

1616
# Changelog
1717

18+
## v0.14
19+
20+
### `DiagonalTensorMap` and `reduceddim`
21+
22+
This adds a `DiagonalTensorMap` type for representing tensor maps in which all of the
23+
blocks are diagonal. This only makes sense for maps between a single index in the domain and
24+
the codomain (which are furthermore required to be the same), as otherwise the fusion and
25+
splitting trees from the domain and codomain to the blocked sectors would itself be
26+
nondiagonal. This new type will be used to capture the singular values and eigenvalues as
27+
tensor maps in the corresponding decompositions. The number of free parameters in a
28+
`DiagonalTensorMap` instance on vector space `V` is equal to `reduceddim(V)`, a new function
29+
that sums up the degeneracy dimension `dim(V, c)` for each of the sectors `c` in `V`. This
30+
function can be useful by itself and is also exported from the `TensorKit` module. An
31+
instance of `DiagonalTensorMap` can then be created as `DiagonalTensorMap(data, V)` where
32+
`data` is a vector of length `reduceddim(V)`.
33+
34+
## v0.13
35+
1836
### `AbstractTensorMap{E,S,N₁,N₂}`
1937

2038
This adds the scalar type as a parameter to the `AbstractTensorMap` type. This is useful in

docs/src/lib/sectors.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,7 @@ are then used in the index manipulation of `AbstractTensorMap` objects. The foll
114114
defined on fusion splitting tree pairs have an associated definition for tensors.
115115
```@docs
116116
repartition
117-
transpose(f₁::FusionTree{I}, f₂::FusionTree{I},
118-
p1::IndexTuple{N₁}, p2::IndexTuple{N₂}) where {I<:Sector,N₁,N₂}
119-
braid(f₁::FusionTree{I}, f₂::FusionTree{I}, levels1::IndexTuple, levels2::IndexTuple, p1::IndexTuple{N₁}, p2::IndexTuple{N₂}) where {I<:Sector,N₁,N₂}
120-
permute(f₁::FusionTree{I}, f₂::FusionTree{I}, p1::IndexTuple{N₁}, p2::IndexTuple{N₂}) where {I<:Sector,N₁,N₂}
117+
transpose(::FusionTree{I}, ::FusionTree{I}, ::IndexTuple{N₁}, ::IndexTuple{N₂}) where {I<:Sector,N₁,N₂}
118+
braid(::FusionTree{I}, ::FusionTree{I}, ::IndexTuple, ::IndexTuple, ::IndexTuple{N₁}, ::IndexTuple{N₂}) where {I<:Sector,N₁,N₂}
119+
permute(::FusionTree{I}, ::FusionTree{I}, ::IndexTuple{N₁}, ::IndexTuple{N₂}) where {I<:Sector,N₁,N₂}
121120
```

docs/src/lib/spaces.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ const CU₁Space = CU1Space
5959
const SU₂Space = SU2Space
6060
```
6161

62-
## Methods
62+
## [Methods](@id s_spacemethods)
6363

6464
Methods often apply similar to e.g. spaces and corresponding tensors or tensor maps, e.g.:
6565

@@ -70,14 +70,15 @@ sectors
7070
hassector
7171
dim(::VectorSpace)
7272
dim(::ElementarySpace, ::Sector)
73+
reduceddim
7374
dim(P::ProductSpace{<:ElementarySpace,N}, sector::NTuple{N,<:Sector}) where {N}
7475
dim(::HomSpace)
7576
dims
76-
blocksectors(::ProductSpace)
77+
blocksectors(P::ProductSpace{S,N}) where {S,N}
7778
blocksectors(::HomSpace)
7879
hasblock
7980
blockdim
80-
fusiontrees(::ProductSpace, ::Sector)
81+
fusiontrees(P::ProductSpace{S,N}, blocksector::I) where {S,N,I}
8182
space
8283
```
8384

@@ -107,10 +108,11 @@ isisomorphic
107108
insertunit
108109
```
109110

110-
There are also specific methods for `HomSpace` instances, that mimic the effect of that
111-
operation on the corresponding tensor maps:
111+
There are also specific methods for `HomSpace` instances, that are used in determining
112+
the resuling `HomSpace` after applying certain tensor operations.
112113

113114
```@docs
114-
permute(::HomSpace, ::Index2Tuple)
115-
compose(::HomSpace{S}, ::HomSpace{S}) where {S}
115+
TensorKit.permute(::HomSpace{S}, ::Index2Tuple{N₁,N₂}) where {S,N₁,N₂}
116+
TensorKit.select(::HomSpace{S}, ::Index2Tuple{N₁,N₂}) where {S,N₁,N₂}
117+
TensorKit.compose(::HomSpace{S}, ::HomSpace{S}) where {S}
116118
```

docs/src/lib/tensors.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ AbstractTensorMap
1414
The following concrete subtypes are provided within the TensorKit library:
1515
```@docs
1616
TensorMap
17+
DiagonalTensorMap
1718
AdjointTensorMap
1819
BraidingTensor
1920
```
@@ -201,6 +202,11 @@ contract!
201202

202203
## `TensorMap` factorizations
203204

205+
The factorisation methods come in two flavors, namely a non-destructive version where you
206+
can specify an additional permutation of the domain and codomain indices before the
207+
factorisation is performed (provided that `sectorstyle(t)` has a symmetric braiding) as
208+
well as a destructive version The non-destructive methods are given first:
209+
204210
```@docs
205211
leftorth
206212
rightorth
@@ -209,7 +215,13 @@ rightnull
209215
tsvd
210216
eigh
211217
eig
218+
eigen
212219
isposdef
213220
```
214221

222+
The corresponding destructive methods have an exclamation mark at the end of their name,
223+
and only accept the `TensorMap` object as well as the method-specific algorithm and keyword
224+
arguments.
225+
226+
215227
TODO: document svd truncation types

0 commit comments

Comments
 (0)