Example #1
0
    def parameter(self, prec=20):
        r"""
        Return the Tate parameter `q` such that the curve is isomorphic
        over the algebraic closure of `\QQ_p` to the curve
        `\QQ_p^{\times}/q^{\ZZ}`.

        INPUT:

        - ``prec`` - the `p`-adic precision, default is 20.

        EXAMPLES::

            sage: eq = EllipticCurve('130a1').tate_curve(5)
            sage: eq.parameter(prec=5)
            3*5^3 + 3*5^4 + 2*5^5 + 2*5^6 + 3*5^7 + O(5^8)
        """
        try:
            qE = self._q
            if qE.absolute_precision() >= prec:
                return qE
        except AttributeError:
            pass

        E4 = EisensteinForms(weight=4).basis()[0]
        Delta = CuspForms(weight=12).basis()[0]
        j = (E4.q_expansion(prec + 3))**3 / Delta.q_expansion(prec + 3)
        jinv = (1 / j).power_series()
        q_in_terms_of_jinv = jinv.reverse()
        R = Qp(self._p, prec=prec)
        qE = q_in_terms_of_jinv(R(1 / self._E.j_invariant()))
        self._q = qE
        return qE
Example #2
0
    def parameter(self, prec=20):
        r"""
        Return the Tate parameter `q` such that the curve is isomorphic
        over the algebraic closure of `\QQ_p` to the curve
        `\QQ_p^{\times}/q^{\ZZ}`.

        INPUT:

        - ``prec`` - the `p`-adic precision, default is 20.

        EXAMPLES::

            sage: eq = EllipticCurve('130a1').tate_curve(5)
            sage: eq.parameter(prec=5)
            3*5^3 + 3*5^4 + 2*5^5 + 2*5^6 + 3*5^7 + O(5^8)
        """
        try:
            qE = self._q
            if qE.absolute_precision() >= prec:
                return qE
        except AttributeError:
            pass

        E4 = EisensteinForms(weight=4).basis()[0]
        Delta = CuspForms(weight=12).basis()[0]
        j = (E4.q_expansion(prec + 3)) ** 3 / Delta.q_expansion(prec + 3)
        jinv = (1 / j).power_series()
        q_in_terms_of_jinv = jinv.reverse()
        R = Qp(self._p, prec=prec)
        qE = q_in_terms_of_jinv(R(1 / self._E.j_invariant()))
        self._q = qE
        return qE
Example #3
0
def tate_parameter(E, p, prec = 20, R = None):
    if R is None:
        R = Qp(p,prec)
    jE = E.j_invariant()
    E4 = EisensteinForms(weight=4).basis()[0]
    Delta = CuspForms(weight=12).basis()[0]
    j = (E4.q_expansion(prec+3))**3/Delta.q_expansion(prec+3)
    jinv = (1/j).power_series()
    q_in_terms_of_jinv = jinv.reversion()
    return q_in_terms_of_jinv(R(1/E.j_invariant()))
