@@ -92,24 +92,6 @@ for V in spacelist
9292 end
9393end
9494
95- @timedtestset " planartrace + CUDA with large traces: $I " for (I, V, Vr) in (
96- (FermionParity, Vect[FermionParity](0 => 40 , 1 => 40 ), Vect[FermionParity](0 => 2 , 1 => 3 )),
97- (FibonacciAnyon, Vect[FibonacciAnyon](:I => 30 , :τ => 30 ), Vect[FibonacciAnyon](:I => 2 , :τ => 1 )),
98- )
99- # (space, p, q) for a full reduction and for a trace with few remaining entries, which are
100- # both split into several chunks of traced entries
101- cases = (
102- (V ⊗ V ← V ⊗ V, ((), ()), ((1 , 2 ), (3 , 4 ))),
103- (Vr ⊗ V ⊗ V ← V ⊗ V, ((1 ,), ()), ((2 , 3 ), (4 , 5 ))),
104- )
105- for (W, p, q) in cases, (α, β) in ((0.7 , 0.3 ), (1.0 , 0.0 ))
106- A = randn (ComplexF64, W)
107- C = randn (ComplexF64, TensorKit. select (W, p))
108- Cgpu = planartrace! (adapt (CuArray, C), adapt (CuArray, A), p, q, α, β)
109- @test adapt (Vector{ComplexF64}, Cgpu) ≈ planartrace! (C, A, p, q, α, β)
110- end
111- end
112-
11395@testset " planar methods" verbose = true begin
11496 @testset " planaradd" begin
11597 A = CUDA. randn (ℂ^ 2 ⊗ ℂ^ 3 ← ℂ^ 6 ⊗ ℂ^ 5 ⊗ ℂ^ 4 )
134116 planartrace! (C′, A′, p, q, true , true )
135117 end
136118
119+ @testset " planartrace with large traces: $I " for (I, V, Vr) in (
120+ (FermionParity, Vect[FermionParity](0 => 40 , 1 => 40 ), Vect[FermionParity](0 => 2 , 1 => 3 )),
121+ (FibonacciAnyon, Vect[FibonacciAnyon](:I => 30 , :τ => 30 ), Vect[FibonacciAnyon](:I => 2 , :τ => 1 )),
122+ )
123+ # (space, p, q) for a full reduction and for a trace with few remaining entries, which are
124+ # both split into several chunks of traced entries
125+ cases = (
126+ (V ⊗ V ← V ⊗ V, ((), ()), ((1 , 2 ), (3 , 4 ))),
127+ (Vr ⊗ V ⊗ V ← V ⊗ V, ((1 ,), ()), ((2 , 3 ), (4 , 5 ))),
128+ )
129+ for (W, p, q) in cases, (α, β) in ((0.7 , 0.3 ), (1.0 , 0.0 ))
130+ A = randn (ComplexF64, W)
131+ C = randn (ComplexF64, TensorKit. select (W, p))
132+ Cgpu = planartrace! (adapt (CuArray, C), adapt (CuArray, A), p, q, α, β)
133+ @test adapt (Vector{ComplexF64}, Cgpu) ≈ planartrace! (C, A, p, q, α, β)
134+ end
135+ end
136+
137137 @testset " planarcontract" begin
138138 A = CUDA. randn (ℂ^ 2 ⊗ ℂ^ 3 ← ℂ^ 2 ⊗ ℂ^ 5 ⊗ ℂ^ 4 )
139139 B = CUDA. randn (ℂ^ 2 ⊗ ℂ^ 4 ← ℂ^ 4 ⊗ ℂ^ 3 )
0 commit comments