Ejemplo n.º 1
0
    def coerce_to_Qp(self,p,M):
        r"""
        If `K` is the base_ring of self, this function takes all maps 
        `K-->Q_p` and applies them to self return a vector of 
        <modular symbol,map: `K-->Q_p`> as map varies over all such maps.  
        `M` is the accuracy

        INPUT:
            - ``p`` --
            - ``M`` --

        OUTPUT:

        EXAMPLES:
        """
        K = self.base_ring()
        f = K.defining_polynomial()
        R = pAdicField(p,M+10)['x']
        x = R.gen()
        v = R(f).roots()
        if len(v) == 0:
            print "No coercion possible -- no prime over p has degree 1"
            return []
        else:
            ans = []
            for j in range(len(v)):
                root = v[j][0]
                psi = K.hom([root],pAdicField(p,M))
                ans = ans+[[self.map(psi),psi]]
        return ans
Ejemplo n.º 2
0
    def interpolation_factor(self, ap, chip=1, psi=None):
        r"""
        Return the interpolation factor associated to self.
        This is the `p`-adic multiplier that which appears in
        the interpolation formula of the `p`-adic `L`-function. It
        has the form `(1-\alpha_p^{-1})^2`, where `\alpha_p` is the
        unit root of `X^2 - \psi(a_p) \chi(p) X + p`.

        INPUT:

        - ``ap`` -- the eigenvalue of the Up operator

        - ``chip`` -- the value of the nebentype at p (default: 1)

        - ``psi`` -- a twisting character (default: None)

        OUTPUT: a `p`-adic number

        EXAMPLES::

            sage: E = EllipticCurve('19a2')
            sage: L = E.padic_lseries(3,implementation="pollackstevens",precision=6)  # long time
            sage: ap = E.ap(3)               # long time
            sage: L.interpolation_factor(ap) # long time
            3^2 + 3^3 + 2*3^5 + 2*3^6 + O(3^7)

        Comparing against a different implementation::

            sage: L = E.padic_lseries(3)
            sage: (1-1/L.alpha(prec=4))^2
            3^2 + 3^3 + O(3^5)
        """
        M = self.symbol().precision_relative()
        p = self.prime()
        if p == 2:
            R = pAdicField(2, M + 1)
        else:
            R = pAdicField(p, M)
        if psi is not None:
            ap = psi(ap)
        ap = ap * chip
        sdisc = R(ap**2 - 4 * p).sqrt()
        v0 = (R(ap) + sdisc) / 2
        v1 = (R(ap) - sdisc) / 2
        if v0.valuation() > 0:
            v0, v1 = v1, v0
        alpha = v0
        return (1 - 1 / alpha)**2
Ejemplo n.º 3
0
    def interpolation_factor(self, ap, chip=1, psi=None):
        r"""
        Return the interpolation factor associated to self.
        This is the `p`-adic multiplier that which appears in
        the interpolation formula of the `p`-adic `L`-function. It
        has the form `(1-\alpha_p^{-1})^2`, where `\alpha_p` is the
        unit root of `X^2 - \psi(a_p) \chi(p) X + p`.

        INPUT:

        - ``ap`` -- the eigenvalue of the Up operator

        - ``chip`` -- the value of the nebentype at p (default: 1)

        - ``psi`` -- a twisting character (default: None)

        OUTPUT: a `p`-adic number

        EXAMPLES::

            sage: E = EllipticCurve('19a2')
            sage: L = E.padic_lseries(3,implementation="pollackstevens",precision=6)  # long time
            sage: ap = E.ap(3)               # long time
            sage: L.interpolation_factor(ap) # long time
            3^2 + 3^3 + 2*3^5 + 2*3^6 + O(3^7)

        Comparing against a different implementation::

            sage: L = E.padic_lseries(3)
            sage: (1-1/L.alpha(prec=4))^2
            3^2 + 3^3 + O(3^5)
        """
        M = self.symbol().precision_relative()
        p = self.prime()
        if p == 2:
            R = pAdicField(2, M + 1)
        else:
            R = pAdicField(p, M)
        if psi is not None:
            ap = psi(ap)
        ap = ap * chip
        sdisc = R(ap ** 2 - 4 * p).sqrt()
        v0 = (R(ap) + sdisc) / 2
        v1 = (R(ap) - sdisc) / 2
        if v0.valuation() > 0:
            v0, v1 = v1, v0
        alpha = v0
        return (1 - 1 / alpha) ** 2
