Skip to content

Commit 32e2092

Browse files
committed
Incremental progress on getting rid of allowscalar
1 parent b82f333 commit 32e2092

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

Project.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,6 @@ TestExtras = "5ed8adda-3752-4e41-b88a-e8b09835ee3a"
5353

5454
[targets]
5555
test = ["Test", "TestExtras", "Random", "Combinatorics", "SafeTestsets", "Aqua", "Adapt", "JLArrays"]
56+
57+
[sources]
58+
Strided = {url = "https://github.com/QuantumKitHub/Strided.jl", rev = "ksh/jlarrays"}

test/abstracttensor/blocktensor.jl

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ using BlockTensorKit
55
using Random
66
using Combinatorics
77
using Adapt
8-
using JLArrays
8+
using Strided, JLArrays
99

1010
Vtr = (
1111
SumSpace(ℂ^3),
@@ -86,12 +86,10 @@ end
8686
# test conversion to TensorMap that isn't backed by a Vector
8787
jl_bt1 = rand(JLVector{T}, W)
8888
TT = TensorKit.TensorMap{T, spacetype(t1′), numout(t1′), numin(t1′), JLVector{T}}
89-
# The @allowscalar here can be removed once QuantumKitHub/Strided.jl#44 and
90-
# QuantumKitHub/StridedViews.jl#31 are merged and new versions are tagged
91-
JLArrays.@allowscalar begin # to avoid scalar indexing error in Strided
92-
jl_bt1′ = @constinferred convert(TT, jl_bt1)
89+
jl_bt1′ = @constinferred convert(TT, jl_bt1)
90+
JLArrays.@allowscalar begin
9391
jl_bt1″ = @inferred BlockTensorMap(jl_bt1′, W)
94-
end
92+
end # still need some logic for copying to a BlockArray of StridedViews
9593
@test jl_bt1 jl_bt1″
9694
end
9795
end

0 commit comments

Comments
 (0)