Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ MatrixAlgebraKit = "0.6"
Random = "1"
SafeTestsets = "0.1"
Strided = "2.3.3"
TensorKit = "0.16.1"
TensorKit = "0.16.4"
TensorOperations = "5"
Test = "1"
TestExtras = "0.2, 0.3"
Expand Down
9 changes: 7 additions & 2 deletions src/tensors/blocktensor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,13 @@ end
function BlockTensorMap(t::AbstractTensorMap, space::TensorMapSumSpace)
TT = tensormaptype(spacetype(t), numout(t), numin(t), storagetype(t))
tdst = BlockTensorMap{TT}(undef, space)
for (f₁, f₂) in fusiontrees(tdst)
copy!(tdst[f₁, f₂], t[f₁, f₂])
@inbounds for (f₁, f₂) in fusiontrees(t)
dst = tdst[f₁, f₂]
src = t[f₁, f₂]
for block_index in Iterators.product(blockaxes(dst)...)
indices = getindex.(axes(dst), block_index)
dst[block_index...] .= @view src[indices...]
end
end
return tdst
end
Expand Down
4 changes: 2 additions & 2 deletions test/vectorspaces/sumspace.jl
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,10 @@ end
@test issetequal(@constinferred(blocksectors(V ← V)), sectors(V))
@test @constinferred(blocksectors(one(V))) == [C0, D0]
for v in [VC, VCM, VMD]
@test @constinferred(blocksectors(v^2)) == blocksectors(v ← v)
@test issetequal(@constinferred(blocksectors(v^2)), blocksectors(v ← v))
end
for v in [WM, WMop]
@test isempty(@constinferred(blocksectors(v^2)))
@test @constinferred(blocksectors(v ← v)) == blocksectors(v)
@test issetequal(@constinferred(blocksectors(v ← v)), blocksectors(v))
end
end
Loading