Ejemplo n.º 4
0
    def p_stabilize_ordinary(self,p,ap,M):
        r"""
        Returns the unique `p`-ordinary `p`-stabilization of self

        INPUT:
            - ``p`` -- good ordinary prime
            - ``ap`` -- Hecke eigenvalue
            - ``M`` -- precision of `Q_p`

        OUTPUT:

        The unique modular symbol of level `N*p` with the same Hecke-eigenvalues as self away from `p` 
        and unit eigenvalue at `p`.

        EXAMPLES:

        ::

        sage: E = EllipticCurve('11a')
        sage: phi = form_modsym_from_elliptic_curve(E); phi
        [-1/5, 3/2, -1/2]        
        sage: phi_ord = phi.p_stabilize_ordinary(3,E.ap(3),10); phi_ord
        [-47611/238060, 47615/95224, 95221/95224, 47611/238060, -95217/476120, 95225/95224, -5951/11903, -95229/95224, 95237/476120]
        sage: phi_ord.hecke(2) - phi_ord.scale(E.ap(2))
        [0, 0, 0, 0, 0, 0, 0, 0, 0]
        sage: phi_ord.hecke(5) - phi_ord.scale(E.ap(5))
        [0, 0, 0, 0, 0, 0, 0, 0, 0]
        sage: p = 3
        sage: M = 100
        sage: R = pAdicField(p,M)['y'] 
        sage: y = R.gen()
        sage: f = y**2-ap*y+p
        sage: v = f.roots()
        sage: alpha = v[0][0]
        sage: alpha
        2 + 3^2 + 2*3^3 + 2*3^4 + 2*3^6 + 3^8 + 2*3^9 + 2*3^11 + 2*3^13 + 3^14 + 2*3^15 + 3^18 + 3^19 + 2*3^20 + 2*3^23 + 2*3^25 + 3^28 + 3^29 + 2*3^32 + 3^33 + 3^34 + 3^36 + 3^37 + 2*3^38 + 3^39 + 3^40 + 2*3^43 + 3^44 + 3^45 + 3^46 + 2*3^48 + 3^49 + 2*3^50 + 3^51 + 3^52 + 3^53 + 3^55 + 3^56 + 3^58 + 3^60 + 3^62 + 3^63 + 2*3^65 + 3^67 + 3^70 + 3^71 + 2*3^73 + 2*3^75 + 2*3^78 + 2*3^79 + 3^82 + 2*3^84 + 3^86 + 3^87 + 3^88 + 3^89 + 2*3^91 + 2*3^92 + 3^93 + 3^94 + 3^95 + O(3^100)
        sage: alpha^2 - E.ap(3)*alpha + 3
        O(3^100)
        sage: alpha=ZZ(alpha)
        sage: (phi_ord.hecke(3) - phi_ord.scale(alpha)).valuation(3)
        11

        """
        N = self.level()
        k = self.data(0).weight()
        assert N%p!=0, "The level isn't prime to p"
        assert (ap%p)!=0, "Not ordinary!"

        # Makes alpha the unit root of the Hecke polynomial x^2-a_p*x+p^(k+1)
        R = pAdicField(p,M)['y'] 
        y = R.gen()
        f = y**2-ap*y+p**(k+1)
        v = f.roots()
        if ZZ(v[0][0])%p<>0:
            alpha = ZZ(v[0][0])
        else:
            alpha = ZZ(v[1][0])
        if self.full_data() == 0:
            self.compute_full_data_from_gen_data()
        return self.p_stabilize(p,alpha)
