-
Notifications
You must be signed in to change notification settings - Fork 112
/
abelian_aut.jl
165 lines (142 loc) · 6.46 KB
/
abelian_aut.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
@testset "conversion" begin
A = abelian_group([n for n in 1:6])
Agap,to_gap,to_oscar = Oscar._isomorphic_gap_group(A)
@test all(to_oscar(to_gap(a))==a for a in A)
@test all(to_gap(to_oscar(a))==a for a in Agap)
@test all(to_oscar(a*b)==to_oscar(a)+to_oscar(b) for a in gens(Agap) for b in gens(Agap))
@test all(to_gap(a+b)==to_gap(a)*to_gap(b) for a in gens(A) for b in gens(A))
Agap,to_gap,to_oscar = Oscar._isomorphic_gap_group(A;T=FPGroup)
@test all(to_oscar(to_gap(a))==a for a in A)
@test all(to_gap(to_oscar(a))==a for a in Agap)
@test all(to_oscar(a*b)==to_oscar(a)+to_oscar(b) for a in gens(Agap) for b in gens(Agap))
@test all(to_gap(a+b)==to_gap(a)*to_gap(b) for a in gens(A) for b in gens(A))
Agap,to_gap,to_oscar = Oscar._isomorphic_gap_group(A;T=PermGroup)
@test all(to_oscar(to_gap(a))==a for a in A)
@test all(to_gap(to_oscar(a))==a for a in Agap)
@test all(to_oscar(a*b)==to_oscar(a)+to_oscar(b) for a in gens(Agap) for b in gens(Agap))
@test all(to_gap(a+b)==to_gap(a)*to_gap(b) for a in gens(A) for b in gens(A))
autA = automorphism_group(A)
@test A[1]^(autA[2]*autA[3]) == (A[1]^autA[2])^autA[3]
@test all(autA(hom(f)) == f for f in gens(autA))
@test all(autA(matrix(f)) == f for f in gens(autA))
@test all(defines_automorphism(domain(autA),matrix(f)) for f in gens(autA))
A,_ = sub(A,[A[1],A[3],A[3]+A[2],A[2]-A[3]], false)
Agap,to_gap,to_oscar = Oscar._isomorphic_gap_group(A)
@test all(to_oscar(to_gap(a))==a for a in A)
@test all(to_gap(to_oscar(a))==a for a in Agap)
@test all(to_oscar(a*b)==to_oscar(a)+to_oscar(b) for a in gens(Agap) for b in gens(Agap))
@test all(to_gap(a+b)==to_gap(a)*to_gap(b) for a in gens(A) for b in gens(A))
Agap,to_gap,to_oscar = Oscar._isomorphic_gap_group(A;T=FPGroup)
@test all(to_oscar(to_gap(a))==a for a in A)
@test all(to_gap(to_oscar(a))==a for a in Agap)
@test all(to_oscar(a*b)==to_oscar(a)+to_oscar(b) for a in gens(Agap) for b in gens(Agap))
@test all(to_gap(a+b)==to_gap(a)*to_gap(b) for a in gens(A) for b in gens(A))
Agap,to_gap,to_oscar = Oscar._isomorphic_gap_group(A;T=PermGroup)
@test all(to_oscar(to_gap(a))==a for a in A)
@test all(to_gap(to_oscar(a))==a for a in Agap)
@test all(to_oscar(a*b)==to_oscar(a)+to_oscar(b) for a in gens(Agap) for b in gens(Agap))
@test all(to_gap(a+b)==to_gap(a)*to_gap(b) for a in gens(A) for b in gens(A))
autA = automorphism_group(A)
@test autA[1](A[1]) == Oscar.apply_automorphism(autA[1],A[1]) == A[1]^autA[1]
@test all(autA(hom(f)) == f for f in gens(autA))
@test all(autA(matrix(f)) == f for f in gens(autA))
@test all(defines_automorphism(domain(autA),matrix(f)) for f in gens(autA))
end
@testset "Orthogonal groups of torsion quadratic modules" begin
L = integer_lattice(gram=3*ZZ[2 1; 1 2])
D = discriminant_group(L)
G = orthogonal_group(D)
d = D[1]
f = gen(G, 1)
f(d)
@test G(matrix(f)) == f
@test hom(f)(d) == f(d)
@test G(hom(f)) == f
L = integer_lattice(gram=3*ZZ[2 1 0; 1 2 0; 0 0 1])
@test order(orthogonal_group(discriminant_group(L))) == 72
L = integer_lattice(gram=ZZ[0 1; 1 2])
# the trivial group
D = discriminant_group(L)
G = orthogonal_group(D)
g = one(G)
@test @inferred g ==G(matrix(g))
L = root_lattice(:A, 2)
q = discriminant_group(L)
T = direct_sum(q, q)[1]
OT = orthogonal_group(T)
f = matrix(ZZ, 2, 2, [1 1;0 1])
fT = hom(T, T, f) # this works, we see it as a map of abelian group
@test_throws ErrorException OT(fT) # this should not because fT does not preserve the bilinear form
T = discriminant_group(root_lattice(:D, 13))
Tsub, _ = sub(T, 4*gens(T))
@test order(orthogonal_group(Tsub)) == 1
L = integer_lattice(gram=ZZ[1 0 0; 0 0 2; 0 2 0])
@test order(orthogonal_group(discriminant_group(L)))==6
# a test for odd lattices
end
@testset "Orthogonal groups of non-semiregular torquadmod" begin
L = integer_lattice(gram=matrix(ZZ, [[2, -1, 0, 0, 0, 0],[-1, 2, -1, -1, 0, 0],[0, -1, 2, 0, 0, 0],[0, -1, 0, 2, 0, 0],[0, 0, 0, 0, 6, 3],[0, 0, 0, 0, 3, 6]]))
T = discriminant_group(L)
Tsub, _ = sub(T, [2*T[1], 3*T[2]])
TT = direct_sum(Tsub, Tsub)[1]
r3 = radical_quadratic(primary_part(TT, 3)[1])[1]
TT2 = primary_part(TT, 2)[1]
@test order(orthogonal_group(Tsub)) == 12
@test order(orthogonal_group(TT)) == 62208
@test orthogonal_group(TT) === orthogonal_group(TT)
@test order(orthogonal_group(TT2)) == 2
@test order(orthogonal_group(r3)) == 48 # this is the order of GL_2(3)
T = TorQuadModule(matrix(QQ, 1, 1, [1//27]))
Tsub, _ = sub(T, 3*gens(T))
@test order(orthogonal_group(Tsub)) == 6
T2 = TorQuadModule(matrix(QQ, 1, 1, [21//25]))
Tsub2, _ = sub(T2, 5*gens(T2))
@test order(orthogonal_group(Tsub2)) == 4
TT = direct_sum(Tsub, Tsub2)[1]
@test order(orthogonal_group(TT)) == 24
L = direct_sum(L, root_lattice(:A, 6))[1]
T = discriminant_group(L)
Tsub, _ = sub(T, [3*T[1], 3*T[2]])
@assert !is_semi_regular(Tsub)
@test order(orthogonal_group(Tsub)) == 24 # expected because for A_6, we have order 2
# and the discriminant group is 7-elementary
end
@testset "Embedding of orthogonal groups" begin
L = integer_lattice(gram=matrix(ZZ, 6, 6, [ 2 -1 0 0 0 0;
-1 2 -1 -1 0 0;
0 -1 2 0 0 0;
0 -1 0 2 0 0;
0 0 0 0 6 3;
0 0 0 0 3 6]))
T = discriminant_group(L)
i = id_hom(T)
f = @inferred embedding_orthogonal_group(i)
@test is_bijective(f)
_, i = primary_part(T, 3)
f = @inferred embedding_orthogonal_group(i)
@test is_injective(f) && !is_surjective(f)
@test order(domain(f)) == 12
@test all(g -> order(f(g)) == order(g), domain(f))
U2 = hyperbolic_plane_lattice(2)
q = discriminant_group(U2)
qq, qqinq = sub(q, [q[1] + q[2]])
@test_throws ArgumentError embedding_orthogonal_group(qqinq)
end
@testset "Action on injections" begin
L = root_lattice(:A, 11)
T = discriminant_group(L)
T2, T2inT = primary_part(T, 2)
_, j = has_complement(T2inT)
OT = orthogonal_group(T)
@test is_invariant(OT, T2inT)
G, res = @inferred restrict_automorphism_group(OT, T2inT)
H, _ = kernel(res)
@test is_invariant(H, j)
I, res2 = restrict_automorphism_group(H, j)
K, _ = kernel(res2)
@test order(K) == 1
T = discriminant_group(hyperbolic_plane_lattice(2))
OT = orthogonal_group(T)
_, i = sub(T, [T[1]])
@test_throws ArgumentError restrict_automorphism_group(OT, i)
end