Skip to content

Commit 991a032

Browse files
committed
small blocktype piracy
1 parent a1eef35 commit 991a032

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/tensors/abstractblocktensor/abstracttensormap.jl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ end
5050
return setindex!(t, v′, f₁, f₂)
5151
end
5252

53-
function TensorKit.block(t::AbstractBlockTensorMap, c::Sector)::TK.blocktype(t)
53+
function TensorKit.block(t::AbstractBlockTensorMap, c::Sector)
5454
sectortype(t) == typeof(c) || throw(SectorMismatch())
5555

5656
rows = prod(TT.getindices(size(t), codomainind(t)))
@@ -95,6 +95,14 @@ Base.@assume_effects :foldable function TensorKit.blocktype(::Type{TT}) where {T
9595
return BlockMatrix{T, Matrix{B}, BS}
9696
end
9797

98+
# piracy:
99+
function TK.blocktype(
100+
::Type{Union{TM, TB}}
101+
) where {T, S, TM <: TensorMap{T, S}, TB <: BraidingTensor{T, S}}
102+
return Union{TK.blocktype(TM), TK.blocktype(TB)}
103+
end
104+
105+
98106
function Base.iterate(iter::TK.BlockIterator{<:AbstractBlockTensorMap}, state...)
99107
next = iterate(iter.structure, state...)
100108
isnothing(next) && return next

0 commit comments

Comments
 (0)