Ejemplo n.º 5
0
    def series(self, prec=5):
        r"""
        Return the ``prec``-th approximation to the `p`-adic `L`-series
        associated to self, as a power series in `T` (corresponding to
        `\gamma-1` with `\gamma` the chosen generator of `1+p\ZZ_p`).

        INPUT:

        - ``prec`` -- (default 5) is the precision of the power series

        EXAMPLES::

            sage: E = EllipticCurve('14a2')
            sage: p = 3
            sage: prec = 6
            sage: L = E.padic_lseries(p,implementation="pollackstevens",precision=prec) # long time
            sage: L.series(4)          # long time
            2*3 + 3^4 + 3^5 + O(3^6) + (2*3 + 3^2 + O(3^4))*T + (2*3 + O(3^2))*T^2 + (3 + O(3^2))*T^3 + O(T^4)

            sage: E = EllipticCurve("15a3")
            sage: L = E.padic_lseries(5,implementation="pollackstevens",precision=15)  # long time
            sage: L.series(3)            # long time
            O(5^15) + (2 + 4*5^2 + 3*5^3 + 5^5 + 2*5^6 + 3*5^7 + 3*5^8 + 2*5^9 + 2*5^10 + 3*5^11 + 5^12 + O(5^13))*T + (4*5 + 4*5^3 + 3*5^4 + 4*5^5 + 3*5^6 + 2*5^7 + 5^8 + 4*5^9 + 3*5^10 + O(5^11))*T^2 + O(T^3)

            sage: E = EllipticCurve("79a1")
            sage: L = E.padic_lseries(2,implementation="pollackstevens",precision=10) # not tested
            sage: L.series(4)  # not tested
            O(2^9) + (2^3 + O(2^4))*T + O(2^0)*T^2 + (O(2^-3))*T^3 + O(T^4)
        """
        p = self.prime()
        M = self.symbol().precision_relative()
        K = pAdicField(p, M)
        R = PowerSeriesRing(K, names="T")
        T = R.gens()[0]
        return R([self[i] for i in range(prec)]).add_bigoh(prec)
Ejemplo n.º 6
0
    def _basic_integral(self, a, j):
        r"""
        Return `\int_{a+pZ_p} (z-{a})^j d\Phi(0-infty)`.

        See formula in section 9.2 of [PS2011]_

        INPUT:

        - ``a`` -- integer in range(p)
        - ``j`` -- integer in range(self.symbol().precision_relative())

        EXAMPLES::

            sage: from sage.modular.pollack_stevens.padic_lseries import pAdicLseries
            sage: E = EllipticCurve('11a3')
            sage: L = E.padic_lseries(5, implementation="pollackstevens", precision=4) #long time
            sage: L._basic_integral(1,2) # long time
            2*5^2 + 5^3 + O(5^4)
        """
        symb = self.symbol()
        M = symb.precision_relative()
        if j > M:
            raise PrecisionError("Too many moments requested")
        p = self.prime()
        ap = symb.Tq_eigenvalue(p)
        D = self._quadratic_twist
        ap = ap * kronecker(D, p)
        K = pAdicField(p, M)
        symb_twisted = symb.evaluate_twisted(a, D)
        return sum(
            binomial(j, r) * ((a - ZZ(K.teichmuller(a)))**(j - r)) *
            (p**r) * symb_twisted.moment(r) for r in range(j + 1)) / ap
Ejemplo n.º 7
0
    def series(self, prec=5):
        r"""
        Return the ``prec``-th approximation to the `p`-adic `L`-series
        associated to ``self``, as a power series in `T` (corresponding to
        `\gamma-1` with `\gamma` the chosen generator of `1+p\ZZ_p`).

        INPUT:

        - ``prec`` -- (default 5) is the precision of the power series

        EXAMPLES::

            sage: E = EllipticCurve('14a2')
            sage: p = 3
            sage: prec = 6
            sage: L = E.padic_lseries(p,implementation="pollackstevens",precision=prec) # long time
            sage: L.series(4)          # long time
            2*3 + 3^4 + 3^5 + O(3^6) + (2*3 + 3^2 + O(3^4))*T + (2*3 + O(3^2))*T^2 + (3 + O(3^2))*T^3 + O(T^4)

            sage: E = EllipticCurve("15a3")
            sage: L = E.padic_lseries(5,implementation="pollackstevens",precision=15)  # long time
            sage: L.series(3)            # long time
            O(5^15) + (2 + 4*5^2 + 3*5^3 + 5^5 + 2*5^6 + 3*5^7 + 3*5^8 + 2*5^9 + 2*5^10 + 3*5^11 + 5^12 + O(5^13))*T + (4*5 + 4*5^3 + 3*5^4 + 4*5^5 + 3*5^6 + 2*5^7 + 5^8 + 4*5^9 + 3*5^10 + O(5^11))*T^2 + O(T^3)

            sage: E = EllipticCurve("79a1")
            sage: L = E.padic_lseries(2,implementation="pollackstevens",precision=10) # not tested
            sage: L.series(4)  # not tested
            O(2^9) + (2^3 + O(2^4))*T + O(2^0)*T^2 + (O(2^-3))*T^3 + O(T^4)
        """
        p = self.prime()
        M = self.symbol().precision_relative()
        K = pAdicField(p, M)
        R = PowerSeriesRing(K, names='T')
        return R([self[i] for i in range(prec)]).add_bigoh(prec)
