Skip to content

Commit e2dc00e

Browse files
committed
add tangent type test
1 parent 998b611 commit e2dc00e

1 file changed

Lines changed: 58 additions & 0 deletions

File tree

test/mooncake/tangent.jl

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
using Test, TestExtras
2+
using TensorKit
3+
using Mooncake
4+
using Random
5+
using JET, AllocCheck
6+
7+
@isdefined(TestSetup) || include("../setup.jl")
8+
using .TestSetup
9+
using .TestSetup: _repartition
10+
11+
mode = Mooncake.ReverseMode
12+
rng = Random.default_rng()
13+
14+
spacelist = (
15+
(ℂ^2, (ℂ^3)', ℂ^3, ℂ^2, (ℂ^2)'),
16+
(
17+
Vect[Z2Irrep](0 => 1, 1 => 1),
18+
Vect[Z2Irrep](0 => 1, 1 => 2)',
19+
Vect[Z2Irrep](0 => 2, 1 => 2)',
20+
Vect[Z2Irrep](0 => 2, 1 => 3),
21+
Vect[Z2Irrep](0 => 2, 1 => 2),
22+
),
23+
(
24+
Vect[FermionParity](0 => 1, 1 => 1),
25+
Vect[FermionParity](0 => 1, 1 => 2)',
26+
Vect[FermionParity](0 => 2, 1 => 1)',
27+
Vect[FermionParity](0 => 2, 1 => 3),
28+
Vect[FermionParity](0 => 2, 1 => 2),
29+
),
30+
(
31+
Vect[U1Irrep](0 => 2, 1 => 1, -1 => 1),
32+
Vect[U1Irrep](0 => 2, 1 => 1, -1 => 1),
33+
Vect[U1Irrep](0 => 2, 1 => 2, -1 => 1)',
34+
Vect[U1Irrep](0 => 1, 1 => 1, -1 => 2),
35+
Vect[U1Irrep](0 => 1, 1 => 2, -1 => 1)',
36+
),
37+
(
38+
Vect[SU2Irrep](0 => 2, 1 // 2 => 1),
39+
Vect[SU2Irrep](0 => 1, 1 => 1),
40+
Vect[SU2Irrep](1 // 2 => 1, 1 => 1)',
41+
Vect[SU2Irrep](1 // 2 => 2),
42+
Vect[SU2Irrep](0 => 1, 1 // 2 => 1, 3 // 2 => 1)',
43+
),
44+
(
45+
Vect[FibonacciAnyon](:I => 2, => 1),
46+
Vect[FibonacciAnyon](:I => 1, => 2)',
47+
Vect[FibonacciAnyon](:I => 2, => 2)',
48+
Vect[FibonacciAnyon](:I => 2, => 3),
49+
Vect[FibonacciAnyon](:I => 2, => 2),
50+
),
51+
)
52+
eltypes = (Float64, ComplexF64)
53+
54+
55+
@timedtestset "Mooncake - Tangent type: $(TensorKit.type_repr(sectortype(eltype(V)))) ($T)" for V in spacelist, T in eltypes
56+
A = randn(T, V[1] V[2] V[4] V[5])
57+
Mooncake.TestUtils.test_data(rng, A)
58+
end

0 commit comments

Comments
 (0)