forked from oscar-system/Oscar.jl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathabelian_aut.jl
136 lines (117 loc) · 5.55 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
@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]])
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 = Zlattice(gram=3*ZZ[2 1; 1 2])
D = discriminant_group(L)
G = orthogonal_group(D)
d = gens(D)[1]
f = gens(G)[1]
f(d)
@test G(matrix(f)) == f
@test hom(f)(d) == f(d)
@test G(hom(f)) == f
L = Zlattice(gram=3*ZZ[2 1 0; 1 2 0; 0 0 1])
@test order(orthogonal_group(discriminant_group(L))) == 72
L = Zlattice(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 = orthogonal_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
end
@testset "Orthogonal groups of non-semiregular torquadmod" begin
L = Zlattice(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 = TorQuadMod(matrix(QQ, 1, 1, [1//27]))
Tsub, _ = sub(T, 3*gens(T))
@test order(orthogonal_group(Tsub)) == 6
T2 = TorQuadMod(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 = Zlattice(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))
end