Ejemplo n.º 8
0
    def series(self, n, prec):
        r"""
        Returns the `n`-th approximation to the `p`-adic `L`-series
        associated to self, as a power series in `T` (corresponding to
        `\gamma-1` with `\gamma= 1 + p` as a generator of `1+p\ZZ_p`).

        EXAMPLES::
        
            sage: from sage.modular.pollack_stevens.space import ps_modsym_from_elliptic_curve
            sage: E = EllipticCurve('57a')
            sage: p = 5
            sage: prec = 4
            sage: phi = ps_modsym_from_elliptic_curve(E)
            sage: phi_stabilized = phi.p_stabilize(p,M = prec+3)
            sage: Phi = phi_stabilized.lift(p,prec,None,algorithm='stevens',eigensymbol=True)
            sage: L = pAdicLseries(Phi)
            sage: L.series(3,4)
            O(5^3) + (3*5 + 5^2 + O(5^3))*T + (5 + O(5^2))*T^2
            
            sage: L1 = E.padic_lseries(5)
            sage: L1.series(4)
            O(5^6) + (3*5 + 5^2 + O(5^3))*T + (5 + 4*5^2 + O(5^3))*T^2 + (4*5^2 + O(5^3))*T^3 + (2*5 + 4*5^2 + O(5^3))*T^4 + O(T^5)
        
        """
        p = self.prime()
        M = self.symb().precision_absolute()
        K = pAdicField(p, M)
        R = PowerSeriesRing(K, names = 'T')
        T = R.gens()[0]
        R.set_default_prec(prec)
        return sum(self[i] * T**i for i in range(n))
Ejemplo n.º 9
0
    def _basic_integral(self, a, j):
        r"""
        Return `\int_{a+pZ_p} (z-{a})^j d\Phi(0-infty)`
        -- see formula [Pollack-Stevens, sec 9.2]

        INPUT:

        - ``a`` -- integer in range(p)
        - ``j`` -- integer in range(self.symbol().precision_relative())

        EXAMPLES::

            sage: from sage.modular.pollack_stevens.padic_lseries import pAdicLseries
            sage: E = EllipticCurve('11a3')
            sage: L = E.padic_lseries(5, implementation="pollackstevens", precision=4) #long time
            sage: L._basic_integral(1,2) # long time
            2*5^2 + 5^3 + O(5^4)
        """
        symb = self.symbol()
        M = symb.precision_relative()
        if j > M:
            raise PrecisionError("Too many moments requested")
        p = self.prime()
        ap = symb.Tq_eigenvalue(p)
        D = self._quadratic_twist
        ap = ap * kronecker(D, p)
        K = pAdicField(p, M)
        symb_twisted = symb.evaluate_twisted(a, D)
        return (
            sum(
                binomial(j, r) * ((a - ZZ(K.teichmuller(a))) ** (j - r)) * (p ** r) * symb_twisted.moment(r)
                for r in range(j + 1)
            )
            / ap
        )
