Skip to content

Commit 4870e09

Browse files
committed
potential overkill fusion tree stuff
1 parent 04bac3d commit 4870e09

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/bimodulesector.jl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,3 +399,19 @@ function TensorKit.scalar(t::AbstractTensorMap{T,S,0,0}) where {T,
399399
isempty(inds) && return zero(scalartype(t))
400400
return only(last(Bs[only(inds)]))
401401
end
402+
403+
# is this even necessary? can let it error at TensorKit fusiontrees.jl:93 from the one(<:BimoduleSector) call
404+
# but these errors are maybe more informative
405+
function TensorKit.FusionTree(uncoupled::Tuple{<:I,Vararg{I}}) where {I<:BimoduleSector}
406+
coupled = collect((uncoupled...))
407+
if length(coupled) == 0 # illegal fusion somewhere
408+
throw(ArgumentError("Forbidden fusion with uncoupled sectors $uncoupled"))
409+
else # allowed fusions require inner lines
410+
error("fusion tree requires inner lines if `FusionStyle(I) <: MultipleFusion`")
411+
end
412+
end
413+
414+
# this one might also be overkill, since `FusionTreeIterator`s don't check whether the fusion is allowed
415+
function fusiontrees(uncoupled::Tuple{I,Vararg{I}}) where {I<:BimoduleSector}
416+
return throw(ArgumentError("coupled sector must be provided for $I fusion"))
417+
end

0 commit comments

Comments
 (0)