From f7a344777b964be6dea74e71a8816a8c38083687 Mon Sep 17 00:00:00 2001 From: lkdvos Date: Wed, 27 Mar 2024 11:39:22 +0100 Subject: [PATCH 1/2] =?UTF-8?q?Add=20otimes=20as=20alternative=20for=20?= =?UTF-8?q?=E2=8A=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/TensorKit.jl | 2 +- src/sectors/sectors.jl | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/TensorKit.jl b/src/TensorKit.jl index 281b5509..8dee9e32 100644 --- a/src/TensorKit.jl +++ b/src/TensorKit.jl @@ -37,7 +37,7 @@ 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: diff --git a/src/sectors/sectors.jl b/src/sectors/sectors.jl index 132e728f..bfb83312 100644 --- a/src/sectors/sectors.jl +++ b/src/sectors/sectors.jl @@ -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`. @@ -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 From f367a3e0c1bd165c35d94a42e6f1a0d2a16b53ab Mon Sep 17 00:00:00 2001 From: lkdvos Date: Sat, 30 Mar 2024 19:33:08 +0100 Subject: [PATCH 2/2] =?UTF-8?q?Add=20oplus=20as=20alternative=20for=20?= =?UTF-8?q?=E2=8A=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/TensorKit.jl | 2 +- src/spaces/vectorspaces.jl | 2 ++ src/tensors/linalg.jl | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) 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 0124868d..b2b7a454 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 diff --git a/src/tensors/linalg.jl b/src/tensors/linalg.jl index 08b64454..4678b780 100644 --- a/src/tensors/linalg.jl +++ b/src/tensors/linalg.jl @@ -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