Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ mathengine = MathJax3(
)
)
)
DocMeta.setdocmeta!(
TensorKitSectors, :DocTestSetup, :(using TensorKitSectors); recursive = true
)

makedocs(;
sitename = "TensorKitSectors.jl",
format = Documenter.HTML(;
Expand Down
11 changes: 8 additions & 3 deletions docs/src/sectors/abelian/trivial.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
```@meta
DocTestSetup = quote
using TensorKitSectors
end
```

# Trivial Sector: `Trivial`

`Trivial` is the trivial sector for ordinary vector spaces.
Expand All @@ -11,9 +17,8 @@ Trivial

There is only one label:

```julia
using TensorKitSectors

```jldoctest
julia> Trivial()
Trivial()
```

Expand Down
15 changes: 11 additions & 4 deletions docs/src/sectors/abelian/u1.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
```@meta
DocTestSetup = quote
using TensorKitSectors
end
```

# ``U(1)`` Representations: `U1Irrep`

`U1Irrep` represents irreducible representations of the compact abelian group ``U(1)`` as a `Sector`.
Expand Down Expand Up @@ -36,11 +42,12 @@ Since this is a representation category, the braiding style is `Bosonic()` and a
`values(U1Irrep)` is infinite.
The iterator starts at zero and alternates positive and negative charges:

```julia
using TensorKitSectors
```jldoctest
julia> values(U1Irrep)[6]
Irrep[U₁](3/2)

values(U1Irrep)[6] # output: Irrep[U₁](3/2)
values(U1Irrep)[7] # output: Irrep[U₁](-3/2)
julia> values(U1Irrep)[7]
Irrep[U₁](-3/2)
```

## References
Expand Down
15 changes: 11 additions & 4 deletions docs/src/sectors/abelian/zn.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
```@meta
DocTestSetup = quote
using TensorKitSectors
end
```

# Cyclic Group Representations: `ZNIrrep`

`ZNIrrep{N}` and `LargeZNIrrep{N}` represent irreducible representations of the cyclic group ``ℤ_N``.
Expand Down Expand Up @@ -38,11 +44,12 @@ The braiding style is `Bosonic()`.

`values(ZNIrrep{N})` iterates charges in increasing order from `0` to `N - 1`.

```julia
using TensorKitSectors
```jldoctest
julia> values(ZNIrrep{5})[4]
Irrep[ℤ{5}](3)

values(ZNIrrep{5})[4] # output is Irrep[ℤ{5}](3)
values(ZNIrrep{34})[34] # output is Irrep[ℤ{34}](33)
julia> values(ZNIrrep{34})[34]
Irrep[ℤ{34}](33)
```

## References
Expand Down
26 changes: 19 additions & 7 deletions docs/src/sectors/composite/named.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
```@meta
DocTestSetup = quote
using TensorKitSectors
end
```

# Named Sectors: `NamedSector`

`NamedSector` represents the same Deligne tensor product as [`ProductSector`](@ref), but stores its component sectors in a *named* tuple so that they can be accessed by name rather than by position.
Expand All @@ -12,15 +18,21 @@ NamedSector

A named sector is constructed with keyword arguments to `⊠`/`NamedSector`, or from a type built with the [`@NamedSector`](@ref) macro:

```julia
using TensorKitSectors
```jldoctest
julia> s = ⊠(; charge = U1Irrep(1), spin = SU2Irrep(1//2))
NamedSector(; charge=Irrep[U₁](1), spin=Irrep[SU₂](1/2))

julia> s.charge
Irrep[U₁](1)

julia> s.spin
Irrep[SU₂](1/2)

s = ⊠(; charge = U1Irrep(1), spin = SU2Irrep(1//2)) # (charge=1, spin=1/2)
s.charge # 1
s.spin # 1/2
julia> I = @NamedSector{charge::U1Irrep, spin::SU2Irrep}
NamedSector{@NamedTuple{charge::U1Irrep, spin::SU2Irrep}}

I = @NamedSector{charge::U1Irrep, spin::SU2Irrep}
I(U1Irrep(1), SU2Irrep(1//2)) # same as above
julia> I(U1Irrep(1), SU2Irrep(1//2))
NamedSector(; charge=Irrep[U₁](1), spin=Irrep[SU₂](1/2))
```


Expand Down
24 changes: 16 additions & 8 deletions docs/src/sectors/composite/product.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
```@meta
DocTestSetup = quote
using TensorKitSectors
end
```

# Product Sectors: `ProductSector`

`ProductSector` represents the Deligne tensor product of sector categories.
Expand All @@ -15,20 +21,22 @@ A product sector stores its component sectors in a tuple.
The recommended constructor is the Deligne product operator `⊠` (typed as `\boxtimes<TAB>`).
The more verbose alias `deligneproduct` is also available:

```julia
using TensorKitSectors
```jldoctest
julia> a = Z2Irrep(1) ⊠ FibonacciAnyon(:τ)
(Irrep[ℤ₂](1) ⊠ FibonacciAnyon(:τ))

a = Z2Irrep(1)FibonacciAnyon(:τ) # (Irrep[ℤ₂](1) ⊠ FibonacciAnyon(:τ))
deligneproduct(Z2Irrep(1), FibonacciAnyon(:τ)) # same as above
julia> deligneproduct(Z2Irrep(1), FibonacciAnyon(:τ)) # same as above
(Irrep[ℤ₂](1)FibonacciAnyon(:τ))
```

The same operator works on sector types:

```julia
using TensorKitSectors
```jldoctest
julia> I = Z2Irrep ⊠ FibonacciAnyon
ProductSector{Tuple{Z2Irrep, FibonacciAnyon}}

I = Z2Irrep ⊠ FibonacciAnyon
a = I(1, :τ)
julia> a = I(1, :τ)
(Irrep[ℤ₂](1) ⊠ FibonacciAnyon(:τ))
```

Products are flattened, and `Trivial` factors are removed:
Expand Down
19 changes: 14 additions & 5 deletions docs/src/sectors/composite/timereversed.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
```@meta
DocTestSetup = quote
using TensorKitSectors
end
```

# Time-Reversed Sectors: `TimeReversed`

`TimeReversed{I}` represents the time-reversed, or conjugate-braided, version of a sector type `I`.
Expand All @@ -13,12 +19,15 @@ timereversed
Construct a wrapped sector with `TimeReversed(a)` or `TimeReversed{I}(a)`.
The helper `timereversed(a)` avoids unnecessary wrappers for symmetric braiding categories and unwraps an already time-reversed sector:

```julia
using TensorKitSectors
```jldoctest
julia> a = IsingAnyon(:σ)
IsingAnyon(:σ)

julia> timereversed(a)
TimeReversed{IsingAnyon}(:σ)

a = IsingAnyon(:σ)
timereversed(a) # TimeReversed{IsingAnyon}(:σ)
timereversed(timereversed(a)) # IsingAnyon(:σ)
julia> timereversed(timereversed(a))
IsingAnyon(:σ)
```

`TimeReversed` is not defined for sectors with `NoBraiding()`.
Expand Down
12 changes: 6 additions & 6 deletions src/named.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ Similar to [`ProductSector`](@ref), but components are accessible by name via `s

# Examples

```julia
```jldoctest
julia> s = NamedSector(; charge=U1Irrep(1), spin=SU2Irrep(1//2))
(charge=1, spin=1/2)
NamedSector(; charge=Irrep[U₁](1), spin=Irrep[SU₂](1/2))

julia> s.charge
1
Irrep[U₁](1)

julia> s.spin
1/2
Irrep[SU₂](1/2)
```

!!! warning
Expand Down Expand Up @@ -182,12 +182,12 @@ Convenience macro for constructing a `NamedSector` type with named components,
analogous to `@NamedTuple`.

# Examples
```julia
```jldoctest
julia> @NamedSector{charge::U1Irrep, spin::SU2Irrep}
NamedSector{@NamedTuple{charge::U1Irrep, spin::SU2Irrep}}

julia> (@NamedSector{charge::U1Irrep, spin::SU2Irrep})(U1Irrep(1), SU2Irrep(1//2))
(charge=1, spin=1/2)
NamedSector(; charge=Irrep[U₁](1), spin=Irrep[SU₂](1/2))
```
"""
macro NamedSector(ex)
Expand Down
Loading