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