From f2fe462a65d7736ff5863be642e84ffc26867806 Mon Sep 17 00:00:00 2001 From: Lukas Devos Date: Tue, 3 Dec 2024 07:38:21 -0500 Subject: [PATCH] reinstate converter --- src/tensors/blocktensor.jl | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/tensors/blocktensor.jl b/src/tensors/blocktensor.jl index b369847..6886721 100644 --- a/src/tensors/blocktensor.jl +++ b/src/tensors/blocktensor.jl @@ -195,6 +195,17 @@ function Base.promote_rule( return BlockTensorMap{TT} end +function Base.convert(::Type{BlockTensorMap}, t::AbstractTensorMap) + S = spacetype(t) + data = fill(t, ntuple(Returns(1), numind(t))) + tdst = BlockTensorMap( + data, + convert(ProductSumSpace{S,numout(t)}, codomain(t)), + convert(ProductSumSpace{S,numin(t)}, domain(t)), + ) + return tdst +end + # Utility # ------- Base.haskey(t::BlockTensorMap, I::CartesianIndex) = checkbounds(Bool, t.data, I)