Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sagelib
Path: blob/master/sage/schemes/elliptic_curves/padic_lseries.py
4156 views
1
# -*- coding: utf-8 -*-
2
r"""
3
p-adic L-functions of elliptic curves
4
5
To an elliptic curve `E` over the rational numbers and a prime `p`, one
6
can associate a `p`-adic L-function; at least if `E` does not have additive
7
reduction at `p`. This function is defined by interpolation of L-values of `E`
8
at twists. Through the main conjecture of Iwasawa theory it should also be
9
equal to a characteristic series of a certain Selmer group.
10
11
If `E` is ordinary, then it is an element of the Iwasawa algebra
12
`\Lambda(\ZZ_p^\times) = \ZZ_p[\Delta][\![T]\!]`, where `\Delta` is the group
13
of `(p-1)`-st roots of unity in `\ZZ_p^\times`, and `T = [\gamma] - 1` where
14
`\gamma = 1 + p` is a generator of `1 + p\ZZ_p`. (There is a slightly different
15
description for `p = 2`.)
16
17
One can decompose this algebra as the direct product of the subalgebras
18
corresponding to the characters of `\Delta`, which are simply the powers
19
`\tau^\eta` (`0 \le \eta \le p-2`) of the Teichmueller character `\tau: \Delta
20
\to \ZZ_p^\times`. Projecting the L-function into these components gives `p-1`
21
power series in `T`, each with coefficients in `\ZZ_p`.
22
23
If `E` is supersingular, the series will have coefficients in a quadratic
24
extension of `\QQ_p`, and the coefficients will be unbounded. In this case we
25
have only implemented the series for `\eta = 0`. We have also implemented the
26
`p`-adic L-series as formulated by Perrin-Riou [BP], which has coefficients in
27
the Dieudonne module `D_pE = H^1_{dR}(E/\QQ_p)` of `E`. There is a different
28
description by Pollack [Po] which is not available here.
29
30
According to the `p`-adic version of the Birch and Swinnerton-Dyer conjecture
31
[MTT], the order of vanishing of the `L`-function at the trivial character
32
(i.e. of the series for `\eta = 0` at `T = 0`) is just the rank of `E(\QQ)`, or
33
this rank plus one if the reduction at `p` is split multiplicative.
34
35
See [SW] for more details.
36
37
REFERENCES:
38
39
- [MTT] B. Mazur, J. Tate, and J. Teitelbaum,
40
On `p`-adic analogues of the conjectures of Birch and
41
Swinnerton-Dyer, Inventiones mathematicae 84, (1986), 1-48.
42
43
- [BP] Dominique Bernardi and Bernadette Perrin-Riou,
44
Variante `p`-adique de la conjecture de Birch et
45
Swinnerton-Dyer (le cas supersingulier), C. R. Acad. Sci. Paris,
46
Ser I. Math, 317 (1993), no 3, 227-232.
47
48
- [Po] Robert Pollack, On the `p`-adic L-function of a modular form
49
at supersingular prime, Duke Math. J. 118 (2003), no 3, 523-558.
50
51
- [SW] William Stein and Christian Wuthrich, Computations About Tate-Shafarevich Groups
52
using Iwasawa theory, preprint 2009.
53
54
AUTHORS:
55
56
- William Stein (2007-01-01): first version
57
58
- Chris Wuthrich (22/05/2007): changed minor issues and added supersingular things
59
60
- Chris Wuthrich (11/2008): added quadratic_twists
61
62
- David Loeffler (01/2011): added nontrivial Teichmueller components
63
64
"""
65
66
######################################################################
67
# Copyright (C) 2007 William Stein <[email protected]>
68
#
69
# Distributed under the terms of the GNU General Public License (GPL)
70
#
71
# This code is distributed in the hope that it will be useful,
72
# but WITHOUT ANY WARRANTY; without even the implied warranty of
73
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
74
# General Public License for more details.
75
#
76
# The full text of the GPL is available at:
77
#
78
# http://www.gnu.org/licenses/
79
######################################################################
80
81
82
from sage.rings.integer_ring import ZZ
83
from sage.rings.rational_field import QQ
84
from sage.rings.padics.factory import Qp
85
from sage.rings.infinity import infinity
86
from sage.rings.all import LaurentSeriesRing, PowerSeriesRing, PolynomialRing, Integers
87
88
from sage.rings.integer import Integer
89
from sage.rings.arith import valuation, binomial, kronecker_symbol, gcd, prime_divisors, valuation
90
91
from sage.structure.sage_object import SageObject
92
93
from sage.misc.all import verbose, denominator, get_verbose
94
import sage.rings.arith as arith
95
96
from sage.modules.free_module_element import vector
97
import sage.matrix.all as matrix
98
import monsky_washnitzer
99
# from sage.interfaces.all import gp
100
from sage.misc.functional import log
101
102
from sage.misc.decorators import rename_keyword
103
104
class pAdicLseries(SageObject):
105
r"""
106
The `p`-adic L-series of an elliptic curve.
107
108
EXAMPLES:
109
An ordinary example::
110
111
sage: e = EllipticCurve('389a')
112
sage: L = e.padic_lseries(5)
113
sage: L.series(0)
114
Traceback (most recent call last):
115
...
116
ValueError: n (=0) must be a positive integer
117
sage: L.series(1)
118
O(T^1)
119
sage: L.series(2)
120
O(5^4) + O(5)*T + (4 + O(5))*T^2 + (2 + O(5))*T^3 + (3 + O(5))*T^4 + O(T^5)
121
sage: L.series(3, prec=10)
122
O(5^5) + O(5^2)*T + (4 + 4*5 + O(5^2))*T^2 + (2 + 4*5 + O(5^2))*T^3 + (3 + O(5^2))*T^4 + (1 + O(5))*T^5 + O(5)*T^6 + (4 + O(5))*T^7 + (2 + O(5))*T^8 + O(5)*T^9 + O(T^10)
123
sage: L.series(2,quadratic_twist=-3)
124
2 + 4*5 + 4*5^2 + O(5^4) + O(5)*T + (1 + O(5))*T^2 + (4 + O(5))*T^3 + O(5)*T^4 + O(T^5)
125
126
127
A prime p such that E[p] is reducible::
128
129
sage: L = EllipticCurve('11a').padic_lseries(5)
130
sage: L.series(1)
131
5 + O(5^2) + O(T)
132
sage: L.series(2)
133
5 + 4*5^2 + O(5^3) + O(5^0)*T + O(5^0)*T^2 + O(5^0)*T^3 + O(5^0)*T^4 + O(T^5)
134
sage: L.series(3)
135
5 + 4*5^2 + 4*5^3 + O(5^4) + O(5)*T + O(5)*T^2 + O(5)*T^3 + O(5)*T^4 + O(T^5)
136
137
An example showing the calculation of nontrivial Teichmueller twists::
138
139
sage: E=EllipticCurve('11a1')
140
sage: lp=E.padic_lseries(7)
141
sage: lp.series(4,eta=1)
142
6 + 2*7^3 + 5*7^4 + O(7^6) + (4*7 + 2*7^2 + O(7^3))*T + (2 + 3*7^2 + O(7^3))*T^2 + (1 + 2*7 + 2*7^2 + O(7^3))*T^3 + (1 + 3*7^2 + O(7^3))*T^4 + O(T^5)
143
sage: lp.series(4,eta=2)
144
5 + 6*7 + 4*7^2 + 2*7^3 + 3*7^4 + 2*7^5 + O(7^6) + (6 + 4*7 + 7^2 + O(7^3))*T + (3 + 2*7^2 + O(7^3))*T^2 + (1 + 4*7 + 7^2 + O(7^3))*T^3 + (6 + 6*7 + 6*7^2 + O(7^3))*T^4 + O(T^5)
145
sage: lp.series(4,eta=3)
146
O(7^6) + (3 + 2*7 + 5*7^2 + O(7^3))*T + (5 + 4*7 + 5*7^2 + O(7^3))*T^2 + (3*7 + 7^2 + O(7^3))*T^3 + (2*7 + 7^2 + O(7^3))*T^4 + O(T^5)
147
148
(Note that the last series vanishes at `T = 0`, which is consistent with ::
149
150
sage: E.quadratic_twist(-7).rank()
151
1
152
153
This proves that `E` has rank 1 over `\QQ(\zeta_7)`.)
154
155
the load-dumps test::
156
157
sage: lp = EllipticCurve('11a').padic_lseries(5)
158
sage: lp == loads(dumps(lp))
159
True
160
"""
161
def __init__(self, E, p, use_eclib=False, normalize='L_ratio'):
162
r"""
163
INPUT:
164
165
- ``E`` - an elliptic curve
166
- ``p`` - a prime of good reduction
167
- ``use_eclib`` - bool (default:True); whether or not to use
168
John Cremona's ``eclib`` for the computation of modular
169
symbols
170
- ``normalize`` - ``'L_ratio'`` (default), ``'period'`` or ``'none'``;
171
this is describes the way the modular symbols
172
are normalized. See ``modular_symbol`` of
173
an elliptic curve over Q for more details.
174
175
EXAMPLES::
176
177
sage: E = EllipticCurve('11a1')
178
sage: Lp = E.padic_lseries(3)
179
sage: Lp.series(2,prec=3)
180
2 + 3 + 3^2 + 2*3^3 + O(3^4) + (1 + O(3))*T + (1 + O(3))*T^2 + O(T^3)
181
"""
182
self._E = E
183
self._p = ZZ(p)
184
self._normalize = normalize
185
self._use_eclib = use_eclib
186
if not self._p.is_prime():
187
raise ValueError, "p (=%s) must be a prime"%p
188
if E.conductor() % (self._p)**2 == 0:
189
raise NotImplementedError, "p (=%s) must be a prime of semi-stable reduction"%p
190
191
try :
192
crla = E.label()
193
except RuntimeError :
194
print "Warning : Curve outside Cremona's table. Computations of modular symbol space might take very long !"
195
196
self._modular_symbol = E.modular_symbol(sign=+1, use_eclib = use_eclib, normalize=normalize)
197
198
def __add_negative_space(self):
199
r"""
200
A helper function not designed for direct use.
201
202
This function add the attribute ``_negative_modular_symbol`` to the class. This may take time
203
and will only be needed when twisting with negative fundamental discriminants.
204
205
EXAMPLES::
206
207
sage: E = EllipticCurve('11a1')
208
sage: lp = E.padic_lseries(5)
209
sage: lp.modular_symbol(1/7,sign=-1) #indirect doctest
210
-1
211
212
"""
213
if self._use_eclib:
214
verbose('Currently there is no negative modular symbols in eclib, so we have to fall back on the implementation of modular symbols in sage')
215
# once there is a eclib implementation of -1, this should be changed.
216
self._negative_modular_symbol = self._E.modular_symbol(sign=-1, use_eclib = False, normalize=self._normalize)
217
else:
218
self._negative_modular_symbol = self._E.modular_symbol(sign=-1, use_eclib = False, normalize=self._normalize)
219
220
def __cmp__(self,other):
221
r"""
222
Compare self and other.
223
224
TESTS::
225
sage: lp1 = EllipticCurve('11a1').padic_lseries(5)
226
sage: lp2 = EllipticCurve('11a1').padic_lseries(7)
227
sage: lp3 = EllipticCurve('11a2').padic_lseries(5)
228
sage: lp1 == lp1
229
True
230
sage: lp1 == lp2
231
False
232
sage: lp1 == lp3
233
False
234
235
"""
236
c = cmp(type(self), type(other))
237
if c:
238
return c
239
return cmp((self._E, self._p), (other._E, other._p))
240
241
242
def elliptic_curve(self):
243
r"""
244
Return the elliptic curve to which this `p`-adic L-series is associated.
245
246
EXAMPLES::
247
248
sage: L = EllipticCurve('11a').padic_lseries(5)
249
sage: L.elliptic_curve()
250
Elliptic Curve defined by y^2 + y = x^3 - x^2 - 10*x - 20 over Rational Field
251
"""
252
return self._E
253
254
def prime(self):
255
r"""
256
Returns the prime `p` as in 'p-adic L-function'.
257
258
EXAMPLES::
259
260
sage: L = EllipticCurve('11a').padic_lseries(5)
261
sage: L.prime()
262
5
263
"""
264
return self._p
265
266
def _repr_(self):
267
r"""
268
Return print representation.
269
270
EXAMPLES::
271
272
sage: e = EllipticCurve('37a')
273
sage: e.padic_lseries(3)._repr_()
274
'3-adic L-series of Elliptic Curve defined by y^2 + y = x^3 - x over Rational Field'
275
sage: e.padic_lseries(3,normalize='none')
276
3-adic L-series of Elliptic Curve defined by y^2 + y = x^3 - x over Rational Field (not normalized)
277
sage: L = e.padic_lseries(3,normalize='none')
278
sage: L.rename('(factor)*L_3(T)')
279
sage: L
280
(factor)*L_3(T)
281
"""
282
s = "%s-adic L-series of %s"%(self._p, self._E)
283
if not self._normalize == 'L_ratio':
284
s += ' (not normalized)'
285
return s
286
287
def modular_symbol(self, r, sign=+1, quadratic_twist= +1):
288
r"""
289
Return the modular symbol evaluated at `r`.
290
This is used to compute this `p`-adic
291
L-series.
292
293
Note that the normalisation is not correct at this
294
stage: use ``_quotient_of periods_to_twist`` to correct.
295
296
Note also that this function does not check if the condition
297
on the quadratic_twist=D is satisfied. So the result will only
298
be correct if for each prime `\ell` dividing `D`, we have
299
`ord_{\ell(N)}<= ord_{\ell}(D)`, where `N` is the conductor of the curve.
300
301
INPUT:
302
303
- ``r`` - a cusp given as either a rational number or oo
304
305
- ``sign`` - +1 (default) or -1 (only implemented without twists)
306
307
- ``quadratic_twist`` - a fundamental discriminant of a quadratic field or +1 (default)
308
309
EXAMPLES::
310
311
sage: E = EllipticCurve('11a1')
312
sage: lp = E.padic_lseries(5)
313
sage: [lp.modular_symbol(r) for r in [0,1/5,oo,1/11]]
314
[1/5, 6/5, 0, 0]
315
sage: [lp.modular_symbol(r,sign=-1) for r in [0,1/3,oo,1/7]]
316
[0, 1, 0, -1]
317
sage: [lp.modular_symbol(r,quadratic_twist=-20) for r in [0,1/5,oo,1/11]]
318
[2, 2, 0, 1]
319
320
sage: lpt = E.quadratic_twist(-3).padic_lseries(5)
321
sage: et = E.padic_lseries(5)._quotient_of_periods_to_twist(-3)
322
sage: lpt.modular_symbol(0) == lp.modular_symbol(0,quadratic_twist=-3)/et
323
True
324
325
"""
326
if quadratic_twist == +1 :
327
if sign == +1 :
328
return self._modular_symbol(r)
329
elif sign == -1:
330
try:
331
m = self._negative_modular_symbol
332
except (KeyError, AttributeError):
333
if not hasattr(self, '_modular_symbol_negative'):
334
self.__add_negative_space()
335
m = self._negative_modular_symbol
336
return m(r)
337
else :
338
D = quadratic_twist
339
if sign == -1:
340
raise NotImplementedError, "Quadratic twists for negative modular symbols are not yet implemented."
341
if D > 0:
342
m = self._modular_symbol
343
s = +1
344
else:
345
try:
346
m = self._negative_modular_symbol
347
except (KeyError, AttributeError):
348
if not hasattr(self, '_modular_symbol_negative'):
349
self.__add_negative_space()
350
m = self._negative_modular_symbol
351
s = -1
352
# without the ZZ here the u is treated as a 'int' and dividing by D gives 0
353
# this only happens when it is called from __init__ (?)
354
return s * sum([kronecker_symbol(D,u) * m(r+ZZ(u)/D) for u in range(1,abs(D))])
355
356
357
def measure(self, a, n, prec, quadratic_twist=+1, sign = +1):
358
r"""
359
Return the measure on `\ZZ_p^{\times}` defined by
360
361
`\mu_{E,\alpha}^+ ( a + p^n \ZZ_p ) =
362
\frac{1}{\alpha^n} \left [\frac{a}{p^n}\right]^{+} -
363
\frac{1}{\alpha^{n+1}} \left[\frac{a}{p^{n-1}}\right]^{+}`
364
365
where `[\cdot]^{+}` is the modular symbol. This is used to define
366
this `p`-adic L-function (at least when the reduction is good).
367
368
The optional argument ``sign`` allows the minus symbol `[\cdot]^{-}` to
369
be substituted for the plus symbol.
370
371
The optional argument ``quadratic_twist`` replaces `E` by the twist in
372
the above formula, but the twisted modular symbol is computed using a
373
sum over modular symbols of `E` rather then finding the modular symbols
374
for the twist. Quadratic twists are only implemented if the sign is
375
`+1`.
376
377
Note that the normalisation is not correct at this
378
stage: use ``_quotient_of periods`` and ``_quotient_of periods_to_twist``
379
to correct.
380
381
Note also that this function does not check if the condition
382
on the ``quadratic_twist=D`` is satisfied. So the result will only
383
be correct if for each prime `\ell` dividing `D`, we have
384
`ord_{\ell}(N)<= ord_{\ell}(D)`, where `N` is the conductor of the curve.
385
386
INPUT:
387
388
- ``a`` - an integer
389
390
- ``n`` - a non-negative integer
391
392
- ``prec`` - an integer
393
394
- ``quadratic_twist`` (default = 1) - a fundamental discriminant of a quadratic field,
395
should be coprime to the conductor of `E`
396
397
- ``sign`` (default = 1) - an integer, which should be `\pm 1`.
398
399
EXAMPLES::
400
401
sage: E = EllipticCurve('37a')
402
sage: L = E.padic_lseries(5)
403
sage: L.measure(1,2, prec=9)
404
2 + 3*5 + 4*5^3 + 2*5^4 + 3*5^5 + 3*5^6 + 4*5^7 + 4*5^8 + O(5^9)
405
sage: L.measure(1,2, quadratic_twist=8,prec=15)
406
O(5^15)
407
sage: L.measure(1,2, quadratic_twist=-4,prec=15)
408
4 + 4*5 + 4*5^2 + 3*5^3 + 2*5^4 + 5^5 + 3*5^6 + 5^8 + 2*5^9 + 3*5^12 + 2*5^13 + 4*5^14 + O(5^15)
409
410
sage: E = EllipticCurve('11a1')
411
sage: a = E.quadratic_twist(-3).padic_lseries(5).measure(1,2,prec=15)
412
sage: b = E.padic_lseries(5).measure(1,2, quadratic_twist=-3,prec=15)
413
sage: a == b/E.padic_lseries(5)._quotient_of_periods_to_twist(-3)
414
True
415
416
"""
417
s = ZZ(sign)
418
if s not in [1, -1]:
419
raise ValueError, "Sign must be +- 1"
420
if quadratic_twist != 1 and s != 1:
421
raise NotImplementedError, "Quadratic twists not implemented for sign -1"
422
423
if quadratic_twist < 0:
424
s = -1
425
426
try:
427
p, alpha, z, w, f = self.__measure_data[(n,prec,s)]
428
except (KeyError, AttributeError):
429
if not hasattr(self, '__measure_data'):
430
self.__measure_data = {}
431
p = self._p
432
alpha = self.alpha(prec=prec)
433
z = 1/(alpha**n)
434
w = p**(n-1)
435
if s == +1 :
436
f = self._modular_symbol
437
else :
438
try :
439
f = self._negative_modular_symbol
440
except (KeyError, AttributeError):
441
if not hasattr(self, '_modular_symbol_negative'):
442
self.__add_negative_space()
443
f = self._negative_modular_symbol
444
self.__measure_data[(n,prec,s)] = (p,alpha,z,w,f)
445
446
if quadratic_twist == 1:
447
if self._E.conductor() % p == 0:
448
return z * f(a/(p*w))
449
return z * f(a/(p*w)) - (z/alpha) * f(a/w)
450
else:
451
D = quadratic_twist
452
chip = kronecker_symbol(D,p)
453
if self._E.conductor() % p == 0:
454
mu = chip**n * z * sum([kronecker_symbol(D,u) * f(a/(p*w)+ZZ(u)/D) for u in range(1,abs(D))])
455
else:
456
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))])
457
return s*mu
458
459
def alpha(self, prec=20):
460
r"""
461
Return a `p`-adic root `\alpha` of the polynomial `x^2 - a_p x
462
+ p` with `ord_p(\alpha) < 1`. In the ordinary case this is
463
just the unit root.
464
465
INPUT:
466
- ``prec`` - positive integer, the `p`-adic precision of the root.
467
468
EXAMPLES:
469
Consider the elliptic curve 37a::
470
471
sage: E = EllipticCurve('37a')
472
473
An ordinary prime::
474
475
sage: L = E.padic_lseries(5)
476
sage: alpha = L.alpha(10); alpha
477
3 + 2*5 + 4*5^2 + 2*5^3 + 5^4 + 4*5^5 + 2*5^7 + 5^8 + 5^9 + O(5^10)
478
sage: alpha^2 - E.ap(5)*alpha + 5
479
O(5^10)
480
481
A supersingular prime::
482
483
sage: L = E.padic_lseries(3)
484
sage: alpha = L.alpha(10); alpha
485
(1 + O(3^10))*alpha
486
sage: alpha^2 - E.ap(3)*alpha + 3
487
(O(3^10))*alpha^2 + (O(3^11))*alpha + (O(3^11))
488
489
A reducible prime::
490
491
sage: L = EllipticCurve('11a').padic_lseries(5)
492
sage: L.alpha(5)
493
1 + 4*5 + 3*5^2 + 2*5^3 + 4*5^4 + O(5^5)
494
"""
495
try:
496
return self._alpha[prec]
497
except AttributeError:
498
self._alpha = {}
499
except KeyError:
500
pass
501
E = self._E
502
p = self._p
503
a_p = E.ap(p)
504
K = Qp(p, prec, print_mode='series')
505
506
if E.conductor() % p == 0:
507
self._alpha[prec] = K(a_p)
508
return K(a_p)
509
510
R = ZZ['x']
511
f = R([p, -a_p, 1])
512
if E.is_ordinary(p):
513
G = f.factor_padic(p, prec+5)
514
for pr, e in G:
515
a = -pr[0]
516
if a.valuation() < 1:
517
self._alpha[prec] = K(a)
518
return K(a)
519
raise ValueError, "bug in p-adic L-function alpha"
520
else: # supersingular case
521
f = f.change_ring(Qp(p, prec, print_mode='series'))
522
a = f.root_field('alpha', check_irreducible=False).gen()
523
self._alpha[prec] = a
524
return a
525
526
def order_of_vanishing(self):
527
r"""
528
Return the order of vanishing of this `p`-adic L-series.
529
530
The output of this function is provably correct, due to a
531
theorem of Kato [Ka].
532
533
NOTE: currently `p` must be a prime of good ordinary reduction.
534
535
REFERENCES:
536
537
- [MTT] B. Mazur, J. Tate, and J. Teitelbaum,
538
On `p`-adic analogues of the conjectures of Birch and
539
Swinnerton-Dyer, Inventiones mathematicae 84, (1986), 1-48.
540
541
- [Ka] Kayuza Kato, `p`-adic Hodge theory and values of zeta functions of modular
542
forms, Cohomologies `p`-adiques et applications arithmetiques III,
543
Asterisque vol 295, SMF, Paris, 2004.
544
545
EXAMPLES::
546
547
sage: L = EllipticCurve('11a').padic_lseries(3)
548
sage: L.order_of_vanishing()
549
0
550
sage: L = EllipticCurve('11a').padic_lseries(5)
551
sage: L.order_of_vanishing()
552
0
553
sage: L = EllipticCurve('37a').padic_lseries(5)
554
sage: L.order_of_vanishing()
555
1
556
sage: L = EllipticCurve('43a').padic_lseries(3)
557
sage: L.order_of_vanishing()
558
1
559
sage: L = EllipticCurve('37b').padic_lseries(3)
560
sage: L.order_of_vanishing()
561
0
562
sage: L = EllipticCurve('389a').padic_lseries(3)
563
sage: L.order_of_vanishing()
564
2
565
sage: L = EllipticCurve('389a').padic_lseries(5)
566
sage: L.order_of_vanishing()
567
2
568
sage: L = EllipticCurve('5077a').padic_lseries(5, use_eclib=True)
569
sage: L.order_of_vanishing()
570
3
571
"""
572
try:
573
return self.__ord
574
except AttributeError:
575
pass
576
577
if not self.is_ordinary():
578
raise NotImplementedError
579
E = self.elliptic_curve()
580
if not E.is_good(self.prime()):
581
raise ValueError, "prime must be of good reduction"
582
r = E.rank()
583
n = 1
584
while True:
585
f = self.series(n)
586
v = f.valuation()
587
if v < r:
588
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)
589
if v == r:
590
self.__ord = v
591
return v
592
n += 1
593
594
595
# def _c_bounds(self, n):
596
# raise NotImplementedError
597
598
# def _prec_bounds(self, n,prec):
599
# raise NotImplementedError
600
601
def teichmuller(self, prec):
602
r"""
603
Return Teichmuller lifts to the given precision.
604
605
INPUT:
606
607
- ``prec`` - a positive integer.
608
609
OUTPUT:
610
611
- a list of `p`-adic numbers, the cached Teichmuller lifts
612
613
EXAMPLES::
614
615
sage: L = EllipticCurve('11a').padic_lseries(7)
616
sage: L.teichmuller(1)
617
[0, 1, 2, 3, 4, 5, 6]
618
sage: L.teichmuller(2)
619
[0, 1, 30, 31, 18, 19, 48]
620
"""
621
p = self._p
622
K = Qp(p, prec, print_mode='series')
623
return [Integer(0)] + \
624
[a.residue(prec).lift() for a in K.teichmuller_system()]
625
626
def _e_bounds(self, n, prec):
627
r"""
628
A helper function not designed for direct use.
629
630
It computes the valuations of the coefficients of `\omega_n = (1+T)^{p^n}-1`.
631
632
EXAMPLES::
633
634
sage: E = EllipticCurve('11a1')
635
sage: Lp = E.padic_lseries(2)
636
sage: Lp._e_bounds(1,10)
637
[+Infinity, 1, 0, 0, 0, 0, 0, 0, 0, 0]
638
sage: Lp._e_bounds(2,10)
639
[+Infinity, 2, 1, 1, 0, 0, 0, 0, 0, 0]
640
sage: Lp._e_bounds(3,10)
641
[+Infinity, 3, 2, 2, 1, 1, 1, 1, 0, 0]
642
sage: Lp._e_bounds(4,10)
643
[+Infinity, 4, 3, 3, 2, 2, 2, 2, 1, 1]
644
"""
645
# trac 10280: replace with new corrected code, note that the sequence has to be decreasing.
646
pn = self._p**n
647
enj = infinity
648
res = [enj]
649
for j in range(1,prec):
650
bino = valuation(binomial(pn,j),self._p)
651
if bino < enj:
652
enj = bino
653
res.append(enj)
654
return res
655
656
def _get_series_from_cache(self, n, prec, D, eta):
657
r"""
658
A helper function not designed for direct use.
659
660
It picks up the series in the cache if it has been previously computed.
661
662
EXAMPLES::
663
664
sage: E = EllipticCurve('11a1')
665
sage: Lp = E.padic_lseries(5)
666
sage: Lp._get_series_from_cache(3,5,1,0)
667
sage: Lp.series(3,prec=5)
668
5 + 4*5^2 + 4*5^3 + O(5^4) + O(5)*T + O(5)*T^2 + O(5)*T^3 + O(5)*T^4 + O(T^5)
669
sage: Lp._get_series_from_cache(3,5,1,0)
670
5 + 4*5^2 + 4*5^3 + O(5^4) + O(5)*T + O(5)*T^2 + O(5)*T^3 + O(5)*T^4 + O(T^5)
671
"""
672
try:
673
return self.__series[(n,prec,D,eta)]
674
except AttributeError:
675
self.__series = {}
676
except KeyError:
677
for _n, _prec, _D, _eta in self.__series.keys():
678
if _n == n and _D == D and _eta == eta and _prec >= prec:
679
return self.__series[(_n,_prec,_D,_eta)].add_bigoh(prec)
680
return None
681
682
def _set_series_in_cache(self, n, prec, D, eta, f):
683
r"""
684
A helper function not designed for direct use.
685
686
It picks up the series in the cache if it has been previously computed.
687
688
EXAMPLES::
689
690
sage: E = EllipticCurve('11a1')
691
sage: Lp = E.padic_lseries(5)
692
sage: Lp.series(3,prec=5)
693
5 + 4*5^2 + 4*5^3 + O(5^4) + O(5)*T + O(5)*T^2 + O(5)*T^3 + O(5)*T^4 + O(T^5)
694
sage: Lp._set_series_in_cache(3,5,1,0,0)
695
sage: Lp.series(3,prec=5)
696
0
697
"""
698
self.__series[(n,prec,D, eta)] = f
699
700
701
def _quotient_of_periods_to_twist(self,D):
702
r"""
703
For a fundamental discriminant `D` of a quadratic number field this computes the constant `\eta` such that
704
`\sqrt{D}\cdot\Omega_{E_D}^{+} =\eta\cdot \Omega_E^{sign(D)}`. As in [MTT]_ page 40.
705
This is either 1 or 2 unless the condition on the twist is not satisfied, e.g. if we are 'twisting back'
706
to a semi-stable curve.
707
708
REFERENCES:
709
710
- [MTT] B. Mazur, J. Tate, and J. Teitelbaum,
711
On `p`-adic analogues of the conjectures of Birch and
712
Swinnerton-Dyer, Invertiones mathematicae 84, (1986), 1-48.
713
714
.. note: No check on precision is made, so this may fail for huge `D`.
715
716
EXAMPLES::
717
718
sage: E = EllipticCurve('37b1')
719
sage: lp = E.padic_lseries(3)
720
sage: lp._quotient_of_periods_to_twist(-20)
721
1
722
sage: lp._quotient_of_periods_to_twist(-4)
723
1
724
sage: lp._quotient_of_periods_to_twist(-3)
725
1
726
sage: lp._quotient_of_periods_to_twist(-8)
727
2
728
sage: lp._quotient_of_periods_to_twist(8)
729
2
730
sage: lp._quotient_of_periods_to_twist(5)
731
1
732
sage: lp._quotient_of_periods_to_twist(12)
733
1
734
735
sage: E = EllipticCurve('11a1')
736
sage: Et = E.quadratic_twist(-3)
737
sage: lpt = Et.padic_lseries(5)
738
sage: lpt._quotient_of_periods_to_twist(-3)
739
6
740
741
"""
742
from sage.functions.all import sqrt
743
# This funciton does not depend on p and could be moved out of this file but it is needed only here
744
745
# Note that the number of real components does not change by twisting.
746
if D == 1:
747
return 1
748
if D > 1:
749
Et = self._E.quadratic_twist(D)
750
qt = Et.period_lattice().basis()[0]/self._E.period_lattice().basis()[0]
751
qt *= sqrt(qt.parent()(D))
752
else:
753
Et = self._E.quadratic_twist(D)
754
qt = Et.period_lattice().basis()[0]/self._E.period_lattice().basis()[1].imag()
755
qt *= sqrt(qt.parent()(-D))
756
verbose('the real approximation is %s'%qt)
757
# we know from MTT that the result has a denominator 1
758
return QQ(int(round(8*qt)))/8
759
760
761
class pAdicLseriesOrdinary(pAdicLseries):
762
def series(self, n=2, quadratic_twist=+1, prec=5, eta=0):
763
r"""
764
Returns the `n`-th approximation to the `p`-adic L-series, in the
765
component corresponding to the `\eta`-th power of the Teichmueller
766
character, as a power series in `T` (corresponding to `\gamma-1` with
767
`\gamma=1+p` as a generator of `1+p\ZZ_p`). Each coefficient is a
768
`p`-adic number whose precision is provably correct.
769
770
Here the normalization of the `p`-adic L-series is chosen
771
such that `L_p(E,1) = (1-1/\alpha)^2 L(E,1)/\Omega_E`
772
where `\alpha` is the unit root of the characteristic
773
polynomial of Frobenius on `T_pE` and `\Omega_E` is the
774
Neron period of `E`.
775
776
INPUT:
777
778
- ``n`` - (default: 2) a positive integer
779
- ``quadratic_twist`` - (default: +1) a fundamental discriminant of a
780
quadratic field, coprime to the conductor of the curve
781
- ``prec`` - (default: 5) maximal number of terms of the series to
782
compute; to compute as many as possible just give a very large
783
number for ``prec``; the result will still be correct.
784
- ``eta`` (default: 0) an integer (specifying the power of the
785
Teichmueller character on the group of roots of unity in
786
`\ZZ_p^\times`)
787
788
ALIAS: power_series is identical to series.
789
790
EXAMPLES:
791
We compute some `p`-adic L-functions associated to the elliptic
792
curve 11a::
793
794
sage: E = EllipticCurve('11a')
795
sage: p = 3
796
sage: E.is_ordinary(p)
797
True
798
sage: L = E.padic_lseries(p)
799
sage: L.series(3)
800
2 + 3 + 3^2 + 2*3^3 + O(3^5) + (1 + 3 + O(3^2))*T + (1 + 2*3 + O(3^2))*T^2 + O(3)*T^3 + O(3)*T^4 + O(T^5)
801
802
Another example at a prime of bad reduction, where the
803
`p`-adic L-function has an extra 0 (compared to the non
804
`p`-adic L-function)::
805
806
sage: E = EllipticCurve('11a')
807
sage: p = 11
808
sage: E.is_ordinary(p)
809
True
810
sage: L = E.padic_lseries(p)
811
sage: L.series(2)
812
O(11^4) + (10 + O(11))*T + (6 + O(11))*T^2 + (2 + O(11))*T^3 + (5 + O(11))*T^4 + O(T^5)
813
814
We compute a `p`-adic L-function that vanishes to order 2::
815
816
sage: E = EllipticCurve('389a')
817
sage: p = 3
818
sage: E.is_ordinary(p)
819
True
820
sage: L = E.padic_lseries(p)
821
sage: L.series(1)
822
O(T^1)
823
sage: L.series(2)
824
O(3^4) + O(3)*T + (2 + O(3))*T^2 + O(T^3)
825
sage: L.series(3)
826
O(3^5) + O(3^2)*T + (2 + 2*3 + O(3^2))*T^2 + (2 + O(3))*T^3 + (1 + O(3))*T^4 + O(T^5)
827
828
Checks if the precision can be changed (trac 5846)::
829
830
sage: L.series(3,prec=4)
831
O(3^5) + O(3^2)*T + (2 + 2*3 + O(3^2))*T^2 + (2 + O(3))*T^3 + O(T^4)
832
sage: L.series(3,prec=6)
833
O(3^5) + O(3^2)*T + (2 + 2*3 + O(3^2))*T^2 + (2 + O(3))*T^3 + (1 + O(3))*T^4 + (1 + O(3))*T^5 + O(T^6)
834
835
Rather than computing the `p`-adic L-function for the curve '15523a1', one can
836
compute it as a quadratic_twist::
837
838
sage: E = EllipticCurve('43a1')
839
sage: lp = E.padic_lseries(3)
840
sage: lp.series(2,quadratic_twist=-19)
841
2 + 2*3 + 2*3^2 + O(3^4) + (1 + O(3))*T + (1 + O(3))*T^2 + O(T^3)
842
sage: E.quadratic_twist(-19).label() #optional --- conductor is greater than 10000
843
'15523a1'
844
845
This proves that the rank of '15523a1' is zero, even if ``mwrank`` can not determine this.
846
847
We calculate the `L`-series in the nontrivial Teichmueller components::
848
849
sage: L = EllipticCurve('110a1').padic_lseries(5)
850
sage: for j in [0..3]: print L.series(4, eta=j)
851
O(5^6) + (2 + 2*5 + 2*5^2 + O(5^3))*T + (5 + 5^2 + O(5^3))*T^2 + (4 + 4*5 + 2*5^2 + O(5^3))*T^3 + (1 + 5 + 3*5^2 + O(5^3))*T^4 + O(T^5)
852
3 + 2*5 + 2*5^3 + 3*5^4 + O(5^6) + (2 + 5 + 4*5^2 + O(5^3))*T + (1 + 4*5 + 2*5^2 + O(5^3))*T^2 + (1 + 5 + 5^2 + O(5^3))*T^3 + (2 + 4*5 + 4*5^2 + O(5^3))*T^4 + O(T^5)
853
2 + O(5^6) + (1 + 5 + O(5^3))*T + (2 + 4*5 + 3*5^2 + O(5^3))*T^2 + (4 + 5 + 2*5^2 + O(5^3))*T^3 + (4 + O(5^3))*T^4 + O(T^5)
854
1 + 3*5 + 4*5^2 + 2*5^3 + 5^4 + 4*5^5 + O(5^6) + (2 + 4*5 + 3*5^2 + O(5^3))*T + (2 + 3*5 + 5^2 + O(5^3))*T^2 + (1 + O(5^3))*T^3 + (2*5 + 2*5^2 + O(5^3))*T^4 + O(T^5)
855
"""
856
n = ZZ(n)
857
if n < 1:
858
raise ValueError, "n (=%s) must be a positive integer"%n
859
eta = ZZ(eta) % (self._p - 1)
860
861
# check if the conditions on quadratic_twist are satisfied
862
D = ZZ(quadratic_twist)
863
if D != 1:
864
if eta != 0: raise NotImplementedError, "quadratic twists only implemented for the 0th Teichmueller component"
865
if D % 4 == 0:
866
d = D//4
867
if not d.is_squarefree() or d % 4 == 1:
868
raise ValueError, "quadratic_twist (=%s) must be a fundamental discriminant of a quadratic field"%D
869
else:
870
if not D.is_squarefree() or D % 4 != 1:
871
raise ValueError, "quadratic_twist (=%s) must be a fundamental discriminant of a quadratic field"%D
872
if gcd(D,self._p) != 1:
873
raise ValueError, "quadratic twist (=%s) must be coprime to p (=%s) "%(D,self._p)
874
if gcd(D,self._E.conductor())!= 1:
875
for ell in prime_divisors(D):
876
if valuation(self._E.conductor(),ell) > valuation(D,ell) :
877
raise ValueError, "can not twist a curve of conductor (=%s) by the quadratic twist (=%s)."%(self._E.conductor(),D)
878
879
880
p = self._p
881
if p == 2 and self._normalize :
882
print 'Warning : For p=2 the normalization might not be correct !'
883
#verbose("computing L-series for p=%s, n=%s, and prec=%s"%(p,n,prec))
884
885
bounds = self._prec_bounds(n,prec)
886
padic_prec = max(bounds[1:]) + 5
887
verbose("using p-adic precision of %s"%padic_prec)
888
889
res_series_prec = min(p**(n-1), prec)
890
verbose("using series precision of %s"%res_series_prec)
891
892
ans = self._get_series_from_cache(n, res_series_prec,D,eta)
893
if not ans is None:
894
verbose("found series in cache")
895
return ans
896
897
K = QQ
898
gamma = K(1 + p)
899
R = PowerSeriesRing(K,'T',res_series_prec)
900
T = R(R.gen(),res_series_prec )
901
L = R(0)
902
one_plus_T_factor = R(1)
903
gamma_power = K(1)
904
teich = self.teichmuller(padic_prec)
905
p_power = p**(n-1)
906
907
verbose("Now iterating over %s summands"%((p-1)*p_power))
908
verbose_level = get_verbose()
909
count_verb = 0
910
for j in range(p_power):
911
s = K(0)
912
if verbose_level >= 2 and j/p_power*100 > count_verb + 3:
913
verbose("%.2f percent done"%(float(j)/p_power*100))
914
count_verb += 3
915
for a in range(1,p):
916
b = teich[a] * gamma_power
917
s += teich[a]**eta * self.measure(b, n, padic_prec,quadratic_twist=D, sign = 1-2*(eta % 2)).lift()
918
L += s * one_plus_T_factor
919
one_plus_T_factor *= 1+T
920
gamma_power *= gamma
921
922
verbose("the series before adjusting the precision is %s"%L)
923
# Now create series but with each coefficient truncated
924
# so it is proven correct:
925
K = Qp(p, padic_prec, print_mode='series')
926
R = PowerSeriesRing(K,'T',res_series_prec)
927
L = R(L,res_series_prec)
928
aj = L.list()
929
if len(aj) > 0:
930
aj = [aj[0].add_bigoh(padic_prec-2)] + [aj[j].add_bigoh(bounds[j]) for j in range(1,len(aj))]
931
L = R(aj,res_series_prec )
932
933
L /= self._quotient_of_periods_to_twist(D)*self._E.real_components()
934
935
self._set_series_in_cache(n, res_series_prec, D, eta, L)
936
937
return L
938
939
power_series = series
940
941
942
def is_ordinary(self):
943
r"""
944
Return True if the elliptic curve that this L-function is attached
945
to is ordinary.
946
947
EXAMPLES::
948
949
sage: L = EllipticCurve('11a').padic_lseries(5)
950
sage: L.is_ordinary()
951
True
952
"""
953
return True
954
955
def is_supersingular(self):
956
r"""
957
Return True if the elliptic curve that this L function is attached
958
to is supersingular.
959
960
EXAMPLES::
961
962
sage: L = EllipticCurve('11a').padic_lseries(5)
963
sage: L.is_supersingular()
964
False
965
"""
966
return False
967
968
def _c_bound(self):
969
r"""
970
A helper function not designed for direct use.
971
972
It returns the maximal `p`-adic valuation of the possible denominators
973
of the modular symbols.
974
975
EXAMPLES::
976
977
sage: E = EllipticCurve('11a1')
978
sage: Lp = E.padic_lseries(5)
979
sage: Lp._c_bound()
980
1
981
sage: Lp = E.padic_lseries(17)
982
sage: Lp._c_bound()
983
0
984
985
"""
986
try:
987
return self.__c_bound
988
except AttributeError:
989
pass
990
E = self._E
991
p = self._p
992
if E.galois_representation().is_irreducible(p):
993
ans = 0
994
else:
995
m = E.modular_symbol_space(sign=1)
996
b = m.boundary_map().codomain()
997
C = b._known_cusps() # all known, since computed the boundary map
998
ans = max([valuation(self.modular_symbol(a).denominator(), p) for a in C])
999
self.__c_bound = ans
1000
return ans
1001
1002
def _prec_bounds(self, n, prec):
1003
r"""
1004
A helper function not designed for direct use.
1005
1006
It returns the `p`-adic precisions of the approximation
1007
to the `p`-adic L-function.
1008
1009
EXAMPLES::
1010
1011
sage: E = EllipticCurve('11a1')
1012
sage: Lp = E.padic_lseries(5)
1013
sage: Lp._prec_bounds(3,10)
1014
[+Infinity, 1, 1, 1, 1, 0, 0, 0, 0, 0]
1015
sage: Lp._prec_bounds(3,12)
1016
[+Infinity, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0]
1017
sage: Lp._prec_bounds(4,5)
1018
[+Infinity, 2, 2, 2, 2]
1019
sage: Lp._prec_bounds(15,10)
1020
[+Infinity, 13, 13, 13, 13, 12, 12, 12, 12, 12]
1021
1022
sage: Lp = E.padic_lseries(3)
1023
sage: Lp._prec_bounds(15,10)
1024
[+Infinity, 14, 14, 13, 13, 13, 13, 13, 13, 12]
1025
1026
"""
1027
p = self._p
1028
e = self._e_bounds(n-1, prec)
1029
c = self._c_bound()
1030
return [e[j] - c for j in range(len(e))]
1031
1032
1033
class pAdicLseriesSupersingular(pAdicLseries):
1034
def series(self, n=3, quadratic_twist = +1, prec=5, eta = 0):
1035
r"""
1036
Return the `n`-th approximation to the `p`-adic L-series as a
1037
power series in `T` (corresponding to `\gamma-1` with
1038
`\gamma=1+p` as a generator of `1+p\ZZ_p`). Each
1039
coefficient is an element of a quadratic extension of the `p`-adic
1040
number whose precision is probably correct.
1041
1042
Here the normalization of the `p`-adic L-series is chosen
1043
such that `L_p(E,1) = (1-1/\alpha)^2 L(E,1)/\Omega_E`
1044
where `\alpha` is the unit root of the characteristic
1045
polynomial of Frobenius on `T_pE` and `\Omega_E` is the
1046
Neron period of `E`.
1047
1048
INPUT:
1049
1050
- ``n`` - (default: 2) a positive integer
1051
- ``quadratic_twist`` - (default: +1) a fundamental discriminant of a
1052
quadratic field, coprime to the conductor of the curve
1053
- ``prec`` - (default: 5) maximal number of terms of the series to
1054
compute; to compute as many as possible just give a very large
1055
number for ``prec``; the result will still be correct.
1056
- ``eta`` (default: 0) an integer (specifying the power of the
1057
Teichmueller character on the group of roots of unity in
1058
`\ZZ_p^\times`)
1059
1060
ALIAS: power_series is identical to series.
1061
1062
EXAMPLES:
1063
A superingular example, where we must compute to higher precision to see anything::
1064
1065
sage: e = EllipticCurve('37a')
1066
sage: L = e.padic_lseries(3); L
1067
3-adic L-series of Elliptic Curve defined by y^2 + y = x^3 - x over Rational Field
1068
sage: L.series(2)
1069
O(T^3)
1070
sage: L.series(4) # takes a long time (several seconds)
1071
(O(3))*alpha + (O(3^2)) + ((O(3^-1))*alpha + (2*3^-1 + O(3^0)))*T + ((O(3^-1))*alpha + (2*3^-1 + O(3^0)))*T^2 + O(T^5)
1072
sage: L.alpha(2).parent()
1073
Univariate Quotient Polynomial Ring in alpha over 3-adic Field with capped
1074
relative precision 2 with modulus (1 + O(3^2))*x^2 + (3 + O(3^3))*x + (3 + O(3^3))
1075
"""
1076
n = ZZ(n)
1077
if n < 1:
1078
raise ValueError, "n (=%s) must be a positive integer"%n
1079
1080
# check if the conditions on quadratic_twist are satisfied
1081
D = ZZ(quadratic_twist)
1082
if D != 1:
1083
if eta != 0: raise NotImplementedError, "quadratic twists only implemented for the 0th Teichmueller component"
1084
if D % 4 == 0:
1085
d = D//4
1086
if not d.is_squarefree() or d % 4 == 1:
1087
raise ValueError, "quadratic_twist (=%s) must be a fundamental discriminant of a quadratic field"%D
1088
else:
1089
if not D.is_squarefree() or D % 4 != 1:
1090
raise ValueError, "quadratic_twist (=%s) must be a fundamental discriminant of a quadratic field"%D
1091
if gcd(D,self._E.conductor())!= 1:
1092
for ell in prime_divisors(D):
1093
if valuation(self._E.conductor(),ell) > valuation(D,ell) :
1094
raise ValueError, "can not twist a curve of conductor (=%s) by the quadratic twist (=%s)."%(self._E.conductor(),D)
1095
1096
p = self._p
1097
if p == 2 and self._normalize :
1098
print 'Warning : for p == 2 the normalization might not be correct !'
1099
eta = ZZ(eta) % (p-1)
1100
1101
prec = min(p**(n-1), prec)
1102
bounds = self._prec_bounds(n,prec)
1103
padic_prec = max(sum(bounds[1:],[])) + 5
1104
verbose("using p-adic precision of %s"%padic_prec)
1105
ans = self._get_series_from_cache(n, prec, quadratic_twist,eta)
1106
if not ans is None:
1107
verbose("found series in cache")
1108
return ans
1109
1110
alpha = self.alpha(prec=padic_prec)
1111
K = alpha.parent()
1112
gamma = 1 + p
1113
R = PowerSeriesRing(K,'T',prec)
1114
T = R(R.gen(), prec)
1115
L = R(0)
1116
one_plus_T_factor = R(1)
1117
gamma_power = 1
1118
teich = self.teichmuller(padic_prec)
1119
1120
verbose("Now iterating over %s summands"%((p-1)*p**(n-1)))
1121
verbose_level = get_verbose()
1122
count_verb = 0
1123
for j in range(p**(n-1)):
1124
s = K(0)
1125
if verbose_level >= 2 and j/p**(n-1)*100 > count_verb + 3:
1126
verbose("%.2f percent done"%(float(j)/p**(n-1)*100))
1127
count_verb += 3
1128
for a in range(1,p):
1129
b = teich[a] * gamma_power
1130
s += teich[a]**eta * self.measure(b, n, padic_prec,quadratic_twist=D, sign=1-2*(eta % 2))
1131
L += s * one_plus_T_factor
1132
one_plus_T_factor *= 1+T
1133
gamma_power *= gamma
1134
1135
# Now create series but with each coefficient truncated
1136
# so it is proven correct:
1137
L = R(L,prec)
1138
aj = L.list()
1139
if len(aj) > 0:
1140
bj = [aj[0][0].add_bigoh(padic_prec-2) + alpha * aj[0][1].add_bigoh(padic_prec-2)]
1141
bj += [aj[j][0].add_bigoh(bounds[j][0]) + alpha * aj[j][1].add_bigoh(bounds[j][1]) for j in range(1,len(aj))]
1142
L = R(bj, prec)
1143
L /= self._quotient_of_periods_to_twist(D)*self._E.real_components()
1144
self._set_series_in_cache(n, prec, quadratic_twist, eta, L)
1145
return L
1146
1147
power_series = series
1148
1149
def is_ordinary(self):
1150
r"""
1151
Return True if the elliptic curve that this L-function is attached
1152
to is ordinary.
1153
1154
EXAMPLES::
1155
1156
sage: L = EllipticCurve('11a').padic_lseries(19)
1157
sage: L.is_ordinary()
1158
False
1159
"""
1160
return False
1161
1162
def is_supersingular(self):
1163
r"""
1164
Return True if the elliptic curve that this L function is attached
1165
to is supersingular.
1166
1167
EXAMPLES::
1168
1169
sage: L = EllipticCurve('11a').padic_lseries(19)
1170
sage: L.is_supersingular()
1171
True
1172
"""
1173
return True
1174
1175
def _prec_bounds(self, n,prec):
1176
r"""
1177
A helper function not designed for direct use.
1178
1179
It returns the `p`-adic precisions of the approximation
1180
to the `p`-adic L-function.
1181
1182
EXAMPLES::
1183
1184
sage: E = EllipticCurve('11a1')
1185
sage: Lp = E.padic_lseries(19)
1186
sage: Lp._prec_bounds(3,5)
1187
[[+Infinity, +Infinity], [-1, -1], [-1, -1], [-1, -1], [-1, -1]]
1188
sage: Lp._prec_bounds(2,5)
1189
[[+Infinity, +Infinity], [-1, -2], [-1, -2], [-1, -2], [-1, -2]]
1190
sage: Lp._prec_bounds(10,5)
1191
[[+Infinity, +Infinity], [3, 2], [3, 2], [3, 2], [3, 2]]
1192
"""
1193
p = self._p
1194
e = self._e_bounds(n-1,prec)
1195
c0 = ZZ(n+2)/2
1196
c1 = ZZ(n+3)/2
1197
return [[infinity,infinity]] + [[(e[j] - c0).floor(), (e[j] - c1).floor()] for j in range(1,len(e))]
1198
1199
1200
def Dp_valued_series(self, n=3, quadratic_twist = +1, prec=5):
1201
r"""
1202
Returns a vector of two components which are p-adic power series.
1203
The answer v is such that
1204
1205
`(1-\varphi)^{-2}\cdot L_p(E,T) =` ``v[1]`` `\cdot \omega +` ``v[2]`` `\cdot \varphi(\omega)`
1206
1207
as an element of the Dieudonne module `D_p(E) = H^1_{dR}(E/\QQ_p)` where
1208
`\omega` is the invariant differential and `\varphi` is the Frobenius on `D_p(E)`.
1209
According to the `p`-adic Birch and Swinnerton-Dyer
1210
conjecture [BP] this function has a zero of order
1211
rank of `E(\QQ)` and it's leading term is contains the order of
1212
the Tate-Shafarevich group, the Tamagawa numbers, the order of the
1213
torsion subgroup and the `D_p`-valued `p`-adic regulator.
1214
1215
INPUT:
1216
1217
- ``n`` - (default: 3) a positive integer
1218
- ``prec`` - (default: 5) a positive integer
1219
1220
REFERENCE:
1221
1222
- [BP] Dominique Bernardi and Bernadette Perrin-Riou,
1223
Variante `p`-adique de la conjecture de Birch et
1224
Swinnerton-Dyer (le cas supersingulier), C. R. Acad. Sci. Paris,
1225
Ser I. Math, 317 (1993), no 3, 227-232.
1226
1227
EXAMPLES::
1228
1229
sage: E = EllipticCurve('14a')
1230
sage: L = E.padic_lseries(5)
1231
sage: L.Dp_valued_series(4) # long time (9s on sage.math, 2011)
1232
(1 + 4*5 + 4*5^3 + O(5^4) + (4 + O(5))*T + (1 + O(5))*T^2 + (4 + O(5))*T^3 + (2 + O(5))*T^4 + O(T^5), O(5^4) + O(5)*T + O(5)*T^2 + O(5)*T^3 + (2 + O(5))*T^4 + O(T^5))
1233
"""
1234
E = self._E
1235
p = self._p
1236
lps = self.series(n, quadratic_twist=quadratic_twist, prec=prec)
1237
1238
# now split up the series in two lps = G + H * alpha
1239
R = lps.base_ring().base_ring() # Qp
1240
QpT , T = PowerSeriesRing(R,'T',prec).objgen()
1241
G = QpT([lps[n][0] for n in range(0,lps.prec())], prec)
1242
H = QpT([lps[n][1] for n in range(0,lps.prec())], prec)
1243
1244
# now compute phi
1245
phi = matrix.matrix([[0,-1/p],[1,E.ap(p)/p]])
1246
lpv = vector([G + (E.ap(p))*H , - R(p) * H ]) # this is L_p
1247
eps = (1-phi)**(-2)
1248
resu = lpv*eps.transpose()
1249
return resu
1250
1251
1252
@rename_keyword(deprecated='Sage version 4.6', method="algorithm")
1253
def frobenius(self, prec=20, algorithm = "mw"):
1254
r"""
1255
This returns a geometric Frobenius `\varphi` on the Diedonne module `D_p(E)`
1256
with respect to the basis `\omega`, the invariant differential, and `\eta=x\omega`.
1257
It satisfies `\varphi^2 - a_p/p\, \varphi + 1/p = 0`.
1258
1259
INPUT:
1260
1261
- ``prec`` - (default: 20) a positive integer
1262
1263
- ``algorithm`` - either 'mw' (default) for Monsky-Washintzer
1264
or 'approx' for the algorithm described by Bernardi and Perrin-Riou
1265
(much slower and not fully tested)
1266
1267
1268
EXAMPLES::
1269
1270
sage: E = EllipticCurve('14a')
1271
sage: L = E.padic_lseries(5)
1272
sage: phi = L.frobenius(5)
1273
sage: phi
1274
[ 2 + 5^2 + 5^4 + O(5^5) 3*5^-1 + 3 + 5 + 4*5^2 + 5^3 + O(5^4)]
1275
[ 3 + 3*5^2 + 4*5^3 + 3*5^4 + O(5^5) 3 + 4*5 + 3*5^2 + 4*5^3 + 3*5^4 + O(5^5)]
1276
sage: -phi^2
1277
[5^-1 + O(5^4) O(5^4)]
1278
[ O(5^5) 5^-1 + O(5^4)]
1279
"""
1280
E = self._E
1281
p = self._p
1282
if algorithm != "mw" and algorithm !="approx":
1283
raise ValueError, "Unknown algorithm %s."%algorithm
1284
if algorithm == "approx":
1285
return self.__phi_bpr(prec=prec)
1286
if p < 4 and algorithm == "mw":
1287
print "Warning: If this fails try again using algorithm=\"approx\""
1288
Ew = E.integral_short_weierstrass_model()
1289
adjusted_prec = monsky_washnitzer.adjusted_prec(p, prec)
1290
modprecring = Integers(p**adjusted_prec)
1291
output_ring = Qp(p, prec)
1292
R, x = PolynomialRing(modprecring, 'x').objgen()
1293
Q = x**3 + modprecring(Ew.a4()) * x + modprecring(Ew.a6())
1294
trace = Ew.ap(p)
1295
fr = monsky_washnitzer.matrix_of_frobenius(Q, p, adjusted_prec, trace)
1296
fr = matrix.matrix(output_ring,2,2,fr)
1297
1298
# return a vector for PARI's ellchangecurve to pass from e1 to e2
1299
def isom(e1,e2):
1300
if not e1.is_isomorphic(e2):
1301
raise ValueError, "Curves must be isomorphic."
1302
usq = (e1.discriminant()/e2.discriminant()).nth_root(6)
1303
u = usq.sqrt()
1304
s = (u * e2.a1() - e1.a1() )/ZZ(2)
1305
r = (usq * e2.a2() - e1.a2() + s**2 + e1.a1()*s)/ZZ(3)
1306
t = (u**3 * e2.a3() - e1.a3() - e1.a1()*r)/ZZ(2)
1307
return [u,r,s,t]
1308
1309
v = isom(E,Ew)
1310
u = v[0]
1311
r = v[1]
1312
1313
# change basis
1314
A = matrix.matrix([[u,-r/u],[0,1/u]])
1315
frn = A * fr * A**(-1)
1316
return 1/p*frn
1317
1318
1319
1320
def __phi_bpr(self, prec=0):
1321
r"""
1322
This returns a geometric Frobenius `\varphi` on the Dieudonne module `D_p(E)`
1323
with respect to the basis `\omega`, the invariant differential, and `\eta=x\omega`.
1324
It satisfies `\varphi^2 - a_p/p\, \varphi + 1/p = 0`.
1325
1326
The algorithm used here is described in bernardi-perrin-riou on page 232.
1327
1328
.. note: Warning. This function has not been sufficiently tested. It is very slow.
1329
1330
EXAMPLES::
1331
1332
sage: E = EllipticCurve('11a1')
1333
sage: lp = E.padic_lseries(19)
1334
sage: lp.frobenius(prec=1,algorithm="approx") #indirect doctest
1335
[ O(19^0) 4*19^-1 + O(19^0)]
1336
[ 14 + O(19) O(19^0)]
1337
1338
sage: E = EllipticCurve('17a1')
1339
sage: lp = E.padic_lseries(3)
1340
sage: lp.frobenius(prec=3,algorithm="approx")
1341
[ O(3) 2*3^-1 + 2 + O(3)]
1342
[ 1 + O(3^2) O(3)]
1343
sage: lp.frobenius(prec=5,algorithm="approx")
1344
[ 3 + O(3^2) 2*3^-1 + 2 + 3 + O(3^2)]
1345
[ 1 + 2*3^2 + O(3^3) 2*3 + O(3^2)]
1346
1347
1348
"""
1349
E = self._E
1350
p = self._p
1351
if prec > 10:
1352
print "Warning: Very large value for the precision."
1353
if prec == 0:
1354
prec = floor((log(10000)/log(p)))
1355
verbose("prec set to %s"%prec)
1356
eh = E.formal()
1357
om = eh.differential(prec = p**prec+3)
1358
verbose("differential computed")
1359
xt = eh.x(prec=p**prec + 3)
1360
et = xt*om
1361
# c_(p^k) = cs[k] d...
1362
cs = [om[p**k-1] for k in range(0,prec+1)]
1363
ds = [et[p**k-1] for k in range(0,prec+1)]
1364
delta = 0
1365
dpr = 0
1366
gamma = 0
1367
dga = 0
1368
for k in range(1,prec+1):
1369
# this is the equation eq[0]*x+eq[1]*y+eq[2] == 0
1370
# such that delta_ = delta + d^dpr*x ...
1371
eq = [(p**dpr*cs[k]) % p**k,(-p**dga*ds[k]) % p**k , (delta*cs[k]-gamma*ds[k]-cs[k-1]) % p**k ]
1372
verbose("valuations : %s"%([x.valuation(p) for x in eq]))
1373
v = min([x.valuation(p) for x in eq])
1374
if v == infinity:
1375
verbose("no new information at step k=%s"%k)
1376
else:
1377
eq = [ZZ(x/p**v) for x in eq]
1378
verbose("renormalised eq mod p^%s is now %s"%(k-v,eq))
1379
if eq[0].valuation(p) == 0:
1380
l = min(eq[1].valuation(p),k-v)
1381
if l == 0:
1382
verbose("not uniquely determined at step k=%s"%k)
1383
else:
1384
ainv = eq[0].inverse_mod(p**l)
1385
delta = delta - eq[2]*ainv*p**dpr
1386
dpr = dpr + l
1387
delta = delta % p**dpr
1388
verbose("delta_prec increased to %s\n delta is now %s"%(dpr,delta))
1389
elif eq[1].valuation(p) == 0:
1390
l = min(eq[0].valuation(p),k-v)
1391
ainv = eq[1].inverse_mod(p**l)
1392
gamma = gamma - eq[2]*ainv*p**dga
1393
dga = dga + l
1394
gamma = gamma % p**dga
1395
verbose("gamma_prec increased to %s\n gamma is now %s"%(dga,gamma))
1396
else:
1397
raise RuntimeError, "Bug: no delta or gamma can exist"
1398
1399
# end of approximation of delta and gamma
1400
R = Qp(p,max(dpr,dga)+1)
1401
delta = R(delta,absprec=dpr)
1402
gamma = R(gamma,absprec=dga)
1403
verbose("result delta = %s\n gamma = %s\n check : %s"%(delta,gamma, [Qp(p,k)(delta * cs[k] - gamma * ds[k] - cs[k-1]) for k in range(1,prec+1)] ))
1404
a = delta
1405
c = -gamma
1406
d = E.ap(p) - a
1407
b = (-1/p+a*d)/c
1408
phi = matrix.matrix([[a,b],[c,d]])
1409
return phi
1410
1411
1412
def bernardi_sigma_function(self, prec=20):
1413
r"""
1414
Return the `p`-adic sigma function of Bernardi in terms of `z = log(t)`.
1415
This is the same as ``padic_sigma`` with ``E2 = 0``.
1416
1417
EXAMPLES::
1418
1419
sage: E = EllipticCurve('14a')
1420
sage: L = E.padic_lseries(5)
1421
sage: L.bernardi_sigma_function(5) # Todo: some sort of consistency check!?
1422
z + 1/24*z^3 + 29/384*z^5 - 8399/322560*z^7 - 291743/92897280*z^9 - 4364831/5225472*z^10 + 2172371753/955514880*z^11 - 17875714529/6897623040*z^12 + 2839176621047/1605264998400*z^13 + 32012675789849/10042939146240*z^14 - 367444910151047/89894839910400*z^15 + 973773806885959/241030539509760*z^16 - 33997971208432501/17259809262796800*z^17 - 10331978660756704339/842918229599846400*z^18 + 18601407947897364480389/950670294194847744000*z^19 - 118837570440101901119321/8071784966648129126400*z^20 + O(z^21)
1423
"""
1424
E = self._E
1425
p = self._p
1426
1427
Eh = E.formal()
1428
lo = Eh.log(prec + 5)
1429
F = lo.reversion()
1430
1431
S = LaurentSeriesRing(QQ,'z')
1432
z = S.gen()
1433
F = F(z)
1434
xofF = Eh.x(prec + 2)(F)
1435
#r = ( E.a1()**2 + 4*E.a2() ) / ZZ(12)
1436
g = (1/z**2 - xofF ).power_series()
1437
h = g.integral().integral()
1438
sigma_of_z = z.power_series() * h.exp()
1439
1440
return sigma_of_z
1441
1442
1443
def Dp_valued_height(self,prec=20):
1444
r"""
1445
Returns the canonical `p`-adic height with values in the Dieudonne module `D_p(E)`.
1446
It is defined to be
1447
1448
`h_{\eta} \cdot \omega - h_{\omega} \cdot \eta`
1449
1450
where `h_{\eta}` is made out of the sigma function of Bernardi and
1451
`h_{\omega}` is `log_E^2`.
1452
The answer ``v`` is given as ``v[1]*omega + v[2]*eta``.
1453
The coordinates of ``v`` are dependent of the
1454
Weierstrass equation.
1455
1456
EXAMPLES::
1457
1458
sage: E = EllipticCurve('53a')
1459
sage: L = E.padic_lseries(5)
1460
sage: h = L.Dp_valued_height(7)
1461
sage: h(E.gens()[0])
1462
(3*5 + 5^2 + 2*5^3 + 3*5^4 + 4*5^5 + 5^6 + 5^7 + O(5^8), 5^2 + 4*5^4 + 2*5^7 + 3*5^8 + O(5^9))
1463
"""
1464
E = self._E
1465
p = self._p
1466
Ehat = E.formal()
1467
elog = Ehat.log(prec + Integer(3))
1468
1469
# we will have to do it properly with David Harvey's _multiply_point()
1470
n = arith.LCM(E.tamagawa_numbers())
1471
n = arith.LCM(n, E.Np(p)) # allowed here because E has good reduction at p
1472
1473
if p < 5:
1474
phi = self.frobenius(min(6,prec),algorithm="approx")
1475
else:
1476
phi = self.frobenius(prec+2,algorithm="mw")
1477
1478
def height(P,check=True):
1479
if P.is_finite_order():
1480
return Qp(p,prec)(0)
1481
if check:
1482
assert P.curve() == E, 'the point P must lie on the curve from which the height function was created'
1483
1484
Q = n * P
1485
tt = - Q[0]/Q[1]
1486
R = Qp(p,prec+5)
1487
tt = R(tt)
1488
zz = elog(tt)
1489
1490
homega = -zz**2/n**2
1491
1492
eQ = denominator(Q[1])/denominator(Q[0])
1493
si = self.bernardi_sigma_function(prec=prec+4)
1494
heta = 2 * log(si(zz)/eQ) / n**2
1495
1496
R = Qp(p,prec)
1497
1498
return vector([-R(heta),R(homega)])
1499
1500
return height
1501
1502
1503
1504
def Dp_valued_regulator(self,prec=20,v1=0,v2=0):
1505
r"""
1506
Returns the canonical `p`-adic regulator with values in the Dieudonne module `D_p(E)`
1507
as defined by Perrin-Riou using the `p`-adic height with values in `D_p(E)`.
1508
The result is written in the basis `\omega`, `\varphi(\omega)`, and hence the
1509
coordinates of the result are independent of the chosen Weierstrass equation.
1510
1511
NOTE: The definition here is corrected with respect to Perrin-Riou's article [PR]. See
1512
[SW].
1513
1514
1515
REFERENCES:
1516
1517
- [PR] Perrin Riou, Arithmetique des courbes elliptiques a reduction supersinguliere en `p`,
1518
Experiment. Math. 12 (2003), no. 2, 155-186.
1519
1520
- [SW] William Stein and Christian Wuthrich, Computations About Tate-Shafarevich Groups
1521
using Iwasawa theory, preprint 2009.
1522
1523
EXAMPLES::
1524
1525
sage: E = EllipticCurve('43a')
1526
sage: L = E.padic_lseries(7)
1527
sage: L.Dp_valued_regulator(7)
1528
(5*7 + 6*7^2 + 4*7^3 + 4*7^4 + 7^5 + 4*7^7 + O(7^8), 4*7^2 + 2*7^3 + 3*7^4 + 7^5 + 6*7^6 + 4*7^7 + O(7^8))
1529
"""
1530
1531
p = self._p
1532
E = self._E
1533
1534
h = self.Dp_valued_height(prec=prec)
1535
1536
# this is the height_{v} (P) for a v in D_p
1537
def hv(vec,P):
1538
hP = h(P)
1539
return - vec[0]*hP[1] +vec[1]*hP[0]
1540
1541
# def hvpairing(vec,P,Q):
1542
# return (hv(vec, P+Q) - hv(vec,P)-hv(vec,Q))/2
1543
K = Qp(p, prec)
1544
1545
if v1 ==0 and v2 ==0 :
1546
v1 = vector([K(0),K(1)]) # that is eta
1547
v2 = vector([K(-1),K(1)]) # and this is eta-omega.
1548
# the rest should not depend on this choice
1549
# as long as it is outside Q_p * omega
1550
1551
rk = E.rank()
1552
if rk == 0:
1553
return vector([K(1),K(0)])
1554
1555
1556
basis = E.gens()
1557
1558
def regv(vec):
1559
M = matrix.matrix(K,rk,rk,0)
1560
point_height = [hv(vec,P) for P in basis]
1561
for i in range(rk):
1562
for j in range(i+1, rk):
1563
M[i, j] = M[j, i] = (hv(vec,basis[i] + basis[j])- point_height[i] - point_height[j] )/2
1564
for i in range(rk):
1565
M[i,i] = point_height[i]
1566
1567
return M.determinant()
1568
1569
1570
def Dp_pairing(vec1,vec2):
1571
return (vec1[0]*vec2[1]-vec1[1]*vec2[0])
1572
1573
omega_vec = vector([K(1),K(0)])
1574
1575
# note the correction here with respect to Perrin-Riou's definition.
1576
# only this way the result will be independent of the choice of v1 and v2.
1577
reg1 = regv(v1)/Dp_pairing(omega_vec,v1)**(rk-1)
1578
1579
reg2 = regv(v2)/Dp_pairing(omega_vec,v2)**(rk-1)
1580
1581
1582
# the regulator in the basis omega,eta
1583
reg_oe = (reg1 * v2 - reg2 * v1 ) / Dp_pairing(v2,v1)
1584
1585
if p < 5:
1586
phi = self.frobenius(min(6,prec),algorithm="approx")
1587
else:
1588
phi = self.frobenius(prec+2,algorithm="mw")
1589
1590
c = phi[1,0] # this is the 'period' [omega,phi(omega)]
1591
a = phi[0,0]
1592
1593
return vector([reg_oe[0] - a/c*reg_oe[1],reg_oe[1]/c])
1594
1595