Path: blob/master/sage/modular/overconvergent/weightspace.py
4072 views
# -*- coding: utf-8 -*-1r"""2The space of `p`-adic weights34A `p`-adic weight is a continuous character `\ZZ_p^\times \to5\CC_p^\times`. These are the `\CC_p`-points of a rigid space over6`\QQ_p`, which is isomorphic to a disjoint union of copies (indexed by7`(\ZZ/p\ZZ)^\times`) of the open unit `p`-adic disc.89Sage supports both "classical points", which are determined by the data of a10Dirichlet character modulo `p^m` for some `m` and an integer `k` (corresponding11to the character `z \mapsto z^k \chi(z)`) and "non-classical points" which are12determined by the data of an element of `(\ZZ/p\ZZ)^\times` and13an element `w \in \CC_p` with `|w - 1| < 1`.1415EXAMPLES::1617sage: W = pAdicWeightSpace(17)18sage: W19Space of 17-adic weight-characters defined over '17-adic Field with capped relative precision 20'20sage: R.<x> = QQ[]21sage: L = Qp(17).extension(x^2 - 17, names='a'); L.rename('L')22sage: W.base_extend(L)23Space of 17-adic weight-characters defined over 'L'2425We create a simple element of `\mathcal{W}`: the algebraic character, `x \mapsto x^6`::2627sage: kappa = W(6)28sage: kappa(5)291562530sage: kappa(5) == 5^631True3233A locally algebraic character, `x \mapsto x^6 \chi(x)` for `\chi` a Dirichlet34character mod `p`::3536sage: kappa2 = W(6, DirichletGroup(17, Qp(17)).0^8)37sage: kappa2(5) == -5^638True39sage: kappa2(13) == 13^640True4142A non-locally-algebraic character, sending the generator 18 of `1 + 1743\ZZ_{17}` to 35 and acting as `\mu \mapsto \mu^4` on the group of 16th44roots of unity::4546sage: kappa3 = W(35 + O(17^20), 4, algebraic=False)47sage: kappa3(2)4816 + 8*17 + ... + O(17^20)4950AUTHORS:5152- David Loeffler (2008-9)53"""5455#*****************************************************************************56# Copyright (C) 2008 William Stein <[email protected]>57# 2008-9 David Loeffler <[email protected]>58#59# Distributed under the terms of the GNU General Public License (GPL)60# http://www.gnu.org/licenses/61#*****************************************************************************6263from sage.structure.parent_base import ParentWithBase64from sage.structure.element import Element65from sage.modular.dirichlet import DirichletGroup, trivial_character66from sage.rings.all import ZZ, QQ, divisors, IntegerModRing, Qp, Infinity67from sage.rings.padics.padic_generic_element import pAdicGenericElement68from sage.misc.misc import verbose69from sage.misc.cachefunc import cached_method70import weakref7172_wscache = {}73def WeightSpace_constructor(p, base_ring=None):74r"""75Construct the p-adic weight space for the given prime p. A `p`-adic weight76is a continuous character `\ZZ_p^\times \to \CC_p^\times`.77These are the `\CC_p`-points of a rigid space over `\QQ_p`,78which is isomorphic to a disjoint union of copies (indexed by79`(\ZZ/p\ZZ)^\times`) of the open unit `p`-adic disc.8081Note that the "base ring" of a `p`-adic weight is the smallest ring82containing the image of `\ZZ`; in particular, although the default base83ring is `\QQ_p`, base ring `\QQ` will also work.8485EXAMPLES::8687sage: pAdicWeightSpace(3) # indirect doctest88Space of 3-adic weight-characters defined over '3-adic Field with capped relative precision 20'89sage: pAdicWeightSpace(3, QQ)90Space of 3-adic weight-characters defined over 'Rational Field'91sage: pAdicWeightSpace(10)92Traceback (most recent call last):93...94ValueError: p must be prime95"""96if base_ring is None:97base_ring = Qp(p)98if _wscache.has_key((p, base_ring)):99m = _wscache[(p, base_ring)]()100if m is not None:101return m102m = WeightSpace_class(p, base_ring)103_wscache[(p, base_ring)] = weakref.ref(m)104return m105106class WeightSpace_class(ParentWithBase):107r"""108The space of `p`-adic weight-characters `\mathcal{W} = {\rm109Hom}(\ZZ_p^\times, \CC_p^\times)`. This isomorphic to a110disjoint union of `(p-1)` open discs of radius 1 (or 2 such discs if `p =1112`), with the parameter on the open disc corresponding to the image of `1 +112p` (or 5 if `p = 2`)113114TESTS::115116sage: W = pAdicWeightSpace(3)117sage: W is loads(dumps(W))118True119"""120121def __init__(self, p, base_ring):122r"""123Initialisation function.124125EXAMPLE::126127sage: pAdicWeightSpace(17)128Space of 17-adic weight-characters defined over '17-adic Field with capped relative precision 20'129"""130ParentWithBase.__init__(self, base=base_ring)131p = ZZ(p)132if not p.is_prime():133raise ValueError, "p must be prime"134self._p = p135self._param = Qp(p)((p == 2 and 5) or (p + 1))136137def _repr_(self):138r"""139String representation of self.140141EXAMPLE::142143sage: pAdicWeightSpace(17)._repr_()144"Space of 17-adic weight-characters defined over '17-adic Field with capped relative precision 20'"145"""146return "Space of %s-adic weight-characters defined over '%s'" % (self.prime(), self.base_ring())147148def __reduce__(self):149r"""150Used for pickling.151152EXAMPLE::153154sage: pAdicWeightSpace(3).__reduce__()155(<function WeightSpace_constructor at ...>, (3, 3-adic Field with capped relative precision 20))156"""157return (WeightSpace_constructor, (self.prime(), self.base_ring()))158159def __call__(self, arg1, arg2 = None, algebraic=True):160r"""161Create an element of this space.162163If ``algebraic = True`` (the default), create a locally algebraic164character. The arguments should be `(k, \chi)` with `k \in \ZZ`165and `\chi` a Dirichlet character of `p`-power conductor defined over a166`p`-adic field; this corresponds to the weight-character `x \mapsto x^k167\chi(x)`. If `\chi` is omitted, it defaults to the trivial character.168169If ``algebraic = False``, create a general character. The arguments are170now (t, w) where `t \in \ZZ/(p-1)\ZZ` and `w \in171\CC_p` with `|w - 1| < 1`. This corresponds to the character172`\kappa` satisfying `\kappa(\mu) = \mu^t` where `\mu` is a `(p-1)`-st173root of unity, and `\kappa(1 + p) = w`.174175EXAMPLES::176177sage: W = pAdicWeightSpace(17)178sage: W(4)1794180sage: W(4, DirichletGroup(17, Qp(17)).0)181(4, 17, [3 + 13*17 + ... + O(17^20)])182sage: W(1 + O(17^5), 4, algebraic = False)183[1 + O(17^5), 4]184"""185186if isinstance(arg1, WeightCharacter):187if arg1.parent() is self:188return arg1189elif arg1.parent().prime() == self.prime():190return self._coerce_in_wtchar(arg1)191else:192raise TypeError, "Incompatible type!"193194if algebraic:195return AlgebraicWeight(self, arg1, arg2)196else:197return ArbitraryWeight(self, arg1, arg2)198199@cached_method200def zero_element(self):201"""202Return the zero of this weight space.203204EXAMPLES::205206sage: W = pAdicWeightSpace(17)207sage: W.zero_element()2080209"""210return self(0)211212def prime(self):213r"""214Return the prime `p` such that this is a `p`-adic weight space.215216EXAMPLE::217218sage: pAdicWeightSpace(17).prime()21917220"""221return self._p222223def base_extend(self, R):224r"""225Extend scalars to the ring R. There must be a canonical coercion map226from the present base ring to R.227228EXAMPLE::229230sage: W = pAdicWeightSpace(3, QQ)231sage: W.base_extend(Qp(3))232Space of 3-adic weight-characters defined over '3-adic Field with capped relative precision 20'233sage: W.base_extend(IntegerModRing(12))234Traceback (most recent call last):235...236TypeError: No coercion map from 'Rational Field' to 'Ring of integers modulo 12' is defined237"""238if R.has_coerce_map_from(self.base_ring()):239return WeightSpace_constructor(self.prime(), R)240else:241raise TypeError, "No coercion map from '%s' to '%s' is defined" % (self.base_ring(), R)242243def _coerce_impl(self, x):244r"""245Canonical coercion of x into self.246247TESTS::248249sage: W1 = pAdicWeightSpace(23, QQ)250sage: W2 = W1.base_extend(Qp(23))251sage: w = W1(3)252sage: W2.coerce(w) # indirect doctest2533254"""255if isinstance(x, WeightCharacter) \256and x.parent().prime() == self.prime() \257and self.base_ring().has_coerce_map_from(x.base_ring()):258return self._coerce_in_wtchar(x)259raise TypeError260261def _coerce_in_wtchar(self, x):262r"""263Convert in a weight-character whose parent is different from self (with264has the prime, but possibly different base ring).265266EXAMPLE::267268sage: W1 = pAdicWeightSpace(23, Qp(3))269sage: W2 = pAdicWeightSpace(23, QQ)270sage: w = W1(3)271sage: W2._coerce_in_wtchar(w)2723273"""274if isinstance(x, AlgebraicWeight):275return AlgebraicWeight(self, x.k(), x.chi().change_ring(self.base_ring()))276else:277return ArbitraryWeight(self, self.base_ring()(x.w()), x.teichmuller_type())278279class WeightCharacter(Element):280r"""281Abstract base class representing an element of the p-adic weight space282`Hom(\ZZ_p^\times, \CC_p^\times)`.283"""284285# This should probably derive from Morphism or even from286# AbelianGroupMorphism; but Sage doesn't know about the abelian group287# Z_p^*, so Hom(Z_p^*, C_p^*) is a bit beyond it!288289def __init__(self, parent):290r"""291Initialisation function.292293EXAMPLE::294295sage: pAdicWeightSpace(17)(0)2960297"""298299Element.__init__(self, parent)300self._p = self.parent().prime()301302def base_extend(self, R):303r"""304Extend scalars to the base ring R (which must have a canonical map from305the current base ring)306307EXAMPLE::308309sage: w = pAdicWeightSpace(17, QQ)(3)310sage: w.base_extend(Qp(17))3113312"""313return self.parent().base_extend(R).coerce(self)314315def is_even(self):316r"""317Return True if this weight-character sends -1 to +1.318319EXAMPLE::320321sage: pAdicWeightSpace(17)(0).is_even()322True323sage: pAdicWeightSpace(17)(11).is_even()324False325sage: pAdicWeightSpace(17)(1 + 17 + O(17^20), 3, False).is_even()326False327sage: pAdicWeightSpace(17)(1 + 17 + O(17^20), 4, False).is_even()328True329"""330if self(-1) == -1:331return False332else:333return True334335def pAdicEisensteinSeries(self, ring, prec=20):336r"""337Calculate the q-expansion of the p-adic Eisenstein series of given338weight-character, normalised so the constant term is 1.339340EXAMPLE::341342sage: kappa = pAdicWeightSpace(3)(3, DirichletGroup(3,QQ).0)343sage: kappa.pAdicEisensteinSeries(QQ[['q']], 20)3441 - 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)345"""346if not self.is_even():347raise ValueError, "Eisenstein series not defined for odd weight-characters"348q = ring.gen()349s = 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)])350return s.add_bigoh(prec)351352def values_on_gens(self):353r"""354If `\kappa` is this character, calculate the values `(\kappa(r), t)`355where `r` is `1 + p` (or 5 if `p = 2`) and `t` is the unique element of356`\ZZ/(p-1)\ZZ` such that `\kappa(\mu) = \mu^t` for `\mu`357a (p-1)st root of unity. (If `p = 2`, we take `t` to be 0 or 1358according to whether `\kappa` is odd or even.) These two values359uniquely determine the character `\kappa`.360361EXAMPLES::362363sage: W=pAdicWeightSpace(11); W(2).values_on_gens()364(1 + 2*11 + 11^2 + O(11^20), 2)365sage: W(2, DirichletGroup(11, QQ).0).values_on_gens()366(1 + 2*11 + 11^2 + O(11^20), 7)367sage: W(1 + 2*11 + O(11^5), 4, algebraic = False).values_on_gens()368(1 + 2*11 + O(11^5), 4)369"""370371return ( self(self.parent()._param), self.teichmuller_type())372373def is_trivial(self):374r"""375Return True if and only if this is the trivial character.376377EXAMPLES::378379sage: pAdicWeightSpace(11)(2).is_trivial()380False381sage: pAdicWeightSpace(11)(2, DirichletGroup(11, QQ).0).is_trivial()382False383sage: pAdicWeightSpace(11)(0).is_trivial()384True385"""386if self.values_on_gens() == (1, 0):387return True388else:389return False390391def __cmp__(self, other):392r"""393Compare self to other.394395EXAMPLES::396397sage: W=pAdicWeightSpace(11)398sage: W(2) == W(3)399False400sage: W(2, DirichletGroup(11, QQ).0) == W(2)401False402sage: W(2, DirichletGroup(11, QQ).0) == W(144 + O(11^20), 7, False)403True404"""405if not isinstance(other, WeightCharacter):406return cmp(type(self), type(other))407else:408return cmp(self.values_on_gens(), other.values_on_gens())409410def Lvalue(self):411r"""412Return the value of the p-adic L-function of `\QQ`, which can be413regarded as a rigid-analytic function on weight space, evaluated at414this character.415416EXAMPLES::417418sage: W = pAdicWeightSpace(11)419sage: sage.modular.overconvergent.weightspace.WeightCharacter(W).Lvalue()420Traceback (most recent call last):421...422NotImplementedError423"""424raise NotImplementedError425426def one_over_Lvalue(self):427r"""428Return the reciprocal of the p-adic L-function evaluated at this429weight-character. If the weight-character is odd, then the L-function430is zero, so an error will be raised.431432EXAMPLES::433434sage: pAdicWeightSpace(11)(4).one_over_Lvalue()435-12/133436sage: pAdicWeightSpace(11)(3, DirichletGroup(11, QQ).0).one_over_Lvalue()437-1/6438sage: pAdicWeightSpace(11)(3).one_over_Lvalue()439Traceback (most recent call last):440...441ZeroDivisionError: Rational division by zero442sage: pAdicWeightSpace(11)(0).one_over_Lvalue()4430444sage: type(_)445<type 'sage.rings.integer.Integer'>446"""447if self.is_trivial():448return ZZ(0)449else:450return 1/self.Lvalue()451452class AlgebraicWeight(WeightCharacter):453r"""454A point in weight space corresponding to a locally algebraic character, of455the form `x \mapsto \chi(x) x^k` where `k` is an integer and `\chi` is a456Dirichlet character modulo `p^n` for some `n`.457458TESTS::459460sage: w = pAdicWeightSpace(23)(12, DirichletGroup(23, QQ).0) # exact461sage: w == loads(dumps(w))462True463sage: w = pAdicWeightSpace(23)(12, DirichletGroup(23, Qp(23)).0) # inexact464sage: w == loads(dumps(w))465True466sage: w is loads(dumps(w)) # elements are not globally unique467False468"""469470def __init__(self, parent, k, chi=None):471r"""472Create a locally algebraic weight-character.473474EXAMPLES::475476sage: pAdicWeightSpace(29)(13, DirichletGroup(29, Qp(29)).0)477(13, 29, [2 + 2*29 + ... + O(29^20)])478"""479WeightCharacter.__init__(self, parent)480k = ZZ(k)481self._k = k482if chi is None:483chi = trivial_character(self._p, QQ)484n = ZZ(chi.conductor())485if n == 1:486n = self._p487if not n.is_power_of(self._p):488raise ValueError, "Character must have %s-power conductor" % p489self._chi = DirichletGroup(n, chi.base_ring())(chi)490491def __call__(self, x):492r"""493Evaluate this character at an element of `\ZZ_p^\times`.494495EXAMPLES:496497Exact answers are returned when this is possible::498499sage: kappa = pAdicWeightSpace(29)(13, DirichletGroup(29, QQ).0)500sage: kappa(1)5011502sage: kappa(0)5030504sage: kappa(12)505-106993205379072506sage: kappa(-1)507-1508sage: kappa(13 + 4*29 + 11*29^2 + O(29^3))5099 + 21*29 + 27*29^2 + O(29^3)510511When the character chi is defined over a p-adic field, the results returned are inexact::512513sage: kappa = pAdicWeightSpace(29)(13, DirichletGroup(29, Qp(29)).0^14)514sage: kappa(1)5151 + O(29^20)516sage: kappa(0)5170518sage: kappa(12)51917 + 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)520sage: kappa(12) == -106993205379072521True522sage: kappa(-1) == -1523True524sage: kappa(13 + 4*29 + 11*29^2 + O(29^3))5259 + 21*29 + 27*29^2 + O(29^3)526"""527if isinstance(x, pAdicGenericElement):528if x.parent().prime() != self._p:529raise TypeError, "x must be an integer or a %s-adic integer" % self._p530if self._p**(x.precision_absolute()) < self._chi.conductor():531raise Exception, "Precision too low"532xint = x.lift()533else:534xint = x535if (xint % self._p == 0): return 0536return self._chi(xint) * x**self._k537538def k(self):539r"""540If this character is `x \mapsto x^k \chi(x)` for an integer `k` and a541Dirichlet character `\chi`, return `k`.542543EXAMPLE::544545sage: kappa = pAdicWeightSpace(29)(13, DirichletGroup(29, Qp(29)).0^14)546sage: kappa.k()54713548"""549return self._k550551def chi(self):552r"""553If this character is `x \mapsto x^k \chi(x)` for an integer `k` and a554Dirichlet character `\chi`, return `\chi`.555556EXAMPLE::557558sage: kappa = pAdicWeightSpace(29)(13, DirichletGroup(29, Qp(29)).0^14)559sage: kappa.chi()560Dirichlet character modulo 29 of conductor 29 mapping 2 |--> 28 + 28*29 + 28*29^2 + ... + O(29^20)561"""562return self._chi563564def _repr_(self):565r"""566String representation of self.567568EXAMPLES::569570sage: pAdicWeightSpace(17)(2)._repr_()571'2'572sage: pAdicWeightSpace(17)(2, DirichletGroup(17, QQ).0)._repr_()573'(2, 17, [-1])'574sage: pAdicWeightSpace(17)(2, DirichletGroup(17, QQ).0^2)._repr_()575'2'576"""577if self._chi.is_trivial():578return "%s" % self._k579else:580return "(%s, %s, %s)" % (self._k, self._chi.modulus(), self._chi._repr_short_())581582def teichmuller_type(self):583r"""584Return the Teichmuller type of this weight-character `\kappa`, which is585the unique `t \in \ZZ/(p-1)\ZZ` such that `\kappa(\mu) =586\mu^t` for \mu a `(p-1)`-st root of 1.587588For `p = 2` this doesn't make sense, but we still want the Teichmuller589type to correspond to the index of the component of weight space in590which `\kappa` lies, so we return 1 if `\kappa` is odd and 0 otherwise.591592EXAMPLE::593594sage: pAdicWeightSpace(11)(2, DirichletGroup(11,QQ).0).teichmuller_type()5957596sage: pAdicWeightSpace(29)(13, DirichletGroup(29, Qp(29)).0).teichmuller_type()59714598sage: pAdicWeightSpace(2)(3, DirichletGroup(4,QQ).0).teichmuller_type()5990600"""601# Special case p == 2602if self._p == 2:603if self.is_even():604return IntegerModRing(2)(0)605else:606return IntegerModRing(2)(1)607m = IntegerModRing(self._p).multiplicative_generator()608x = [y for y in IntegerModRing(self._chi.modulus()) if y == m and y**(self._p - 1) == 1]609if len(x) != 1: raise ArithmeticError610x = x[0]611f = IntegerModRing(self._p)(self._chi(x)).log(m)612return IntegerModRing(self._p - 1)(self._k + f)613614def Lvalue(self):615r"""616Return the value of the p-adic L-function of `\QQ` evaluated at617this weight-character. If the character is `x \mapsto x^k \chi(x)`618where `k > 0` and `\chi` has conductor a power of `p`, this is an619element of the number field generated by the values of `\chi`, equal to620the value of the complex L-function `L(1-k, \chi)`. If `\chi` is621trivial, it is equal to `(1 - p^{k-1})\zeta(1-k)`.622623At present this is not implemented in any other cases, except the624trivial character (for which the value is `\infty`).625626TODO: Implement this more generally using the Amice transform machinery627in sage/schemes/elliptic_curves/padic_lseries.py, which should clearly628be factored out into a separate class.629630EXAMPLES::631632sage: pAdicWeightSpace(7)(4).Lvalue() == (1 - 7^3)*zeta__exact(-3)633True634sage: pAdicWeightSpace(7)(5, DirichletGroup(7, Qp(7)).0^4).Lvalue()6350636sage: pAdicWeightSpace(7)(6, DirichletGroup(7, Qp(7)).0^4).Lvalue()6371 + 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)638"""639if self._k > 0:640return -self._chi.bernoulli(self._k)/self._k641if self.is_trivial():642return Infinity643else:644raise NotImplementedError, "Don't know how to compute value of this L-function"645646class ArbitraryWeight(WeightCharacter):647648def __init__(self, parent, w, t):649r"""650Create the element of p-adic weight space in the given component651mapping 1 + p to w. Here w must be an element of a p-adic field, with652finite precision.653654EXAMPLE::655656sage: pAdicWeightSpace(17)(1 + 17^2 + O(17^3), 11, False)657[1 + 17^2 + O(17^3), 11]658"""659WeightCharacter.__init__(self, parent)660661self.t = ZZ(t) % (self._p > 2 and (self._p - 1) or 2)662# do we store w precisely?663if (w - 1).valuation() <= 0:664raise ValueError, "Must send generator to something nearer 1"665self.w = w666667def _repr_(self):668r"""String representation of this character.669670EXAMPLES::671672sage: pAdicWeightSpace(97)(1 + 2*97 + O(97^20), 12, False)._repr_()673'[1 + 2*97 + O(97^20), 12]'674"""675return "[%s, %s]" % (self.w, self.t)676677def __call__(self, x):678r"""679Evaluate this character at an element of `\ZZ_p^\times`.680681EXAMPLES::682683sage: kappa = pAdicWeightSpace(23)(1 + 23^2 + O(23^20), 4, False)684sage: kappa(2)68516 + 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)686sage: kappa(-1)6871 + O(23^20)688sage: kappa(23)6890690sage: kappa(2 + 2*23 + 11*23^2 + O(23^3))69116 + 7*23 + O(23^3)692"""693694if not isinstance(x, pAdicGenericElement):695x = Qp(self._p)(x)696if x.valuation() != 0:697return 0698699teich = x.parent().teichmuller(x)700xx = x / teich701if (xx - 1).valuation() <= 0:702raise ArithmeticError703verbose("Normalised element is %s" % xx)704705e = xx.log() / self.parent()._param.log()706verbose("Exponent is %s" % e)707708return teich**(self.t) * (self.w.log() * e).exp()709710def teichmuller_type(self):711r"""712Return the Teichmuller type of this weight-character `\kappa`, which is713the unique `t \in \ZZ/(p-1)\ZZ` such that `\kappa(\mu) =714\mu^t` for \mu a `(p-1)`-st root of 1.715716For `p = 2` this doesn't make sense, but we still want the Teichmuller717type to correspond to the index of the component of weight space in718which `\kappa` lies, so we return 1 if `\kappa` is odd and 0 otherwise.719720EXAMPLES::721722sage: pAdicWeightSpace(17)(1 + 3*17 + 2*17^2 + O(17^3), 8, False).teichmuller_type()7238724sage: pAdicWeightSpace(2)(1 + 2 + O(2^2), 1, False).teichmuller_type()7251726"""727return self.t728729730731