Skip to content

Commit 0bd8ffa

Browse files
authored
TensorKit v0.16.4 changes (#50)
* add TensorKit sources * fix sumspace errors * fix scalar indexing
1 parent f1df152 commit 0bd8ffa

3 files changed

Lines changed: 10 additions & 5 deletions

File tree

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ MatrixAlgebraKit = "0.6"
3636
Random = "1"
3737
SafeTestsets = "0.1"
3838
Strided = "2.3.3"
39-
TensorKit = "0.16.1"
39+
TensorKit = "0.16.4"
4040
TensorOperations = "5"
4141
Test = "1"
4242
TestExtras = "0.2, 0.3"

src/tensors/blocktensor.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,13 @@ end
113113
function BlockTensorMap(t::AbstractTensorMap, space::TensorMapSumSpace)
114114
TT = tensormaptype(spacetype(t), numout(t), numin(t), storagetype(t))
115115
tdst = BlockTensorMap{TT}(undef, space)
116-
for (f₁, f₂) in fusiontrees(tdst)
117-
copy!(tdst[f₁, f₂], t[f₁, f₂])
116+
@inbounds for (f₁, f₂) in fusiontrees(t)
117+
dst = tdst[f₁, f₂]
118+
src = t[f₁, f₂]
119+
for block_index in Iterators.product(blockaxes(dst)...)
120+
indices = getindex.(axes(dst), block_index)
121+
dst[block_index...] .= @view src[indices...]
122+
end
118123
end
119124
return tdst
120125
end

test/vectorspaces/sumspace.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,10 @@ end
249249
@test issetequal(@constinferred(blocksectors(V V)), sectors(V))
250250
@test @constinferred(blocksectors(one(V))) == [C0, D0]
251251
for v in [VC, VCM, VMD]
252-
@test @constinferred(blocksectors(v^2)) == blocksectors(v v)
252+
@test issetequal(@constinferred(blocksectors(v^2)), blocksectors(v v))
253253
end
254254
for v in [WM, WMop]
255255
@test isempty(@constinferred(blocksectors(v^2)))
256-
@test @constinferred(blocksectors(v v)) == blocksectors(v)
256+
@test issetequal(@constinferred(blocksectors(v v)), blocksectors(v))
257257
end
258258
end

0 commit comments

Comments
 (0)