Path: blob/master/sage/modular/local_comp/local_comp.py
4054 views
r"""1Local components of modular forms23If `f` is a (new, cuspidal, normalised) modular eigenform, then one can4associate to `f` an *automorphic representation* `\pi_f` of the group5`\operatorname{GL}_2(\mathbf{A})` (where `\mathbf{A}` is the adele ring of6`\QQ`). This object factors as a restricted tensor product of components7`\pi_{f, v}` for each place of `\QQ`. These are infinite-dimensional8representations, but they are specified by a finite amount of data, and this9module provides functions which determine a description of the local factor10`\pi_{f, p}` at a finite prime `p`.1112The functions in this module are based on the algorithms described in:1314.. [LW11] David Loeffler and Jared Weinstein, *On the computation of local components of a newform*,15Mathematics of Computation (to appear), 2011. `Online version16<http://dx.doi.org/10.1090/S0025-5718-2011-02530-5>`_.1718AUTHORS:1920- David Loeffler21- Jared Weinstein22"""2324import operator25from sage.structure.sage_object import SageObject26from sage.rings.all import QQ, ZZ, Zmod, QQbar, PolynomialRing, polygen27from sage.modular.modform.element import Newform28from sage.modular.dirichlet import DirichletGroup29from sage.misc.cachefunc import cached_method30from sage.misc.abstract_method import abstract_method31from sage.structure.sequence import Sequence3233from type_space import TypeSpace34from smoothchar import SmoothCharacterGroupQp, SmoothCharacterGroupUnramifiedQuadratic, SmoothCharacterGroupRamifiedQuadratic3536def LocalComponent(f, p, twist_factor=None):37r"""38Calculate the local component at the prime `p` of the automorphic39representation attached to the newform `f`.4041INPUT:4243- ``f`` (:class:`~sage.modular.modform.element.Newform`) a newform of weight `k \ge 2`44- ``p`` (integer) a prime45- ``twist_factor`` (integer) an integer congruent to `k` modulo 2 (default: `k - 2`)4647.. note::4849The argument ``twist_factor`` determines the choice of normalisation: if it is50set to `j \in \ZZ`, then the central character of `\pi_{f, \ell}` maps `\ell`51to `\ell^j \varepsilon(\ell)` for almost all `\ell`, where `\varepsilon` is the52Nebentypus character of `f`.5354In the analytic theory it is conventional to take `j = 0` (the "Langlands55normalisation"), so the representation `\pi_f` is unitary; however, this is56inconvenient for `k` odd, since in this case one needs to choose a square root of `p`57and thus the map `f \to \pi_{f}` is not Galois-equivariant. Hence we use, by default, the58"Hecke normalisation" given by `j = k - 2`. This is also the most natural normalisation59from the perspective of modular symbols.6061We also adopt a slightly unusual definition of the principal series: we62define `\pi(\chi_1, \chi_2)` to be the induction from the Borel subgroup of63the character of the maximal torus `\begin{pmatrix} x & \\ & y64\end{pmatrix} \mapsto \chi_1(a) \chi_2(b) |b|`, so its central character is65`z \mapsto \chi_1(z) \chi_2(z) |z|`. Thus `\chi_1 \chi_2` is the66restriction to `\QQ_p^\times` of the unique character of the id\'ele class67group mapping `\ell` to `\ell^{k-1} \varepsilon(\ell)` for almost all `\ell`.68This has the property that the *set* `\{\chi_1, \chi_2\}` also depends69Galois-equivariantly on `f`.7071EXAMPLE::7273sage: Pi = LocalComponent(Newform('49a'), 7); Pi74Smooth representation of GL_2(Q_7) with conductor 7^275sage: Pi.central_character()76Character of Q_7*, of level 0, mapping 7 |--> 177sage: Pi.species()78'Supercuspidal'79sage: Pi.characters()80[81Character of unramified extension Q_7(s)* (s^2 + 6*s + 3 = 0), of level 1, mapping s |--> d, 7 |--> 1,82Character of unramified extension Q_7(s)* (s^2 + 6*s + 3 = 0), of level 1, mapping s |--> -d, 7 |--> 183]84"""85p = ZZ(p)86if not p.is_prime():87raise ValueError( "p must be prime" )88if not isinstance(f, Newform):89raise TypeError( "f (=%s of type %s) should be a Newform object" % (f, type(f)) )9091r = f.level().valuation(p)92if twist_factor is None:93twist_factor = ZZ(f.weight() - 2)94else:95twist_factor = ZZ(twist_factor)96if r == 0:97return UnramifiedPrincipalSeries(f, p, twist_factor)98c = ZZ(f.character().conductor()).valuation(p)99if f[p] != 0:100if c == r:101return PrimitivePrincipalSeries(f, p, twist_factor)102if c == 0 and r == 1:103return PrimitiveSpecial(f, p, twist_factor)104Xf = TypeSpace(f, p)105if Xf.is_minimal():106return PrimitiveSupercuspidal(f, p, twist_factor)107else:108raise NotImplementedError( "Form %s is not %s-primitive" % (f, p) )109110class LocalComponentBase(SageObject):111r"""112Base class for local components of newforms. Not to be directly instantiated; use the :func:`~LocalComponent` constructor function.113"""114115def __init__(self, newform, prime, twist_factor):116r"""117Standard initialisation function.118119EXAMPLE::120121sage: LocalComponent(Newform('49a'), 7) # indirect doctest122Smooth representation of GL_2(Q_7) with conductor 7^2123"""124self._p = prime125self._f = newform126self._twist_factor = twist_factor127128@abstract_method129def species(self):130r"""131The species of this local component, which is either 'Principal132Series', 'Special' or 'Supercuspidal'.133134EXAMPLE::135136sage: from sage.modular.local_comp.local_comp import LocalComponentBase137sage: LocalComponentBase(Newform('50a'), 3, 0).species()138Traceback (most recent call last):139...140NotImplementedError: <abstract method species at ...>141"""142pass143144@abstract_method145def check_tempered(self):146r"""147Check that this representation is quasi-tempered, i.e. `\pi \otimes148|\det|^{j/2}` is tempered. It is well known that local components of149modular forms are *always* tempered, so this serves as a useful check150on our computations.151152EXAMPLE::153154sage: from sage.modular.local_comp.local_comp import LocalComponentBase155sage: LocalComponentBase(Newform('50a'), 3, 0).check_tempered()156Traceback (most recent call last):157...158NotImplementedError: <abstract method check_tempered at ...>159"""160pass161162def _repr_(self):163r"""164String representation of self.165166EXAMPLE::167168sage: LocalComponent(Newform('50a'), 5)._repr_()169'Smooth representation of GL_2(Q_5) with conductor 5^2'170"""171return "Smooth representation of GL_2(Q_%s) with conductor %s^%s" % (self.prime(), self.prime(), self.conductor())172173def newform(self):174r"""175The newform of which this is a local component.176177EXAMPLE::178179sage: LocalComponent(Newform('50a'), 5).newform()180q - q^2 + q^3 + q^4 + O(q^6)181"""182return self._f183184def prime(self):185r"""186The prime at which this is a local component.187188EXAMPLE::189190sage: LocalComponent(Newform('50a'), 5).prime()1915192"""193return self._p194195def conductor(self):196r"""197The smallest `r` such that this representation has a nonzero vector fixed by the subgroup198`\begin{pmatrix} * & * \\ 0 & 1\end{pmatrix} \pmod{p^r}`. This is equal to the power of `p` dividing the level of the corresponding newform.199200EXAMPLE::201202sage: LocalComponent(Newform('50a'), 5).conductor()2032204"""205return self.newform().level().valuation(self.prime())206207def coefficient_field(self):208r"""209The field `K` over which this representation is defined. This is the field generated by the Hecke eigenvalues of the corresponding newform (over whatever base ring the newform is created).210211EXAMPLE::212213sage: LocalComponent(Newforms(50)[0], 3).coefficient_field()214Rational Field215sage: LocalComponent(Newforms(Gamma1(10), 3, base_ring=QQbar)[0], 5).coefficient_field()216Algebraic Field217sage: LocalComponent(Newforms(DirichletGroup(5).0, 7,names='c')[0], 5).coefficient_field()218Number Field in c0 with defining polynomial x^2 + (5*zeta4 + 5)*x - 88*zeta4 over its base field219"""220return self.newform().hecke_eigenvalue_field()221222def twist_factor(self):223r"""224The unique `j` such that `\begin{pmatrix} p & 0 \\ 0 & p\end{pmatrix}`225acts as multiplication by `p^j` times a root of unity.226227There are various conventions for this; see the documentation of the228:func:`~LocalComponent` constructor function for more information.229230The twist factor should have the same parity as the weight of the form,231since otherwise the map sending `f` to its local component won't be232Galois equivariant.233234EXAMPLE::235236sage: LocalComponent(Newforms(50)[0], 3).twist_factor()2370238sage: LocalComponent(Newforms(50)[0], 3, twist_factor=173).twist_factor()239173240"""241return self._twist_factor242243def central_character(self):244r"""245Return the central character of this representation. This is the246restriction to `\QQ_p^\times` of the unique smooth character `\omega`247of `\mathbf{A}^\times / \QQ^\times` such that `\omega(\varpi_\ell) =248\ell^j \varepsilon(\ell)` for all primes `\ell \nmid Np`, where249`\varpi_\ell` is a uniformiser at `\ell`, `\varepsilon` is the250Nebentypus character of the newform `f`, and `j` is the twist factor251(see the documentation for :func:`~LocalComponent`).252253EXAMPLES::254255sage: LocalComponent(Newform('27a'), 3).central_character()256Character of Q_3*, of level 0, mapping 3 |--> 1257258sage: LocalComponent(Newforms(Gamma1(5), 5, names='c')[0], 5).central_character()259Character of Q_5*, of level 1, mapping 2 |--> c0 + 1, 5 |--> 125260261sage: LocalComponent(Newforms(DirichletGroup(24)([1, -1,-1]), 3, names='a')[0], 2).central_character()262Character of Q_2*, of level 3, mapping 7 |--> 1, 5 |--> -1, 2 |--> -2263"""264from sage.rings.arith import crt265chi = self.newform().character()266f = self.prime() ** self.conductor()267N = self.newform().level() // f268G = DirichletGroup(f, self.coefficient_field())269chip = G([chi(crt(ZZ(x), 1, f, N)) for x in G.unit_gens()]).primitive_character()270a = crt(1, self.prime(), f, N)271272if chip.conductor() == 1:273return SmoothCharacterGroupQp(self.prime(), self.coefficient_field()).character(0, [chi(a) * self.prime()**self.twist_factor()])274else:275return SmoothCharacterGroupQp(self.prime(), self.coefficient_field()).character(chip.conductor().valuation(self.prime()), list((~chip).values_on_gens()) + [chi(a) * self.prime()**self.twist_factor()])276277def __cmp__(self, other):278r"""279Comparison function.280281EXAMPLE::282283sage: Pi = LocalComponent(Newform("50a"), 5)284sage: Pi == LocalComponent(Newform("50a"), 3)285False286sage: Pi == LocalComponent(Newform("50b"), 5)287False288sage: Pi == QQ289False290sage: Pi == None291False292sage: Pi == loads(dumps(Pi))293True294"""295return (cmp(type(self), type(other))296or cmp(self.prime(), other.prime())297or cmp(self.newform(), other.newform())298or cmp(self.twist_factor(), other.twist_factor()))299300class PrincipalSeries(LocalComponentBase):301r"""302A principal series representation. This is an abstract base class, not to303be instantiated directly; see the subclasses304:class:`~UnramifiedPrincipalSeries` and :class:`~PrimitivePrincipalSeries`.305"""306307def species(self):308r"""309The species of this local component, which is either 'Principal310Series', 'Special' or 'Supercuspidal'.311312EXAMPLE::313314sage: LocalComponent(Newform('50a'), 3).species()315'Principal Series'316"""317return "Principal Series"318319def check_tempered(self):320r"""321Check that this representation is tempered (after twisting by322`|\det|^{j/2}`), i.e. that `|\chi_1(p)| = |\chi_2(p)| = p^{(j + 1)/2}`.323This follows from the Ramanujan--Petersson conjecture, as proved by324Deligne.325326EXAMPLE::327328sage: LocalComponent(Newform('49a'), 3).check_tempered()329"""330c1, c2 = self.characters()331K = c1.base_ring()332p = self.prime()333w = QQbar(p)**((1 + self.twist_factor()) / 2)334for sigma in K.embeddings(QQbar):335assert sigma(c1(p)).abs() == sigma(c2(p)).abs() == w336337@abstract_method338def characters(self):339r"""340Return the two characters `(\chi_1, \chi_2)` such this representation341`\pi_{f, p}` is equal to the principal series `\pi(\chi_1, \chi_2)`.342343EXAMPLE::344345sage: from sage.modular.local_comp.local_comp import PrincipalSeries346sage: PrincipalSeries(Newform('50a'), 3, 0).characters()347Traceback (most recent call last):348...349NotImplementedError: <abstract method characters at ...>350"""351pass352353class UnramifiedPrincipalSeries(PrincipalSeries):354r"""355An unramified principal series representation of `{\rm GL}_2(\QQ_p)`356(corresponding to a form whose level is not divisible by `p`).357358EXAMPLE::359360sage: Pi = LocalComponent(Newform('50a'), 3)361sage: Pi.conductor()3620363sage: type(Pi)364<class 'sage.modular.local_comp.local_comp.UnramifiedPrincipalSeries'>365sage: TestSuite(Pi).run()366"""367368def satake_polynomial(self):369r"""370Return the Satake polynomial of this representation, i.e.~the polynomial whose roots are `\chi_1(p), \chi_2(p)`371where this representation is `\pi(\chi_1, \chi_2)`. Concretely, this is the polynomial372373.. math::374375X^2 - p^{(j - k + 2)/2} a_p(f) X + p^{j + 1} \varepsilon(p)`.376377An error will be raised if `j \ne k \bmod 2`.378379EXAMPLES::380381sage: LocalComponent(Newform('11a'), 17).satake_polynomial()382X^2 + 2*X + 17383sage: LocalComponent(Newform('11a'), 17, twist_factor = -2).satake_polynomial()384X^2 + 2/17*X + 1/17385"""386p = self.prime()387return PolynomialRing(self.coefficient_field(), 'X')([388self.central_character()(p)*p,389-self.newform()[p] * p**((self.twist_factor() - self.newform().weight() + 2)/2),3901391])392393def characters(self):394r"""395Return the two characters `(\chi_1, \chi_2)` such this representation396`\pi_{f, p}` is equal to the principal series `\pi(\chi_1, \chi_2)`.397These are the unramified characters mapping `p` to the roots of the Satake polynomial,398so in most cases (but not always) they will be defined over an399extension of the coefficient field of self.400401EXAMPLES::402403sage: LocalComponent(Newform('11a'), 17).characters()404[405Character of Q_17*, of level 0, mapping 17 |--> d,406Character of Q_17*, of level 0, mapping 17 |--> -d - 2407]408sage: LocalComponent(Newforms(Gamma1(5), 6, names='a')[1], 3).characters()409[410Character of Q_3*, of level 0, mapping 3 |--> -3/2*a1 + 12,411Character of Q_3*, of level 0, mapping 3 |--> -3/2*a1 - 12412]413"""414f = self.satake_polynomial()415if not f.is_irreducible():416# This can happen; see the second example above417d = f.roots()[0][0]418else:419d = self.coefficient_field().extension(f, 'd').gen()420G = SmoothCharacterGroupQp(self.prime(), d.parent())421return Sequence([G.character(0, [d]), G.character(0, [self.newform()[self.prime()] - d])], cr=True, universe=G)422423class PrimitivePrincipalSeries(PrincipalSeries):424r"""425A ramified principal series of the form `\pi(\chi_1, \chi_2)`426where `\chi_1` is unramified but `\chi_2` is not.427428EXAMPLE::429430sage: Pi = LocalComponent(Newforms(Gamma1(13), 2, names='a')[0], 13)431sage: type(Pi)432<class 'sage.modular.local_comp.local_comp.PrimitivePrincipalSeries'>433sage: TestSuite(Pi).run()434"""435436def characters(self):437r"""438Return the two characters `(\chi_1, \chi_2)` such that the local component `\pi_{f, p}` is the induction of the character `\chi_1 \times \chi_2` of the Borel subgroup.439440EXAMPLE::441442sage: LocalComponent(Newforms(Gamma1(13), 2, names='a')[0], 13).characters()443[444Character of Q_13*, of level 0, mapping 13 |--> 3*a0 + 2,445Character of Q_13*, of level 1, mapping 2 |--> a0 + 2, 13 |--> -3*a0 - 7446]447"""448G = SmoothCharacterGroupQp(self.prime(), self.coefficient_field())449chi1 = G.character(0, [self.newform()[self.prime()]])450chi2 = G.character(0, [self.prime()]) * self.central_character() / chi1451return Sequence([chi1, chi2], cr=True, universe=G)452453class PrimitiveSpecial(LocalComponentBase):454r"""455A primitive special representation: that is, the Steinberg representation456twisted by an unramified character. All such representations have conductor4571.458459EXAMPLES::460461sage: Pi = LocalComponent(Newform('37a'), 37)462sage: Pi.species()463'Special'464sage: Pi.conductor()4651466sage: type(Pi)467<class 'sage.modular.local_comp.local_comp.PrimitiveSpecial'>468sage: TestSuite(Pi).run()469"""470471def species(self):472r"""473The species of this local component, which is either 'Principal474Series', 'Special' or 'Supercuspidal'.475476EXAMPLE::477478sage: LocalComponent(Newform('37a'), 37).species()479'Special'480"""481return "Special"482483def characters(self):484r"""485Return the defining characters of this representation. In this case, it486will return the unique unramified character `\chi` of `\QQ_p^\times`487such that this representation is equal to `\mathrm{St} \otimes \chi`,488where `\mathrm{St}` is the Steinberg representation (defined as the489quotient of the parabolic induction of the trivial character by its490trivial subrepresentation).491492EXAMPLES:493494Our first example is the newform corresponding to an elliptic curve of495conductor `37`. This is the nontrivial quadratic twist of Steinberg,496corresponding to the fact that the elliptic curve has non-split497multiplicative reduction at 37::498499sage: LocalComponent(Newform('37a'), 37).characters()500[Character of Q_37*, of level 0, mapping 37 |--> -1]501502We try an example in odd weight, where the central character isn't503trivial::504505sage: Pi = LocalComponent(Newforms(DirichletGroup(21)([-1, 1]), 3, names='j')[0], 7); Pi.characters()506[Character of Q_7*, of level 0, mapping 7 |--> -1/2*j0^2 - 7/2]507sage: Pi.characters()[0] ^2 == Pi.central_character()508True509510An example using a non-standard twist factor::511512sage: Pi = LocalComponent(Newforms(DirichletGroup(21)([-1, 1]), 3, names='j')[0], 7, twist_factor=3); Pi.characters()513[Character of Q_7*, of level 0, mapping 7 |--> -7/2*j0^2 - 49/2]514sage: Pi.characters()[0]^2 == Pi.central_character()515True516"""517518return [SmoothCharacterGroupQp(self.prime(), self.coefficient_field()).character(0, [self.newform()[self.prime()] * self.prime() ** ((self.twist_factor() - self.newform().weight() + 2)/2)])]519520def check_tempered(self):521r"""522Check that this representation is tempered (after twisting by523`|\det|^{j/2}` where `j` is the twist factor). Since local components524of modular forms are always tempered, this is a useful check on our525calculations.526527EXAMPLE::528529sage: Pi = LocalComponent(Newforms(DirichletGroup(21)([-1, 1]), 3, names='j')[0], 7)530sage: Pi.check_tempered()531"""532c1 = self.characters()[0]533K = c1.base_ring()534p = self.prime()535w = QQbar(p)**(self.twist_factor() / ZZ(2))536for sigma in K.embeddings(QQbar):537assert sigma(c1(p)).abs() == w538539class PrimitiveSupercuspidal(LocalComponentBase):540r"""541A primitive supercuspidal representation. Except for some excpetional cases542when `p = 2` which we do not implement here, such representations are543parametrized by smooth characters of tamely ramified quadratic extensions544of `\QQ_p`.545546EXAMPLES::547548sage: f = Newform("50a")549sage: Pi = LocalComponent(f, 5)550sage: type(Pi)551<class 'sage.modular.local_comp.local_comp.PrimitiveSupercuspidal'>552sage: Pi.species()553'Supercuspidal'554sage: TestSuite(Pi).run()555"""556557def species(self):558r"""559The species of this local component, which is either 'Principal560Series', 'Special' or 'Supercuspidal'.561562EXAMPLE::563564sage: LocalComponent(Newform('49a'), 7).species()565'Supercuspidal'566"""567return "Supercuspidal"568569@cached_method570def type_space(self):571r"""572Return a :class:`~sage.modular.local_comp.type_space.TypeSpace` object573describing the (homological) type space of this newform, which we know574is dual to the type space of the local component.575576EXAMPLE::577578sage: LocalComponent(Newform('49a'), 7).type_space()5796-dimensional type space at prime 7 of form q + q^2 - q^4 + O(q^6)580"""581return TypeSpace(self.newform(), self.prime())582583def characters(self):584r"""585Return the two conjugate characters of `K^\times`, where `K` is some586quadratic extension of `\QQ_p`, defining this representation. This is587fully implemented only in the case where the power of `p` dividing the588level of the form is even, in which case `K` is the unique unramified589quadratic extension of `\QQ_p`.590591EXAMPLES:592593The first example from _[LW11]::594595sage: f = Newform('50a')596sage: Pi = LocalComponent(f, 5)597sage: chars = Pi.characters(); chars598[599Character of unramified extension Q_5(s)* (s^2 + 4*s + 2 = 0), of level 1, mapping s |--> d, 5 |--> 1,600Character of unramified extension Q_5(s)* (s^2 + 4*s + 2 = 0), of level 1, mapping s |--> -d - 1, 5 |--> 1601]602sage: chars[0].base_ring()603Number Field in d with defining polynomial x^2 + x + 1604605These characters are interchanged by the Frobenius automorphism of `\mathbb{F}_{25}`::606607sage: chars[0] == chars[1]**5608True609610A more complicated example (higher weight and nontrivial central character)::611612sage: f = Newforms(GammaH(25, [6]), 3, names='j')[0]; f613q + j0*q^2 + 1/3*j0^3*q^3 - 1/3*j0^2*q^4 + O(q^6)614sage: Pi = LocalComponent(f, 5)615sage: Pi.characters()616[617Character of unramified extension Q_5(s)* (s^2 + 4*s + 2 = 0), of level 1, mapping s |--> d, 5 |--> 5,618Character of unramified extension Q_5(s)* (s^2 + 4*s + 2 = 0), of level 1, mapping s |--> -d - 1/3*j0^3, 5 |--> 5619]620sage: Pi.characters()[0].base_ring()621Number Field in d with defining polynomial x^2 + 1/3*j0^3*x - 1/3*j0^2 over its base field622623.. warning::624625The above output isn't actually the same as in Example 2 of626_[LW11], due to an error in the published paper (correction627pending) -- the published paper has the inverses of the above628characters.629630A higher level example::631632sage: f = Newform('81a', names='j'); f633q + j0*q^2 + q^4 - j0*q^5 + O(q^6)634sage: LocalComponent(f, 3).characters() # long time (12s on sage.math, 2012)635[636Character of unramified extension Q_3(s)* (s^2 + 2*s + 2 = 0), of level 2, mapping -2*s |--> -2*d - j0, 4 |--> 1, 3*s + 1 |--> -j0*d - 2, 3 |--> 1,637Character of unramified extension Q_3(s)* (s^2 + 2*s + 2 = 0), of level 2, mapping -2*s |--> 2*d + j0, 4 |--> 1, 3*s + 1 |--> j0*d + 1, 3 |--> 1638]639640In the ramified case, it's not fully implemented, and just returns a641string indicating which ramified extension is being considered::642643sage: Pi = LocalComponent(Newform('27a'), 3)644sage: Pi.characters()645'Character of Q_3(sqrt(-3))'646sage: Pi = LocalComponent(Newform('54a'), 3)647sage: Pi.characters()648'Character of Q_3(sqrt(3))'649"""650T = self.type_space()651if self.conductor() % 2 == 0:652653G = SmoothCharacterGroupUnramifiedQuadratic(self.prime(), self.coefficient_field())654n = self.conductor() // 2655g = G.quotient_gen(n)656m = g.matrix().change_ring(ZZ).list()657tr = (~T.rho(m)).trace()658659# The inverse is needed here because T is the *homological* type space,660# which is dual to the cohomological one that defines the local component.661662X = polygen(self.coefficient_field())663theta_poly = X**2 - (-1)**n*tr*X + self.central_character()(g.norm())664if theta_poly.is_irreducible():665F = self.coefficient_field().extension(theta_poly, "d")666G = G.base_extend(F)667chi1, chi2 = [G.extend_character(n, self.central_character(), x[0]) for x in theta_poly.roots(G.base_ring())]668669# Consistency checks670assert chi1.restrict_to_Qp() == chi2.restrict_to_Qp() == self.central_character()671assert chi1*chi2 == chi1.parent().compose_with_norm(self.central_character())672673return Sequence([chi1, chi2], check=False, cr=True)674675else:676# The ramified case.677678p = self.prime()679680if p == 2:681# The ramified 2-adic representations aren't classified by admissible pairs. Die.682raise NotImplementedError( "Computation with ramified 2-adic representations not implemented" )683684if p % 4 == 3:685a = ZZ(-1)686else:687a = ZZ(Zmod(self.prime()).quadratic_nonresidue())688689tr1 = (~T.rho([0,1,a*p, 0])).trace()690tr2 = (~T.rho([0,1,p,0])).trace()691692if tr1 == tr2 == 0:693# This *can* happen. E.g. if the central character satisfies694# chi(-1) = -1, then we have theta(pi) + theta(-pi) = theta(pi)695# * (1 + -1) = 0. In this case, one can presumably identify696# the character and the extension by some more subtle argument697# but I don't know of a good way to automate the process.698raise NotImplementedError( "Can't identify ramified quadratic extension -- both traces zero" )699elif tr1 == 0:700return "Character of Q_%s(sqrt(%s))" % (p, p)701702elif tr2 == 0:703return "Character of Q_%s(sqrt(%s))" % (p, a*p)704705else:706# At least one of the traces is *always* 0, since the type707# space has to be isomorphic to its twist by the (ramified708# quadratic) character corresponding to the quadratic709# extension.710raise RuntimeError( "Can't get here!" )711712def check_tempered(self):713r"""714Check that this representation is tempered (after twisting by715`|\det|^{j/2}` where `j` is the twist factor). Since local components716of modular forms are always tempered, this is a useful check on our717calculations.718719Since the computation of the characters attached to this representation720is not implemented in the odd-conductor case, a NotImplementedError721will be raised for such representations.722723EXAMPLE::724725sage: LocalComponent(Newform("50a"), 5).check_tempered()726sage: LocalComponent(Newform("27a"), 3).check_tempered() # not tested727"""728if self.conductor() % 2:729raise NotImplementedError730c1, c2 = self.characters()731K = c1.base_ring()732p = self.prime()733w = QQbar(p)**(self.twist_factor() / ZZ(2))734for sigma in K.embeddings(QQbar):735assert c1(p).abs() == c2(p).abs() == w736737738