diff --git a/src/TensorKit.jl b/src/TensorKit.jl index 8dee9e32..e662f9c2 100644 --- a/src/TensorKit.jl +++ b/src/TensorKit.jl @@ -30,7 +30,7 @@ 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 diff --git a/src/spaces/vectorspaces.jl b/src/spaces/vectorspaces.jl index d8e764f0..0c7320cf 100644 --- a/src/spaces/vectorspaces.jl +++ b/src/spaces/vectorspaces.jl @@ -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 @@ -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