@@ -148,22 +148,32 @@ project_hermitian(A) = (A + A') / 2
148148
149149ChainRulesTestUtils. test_method_tables ()
150150
151- spacelist = try
152- if ENV [" CI" ] == " true"
153- println (" Detected running on CI" )
154- if Sys. iswindows ()
155- (Vtr, Vℤ₃, VU₁, VfU₁, VCU₁, VSU₂)
156- elseif Sys. isapple ()
157- (Vtr, Vℤ₃, VfU₁, VfSU₂)
158- else
159- (Vtr, VU₁, VCU₁, VfSU₂, Vfib)
160- end
161- else
162- (Vtr, Vℤ₃, VU₁, VfU₁, VSU₂, VfSU₂, Vfib)
163- end
164- catch
165- (Vtr, Vℤ₃, VU₁, VfU₁, VCU₁, VSU₂, VfSU₂, Vfib)
166- end
151+ spacelist = ((ℂ^ 2 , (ℂ^ 3 )' , ℂ^ 3 , ℂ^ 2 , (ℂ^ 2 )' ),
152+ (Vect[Z2Irrep](0 => 1 , 1 => 1 ),
153+ Vect[Z2Irrep](0 => 1 , 1 => 2 )' ,
154+ Vect[Z2Irrep](0 => 3 , 1 => 2 )' ,
155+ Vect[Z2Irrep](0 => 2 , 1 => 3 ),
156+ Vect[Z2Irrep](0 => 2 , 1 => 2 )),
157+ (Vect[FermionParity](0 => 1 , 1 => 1 ),
158+ Vect[FermionParity](0 => 1 , 1 => 2 )' ,
159+ Vect[FermionParity](0 => 2 , 1 => 2 )' ,
160+ Vect[FermionParity](0 => 2 , 1 => 3 ),
161+ Vect[FermionParity](0 => 2 , 1 => 2 )),
162+ (Vect[U1Irrep](0 => 2 , 1 => 1 , - 1 => 1 ),
163+ Vect[U1Irrep](0 => 3 , 1 => 1 , - 1 => 1 ),
164+ Vect[U1Irrep](0 => 2 , 1 => 2 , - 1 => 1 )' ,
165+ Vect[U1Irrep](0 => 1 , 1 => 1 , - 1 => 2 ),
166+ Vect[U1Irrep](0 => 1 , 1 => 2 , - 1 => 1 )' ),
167+ (Vect[SU2Irrep](0 => 2 , 1 // 2 => 1 ),
168+ Vect[SU2Irrep](0 => 1 , 1 => 1 ),
169+ Vect[SU2Irrep](1 // 2 => 1 , 1 => 1 )' ,
170+ Vect[SU2Irrep](1 // 2 => 2 ),
171+ Vect[SU2Irrep](0 => 1 , 1 // 2 => 1 , 3 // 2 => 1 )' ),
172+ (Vect[FibonacciAnyon](:I => 1 , :τ => 1 ),
173+ Vect[FibonacciAnyon](:I => 1 , :τ => 2 )' ,
174+ Vect[FibonacciAnyon](:I => 3 , :τ => 2 )' ,
175+ Vect[FibonacciAnyon](:I => 2 , :τ => 3 ),
176+ Vect[FibonacciAnyon](:I => 2 , :τ => 2 )))
167177
168178for V in spacelist
169179 I = sectortype (eltype (V))
@@ -308,8 +318,8 @@ for V in spacelist
308318
309319 @timedtestset " tensortrace!" begin
310320 for _ in 1 : 5
311- k1 = rand (0 : 3 )
312- k2 = k1 == 3 ? 1 : rand (1 : 2 )
321+ k1 = rand (0 : 2 )
322+ k2 = rand (1 : 2 )
313323 V1 = map (v -> rand (Bool) ? v' : v, rand (V, k1))
314324 V2 = map (v -> rand (Bool) ? v' : v, rand (V, k2))
315325
@@ -331,13 +341,13 @@ for V in spacelist
331341 end
332342
333343 @timedtestset " tensoradd!" begin
334- A = randn (T, V[1 ] ⊗ V[2 ] ⊗ V[ 3 ] ← V[4 ] ⊗ V[5 ])
344+ A = randn (T, V[1 ] ⊗ V[2 ] ← V[4 ] ⊗ V[5 ])
335345 α = randn (T)
336346 β = randn (T)
337347
338348 # repeat a couple times to get some distribution of arrows
339349 for _ in 1 : 5
340- p = randindextuple (length (V ))
350+ p = randindextuple (numind (A ))
341351
342352 C1 = randn! (TensorOperations. tensoralloc_add (T, A, p, false ,
343353 Val (false )))
@@ -399,19 +409,20 @@ for V in spacelist
399409 end
400410
401411 @timedtestset " Factorizations" begin
412+ W = V[1 ] ⊗ V[2 ]
402413 @testset " QR" begin
403414 for T in eltypes,
404415 t in (randn (T, W, W), randn (T, W, W)' ,
405- randn (T, W, V1 ), randn (T, V1 , W),
406- randn (T, W, V1 )' , randn (T, V1 , W)' ,
407- DiagonalTensorMap (randn (T, reduceddim (V1 )), V1 ))
416+ randn (T, W, V[ 1 ] ), randn (T, V[ 1 ] , W),
417+ randn (T, W, V[ 1 ] )' , randn (T, V[ 1 ] , W)' ,
418+ DiagonalTensorMap (randn (T, reduceddim (V[ 1 ] )), V[ 1 ] ))
408419
409420 atol = rtol = precision (T) * dim (space (t))
410421 fkwargs = (; positive= true ) # make FiniteDifferences happy
411422
412423 test_ad_rrule (qr_compact, t; fkwargs, atol, rtol)
413- test_ad_rrule (first ∘ qr_compact, t; fkwargs, atol, rtol, )
414- test_ad_rrule (last ∘ qr_compact, t; fkwargs, atol, rtol, )
424+ test_ad_rrule (first ∘ qr_compact, t; fkwargs, atol, rtol)
425+ test_ad_rrule (last ∘ qr_compact, t; fkwargs, atol, rtol)
415426
416427 # qr_full/qr_null requires being careful with gauges
417428 Q, R = qr_full (t)
@@ -445,9 +456,9 @@ for V in spacelist
445456 @testset " LQ" begin
446457 for T in eltypes,
447458 t in (randn (T, W, W), randn (T, W, W)' ,
448- randn (T, W, V1 ), randn (T, V1 , W),
449- randn (T, W, V1 )' , randn (T, V1 , W)' ,
450- DiagonalTensorMap (randn (T, reduceddim (V1 )), V1 ))
459+ randn (T, W, V[ 1 ] ), randn (T, V[ 1 ] , W),
460+ randn (T, W, V[ 1 ] )' , randn (T, V[ 1 ] , W)' ,
461+ DiagonalTensorMap (randn (T, reduceddim (V[ 1 ] )), V[ 1 ] ))
451462
452463 atol = rtol = precision (T) * dim (space (t))
453464 fkwargs = (; positive= true ) # make FiniteDifferences happy
@@ -489,8 +500,8 @@ for V in spacelist
489500
490501 @testset " Eigenvalue decomposition" begin
491502 for T in eltypes,
492- t in (rand (T, V1, V1 ), rand (T, W, W), rand (T, W, W)' ,
493- DiagonalTensorMap (rand (T, reduceddim (V1 )), V1 ))
503+ t in (rand (T, V[ 1 ], V[ 1 ] ), rand (T, W, W), rand (T, W, W)' ,
504+ DiagonalTensorMap (rand (T, reduceddim (V[ 1 ] )), V[ 1 ] ))
494505
495506 atol = rtol = precision (T) * dim (space (t))
496507
@@ -524,7 +535,7 @@ for V in spacelist
524535
525536 @testset " Singular value decomposition" begin
526537 for T in eltypes,
527- t in (randn (T, V1, V1 ), randn (T, W, W), randn (T, W, W))
538+ t in (randn (T, V[ 1 ], V[ 1 ] ), randn (T, W, W), randn (T, W, W))
528539 # TODO : fix diagonaltensormap case
529540 # DiagonalTensorMap(rand(T, reduceddim(V1)), V1))
530541
0 commit comments