Skip to content

Commit e85b79d

Browse files
committed
Move over storagetype logic from TensorKit
1 parent 1519a22 commit e85b79d

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/tensors/abstractblocktensor/abstracttensormap.jl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,11 @@ function Base.iterate(iter::TK.BlockIterator{<:AbstractBlockTensorMap}, state...
106106
end
107107
Base.getindex(iter::TK.BlockIterator{<:AbstractBlockTensorMap}, c::Sector) = block(iter.t, c)
108108

109-
TensorKit.storagetype(::Type{TT}) where {TT <: AbstractBlockTensorMap} = storagetype(eltype(TT))
109+
function TensorKit.storagetype(::Type{TT}) where {TT <: AbstractBlockTensorMap}
110+
if eltype(TT) isa Union
111+
TU = eltype(TT)
112+
return promote_storagetype(TU.a, TU.b)
113+
else
114+
return storagetype(eltype(TT))
115+
end
116+
end

0 commit comments

Comments
 (0)