Ejemplo n.º 10
0
    def interpolation_factor(self, ap, chip=1, psi=None):
        r"""
        Return the interpolation factor associated to self.
        This is the `p`-adic multiplier that which appears in
        the interpolation formula of the `p`-adic `L`-function.

        INPUT:

        - ``ap`` -- ## mm TODO

        - ``chip`` --

        - ``psi`` --

        OUTPUT: a `p`-adic number

        EXAMPLES::

            sage: E = EllipticCurve('19a2')
            sage: L = E.padic_lseries(3,implementation="pollackstevens",precision=6)  # long time
            sage: ap = E.ap(3)               # long time
            sage: L.interpolation_factor(ap) # long time
            3^2 + 3^3 + 2*3^5 + 2*3^6 + O(3^7)

        Comparing against a different implementation::

            sage: L = E.padic_lseries(3)
            sage: (1-1/L.alpha(prec=4))^2
            3^2 + 3^3 + O(3^5)
        """
        M = self.symbol().precision_relative()
        p = self.prime()
        if p == 2:
            R = pAdicField(2, M + 1)
        else:
            R = pAdicField(p, M)
        if psi is not None:
            ap = psi(ap)
        ap = ap * chip
        sdisc = R(ap ** 2 - 4 * p).sqrt()
        v0 = (R(ap) + sdisc) / 2
        v1 = (R(ap) - sdisc) / 2
        if v0.valuation() > 0:
            v0, v1 = v1, v0
        alpha = v0
        return (1 - 1 / alpha) ** 2
Ejemplo n.º 11
0
    def interpolation_factor(self, ap, chip=1, psi=None):
        r"""
        Return the interpolation factor associated to self.
        This is the `p`-adic multiplier that which appears in
        the interpolation formula of the `p`-adic `L`-function.

        INPUT:

        - ``ap`` -- ## mm TODO

        - ``chip`` --

        - ``psi`` --

        OUTPUT: a `p`-adic number

        EXAMPLES::

            sage: E = EllipticCurve('19a2')
            sage: L = E.padic_lseries(3,implementation="pollackstevens",precision=6)  # long time
            sage: ap = E.ap(3)               # long time
            sage: L.interpolation_factor(ap) # long time
            3^2 + 3^3 + 2*3^5 + 2*3^6 + O(3^7)

        Comparing against a different implementation::

            sage: L = E.padic_lseries(3)
            sage: (1-1/L.alpha(prec=4))^2
            3^2 + 3^3 + O(3^5)
        """
        M = self.symbol().precision_relative()
        p = self.prime()
        if p == 2:
            R = pAdicField(2, M + 1)
        else:
            R = pAdicField(p, M)
        if psi is not None:
            ap = psi(ap)
        ap = ap * chip
        sdisc = R(ap**2 - 4 * p).sqrt()
        v0 = (R(ap) + sdisc) / 2
        v1 = (R(ap) - sdisc) / 2
        if v0.valuation() > 0:
            v0, v1 = v1, v0
        alpha = v0
        return (1 - 1 / alpha)**2
Ejemplo n.º 12
0
    def p_stabilize_critical(self,p,ap,M):
        r"""

        INPUT:
            - ``p`` -- good ordinary prime
            - ``ap`` -- Hecke eigenvalue
            - ``M`` -- precision of `Q_p`

        OUTPUT:

        The unique modular symbol of level `N*p` with the same Hecke-eigenvalues as self away from `p` 
        and non-unit eigenvalue at `p`.

        EXAMPLES:

        ::

        sage: E = EllipticCurve('11a')
        sage: phi = form_modsym_from_elliptic_curve(E); phi
        [-1/5, 3/2, -1/2]        
        sage: phi_ss = phi.p_stabilize_critical(3,E.ap(3),10)
        sage: phi_ord.hecke(2) - phi_ord.scale(E.ap(2))
        [0, 0, 0, 0, 0, 0, 0, 0, 0]
        sage: phi_ord.hecke(5) - phi_ord.scale(E.ap(5))
        [0, 0, 0, 0, 0, 0, 0, 0, 0]
        sage: p = 3
        sage: M = 10
        sage: R = pAdicField(p,M)['y'] 
        sage: y = R.gen()
        sage: f = y**2-ap*y+p
        sage: v = f.roots()
        sage: beta = v[1][0]
        sage: beta^2 - E.ap(3)*beta + 3
        O(3^10)
        sage: beta=ZZ(beta)
        sage: (phi_ss.hecke(3) - phi_ss.scale(beta)).valuation(3)
        9

        """
        N = self.level()
        k = self.data(0).weight()
        assert N%p<>0, "The level isn't prime to p"
        assert (ap%p)!=0, "Not ordinary!"

        # makes alpha the non-unit root of Hecke poly
        R = pAdicField(p,M)['y'] 
        y = R.gen()
        f = y**2-ap*y+p**(k+1)
        v = f.roots()
        if ZZ(v[0][0])%p == 0:
            alpha = ZZ(v[0][0])
        else:
            alpha = ZZ(v[1][0])
        if self.full_data == 0:
            self.compute_full_data_from_gen_data()
        return self.p_stabilize(p,alpha)
