@@ -6,21 +6,27 @@ using Random
66spacelist = ad_spacelist (fast_tests)
77eltypes = (Float64, ComplexF64)
88
9- if VERSION > v " 1.11.0-rc" # https://github.com/QuantumKitHub/TensorKit.jl/issues/457
10- @timedtestset verbose = true " Enzyme - Index Manipulations (insertunit):" begin
11- @timedtestset verbose = true " $(TensorKit. type_repr (sectortype (eltype (V)))) ($T )" for V in spacelist, T in eltypes, TA in (Duplicated,)
12- atol = default_tol (T)
13- rtol = default_tol (T)
14- A = randn (T, V[1 ] ⊗ V[2 ] ← (V[3 ] ⊗ V[4 ] ⊗ V[5 ])' )
15- @testset for insertunit in (insertleftunit, insertrightunit)
16- EnzymeTestUtils. test_reverse (insertunit, TA, (A, TA), (Val (1 ), Const); atol, rtol)
17- EnzymeTestUtils. test_reverse (insertunit, TA, (A, TA), (Val (4 ), Const); atol, rtol)
18- EnzymeTestUtils. test_reverse (insertunit, TA, (A' , TA), (Val (2 ), Const); atol, rtol)
19- EnzymeTestUtils. test_reverse (insertunit, TA, (A, TA), (Val (1 ), Const); atol, rtol, fkwargs = (copy = false ,))
20- EnzymeTestUtils. test_reverse (insertunit, TA, (A, TA), (Val (2 ), Const); atol, rtol, fkwargs = (copy = true ,))
21- EnzymeTestUtils. test_reverse (insertunit, TA, (A, TA), (Val (3 ), Const); atol, rtol, fkwargs = (copy = false , dual = true , conj = true ))
22- EnzymeTestUtils. test_reverse (insertunit, TA, (A' , TA), (Val (3 ), Const); atol, rtol, fkwargs = (copy = false , dual = true , conj = true ))
23- end
9+ @timedtestset verbose = true " Enzyme - Index Manipulations (insertunit):" begin
10+ @timedtestset verbose = true " $(TensorKit. type_repr (sectortype (eltype (V)))) ($T )" for V in spacelist, T in eltypes, TA in (Duplicated,)
11+ atol = default_tol (T)
12+ rtol = default_tol (T)
13+ A = randn (T, V[1 ] ⊗ V[2 ] ← (V[3 ] ⊗ V[4 ] ⊗ V[5 ])' )
14+ @testset for insertunit in (insertleftunit, insertrightunit)
15+ EnzymeTestUtils. test_reverse (insertunit, TA, (A, TA), (Val (1 ), Const); atol, rtol)
16+ EnzymeTestUtils. test_reverse (insertunit, TA, (A, TA), (Val (4 ), Const); atol, rtol)
17+ EnzymeTestUtils. test_reverse (insertunit, TA, (A' , TA), (Val (2 ), Const); atol, rtol)
18+ EnzymeTestUtils. test_reverse (insertunit, TA, (A, TA), (Val (1 ), Const); atol, rtol, fkwargs = (copy = false ,))
19+ EnzymeTestUtils. test_reverse (insertunit, TA, (A, TA), (Val (2 ), Const); atol, rtol, fkwargs = (copy = true ,))
20+ EnzymeTestUtils. test_reverse (insertunit, TA, (A, TA), (Val (3 ), Const); atol, rtol, fkwargs = (copy = false , dual = true , conj = true ))
21+ EnzymeTestUtils. test_reverse (insertunit, TA, (A' , TA), (Val (3 ), Const); atol, rtol, fkwargs = (copy = false , dual = true , conj = true ))
22+
23+ EnzymeTestUtils. test_forward (insertunit, TA, (A, TA), (Val (1 ), Const); atol, rtol)
24+ EnzymeTestUtils. test_forward (insertunit, TA, (A, TA), (Val (4 ), Const); atol, rtol)
25+ EnzymeTestUtils. test_forward (insertunit, TA, (A' , TA), (Val (2 ), Const); atol, rtol)
26+ EnzymeTestUtils. test_forward (insertunit, TA, (A, TA), (Val (1 ), Const); atol, rtol, fkwargs = (copy = false ,))
27+ EnzymeTestUtils. test_forward (insertunit, TA, (A, TA), (Val (2 ), Const); atol, rtol, fkwargs = (copy = true ,))
28+ EnzymeTestUtils. test_forward (insertunit, TA, (A, TA), (Val (3 ), Const); atol, rtol, fkwargs = (copy = false , dual = true , conj = true ))
29+ EnzymeTestUtils. test_forward (insertunit, TA, (A' , TA), (Val (3 ), Const); atol, rtol, fkwargs = (copy = false , dual = true , conj = true ))
2430 end
2531 end
2632end
0 commit comments