Skip to content
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

Add unicode alternatives: otimes and oplus #109

Merged
merged 2 commits into from
Mar 30, 2024
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: 2 additions & 2 deletions src/TensorKit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ export TruncationScheme
export SpaceMismatch, SectorMismatch, IndexError # error types

# general vector space methods
export space, field, dual, dim, dims, fuse, flip, isdual, insertunit
export space, field, dual, dim, dims, fuse, flip, isdual, insertunit, oplus

# partial order for vector spaces
export infimum, supremum, isisomorphic, ismonomorphic, isepimorphic

# methods for sectors and properties thereof
export sectortype, sectors, hassector, Nsymbol, Fsymbol, Rsymbol, Bsymbol,
frobeniusschur, twist
frobeniusschur, twist, otimes
export fusiontrees, braid, permute, transpose
export ZNSpace, SU2Irrep, U1Irrep, CU1Irrep
# other fusion tree manipulations, should not be exported:
Expand Down
4 changes: 3 additions & 1 deletion src/sectors/sectors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ Base.isless(::Trivial, ::Trivial) = false
# FusionStyle: the most important aspect of Sector
#---------------------------------------------
"""
⊗(a::I, b::I) where {I<:Sector}
⊗(a::I, b::I...) where {I<:Sector}
otimes(a::I, b::I...) where {I<:Sector}

Return an iterable of elements of `c::I` that appear in the fusion product `a ⊗ b`.

Expand All @@ -128,6 +129,7 @@ Note that every element `c` should appear at most once, fusion degeneracies (if
"""
⊗(::Trivial, ::Trivial) = (Trivial(),)
⊗(I::Sector) = (I,)
const otimes = ⊗

"""
Nsymbol(a::I, b::I, c::I) where {I<:Sector} -> Integer
Expand Down
2 changes: 2 additions & 0 deletions src/spaces/vectorspaces.jl
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ Base.oneunit(V::ElementarySpace) = oneunit(typeof(V))

"""
⊕(V₁::S, V₂::S, V₃::S...) where {S<:ElementarySpace} -> S
oplus(V₁::S, V₂::S, V₃::S...) where {S<:ElementarySpace} -> S

Return the corresponding vector space of type `S` that represents the direct sum sum of the
spaces `V₁`, `V₂`, ... Note that all the individual spaces should have the same value for
Expand All @@ -131,6 +132,7 @@ spaces `V₁`, `V₂`, ... Note that all the individual spaces should have the s
function ⊕ end
⊕(V₁::VectorSpace, V₂::VectorSpace) = ⊕(promote(V₁, V₂)...)
⊕(V::Vararg{VectorSpace}) = foldl(⊕, V)
const oplus = ⊕

"""
⊗(V₁::S, V₂::S, V₃::S...) where {S<:ElementarySpace} -> S
Expand Down
1 change: 1 addition & 0 deletions src/tensors/linalg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ end
# tensor product of tensors
"""
⊗(t1::AbstractTensorMap{S}, t2::AbstractTensorMap{S}, ...) -> TensorMap{S}
otimes(t1::AbstractTensorMap{S}, t2::AbstractTensorMap{S}, ...) -> TensorMap{S}

Compute the tensor product between two `AbstractTensorMap` instances, which results in a
new `TensorMap` instance whose codomain is `codomain(t1) ⊗ codomain(t2)` and whose domain
Expand Down
Loading