Ejemplo n.º 13
0
    def interpolation_factor(self, ap,chip=1, psi = None):
        r"""
        Returns the interpolation factor associated to self

        EXAMPLES::

            sage: from sage.modular.pollack_stevens.space import ps_modsym_from_elliptic_curve
            sage: E = EllipticCurve('57a')
            sage: p = 5
            sage: prec = 4
            sage: phi = ps_modsym_from_elliptic_curve(E)
            sage: phi_stabilized = phi.p_stabilize(p,M = prec)
            sage: Phi = phi_stabilized.lift(p,prec,None,algorithm='stevens')
            sage: L = pAdicLseries(Phi)
            sage: ap = phi.Tq_eigenvalue(p)
            sage: L.interpolation_factor(ap)
            4 + 2*5 + 4*5^3 + O(5^4)

        Comparing against a different implementation:

            sage: L = E.padic_lseries(5)
            sage: (1-1/L.alpha(prec=4))^2
            4 + 2*5 + 4*5^3 + O(5^4)

        """
        M = self.symb().precision_absolute()
        p = self.prime()
        if p == 2:
            R = pAdicField(2, M + 1)
        else:
            R = pAdicField(p, M)
        if psi != None:
            ap = psi(ap)
        ap = ap*chip
        sdisc = R(ap**2 - 4*p).sqrt()
        v0 = (R(ap) + sdisc) / 2
        v1 = (R(ap) - sdisc) / 2
        if v0.valuation() > 0:
            v0, v1 = v1, v0
        alpha = v0
        return (1 - 1/alpha)**2
Ejemplo n.º 14
0
    def __getitem__(self, n):
        """
        Returns the `n`-th coefficient of the `p`-adic `L`-series
        
        EXAMPLES::

            sage: from sage.modular.pollack_stevens.space import ps_modsym_from_elliptic_curve
            sage: E = EllipticCurve('57a')
            sage: p = 5
            sage: prec = 4
            sage: phi = ps_modsym_from_elliptic_curve(E)
            sage: phi_stabilized = phi.p_stabilize(p,M = prec+3)
            sage: Phi = phi_stabilized.lift(p=p,M=prec,alpha=None,algorithm='stevens',eigensymbol=True)
            sage: L = pAdicLseries(Phi)
            sage: L[1]
            3*5 + 5^2 + O(5^3)

            sage: L1 = E.padic_lseries(5)
            sage: L1.series(4)[1]
            3*5 + 5^2 + O(5^3)
            
        """
        if self._coefficients.has_key(n):
            return self._coefficients[n]
        else:
            p = self.prime()
            symb = self.symb()
            ap = symb.Tq_eigenvalue(p)
            gamma = self._gamma
            precision = self._precision
            
            S = QQ[['z']]
            z = S.gen()
            M = symb.precision_absolute()
            K = pAdicField(p, M)
            dn = 0
            if n == 0:
                precision = M
                lb = [1] + [0 for a in range(M-1)]
            else:
                lb = log_gamma_binomial(p, gamma, z, n, 2*M)
                if precision == None:
                    precision = min([j + lb[j].valuation(p) for j in range(M, len(lb))])
                lb = [lb[a] for a in range(M)]

            for j in range(len(lb)):
                cjn = lb[j]
                temp = sum((ZZ(K.teichmuller(a))**(-j)) * self._basic_integral(a, j) for a in range(1, p))
                dn = dn + cjn*temp
            self._coefficients[n] = dn + O(p**precision)
            return self._coefficients[n]
