Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sagelib
Path: blob/master/sage/modular/overconvergent/weightspace.py
4072 views
1
# -*- coding: utf-8 -*-
2
r"""
3
The space of `p`-adic weights
4
5
A `p`-adic weight is a continuous character `\ZZ_p^\times \to
6
\CC_p^\times`. These are the `\CC_p`-points of a rigid space over
7
`\QQ_p`, which is isomorphic to a disjoint union of copies (indexed by
8
`(\ZZ/p\ZZ)^\times`) of the open unit `p`-adic disc.
9
10
Sage supports both "classical points", which are determined by the data of a
11
Dirichlet character modulo `p^m` for some `m` and an integer `k` (corresponding
12
to the character `z \mapsto z^k \chi(z)`) and "non-classical points" which are
13
determined by the data of an element of `(\ZZ/p\ZZ)^\times` and
14
an element `w \in \CC_p` with `|w - 1| < 1`.
15
16
EXAMPLES::
17
18
sage: W = pAdicWeightSpace(17)
19
sage: W
20
Space of 17-adic weight-characters defined over '17-adic Field with capped relative precision 20'
21
sage: R.<x> = QQ[]
22
sage: L = Qp(17).extension(x^2 - 17, names='a'); L.rename('L')
23
sage: W.base_extend(L)
24
Space of 17-adic weight-characters defined over 'L'
25
26
We create a simple element of `\mathcal{W}`: the algebraic character, `x \mapsto x^6`::
27
28
sage: kappa = W(6)
29
sage: kappa(5)
30
15625
31
sage: kappa(5) == 5^6
32
True
33
34
A locally algebraic character, `x \mapsto x^6 \chi(x)` for `\chi` a Dirichlet
35
character mod `p`::
36
37
sage: kappa2 = W(6, DirichletGroup(17, Qp(17)).0^8)
38
sage: kappa2(5) == -5^6
39
True
40
sage: kappa2(13) == 13^6
41
True
42
43
A non-locally-algebraic character, sending the generator 18 of `1 + 17
44
\ZZ_{17}` to 35 and acting as `\mu \mapsto \mu^4` on the group of 16th
45
roots of unity::
46
47
sage: kappa3 = W(35 + O(17^20), 4, algebraic=False)
48
sage: kappa3(2)
49
16 + 8*17 + ... + O(17^20)
50
51
AUTHORS:
52
53
- David Loeffler (2008-9)
54
"""
55
56
#*****************************************************************************
57
# Copyright (C) 2008 William Stein <[email protected]>
58
# 2008-9 David Loeffler <[email protected]>
59
#
60
# Distributed under the terms of the GNU General Public License (GPL)
61
# http://www.gnu.org/licenses/
62
#*****************************************************************************
63
64
from sage.structure.parent_base import ParentWithBase
65
from sage.structure.element import Element
66
from sage.modular.dirichlet import DirichletGroup, trivial_character
67
from sage.rings.all import ZZ, QQ, divisors, IntegerModRing, Qp, Infinity
68
from sage.rings.padics.padic_generic_element import pAdicGenericElement
69
from sage.misc.misc import verbose
70
from sage.misc.cachefunc import cached_method
71
import weakref
72
73
_wscache = {}
74
def WeightSpace_constructor(p, base_ring=None):
75
r"""
76
Construct the p-adic weight space for the given prime p. A `p`-adic weight
77
is a continuous character `\ZZ_p^\times \to \CC_p^\times`.
78
These are the `\CC_p`-points of a rigid space over `\QQ_p`,
79
which is isomorphic to a disjoint union of copies (indexed by
80
`(\ZZ/p\ZZ)^\times`) of the open unit `p`-adic disc.
81
82
Note that the "base ring" of a `p`-adic weight is the smallest ring
83
containing the image of `\ZZ`; in particular, although the default base
84
ring is `\QQ_p`, base ring `\QQ` will also work.
85
86
EXAMPLES::
87
88
sage: pAdicWeightSpace(3) # indirect doctest
89
Space of 3-adic weight-characters defined over '3-adic Field with capped relative precision 20'
90
sage: pAdicWeightSpace(3, QQ)
91
Space of 3-adic weight-characters defined over 'Rational Field'
92
sage: pAdicWeightSpace(10)
93
Traceback (most recent call last):
94
...
95
ValueError: p must be prime
96
"""
97
if base_ring is None:
98
base_ring = Qp(p)
99
if _wscache.has_key((p, base_ring)):
100
m = _wscache[(p, base_ring)]()
101
if m is not None:
102
return m
103
m = WeightSpace_class(p, base_ring)
104
_wscache[(p, base_ring)] = weakref.ref(m)
105
return m
106
107
class WeightSpace_class(ParentWithBase):
108
r"""
109
The space of `p`-adic weight-characters `\mathcal{W} = {\rm
110
Hom}(\ZZ_p^\times, \CC_p^\times)`. This isomorphic to a
111
disjoint union of `(p-1)` open discs of radius 1 (or 2 such discs if `p =
112
2`), with the parameter on the open disc corresponding to the image of `1 +
113
p` (or 5 if `p = 2`)
114
115
TESTS::
116
117
sage: W = pAdicWeightSpace(3)
118
sage: W is loads(dumps(W))
119
True
120
"""
121
122
def __init__(self, p, base_ring):
123
r"""
124
Initialisation function.
125
126
EXAMPLE::
127
128
sage: pAdicWeightSpace(17)
129
Space of 17-adic weight-characters defined over '17-adic Field with capped relative precision 20'
130
"""
131
ParentWithBase.__init__(self, base=base_ring)
132
p = ZZ(p)
133
if not p.is_prime():
134
raise ValueError, "p must be prime"
135
self._p = p
136
self._param = Qp(p)((p == 2 and 5) or (p + 1))
137
138
def _repr_(self):
139
r"""
140
String representation of self.
141
142
EXAMPLE::
143
144
sage: pAdicWeightSpace(17)._repr_()
145
"Space of 17-adic weight-characters defined over '17-adic Field with capped relative precision 20'"
146
"""
147
return "Space of %s-adic weight-characters defined over '%s'" % (self.prime(), self.base_ring())
148
149
def __reduce__(self):
150
r"""
151
Used for pickling.
152
153
EXAMPLE::
154
155
sage: pAdicWeightSpace(3).__reduce__()
156
(<function WeightSpace_constructor at ...>, (3, 3-adic Field with capped relative precision 20))
157
"""
158
return (WeightSpace_constructor, (self.prime(), self.base_ring()))
159
160
def __call__(self, arg1, arg2 = None, algebraic=True):
161
r"""
162
Create an element of this space.
163
164
If ``algebraic = True`` (the default), create a locally algebraic
165
character. The arguments should be `(k, \chi)` with `k \in \ZZ`
166
and `\chi` a Dirichlet character of `p`-power conductor defined over a
167
`p`-adic field; this corresponds to the weight-character `x \mapsto x^k
168
\chi(x)`. If `\chi` is omitted, it defaults to the trivial character.
169
170
If ``algebraic = False``, create a general character. The arguments are
171
now (t, w) where `t \in \ZZ/(p-1)\ZZ` and `w \in
172
\CC_p` with `|w - 1| < 1`. This corresponds to the character
173
`\kappa` satisfying `\kappa(\mu) = \mu^t` where `\mu` is a `(p-1)`-st
174
root of unity, and `\kappa(1 + p) = w`.
175
176
EXAMPLES::
177
178
sage: W = pAdicWeightSpace(17)
179
sage: W(4)
180
4
181
sage: W(4, DirichletGroup(17, Qp(17)).0)
182
(4, 17, [3 + 13*17 + ... + O(17^20)])
183
sage: W(1 + O(17^5), 4, algebraic = False)
184
[1 + O(17^5), 4]
185
"""
186
187
if isinstance(arg1, WeightCharacter):
188
if arg1.parent() is self:
189
return arg1
190
elif arg1.parent().prime() == self.prime():
191
return self._coerce_in_wtchar(arg1)
192
else:
193
raise TypeError, "Incompatible type!"
194
195
if algebraic:
196
return AlgebraicWeight(self, arg1, arg2)
197
else:
198
return ArbitraryWeight(self, arg1, arg2)
199
200
@cached_method
201
def zero_element(self):
202
"""
203
Return the zero of this weight space.
204
205
EXAMPLES::
206
207
sage: W = pAdicWeightSpace(17)
208
sage: W.zero_element()
209
0
210
"""
211
return self(0)
212
213
def prime(self):
214
r"""
215
Return the prime `p` such that this is a `p`-adic weight space.
216
217
EXAMPLE::
218
219
sage: pAdicWeightSpace(17).prime()
220
17
221
"""
222
return self._p
223
224
def base_extend(self, R):
225
r"""
226
Extend scalars to the ring R. There must be a canonical coercion map
227
from the present base ring to R.
228
229
EXAMPLE::
230
231
sage: W = pAdicWeightSpace(3, QQ)
232
sage: W.base_extend(Qp(3))
233
Space of 3-adic weight-characters defined over '3-adic Field with capped relative precision 20'
234
sage: W.base_extend(IntegerModRing(12))
235
Traceback (most recent call last):
236
...
237
TypeError: No coercion map from 'Rational Field' to 'Ring of integers modulo 12' is defined
238
"""
239
if R.has_coerce_map_from(self.base_ring()):
240
return WeightSpace_constructor(self.prime(), R)
241
else:
242
raise TypeError, "No coercion map from '%s' to '%s' is defined" % (self.base_ring(), R)
243
244
def _coerce_impl(self, x):
245
r"""
246
Canonical coercion of x into self.
247
248
TESTS::
249
250
sage: W1 = pAdicWeightSpace(23, QQ)
251
sage: W2 = W1.base_extend(Qp(23))
252
sage: w = W1(3)
253
sage: W2.coerce(w) # indirect doctest
254
3
255
"""
256
if isinstance(x, WeightCharacter) \
257
and x.parent().prime() == self.prime() \
258
and self.base_ring().has_coerce_map_from(x.base_ring()):
259
return self._coerce_in_wtchar(x)
260
raise TypeError
261
262
def _coerce_in_wtchar(self, x):
263
r"""
264
Convert in a weight-character whose parent is different from self (with
265
has the prime, but possibly different base ring).
266
267
EXAMPLE::
268
269
sage: W1 = pAdicWeightSpace(23, Qp(3))
270
sage: W2 = pAdicWeightSpace(23, QQ)
271
sage: w = W1(3)
272
sage: W2._coerce_in_wtchar(w)
273
3
274
"""
275
if isinstance(x, AlgebraicWeight):
276
return AlgebraicWeight(self, x.k(), x.chi().change_ring(self.base_ring()))
277
else:
278
return ArbitraryWeight(self, self.base_ring()(x.w()), x.teichmuller_type())
279
280
class WeightCharacter(Element):
281
r"""
282
Abstract base class representing an element of the p-adic weight space
283
`Hom(\ZZ_p^\times, \CC_p^\times)`.
284
"""
285
286
# This should probably derive from Morphism or even from
287
# AbelianGroupMorphism; but Sage doesn't know about the abelian group
288
# Z_p^*, so Hom(Z_p^*, C_p^*) is a bit beyond it!
289
290
def __init__(self, parent):
291
r"""
292
Initialisation function.
293
294
EXAMPLE::
295
296
sage: pAdicWeightSpace(17)(0)
297
0
298
"""
299
300
Element.__init__(self, parent)
301
self._p = self.parent().prime()
302
303
def base_extend(self, R):
304
r"""
305
Extend scalars to the base ring R (which must have a canonical map from
306
the current base ring)
307
308
EXAMPLE::
309
310
sage: w = pAdicWeightSpace(17, QQ)(3)
311
sage: w.base_extend(Qp(17))
312
3
313
"""
314
return self.parent().base_extend(R).coerce(self)
315
316
def is_even(self):
317
r"""
318
Return True if this weight-character sends -1 to +1.
319
320
EXAMPLE::
321
322
sage: pAdicWeightSpace(17)(0).is_even()
323
True
324
sage: pAdicWeightSpace(17)(11).is_even()
325
False
326
sage: pAdicWeightSpace(17)(1 + 17 + O(17^20), 3, False).is_even()
327
False
328
sage: pAdicWeightSpace(17)(1 + 17 + O(17^20), 4, False).is_even()
329
True
330
"""
331
if self(-1) == -1:
332
return False
333
else:
334
return True
335
336
def pAdicEisensteinSeries(self, ring, prec=20):
337
r"""
338
Calculate the q-expansion of the p-adic Eisenstein series of given
339
weight-character, normalised so the constant term is 1.
340
341
EXAMPLE::
342
343
sage: kappa = pAdicWeightSpace(3)(3, DirichletGroup(3,QQ).0)
344
sage: kappa.pAdicEisensteinSeries(QQ[['q']], 20)
345
1 - 9*q + 27*q^2 - 9*q^3 - 117*q^4 + 216*q^5 + 27*q^6 - 450*q^7 + 459*q^8 - 9*q^9 - 648*q^10 + 1080*q^11 - 117*q^12 - 1530*q^13 + 1350*q^14 + 216*q^15 - 1845*q^16 + 2592*q^17 + 27*q^18 - 3258*q^19 + O(q^20)
346
"""
347
if not self.is_even():
348
raise ValueError, "Eisenstein series not defined for odd weight-characters"
349
q = ring.gen()
350
s = ring(1) + 2*self.one_over_Lvalue() * sum([sum([self(d)/d for d in divisors(n)]) * q**n for n in xrange(1, prec)])
351
return s.add_bigoh(prec)
352
353
def values_on_gens(self):
354
r"""
355
If `\kappa` is this character, calculate the values `(\kappa(r), t)`
356
where `r` is `1 + p` (or 5 if `p = 2`) and `t` is the unique element of
357
`\ZZ/(p-1)\ZZ` such that `\kappa(\mu) = \mu^t` for `\mu`
358
a (p-1)st root of unity. (If `p = 2`, we take `t` to be 0 or 1
359
according to whether `\kappa` is odd or even.) These two values
360
uniquely determine the character `\kappa`.
361
362
EXAMPLES::
363
364
sage: W=pAdicWeightSpace(11); W(2).values_on_gens()
365
(1 + 2*11 + 11^2 + O(11^20), 2)
366
sage: W(2, DirichletGroup(11, QQ).0).values_on_gens()
367
(1 + 2*11 + 11^2 + O(11^20), 7)
368
sage: W(1 + 2*11 + O(11^5), 4, algebraic = False).values_on_gens()
369
(1 + 2*11 + O(11^5), 4)
370
"""
371
372
return ( self(self.parent()._param), self.teichmuller_type())
373
374
def is_trivial(self):
375
r"""
376
Return True if and only if this is the trivial character.
377
378
EXAMPLES::
379
380
sage: pAdicWeightSpace(11)(2).is_trivial()
381
False
382
sage: pAdicWeightSpace(11)(2, DirichletGroup(11, QQ).0).is_trivial()
383
False
384
sage: pAdicWeightSpace(11)(0).is_trivial()
385
True
386
"""
387
if self.values_on_gens() == (1, 0):
388
return True
389
else:
390
return False
391
392
def __cmp__(self, other):
393
r"""
394
Compare self to other.
395
396
EXAMPLES::
397
398
sage: W=pAdicWeightSpace(11)
399
sage: W(2) == W(3)
400
False
401
sage: W(2, DirichletGroup(11, QQ).0) == W(2)
402
False
403
sage: W(2, DirichletGroup(11, QQ).0) == W(144 + O(11^20), 7, False)
404
True
405
"""
406
if not isinstance(other, WeightCharacter):
407
return cmp(type(self), type(other))
408
else:
409
return cmp(self.values_on_gens(), other.values_on_gens())
410
411
def Lvalue(self):
412
r"""
413
Return the value of the p-adic L-function of `\QQ`, which can be
414
regarded as a rigid-analytic function on weight space, evaluated at
415
this character.
416
417
EXAMPLES::
418
419
sage: W = pAdicWeightSpace(11)
420
sage: sage.modular.overconvergent.weightspace.WeightCharacter(W).Lvalue()
421
Traceback (most recent call last):
422
...
423
NotImplementedError
424
"""
425
raise NotImplementedError
426
427
def one_over_Lvalue(self):
428
r"""
429
Return the reciprocal of the p-adic L-function evaluated at this
430
weight-character. If the weight-character is odd, then the L-function
431
is zero, so an error will be raised.
432
433
EXAMPLES::
434
435
sage: pAdicWeightSpace(11)(4).one_over_Lvalue()
436
-12/133
437
sage: pAdicWeightSpace(11)(3, DirichletGroup(11, QQ).0).one_over_Lvalue()
438
-1/6
439
sage: pAdicWeightSpace(11)(3).one_over_Lvalue()
440
Traceback (most recent call last):
441
...
442
ZeroDivisionError: Rational division by zero
443
sage: pAdicWeightSpace(11)(0).one_over_Lvalue()
444
0
445
sage: type(_)
446
<type 'sage.rings.integer.Integer'>
447
"""
448
if self.is_trivial():
449
return ZZ(0)
450
else:
451
return 1/self.Lvalue()
452
453
class AlgebraicWeight(WeightCharacter):
454
r"""
455
A point in weight space corresponding to a locally algebraic character, of
456
the form `x \mapsto \chi(x) x^k` where `k` is an integer and `\chi` is a
457
Dirichlet character modulo `p^n` for some `n`.
458
459
TESTS::
460
461
sage: w = pAdicWeightSpace(23)(12, DirichletGroup(23, QQ).0) # exact
462
sage: w == loads(dumps(w))
463
True
464
sage: w = pAdicWeightSpace(23)(12, DirichletGroup(23, Qp(23)).0) # inexact
465
sage: w == loads(dumps(w))
466
True
467
sage: w is loads(dumps(w)) # elements are not globally unique
468
False
469
"""
470
471
def __init__(self, parent, k, chi=None):
472
r"""
473
Create a locally algebraic weight-character.
474
475
EXAMPLES::
476
477
sage: pAdicWeightSpace(29)(13, DirichletGroup(29, Qp(29)).0)
478
(13, 29, [2 + 2*29 + ... + O(29^20)])
479
"""
480
WeightCharacter.__init__(self, parent)
481
k = ZZ(k)
482
self._k = k
483
if chi is None:
484
chi = trivial_character(self._p, QQ)
485
n = ZZ(chi.conductor())
486
if n == 1:
487
n = self._p
488
if not n.is_power_of(self._p):
489
raise ValueError, "Character must have %s-power conductor" % p
490
self._chi = DirichletGroup(n, chi.base_ring())(chi)
491
492
def __call__(self, x):
493
r"""
494
Evaluate this character at an element of `\ZZ_p^\times`.
495
496
EXAMPLES:
497
498
Exact answers are returned when this is possible::
499
500
sage: kappa = pAdicWeightSpace(29)(13, DirichletGroup(29, QQ).0)
501
sage: kappa(1)
502
1
503
sage: kappa(0)
504
0
505
sage: kappa(12)
506
-106993205379072
507
sage: kappa(-1)
508
-1
509
sage: kappa(13 + 4*29 + 11*29^2 + O(29^3))
510
9 + 21*29 + 27*29^2 + O(29^3)
511
512
When the character chi is defined over a p-adic field, the results returned are inexact::
513
514
sage: kappa = pAdicWeightSpace(29)(13, DirichletGroup(29, Qp(29)).0^14)
515
sage: kappa(1)
516
1 + O(29^20)
517
sage: kappa(0)
518
0
519
sage: kappa(12)
520
17 + 11*29 + 7*29^2 + 4*29^3 + 5*29^4 + 2*29^5 + 13*29^6 + 3*29^7 + 18*29^8 + 21*29^9 + 28*29^10 + 28*29^11 + 28*29^12 + 28*29^13 + 28*29^14 + 28*29^15 + 28*29^16 + 28*29^17 + 28*29^18 + 28*29^19 + O(29^20)
521
sage: kappa(12) == -106993205379072
522
True
523
sage: kappa(-1) == -1
524
True
525
sage: kappa(13 + 4*29 + 11*29^2 + O(29^3))
526
9 + 21*29 + 27*29^2 + O(29^3)
527
"""
528
if isinstance(x, pAdicGenericElement):
529
if x.parent().prime() != self._p:
530
raise TypeError, "x must be an integer or a %s-adic integer" % self._p
531
if self._p**(x.precision_absolute()) < self._chi.conductor():
532
raise Exception, "Precision too low"
533
xint = x.lift()
534
else:
535
xint = x
536
if (xint % self._p == 0): return 0
537
return self._chi(xint) * x**self._k
538
539
def k(self):
540
r"""
541
If this character is `x \mapsto x^k \chi(x)` for an integer `k` and a
542
Dirichlet character `\chi`, return `k`.
543
544
EXAMPLE::
545
546
sage: kappa = pAdicWeightSpace(29)(13, DirichletGroup(29, Qp(29)).0^14)
547
sage: kappa.k()
548
13
549
"""
550
return self._k
551
552
def chi(self):
553
r"""
554
If this character is `x \mapsto x^k \chi(x)` for an integer `k` and a
555
Dirichlet character `\chi`, return `\chi`.
556
557
EXAMPLE::
558
559
sage: kappa = pAdicWeightSpace(29)(13, DirichletGroup(29, Qp(29)).0^14)
560
sage: kappa.chi()
561
Dirichlet character modulo 29 of conductor 29 mapping 2 |--> 28 + 28*29 + 28*29^2 + ... + O(29^20)
562
"""
563
return self._chi
564
565
def _repr_(self):
566
r"""
567
String representation of self.
568
569
EXAMPLES::
570
571
sage: pAdicWeightSpace(17)(2)._repr_()
572
'2'
573
sage: pAdicWeightSpace(17)(2, DirichletGroup(17, QQ).0)._repr_()
574
'(2, 17, [-1])'
575
sage: pAdicWeightSpace(17)(2, DirichletGroup(17, QQ).0^2)._repr_()
576
'2'
577
"""
578
if self._chi.is_trivial():
579
return "%s" % self._k
580
else:
581
return "(%s, %s, %s)" % (self._k, self._chi.modulus(), self._chi._repr_short_())
582
583
def teichmuller_type(self):
584
r"""
585
Return the Teichmuller type of this weight-character `\kappa`, which is
586
the unique `t \in \ZZ/(p-1)\ZZ` such that `\kappa(\mu) =
587
\mu^t` for \mu a `(p-1)`-st root of 1.
588
589
For `p = 2` this doesn't make sense, but we still want the Teichmuller
590
type to correspond to the index of the component of weight space in
591
which `\kappa` lies, so we return 1 if `\kappa` is odd and 0 otherwise.
592
593
EXAMPLE::
594
595
sage: pAdicWeightSpace(11)(2, DirichletGroup(11,QQ).0).teichmuller_type()
596
7
597
sage: pAdicWeightSpace(29)(13, DirichletGroup(29, Qp(29)).0).teichmuller_type()
598
14
599
sage: pAdicWeightSpace(2)(3, DirichletGroup(4,QQ).0).teichmuller_type()
600
0
601
"""
602
# Special case p == 2
603
if self._p == 2:
604
if self.is_even():
605
return IntegerModRing(2)(0)
606
else:
607
return IntegerModRing(2)(1)
608
m = IntegerModRing(self._p).multiplicative_generator()
609
x = [y for y in IntegerModRing(self._chi.modulus()) if y == m and y**(self._p - 1) == 1]
610
if len(x) != 1: raise ArithmeticError
611
x = x[0]
612
f = IntegerModRing(self._p)(self._chi(x)).log(m)
613
return IntegerModRing(self._p - 1)(self._k + f)
614
615
def Lvalue(self):
616
r"""
617
Return the value of the p-adic L-function of `\QQ` evaluated at
618
this weight-character. If the character is `x \mapsto x^k \chi(x)`
619
where `k > 0` and `\chi` has conductor a power of `p`, this is an
620
element of the number field generated by the values of `\chi`, equal to
621
the value of the complex L-function `L(1-k, \chi)`. If `\chi` is
622
trivial, it is equal to `(1 - p^{k-1})\zeta(1-k)`.
623
624
At present this is not implemented in any other cases, except the
625
trivial character (for which the value is `\infty`).
626
627
TODO: Implement this more generally using the Amice transform machinery
628
in sage/schemes/elliptic_curves/padic_lseries.py, which should clearly
629
be factored out into a separate class.
630
631
EXAMPLES::
632
633
sage: pAdicWeightSpace(7)(4).Lvalue() == (1 - 7^3)*zeta__exact(-3)
634
True
635
sage: pAdicWeightSpace(7)(5, DirichletGroup(7, Qp(7)).0^4).Lvalue()
636
0
637
sage: pAdicWeightSpace(7)(6, DirichletGroup(7, Qp(7)).0^4).Lvalue()
638
1 + 2*7 + 7^2 + 3*7^3 + 3*7^5 + 4*7^6 + 2*7^7 + 5*7^8 + 2*7^9 + 3*7^10 + 6*7^11 + 2*7^12 + 3*7^13 + 5*7^14 + 6*7^15 + 5*7^16 + 3*7^17 + 6*7^18 + O(7^19)
639
"""
640
if self._k > 0:
641
return -self._chi.bernoulli(self._k)/self._k
642
if self.is_trivial():
643
return Infinity
644
else:
645
raise NotImplementedError, "Don't know how to compute value of this L-function"
646
647
class ArbitraryWeight(WeightCharacter):
648
649
def __init__(self, parent, w, t):
650
r"""
651
Create the element of p-adic weight space in the given component
652
mapping 1 + p to w. Here w must be an element of a p-adic field, with
653
finite precision.
654
655
EXAMPLE::
656
657
sage: pAdicWeightSpace(17)(1 + 17^2 + O(17^3), 11, False)
658
[1 + 17^2 + O(17^3), 11]
659
"""
660
WeightCharacter.__init__(self, parent)
661
662
self.t = ZZ(t) % (self._p > 2 and (self._p - 1) or 2)
663
# do we store w precisely?
664
if (w - 1).valuation() <= 0:
665
raise ValueError, "Must send generator to something nearer 1"
666
self.w = w
667
668
def _repr_(self):
669
r"""String representation of this character.
670
671
EXAMPLES::
672
673
sage: pAdicWeightSpace(97)(1 + 2*97 + O(97^20), 12, False)._repr_()
674
'[1 + 2*97 + O(97^20), 12]'
675
"""
676
return "[%s, %s]" % (self.w, self.t)
677
678
def __call__(self, x):
679
r"""
680
Evaluate this character at an element of `\ZZ_p^\times`.
681
682
EXAMPLES::
683
684
sage: kappa = pAdicWeightSpace(23)(1 + 23^2 + O(23^20), 4, False)
685
sage: kappa(2)
686
16 + 7*23 + 7*23^2 + 16*23^3 + 23^4 + 20*23^5 + 15*23^7 + 11*23^8 + 12*23^9 + 8*23^10 + 22*23^11 + 16*23^12 + 13*23^13 + 4*23^14 + 19*23^15 + 6*23^16 + 7*23^17 + 11*23^19 + O(23^20)
687
sage: kappa(-1)
688
1 + O(23^20)
689
sage: kappa(23)
690
0
691
sage: kappa(2 + 2*23 + 11*23^2 + O(23^3))
692
16 + 7*23 + O(23^3)
693
"""
694
695
if not isinstance(x, pAdicGenericElement):
696
x = Qp(self._p)(x)
697
if x.valuation() != 0:
698
return 0
699
700
teich = x.parent().teichmuller(x)
701
xx = x / teich
702
if (xx - 1).valuation() <= 0:
703
raise ArithmeticError
704
verbose("Normalised element is %s" % xx)
705
706
e = xx.log() / self.parent()._param.log()
707
verbose("Exponent is %s" % e)
708
709
return teich**(self.t) * (self.w.log() * e).exp()
710
711
def teichmuller_type(self):
712
r"""
713
Return the Teichmuller type of this weight-character `\kappa`, which is
714
the unique `t \in \ZZ/(p-1)\ZZ` such that `\kappa(\mu) =
715
\mu^t` for \mu a `(p-1)`-st root of 1.
716
717
For `p = 2` this doesn't make sense, but we still want the Teichmuller
718
type to correspond to the index of the component of weight space in
719
which `\kappa` lies, so we return 1 if `\kappa` is odd and 0 otherwise.
720
721
EXAMPLES::
722
723
sage: pAdicWeightSpace(17)(1 + 3*17 + 2*17^2 + O(17^3), 8, False).teichmuller_type()
724
8
725
sage: pAdicWeightSpace(2)(1 + 2 + O(2^2), 1, False).teichmuller_type()
726
1
727
"""
728
return self.t
729
730
731