Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
241818 views
1
# -*- coding: utf-8 -*-
2
r"""
3
p-adic L-series of modular Jacobians with ordinary reduction at p.
4
5
REFERENCES:
6
7
- [MTT] B. Mazur, J. Tate, and J. Teitelbaum,
8
On `p`-adic analogues of the conjectures of Birch and
9
Swinnerton-Dyer, Inventiones mathematicae 84, (1986), 1-48.
10
11
- [SW] William Stein and Christian Wuthrich, Computations About
12
Tate-Shafarevich Groups using Iwasawa theory, preprint 2009.
13
14
AUTHORS:
15
16
- William Stein and Jennifer Balakrishnan (2010-07-01): first version
17
18
"""
19
20
######################################################################
21
# Copyright (C) 2010 William Stein <[email protected]>
22
#
23
# Distributed under the terms of the GNU General Public License (GPL)
24
#
25
# This code is distributed in the hope that it will be useful,
26
# but WITHOUT ANY WARRANTY; without even the implied warranty of
27
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28
# General Public License for more details.
29
#
30
# The full text of the GPL is available at:
31
#
32
# http://www.gnu.org/licenses/
33
######################################################################
34
35
36
from sage.rings.integer_ring import ZZ
37
from sage.rings.rational_field import QQ
38
from sage.rings.padics.factory import Qp, Zp
39
from sage.rings.infinity import infinity
40
from sage.rings.all import LaurentSeriesRing, PowerSeriesRing, PolynomialRing, Integers
41
42
from sage.rings.integer import Integer
43
from sage.rings.arith import valuation, binomial, kronecker_symbol, gcd, prime_divisors, valuation
44
45
from sage.structure.sage_object import SageObject
46
47
from sage.misc.all import verbose, denominator, get_verbose
48
from sage.databases.cremona import parse_cremona_label
49
from sage.schemes.elliptic_curves.constructor import EllipticCurve
50
import sage.rings.arith as arith
51
52
from sage.modules.free_module_element import vector
53
import sage.matrix.all as matrix
54
55
# from sage.interfaces.all import gp
56
from sage.misc.functional import log
57
58
from sage.modular.modsym.modsym import ModularSymbols
59
60
class pAdicLseries(SageObject):
61
r"""
62
The `p`-adic L-series of a modular abelian variety.
63
64
EXAMPLES:
65
66
An ordinary example::
67
68
69
"""
70
def __init__(self, J, p, normalize='L_ratio'):
71
r"""
72
INPUT:
73
- ``J`` - modular abelian variety
74
- ``p`` - a prime of good reduction
75
- ``normalize`` - ``'L_ratio'`` (default), ``'period'`` or
76
``'none'``; this is describes the way the modular
77
symbols are normalized
78
"""
79
self._J = J
80
self._level = J.level()
81
self._p = ZZ(p)
82
self._normalize = normalize
83
if not self._p.is_prime():
84
raise ValueError, "p (=%s) must be a prime"%p
85
A = self._J.modular_symbols(sign=1)
86
self._modular_symbols_subspace = A
87
v = A.dual_eigenvector()
88
self._dual_eigenvector = v
89
self._hecke_eigenvalue_field = v[0].parent()
90
91
def __cmp__(self,other):
92
r"""
93
Compare self and other.
94
95
TESTS::
96
97
sage: lp1 = J0(23)[0].padic_lseries(5)
98
sage: lp2 = J0(23)[0].padic_lseries(7)
99
sage: lp3 = J0(29)[0].padic_lseries(5)
100
sage: lp1 == lp1
101
True
102
sage: lp1 == lp2
103
False
104
sage: lp1 == lp3
105
False
106
"""
107
c = cmp(type(self), type(other))
108
if c:
109
return c
110
return cmp((self._J, self._p), (other._J, other._p))
111
112
def modular_symbols_subspace(self):
113
"""
114
"""
115
return self._modular_symbols_subspace
116
117
def hecke_eigenvalue_field(self):
118
"""
119
The field of definition of the dual eigenform.
120
"""
121
return self._hecke_eigenvalue_field
122
123
def psi(self):
124
"""
125
The embedding $\Q(\alpha) \into \Q_p(a)$ sending $\alpha \mapsto a$.
126
"""
127
K_f = self._hecke_eigenvalue_field
128
p = self._p
129
# kbar = K_f.residue_field(p)
130
Q = Qp(p)
131
132
###split case
133
pOK = K_f.factor(p)
134
if (len(pOK) == 2 and pOK[0][1] == 1):
135
R = Q['x']
136
r1, r2 = R(K_f.defining_polynomial()).roots()
137
psi1 = K_f.hom([r1[0]])
138
psi2 = K_f.hom([r2[0]])
139
return [psi1, psi2]
140
else:
141
F = Q.extension(K_f.defining_polynomial(),names='a')
142
a = F.gen()
143
psi = self._psis = [K_f.hom([a])]
144
return psi
145
146
def modular_symbol(self,r):
147
"""
148
Compute the modular symbol at the cusp $r$.
149
"""
150
v = self._dual_eigenvector
151
152
try:
153
psis = self._psis
154
except AttributeError:
155
psis = self._psis = self.psi()
156
157
# TODO: rewrite this function to be a separate Cython class
158
# that just does reducing [r,infinity] to a rational using
159
# exactly the data that ones needs to do this (not going
160
# through modular symbols), and it'll make this massively
161
# faster.
162
if len(psis) == 1:
163
psi = psis[0]
164
M = self.modular_symbols_subspace().ambient()
165
s = M([r,infinity])
166
return psi(v.dot_product(s.element()))
167
else:
168
if self._emb == 1:
169
psi = psis[0]
170
elif self._emb == 2:
171
psi = psis[1]
172
# elif (self._current_alpha == self.alpha()[0]):
173
# psi = psis[0]
174
# else:
175
# psi = psis[1]
176
177
M = self.modular_symbols_subspace().ambient()
178
s = M([r,infinity])
179
return psi(v.dot_product(s.element()))
180
181
182
#############stuff for p-adic BSD, should be moved######
183
184
def regulator(self):
185
"""
186
"""
187
list = [23, 29, 31, 35, 39, 63,65, 87, 117, 135, 175, 189]
188
if (self.abelian_variety().level() in list):
189
return 1
190
else:
191
raise NotImplementedError
192
193
def rank(self):
194
"""
195
"""
196
list = [23, 29, 31, 35,39, 63,65, 87, 117, 135, 175, 189]
197
if (self.abelian_variety().level() in list):
198
return 1
199
else:
200
raise NotImplementedError
201
202
def tamagawa_prod(self):
203
"""
204
"""
205
list = [23, 29, 31, 35,39, 63,65, 87, 117, 125, 133, 135, 175, 189]
206
A = self.abelian_variety()
207
if A.dimension() != 2:
208
raise NotImplementedError
209
lev = self._level
210
if lev not in list:
211
raise NotImplementedError
212
elif lev == 23:
213
return 11
214
elif lev == 29:
215
return 7
216
elif lev == 31:
217
return 5
218
elif lev == 35:
219
return 32
220
elif lev == 39:
221
return 28
222
elif lev == 63:
223
return 6
224
elif self.label() == '65a(1,65)':
225
return 7
226
elif self.label() == '65b(1,65)':
227
return 3
228
elif lev == 87:
229
return 5
230
elif self.label() == '117a(1,117)':
231
return 12
232
elif self.label() == '117b(1,117)':
233
return 4
234
elif self.label() == '125b(1,125)':
235
return 5
236
elif self.label() == '133a(1,133)':
237
return 5
238
elif lev == 135:
239
return 3
240
elif lev == 175:
241
return 5
242
elif lev == 189:
243
return 3
244
245
def torsion_order(self):
246
"""
247
"""
248
list = [23, 29, 31, 35,39, 63,65, 87, 117, 125, 133, 135, 175, 189]
249
A = self.abelian_variety()
250
if A.dimension() != 2:
251
raise NotImplementedError
252
lev = self._level
253
if lev not in list:
254
raise NotImplementedError
255
elif lev == 23:
256
return 11
257
elif lev == 29:
258
return 7
259
elif lev == 31:
260
return 5
261
elif lev == 35:
262
return 16
263
elif lev == 39:
264
return 28
265
elif lev == 63:
266
return 6
267
elif self.label() == '65a(1,65)':
268
return 14
269
elif self.label() == '65b(1,65)':
270
return 6
271
elif lev == 87:
272
return 5
273
elif self.label() == '117a(1,117)':
274
return 6
275
elif self.label() == '117b(1,117)':
276
return 2
277
elif self.label() == '125b(1,125)':
278
return 5
279
elif self.label() == '133a(1,133)':
280
return 5
281
elif lev == 135:
282
return 3
283
elif lev == 175:
284
return 5
285
elif lev == 189:
286
return 3
287
288
def sha(self):
289
"""
290
"""
291
list = [23, 29, 31, 35,39, 63,65, 87, 117, 125, 133, 135, 175, 189]
292
A = self.abelian_variety()
293
if A.dimension() != 2:
294
raise NotImplementedError
295
lev = self._level
296
if lev not in list:
297
raise NotImplementedError
298
elif lev == 23:
299
return 1
300
elif lev == 29:
301
return 1
302
elif lev == 31:
303
return 1
304
elif lev == 35:
305
return 1
306
elif lev == 39:
307
return 1
308
elif lev == 63:
309
return 1
310
elif self.label() == '65a(1,65)':
311
return 2
312
elif self.label() == '65b(1,65)':
313
return 2
314
elif lev == 87:
315
return 1
316
elif self.label() == '117a(1,117)':
317
return 1
318
elif self.label() == '117b(1,117)':
319
return 1
320
elif self.label() == '125b(1,125)':
321
return 4
322
elif self.label() == '133a(1,133)':
323
return 4
324
elif lev == 135:
325
return 1
326
elif lev == 175:
327
return 1
328
elif lev == 189:
329
return 1
330
331
def rhs(self):
332
"""
333
"""
334
list = [23, 29, 31, 35,39, 63,65, 87, 117, 125, 133, 135, 175, 189]
335
lev = self.abelian_variety().level()
336
if lev not in list:
337
raise NotImplementedError
338
else:
339
try:
340
eps = (1-1/self.alpha()).norm()**2
341
except AttributeError:
342
eps = (1-1/self.alpha())**4
343
return eps*(self.tamagawa_prod()*self.sha())/(self.torsion_order()**2)
344
345
346
347
#######################################################
348
349
def abelian_variety(self):
350
r"""
351
Return the abelian variety to which this `p`-adic L-series is
352
associated.
353
354
EXAMPLES::
355
356
sage: L = J0(23)[0].padic_lseries(5)
357
sage: L.abelian_variety()
358
Simple abelian variety J0(23) of dimension 2
359
"""
360
return self._J
361
362
def prime(self):
363
r"""
364
Returns the prime `p` as in 'p-adic L-function'.
365
366
EXAMPLES::
367
368
sage: L = J0(23)[0].padic_lseries(5)
369
sage: L.prime()
370
5
371
"""
372
return self._p
373
374
def _repr_(self):
375
r"""
376
Return print representation.
377
378
EXAMPLES::
379
"""
380
s = "%s-adic L-series of %s"%(self._p, self._J)
381
if not self._normalize == 'L_ratio':
382
s += ' (not normalized)'
383
return s
384
385
def ap(self):
386
"""
387
Return the Hecke eigenvalue $a_p$.
388
389
EXAMPLES::
390
391
sage: J = J0(23)[0]
392
sage: [(p, J.padic_lseries(p)) for p in prime_range(5,30)]
393
(5, 2*alpha)
394
(7, 2*alpha + 2)
395
(11, -2*alpha - 4)
396
(13, 3)
397
(17, -2*alpha + 2)
398
(19, -2)
399
(23, 1)
400
(29, -3)
401
"""
402
try:
403
A = self._modular_symbols_subspace
404
except AttributeError:
405
A = self._modular_symbols_subspace = self.modular_symbols_subspace()
406
a_p = self._ap = A.eigenvalue(self._p)
407
return a_p
408
409
def is_ordinary(self):
410
"""
411
Check if $p$ is an ordinary prime.
412
"""
413
try:
414
K_f = self._hecke_eigenvalue_field
415
except AttributeError:
416
K_f = self._hecke_eigenvalue_field = self.hecke_eigenvalue_field()
417
try:
418
a_p = self._ap
419
except AttributeError:
420
a_p = self._ap = self.ap()
421
frak_p = [x[0] for x in K_f.factor(self._p)]
422
not_in_p = [x for x in frak_p if a_p not in frak_p]
423
if len(not_in_p) == 0:
424
return False
425
else:
426
return True
427
428
def measure(self,a,n,prec,quadratic_twist=+1,user_alpha=[],outside_call=False):
429
"""
430
outside_call: if using this from outside the series computation
431
"""
432
if quadratic_twist > 0:
433
s = +1
434
else:
435
s = -1
436
try:
437
p, alpha, z, w, f = self.__measure_data[(n,prec,s)]
438
except (KeyError, AttributeError):
439
if not hasattr(self, '__measure_data'):
440
self.__measure_data = {}
441
p = self._p
442
alpha = user_alpha
443
z = 1/(alpha**n)
444
w = p**(n-1)
445
f = self.modular_symbol
446
self.__measure_data[(n,prec,s)] = (p,alpha,z,w,f)
447
if outside_call:
448
if (user_alpha == self.alpha()[0]):
449
self._emb = 1
450
else:
451
self._emb = 2
452
if alpha != user_alpha:
453
alpha = user_alpha
454
z = 1/(alpha**n)
455
f = self.modular_symbol
456
self.__measure_data[(n,prec,s)] = (p,alpha,z,w,f)
457
458
if quadratic_twist == 1:
459
return z * f(a/(p*w)) - (z/alpha) * f(a/w)
460
461
else:
462
D = quadratic_twist
463
chip = kronecker_symbol(D,p)
464
if self._E.conductor() % p == 0:
465
mu = chip**n * z * sum([kronecker_symbol(D,u) * f(a/(p*w)+ZZ(u)/D) for u in range(1,abs(D))])
466
else:
467
mu = chip**n * sum([kronecker_symbol(D,u) *(z * f(a/(p*w)+ZZ(u)/D) - chip *(z/alpha)* f(a/w+ZZ(u)/D)) for u in range(1,abs(D))])
468
return s*mu
469
470
471
def alpha(self, prec=20):
472
r"""
473
Return a `p`-adic root `\alpha` of the polynomial `x^2 - a_p x
474
+ p` with `ord_p(\alpha) < 1`. In the ordinary case this is
475
just the unit root.
476
477
INPUT:
478
- ``prec`` - positive integer, the `p`-adic precision of the root.
479
480
EXAMPLES:
481
482
"""
483
try:
484
return self._alpha[prec]
485
except AttributeError:
486
self._alpha = {}
487
except KeyError:
488
pass
489
490
J = self._J
491
p = self._p
492
Q = Qp(p)
493
try:
494
a_p = self._ap
495
except AttributeError:
496
a_p = self._ap = self.ap()
497
498
try:
499
psis = self._psis
500
except AttributeError:
501
psis = self._psis = self.psi()
502
503
K_f = self.hecke_eigenvalue_field()
504
if len(psis) == 1:
505
F = Q.extension(K_f.defining_polynomial(),names='a')
506
a = F.gen()
507
G = K_f.embeddings(K_f)
508
if G[0](K_f.gen()) == K_f.gen():
509
conj_map = G[1]
510
else:
511
conj_map = G[0]
512
v = self._dual_eigenvector
513
v_conj = vector(conj_map(a) for a in v)
514
a_p_conj = conj_map(a_p)
515
R = F['x']
516
x = R.gen()
517
psi = psis[0]
518
a_p_padic = psi(a_p)
519
a_p_conj_padic = psi(a_p_conj)
520
f = x**2 - (a_p_padic)*x + p
521
fconj = x**2 - (a_p_conj_padic)*x + p
522
norm_f = f*fconj
523
norm_f_basefield = norm_f.change_ring(Q)
524
FF = norm_f_basefield().factor()
525
root0 = -f.gcd(FF[0][0])[0]
526
root1 = -f.gcd(FF[1][0])[0]
527
if root0.valuation() < 1:
528
padic_lseries_alpha = [root0]
529
else:
530
padic_lseries_alpha = [root1]
531
532
else:
533
a_p_conj_padic = []
534
a_p_padic = []
535
for psi in psis:
536
a_p_padic = a_p_padic + [psi(a_p)]
537
538
R = Q['x']
539
x = R.gen()
540
padic_lseries_alpha = []
541
for aps in a_p_padic:
542
f = R(x**2 - aps*x + p)
543
roots = f.roots()
544
root0 = roots[0][0]
545
root1 = roots[1][0]
546
if root0.valuation() < 1:
547
padic_lseries_alpha = padic_lseries_alpha + [root0]
548
else:
549
padic_lseries_alpha = padic_lseries_alpha + [root1]
550
551
return padic_lseries_alpha
552
553
def order_of_vanishing(self):
554
r"""
555
Return the order of vanishing of this `p`-adic L-series.
556
557
The output of this function is provably correct, due to a
558
theorem of Kato [Ka]. This function will terminate if and only if
559
the Mazur-Tate-Teitelbaum analogue [MTT] of the BSD conjecture about
560
the rank of the curve is true and the subgroup of elements of
561
`p`-power order in the Shafarevich-Tate group of this curve is
562
finite. I.e. if this function terminates (with no errors!),
563
then you may conclude that the `p`-adic BSD rank conjecture is
564
true and that the `p`-part of Sha is finite.
565
566
NOTE: currently `p` must be a prime of good ordinary reduction.
567
568
REFERENCES:
569
570
- [MTT] B. Mazur, J. Tate, and J. Teitelbaum,
571
On `p`-adic analogues of the conjectures of Birch and
572
Swinnerton-Dyer, Inventiones mathematicae 84, (1986), 1-48.
573
574
- [Ka] Kayuza Kato, `p`-adic Hodge theory and values of zeta functions of modular
575
forms, Cohomologies `p`-adiques et applications arithmetiques III,
576
Asterisque vol 295, SMF, Paris, 2004.
577
578
EXAMPLES::
579
580
"""
581
try:
582
return self.__ord
583
except AttributeError:
584
pass
585
586
if not self.is_ordinary():
587
raise NotImplementedError
588
E = self.elliptic_curve()
589
if not E.is_good(self.prime()):
590
raise ValueError, "prime must be of good reduction"
591
r = E.rank()
592
n = 1
593
while True:
594
f = self.series(n)
595
v = f.valuation()
596
if v < r:
597
raise RuntimeError, "while computing p-adic order of vanishing, got a contradiction: the curve is %s, the curve has rank %s, but the p-adic L-series vanishes to order <= %s"%(E, r, v)
598
if v == r:
599
self.__ord = v
600
return v
601
n += 1
602
603
def _c_bounds(self, n):
604
raise NotImplementedError
605
606
def _prec_bounds(self, n,prec):
607
raise NotImplementedError
608
609
def teichmuller(self, prec):
610
r"""
611
Return Teichmuller lifts to the given precision.
612
613
INPUT:
614
- ``prec`` - a positive integer.
615
616
OUTPUT:
617
- a list of `p`-adic numbers, the cached Teichmuller lifts
618
619
EXAMPLES::
620
621
sage: L = EllipticCurve('11a').padic_lseries(7)
622
sage: L.teichmuller(1)
623
[0, 1, 2, 3, 4, 5, 6]
624
sage: L.teichmuller(2)
625
[0, 1, 30, 31, 18, 19, 48]
626
"""
627
p = self._p
628
K = Qp(p, prec, print_mode='series')
629
return [Integer(0)] + \
630
[a.residue(prec).lift() for a in K.teichmuller_system()]
631
632
def _e_bounds(self, n, prec):
633
p = self._p
634
prec = max(2,prec)
635
R = PowerSeriesRing(ZZ,'T',prec+1)
636
T = R(R.gen(),prec +1)
637
w = (1+T)**(p**n) - 1
638
return [infinity] + [valuation(w[j],p) for j in range(1,min(w.degree()+1,prec))]
639
640
def _get_series_from_cache(self, n, prec, D):
641
try:
642
return self.__series[(n,prec,D)]
643
except AttributeError:
644
self.__series = {}
645
except KeyError:
646
for _n, _prec, _D in self.__series.keys():
647
if _n == n and _D == D and _prec >= prec:
648
return self.__series[(_n,_prec,_D)].add_bigoh(prec)
649
return None
650
651
def _set_series_in_cache(self, n, prec, D, f):
652
self.__series[(n,prec,D)] = f
653
654
655
def _quotient_of_periods_to_twist(self,D):
656
r"""
657
For a fundamental discriminant `D` of a quadratic number field
658
this computes the constant `\eta` such that
659
`\sqrt{D}\cdot\Omega_{E_D}^{+} =\eta\cdot
660
\Omega_E^{sign(D)}`. As in [MTT]_ page 40. This is either 1
661
or 2 unless the condition on the twist is not satisfied,
662
e.g. if we are 'twisting back' to a semi-stable curve.
663
664
REFERENCES:
665
666
- [MTT] B. Mazur, J. Tate, and J. Teitelbaum,
667
On `p`-adic analogues of the conjectures of Birch and
668
Swinnerton-Dyer, Invertiones mathematicae 84, (1986), 1-48.
669
670
.. note: No check on precision is made, so this may fail for huge `D`.
671
672
EXAMPLES::
673
674
"""
675
from sage.functions.all import sqrt
676
# This funciton does not depend on p and could be moved out of this file but it is needed only here
677
678
# Note that the number of real components does not change by twisting.
679
if D == 1:
680
return 1
681
if D > 1:
682
Et = self._E.quadratic_twist(D)
683
qt = Et.period_lattice().basis()[0]/self._E.period_lattice().basis()[0]
684
qt *= sqrt(qt.parent()(D))
685
else:
686
Et = self._E.quadratic_twist(D)
687
qt = Et.period_lattice().basis()[0]/self._E.period_lattice().basis()[1].imag()
688
qt *= sqrt(qt.parent()(-D))
689
verbose('the real approximation is %s'%qt)
690
# we know from MTT that the result has a denominator 1
691
return QQ(int(round(8*qt)))/8
692
693
694
class pAdicLseriesOrdinary(pAdicLseries):
695
"""
696
EXAMPLE:
697
698
sage: from psage.modform.rational.padic_lseries import *
699
sage: A = J0(188)[-2]
700
sage: L = pAdicLseriesOrdinary(A, 7)
701
sage: L.series()
702
O(7^20) + ((2*a + 4) + (6*a + 2)*7 + 6*7^2 + 4*a*7^3 + (4*a + 5)*7^4 + (4*a + 5)*7^5 + (6*a + 3)*7^6 + (2*a + 1)*7^7 + (5*a + 2)*7^8 + 5*7^9 + (2*a + 2)*7^10 + (5*a + 4)*7^11 + 3*a*7^12 + (5*a + 4)*7^13 + 5*a*7^14 + (3*a + 6)*7^15 + (5*a + 6)*7^16 + (6*a + 4)*7^17 + 5*a*7^18 + (3*a + 5)*7^19 + O(7^20))*T + ((5*a + 3) + (a + 6)*7 + (2*a + 1)*7^2 + (3*a + 2)*7^3 + (4*a + 2)*7^4 + 4*a*7^5 + (2*a + 6)*7^6 + 3*7^7 + (3*a + 5)*7^8 + (5*a + 2)*7^9 + (a + 3)*7^10 + 6*a*7^11 + (5*a + 5)*7^12 + (6*a + 6)*7^13 + (3*a + 4)*7^14 + (2*a + 4)*7^15 + (3*a + 6)*7^16 + (6*a + 1)*7^17 + 5*7^18 + (6*a + 5)*7^19 + O(7^20))*T^2 + ((3*a + 6) + (6*a + 6)*7 + 5*7^2 + 6*a*7^3 + (a + 4)*7^4 + (3*a + 2)*7^5 + 3*a*7^6 + (4*a + 6)*7^7 + (5*a + 2)*7^8 + 6*a*7^9 + (3*a + 1)*7^10 + (5*a + 3)*7^11 + (a + 1)*7^12 + (a + 4)*7^13 + (6*a + 2)*7^14 + (a + 2)*7^15 + (3*a + 1)*7^17 + (2*a + 5)*7^18 + (a + 3)*7^19 + O(7^20))*T^3 + ((3*a + 6) + (4*a + 3)*7 + (2*a + 3)*7^2 + (2*a + 2)*7^3 + 5*a*7^4 + 3*a*7^5 + (2*a + 5)*7^6 + (6*a + 1)*7^7 + (a + 2)*7^8 + (a + 1)*7^9 + (4*a + 5)*7^10 + 5*a*7^11 + (3*a + 4)*7^12 + (5*a + 6)*7^13 + (a + 5)*7^14 + 5*7^15 + 4*a*7^16 + (a + 3)*7^17 + (6*a + 2)*7^18 + (2*a + 3)*7^19 + O(7^20))*T^4 + O(T^5)
703
704
sage: L = pAdicLseriesOrdinary(A,19)
705
sage: f = L.series(n=3)
706
sage: f[2]
707
8 + 13*19 + 11*19^2 + 12*19^3 + 16*19^4 + 16*19^5 + 4*19^6 + 19^7 + 3*19^8 + 6*19^9 + 3*19^10 + 15*19^11 + 9*19^12 + 15*19^13 + 5*19^14 + 8*19^15 + 16*19^16 + 6*19^17 + 11*19^18 + 6*19^19 + O(19^20)
708
709
"""
710
def measure_experimental(self,a,n,prec,quadratic_twist=+1,alpha=[]):
711
"""
712
"""
713
if quadratic_twist > 0:
714
s = +1
715
else:
716
s = -1
717
try:
718
p, p_inv, alpha, alpha_inv, z, w, w_inv, f = self.__measure_data[(n,prec,s)]
719
except (KeyError, AttributeError):
720
if not hasattr(self, '__measure_data'):
721
self.__measure_data = {}
722
p = self._p
723
z = 1/(alpha**n)
724
w = p**(n-1)
725
f = self.modular_symbol
726
w_inv = ~w
727
alpha_inv = ~alpha
728
p_inv = p.parent()(1)/p
729
R = alpha.parent()
730
731
self.__measure_data[(n,prec,s)] = (R(p),R(p_inv),alpha,alpha_inv,z,R(w),R(w_inv),f)
732
733
if quadratic_twist == 1:
734
return z * f(a*p_inv*w_inv) - (z*alpha_inv) * f(a*w_inv)
735
736
else:
737
D = quadratic_twist
738
chip = kronecker_symbol(D,p)
739
if self._E.conductor() % p == 0:
740
mu = chip**n * z * sum([kronecker_symbol(D,u) * f(a/(p*w)+ZZ(u)/D) for u in range(1,abs(D))])
741
else:
742
mu = chip**n * sum([kronecker_symbol(D,u) *(z * f(a/(p*w)+ZZ(u)/D) - chip *(z/alpha)* f(a/w+ZZ(u)/D)) for u in range(1,abs(D))])
743
return s*mu
744
745
746
def series(self, n=2, quadratic_twist=+1, prec=5):
747
r"""
748
Returns the `n`-th approximation to the `p`-adic L-series as a
749
power series in `T` (corresponding to `\gamma-1` with
750
`\gamma=1+p` as a generator of `1+p\ZZ_p`). Each coefficient
751
is a `p`-adic number whose precision is provably correct.
752
753
Here the normalization of the `p`-adic L-series is chosen such
754
that `L_p(J,1) = (1-1/\alpha)^2 L(J,1)/\Omega_J` where
755
`\alpha` is the unit root
756
757
INPUT:
758
759
- ``n`` - (default: 2) a positive integer
760
- ``quadratic_twist`` - (default: +1) a fundamental
761
discriminant of a quadratic field, coprime to the
762
conductor of the curve
763
- ``prec`` - (default: 5) maximal number of terms of the
764
series to compute; to compute as many as possible just
765
give a very large number for ``prec``; the result will
766
still be correct.
767
768
ALIAS: power_series is identical to series.
769
770
EXAMPLES:
771
772
sage: J = J0(188)[0]
773
sage: p = 7
774
sage: L = J.padic_lseries(p)
775
sage: L.is_ordinary()
776
True
777
sage: f = L.series(2)
778
sage: f[0]
779
O(7^20)
780
sage: f[1].norm()
781
3 + 4*7 + 3*7^2 + 6*7^3 + 5*7^4 + 5*7^5 + 6*7^6 + 4*7^7 + 5*7^8 + 7^10 + 5*7^11 + 4*7^13 + 4*7^14 + 5*7^15 + 2*7^16 + 5*7^17 + 7^18 + 7^19 + O(7^20)
782
783
"""
784
n = ZZ(n)
785
if n < 1:
786
raise ValueError, "n (=%s) must be a positive integer"%n
787
if not self.is_ordinary():
788
raise ValueError, "p (=%s) must be an ordinary prime"%p
789
# check if the conditions on quadratic_twist are satisfied
790
D = ZZ(quadratic_twist)
791
if D != 1:
792
if D % 4 == 0:
793
d = D//4
794
if not d.is_squarefree() or d % 4 == 1:
795
raise ValueError, "quadratic_twist (=%s) must be a fundamental discriminant of a quadratic field"%D
796
else:
797
if not D.is_squarefree() or D % 4 != 1:
798
raise ValueError, "quadratic_twist (=%s) must be a fundamental discriminant of a quadratic field"%D
799
if gcd(D,self._p) != 1:
800
raise ValueError, "quadratic twist (=%s) must be coprime to p (=%s) "%(D,self._p)
801
if gcd(D,self._E.conductor())!= 1:
802
for ell in prime_divisors(D):
803
if valuation(self._E.conductor(),ell) > valuation(D,ell) :
804
raise ValueError, "can not twist a curve of conductor (=%s) by the quadratic twist (=%s)."%(self._E.conductor(),D)
805
806
807
p = self._p
808
if p == 2 and self._normalize :
809
print 'Warning : For p=2 the normalization might not be correct !'
810
#verbose("computing L-series for p=%s, n=%s, and prec=%s"%(p,n,prec))
811
812
# bounds = self._prec_bounds(n,prec)
813
# padic_prec = max(bounds[1:]) + 5
814
padic_prec = 10
815
# verbose("using p-adic precision of %s"%padic_prec)
816
817
res_series_prec = min(p**(n-1), prec)
818
verbose("using series precision of %s"%res_series_prec)
819
820
ans = self._get_series_from_cache(n, res_series_prec,D)
821
if not ans is None:
822
verbose("found series in cache")
823
return ans
824
825
K = QQ
826
gamma = K(1 + p)
827
R = PowerSeriesRing(K,'T',res_series_prec)
828
T = R(R.gen(),res_series_prec )
829
#L = R(0)
830
one_plus_T_factor = R(1)
831
gamma_power = K(1)
832
teich = self.teichmuller(padic_prec)
833
p_power = p**(n-1)
834
# F = Qp(p,padic_prec)
835
836
verbose("Now iterating over %s summands"%((p-1)*p_power))
837
verbose_level = get_verbose()
838
count_verb = 0
839
alphas = self.alpha()
840
#print len(alphas)
841
Lprod = []
842
self._emb = 0
843
if len(alphas) == 2:
844
split = True
845
else:
846
split = False
847
for alpha in alphas:
848
L = R(0)
849
self._emb = self._emb + 1
850
for j in range(p_power):
851
s = K(0)
852
if verbose_level >= 2 and j/p_power*100 > count_verb + 3:
853
verbose("%.2f percent done"%(float(j)/p_power*100))
854
count_verb += 3
855
for a in range(1,p):
856
if split:
857
# b = ((F.teichmuller(a)).lift() % ZZ(p**n))
858
b = (teich[a]) % ZZ(p**n)
859
b = b*gamma_power
860
else:
861
b = teich[a] * gamma_power
862
s += self.measure(b, n, padic_prec,D,alpha)
863
L += s * one_plus_T_factor
864
one_plus_T_factor *= 1+T
865
gamma_power *= gamma
866
867
Lprod = Lprod + [L]
868
if len(Lprod)==1:
869
return Lprod[0]
870
else:
871
return Lprod[0]*Lprod[1]
872
873
power_series = series
874
875
876