Ejemplo n.º 15
0
    def __getitem__(self, n):
        r"""
        Return the `n`-th coefficient of the `p`-adic `L`-series

        EXAMPLES::

            sage: E = EllipticCurve('14a5')
            sage: L = E.padic_lseries(7,implementation="pollackstevens",precision=5) # long time
            sage: L[0]                                   # long time
            O(7^5)
            sage: L[1]                                   # long time
            5 + 5*7 + 2*7^2 + 2*7^3 + O(7^4)
         """

        if n in self._coefficients:
            return self._coefficients[n]
        else:
            p = self.prime()
            symb = self.symbol()
            # ap = symb.Tq_eigenvalue(p)
            gamma = self._gamma
            precision = self._precision

            S = QQ[['z']]
            z = S.gen()
            M = symb.precision_relative()
            K = pAdicField(p, M)
            dn = 0
            if n == 0:
                precision = M
                lb = [1] + [0 for a in range(M - 1)]
            else:
                lb = log_gamma_binomial(p, gamma, z, n, 2 * M)
                if precision is None:
                    precision = min(
                        [j + lb[j].valuation(p) for j in range(M, len(lb))])
                lb = [lb[a] for a in range(M)]

            for j in range(len(lb)):
                cjn = lb[j]
                temp = sum(
                    (ZZ(K.teichmuller(a))**(-j)) * self._basic_integral(a, j)
                    for a in range(1, p))
                dn = dn + cjn * temp
            self._coefficients[n] = dn.add_bigoh(precision)
            self._coefficients[n] /= self._cinf
            return self._coefficients[n]
Ejemplo n.º 16
0
    def __getitem__(self, n):
        r"""
        Return the `n`-th coefficient of the `p`-adic `L`-series

        EXAMPLES::

            sage: E = EllipticCurve('14a5')
            sage: L = E.padic_lseries(7,implementation="pollackstevens",precision=5) # long time
            sage: L[0]                                   # long time
            O(7^5)
            sage: L[1]                                   # long time
            5 + 5*7 + 2*7^2 + 2*7^3 + O(7^4)
         """

        if n in self._coefficients:
            return self._coefficients[n]
        else:
            p = self.prime()
            symb = self.symbol()
            # ap = symb.Tq_eigenvalue(p)
            gamma = self._gamma
            precision = self._precision

            S = QQ[['z']]
            z = S.gen()
            M = symb.precision_relative()
            K = pAdicField(p, M)
            dn = 0
            if n == 0:
                precision = M
                lb = [1] + [0 for a in range(M - 1)]
            else:
                lb = log_gamma_binomial(p, gamma, z, n, 2 * M)
                if precision is None:
                    precision = min([j + lb[j].valuation(p)
                                     for j in range(M, len(lb))])
                lb = [lb[a] for a in range(M)]

            for j in range(len(lb)):
                cjn = lb[j]
                temp = sum((ZZ(K.teichmuller(a)) ** (-j))
                           * self._basic_integral(a, j) for a in range(1, p))
                dn = dn + cjn * temp
            self._coefficients[n] = dn.add_bigoh(precision)
            self._coefficients[n] /= self._cinf
            return self._coefficients[n]
Ejemplo n.º 17
0
    def matrix_of_frobenius(self, p, prec=20):

        # BUG: should get this method from HyperellipticCurve_generic
        def my_chage_ring(self, R):
            from .constructor import HyperellipticCurve
            f, h = self._hyperelliptic_polynomials
            y = self._printing_ring.gen()
            x = self._printing_ring.base_ring().gen()
            return HyperellipticCurve(f.change_ring(R), h, "%s,%s"%(x,y))

        import sage.schemes.hyperelliptic_curves.monsky_washnitzer as monsky_washnitzer
        if is_pAdicField(p) or is_pAdicRing(p):
            K = p
        else:
            K = pAdicField(p, prec)
        frob_p, forms = monsky_washnitzer.matrix_of_frobenius_hyperelliptic(my_chage_ring(self, K))
        return frob_p
    def matrix_of_frobenius(self, p, prec=20):

        # BUG: should get this method from HyperellipticCurve_generic
        def my_chage_ring(self, R):
            from constructor import HyperellipticCurve
            f, h = self._hyperelliptic_polynomials
            y = self._printing_ring.gen()
            x = self._printing_ring.base_ring().gen()
            return HyperellipticCurve(f.change_ring(R), h, "%s,%s"%(x,y))

        import sage.schemes.elliptic_curves.monsky_washnitzer as monsky_washnitzer
        if is_pAdicField(p) or is_pAdicRing(p):
            K = p
        else:
            K = pAdicField(p, prec)
        frob_p, forms = monsky_washnitzer.matrix_of_frobenius_hyperelliptic(my_chage_ring(self, K))
        return frob_p