Example #4
0
File: util.py Project: mmasdeu/shp
def getcoords(E, u, prec=20, R=None):
    if R is None:
        R = u.parent()
        u = R(u)
    p = R.prime()
    jE = E.j_invariant()

    # Calculate the Tate parameter
    E4 = EisensteinForms(weight=4).basis()[0]
    Delta = CuspForms(weight=12).basis()[0]
    j = (E4.q_expansion(prec + 7)) ** 3 / Delta.q_expansion(prec + 7)
    qE = (1 / j).power_series().reversion()(R(1 / jE))

    # Normalize the period by appropriate powers of qE
    un = u * qE ** (-(u.valuation() / qE.valuation()).floor())

    precn = (prec / qE.valuation()).floor() + 4
    # formulas in Silverman II (Advanced Topics in the Arithmetic of Elliptic curves, p. 425)
    xx = un / (1 - un) ** 2 + sum(
        [
            qE ** n * un / (1 - qE ** n * un) ** 2
            + qE ** n / un / (1 - qE ** n / un) ** 2
            - 2 * qE ** n / (1 - qE ** n) ** 2
            for n in range(1, precn)
        ]
    )
    yy = un ** 2 / (1 - un) ** 3 + sum(
        [
            qE ** (2 * n) * un ** 2 / (1 - qE ** n * un) ** 3
            - qE ** n / un / (1 - qE ** n / un) ** 3
            + qE ** n / (1 - qE ** n) ** 2
            for n in range(1, precn)
        ]
    )

    sk = lambda q, k, pprec: sum([n ** k * q ** n / (1 - q ** n) for n in range(1, pprec + 1)])
    n = qE.valuation()
    precp = ((prec + 4) / n).floor() + 2

    tate_a4 = -5 * sk(qE, 3, precp)
    tate_a6 = (tate_a4 - 7 * sk(qE, 5, precp)) / 12
    Eq = EllipticCurve([R(1), R(0), R(0), tate_a4, tate_a6])

    C2 = (Eq.c4() * E.c6()) / (Eq.c6() * E.c4())

    C = R(C2).square_root()
    s = (C - R(E.a1())) / R(2)
    r = (s * (C - s) - R(E.a2())) / 3
    t = (r * (2 * s - C) - R(E.a3())) / 2

    return (r + C2 * xx, t + s * C2 * xx + C * C2 * yy)
Example #5
0
File: util.py Project: mmasdeu/shp
def getcoords(E, u, prec=20, R=None):
    if R is None:
        R = u.parent()
        u = R(u)
    p = R.prime()
    jE = E.j_invariant()

    # Calculate the Tate parameter
    E4 = EisensteinForms(weight=4).basis()[0]
    Delta = CuspForms(weight=12).basis()[0]
    j = (E4.q_expansion(prec + 7))**3 / Delta.q_expansion(prec + 7)
    qE = (1 / j).power_series().reversion()(R(1 / jE))

    # Normalize the period by appropriate powers of qE
    un = u * qE**(-(u.valuation() / qE.valuation()).floor())

    precn = (prec / qE.valuation()).floor() + 4
    # formulas in Silverman II (Advanced Topics in the Arithmetic of Elliptic curves, p. 425)
    xx = un / (1 - un)**2 + sum([
        qE**n * un / (1 - qE**n * un)**2 + qE**n / un /
        (1 - qE**n / un)**2 - 2 * qE**n / (1 - qE**n)**2
        for n in range(1, precn)
    ])
    yy = un**2 / (1 - un)**3 + sum([
        qE**(2 * n) * un**2 / (1 - qE**n * un)**3 - qE**n / un /
        (1 - qE**n / un)**3 + qE**n / (1 - qE**n)**2 for n in range(1, precn)
    ])

    sk = lambda q, k, pprec: sum(
        [n**k * q**n / (1 - q**n) for n in range(1, pprec + 1)])
    n = qE.valuation()
    precp = ((prec + 4) / n).floor() + 2

    tate_a4 = -5 * sk(qE, 3, precp)
    tate_a6 = (tate_a4 - 7 * sk(qE, 5, precp)) / 12
    Eq = EllipticCurve([R(1), R(0), R(0), tate_a4, tate_a6])

    C2 = (Eq.c4() * E.c6()) / (Eq.c6() * E.c4())

    C = R(C2).square_root()
    s = (C - R(E.a1())) / R(2)
    r = (s * (C - s) - R(E.a2())) / 3
    t = (r * (2 * s - C) - R(E.a3())) / 2

    return (r + C2 * xx, t + s * C2 * xx + C * C2 * yy)
