Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sagelib
Path: blob/master/sage/tests/book_stein_modform.py
4057 views
1
"""
2
This file contains a bunch of tests extracted from the published book
3
'Modular Forms: a Computational Approach' by William Stein, AMS 2007.
4
5
One doctest is commented out below, because it does not work in
6
Sage currently. The original answer in the book is wrong, but the
7
correct answer has been put in below. This is trac #4357.
8
"""
9
10
"""
11
sage: G = SL(2,ZZ); G
12
Special Linear Group of degree 2 over Integer Ring
13
sage: S, T = G.gens()
14
sage: S
15
[ 0 1]
16
[-1 0]
17
sage: T
18
[1 1]
19
[0 1]
20
sage: delta_qexp(6)
21
q - 24*q^2 + 252*q^3 - 1472*q^4 + 4830*q^5 + O(q^6)
22
sage: bernoulli(12)
23
-691/2730
24
sage: bernoulli(50)
25
495057205241079648212477525/66
26
sage: len(str(bernoulli(10000)))
27
27706
28
sage: E4 = eisenstein_series_qexp(4, 3)
29
sage: E6 = eisenstein_series_qexp(6, 3)
30
sage: E4^6
31
1/191102976000000 + 1/132710400000*q + 203/44236800000*q^2 + O(q^3)
32
sage: E4^3*E6^2
33
1/3511517184000 - 1/12192768000*q - 377/4064256000*q^2 + O(q^3)
34
sage: E6^4
35
1/64524128256 - 1/32006016*q + 241/10668672*q^2 + O(q^3)
36
sage: victor_miller_basis(28,5)
37
[
38
1 + 15590400*q^3 + 36957286800*q^4 + O(q^5),
39
q + 151740*q^3 + 61032448*q^4 + O(q^5),
40
q^2 + 192*q^3 - 8280*q^4 + O(q^5)
41
]
42
sage: R.<q> = QQ[['q']]
43
sage: F4 = 240 * eisenstein_series_qexp(4,3)
44
sage: F6 = -504 * eisenstein_series_qexp(6,3)
45
sage: F4^3
46
1 + 720*q + 179280*q^2 + O(q^3)
47
sage: Delta = (F4^3 - F6^2)/1728; Delta
48
q - 24*q^2 + O(q^3)
49
sage: F4^3 - 720*Delta
50
1 + 196560*q^2 + O(q^3)
51
sage: M = ModularForms(1,36, prec=6).echelon_form()
52
sage: M.basis()
53
[
54
1 + 6218175600*q^4 + 15281788354560*q^5 + O(q^6),
55
q + 57093088*q^4 + 37927345230*q^5 + O(q^6),
56
q^2 + 194184*q^4 + 7442432*q^5 + O(q^6),
57
q^3 - 72*q^4 + 2484*q^5 + O(q^6)
58
]
59
sage: T2 = M.hecke_matrix(2); T2
60
[ 34359738369 0 6218175600 9026867482214400]
61
[ 0 0 34416831456 5681332472832]
62
[ 0 1 194184 -197264484]
63
[ 0 0 -72 -54528]
64
sage: T2.charpoly().factor()
65
(x - 34359738369) * (x^3 - 139656*x^2 - 59208339456*x - 1467625047588864)
66
sage: bernoulli_mod_p(23)
67
[1, 4, 13, 17, 13, 6, 10, 5, 10, 9, 15]
68
sage: set_modsym_print_mode ('modular')
69
sage: M = ModularSymbols(11, 2)
70
sage: M.basis()
71
({Infinity, 0}, {-1/8, 0}, {-1/9, 0})
72
sage: S = M.cuspidal_submodule()
73
sage: S.integral_basis() # basis over ZZ.
74
({-1/8, 0}, {-1/9, 0})
75
sage: set_modsym_print_mode ('manin') # set it back
76
sage: convergents(4/7)
77
[0, 1, 1/2, 4/7]
78
sage: M = ModularSymbols(2,2)
79
sage: M
80
Modular Symbols space of dimension 1 for Gamma_0(2)
81
of weight 2 with sign 0 over Rational Field
82
sage: M.manin_generators()
83
[(0,1), (1,0), (1,1)]
84
85
sage: M = ModularSymbols(3,2)
86
sage: M.manin_generators()
87
[(0,1), (1,0), (1,1), (1,2)]
88
89
sage: M = ModularSymbols(6,2)
90
sage: M.manin_generators()
91
[(0,1), (1,0), (1,1), (1,2), (1,3), (1,4), (1,5), (2,1),
92
(2,3), (2,5), (3,1), (3,2)]
93
sage: M = ModularSymbols(2,2)
94
sage: [x.lift_to_sl2z(2) for x in M.manin_generators()]
95
[[1, 0, 0, 1], [0, -1, 1, 0], [0, -1, 1, 1]]
96
sage: M = ModularSymbols(6,2)
97
sage: x = M.manin_generators()[9]
98
sage: x
99
(2,5)
100
sage: x.lift_to_sl2z(6)
101
[1, 2, 2, 5]
102
sage: M = ModularSymbols(2,2)
103
sage: M.manin_basis()
104
[1]
105
sage: [M.manin_generators()[i] for i in M.manin_basis()]
106
[(1,0)]
107
sage: M = ModularSymbols(6,2)
108
sage: M.manin_basis()
109
[1, 10, 11]
110
sage: [M.manin_generators()[i] for i in M.manin_basis()]
111
[(1,0), (3,1), (3,2)]
112
sage: M.basis()
113
((1,0), (3,1), (3,2))
114
sage: [x.modular_symbol_rep() for x in M.basis()]
115
[{Infinity, 0}, {0, 1/3}, {-1/2, -1/3}]
116
sage: M = ModularSymbols(2,2)
117
sage: M.manin_gens_to_basis()
118
[-1]
119
[ 1]
120
[ 0]
121
sage: M = ModularSymbols(2,2)
122
sage: x = (1,0); M(x)
123
(1,0)
124
sage: M( (3,1) ) # entries are reduced modulo 2 first
125
0
126
sage: M( (10,19) )
127
-(1,0)
128
sage: M = ModularSymbols(6,2)
129
sage: M.manin_gens_to_basis()
130
[-1 0 0]
131
[ 1 0 0]
132
[ 0 0 0]
133
[ 0 -1 1]
134
[ 0 -1 0]
135
[ 0 -1 1]
136
[ 0 0 0]
137
[ 0 1 -1]
138
[ 0 0 -1]
139
[ 0 1 -1]
140
[ 0 1 0]
141
[ 0 0 1]
142
sage: M = ModularSymbols(6,2)
143
sage: M((0,1))
144
-(1,0)
145
sage: M((1,2))
146
-(3,1) + (3,2)
147
sage: HeilbronnCremona(2).to_list()
148
[[1, 0, 0, 2], [2, 0, 0, 1], [2, 1, 0, 1], [1, 0, 1, 2]]
149
sage: HeilbronnCremona(3).to_list()
150
[[1, 0, 0, 3], [3, 1, 0, 1], [1, 0, 1, 3], [3, 0, 0, 1],
151
[3, -1, 0, 1], [-1, 0, 1, -3]]
152
sage: HeilbronnCremona(5).to_list()
153
[[1, 0, 0, 5], [5, 2, 0, 1], [2, 1, 1, 3], [1, 0, 3, 5],
154
[5, 1, 0, 1], [1, 0, 1, 5], [5, 0, 0, 1], [5, -1, 0, 1],
155
[-1, 0, 1, -5], [5, -2, 0, 1], [-2, 1, 1, -3],
156
[1, 0, -3, 5]]
157
sage: len(HeilbronnCremona(37))
158
128
159
sage: len(HeilbronnCremona(389))
160
1892
161
sage: len(HeilbronnCremona(2003))
162
11662
163
sage: M = ModularSymbols(2,2)
164
sage: M.T(2).matrix()
165
[1]
166
sage: M = ModularSymbols(6, 2)
167
sage: M.T(2).matrix()
168
[ 2 1 -1]
169
[-1 0 1]
170
[-1 -1 2]
171
sage: M.T(3).matrix()
172
[3 2 0]
173
[0 1 0]
174
[2 2 1]
175
sage: M.T(3).fcp() # factored characteristic polynomial
176
(x - 3) * (x - 1)^2
177
sage: M = ModularSymbols(39, 2)
178
sage: T2 = M.T(2)
179
sage: T2.matrix()
180
[ 3 0 -1 0 0 1 1 -1 0]
181
[ 0 0 2 0 -1 1 0 1 -1]
182
[ 0 1 0 -1 1 1 0 1 -1]
183
[ 0 0 1 0 0 1 0 1 -1]
184
[ 0 -1 2 0 0 1 0 1 -1]
185
[ 0 0 1 1 0 1 1 -1 0]
186
[ 0 0 0 -1 0 1 1 2 0]
187
[ 0 0 0 1 0 0 2 0 1]
188
[ 0 0 -1 0 0 0 1 0 2]
189
sage: T2.fcp() # factored characteristic polynomial
190
(x - 1)^2 * (x - 3)^3 * (x^2 + 2*x - 1)^2
191
sage: T2 = M.T(2).matrix()
192
sage: T5 = M.T(5).matrix()
193
sage: T2*T5 - T5*T2 == 0
194
True
195
sage: T5.charpoly().factor()
196
(x - 2)^2 * (x - 6)^3 * (x^2 - 8)^2
197
sage: M = ModularSymbols(39, 2)
198
sage: M.T(2).decomposition()
199
[
200
Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension 9 for Gamma_0(39) of weight 2 with sign 0 over Rational Field,
201
Modular Symbols subspace of dimension 3 of Modular Symbols space of dimension 9 for Gamma_0(39) of weight 2 with sign 0 over Rational Field,
202
Modular Symbols subspace of dimension 4 of Modular Symbols space of dimension 9 for Gamma_0(39) of weight 2 with sign 0 over Rational Field
203
]
204
sage: M = ModularSymbols(2, 2)
205
sage: M.boundary_map()
206
Hecke module morphism boundary map defined by the matrix
207
[ 1 -1]
208
Domain: Modular Symbols space of dimension 1 for
209
Gamma_0(2) of weight ...
210
Codomain: Space of Boundary Modular Symbols for
211
Congruence Subgroup Gamma0(2) ...
212
sage: M.cuspidal_submodule()
213
Modular Symbols subspace of dimension 0 of Modular
214
Symbols space of dimension 1 for Gamma_0(2) of weight
215
2 with sign 0 over Rational Field
216
sage: M = ModularSymbols(11, 2)
217
sage: M.boundary_map().matrix()
218
[ 1 -1]
219
[ 0 0]
220
[ 0 0]
221
sage: M.cuspidal_submodule()
222
Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension 3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field
223
sage: S = M.cuspidal_submodule(); S
224
Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension 3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field
225
sage: S.basis()
226
((1,8), (1,9))
227
sage: S.T(2).matrix()
228
[-2 0]
229
[ 0 -2]
230
sage: S.T(3).matrix()
231
[-1 0]
232
[ 0 -1]
233
sage: S.T(5).matrix()
234
[1 0]
235
[0 1]
236
sage: E = EllipticCurve([0,-1,1,-10,-20])
237
sage: 2 + 1 - E.Np(2)
238
-2
239
sage: 3 + 1 - E.Np(3)
240
-1
241
sage: 5 + 1 - E.Np(5)
242
1
243
sage: 7 + 1 - E.Np(7)
244
-2
245
sage: [S.T(p).matrix()[0,0] for p in [2,3,5,7]]
246
[-2, -1, 1, -2]
247
sage: M = ModularSymbols(11); M.basis()
248
((1,0), (1,8), (1,9))
249
sage: S = M.cuspidal_submodule(); S
250
Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension 3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field
251
sage: S.T(2).matrix()
252
[-2 0]
253
[ 0 -2]
254
sage: S.T(3).matrix()
255
[-1 0]
256
[ 0 -1]
257
sage: M = ModularSymbols(33)
258
sage: S = M.cuspidal_submodule(); S
259
Modular Symbols subspace of dimension 6 of Modular
260
Symbols space of dimension 9 for Gamma_0(33) of weight
261
2 with sign 0 over Rational Field
262
sage: R.<q> = PowerSeriesRing(QQ)
263
sage: v = [S.T(n).matrix()[0,0] for n in range(1,6)]
264
sage: f00 = sum(v[n-1]*q^n for n in range(1,6)) + O(q^6)
265
sage: f00
266
q - q^2 - q^3 + q^4 + O(q^6)
267
sage: v = [S.T(n).matrix()[0,1] for n in range(1,6)]
268
sage: f01 = sum(v[n-1]*q^n for n in range(1,6)) + O(q^6)
269
sage: f01
270
-2*q^3 + O(q^6)
271
sage: v = [S.T(n).matrix()[1,0] for n in range(1,6)]
272
sage: f10 = sum(v[n-1]*q^n for n in range(1,6)) + O(q^6)
273
sage: f10
274
q^3 + O(q^6)
275
sage: v = [S.T(n).matrix()[1,1] for n in range(1,6)]
276
sage: f11 = sum(v[n-1]*q^n for n in range(1,6)) + O(q^6)
277
sage: f11
278
q - 2*q^2 + 2*q^4 + q^5 + O(q^6)
279
sage: M = ModularSymbols(23)
280
sage: S = M.cuspidal_submodule()
281
sage: S
282
Modular Symbols subspace of dimension 4 of Modular
283
Symbols space of dimension 5 for Gamma_0(23) of weight
284
2 with sign 0 over Rational Field
285
sage: f = S.q_expansion_cuspforms(6)
286
sage: f(0,0)
287
q - 2/3*q^2 + 1/3*q^3 - 1/3*q^4 - 4/3*q^5 + O(q^6)
288
sage: f(0,1)
289
O(q^6)
290
sage: f(1,0)
291
-1/3*q^2 + 2/3*q^3 + 1/3*q^4 - 2/3*q^5 + O(q^6)
292
sage: S.q_expansion_basis(6)
293
[
294
q - q^3 - q^4 + O(q^6),
295
q^2 - 2*q^3 - q^4 + 2*q^5 + O(q^6)
296
]
297
sage: R = Integers(49)
298
sage: R
299
Ring of integers modulo 49
300
sage: R.unit_gens()
301
[3]
302
sage: Integers(25).unit_gens()
303
[2]
304
sage: Integers(100).unit_gens()
305
[51, 77]
306
sage: Integers(200).unit_gens()
307
[151, 101, 177]
308
sage: Integers(2005).unit_gens()
309
[402, 1206]
310
sage: Integers(200000000).unit_gens()
311
[174218751, 51562501, 187109377]
312
sage: list(DirichletGroup(5))
313
[Dirichlet character modulo 5 of conductor 1 mapping 2 |--> 1,
314
Dirichlet character modulo 5 of conductor 5 mapping 2 |--> zeta4,
315
Dirichlet character modulo 5 of conductor 5 mapping 2 |--> -1,
316
Dirichlet character modulo 5 of conductor 5 mapping 2 |--> -zeta4]
317
sage: list(DirichletGroup(5, QQ))
318
[Dirichlet character modulo 5 of conductor 1 mapping 2 |--> 1, Dirichlet character modulo 5 of conductor 5 mapping 2 |--> -1]
319
sage: G = DirichletGroup(200)
320
sage: G
321
Group of Dirichlet characters of modulus 200 over
322
Cyclotomic Field of order 20 and degree 8
323
sage: G.exponent()
324
20
325
sage: G.gens()
326
(Dirichlet character modulo 200 of conductor 4 mapping 151 |--> -1, 101 |--> 1, 177 |--> 1,
327
Dirichlet character modulo 200 of conductor 8 mapping 151 |--> 1, 101 |--> -1, 177 |--> 1,
328
Dirichlet character modulo 200 of conductor 25 mapping 151 |--> 1, 101 |--> 1, 177 |--> zeta20)
329
sage: K = G.base_ring()
330
sage: zeta = K.0
331
sage: eps = G([1,-1,zeta^5])
332
sage: eps
333
Dirichlet character modulo 200 of conductor 40 mapping 151 |--> 1, 101 |--> -1, 177 |--> zeta20^5
334
sage: eps(3)
335
zeta20^5
336
sage: -zeta^15
337
zeta20^5
338
sage: kronecker(151,200)
339
1
340
sage: kronecker(101,200)
341
-1
342
sage: kronecker(177,200)
343
1
344
sage: G = DirichletGroup(20)
345
sage: G.galois_orbits()
346
[
347
[Dirichlet character modulo 20 of conductor 1 mapping 11 |--> 1, 17 |--> 1],
348
[Dirichlet character modulo 20 of conductor 5 mapping 11 |--> 1, 17 |--> zeta4,
349
Dirichlet character modulo 20 of conductor 5 mapping 11 |--> 1, 17 |--> -zeta4],
350
[Dirichlet character modulo 20 of conductor 5 mapping 11 |--> 1, 17 |--> -1],
351
[Dirichlet character modulo 20 of conductor 4 mapping 11 |--> -1, 17 |--> 1],
352
[Dirichlet character modulo 20 of conductor 20 mapping 11 |--> -1, 17 |--> zeta4,
353
Dirichlet character modulo 20 of conductor 20 mapping 11 |--> -1, 17 |--> -zeta4],
354
[Dirichlet character modulo 20 of conductor 20 mapping 11 |--> -1, 17 |--> -1]
355
]
356
sage: G = DirichletGroup(11, QQ); G
357
Group of Dirichlet characters of modulus 11 over
358
Rational Field
359
sage: list(G)
360
[Dirichlet character modulo 11 of conductor 1 mapping 2 |--> 1,
361
Dirichlet character modulo 11 of conductor 11 mapping 2 |--> -1]
362
sage: eps = G.0 # 0th generator for Dirichlet group
363
sage: eps
364
Dirichlet character modulo 11 of conductor 11 mapping 2 |--> -1
365
sage: G.unit_gens()
366
[2]
367
sage: eps(2)
368
-1
369
sage: eps(3)
370
1
371
sage: [eps(11*n) for n in range(10)]
372
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
373
sage: R = CyclotomicField(4)
374
sage: CyclotomicField(4)
375
Cyclotomic Field of order 4 and degree 2
376
sage: G = DirichletGroup(15, R)
377
sage: G
378
Group of Dirichlet characters of modulus 15 over
379
Cyclotomic Field of order 4 and degree 2
380
sage: list(G)
381
[Dirichlet character modulo 15 of conductor 1 mapping 11 |--> 1, 7 |--> 1,
382
Dirichlet character modulo 15 of conductor 3 mapping 11 |--> -1, 7 |--> 1,
383
Dirichlet character modulo 15 of conductor 5 mapping 11 |--> 1, 7 |--> zeta4,
384
Dirichlet character modulo 15 of conductor 15 mapping 11 |--> -1, 7 |--> zeta4,
385
Dirichlet character modulo 15 of conductor 5 mapping 11 |--> 1, 7 |--> -1,
386
Dirichlet character modulo 15 of conductor 15 mapping 11 |--> -1, 7 |--> -1,
387
Dirichlet character modulo 15 of conductor 5 mapping 11 |--> 1, 7 |--> -zeta4,
388
Dirichlet character modulo 15 of conductor 15 mapping 11 |--> -1, 7 |--> -zeta4]
389
sage: e = G.1
390
sage: e(4)
391
-1
392
sage: e(-1)
393
-1
394
sage: e(5)
395
0
396
sage: [e(n) for n in range(15)]
397
[0, 1, zeta4, 0, -1, 0, 0, zeta4, -zeta4,
398
0, 0, 1, 0, -zeta4, -1]
399
sage: G = DirichletGroup(15, GF(5)); G
400
Group of Dirichlet characters of modulus 15
401
over Finite Field of size 5
402
sage: list(G)
403
[Dirichlet character modulo 15 of conductor 1 mapping 11 |--> 1, 7 |--> 1,
404
Dirichlet character modulo 15 of conductor 3 mapping 11 |--> 4, 7 |--> 1,
405
Dirichlet character modulo 15 of conductor 5 mapping 11 |--> 1, 7 |--> 2,
406
Dirichlet character modulo 15 of conductor 15 mapping 11 |--> 4, 7 |--> 2,
407
Dirichlet character modulo 15 of conductor 5 mapping 11 |--> 1, 7 |--> 4,
408
Dirichlet character modulo 15 of conductor 15 mapping 11 |--> 4, 7 |--> 4,
409
Dirichlet character modulo 15 of conductor 5 mapping 11 |--> 1, 7 |--> 3,
410
Dirichlet character modulo 15 of conductor 15 mapping 11 |--> 4, 7 |--> 3]
411
sage: e = G.1
412
sage: e(-1)
413
4
414
sage: e(2)
415
2
416
sage: e(5)
417
0
418
sage: print [e(n) for n in range(15)]
419
[0, 1, 2, 0, 4, 0, 0, 2, 3, 0, 0, 1, 0, 3, 4]
420
sage: G = DirichletGroup(5)
421
sage: e = G.0
422
sage: e(2)
423
zeta4
424
sage: e.bernoulli(1)
425
-1/5*zeta4 - 3/5
426
sage: e.bernoulli(9)
427
-108846/5*zeta4 - 176868/5
428
sage: E = EisensteinForms(Gamma1(13),2)
429
sage: E.eisenstein_series()
430
[
431
1/2 + q + 3*q^2 + 4*q^3 + 7*q^4 + 6*q^5 + O(q^6),
432
-7/13*zeta6 - 11/13 + q + (2*zeta6 + 1)*q^2 + (-3*zeta6 + 1)*q^3 + (6*zeta6 - 3)*q^4 - 4*q^5 + O(q^6),
433
q + (zeta6 + 2)*q^2 + (-zeta6 + 3)*q^3 + (3*zeta6 + 3)*q^4 + 4*q^5 + O(q^6),
434
-zeta6 + q + (2*zeta6 - 1)*q^2 + (3*zeta6 - 2)*q^3 + (-2*zeta6 - 1)*q^4 + 6*q^5 + O(q^6),
435
q + (zeta6 + 1)*q^2 + (zeta6 + 2)*q^3 + (zeta6 + 2)*q^4 + 6*q^5 + O(q^6),
436
-1 + q - q^2 + 4*q^3 + 3*q^4 - 4*q^5 + O(q^6),
437
q + q^2 + 4*q^3 + 3*q^4 + 4*q^5 + O(q^6),
438
zeta6 - 1 + q + (-2*zeta6 + 1)*q^2 + (-3*zeta6 + 1)*q^3 + (2*zeta6 - 3)*q^4 + 6*q^5 + O(q^6),
439
q + (-zeta6 + 2)*q^2 + (-zeta6 + 3)*q^3 + (-zeta6 + 3)*q^4 + 6*q^5 + O(q^6),
440
7/13*zeta6 - 18/13 + q + (-2*zeta6 + 3)*q^2 + (3*zeta6 - 2)*q^3 + (-6*zeta6 + 3)*q^4 - 4*q^5 + O(q^6),
441
q + (-zeta6 + 3)*q^2 + (zeta6 + 2)*q^3 + (-3*zeta6 + 6)*q^4 + 4*q^5 + O(q^6)
442
]
443
sage: e = E.eisenstein_series()
444
sage: for e in E.eisenstein_series():
445
... print e.parameters()
446
...
447
(Dirichlet character modulo 13 of conductor 1 mapping 2 |--> 1, Dirichlet character modulo 13 of conductor 1 mapping 2 |--> 1, 13)
448
(Dirichlet character modulo 13 of conductor 1 mapping 2 |--> 1, Dirichlet character modulo 13 of conductor 13 mapping 2 |--> zeta6, 1)
449
(Dirichlet character modulo 13 of conductor 13 mapping 2 |--> zeta6, Dirichlet character modulo 13 of conductor 1 mapping 2 |--> 1, 1)
450
(Dirichlet character modulo 13 of conductor 1 mapping 2 |--> 1, Dirichlet character modulo 13 of conductor 13 mapping 2 |--> zeta6 - 1, 1)
451
(Dirichlet character modulo 13 of conductor 13 mapping 2 |--> zeta6 - 1, Dirichlet character modulo 13 of conductor 1 mapping 2 |--> 1, 1)
452
(Dirichlet character modulo 13 of conductor 1 mapping 2 |--> 1, Dirichlet character modulo 13 of conductor 13 mapping 2 |--> -1, 1)
453
(Dirichlet character modulo 13 of conductor 13 mapping 2 |--> -1, Dirichlet character modulo 13 of conductor 1 mapping 2 |--> 1, 1)
454
(Dirichlet character modulo 13 of conductor 1 mapping 2 |--> 1, Dirichlet character modulo 13 of conductor 13 mapping 2 |--> -zeta6, 1)
455
(Dirichlet character modulo 13 of conductor 13 mapping 2 |--> -zeta6, Dirichlet character modulo 13 of conductor 1 mapping 2 |--> 1, 1)
456
(Dirichlet character modulo 13 of conductor 1 mapping 2 |--> 1, Dirichlet character modulo 13 of conductor 13 mapping 2 |--> -zeta6 + 1, 1)
457
(Dirichlet character modulo 13 of conductor 13 mapping 2 |--> -zeta6 + 1, Dirichlet character modulo 13 of conductor 1 mapping 2 |--> 1, 1)
458
sage: dimension_cusp_forms(Gamma0(2007),2)
459
221
460
sage: dimension_eis(Gamma0(2007),2)
461
7
462
sage: dimension_modular_forms(Gamma0(2007),2)
463
228
464
sage: dimension_new_cusp_forms(Gamma0(11),12)
465
8
466
sage: dimension_cusp_forms(Gamma0(11),12)
467
10
468
sage: dimension_new_cusp_forms(Gamma0(2007),12)
469
1017
470
sage: dimension_cusp_forms(Gamma0(2007),12)
471
2460
472
sage: dimension_cusp_forms(Gamma1(2007),2)
473
147409
474
sage: dimension_eis(Gamma1(2007),2)
475
3551
476
sage: dimension_modular_forms(Gamma1(2007),2)
477
150960
478
sage: G = DirichletGroup(2007)
479
sage: e = prod(G.gens(), G(1))
480
sage: dimension_cusp_forms(e,2)
481
222
482
sage: dimension_cusp_forms(e,3)
483
0
484
sage: dimension_cusp_forms(e,4)
485
670
486
sage: dimension_cusp_forms(e,24)
487
5150
488
sage: dimension_eis(e,2)
489
4
490
sage: dimension_eis(e,3)
491
0
492
sage: dimension_eis(e,4)
493
4
494
sage: dimension_eis(e,24)
495
4
496
sage: G = DirichletGroup(2007, QQ)
497
sage: e = prod(G.gens(), G(1))
498
sage: dimension_new_cusp_forms(e,2)
499
76
500
sage: p = 389
501
sage: k = GF(p)
502
sage: a = k(7/13); a
503
210
504
sage: a.rational_reconstruction()
505
7/13
506
sage: M = MatrixSpace(QQ,4,8)
507
sage: A = M([[-9,6,7,3,1,0,0,0],[-10,3,8,2,0,1,0,0],[3,-6,2,8,0,0,1,0],[-8,-6,-8,6,0,0,0,1]])
508
sage: A41 = MatrixSpace(GF(41),4,8)(A)
509
sage: E41 = A41.echelon_form()
510
sage: B = A.matrix_from_columns([0,1,2,4])
511
sage: E = B^(-1)*A
512
sage: B = A.matrix_from_columns([0,1,2,3])
513
sage: M = ModularSymbols(Gamma0(6)); M
514
Modular Symbols space of dimension 3 for Gamma_0(6)
515
of weight 2 with sign 0 over Rational Field
516
sage: M.new_subspace()
517
Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension 3 for Gamma_0(6) of weight 2 with sign 0 over Rational Field
518
sage: M.old_subspace()
519
Modular Symbols subspace of dimension 3 of Modular
520
Symbols space of dimension 3 for Gamma_0(6) of weight
521
2 with sign 0 over Rational Field
522
sage: G = DirichletGroup(13)
523
sage: G
524
Group of Dirichlet characters of modulus 13 over
525
Cyclotomic Field of order 12 and degree 4
526
sage: dimension_modular_forms(Gamma1(13),2)
527
13
528
sage: [dimension_modular_forms(e,2) for e in G]
529
[1, 0, 3, 0, 2, 0, 2, 0, 2, 0, 3, 0]
530
sage: G = DirichletGroup(100)
531
sage: G
532
Group of Dirichlet characters of modulus 100 over
533
Cyclotomic Field of order 20 and degree 8
534
sage: dimension_modular_forms(Gamma1(100),2)
535
370
536
sage: v = [dimension_modular_forms(e,2) for e in G]; v
537
[24, 0, 0, 17, 18, 0, 0, 17, 18, 0, 0, 21, 18, 0, 0, 17,
538
18, 0, 0, 17, 24, 0, 0, 17, 18, 0, 0, 17, 18, 0, 0, 21,
539
18, 0, 0, 17, 18, 0, 0, 17]
540
sage: sum(v)
541
370
542
sage: S = CuspForms(Gamma0(45), 2, prec=14); S
543
Cuspidal subspace of dimension 3 of Modular Forms space
544
of dimension 10 for Congruence Subgroup Gamma0(45) of
545
weight 2 over Rational Field
546
sage: S.basis()
547
[
548
q - q^4 - q^10 - 2*q^13 + O(q^14),
549
q^2 - q^5 - 3*q^8 + 4*q^11 + O(q^14),
550
q^3 - q^6 - q^9 - q^12 + O(q^14)
551
]
552
553
sage: S.new_subspace().basis() # not tested
554
(q + q^2 - q^4 -q^5 - 3*q^8 - q^10 + 4*q^11 - 2*q^13 + O(q^14),)
555
sage: CuspForms(Gamma0(9),2)
556
Cuspidal subspace of dimension 0 of Modular Forms space
557
of dimension 3 for Congruence Subgroup Gamma0(9) of
558
weight 2 over Rational Field
559
sage: CuspForms(Gamma0(15),2, prec=10).basis()
560
[
561
q - q^2 - q^3 - q^4 + q^5 + q^6 + 3*q^8 + q^9 + O(q^10)
562
]
563
"""
564
565