Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sagelib
Path: blob/master/sage/modular/overconvergent/genus0.py
4091 views
1
# -*- coding: utf-8 -*-
2
r"""
3
Overconvergent p-adic modular forms for small primes
4
5
This module implements computations of Hecke operators and `U_p`-eigenfunctions
6
on `p`-adic overconvergent modular forms of tame level 1, where `p` is one of
7
the primes `\{2, 3, 5, 7, 13\}`, using the algorithms described in [Loe2007]_.
8
9
.. [Loe2007] David Loeffler, *Spectral expansions of overconvergent modular functions*,
10
Int. Math. Res. Not 2007 (050). `Arxiv preprint <http://uk.arxiv.org/abs/math/0701168>`_.
11
12
AUTHORS:
13
14
- David Loeffler (August 2008): initial version
15
- David Loeffler (March 2009): extensively reworked
16
- Lloyd Kilford (May 2009): add
17
:meth:`~sage.modular.overconvergent.genus0.OverconvergentModularFormsSpace.slopes`
18
method
19
- David Loeffler (June 2009): miscellaneous bug fixes and usability improvements
20
21
The Theory
22
~~~~~~~~~~
23
24
Let `p` be one of the above primes, so `X_0(p)` has genus 0, and let
25
26
.. math::
27
28
f_p = \sqrt[p-1]{\frac{\Delta(pz)}{\Delta(z)}}
29
30
(an `\eta`-product of level `p` -- see module :mod:`sage.modular.etaproducts`).
31
Then one can show that `f_p` gives an isomorphism `X_0(p) \to \mathbb{P}^1`.
32
Furthermore, if we work over `\CC_p`, the `r`-overconvergent locus on `X_0(p)`
33
(or of `X_0(1)`, via the canonical subgroup lifting), corresponds to the
34
`p`-adic disc
35
36
.. math::
37
38
|f_p|_p \le p^{\frac{12r}{p-1}}.
39
40
(This is Theorem 1 of [Loe2007]_.)
41
42
Hence if we fix an element `c` with `|c| = p^{-\frac{12r}{p-1}}`, the space
43
`S_k^\dag(1, r)` of overconvergent `p`-adic modular forms has an orthonormal
44
basis given by the functions `(cf)^n`. So any element can be written in the
45
form `E_k \times \sum_{n \ge 0} a_n (cf)^n`, where `a_n \to 0` as `N \to
46
\infty`, and any such sequence `a_n` defines a unique overconvergent form.
47
48
One can now find the matrix of Hecke operators in this basis, either by
49
calculating `q`-expansions, or (for the special case of `U_p`) using a
50
recurrence formula due to Kolberg.
51
52
An Extended Example
53
~~~~~~~~~~~~~~~~~~~
54
55
We create a space of 3-adic modular forms::
56
57
sage: M = OverconvergentModularForms(3, 8, 1/6, prec=60)
58
59
Creating an element directly as a linear combination of basis vectors.
60
61
.. link
62
63
::
64
65
sage: f1 = M.3 + M.5; f1.q_expansion()
66
27*q^3 + 1055916/1093*q^4 + 19913121/1093*q^5 + 268430112/1093*q^6 + ...
67
sage: f1.coordinates(8)
68
[0, 0, 0, 1, 0, 1, 0, 0]
69
70
We can coerce from elements of classical spaces of modular forms:
71
72
.. link
73
74
::
75
76
sage: f2 = M(CuspForms(3, 8).0); f2
77
3-adic overconvergent modular form of weight-character 8 with q-expansion q + 6*q^2 - 27*q^3 - 92*q^4 + 390*q^5 - 162*q^6 ...
78
79
We express this in a basis, and see that the coefficients go to zero very fast:
80
81
.. link
82
83
::
84
85
sage: [x.valuation(3) for x in f2.coordinates(60)]
86
[+Infinity, -1, 3, 6, 10, 13, 18, 20, 24, 27, 31, 34, 39, 41, 45, 48, 52, 55, 61, 62, 66, 69, 73, 76, 81, 83, 87, 90, 94, 97, 102, 104, 108, 111, 115, 118, 124, 125, 129, 132, 136, 139, 144, 146, 150, 153, 157, 160, 165, 167, 171, 174, 178, 181, 188, 188, 192, 195, 199, 202]
87
88
This form has more level at `p`, and hence is less overconvergent:
89
90
.. link
91
92
::
93
94
sage: f3 = M(CuspForms(9, 8).0); [x.valuation(3) for x in f3.coordinates(60)]
95
[+Infinity, -1, -1, 0, -4, -4, -2, -3, 0, 0, -1, -1, 1, 0, 3, 3, 3, 3, 5, 3, 7, 7, 6, 6, 8, 7, 10, 10, 8, 8, 10, 9, 12, 12, 12, 12, 14, 12, 17, 16, 15, 15, 17, 16, 19, 19, 18, 18, 20, 19, 22, 22, 22, 22, 24, 21, 25, 26, 24, 24]
96
97
An error will be raised for forms which are not sufficiently overconvergent:
98
99
.. link
100
101
::
102
103
sage: M(CuspForms(27, 8).0)
104
Traceback (most recent call last):
105
...
106
ValueError: Form is not overconvergent enough (form is only 1/12-overconvergent)
107
108
Let's compute some Hecke operators. Note that the coefficients of this matrix are `p`-adically tiny:
109
110
.. link
111
112
::
113
114
sage: M.hecke_matrix(3, 4).change_ring(Qp(3,prec=1))
115
[ 1 + O(3) 0 0 0]
116
[ 0 2*3^3 + O(3^4) 2*3^3 + O(3^4) 3^2 + O(3^3)]
117
[ 0 2*3^7 + O(3^8) 2*3^8 + O(3^9) 3^6 + O(3^7)]
118
[ 0 2*3^10 + O(3^11) 2*3^10 + O(3^11) 2*3^9 + O(3^10)]
119
120
We compute the eigenfunctions of a 4x4 truncation:
121
122
.. link
123
124
::
125
126
sage: efuncs = M.eigenfunctions(4)
127
sage: for i in [1..3]:
128
... print efuncs[i].q_expansion(prec=4).change_ring(Qp(3,prec=20))
129
(1 + O(3^20))*q + (2*3 + 3^15 + 3^16 + 3^17 + 2*3^19 + 2*3^20 + O(3^21))*q^2 + (2*3^3 + 2*3^4 + 2*3^5 + 2*3^6 + 2*3^7 + 2*3^8 + 2*3^9 + 2*3^10 + 2*3^11 + 2*3^12 + 2*3^13 + 2*3^14 + 2*3^15 + 2*3^16 + 3^17 + 2*3^18 + 2*3^19 + 3^21 + 3^22 + O(3^23))*q^3 + O(q^4)
130
(1 + O(3^20))*q + (3 + 2*3^2 + 3^3 + 3^4 + 3^12 + 3^13 + 2*3^14 + 3^15 + 2*3^17 + 3^18 + 3^19 + 3^20 + O(3^21))*q^2 + (3^7 + 3^13 + 2*3^14 + 2*3^15 + 3^16 + 3^17 + 2*3^18 + 3^20 + 2*3^21 + 2*3^22 + 2*3^23 + 2*3^25 + O(3^27))*q^3 + O(q^4)
131
(1 + O(3^20))*q + (2*3 + 3^3 + 2*3^4 + 3^6 + 2*3^8 + 3^9 + 3^10 + 2*3^11 + 2*3^13 + 3^16 + 3^18 + 3^19 + 3^20 + O(3^21))*q^2 + (3^9 + 2*3^12 + 3^15 + 3^17 + 3^18 + 3^19 + 3^20 + 2*3^22 + 2*3^23 + 2*3^27 + 2*3^28 + O(3^29))*q^3 + O(q^4)
132
133
The first eigenfunction is a classical cusp form of level 3:
134
135
.. link
136
137
::
138
139
sage: (efuncs[1] - M(CuspForms(3, 8).0)).valuation()
140
13
141
142
The second is an Eisenstein series!
143
144
.. link
145
146
::
147
148
sage: (efuncs[2] - M(EisensteinForms(3, 8).1)).valuation()
149
10
150
151
The third is a genuinely new thing (not a classical modular form at all); the
152
coefficients are almost certainly not algebraic over `\QQ`. Note that the slope
153
is 9, so Coleman's classicality criterion (forms of slope `< k-1` are
154
classical) does not apply.
155
156
.. link
157
158
::
159
160
sage: a3 = efuncs[3].q_expansion()[3]; a3
161
3^9 + 2*3^12 + 3^15 + 3^17 + 3^18 + 3^19 + 3^20 + 2*3^22 + 2*3^23 + 2*3^27 + 2*3^28 + 3^32 + 3^33 + 2*3^34 + 3^38 + 2*3^39 + 3^40 + 2*3^41 + 3^44 + 3^45 + 3^46 + 2*3^47 + 2*3^48 + 3^49 + 3^50 + 2*3^51 + 2*3^52 + 3^53 + 2*3^54 + 3^55 + 3^56 + 3^57 + 2*3^58 + 2*3^59 + 3^60 + 2*3^61 + 2*3^63 + 2*3^64 + 3^65 + 2*3^67 + 3^68 + 2*3^69 + 2*3^71 + 3^72 + 2*3^74 + 3^75 + 3^76 + 3^79 + 3^80 + 2*3^83 + 2*3^84 + 3^85 + 2*3^87 + 3^88 + 2*3^89 + 2*3^90 + 2*3^91 + 3^92 + O(3^98)
162
sage: efuncs[3].slope()
163
9
164
165
-----------
166
"""
167
168
#*****************************************************************************
169
# Copyright (C) 2008 William Stein <[email protected]>
170
# 2008-9 David Loeffler <[email protected]>
171
#
172
# Distributed under the terms of the GNU General Public License (GPL)
173
# http://www.gnu.org/licenses/
174
#*****************************************************************************
175
176
177
from sage.matrix.all import matrix, MatrixSpace, diagonal_matrix
178
from sage.misc.misc import verbose
179
from sage.misc.cachefunc import cached_method
180
from sage.modular.all import (DirichletGroup, trivial_character, EtaProduct,
181
j_invariant_qexp, hecke_operator_on_qexp)
182
from sage.modular.arithgroup.all import (Gamma1, is_Gamma0, is_Gamma1)
183
from sage.modular.modform.element import ModularFormElement
184
from sage.modules.all import vector
185
from sage.modules.module import Module_old
186
from sage.structure.element import Vector, ModuleElement
187
from sage.plot.plot import plot
188
from sage.rings.all import (O, Infinity, ZZ, QQ, pAdicField, PolynomialRing, PowerSeriesRing, is_pAdicField)
189
import weakref
190
191
from weightspace import WeightSpace_constructor as WeightSpace, WeightCharacter
192
__ocmfdict = {}
193
194
####################
195
# Factory function #
196
####################
197
198
def OverconvergentModularForms(prime, weight, radius, base_ring=QQ, prec = 20, char = None):
199
r"""
200
Create a space of overconvergent `p`-adic modular forms of level
201
`\Gamma_0(p)`, over the given base ring. The base ring need not be a
202
`p`-adic ring (the spaces we compute with typically have bases over
203
`\QQ`).
204
205
INPUT:
206
207
- ``prime`` - a prime number `p`, which must be one of the primes `\{2, 3,
208
5, 7, 13\}`, or the congruence subgroup `\Gamma_0(p)` where `p` is one of these
209
primes.
210
211
- ``weight`` - an integer (which at present must be 0 or `\ge 2`), the
212
weight.
213
214
- ``radius`` - a rational number in the interval `\left( 0, \frac{p}{p+1}
215
\right)`, the radius of overconvergence.
216
217
- ``base_ring`` (default: `\QQ`), a ring over which to compute. This
218
need not be a `p`-adic ring.
219
220
- ``prec`` - an integer (default: 20), the number of `q`-expansion terms to
221
compute.
222
223
- ``char`` - a Dirichlet character modulo `p` or ``None`` (the default).
224
Here ``None`` is interpreted as the trivial character modulo `p`.
225
226
The character `\chi` and weight `k` must satisfy `(-1)^k = \chi(-1)`, and
227
the base ring must contain an element `v` such that
228
`{\rm ord}_p(v) = \frac{12 r}{p-1}` where `r` is the radius of
229
overconvergence (and `{\rm ord}_p` is normalised so `{\rm ord}_p(p) = 1`).
230
231
EXAMPLES::
232
233
sage: OverconvergentModularForms(3, 0, 1/2)
234
Space of 3-adic 1/2-overconvergent modular forms of weight-character 0 over Rational Field
235
sage: OverconvergentModularForms(3, 16, 1/2)
236
Space of 3-adic 1/2-overconvergent modular forms of weight-character 16 over Rational Field
237
sage: OverconvergentModularForms(3, 3, 1/2, char = DirichletGroup(3,QQ).0)
238
Space of 3-adic 1/2-overconvergent modular forms of weight-character (3, 3, [-1]) over Rational Field
239
"""
240
if is_Gamma0(prime) or is_Gamma1(prime):
241
prime = prime.level()
242
else:
243
prime = ZZ(prime)
244
if char is None:
245
char = trivial_character(prime, base_ring=QQ)
246
if int(prime) not in [2, 3, 5, 7, 13]:
247
raise ValueError, "p must be one of {2, 3, 5, 7, 13}"
248
key = (prime, weight, radius, base_ring, prec, char)
249
if __ocmfdict.has_key(key):
250
w = __ocmfdict[key]
251
M = w()
252
if not (M is None):
253
return M
254
M = OverconvergentModularFormsSpace(*key)
255
__ocmfdict[key] = weakref.ref(M)
256
return M
257
258
#########################
259
# Main class definition #
260
#########################
261
262
class OverconvergentModularFormsSpace(Module_old):
263
r"""
264
A space of overconvergent modular forms of level `\Gamma_0(p)`,
265
where `p` is a prime such that `X_0(p)` has genus 0.
266
267
Elements are represented as power series, with a formal power series `F`
268
corresponding to the modular form `E_k^\ast \times F(g)` where `E_k^\ast`
269
is the `p`-deprived Eisenstein series of weight-character `k`, and `g` is a
270
uniformiser of `X_0(p)` normalised so that the `r`-overconvergent region
271
`X_0(p)_{\ge r}` corresponds to `|g| \le 1`.
272
273
TESTS::
274
275
sage: K.<w> = Qp(13).extension(x^2-13); M = OverconvergentModularForms(13, 20, radius=1/2, base_ring=K)
276
sage: M is loads(dumps(M))
277
True
278
"""
279
280
###############
281
# Init script #
282
###############
283
284
def __init__(self, prime, weight, radius, base_ring, prec, char):
285
r"""
286
Create a space of overconvergent `p`-adic modular forms of level
287
`\Gamma_0(p)`, over the given base ring. The base ring need not be a
288
`p`-adic ring (the spaces we compute with typically have bases over
289
`\QQ`).
290
291
EXAMPLES::
292
293
sage: OverconvergentModularForms(3, 0, 1/2)
294
Space of 3-adic 1/2-overconvergent modular forms of weight-character 0 over Rational Field
295
"""
296
297
self._p = prime
298
299
if not ( base_ring == QQ or is_pAdicField(base_ring) ):
300
raise TypeError, "Base ring must be QQ or a p-adic field"
301
302
if base_ring != QQ and base_ring.prime() != self._p:
303
raise TypeError, "Residue characteristic of base ring (=%s) must be %s" % (base_ring, self._p)
304
305
if isinstance(weight, WeightCharacter):
306
self._wtchar = weight
307
else:
308
self._wtchar = WeightSpace(prime, base_ring = char.base_ring())(weight, char, algebraic=True)
309
310
if not self._wtchar.is_even():
311
raise ValueError, "Weight-character must be even"
312
313
Module_old.__init__(self, base_ring)
314
315
self._prec = prec
316
317
self._qsr = PowerSeriesRing(base_ring, 'q', prec) # q-series ring
318
self._gsr = PowerSeriesRing(base_ring, 'g', prec) # g-adic expansions, g = c*f
319
320
self._cached_recurrence_matrix = None
321
self._set_radius(radius)
322
self._basis_cache = [self._wtchar.pAdicEisensteinSeries(self._qsr, self.prec())]
323
self._uniformiser = self._qsr(EtaProduct(prime, {prime: 24/ZZ(prime-1), ZZ(1):-24/ZZ(prime-1)}).qexp(self.prec()))
324
325
for i in xrange(1, self.prec()):
326
self._basis_cache.append(self._basis_cache[-1] * self._uniformiser * self._const)
327
328
#####################################
329
# Methods called by the init script #
330
#####################################
331
332
def _set_radius(self, radius):
333
r"""
334
Set the radius of overconvergence to be `r`, where `r` is a rational
335
number in the interval `0 < r < \frac{p}{p+1}`.
336
337
This only makes sense if the base ring contains an element of
338
normalised valuation `\frac{12r}{p-1}`. If this valuation is an
339
integer, we use the appropriate power of `p`. Otherwise, we assume the
340
base ring has a ``uniformiser`` method and take an appropriate power of
341
the uniformiser, raising an error if no such element exists.
342
343
EXAMPLES::
344
345
sage: M = OverconvergentModularForms(3, 2, 1/2) # indirect doctest
346
sage: M._set_radius(1/3); M
347
Space of 3-adic 1/3-overconvergent modular forms of weight-character 2 over Rational Field
348
349
sage: L.<w> = Qp(3).extension(x^5 - 3)
350
sage: OverconvergentModularForms(3, 2, 1/30, base_ring=L).normalising_factor() # indirect doctest
351
w + O(w^101)
352
353
sage: OverconvergentModularForms(3, 2, 1/40, base_ring=L)
354
Traceback (most recent call last):
355
...
356
ValueError: no element of base ring (=Eisenstein Extension ...) has normalised valuation 3/20
357
"""
358
359
p = ZZ(self.prime())
360
361
if (radius < 0 or radius > p/(p+1)):
362
raise ValueError, "radius (=%s) must be between 0 and p/(p+1)" % radius
363
d = 12/(p-1)*radius
364
if d.is_integral():
365
self._const = p ** ZZ(d)
366
self._radius = radius
367
else:
368
try:
369
pi = self.base_ring().uniformiser()
370
e = d / pi.normalized_valuation()
371
except AttributeError: # base ring isn't a p-adic ring
372
pi = p
373
e = d
374
if not e.is_integral():
375
raise ValueError, "no element of base ring (=%s) has normalised valuation %s" % (self.base_ring(), radius * 12 /(p-1))
376
self._radius = radius
377
self._const = pi ** ZZ(e)
378
379
##############################################
380
# Boring functions that access internal data #
381
##############################################
382
383
def is_exact(self):
384
r"""
385
True if elements of this space are represented exactly, i.e., there is
386
no precision loss when doing arithmetic. As this is never true for
387
overconvergent modular forms spaces, this returns False.
388
389
EXAMPLES::
390
391
sage: OverconvergentModularForms(13, 12, 0).is_exact()
392
False
393
"""
394
return False
395
396
def change_ring(self, ring):
397
r"""
398
Return the space corresponding to self but over the given base ring.
399
400
EXAMPLES::
401
402
sage: M = OverconvergentModularForms(2, 0, 1/2)
403
sage: M.change_ring(Qp(2))
404
Space of 2-adic 1/2-overconvergent modular forms of weight-character 0 over 2-adic Field with ...
405
"""
406
return OverconvergentModularForms(self.prime(), self.weight(), self.radius(), ring, self.prec(), self.character())
407
408
def base_extend(self, ring):
409
r"""
410
Return the base extension of self to the given base ring. There must be
411
a canonical map to this ring from the current base ring, otherwise a
412
TypeError will be raised.
413
414
EXAMPLES::
415
416
sage: M = OverconvergentModularForms(2, 0, 1/2, base_ring = Qp(2))
417
sage: M.base_extend(Qp(2).extension(x^2 - 2, names="w"))
418
Space of 2-adic 1/2-overconvergent modular forms of weight-character 0 over Eisenstein Extension of 2-adic Field ...
419
sage: M.base_extend(QQ)
420
Traceback (most recent call last):
421
...
422
TypeError: Base extension of self (over '2-adic Field with capped relative precision 20') to ring 'Rational Field' not defined.
423
"""
424
if ring.has_coerce_map_from(self.base_ring()):
425
return self.change_ring(ring)
426
else:
427
raise TypeError, "Base extension of self (over '%s') to ring '%s' not defined." % (self.base_ring(), ring)
428
429
def _an_element_impl(self):
430
r"""
431
Return an element of this space (used by the coercion machinery).
432
433
EXAMPLE::
434
435
sage: OverconvergentModularForms(3, 2, 1/3, prec=4).an_element() # indirect doctest
436
3-adic overconvergent modular form of weight-character 2 with q-expansion 9*q + 216*q^2 + 2430*q^3 + O(q^4)
437
"""
438
return OverconvergentModularFormElement(self, self._gsr.an_element())
439
440
def character(self):
441
r"""
442
Return the character of self. For overconvergent forms, the weight and
443
the character are unified into the concept of a weight-character, so
444
this returns exactly the same thing as self.weight().
445
446
EXAMPLE::
447
448
sage: OverconvergentModularForms(3, 0, 1/2).character()
449
0
450
sage: type(OverconvergentModularForms(3, 0, 1/2).character())
451
<class '...weightspace.AlgebraicWeight'>
452
sage: OverconvergentModularForms(3, 3, 1/2, char=DirichletGroup(3,QQ).0).character()
453
(3, 3, [-1])
454
"""
455
return self._wtchar
456
457
def weight(self):
458
r"""
459
Return the character of self. For overconvergent forms, the weight and
460
the character are unified into the concept of a weight-character, so
461
this returns exactly the same thing as self.character().
462
463
EXAMPLE::
464
465
sage: OverconvergentModularForms(3, 0, 1/2).weight()
466
0
467
sage: type(OverconvergentModularForms(3, 0, 1/2).weight())
468
<class '...weightspace.AlgebraicWeight'>
469
sage: OverconvergentModularForms(3, 3, 1/2, char=DirichletGroup(3,QQ).0).weight()
470
(3, 3, [-1])
471
"""
472
return self._wtchar
473
474
475
def normalising_factor(self):
476
r"""
477
The normalising factor `c` such that `g = c f` is a parameter for the
478
`r`-overconvergent disc in `X_0(p)`, where `f` is the standard
479
uniformiser.
480
481
EXAMPLE::
482
483
sage: L.<w> = Qp(7).extension(x^2 - 7)
484
sage: OverconvergentModularForms(7, 0, 1/4, base_ring=L).normalising_factor()
485
w + O(w^41)
486
"""
487
return self._const
488
489
def __cmp__(self, other):
490
r"""
491
Compare self to other.
492
493
EXAMPLES::
494
495
sage: OverconvergentModularForms(3, 12, 1/2) == ModularForms(3, 12)
496
False
497
sage: OverconvergentModularForms(3, 0, 1/2) == OverconvergentModularForms(3, 0, 1/3)
498
False
499
sage: OverconvergentModularForms(3, 0, 1/2) == OverconvergentModularForms(3, 0, 1/2, base_ring = Qp(3))
500
False
501
sage: OverconvergentModularForms(3, 0, 1/2) == OverconvergentModularForms(3, 0, 1/2)
502
True
503
"""
504
if not isinstance(other, OverconvergentModularFormsSpace):
505
return cmp(type(self), type(other))
506
else:
507
return cmp(self._params(), other._params())
508
509
def _params(self):
510
r"""
511
Return the parameters that define this module uniquely: prime, weight,
512
character, radius of overconvergence and base ring. Mostly used for
513
pickling.
514
515
EXAMPLES::
516
517
sage: L.<w> = Qp(7).extension(x^2 - 7)
518
sage: OverconvergentModularForms(7, 0, 1/4, base_ring=L)._params()
519
(7, 0, 1/4, Eisenstein Extension ..., 20, Dirichlet character modulo 7 of conductor 1 mapping 3 |--> 1)
520
521
"""
522
return (self.prime(), self.weight().k(), self.radius(), self.base_ring(), self.prec(), self.weight().chi())
523
524
def __reduce__(self):
525
r"""
526
Return the function and arguments used to construct self. Used for pickling.
527
528
EXAMPLES::
529
530
sage: L.<w> = Qp(7).extension(x^2 - 7)
531
sage: OverconvergentModularForms(7, 0, 1/4, base_ring=L).__reduce__()
532
(<function OverconvergentModularForms at ...>, (7, 0, 1/4, Eisenstein Extension ..., 20, Dirichlet character modulo 7 of conductor 1 mapping 3 |--> 1))
533
534
"""
535
return (OverconvergentModularForms, self._params())
536
537
def gen(self, i):
538
r"""
539
Return the ith module generator of self.
540
541
EXAMPLE::
542
543
sage: M = OverconvergentModularForms(3, 2, 1/2, prec=4)
544
sage: M.gen(0)
545
3-adic overconvergent modular form of weight-character 2 with q-expansion 1 + 12*q + 36*q^2 + 12*q^3 + O(q^4)
546
sage: M.gen(1)
547
3-adic overconvergent modular form of weight-character 2 with q-expansion 27*q + 648*q^2 + 7290*q^3 + O(q^4)
548
sage: M.gen(30)
549
3-adic overconvergent modular form of weight-character 2 with q-expansion O(q^4)
550
"""
551
552
return OverconvergentModularFormElement(self, gexp=self._gsr.gen()**i)
553
554
def _repr_(self):
555
r"""
556
Return a string representation of self.
557
558
EXAMPLES::
559
560
sage: OverconvergentModularForms(3, 0, 1/2)._repr_()
561
'Space of 3-adic 1/2-overconvergent modular forms of weight-character 0 over Rational Field'
562
"""
563
return "Space of %s-adic %s-overconvergent modular forms of weight-character %s over %s" % (self.prime(), self.radius(), self.weight(), self.base_ring())
564
565
def prime(self):
566
r"""
567
Return the residue characteristic of self, i.e. the prime `p` such that
568
this is a `p`-adic space.
569
570
EXAMPLES::
571
572
sage: OverconvergentModularForms(5, 12, 1/3).prime()
573
5
574
"""
575
return self._p
576
577
578
def radius(self):
579
r"""
580
The radius of overconvergence of this space.
581
582
EXAMPLE::
583
584
sage: OverconvergentModularForms(3, 0, 1/3).radius()
585
1/3
586
"""
587
return self._radius
588
589
def gens(self):
590
r"""
591
Return a generator object that iterates over the (infinite) set of
592
basis vectors of self.
593
594
EXAMPLES::
595
596
sage: o = OverconvergentModularForms(3, 12, 1/2)
597
sage: t = o.gens()
598
sage: t.next()
599
3-adic overconvergent modular form of weight-character 12 with q-expansion 1 - 32760/61203943*q - 67125240/61203943*q^2 - ...
600
sage: t.next()
601
3-adic overconvergent modular form of weight-character 12 with q-expansion 27*q + 19829193012/61203943*q^2 + 146902585770/61203943*q^3 + ...
602
"""
603
i = 0
604
while 1:
605
yield self.gen(i)
606
i += 1
607
608
def prec(self):
609
r"""
610
Return the series precision of self. Note that this is different from
611
the `p`-adic precision of the base ring.
612
613
EXAMPLE::
614
615
sage: OverconvergentModularForms(3, 0, 1/2).prec()
616
20
617
sage: OverconvergentModularForms(3, 0, 1/2,prec=40).prec()
618
40
619
"""
620
return self._prec
621
622
#####################################
623
# Element construction and coercion #
624
# (unfortunately not using #
625
# the new coercion model) #
626
#####################################
627
628
def __call__(self, input):
629
r"""
630
Create an element of this space. Allowable inputs are:
631
632
- elements of compatible spaces of modular forms or overconvergent
633
modular forms
634
635
- arbitrary power series in `q`
636
637
- lists of elements of the base ring (interpreted as vectors in the
638
basis given by self.gens()).
639
640
Precision may be specified by padding lists at the end with zeros;
641
inputs with a higher precision than the set precision of this space
642
will be rounded.
643
644
EXAMPLES::
645
646
From a `q`-expansion::
647
648
sage: M = OverconvergentModularForms(3, 0, 1/2, prec=5)
649
sage: R.<q> = QQ[[]]
650
sage: f=M(q + q^2 - q^3 + O(q^16)); f
651
3-adic overconvergent modular form of weight-character 0 with q-expansion q + q^2 - q^3 + O(q^5)
652
sage: M.coordinate_vector(f)
653
(0, 1/27, -11/729, 173/19683, -3172/531441)
654
655
From a list or a vector::
656
657
sage: M([1,0,1])
658
3-adic overconvergent modular form of weight-character 0 with q-expansion 1 + 729*q^2 + O(q^3)
659
sage: M([1,0,1,0,0])
660
3-adic overconvergent modular form of weight-character 0 with q-expansion 1 + 729*q^2 + 17496*q^3 + 236196*q^4 + O(q^5)
661
sage: f = M([1,0,1,0,0]); v = M.coordinate_vector(f); v
662
(1, 0, 1, 0, 0)
663
sage: M(v) == f
664
True
665
666
From a classical modular form::
667
668
sage: f = CuspForms(Gamma0(3), 12).0; f
669
q - 176*q^4 + 2430*q^5 + O(q^6)
670
sage: fdag = OverconvergentModularForms(3, 12, 1/3, prec=8)(f); fdag
671
3-adic overconvergent modular form of weight-character 12 with q-expansion q - 176*q^4 + 2430*q^5 - 5832*q^6 - 19336*q^7 + O(q^8)
672
sage: fdag.parent().coordinate_vector(f)*(1 + O(3^2))
673
(0, 3^-2 + O(3^0), 2*3^-3 + 2*3^-2 + O(3^-1), 3^-4 + 3^-3 + O(3^-2), 2 + 3 + O(3^2), 2*3 + 3^2 + O(3^3), 2*3^4 + 2*3^5 + O(3^6), 3^5 + 3^6 + O(3^7))
674
sage: OverconvergentModularForms(3, 6, 1/3)(f)
675
Traceback (most recent call last):
676
...
677
TypeError: Cannot create an element of 'Space of 3-adic ...' from element of incompatible space 'Cuspidal subspace ...'
678
679
We test that zero elements are handled properly::
680
681
sage: M(0)
682
3-adic overconvergent modular form of weight-character 0 with q-expansion O(q^5)
683
sage: M(O(q^3))
684
3-adic overconvergent modular form of weight-character 0 with q-expansion O(q^3)
685
686
We test coercion between spaces of different precision::
687
688
sage: M10 = OverconvergentModularForms(3, 0, 1/2, prec=10)
689
sage: f = M10.1
690
sage: M(f)
691
3-adic overconvergent modular form of weight-character 0 with q-expansion 27*q + 324*q^2 + 2430*q^3 + 13716*q^4 + O(q^5)
692
sage: M10(M(f))
693
3-adic overconvergent modular form of weight-character 0 with q-expansion 27*q + 324*q^2 + 2430*q^3 + 13716*q^4 + O(q^5)
694
"""
695
if isinstance(input, (int, long)):
696
input = ZZ(input)
697
698
if isinstance(input, OverconvergentModularFormElement):
699
if input.parent() is self:
700
return input
701
return self._coerce_from_ocmf(input)
702
703
elif isinstance(input, ModularFormElement):
704
if ( (input.level() == 1 or input.level().prime_factors() == [self.prime()])
705
and input.weight() == self.weight().k()
706
and input.character().primitive_character() == self.weight().chi().primitive_character()):
707
p = ZZ(self.prime())
708
nu = (input.level() == 1 and p/(p+1)) or (1 / (p + 1) * p**(2 - input.level().valuation(p)))
709
if self.radius() > nu:
710
raise ValueError, "Form is not overconvergent enough (form is only %s-overconvergent)" % nu
711
else:
712
return self(self._qsr(input.q_expansion(self.prec())))
713
else:
714
raise TypeError, "Cannot create an element of '%s' from element of incompatible space '%s'" % (self, input.parent())
715
716
elif isinstance(input, (list, tuple, Vector)):
717
v = list(input)
718
n = len(v)
719
return OverconvergentModularFormElement(self, gexp=self._gsr(v).add_bigoh(n), qexp=None)
720
721
elif self._qsr.has_coerce_map_from(input.parent()):
722
return OverconvergentModularFormElement(self, gexp=None, qexp=self._qsr(input))
723
724
else:
725
raise TypeError, "Don't know how to create an overconvergent modular form from %s" % input
726
727
@cached_method
728
def zero_element(self):
729
"""
730
Return the zero of this space.
731
732
EXAMPLE::
733
734
sage: K.<w> = Qp(13).extension(x^2-13); M = OverconvergentModularForms(13, 20, radius=1/2, base_ring=K)
735
sage: K.zero_element()
736
0
737
"""
738
return self(0)
739
740
def _coerce_from_ocmf(self, f):
741
r"""
742
Try to convert the overconvergent modular form `f` into an element of self. An error will be raised if this is
743
obviously nonsense.
744
745
EXAMPLES::
746
sage: M = OverconvergentModularForms(3, 0, 1/2)
747
sage: MM = M.base_extend(Qp(3))
748
sage: R.<q> = Qp(3)[[]]; f = MM(q + O(q^2)); f
749
3-adic overconvergent modular form of weight-character 0 with q-expansion (1 + O(3^20))*q + O(q^2)
750
sage: M._coerce_from_ocmf(f)
751
3-adic overconvergent modular form of weight-character 0 with q-expansion q + O(q^2)
752
sage: f in M # indirect doctest
753
True
754
"""
755
prime, weight, radius, base_ring, prec, char = f.parent()._params()
756
if (prime, weight, char) != (self.prime(), self.weight().k(), self.weight().chi()):
757
raise TypeError, "Cannot create an element of '%s' from element of incompatible space '%s'" % (self, input.parent())
758
return self(self._qsr(f.q_expansion()))
759
760
def _coerce_impl(self, x):
761
r"""
762
Canonical coercion of x into self. Here the possibilities for x are
763
more restricted.
764
765
TESTS::
766
767
sage: M = OverconvergentModularForms(3, 0, 1/2)
768
sage: MM = M.base_extend(Qp(3))
769
sage: MM.has_coerce_map_from(M) # indirect doctest
770
True
771
sage: MM.coerce(M.1)
772
3-adic overconvergent modular form of weight-character 0 with q-expansion (3^3 + O(3^23))*q + (3^4 + 3^5 + O(3^24))*q^2 ...
773
sage: M.has_coerce_map_from(MM)
774
False
775
sage: M.coerce(1)
776
3-adic overconvergent modular form of weight-character 0 with q-expansion 1 + O(q^20)
777
"""
778
if isinstance(x, OverconvergentModularFormElement) and self.base_ring().has_coerce_map_from(x.base_ring()):
779
return self._coerce_from_ocmf(x)
780
else:
781
return self.base_ring().coerce(x) * self.gen(0)
782
783
784
def coordinate_vector(self, x):
785
r"""
786
Write x as a vector with respect to the basis given by self.basis().
787
Here x must be an element of this space or something that can be
788
converted into one. If x has precision less than the default precision
789
of self, then the returned vector will be shorter.
790
791
EXAMPLES::
792
793
sage: M = OverconvergentModularForms(Gamma0(3), 0, 1/3, prec=4)
794
sage: M.coordinate_vector(M.gen(2))
795
(0, 0, 1, 0)
796
sage: q = QQ[['q']].gen(); M.coordinate_vector(q - q^2 + O(q^4))
797
(0, 1/9, -13/81, 74/243)
798
sage: M.coordinate_vector(q - q^2 + O(q^3))
799
(0, 1/9, -13/81)
800
"""
801
if hasattr(x, 'base_ring') and x.base_ring() != self.base_ring():
802
return self.base_extend(x.base_ring()).coordinate_vector(x)
803
804
if x.parent() != self:
805
x = self(x)
806
807
return vector(self.base_ring(), x.gexp().padded_list(x.gexp().prec()))
808
809
810
##########################################################
811
# Pointless routines required by parent class definition #
812
##########################################################
813
814
def ngens(self):
815
r"""
816
The number of generators of self (as a module over its base ring), i.e. infinity.
817
818
EXAMPLES::
819
820
sage: M = OverconvergentModularForms(2, 4, 1/6)
821
sage: M.ngens()
822
+Infinity
823
"""
824
return Infinity
825
826
def gens_dict(self):
827
r"""
828
Return a dictionary mapping the names of generators of this space to
829
their values. (Required by parent class definition.) As this does not
830
make any sense here, this raises a TypeError.
831
832
EXAMPLES::
833
834
sage: M = OverconvergentModularForms(2, 4, 1/6)
835
sage: M.gens_dict()
836
Traceback (most recent call last):
837
...
838
TypeError: gens_dict does not make sense as number of generators is infinite
839
"""
840
841
raise TypeError, "gens_dict does not make sense as number of generators is infinite"
842
843
#####################################
844
# Routines with some actual content #
845
#####################################
846
847
def hecke_operator(self, f, m):
848
r"""
849
Given an element `f` and an integer `m`, calculates the Hecke operator
850
`T_m` acting on `f`.
851
852
The input may be either a "bare" power series, or an
853
OverconvergentModularFormElement object; the return value will be of
854
the same type.
855
856
EXAMPLE::
857
858
sage: M = OverconvergentModularForms(3, 0, 1/2)
859
sage: f = M.1
860
sage: M.hecke_operator(f, 3)
861
3-adic overconvergent modular form of weight-character 0 with q-expansion 2430*q + 265356*q^2 + 10670373*q^3 + 249948828*q^4 + 4113612864*q^5 + 52494114852*q^6 + O(q^7)
862
sage: M.hecke_operator(f.q_expansion(), 3)
863
2430*q + 265356*q^2 + 10670373*q^3 + 249948828*q^4 + 4113612864*q^5 + 52494114852*q^6 + O(q^7)
864
"""
865
866
# This should just be an instance of hecke_operator_on_qexp but that
867
# won't accept arbitrary power series as input, although it's clearly
868
# supposed to, which seems rather to defy the point but never mind...
869
870
if f.parent() is self:
871
return self(self.hecke_operator(f.q_expansion(), m))
872
elif isinstance(f, OverconvergentModularFormElement):
873
if f.parent() is self.base_extend(f.parent().base_ring()):
874
return f.parent().hecke_operator(f, m)
875
else:
876
raise TypeError, "Not an element of this space"
877
else:
878
return hecke_operator_on_qexp(f, m, self.weight().k(), eps=self.weight().chi())
879
880
881
882
def _convert_to_basis(self, qexp):
883
r"""
884
Given a `q`-expansion, converts it to a vector in the basis of this
885
space, to the maximum possible precision (which is the minimum of the
886
`q`-adic precision of the `q`-expansion and the precision of self).
887
888
EXAMPLE::
889
890
sage: M = OverconvergentModularForms(2, 0, 1/2)
891
sage: R.<q> = QQ[[]]
892
sage: M._convert_to_basis(q + q^2 + O(q^4))
893
1/64*g - 23/4096*g^2 + 201/65536*g^3 + O(g^4)
894
"""
895
n = min(qexp.prec(), self.prec())
896
x = qexp
897
g = self._gsr.gen()
898
answer = self._gsr(0)
899
for i in xrange(n):
900
assert(x.valuation() >= i)
901
answer += (x[i] / self._basis_cache[i][i])*g**i
902
x = x - self._basis_cache[i] * answer[i]
903
return answer + O(g**n)
904
905
def hecke_matrix(self, m, n, use_recurrence = False, exact_arith = False):
906
r"""
907
Calculate the matrix of the `T_m` operator in the basis of this space,
908
truncated to an `n \times n` matrix. Conventions are that operators act
909
on the left on column vectors (this is the opposite of the conventions
910
of the sage.modules.matrix_morphism class!) Uses naive `q`-expansion
911
arguments if use_recurrence=False and uses the Kolberg style
912
recurrences if use_recurrence=True.
913
914
The argument "exact_arith" causes the computation to be done with
915
rational arithmetic, even if the base ring is an inexact `p`-adic ring.
916
This is useful as there can be precision loss issues (particularly with
917
use_recurrence=False).
918
919
EXAMPLES::
920
921
sage: OverconvergentModularForms(2, 0, 1/2).hecke_matrix(2, 4)
922
[ 1 0 0 0]
923
[ 0 24 64 0]
924
[ 0 32 1152 4608]
925
[ 0 0 3072 61440]
926
sage: OverconvergentModularForms(2, 12, 1/2, base_ring=pAdicField(2)).hecke_matrix(2, 3) * (1 + O(2^2))
927
[ 1 + O(2^2) 0 0]
928
[ 0 2^3 + O(2^5) 2^6 + O(2^8)]
929
[ 0 2^4 + O(2^6) 2^7 + 2^8 + O(2^9)]
930
sage: OverconvergentModularForms(2, 12, 1/2, base_ring=pAdicField(2)).hecke_matrix(2, 3, exact_arith=True)
931
[ 1 0 0]
932
[ 0 33881928/1414477 64]
933
[ 0 -192898739923312/2000745183529 1626332544/1414477]
934
"""
935
936
if exact_arith and not self.base_ring().is_exact():
937
return self.change_ring(QQ).hecke_matrix(m, n, use_recurrence)
938
939
M = MatrixSpace(self.base_ring(), n)
940
mat = M(0)
941
for j in xrange(min(n, self.prime())):
942
l = self._convert_to_basis(self.hecke_operator(self._basis_cache[j], m))
943
for i in xrange(n):
944
try:
945
mat[i,j] = l[i]
946
except IndexError:
947
if not self.weight().is_zero():
948
raise ValueError, "n is too large for current precision"
949
else:
950
if i <= self.prime() * j:
951
raise ValueError, "n is too large computing initial conds: can't work out u[%s, %s]" % (i,j)
952
else:
953
mat[i,j] = 0 # computations are exact for weight 0, and we know these terms are zero
954
if use_recurrence:
955
if m != self.prime(): raise ValueError, "Recurrence method not valid when m != p"
956
for j in xrange(self.prime(), n):
957
# can only apply recurrence if have i,j both >= p.
958
if j >= self.prec():
959
for i in xrange(self.prime()):
960
if self.weight() != 0:
961
raise ValueError, "n is too large for current precision"
962
else:
963
if j <= self.prime() * i:
964
raise ValueError, "n is too large computing initial conds: can't work out u[%s,%s]" % (i,j)
965
mat[i,j] = 0
966
967
968
else:
969
l = self._convert_to_basis(self.hecke_operator(self._basis_cache[j], m))
970
for i in xrange(self.prime()):
971
mat[i,j] = l[i]
972
for i in xrange(self.prime(), n):
973
for u in xrange(self.prime()):
974
for v in xrange(self.prime()):
975
mat[i,j] = mat[i,j] + mat[i-u-1, j-v-1]*self.recurrence_matrix()[u,v]
976
977
else:
978
if( n*self.prime() > self.prec()):
979
raise ValueError, "n is too large"
980
for j in xrange(self.prime(), n):
981
l = self._convert_to_basis(self.hecke_operator(self._basis_cache[j], m))
982
for i in xrange(n):
983
mat[i,j] = l[i]
984
return mat
985
986
def slopes(self, n, use_recurrence=False):
987
r"""
988
Compute the slopes of the `U_p` operator acting on self, using an n x n matrix.
989
990
EXAMPLES::
991
992
sage: OverconvergentModularForms(5,2,1/3,base_ring=Qp(5),prec=100).slopes(5)
993
[0, 2, 5, 6, 9]
994
sage: OverconvergentModularForms(2,1,1/3,char=DirichletGroup(4,QQ).0).slopes(5)
995
[0, 2, 4, 6, 8]
996
"""
997
if self.base_ring() == QQ:
998
slopelist=self.cps_u(n).truncate().newton_slopes(self.prime())
999
elif is_pAdicField(self.base_ring()):
1000
slopelist=self.cps_u(n).truncate().newton_slopes()
1001
else:
1002
print "slopes are only defined for base field QQ or a p-adic field"
1003
return [-i for i in slopelist]
1004
1005
def eigenfunctions(self, n, F = None, exact_arith=True):
1006
"""
1007
Calculate approximations to eigenfunctions of self. These are the
1008
eigenfunctions of self.hecke_matrix(p, n), which are approximations to
1009
the true eigenfunctions. Returns a list of
1010
OverconvergentModularFormElement objects, in increasing order of slope.
1011
1012
INPUT:
1013
1014
- ``n`` - integer. The size of the matrix to use.
1015
1016
- ``F`` - None, or a field over which to calculate eigenvalues. If the
1017
field is None, the current base ring is used. If the base ring is not
1018
a `p`-adic ring, an error will be raised.
1019
1020
- ``exact_arith`` - True or False (default True). If True, use exact
1021
rational arithmetic to calculate the matrix of the `U` operator and its
1022
characteristic power series, even when the base ring is an inexact
1023
`p`-adic ring. This is typically slower, but more numerically stable.
1024
1025
NOTE: Try using ``set_verbose(1, 'sage/modular/overconvergent')`` to
1026
get more feedback on what is going on in this algorithm. For even more
1027
feedback, use 2 instead of 1.
1028
1029
EXAMPLES::
1030
1031
sage: X = OverconvergentModularForms(2, 2, 1/6).eigenfunctions(8, Qp(2, 100))
1032
sage: X[1]
1033
2-adic overconvergent modular form of weight-character 2 with q-expansion (1 + O(2^74))*q + (2^4 + 2^5 + 2^9 + 2^10 + 2^12 + 2^13 + 2^15 + 2^17 + 2^19 + 2^20 + 2^21 + 2^23 + 2^28 + 2^30 + 2^31 + 2^32 + 2^34 + 2^36 + 2^37 + 2^39 + 2^40 + 2^43 + 2^44 + 2^45 + 2^47 + 2^48 + 2^52 + 2^53 + 2^54 + 2^55 + 2^56 + 2^58 + 2^59 + 2^60 + 2^61 + 2^67 + 2^68 + 2^70 + 2^71 + 2^72 + 2^74 + 2^76 + O(2^78))*q^2 + (2^2 + 2^7 + 2^8 + 2^9 + 2^12 + 2^13 + 2^16 + 2^17 + 2^21 + 2^23 + 2^25 + 2^28 + 2^33 + 2^34 + 2^36 + 2^37 + 2^42 + 2^45 + 2^47 + 2^49 + 2^50 + 2^51 + 2^54 + 2^55 + 2^58 + 2^60 + 2^61 + 2^67 + 2^71 + 2^72 + O(2^76))*q^3 + (2^8 + 2^11 + 2^14 + 2^19 + 2^21 + 2^22 + 2^24 + 2^25 + 2^26 + 2^27 + 2^28 + 2^29 + 2^32 + 2^33 + 2^35 + 2^36 + 2^44 + 2^45 + 2^46 + 2^47 + 2^49 + 2^50 + 2^53 + 2^54 + 2^55 + 2^56 + 2^57 + 2^60 + 2^63 + 2^66 + 2^67 + 2^69 + 2^74 + 2^76 + 2^79 + 2^80 + 2^81 + O(2^82))*q^4 + (2 + 2^2 + 2^9 + 2^13 + 2^15 + 2^17 + 2^19 + 2^21 + 2^23 + 2^26 + 2^27 + 2^28 + 2^30 + 2^33 + 2^34 + 2^35 + 2^36 + 2^37 + 2^38 + 2^39 + 2^41 + 2^42 + 2^43 + 2^45 + 2^58 + 2^59 + 2^60 + 2^61 + 2^62 + 2^63 + 2^65 + 2^66 + 2^68 + 2^69 + 2^71 + 2^72 + O(2^75))*q^5 + (2^6 + 2^7 + 2^15 + 2^16 + 2^21 + 2^24 + 2^25 + 2^28 + 2^29 + 2^33 + 2^34 + 2^37 + 2^44 + 2^45 + 2^48 + 2^50 + 2^51 + 2^54 + 2^55 + 2^57 + 2^58 + 2^59 + 2^60 + 2^64 + 2^69 + 2^71 + 2^73 + 2^75 + 2^78 + O(2^80))*q^6 + (2^3 + 2^8 + 2^9 + 2^10 + 2^11 + 2^12 + 2^14 + 2^15 + 2^17 + 2^19 + 2^20 + 2^21 + 2^23 + 2^25 + 2^26 + 2^34 + 2^37 + 2^38 + 2^39 + 2^40 + 2^41 + 2^45 + 2^47 + 2^49 + 2^51 + 2^53 + 2^54 + 2^55 + 2^57 + 2^58 + 2^59 + 2^60 + 2^61 + 2^66 + 2^69 + 2^70 + 2^71 + 2^74 + 2^76 + O(2^77))*q^7 + O(q^8)
1034
sage: [x.slope() for x in X]
1035
[0, 4, 8, 14, 16, 18, 26, 30]
1036
"""
1037
1038
if F is None:
1039
F = self.base_ring()
1040
1041
if F.is_exact():
1042
#raise TypeError, "cannot calculate eigenfunctions over exact base fields"
1043
F = pAdicField(self.prime(), 100)
1044
1045
m = self.hecke_matrix(self.prime(), n, use_recurrence=True, exact_arith=exact_arith)
1046
cp = m.charpoly()
1047
eigenvalues = cp.roots(F)
1048
eigenfunctions = []
1049
verbose("Expected %s eigenvalues, got %s" % (n, len(eigenvalues)))
1050
for (r, d) in eigenvalues:
1051
v = r.valuation()
1052
if d != 1:
1053
#print "Warning: Root occurs with multiplicity"
1054
continue
1055
1056
mr = (m._pari_() - r._pari_())
1057
# Annoying thing: r isn't quite as precise as it claims to be
1058
# (bug reported to sage-support list)
1059
while F(mr.matdet()) != 0:
1060
verbose("p-adic solver returned wrong result in slope %s; refining" % r.valuation(), level=2)
1061
r = r - cp(r)/cp.derivative()(r)
1062
mr2 = (m._pari_() - r._pari_())
1063
if mr2.matdet().valuation(self.prime()) > mr.matdet().valuation(self.prime()):
1064
mr = mr2
1065
else:
1066
mr = None
1067
break
1068
1069
if mr is None:
1070
verbose("Unable to calculate exact root in slope %s" % r.valuation())
1071
continue
1072
1073
# now calculate the kernel using PARI
1074
1075
v = mr._pari_().matker()
1076
1077
if repr(v) == "[;]":
1078
verbose("PARI returned empty eigenspace in slope %s" % r.valuation())
1079
continue
1080
# Can't happen? Does PARI always return a
1081
# nonempty kernel for matrices that have det
1082
# indistinguishable from 0?
1083
1084
if v.ncols() != 1:
1085
verbose("PARI returned non-simple eigenspace in slope %s" % r.valuation())
1086
continue
1087
1088
gexp = self._gsr(0)
1089
for i in xrange(v.nrows()):
1090
gexp += self._gsr.gen()**i * F(v[i,0])
1091
gexp = gexp + O(self._gsr.gen()**int(v.nrows()))
1092
1093
if gexp[0] != 0:
1094
gexp = gexp/gexp[0]
1095
elif gexp[1] != 0:
1096
gexp = gexp/gexp[1]/self._const
1097
# This is slightly subtle. We want all eigenfunctions to have q-exps in Z_p.
1098
# Normalising the q-term to be 1 doesn't work for the Eisenstein series if
1099
# we're in the 0 component of weight-character space. But normalising the const term
1100
# to 1 works as *none of the small primes we deal with are irregular*! :-)
1101
else:
1102
raise ValueError, "Constant and linear terms both zero!"
1103
# if this gets called something is very wrong.
1104
1105
efunc = OverconvergentModularFormElement(self.base_extend(F), gexp=gexp)
1106
efunc._notify_eigen(r)
1107
assert efunc.is_integral()
1108
# This sometimes fails if n is too large -- last row of matrix fills
1109
# up with garbage. I don't know why. XXX FIX THIS XXX
1110
eigenfunctions.append((r.valuation(), efunc))
1111
1112
eigenfunctions.sort() # sort by slope
1113
return [f for _,f in eigenfunctions]
1114
1115
def recurrence_matrix(self, use_smithline=True):
1116
r"""
1117
Return the recurrence matrix satisfied by the coefficients of `U`,
1118
that is a matrix `R =(r_{rs})_{r,s=1 \dots p}` such that `u_{ij} =
1119
\sum_{r,s=1}^p r_{rs} u_{i-r, j-s}`. Uses an elegant construction which
1120
I believe is due to Smithline. See [Loe2007]_.
1121
1122
EXAMPLES::
1123
1124
sage: OverconvergentModularForms(2, 0, 0).recurrence_matrix()
1125
[ 48 1]
1126
[4096 0]
1127
sage: OverconvergentModularForms(2, 0, 1/2).recurrence_matrix()
1128
[48 64]
1129
[64 0]
1130
sage: OverconvergentModularForms(3, 0, 0).recurrence_matrix()
1131
[ 270 36 1]
1132
[ 26244 729 0]
1133
[531441 0 0]
1134
sage: OverconvergentModularForms(5, 0, 0).recurrence_matrix()
1135
[ 1575 1300 315 30 1]
1136
[ 162500 39375 3750 125 0]
1137
[ 4921875 468750 15625 0 0]
1138
[ 58593750 1953125 0 0 0]
1139
[244140625 0 0 0 0]
1140
sage: OverconvergentModularForms(7, 0, 0).recurrence_matrix()
1141
[ 4018 8624 5915 1904 322 28 1]
1142
[ 422576 289835 93296 15778 1372 49 0]
1143
[ 14201915 4571504 773122 67228 2401 0 0]
1144
[ 224003696 37882978 3294172 117649 0 0 0]
1145
[ 1856265922 161414428 5764801 0 0 0 0]
1146
[ 7909306972 282475249 0 0 0 0 0]
1147
[13841287201 0 0 0 0 0 0]
1148
sage: OverconvergentModularForms(13, 0, 0).recurrence_matrix()
1149
[ 15145 124852 354536 ...
1150
"""
1151
1152
if self._cached_recurrence_matrix is not None:
1153
return self._cached_recurrence_matrix
1154
1155
MM = OverconvergentModularForms(self.prime(), 0, 0, base_ring=QQ)
1156
m = MM._discover_recurrence_matrix(use_smithline = True).base_extend(self.base_ring())
1157
1158
r = diagonal_matrix([self._const**i for i in xrange(self.prime())])
1159
self._cached_recurrence_matrix = (r**(-1)) * m * r
1160
self._cached_recurrence_matrix.set_immutable()
1161
return self._cached_recurrence_matrix
1162
1163
1164
def _discover_recurrence_matrix(self, use_smithline=True):
1165
r"""
1166
Does hard work of calculating recurrence matrix, which is cached to avoid doing this every time.
1167
1168
EXAMPLE::
1169
1170
sage: o = OverconvergentModularForms(3,12,0)
1171
sage: o._discover_recurrence_matrix() == o.recurrence_matrix()
1172
True
1173
"""
1174
1175
(f_ring, f) = PolynomialRing(self.base_ring(), "f").objgen()
1176
1177
if use_smithline:
1178
# Compute Smithline's polynomial H_p
1179
jq = self._qsr(j_invariant_qexp(1+self.prime()).shift(1).power_series())
1180
1181
# avoid dividing by q so as not to instantiate a Laurent series
1182
h = self._uniformiser.shift(-1) * jq
1183
fi = self._qsr(1)
1184
coeffs = []
1185
for i in xrange(self.prime()+2):
1186
if not h.valuation() >= i:
1187
raise ValueError, "Something strange is happening here"
1188
1189
coeffs.append(h[i] / fi[i])
1190
h = h - coeffs[-1] * fi
1191
fi = fi*self._uniformiser
1192
SmiH = f_ring(coeffs)
1193
assert SmiH.degree() == self.prime() + 1
1194
# print "Smithline's H_p is: ",SmiH, " = ",SmiH.factor()
1195
xyring = PolynomialRing(self.base_ring(), ["x","y"], 2)
1196
x,y = xyring.gens()
1197
cc = self.prime() ** (-12/(self.prime() - 1))
1198
bigI = x*SmiH(y*cc)- y*cc*SmiH(x)
1199
smallI = xyring(bigI / (x - cc*y))
1200
# print "Smithline's I_p is: ", smallI
1201
r = matrix(ZZ, self.prime(), self.prime())
1202
for i in xrange(self.prime()):
1203
for j in xrange(self.prime()):
1204
r[i,j] = -smallI[i+1, j+1]
1205
return r
1206
else:
1207
# compute from U(f^j) for small j via Newton's identities
1208
# to be implemented when I can remember Newton's identities!
1209
raise NotImplementedError
1210
1211
def cps_u(self, n, use_recurrence=False):
1212
r"""
1213
Compute the characteristic power series of `U_p` acting on self, using
1214
an n x n matrix.
1215
1216
EXAMPLES::
1217
1218
sage: OverconvergentModularForms(3, 16, 1/2, base_ring=Qp(3)).cps_u(4)
1219
1 + O(3^20) + (2 + 2*3 + 2*3^2 + 2*3^4 + 3^5 + 3^6 + 3^7 + 3^11 + 3^12 + 2*3^14 + 3^16 + 3^18 + O(3^19))*T + (2*3^3 + 3^5 + 3^6 + 3^7 + 2*3^8 + 2*3^9 + 2*3^10 + 3^11 + 3^12 + 2*3^13 + 2*3^16 + 2*3^18 + O(3^19))*T^2 + (2*3^15 + 2*3^16 + 2*3^19 + 2*3^20 + 2*3^21 + O(3^22))*T^3 + (3^17 + 2*3^18 + 3^19 + 3^20 + 3^22 + 2*3^23 + 2*3^25 + 3^26 + O(3^27))*T^4
1220
sage: OverconvergentModularForms(3, 16, 1/2, base_ring=Qp(3), prec=30).cps_u(10)
1221
1 + O(3^20) + (2 + 2*3 + 2*3^2 + 2*3^4 + 3^5 + 3^6 + 3^7 + 2*3^15 + O(3^16))*T + (2*3^3 + 3^5 + 3^6 + 3^7 + 2*3^8 + 2*3^9 + 2*3^10 + 2*3^11 + 2*3^12 + 2*3^13 + 3^14 + 3^15 + O(3^16))*T^2 + (3^14 + 2*3^15 + 2*3^16 + 3^17 + 3^18 + O(3^19))*T^3 + (3^17 + 2*3^18 + 3^19 + 3^20 + 3^21 + O(3^24))*T^4 + (3^29 + 2*3^32 + O(3^33))*T^5 + (2*3^44 + O(3^45))*T^6 + (2*3^59 + O(3^60))*T^7 + (2*3^78 + O(3^79))*T^8
1222
1223
NOTES:
1224
1225
Uses the Hessenberg form of the Hecke matrix to compute the
1226
characteristic polynomial. Because of the use of relative precision
1227
here this tends to give better precision in the p-adic coefficients.
1228
"""
1229
m = self.hecke_matrix(self.prime(), n, use_recurrence)
1230
A = PowerSeriesRing(self.base_ring(),'T')
1231
1232
# From a conversation with David Loeffler, apparently self.base_ring()
1233
# is either the field of rational numbers or some p-adic field. In the
1234
# first case we want to use the linbox algorithm, and in the second
1235
# case the Hessenberg form algorithm.
1236
#
1237
if self.base_ring().is_exact():
1238
g = A(m.charpoly('T').reverse())
1239
else:
1240
g = A(m.charpoly('T', "hessenberg").reverse())
1241
1242
return g
1243
1244
class OverconvergentModularFormElement(ModuleElement):
1245
r"""
1246
A class representing an element of a space of overconvergent modular forms.
1247
1248
EXAMPLE::
1249
1250
sage: K.<w> = Qp(5).extension(x^7 - 5); s = OverconvergentModularForms(5, 6, 1/21, base_ring=K).0
1251
sage: s == loads(dumps(s))
1252
True
1253
"""
1254
1255
def __init__(self, parent, gexp=None, qexp=None):
1256
r"""
1257
Create an element of this space.
1258
1259
EXAMPLE::
1260
1261
sage: OverconvergentModularForms(3, 2, 1/6,prec=5).an_element() # indirect doctest
1262
3-adic overconvergent modular form of weight-character 2 with q-expansion 3*q + 72*q^2 + 810*q^3 + 6096*q^4 + O(q^5)
1263
"""
1264
1265
ModuleElement.__init__(self, parent)
1266
1267
self._p = self.parent().prime()
1268
#self.weight = self.parent().weight
1269
if (gexp is None and qexp is None) or (gexp is not None and qexp is not None):
1270
raise ValueError, "Must supply exactly one of a q-expansion and a g-expansion"
1271
if gexp is not None:
1272
self._gexp = gexp.add_bigoh(self.parent().prec())
1273
self._qexp = sum([self.parent()._basis_cache[i] * gexp[i] for i in xrange(min(gexp.prec(), self.parent().prec()))])
1274
self._qexp = self._qexp.add_bigoh(self._gexp.prec())
1275
else: # qexp is not None
1276
self._qexp = qexp.add_bigoh(self.parent().prec())
1277
self._gexp = self.parent()._convert_to_basis(self._qexp)
1278
1279
self._is_eigen = False
1280
self._eigenvalue = None
1281
self._slope = None
1282
1283
1284
def _add_(self, other):
1285
r"""
1286
Add self to other (where other has the same parent as self).
1287
1288
EXAMPLES::
1289
1290
sage: M = OverconvergentModularForms(2, 12, 1/6)
1291
sage: f = M.0
1292
sage: f + f # indirect doctest
1293
2-adic overconvergent modular form of weight-character 12 with q-expansion 2 - 131040/1414477*q ...
1294
"""
1295
return OverconvergentModularFormElement(self.parent(), gexp = self.gexp() + other.gexp())
1296
1297
def _lmul_(self, x):
1298
r"""
1299
Left multiplication by other.
1300
1301
EXAMPLES::
1302
1303
sage: M = OverconvergentModularForms(2, 12, 1/6)
1304
sage: f = M.0
1305
sage: 2*f # indirect doctest
1306
2-adic overconvergent modular form of weight-character 12 with q-expansion 2 - 131040/1414477*q ...
1307
1308
"""
1309
return OverconvergentModularFormElement(self.parent(), gexp = x * self.gexp())
1310
1311
def _rmul_(self, x):
1312
r"""
1313
Right multiplication by other.
1314
1315
EXAMPLES::
1316
1317
sage: M = OverconvergentModularForms(2, 12, 1/6)
1318
sage: f = M.0
1319
sage: f * 3 # indirect doctest
1320
2-adic overconvergent modular form of weight-character 12 with q-expansion 3 - 196560/1414477*q ...
1321
1322
"""
1323
return OverconvergentModularFormElement(self.parent(), gexp = x * self.gexp())
1324
1325
def prec(self):
1326
r"""
1327
Return the series expansion precision of this overconvergent modular
1328
form. (This is not the same as the `p`-adic precision of the
1329
coefficients.)
1330
1331
EXAMPLE::
1332
1333
sage: OverconvergentModularForms(5, 6, 1/3,prec=15).gen(1).prec()
1334
15
1335
"""
1336
return self.gexp().prec()
1337
1338
def is_eigenform(self):
1339
r"""
1340
Return True if this is an eigenform. At present this returns False
1341
unless this element was explicitly flagged as an eigenform, using the
1342
_notify_eigen function.
1343
1344
EXAMPLE::
1345
1346
sage: M = OverconvergentModularForms(3, 0, 1/2)
1347
sage: f = M.eigenfunctions(3)[1]
1348
sage: f.is_eigenform()
1349
True
1350
sage: M.gen(4).is_eigenform()
1351
False
1352
"""
1353
return self._is_eigen
1354
1355
def slope(self):
1356
r"""
1357
Return the slope of this eigenform, i.e. the valuation of its
1358
`U_p`-eigenvalue. Raises an error unless this element was explicitly
1359
flagged as an eigenform, using the _notify_eigen function.
1360
1361
EXAMPLE::
1362
1363
sage: M = OverconvergentModularForms(3, 0, 1/2)
1364
sage: f = M.eigenfunctions(3)[1]
1365
sage: f.slope()
1366
2
1367
sage: M.gen(4).slope()
1368
Traceback (most recent call last):
1369
...
1370
TypeError: slope only defined for eigenfunctions
1371
"""
1372
if not self.is_eigenform(): raise TypeError, "slope only defined for eigenfunctions"
1373
return self._slope
1374
1375
def eigenvalue(self):
1376
r"""
1377
Return the `U_p`-eigenvalue of this eigenform. Raises an error unless
1378
this element was explicitly flagged as an eigenform, using the
1379
_notify_eigen function.
1380
1381
EXAMPLE::
1382
1383
sage: M = OverconvergentModularForms(3, 0, 1/2)
1384
sage: f = M.eigenfunctions(3)[1]
1385
sage: f.eigenvalue()
1386
3^2 + 3^4 + 2*3^6 + 3^7 + 3^8 + 2*3^9 + 2*3^10 + 3^12 + 3^16 + 2*3^17 + 3^18 + 3^20 + 2*3^21 + 3^22 + 2*3^23 + 3^25 + 3^26 + 2*3^27 + 2*3^29 + 3^30 + 3^31 + 3^32 + 3^33 + 3^34 + 3^36 + 3^40 + 2*3^41 + 3^43 + 3^44 + 3^45 + 3^46 + 3^48 + 3^49 + 3^50 + 2*3^51 + 3^52 + 3^54 + 2*3^57 + 2*3^59 + 3^60 + 3^61 + 2*3^63 + 2*3^66 + 2*3^67 + 3^69 + 2*3^72 + 3^74 + 2*3^75 + 3^76 + 2*3^77 + 2*3^78 + 2*3^80 + 3^81 + 2*3^82 + 3^84 + 2*3^85 + 2*3^86 + 3^87 + 3^88 + 2*3^89 + 2*3^91 + 3^93 + 3^94 + 3^95 + 3^96 + 3^98 + 2*3^99 + O(3^100)
1387
sage: M.gen(4).eigenvalue()
1388
Traceback (most recent call last):
1389
...
1390
TypeError: eigenvalue only defined for eigenfunctions
1391
"""
1392
1393
if not self.is_eigenform(): raise TypeError, "eigenvalue only defined for eigenfunctions"
1394
return self._eigenvalue
1395
1396
def q_expansion(self, prec=None):
1397
r"""
1398
Return the `q`-expansion of self, to as high precision as it is known.
1399
1400
EXAMPLE::
1401
1402
sage: OverconvergentModularForms(3, 4, 1/2).gen(0).q_expansion()
1403
1 - 120/13*q - 1080/13*q^2 - 120/13*q^3 - 8760/13*q^4 - 15120/13*q^5 - 1080/13*q^6 - 41280/13*q^7 - 5400*q^8 - 120/13*q^9 - 136080/13*q^10 - 159840/13*q^11 - 8760/13*q^12 - 263760/13*q^13 - 371520/13*q^14 - 15120/13*q^15 - 561720/13*q^16 - 45360*q^17 - 1080/13*q^18 - 823200/13*q^19 + O(q^20)
1404
"""
1405
if prec is None:
1406
return self._qexp
1407
elif prec > self.prec():
1408
raise ValueError
1409
else:
1410
return self._qexp.add_bigoh(prec)
1411
1412
def gexp(self):
1413
r"""
1414
Return the formal power series in `g` corresponding to this
1415
overconvergent modular form (so the result is `F` where this modular form
1416
is `E_k^\ast \times F(g)`, where `g` is the appropriately normalised
1417
parameter of `X_0(p)`).
1418
1419
EXAMPLE::
1420
1421
sage: M = OverconvergentModularForms(3, 0, 1/2)
1422
sage: f = M.eigenfunctions(3)[1]
1423
sage: f.gexp()
1424
(3^-3 + O(3^95))*g + (3^-1 + 1 + 2*3 + 3^2 + 2*3^3 + 3^5 + 3^7 + 3^10 + 3^11 + 3^14 + 3^15 + 3^16 + 2*3^19 + 3^21 + 3^22 + 2*3^23 + 2*3^24 + 3^26 + 2*3^27 + 3^29 + 3^31 + 3^34 + 2*3^35 + 2*3^36 + 3^38 + 2*3^39 + 3^41 + 2*3^42 + 2*3^43 + 2*3^44 + 2*3^46 + 2*3^47 + 3^48 + 2*3^49 + 2*3^50 + 3^51 + 2*3^54 + 2*3^55 + 2*3^56 + 3^57 + 2*3^58 + 2*3^59 + 2*3^60 + 3^61 + 3^62 + 3^63 + 3^64 + 2*3^65 + 3^67 + 3^68 + 2*3^69 + 3^70 + 2*3^71 + 2*3^74 + 3^76 + 2*3^77 + 3^78 + 2*3^79 + 2*3^80 + 3^84 + 2*3^85 + 2*3^86 + 3^88 + 2*3^89 + 3^91 + 3^92 + 2*3^94 + 3^95 + O(3^97))*g^2 + O(g^3)
1425
"""
1426
return self._gexp
1427
1428
def coordinates(self, prec=None):
1429
r"""
1430
Return the coordinates of this modular form in terms of the basis of this space.
1431
1432
EXAMPLES::
1433
1434
sage: M = OverconvergentModularForms(3, 0, 1/2, prec=15)
1435
sage: f = (M.0 + M.3); f.coordinates()
1436
[1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
1437
sage: f.coordinates(6)
1438
[1, 0, 0, 1, 0, 0]
1439
sage: OverconvergentModularForms(3, 0, 1/6)(f).coordinates(6)
1440
[1, 0, 0, 729, 0, 0]
1441
sage: f.coordinates(100)
1442
Traceback (most recent call last):
1443
...
1444
ValueError: Precision too large for space
1445
"""
1446
1447
1448
if prec > self.prec(): raise ValueError, "Precision too large for space"
1449
if prec is None: prec = self.prec()
1450
return self._gexp.padded_list(prec)
1451
1452
def prime(self):
1453
r"""
1454
If this is a `p`-adic modular form, return `p`.
1455
1456
EXAMPLE::
1457
1458
sage: OverconvergentModularForms(2, 0, 1/2).an_element().prime()
1459
2
1460
"""
1461
return self._p
1462
1463
def _notify_eigen(self, eigenvalue):
1464
"""
1465
Flags this element as an eigenform. It then remembers some extra data.
1466
1467
EXAMPLE::
1468
1469
sage: OverconvergentModularForms(3, 16, 1/3).eigenfunctions(4) # indirect doctest
1470
[...]
1471
"""
1472
self._is_eigen = True
1473
self._eigenvalue = eigenvalue
1474
self._slope = eigenvalue.normalized_valuation()
1475
1476
def is_integral(self):
1477
r"""
1478
Test whether or not this element has `q`-expansion coefficients that
1479
are `p`-adically integral. This should always be the case with eigenfunctions, but sometimes
1480
if n is very large this breaks down for unknown reasons!
1481
1482
EXAMPLE::
1483
1484
sage: M = OverconvergentModularForms(2, 0, 1/3)
1485
sage: q = QQ[['q']].gen()
1486
sage: M(q - 17*q^2 + O(q^3)).is_integral()
1487
True
1488
sage: M(q - q^2/2 + 6*q^7 + O(q^9)).is_integral()
1489
False
1490
"""
1491
1492
for co in self.q_expansion().list():
1493
if (co * (1 + O(self.prime()))).valuation() < 0: # have to force it into ZZ_p
1494
return False
1495
return True
1496
1497
def _repr_(self):
1498
r"""
1499
String representation of self.
1500
1501
EXAMPLES::
1502
1503
sage: o=OverconvergentModularForms(3, 0, 1/2)
1504
sage: o([1, 0, 1, 3])._repr_()
1505
'3-adic overconvergent modular form of weight-character 0 with q-expansion 1 + 729*q^2 + 76545*q^3 + O(q^4)'
1506
"""
1507
return "%s-adic overconvergent modular form of weight-character %s with q-expansion %s" % (self.prime(), self.weight(), self.q_expansion())
1508
1509
def __cmp__(self, other):
1510
r"""
1511
Compare self to other.
1512
1513
EXAMPLES::
1514
1515
sage: o=OverconvergentModularForms(3, 0, 1/2)
1516
sage: o([1, 1, 1, 0, 0, 0, 0]) == o([2, 1, 0])
1517
False
1518
sage: o([1, 1, 1, 0, 0, 0, 0]) == o([1,1])
1519
True
1520
"""
1521
1522
if other.parent() != self.parent():
1523
raise ArithmeticError, "Can't get here!"
1524
return cmp(self.gexp(), other.gexp())
1525
1526
def r_ord(self, r):
1527
r"""
1528
The `p`-adic valuation of the norm of self on the `r`-overconvergent region.
1529
1530
EXAMPLES::
1531
1532
sage: o=OverconvergentModularForms(3, 0, 1/2)
1533
sage: t = o([1, 1, 1/3])
1534
sage: t.r_ord(1/2)
1535
1
1536
sage: t.r_ord(2/3)
1537
3
1538
"""
1539
ord = -Infinity
1540
p = self.prime()
1541
s = self.parent().radius()
1542
1543
F = self.parent().base_ring()
1544
if not is_pAdicField(F):
1545
F = pAdicField(p)
1546
1547
for i in xrange(self.prec()):
1548
ord = max( ord, 12/ZZ(p - 1)*i*(r - s) - F(self.gexp()[i]).normalized_valuation())
1549
1550
return ord
1551
1552
def valuation(self):
1553
r"""
1554
Return the `p`-adic valuation of this form (i.e. the minimum of the
1555
`p`-adic valuations of its coordinates).
1556
1557
EXAMPLES::
1558
1559
sage: M = OverconvergentModularForms(3, 0, 1/2)
1560
sage: (M.7).valuation()
1561
0
1562
sage: (3^18 * (M.2)).valuation()
1563
18
1564
"""
1565
if is_pAdicField(self.parent().base_ring()):
1566
v = lambda u: u.normalized_valuation()
1567
else:
1568
v = lambda u: u.valuation(self.parent().prime())
1569
return min([v(x) for x in self.gexp().list()])
1570
1571
def governing_term(self, r):
1572
r"""
1573
The degree of the series term with largest norm on the `r`-overconvergent region.
1574
1575
EXAMPLES::
1576
1577
sage: o=OverconvergentModularForms(3, 0, 1/2)
1578
sage: f=o.eigenfunctions(10)[1]
1579
sage: f.governing_term(1/2)
1580
1
1581
"""
1582
p = self.prime()
1583
F = self.parent().base_ring()
1584
if not is_pAdicField(F):
1585
F = pAdicField(p)
1586
s = self.parent().radius()
1587
p = self.prime()
1588
1589
for i in xrange(self.gexp().prec()):
1590
if 12/ZZ(p - 1)*i*(r - s) - F(self.gexp()[i]).normalized_valuation() == self.r_ord(r):
1591
return i
1592
raise Exception, "Can't get here"
1593
1594
def valuation_plot(self, rmax = None):
1595
r"""
1596
Draw a graph depicting the growth of the norm of this overconvergent
1597
modular form as it approaches the boundary of the overconvergent
1598
region.
1599
1600
EXAMPLE::
1601
1602
sage: o=OverconvergentModularForms(3, 0, 1/2)
1603
sage: f=o.eigenfunctions(4)[1]
1604
sage: f.valuation_plot()
1605
"""
1606
if rmax is None: rmax = ZZ(self.prime())/ZZ(1 + self.prime())
1607
return plot(self.r_ord, (0, rmax) )
1608
1609
def weight(self):
1610
r"""
1611
Return the weight of this overconvergent modular form.
1612
1613
EXAMPLES::
1614
1615
sage: M = OverconvergentModularForms(13, 10, 1/2, base_ring = Qp(13).extension(x^2 - 13,names='a'))
1616
sage: M.gen(0).weight()
1617
10
1618
"""
1619
return self.parent().weight()
1620
1621
def additive_order(self):
1622
r"""
1623
Return the additive order of this element (required attribute for all
1624
elements deriving from sage.modules.ModuleElement).
1625
1626
EXAMPLES::
1627
1628
sage: M = OverconvergentModularForms(13, 10, 1/2, base_ring = Qp(13).extension(x^2 - 13,names='a'))
1629
sage: M.gen(0).additive_order()
1630
+Infinity
1631
sage: M(0).additive_order()
1632
1
1633
"""
1634
from sage.rings.infinity import Infinity
1635
if self.is_zero(): return ZZ(1)
1636
else: return Infinity
1637
1638
def base_extend(self, R):
1639
r"""
1640
Return a copy of self but with coefficients in the given ring.
1641
1642
EXAMPLES::
1643
1644
sage: M = OverconvergentModularForms(7, 10, 1/2, prec=5)
1645
sage: f = M.1
1646
sage: f.base_extend(Qp(7, 4))
1647
7-adic overconvergent modular form of weight-character 10 with q-expansion (7 + O(7^5))*q + (6*7 + 4*7^2 + 7^3 + 6*7^4 + O(7^5))*q^2 + (5*7 + 5*7^2 + 7^4 + O(7^5))*q^3 + (7^2 + 4*7^3 + 3*7^4 + 2*7^5 + O(7^6))*q^4 + O(q^5)
1648
"""
1649
S = self.parent().base_extend(R)
1650
return S(self)
1651
1652
def _pari_(self):
1653
r"""
1654
Return the Pari object corresponding to self, which is just the
1655
`q`-expansion of self as a formal power series.
1656
1657
EXAMPLES::
1658
1659
sage: f = OverconvergentModularForms(3, 0, 1/2).1
1660
sage: pari(f) # indirect doctest
1661
27*q + 324*q^2 + 2430*q^3 + 13716*q^4 + 64557*q^5 + 265356*q^6 + 983556*q^7 + 3353076*q^8 + 10670373*q^9 + 32031288*q^10 + 91455804*q^11 + 249948828*q^12 + 657261999*q^13 + 1669898592*q^14 + 4113612864*q^15 + 9853898292*q^16 + 23010586596*q^17 + 52494114852*q^18 + 117209543940*q^19 + O(q^20)
1662
sage: pari(f.base_extend(Qp(3))) # indirect doctest
1663
(3^3 + O(3^23))*q + (3^4 + 3^5 + O(3^24))*q^2 + (3^5 + 3^7 + O(3^25))*q^3 + (3^3 + 3^4 + 2*3^5 + 2*3^8 + O(3^23))*q^4 + (2*3^4 + 3^5 + 3^6 + 2*3^7 + 3^10 + O(3^24))*q^5 + (3^6 + 3^7 + 3^8 + 3^9 + 3^10 + 3^11 + O(3^26))*q^6 + (2*3^3 + 3^4 + 2*3^6 + 2*3^7 + 2*3^8 + 3^9 + 3^10 + 2*3^11 + 3^12 + O(3^23))*q^7 + (2*3^4 + 3^5 + 3^8 + 2*3^9 + 2*3^10 + 2*3^13 + O(3^24))*q^8 + (3^7 + 2*3^9 + 2*3^12 + 2*3^14 + O(3^27))*q^9 + (2*3^5 + 3^8 + 3^9 + 2*3^10 + 2*3^13 + 2*3^15 + O(3^25))*q^10 + (3^4 + 2*3^5 + 2*3^6 + 3^8 + 2*3^9 + 3^12 + 3^14 + 2*3^16 + O(3^24))*q^11 + (3^5 + 3^6 + 2*3^8 + 2*3^9 + 2*3^10 + 2*3^12 + 3^14 + 2*3^15 + 2*3^16 + 3^17 + O(3^25))*q^12 + (2*3^3 + 2*3^4 + 2*3^5 + 3^8 + 2*3^9 + 2*3^11 + 3^13 + 2*3^14 + 2*3^17 + 3^18 + O(3^23))*q^13 + (2*3^4 + 2*3^6 + 2*3^7 + 3^8 + 2*3^9 + 3^10 + 3^12 + 3^14 + 2*3^15 + 2*3^16 + 3^18 + 3^19 + O(3^24))*q^14 + (2*3^6 + 3^7 + 3^9 + 3^10 + 3^11 + 2*3^14 + 3^15 + 2*3^16 + 3^17 + 3^18 + 3^20 + O(3^26))*q^15 + (3^3 + 2*3^4 + 2*3^7 + 2*3^8 + 3^9 + 3^10 + 2*3^11 + 3^12 + 2*3^14 + 2*3^15 + 3^17 + 3^18 + 2*3^19 + 2*3^20 + O(3^23))*q^16 + (2*3^5 + 2*3^7 + 2*3^8 + 3^10 + 3^11 + 2*3^12 + 2*3^13 + 3^14 + 3^15 + 3^17 + 2*3^18 + 3^19 + 2*3^21 + O(3^25))*q^17 + (3^8 + 3^9 + 2*3^10 + 2*3^11 + 3^12 + 3^14 + 3^15 + 3^16 + 3^17 + 2*3^21 + 3^22 + O(3^28))*q^18 + (2*3^3 + 3^5 + 2*3^6 + 2*3^8 + 2*3^9 + 3^11 + 2*3^12 + 3^13 + 3^14 + 2*3^15 + 3^16 + 3^17 + 2*3^18 + 3^19 + 2*3^21 + O(3^23))*q^19 + O(q^20)
1664
"""
1665
return self.q_expansion()._pari_()
1666
1667