Skip to content

Commit 48ad509

Browse files
committed
handle missing fusiontree case
1 parent 2e9c200 commit 48ad509

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎src/tensors/abstractblocktensor/conversion.jl‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ function Base.convert(::Type{TensorMap}, t::AbstractBlockTensorMap)
2020

2121
for (k, v) in nonzero_pairs(t)
2222
indices = getindex.(blockax, Block.(Tuple(k)))
23-
copy!(arr[indices...], v[f₁, f₂])
23+
arr_slice = arr[indices...]
24+
# need to check for empty since fusion tree pair might not be present
25+
isempty(arr_slice) || copy!(arr_slice, v[f₁, f₂])
2426
end
2527
end
2628

0 commit comments

Comments
 (0)