CoCalc Public Fileswww / tables / magma_src / ModFrm / tests.mOpen with one click!
Author: William A. Stein
1
freeze;
2
3
/****-*-magma-* EXPORT DATE: 2004-03-08 ************************************
4
5
MODFORM: Modular Forms in MAGMA
6
7
William A. Stein
8
9
FILE: tests.m
10
11
$Header: /home/was/magma/packages/modform/code/RCS/tests.m,v 1.4 2002/04/13 07:27:10 was Exp $
12
13
$Log: tests.m,v $
14
Revision 1.4 2002/04/13 07:27:10 was
15
*** empty log message ***
16
17
Revision 1.3 2001/05/30 18:57:44 was
18
Created.
19
20
Revision 1.2 2001/05/16 04:00:52 was
21
initial code entry.
22
23
24
***************************************************************************/
25
26
27
forward RandomBasisG1,
28
NewformsG1,
29
NewSubspaceG1,
30
TestModpG1,
31
TestpAdicG1,
32
TestComplexG1,
33
TestCharpoly;
34
35
NS := NewSubspace;
36
CS := CuspidalSubspace;
37
ES := EisensteinSubspace;
38
39
40
intrinsic BugHunter(tests::[RngIntElt], rep::RngIntElt, how_hard::FldPrElt)
41
{}
42
if #tests eq 0 then
43
tests := [1..100];
44
end if;
45
for n in [1..rep] do
46
if 1 in tests then
47
"BG -- RandomBasisG1 -- ", n;
48
RandomBasisG1(how_hard);
49
end if;
50
if 2 in tests then
51
"BG -- NewformsG1 -- ", n;
52
NewformsG1(how_hard);
53
end if;
54
if 3 in tests then
55
"BG -- NewSubspaceG1 -- ", n;
56
NewSubspaceG1(how_hard);
57
end if;
58
if 4 in tests then
59
"BG -- TestModpG1 -- ", n;
60
TestModpG1(how_hard);
61
end if;
62
if 5 in tests then
63
"BG -- TestpAdicG1 -- ", n;
64
TestpAdicG1(how_hard);
65
end if;
66
if 6 in tests then
67
"BG -- TestComplexG1 -- ", n;
68
TestComplexG1(how_hard);
69
end if;
70
if 7 in tests then
71
"BG -- charpoly test -- ", n;
72
TestCharpoly(how_hard);
73
end if;
74
end for;
75
end intrinsic
76
77
78
function G1(how_hard)
79
80
N := Random([1] cat [1..Round(how_hard*100)]);
81
k := Random([2] cat [2..Round(how_hard*20)+2]);
82
return ModularForms(Gamma1(N),k);
83
end function;
84
85
function RandomSpace(how_hard)
86
N := Random([1] cat [1..Round(how_hard*100)]);
87
k := Random([2] cat [2..Round(how_hard*20)+2]);
88
if Random([1..2]) eq 1 then
89
"Gamma0";
90
M := ModularForms(Gamma0(N),Max(k,2));
91
else
92
"Gamma1";
93
N := (N div 2)+1;
94
k := k div 2;
95
M := ModularForms(Gamma1(N),Max(k,2));
96
end if;
97
if Random([1..3]) ne 1 then
98
if Random([1..2]) eq 1 then
99
p := NextPrime(Random([1..10]));
100
else
101
p := NextPrime(Random([1..1000]));
102
end if;
103
else
104
p := 0;
105
end if;
106
printf "N=%o, k=%o, p=%o\n", N,k,p;
107
return M, p;
108
end function;
109
110
111
procedure RandomBasisG1(how_hard)
112
assert Type(how_hard) eq FldPrElt;
113
114
M := G1(how_hard); M;
115
print "qExpansionBasis(M);";
116
[PowerSeries(f,20) : f in Basis(M)];
117
print "qExpansionBasis(EisensteinSubspace(M));";
118
[PowerSeries(f,20) : f in Basis(ES(M))];
119
print "qExpansionBasis(CuspidalSubspace(M));";
120
[PowerSeries(f,20) : f in Basis(CS(M))];
121
end procedure;
122
123
procedure NewformsG1(how_hard)
124
assert Type(how_hard) eq FldPrElt;
125
126
M := G1(how_hard); M;
127
print "N := Newforms(M);";
128
N := Newforms(M);N;
129
print "q-expansions";
130
for orb in N do
131
"-------------------------";
132
for f in orb do
133
PowerSeries(f,10);
134
Degree(f);
135
end for;
136
end for;
137
end procedure;
138
139
procedure NewSubspaceG1(how_hard)
140
assert Type(how_hard) eq FldPrElt;
141
142
M := G1(how_hard); M;
143
print "NS(M) := ", NS(M);
144
print "NS(ES(M)) := ", NS(ES(M));
145
print "ES(NS(M)) := ", NS(ES(M));
146
assert Dimension(NS(ES(M))) eq Dimension(NS(ES(M)));
147
print "CS(NS(M)) := ", CS(NS(M));
148
print "NS(CS(M)) := ", NS(CS(M));
149
print "qexp(NS(CS(M))) := ", [PowerSeries(f,20) : f in Basis(NS(CS(M)))];
150
print "qexp(ES(NS(M))) := ", [PowerSeries(f,20) : f in Basis(ES(NS(M)))];
151
end procedure;
152
153
procedure TestModpG1(how_hard)
154
assert Type(how_hard) eq FldPrElt;
155
156
p := 0;
157
while p eq 0 do
158
M, p := RandomSpace(how_hard);
159
end while;
160
161
M;
162
N := Newforms(M);N;
163
print "q-expansions";
164
for orb in N do
165
Reductions(orb[1], p);
166
end for;
167
168
end procedure;
169
170
171
procedure TestpAdicG1(how_hard)
172
assert Type(how_hard) eq FldPrElt;
173
174
p := 0;
175
while p eq 0 do
176
M, p := RandomSpace(how_hard);
177
end while;
178
M;
179
N := Newforms(M);N;
180
print "q-expansions";
181
for orb in N do
182
pAdicEmbeddings(orb[1], p);
183
end for;
184
185
end procedure;
186
187
procedure TestComplexG1(how_hard)
188
assert Type(how_hard) eq FldPrElt;
189
190
M := RandomSpace(how_hard);
191
M;
192
N := Newforms(M);N;
193
print "q-expansions";
194
for orb in N do
195
ComplexEmbeddings(orb[1]);
196
end for;
197
198
end procedure;
199
200
procedure TestCharpoly(how_hard)
201
M := RandomSpace(how_hard);
202
M;
203
n := Round(Random([1..100])*how_hard)+1;
204
while GCD(Level(M),n) gt 1 do
205
n := Round(Random([1..100])*how_hard)+1;
206
end while;
207
printf "n = %o\n", n;
208
//printf "f_%o on M := %o\n", n, HeckePolynomial(M, n);
209
// printf "f_%o on ES(M) := %o\n", n, HeckePolynomial(ES(M), n);
210
printf "f_%o on CS(M) := %o\n", n, HeckePolynomial(CS(M), n);
211
//printf "f_%o on ES(NS(M)) := %o\n", n, HeckePolynomial(NS(ES(M)), n);
212
end procedure;
213