Ejemplo n.º 19
0
def pLfunction_coef(Phi,ap,n,D,gam,error=None):
    """
    Returns the nth coefficient of the `p`-adic `L`-function in the 
    `T`-variable of a quadratic twist of `\Phi`.  
    
    If error is not specified, then the correct error bound is computed 
    and the answer is return modulo that accuracy.

    INPUT:
        - ``Phi`` -- overconvergent Hecke-eigensymbol
        - ``ap`` -- eigenvalue of `U_p`
        - ``n`` -- index of desired coefficient
        - ``D`` -- discriminant of quadratic twist
        - ``gam`` -- topological generator of `1 + pZ_p`
    
    OUTPUT:

    The `n`th coefficient of the `p`-adic `L`-function in the `T`-variable
    of a quadratic twist of `\Phi`

    EXAMPLES:
    
    """
    S = QQ[['z']]
    z = S.gen()
    p = Phi.p()
    M = Phi.num_moments()
    R = pAdicField(p,M)
    lb = loggam_binom(p,gam,z,n,2*M)
    dn = 0
    if n == 0:
        err = M
    else:
        if (error == None):
            err = min([j+lb[j].valuation(p) for j in range(M,len(lb))])
        else:
            err = error
        lb = [lb[a] for a in range(M)]
        
    for j in range(len(lb)):
        cjn = lb[j]
        temp = 0
        for a in range(1,p):
            temp = temp + (teich(a,p,M)**(-j))*basic_integral(Phi,a,j,ap,D)
        dn = dn + cjn*temp
    return dn + O(p**err)
Ejemplo n.º 20
0
    def _basic_integral(self, a, j):
        r"""
        Returns `\int_{a+pZ_p} (z-{a})^j d\Phi(0-infty)`
        -- see formula [Pollack-Stevens, sec 9.2]

        INPUT:

        - ``a`` -- integer in range(p)
        - ``j`` -- integer in range(self.symb().precision_absolute())

        EXAMPLES::

            sage: from sage.modular.pollack_stevens.space import ps_modsym_from_elliptic_curve
            sage: E = EllipticCurve('57a')
            sage: p = 5
            sage: prec = 4
            sage: phi = ps_modsym_from_elliptic_curve(E)
            sage: phi_stabilized = phi.p_stabilize(p,M = prec+3)
            sage: Phi = phi_stabilized.lift(p,prec,None,algorithm = 'stevens',eigensymbol = True)
            sage: L = pAdicLseries(Phi)
            sage: L.eval_twisted_symbol_on_Da(1)
            (2 + 2*5 + 2*5^2 + 2*5^3 + O(5^4), 2 + 3*5 + 2*5^2 + O(5^3), 4*5 + O(5^2), 3 + O(5))
            sage: L._basic_integral(1,2)
            2*5^3 + O(5^4)
        
        """
        symb = self.symb()
        M = symb.precision_absolute()
        if j > M:
            raise PrecisionError ("Too many moments requested")
        p = self.prime()
        ap = symb.Tq_eigenvalue(p)
        D = self._quadratic_twist
        ap = ap * kronecker(D, p)
        K = pAdicField(p, M)
        symb_twisted = self.eval_twisted_symbol_on_Da(a)
        return sum(binomial(j, r) * ((a - ZZ(K.teichmuller(a)))**(j - r)) *
                (p**r) * symb_twisted.moment(r) for r in range(j + 1)) / ap
Ejemplo n.º 21
0
def teich(a,p,M):
    r"""
    Returns the Teichmuller representative of `a` in `Qp` as an element of `Z` 
    (`Qp` is created with precision `O(p^M)`)

    INPUT:
        - ``a`` -- element of `Qp`
	- ``p`` -- prime
	- ``M`` -- precision, `O(p^M)`

    OUTPUT:
	
    The Teichmuller representative of a as an element of `Z`

    EXAMPLES:

        sage: teich(2,5,10)
        6139557
        sage: teich(3,7,10)
        146507973
    """
    R = pAdicField(p,M)
    return ZZ(R.teichmuller(a))