Example #6
0
def modular_ratio_space(chi):
    r"""
    Compute the space of 'modular ratios', i.e. meromorphic modular forms f
    level N and character chi such that f * E is a holomorphic cusp form for
    every Eisenstein series E of weight 1 and character 1/chi.

    Elements are returned as q-expansions up to precision R, where R is one
    greater than the weight 3 Sturm bound.

    EXAMPLES::

        sage: chi = DirichletGroup(31,QQ).0
        sage: sage.modular.modform.weight1.modular_ratio_space(chi)
        [q - 8/3*q^3 + 13/9*q^4 + 43/27*q^5 - 620/81*q^6 + 1615/243*q^7 + 3481/729*q^8 + O(q^9),
         q^2 - 8/3*q^3 + 13/9*q^4 + 70/27*q^5 - 620/81*q^6 + 1858/243*q^7 + 2752/729*q^8 + O(q^9)]
    """
    from sage.modular.modform.constructor import EisensteinForms, CuspForms

    if chi(-1) == 1:
        return []
    N = chi.modulus()
    chi = chi.minimize_base_ring()
    K = chi.base_ring()
    R = Gamma0(N).sturm_bound(3) + 1
    verbose("Working precision is %s" % R, level=1)
    verbose("Coeff field is %s" % K, level=1)

    V = K**R
    I = V
    d = I.rank()

    t = verbose("Calculating Eisenstein forms in weight 1...", level=1)
    B0 = EisensteinForms(~chi, 1).q_echelon_basis(prec=R)
    B = [b + B0[0] for b in B0]
    verbose("Done (dimension %s)" % len(B), level=1, t=t)

    t = verbose("Calculating in weight 2...", level=1)
    C = CuspForms(Gamma0(N), 2).q_echelon_basis(prec=R)
    verbose("Done (dimension %s)" % len(C), t=t, level=1)

    t = verbose("Computing candidate space", level=1)
    for b in B:
        quots = (c / b for c in C)
        W = V.span(V(x.padded_list(R)) for x in quots)
        I = I.intersection(W)
        if I.rank() < d:
            verbose(" Cut down to dimension %s" % I.rank(), level=1)
            d = I.rank()
        if I.rank() == 0:
            break

    verbose("Done: intersection is %s-dimensional" % I.dimension(),
            t=t,
            level=1)

    A = PowerSeriesRing(K, 'q')
    return [A(x.list()).add_bigoh(R) for x in I.gens()]
Example #7
0
def modular_ratio_to_prec(chi, qexp, prec):
    r"""
    Given a q-expansion of a modular ratio up to sufficient precision to
    determine it uniquely, compute it to greater precision.

    EXAMPLES::

        sage: from sage.modular.modform.weight1 import modular_ratio_to_prec
        sage: R.<q> = QQ[[]]
        sage: modular_ratio_to_prec(DirichletGroup(31,QQ).0, q-q^2-q^5-q^7+q^8+O(q^9), 20)
        q - q^2 - q^5 - q^7 + q^8 + q^9 + q^10 + q^14 - q^16 - q^18 - q^19 + O(q^20)
    """
    if prec <= qexp.prec():
        return qexp.add_bigoh(prec)
    from sage.modular.modform.constructor import EisensteinForms, CuspForms
    B = EisensteinForms(~chi, 1).gen(0).qexp(prec)
    fB = qexp * B
    fB_elt = CuspForms(chi.level(), 2, base_ring=qexp.base_ring())(fB)
    return fB_elt.qexp(prec) / B
Example #8
0
def modular_ratio_to_prec(chi, qexp, prec):
    r"""
    Given a q-expansion of a modular ratio up to sufficient precision to
    determine it uniquely, compute it to greater precision.

    EXAMPLES::

        sage: from sage.modular.modform.weight1 import modular_ratio_to_prec
        sage: R.<q> = QQ[[]]
        sage: modular_ratio_to_prec(DirichletGroup(31,QQ).0, q-q^2-q^5-q^7+q^8+O(q^9), 20)
        q - q^2 - q^5 - q^7 + q^8 + q^9 + q^10 + q^14 - q^16 - q^18 - q^19 + O(q^20)
    """
    if prec <= qexp.prec():
        return qexp.add_bigoh(prec)
    from sage.modular.modform.constructor import EisensteinForms, CuspForms
    B = EisensteinForms(~chi, 1).gen(0).qexp(prec)
    fB = qexp * B
    fB_elt = CuspForms(chi.level(), 2, base_ring=qexp.base_ring())(fB)
    return fB_elt.qexp(prec) / B