Elliptic curves over \(p\)-adic fields - Elliptic curves

Skip to content
Back to top
View this page
Edit this page

# Elliptic curves over \(p\)-adic fields

AUTHORS:

- Robert Bradshaw

- William Stein

- Miljan Brakovevic

- Ralf Gerkmann

- Kiran Kedlaya

- Jennifer Balakrishnan

- Francis Clarke

class sage.schemes.elliptic_curves.ell_padic_field.EllipticCurve_padic_field(R, data, category=None)

  Bases: `EllipticCurve_field`

  Elliptic curve over a \(p\)-adic field.

  EXAMPLES:

  Sage

      sage: Qp = pAdicField(17)
      sage: E = EllipticCurve(Qp,[2,3]); E
      Elliptic Curve defined by y^2  = x^3 + (2+O(17^20))*x + (3+O(17^20))
       over 17-adic Field with capped relative precision 20
      sage: E == loads(dumps(E))
      True

  Python

      >>> from sage.all import *
      >>> Qp = pAdicField(Integer(17))
      >>> E = EllipticCurve(Qp,[Integer(2),Integer(3)]); E
      Elliptic Curve defined by y^2  = x^3 + (2+O(17^20))*x + (3+O(17^20))
       over 17-adic Field with capped relative precision 20
      >>> E == loads(dumps(E))
      True

  P_to_S(P, S)

    Given a finite Weierstrass point \(P\) and a point \(S\) in the same disc, compute the Coleman integrals \(\{\int_P^S x^i dx/2y \}_{i=0}^{2g-1}\).

    INPUT:

    - `P` – finite Weierstrass point

    - `S` – point in disc of \(P\)

    OUTPUT: Coleman integrals \(\{\int_P^S x^i dx/2y \}_{i=0}^{2g-1}\)

    EXAMPLES:

    Sage

        sage: K = Qp(5,4)
        sage: E = EllipticCurve(K, [-10,9])
        sage: P = E(1,0)
        sage: EJ = E.curve_over_ram_extn(10)
        sage: S = E.get_boundary_point(EJ,P)
        sage: E.P_to_S(P, S)
        (2*a + 4*a^3 + 2*a^11 + 4*a^13 + 2*a^17 + 2*a^19 + a^21 + 4*a^23 + a^25 + 2*a^27 + 2*a^29 + 3*a^31 + 4*a^33 + O(a^35), a^-5 + 2*a + 2*a^3 + a^7 + 3*a^11 + a^13 + 3*a^15 + 3*a^17 + 2*a^19 + 4*a^21 + 4*a^23 + 4*a^25 + 2*a^27 + a^29 + a^31 + O(a^33))

    Python

        >>> from sage.all import *
        >>> K = Qp(Integer(5),Integer(4))
        >>> E = EllipticCurve(K, [-Integer(10),Integer(9)])
        >>> P = E(Integer(1),Integer(0))
        >>> EJ = E.curve_over_ram_extn(Integer(10))
        >>> S = E.get_boundary_point(EJ,P)
        >>> E.P_to_S(P, S)
        (2*a + 4*a^3 + 2*a^11 + 4*a^13 + 2*a^17 + 2*a^19 + a^21 + 4*a^23 + a^25 + 2*a^27 + 2*a^29 + 3*a^31 + 4*a^33 + O(a^35), a^-5 + 2*a + 2*a^3 + a^7 + 3*a^11 + a^13 + 3*a^15 + 3*a^17 + 2*a^19 + 4*a^21 + 4*a^23 + 4*a^25 + 2*a^27 + a^29 + a^31 + O(a^33))

    AUTHOR:

    - Jennifer Balakrishnan

  S_to_Q(S, Q)

    Given \(S\) a point on `self` over an extension field, compute the Coleman integrals \(\{\int_S^Q x^i dx/2y \}_{i=0}^{2g-1}\).

    one should be able to feed `S,Q` into coleman_integral, but currently that segfaults

    INPUT:

    - `S` – a point with coordinates in an extension of \(\QQ_p\) (with unif. a)

    - `Q` – a non-Weierstrass point defined over \(\QQ_p\)

    OUTPUT:

    The Coleman integrals \(\{\int_S^Q x^i dx/2y \}_{i=0}^{2g-1}\) in terms of \(a\).

    EXAMPLES:

    Sage

        sage: K = Qp(5,6)
        sage: E = EllipticCurve(K, [-10,9])
        sage: J.<a> = K.extension(x^20-5)
        sage: EJ  = E.change_ring(J)
        sage: w = E.invariant_differential()
        sage: x,y = E.monsky_washnitzer_gens()
        sage: P = E(1,0)
        sage: Q = E(0,3)
        sage: S = E.get_boundary_point(EJ,P)
        sage: P_to_S = E.P_to_S(P,S)
        sage: S_to_Q = EJ.S_to_Q(S,Q)
        sage: P_to_S + S_to_Q
        (2*a^40 + a^80 + a^100 + O(a^105), a^20 + 2*a^40 + 4*a^60 + 2*a^80 + O(a^103))
        sage: E.coleman_integrals_on_basis(P,Q)
        (2*5^2 + 5^4 + 5^5 + 3*5^6 + O(5^7), 5 + 2*5^2 + 4*5^3 + 2*5^4 + 5^6 + O(5^7))

    Python

        >>> from sage.all import *
        >>> K = Qp(Integer(5),Integer(6))
        >>> E = EllipticCurve(K, [-Integer(10),Integer(9)])
        >>> J = K.extension(x**Integer(20)-Integer(5), names=('a',)); (a,) = J._first_ngens(1)
        >>> EJ  = E.change_ring(J)
        >>> w = E.invariant_differential()
        >>> x,y = E.monsky_washnitzer_gens()
        >>> P = E(Integer(1),Integer(0))
        >>> Q = E(Integer(0),Integer(3))
        >>> S = E.get_boundary_point(EJ,P)
        >>> P_to_S = E.P_to_S(P,S)
        >>> S_to_Q = EJ.S_to_Q(S,Q)
        >>> P_to_S + S_to_Q
        (2*a^40 + a^80 + a^100 + O(a^105), a^20 + 2*a^40 + 4*a^60 + 2*a^80 + O(a^103))
        >>> E.coleman_integrals_on_basis(P,Q)
        (2*5^2 + 5^4 + 5^5 + 3*5^6 + O(5^7), 5 + 2*5^2 + 4*5^3 + 2*5^4 + 5^6 + O(5^7))

    AUTHOR:

    - Jennifer Balakrishnan

  coleman_integral(w, P, Q, algorithm='None')

    Return the Coleman integral \(\int_P^Q w\).

    INPUT:

    - `w` – differential (if one of P,Q is Weierstrass, w must be odd)

    - `P` – point on `self`

    - `Q` – point on `self`

    - `algorithm` – `None` (default, uses Frobenius) or teichmuller (uses Teichmuller points)

    OUTPUT: the Coleman integral \(\int_P^Q w\)

    EXAMPLES:

    A simple example, integrating dx:

    Sage

        sage: K = Qp(5,10)
        sage: E = EllipticCurve(K, [-4,4])
        sage: P = E(2, 2)
        sage: Q = E.teichmuller(P)
        sage: x, y = E.monsky_washnitzer_gens()
        sage: E.coleman_integral(x.diff(), P, Q)
        5 + 2*5^2 + 5^3 + 3*5^4 + 4*5^5 + 2*5^6 + 3*5^7 + 3*5^9 + O(5^10)
        sage: Q[0] - P[0]
        5 + 2*5^2 + 5^3 + 3*5^4 + 4*5^5 + 2*5^6 + 3*5^7 + 3*5^9 + O(5^10)

    Python

        >>> from sage.all import *
        >>> K = Qp(Integer(5),Integer(10))
        >>> E = EllipticCurve(K, [-Integer(4),Integer(4)])
        >>> P = E(Integer(2), Integer(2))
        >>> Q = E.teichmuller(P)
        >>> x, y = E.monsky_washnitzer_gens()
        >>> E.coleman_integral(x.diff(), P, Q)
        5 + 2*5^2 + 5^3 + 3*5^4 + 4*5^5 + 2*5^6 + 3*5^7 + 3*5^9 + O(5^10)
        >>> Q[Integer(0)] - P[Integer(0)]
        5 + 2*5^2 + 5^3 + 3*5^4 + 4*5^5 + 2*5^6 + 3*5^7 + 3*5^9 + O(5^10)

    Another example:

    Sage

        sage: K = Qp(7,10)
        sage: E = EllipticCurve(K, [0,8,0,-9,0])
        sage: _, forms = monsky_washnitzer.matrix_of_frobenius_hyperelliptic(E)
        sage: w = E.invariant_differential()
        sage: x,y = E.monsky_washnitzer_gens()
        sage: f = forms[0]
        sage: S = E(9,36)
        sage: Q = E.teichmuller(S)
        sage: P = E(-1,4)
        sage: b = x*w*w._coeff.parent()(f)
        sage: E.coleman_integral(b,P,Q)
        7 + 7^2 + 4*7^3 + 5*7^4 + 3*7^5 + 7^6 + 5*7^7 + 3*7^8 + 4*7^9 + 4*7^10 + O(7^11)

    [Python]

        >>> from sage.all import *
        >>> K = Qp(Integer(7),Integer(10))
        >>> E = EllipticCurve(K, [Integer(0),Integer(8),Integer(0),-Integer(9),Integer(0)])
        >>> _, forms = monsky_washnitzer.matrix_of_frobenius_hyperelliptic(E)
        >>> w = E.invariant_differential()
        >>> x,y = E.monsky_washnitzer_gens()
        >>> f = forms[Integer(0)]
        >>> S = E(Integer(9),Integer(36))
        >>> Q = E.teichmuller(S)
        >>> P = E(-Integer(1),Integer(4))
        >>> b = x*w*w._coeff.parent()(f)
        >>> E.coleman_integral(b,P,Q)
        7 + 7^2 + 4*7^3 + 5*7^4 + 3*7^5 + 7^6 + 5*7^7 + 3*7^8 + 4*7^9 + 4*7^10 + O(7^11)

    Sage

        sage: K = Qp(5,8)
        sage: E = EllipticCurve(K, [0,1])
        sage: w = E.invariant_differential()
        sage: P = E(0,1)
        sage: Q = E(5, 1 + 3*5^3 + 2*5^4 + 2*5^5 + 3*5^7)
        sage: x,y = E.monsky_washnitzer_gens()
        sage: (2*y*w).coleman_integral(P,Q)
        5 + O(5^9)
        sage: xloc,yloc,zloc = E.local_analytic_interpolation(P,Q)
        sage: I2 = (xloc.derivative()/(2*yloc)).integral()
        sage: I2.polynomial()(1) - I2(0)
        3*5 + 2*5^2 + 2*5^3 + 5^4 + 4*5^6 + 5^7 + O(5^9)
        sage: E.coleman_integral(w,P,Q)
        3*5 + 2*5^2 + 2*5^3 + 5^4 + 4*5^6 + 5^7 + O(5^9)

    Python

        >>> from sage.all import *
        >>> K = Qp(Integer(5),Integer(8))
        >>> E = EllipticCurve(K, [Integer(0),Integer(1)])
        >>> w = E.invariant_differential()
        >>> P = E(Integer(0),Integer(1))
        >>> Q = E(Integer(5), Integer(1) + Integer(3)*Integer(5)**Integer(3) + Integer(2)*Integer(5)**Integer(4) + Integer(2)*Integer(5)**Integer(5) + Integer(3)*Integer(5)**Integer(7))
        >>> x,y = E.monsky_washnitzer_gens()
        >>> (Integer(2)*y*w).coleman_integral(P,Q)
        5 + O(5^9)
        >>> xloc,yloc,zloc = E.local_analytic_interpolation(P,Q)
        >>> I2 = (xloc.derivative()/(Integer(2)*yloc)).integral()
        >>> I2.polynomial()(Integer(1)) - I2(Integer(0))
        3*5 + 2*5^2 + 2*5^3 + 5^4 + 4*5^6 + 5^7 + O(5^9)
        >>> E.coleman_integral(w,P,Q)
        3*5 + 2*5^2 + 2*5^3 + 5^4 + 4*5^6 + 5^7 + O(5^9)

    Integrals involving Weierstrass points:

    Sage

        sage: K = Qp(5,8)
        sage: E = EllipticCurve(K, [-10,9])
        sage: S = E(1,0)
        sage: P = E(0,3)
        sage: negP = E(0,-3)
        sage: T = E(0,1,0)
        sage: w = E.invariant_differential()
        sage: x,y = E.monsky_washnitzer_gens()
        sage: E.coleman_integral(w*x^3,S,T)
        0
        sage: E.coleman_integral(w*x^3,T,S)
        0
        sage: E.coleman_integral(w,S,P)
        2*5^2 + 5^4 + 5^5 + 3*5^6 + 3*5^7 + 2*5^8 + O(5^9)
        sage: E.coleman_integral(w,T,P)
        2*5^2 + 5^4 + 5^5 + 3*5^6 + 3*5^7 + 2*5^8 + O(5^9)
        sage: E.coleman_integral(w*x^3,T,P)
        5^2 + 2*5^3 + 3*5^6 + 3*5^7 + O(5^8)
        sage: E.coleman_integral(w*x^3,S,P)
        5^2 + 2*5^3 + 3*5^6 + 3*5^7 + O(5^8)
        sage: E.coleman_integral(w, P, negP, algorithm='teichmuller')
        5^2 + 4*5^3 + 2*5^4 + 2*5^5 + 3*5^6 + 2*5^7 + 4*5^8 + O(5^9)
        sage: E.coleman_integral(w, P, negP)
        5^2 + 4*5^3 + 2*5^4 + 2*5^5 + 3*5^6 + 2*5^7 + 4*5^8 + O(5^9)

    [Python]

        >>> from sage.all import *
        >>> K = Qp(Integer(5),Integer(8))
        >>> E = EllipticCurve(K, [-Integer(10),Integer(9)])
        >>> S = E(Integer(1),Integer(0))
        >>> P = E(Integer(0),Integer(3))
        >>> negP = E(Integer(0),-Integer(3))
        >>> T = E(Integer(0),Integer(1),Integer(0))
        >>> w = E.invariant_differential()
        >>> x,y = E.monsky_washnitzer_gens()
        >>> E.coleman_integral(w*x**Integer(3),S,T)
        0
        >>> E.coleman_integral(w*x**Integer(3),T,S)
        0
        >>> E.coleman_integral(w,S,P)
        2*5^2 + 5^4 + 5^5 + 3*5^6 + 3*5^7 + 2*5^8 + O(5^9)
        >>> E.coleman_integral(w,T,P)
        2*5^2 + 5^4 + 5^5 + 3*5^6 + 3*5^7 + 2*5^8 + O(5^9)
        >>> E.coleman_integral(w*x**Integer(3),T,P)
        5^2 + 2*5^3 + 3*5^6 + 3*5^7 + O(5^8)
        >>> E.coleman_integral(w*x**Integer(3),S,P)
        5^2 + 2*5^3 + 3*5^6 + 3*5^7 + O(5^8)
        >>> E.coleman_integral(w, P, negP, algorithm='teichmuller')
        5^2 + 4*5^3 + 2*5^4 + 2*5^5 + 3*5^6 + 2*5^7 + 4*5^8 + O(5^9)
        >>> E.coleman_integral(w, P, negP)
        5^2 + 4*5^3 + 2*5^4 + 2*5^5 + 3*5^6 + 2*5^7 + 4*5^8 + O(5^9)

    AUTHORS:

    - Robert Bradshaw (2007-03)

    - Kiran Kedlaya (2008-05)

    - Jennifer Balakrishnan (2010-02)

  coleman_integral_P_to_S(w, P, S)

    Given a finite Weierstrass point \(P\) and a point \(S\) in the same disc, compute the Coleman integral \(\int_P^S w\).

    INPUT:

    - `w` – differential

    - `P` – Weierstrass point

    - `S` – point in the same disc of \(P\) (S is defined over an extension of \(\QQ_p\); coordinates of S are given in terms of uniformizer \(a\))

    OUTPUT: Coleman integral \(\int_P^S w\) in terms of \(a\)

    EXAMPLES:

    Sage

        sage: K = Qp(5,4)
        sage: E = EllipticCurve(K, [-10,9])
        sage: P = E(1,0)
        sage: J.<a> = K.extension(x^10-5)
        sage: EJ  = E.change_ring(J)
        sage: S = E.get_boundary_point(EJ,P)
        sage: x,y = E.monsky_washnitzer_gens()
        sage: S[0]-P[0] == E.coleman_integral_P_to_S(x.diff(),P,S)
        True
        sage: E.coleman_integral_P_to_S(E.invariant_differential(),P,S) == E.P_to_S(P,S)[0]
        True

    Python

        >>> from sage.all import *
        >>> K = Qp(Integer(5),Integer(4))
        >>> E = EllipticCurve(K, [-Integer(10),Integer(9)])
        >>> P = E(Integer(1),Integer(0))
        >>> J = K.extension(x**Integer(10)-Integer(5), names=('a',)); (a,) = J._first_ngens(1)
        >>> EJ  = E.change_ring(J)
        >>> S = E.get_boundary_point(EJ,P)
        >>> x,y = E.monsky_washnitzer_gens()
        >>> S[Integer(0)]-P[Integer(0)] == E.coleman_integral_P_to_S(x.diff(),P,S)
        True
        >>> E.coleman_integral_P_to_S(E.invariant_differential(),P,S) == E.P_to_S(P,S)[Integer(0)]
        True

    AUTHOR:

    - Jennifer Balakrishnan

  coleman_integral_S_to_Q(w, S, Q)

    Compute the Coleman integral \(\int_S^Q w\).

    one should be able to feed `S,Q` into coleman_integral, but currently that segfaults

    INPUT:

    - `w` – a differential

    - `S` – a point with coordinates in an extension of \(\QQ_p\)

    - `Q` – a non-Weierstrass point defined over \(\QQ_p\)

    OUTPUT: the Coleman integral \(\int_S^Q w\)

    EXAMPLES:

    Sage

        sage: K = Qp(5,6)
        sage: E = EllipticCurve(K, [-10,9])
        sage: J.<a> = K.extension(x^20-5)
        sage: EJ = E.change_ring(J)
        sage: x,y = E.monsky_washnitzer_gens()
        sage: P = E(1,0)
        sage: Q = E(0,3)
        sage: S = E.get_boundary_point(EJ,P)
        sage: P_to_S = E.coleman_integral_P_to_S(y.diff(),P,S)
        sage: S_to_Q = EJ.coleman_integral_S_to_Q(y.diff(),S,Q)
        sage: P_to_S + S_to_Q
        3 + O(a^119)
        sage: E.coleman_integral(y.diff(),P,Q)
        3 + O(5^6)

    Python

        >>> from sage.all import *
        >>> K = Qp(Integer(5),Integer(6))
        >>> E = EllipticCurve(K, [-Integer(10),Integer(9)])
        >>> J = K.extension(x**Integer(20)-Integer(5), names=('a',)); (a,) = J._first_ngens(1)
        >>> EJ = E.change_ring(J)
        >>> x,y = E.monsky_washnitzer_gens()
        >>> P = E(Integer(1),Integer(0))
        >>> Q = E(Integer(0),Integer(3))
        >>> S = E.get_boundary_point(EJ,P)
        >>> P_to_S = E.coleman_integral_P_to_S(y.diff(),P,S)
        >>> S_to_Q = EJ.coleman_integral_S_to_Q(y.diff(),S,Q)
        >>> P_to_S + S_to_Q
        3 + O(a^119)
        >>> E.coleman_integral(y.diff(),P,Q)
        3 + O(5^6)

    AUTHOR:

    - Jennifer Balakrishnan

  coleman_integral_from_weierstrass_via_boundary(w, P, Q, d)

    Compute the Coleman integral \(\int_P^Q w\) via a boundary point in the disc of \(P\), defined over a degree \(d\) extension

    INPUT:

    - `w` – a differential

    - `P` – a Weierstrass point

    - `Q` – a non-Weierstrass point

    - `d` – degree of extension where coordinates of boundary point lie

    OUTPUT:

    the Coleman integral \(\int_P^Q w\), written in terms of the uniformizer \(a\) of the degree \(d\) extension

    EXAMPLES:

    Sage

        sage: K = Qp(5,6)
        sage: E = EllipticCurve(K, [-10,9])
        sage: P = E(1,0)
        sage: Q = E(0,3)
        sage: x,y = E.monsky_washnitzer_gens()
        sage: E.coleman_integral_from_weierstrass_via_boundary(y.diff(),P,Q,20)
        3 + O(a^119)
        sage: E.coleman_integral(y.diff(),P,Q)
        3 + O(5^6)
        sage: w = E.invariant_differential()
        sage: E.coleman_integral_from_weierstrass_via_boundary(w,P,Q,20)
        2*a^40 + a^80 + a^100 + O(a^105)
        sage: E.coleman_integral(w,P,Q)
        2*5^2 + 5^4 + 5^5 + 3*5^6 + O(5^7)

    Python

        >>> from sage.all import *
        >>> K = Qp(Integer(5),Integer(6))
        >>> E = EllipticCurve(K, [-Integer(10),Integer(9)])
        >>> P = E(Integer(1),Integer(0))
        >>> Q = E(Integer(0),Integer(3))
        >>> x,y = E.monsky_washnitzer_gens()
        >>> E.coleman_integral_from_weierstrass_via_boundary(y.diff(),P,Q,Integer(20))
        3 + O(a^119)
        >>> E.coleman_integral(y.diff(),P,Q)
        3 + O(5^6)
        >>> w = E.invariant_differential()
        >>> E.coleman_integral_from_weierstrass_via_boundary(w,P,Q,Integer(20))
        2*a^40 + a^80 + a^100 + O(a^105)
        >>> E.coleman_integral(w,P,Q)
        2*5^2 + 5^4 + 5^5 + 3*5^6 + O(5^7)

    AUTHOR:

    - Jennifer Balakrishnan

  coleman_integrals_on_basis(P, Q, algorithm=None)

    Compute the Coleman integrals \(\{\int_P^Q x^i dx/2y \}_{i=0}^{2g-1}\).

    INPUT:

    - `P` – point on `self`

    - `Q` – point on `self`

    - `algorithm` – `None` (default, uses Frobenius) or teichmuller (uses Teichmuller points)

    OUTPUT: the Coleman integrals \(\{\int_P^Q x^i dx/2y \}_{i=0}^{2g-1}\)

    EXAMPLES:

    Sage

        sage: K = Qp(5,8)
        sage: E = EllipticCurve(K, [-10,9])
        sage: S = E(1,0)
        sage: P = E(0,3)
        sage: T = E(0,1,0)
        sage: Q = E.lift_x(5^-2)
        sage: R = E.lift_x(4*5^-2)
        sage: E.coleman_integrals_on_basis(S,P)
        (2*5^2 + 5^4 + 5^5 + 3*5^6 + 3*5^7 + 2*5^8 + O(5^9), 5 + 2*5^2 + 4*5^3 + 2*5^4 + 3*5^6 + 4*5^7 + 2*5^8 + O(5^9))
        sage: E.coleman_integrals_on_basis(T,P)
        (2*5^2 + 5^4 + 5^5 + 3*5^6 + 3*5^7 + 2*5^8 + O(5^9), 5 + 2*5^2 + 4*5^3 + 2*5^4 + 3*5^6 + 4*5^7 + 2*5^8 + O(5^9))
        sage: E.coleman_integrals_on_basis(P,S) == -E.coleman_integrals_on_basis(S,P)
        True
        sage: E.coleman_integrals_on_basis(S,Q)
        (5 + O(5^4), 4*5^-1 + 4 + 4*5 + 4*5^2 + O(5^3))
        sage: E.coleman_integrals_on_basis(Q,R)
        (5 + 2*5^2 + 2*5^3 + 2*5^4 + 3*5^5 + 3*5^6 + 3*5^7 + 5^8 + O(5^9), 3*5^-1 + 2*5^4 + 5^5 + 2*5^6 + O(5^7))
        sage: E.coleman_integrals_on_basis(S,R) == E.coleman_integrals_on_basis(S,Q) + E.coleman_integrals_on_basis(Q,R)
        True
        sage: E.coleman_integrals_on_basis(T,T)
        (0, 0)
        sage: E.coleman_integrals_on_basis(S,T)
        (0, 0)

    Python

        >>> from sage.all import *
        >>> K = Qp(Integer(5),Integer(8))
        >>> E = EllipticCurve(K, [-Integer(10),Integer(9)])
        >>> S = E(Integer(1),Integer(0))
        >>> P = E(Integer(0),Integer(3))
        >>> T = E(Integer(0),Integer(1),Integer(0))
        >>> Q = E.lift_x(Integer(5)**-Integer(2))
        >>> R = E.lift_x(Integer(4)*Integer(5)**-Integer(2))
        >>> E.coleman_integrals_on_basis(S,P)
        (2*5^2 + 5^4 + 5^5 + 3*5^6 + 3*5^7 + 2*5^8 + O(5^9), 5 + 2*5^2 + 4*5^3 + 2*5^4 + 3*5^6 + 4*5^7 + 2*5^8 + O(5^9))
        >>> E.coleman_integrals_on_basis(T,P)
        (2*5^2 + 5^4 + 5^5 + 3*5^6 + 3*5^7 + 2*5^8 + O(5^9), 5 + 2*5^2 + 4*5^3 + 2*5^4 + 3*5^6 + 4*5^7 + 2*5^8 + O(5^9))
        >>> E.coleman_integrals_on_basis(P,S) == -E.coleman_integrals_on_basis(S,P)
        True
        >>> E.coleman_integrals_on_basis(S,Q)
        (5 + O(5^4), 4*5^-1 + 4 + 4*5 + 4*5^2 + O(5^3))
        >>> E.coleman_integrals_on_basis(Q,R)
        (5 + 2*5^2 + 2*5^3 + 2*5^4 + 3*5^5 + 3*5^6 + 3*5^7 + 5^8 + O(5^9), 3*5^-1 + 2*5^4 + 5^5 + 2*5^6 + O(5^7))
        >>> E.coleman_integrals_on_basis(S,R) == E.coleman_integrals_on_basis(S,Q) + E.coleman_integrals_on_basis(Q,R)
        True
        >>> E.coleman_integrals_on_basis(T,T)
        (0, 0)
        >>> E.coleman_integrals_on_basis(S,T)
        (0, 0)

    AUTHORS:

    - Robert Bradshaw (2007-03): non-Weierstrass points

    - Jennifer Balakrishnan and Robert Bradshaw (2010-02): Weierstrass points

  curve_over_ram_extn(deg)

    Return `self` over \(\QQ_p(p^(1/deg))\).

    INPUT:

    - `deg` – the degree of the ramified extension

    OUTPUT: `self` over \(\QQ_p(p^(1/deg))\)

    EXAMPLES:

    Sage

        sage: K = Qp(5,8)
        sage: E = EllipticCurve(K, [0,1])
        sage: E.curve_over_ram_extn(2)
        Elliptic Curve defined by y^2 = x^3 + (1+O(a^16)) over 5-adic Eisenstein Extension Field in a defined by x^2 - 5

    Python

        >>> from sage.all import *
        >>> K = Qp(Integer(5),Integer(8))
        >>> E = EllipticCurve(K, [Integer(0),Integer(1)])
        >>> E.curve_over_ram_extn(Integer(2))
        Elliptic Curve defined by y^2 = x^3 + (1+O(a^16)) over 5-adic Eisenstein Extension Field in a defined by x^2 - 5

    AUTHOR:

    - Jennifer Balakrishnan

  find_char_zero_weier_point(Q)

    Given \(Q\) a point on `self` in a Weierstrass disc, finds the center of the Weierstrass disc (if defined over `self.base_ring()`).

    EXAMPLES:

    Sage

        sage: K = Qp(5,8)
        sage: E = EllipticCurve(K, [-10,9])
        sage: Q = E([0,1,0])
        sage: E.find_char_zero_weier_point(Q) == Q
        True

        sage: S = E([1,0])
        sage: T = E.lift_x(1+3*5^2)
        sage: E.find_char_zero_weier_point(T) == S
        True

        sage: P = E([0,3])
        sage: E.find_char_zero_weier_point(P)
        Traceback (most recent call last):
        ...
        ValueError: (0 : 3 + O(5^8) : 1 + O(5^8)) is not in a Weierstrass disc

    Python

        >>> from sage.all import *
        >>> K = Qp(Integer(5),Integer(8))
        >>> E = EllipticCurve(K, [-Integer(10),Integer(9)])
        >>> Q = E([Integer(0),Integer(1),Integer(0)])
        >>> E.find_char_zero_weier_point(Q) == Q
        True

        >>> S = E([Integer(1),Integer(0)])
        >>> T = E.lift_x(Integer(1)+Integer(3)*Integer(5)**Integer(2))
        >>> E.find_char_zero_weier_point(T) == S
        True

        >>> P = E([Integer(0),Integer(3)])
        >>> E.find_char_zero_weier_point(P)
        Traceback (most recent call last):
        ...
        ValueError: (0 : 3 + O(5^8) : 1 + O(5^8)) is not in a Weierstrass disc

    AUTHOR:

    - Jennifer Balakrishnan

  frobenius(P=None)

    Return the Frobenius as a function on the group of points of this elliptic curve.

    EXAMPLES:

    Sage

        sage: Qp = pAdicField(13)
        sage: E = EllipticCurve(Qp,[1,1])
        sage: type(E.frobenius())
        <... 'function'>
        sage: point = E(0,1)
        sage: E.frobenius(point)
        (0 : 1 + O(13^20) : 1 + O(13^20))

    Python

        >>> from sage.all import *
        >>> Qp = pAdicField(Integer(13))
        >>> E = EllipticCurve(Qp,[Integer(1),Integer(1)])
        >>> type(E.frobenius())
        <... 'function'>
        >>> point = E(Integer(0),Integer(1))
        >>> E.frobenius(point)
        (0 : 1 + O(13^20) : 1 + O(13^20))

    Check that Issue #29709 is fixed:

    Sage

        sage: Qp = pAdicField(13)
        sage: E = EllipticCurve(Qp,[0,0,1,0,1])
        sage: E.frobenius(E(1,1))
        Traceback (most recent call last):
        ...
        NotImplementedError: Curve must be in weierstrass normal form.
        sage: E = EllipticCurve(Qp,[0,1,0,0,1])
        sage: E.frobenius(E(0,1))
        (0 : 1 + O(13^20) : 1 + O(13^20))

    [Python]

        >>> from sage.all import *
        >>> Qp = pAdicField(Integer(13))
        >>> E = EllipticCurve(Qp,[Integer(0),Integer(0),Integer(1),Integer(0),Integer(1)])
        >>> E.frobenius(E(Integer(1),Integer(1)))
        Traceback (most recent call last):
        ...
        NotImplementedError: Curve must be in weierstrass normal form.
        >>> E = EllipticCurve(Qp,[Integer(0),Integer(1),Integer(0),Integer(0),Integer(1)])
        >>> E.frobenius(E(Integer(0),Integer(1)))
        (0 : 1 + O(13^20) : 1 + O(13^20))

  get_boundary_point(curve_over_extn, P)

    Given `self` over an extension field, find a point in the disc of \(P\) near the boundary.

    INPUT:

    - `curve_over_extn` – `self` over a totally ramified extension

    - `P` – Weierstrass point

    OUTPUT: a point in the disc of \(P\) near the boundary

    EXAMPLES:

    Sage

        sage: K = Qp(3,6)
        sage: E = EllipticCurve(K,[-10,9])
        sage: P = E(1,0)
        sage: J.<a> = K.extension(x^30-3)
        sage: EJ  = E.change_ring(J)
        sage: S = E.get_boundary_point(EJ,P)
        sage: S
        (1 + 2*a^2 + 2*a^6 + 2*a^18 + a^32 + a^34 + a^36 + 2*a^38 + 2*a^40 + a^42 + 2*a^44 + a^48 + 2*a^50 + 2*a^52 + a^54 + a^56 + 2*a^60 + 2*a^62 + a^70 + 2*a^72 + a^76 + 2*a^78 + a^82 + a^88 + a^96 + 2*a^98 + 2*a^102 + a^104 + 2*a^106 + a^108 + 2*a^110 + a^112 + 2*a^116 + a^126 + 2*a^130 + 2*a^132 + a^144 + 2*a^148 + 2*a^150 + a^152 + 2*a^154 + a^162 + a^164 + a^166 + a^168 + a^170 + a^176 + a^178 + O(a^180) : a + O(a^180) : 1 + O(a^180))

    Python

        >>> from sage.all import *
        >>> K = Qp(Integer(3),Integer(6))
        >>> E = EllipticCurve(K,[-Integer(10),Integer(9)])
        >>> P = E(Integer(1),Integer(0))
        >>> J = K.extension(x**Integer(30)-Integer(3), names=('a',)); (a,) = J._first_ngens(1)
        >>> EJ  = E.change_ring(J)
        >>> S = E.get_boundary_point(EJ,P)
        >>> S
        (1 + 2*a^2 + 2*a^6 + 2*a^18 + a^32 + a^34 + a^36 + 2*a^38 + 2*a^40 + a^42 + 2*a^44 + a^48 + 2*a^50 + 2*a^52 + a^54 + a^56 + 2*a^60 + 2*a^62 + a^70 + 2*a^72 + a^76 + 2*a^78 + a^82 + a^88 + a^96 + 2*a^98 + 2*a^102 + a^104 + 2*a^106 + a^108 + 2*a^110 + a^112 + 2*a^116 + a^126 + 2*a^130 + 2*a^132 + a^144 + 2*a^148 + 2*a^150 + a^152 + 2*a^154 + a^162 + a^164 + a^166 + a^168 + a^170 + a^176 + a^178 + O(a^180) : a + O(a^180) : 1 + O(a^180))

    AUTHOR:

    - Jennifer Balakrishnan

  invariant_differential()

    Return \(dx/2y\), as an element of the Monsky-Washnitzer cohomology of `self`.

    EXAMPLES:

    Sage

        sage: Q5 = pAdicField(5,10)
        sage: E = EllipticCurve(Q5,[0,1])
        sage: w = E.invariant_differential(); w
        (-((4+4*5+4*5^2+4*5^3+4*5^4+4*5^5+4*5^6+4*5^7+4*5^8+4*5^9+O(5^10)))*1) dx/2y
        sage: x,y = E.monsky_washnitzer_gens()
        sage: x.diff() == 2*y*w
        True

    Python

        >>> from sage.all import *
        >>> Q5 = pAdicField(Integer(5),Integer(10))
        >>> E = EllipticCurve(Q5,[Integer(0),Integer(1)])
        >>> w = E.invariant_differential(); w
        (-((4+4*5+4*5^2+4*5^3+4*5^4+4*5^5+4*5^6+4*5^7+4*5^8+4*5^9+O(5^10)))*1) dx/2y
        >>> x,y = E.monsky_washnitzer_gens()
        >>> x.diff() == Integer(2)*y*w
        True

  is_in_weierstrass_disc(P)

    Check if \(P\) is in a Weierstrass disc.

    EXAMPLES:

    Sage

        sage: K = Qp(5,8)
        sage: E = EllipticCurve(K, [-10,9])
        sage: P = E([0,3])
        sage: E.is_in_weierstrass_disc(P)
        False
        sage: Q = E([0,1,0])
        sage: E.is_in_weierstrass_disc(Q)
        True
        sage: S = E([1,0])
        sage: E.is_in_weierstrass_disc(S)
        True
        sage: T = E.lift_x(1+3*5^2); T
        (1 + 3*5^2 + O(5^8) : 3*5 + 4*5^2 + 5^4 + 3*5^5 + 5^6 + O(5^7) : 1 + O(5^8))
        sage: E.is_in_weierstrass_disc(T)
        True

    Python

        >>> from sage.all import *
        >>> K = Qp(Integer(5),Integer(8))
        >>> E = EllipticCurve(K, [-Integer(10),Integer(9)])
        >>> P = E([Integer(0),Integer(3)])
        >>> E.is_in_weierstrass_disc(P)
        False
        >>> Q = E([Integer(0),Integer(1),Integer(0)])
        >>> E.is_in_weierstrass_disc(Q)
        True
        >>> S = E([Integer(1),Integer(0)])
        >>> E.is_in_weierstrass_disc(S)
        True
        >>> T = E.lift_x(Integer(1)+Integer(3)*Integer(5)**Integer(2)); T
        (1 + 3*5^2 + O(5^8) : 3*5 + 4*5^2 + 5^4 + 3*5^5 + 5^6 + O(5^7) : 1 + O(5^8))
        >>> E.is_in_weierstrass_disc(T)
        True

    AUTHOR:

    - Jennifer Balakrishnan (2010-02)

  is_same_disc(P, Q)

    Check if \(P,Q\) are in the same residue disc.

    EXAMPLES:

    Sage

        sage: Q7 = pAdicField(7,6)
        sage: E = EllipticCurve(Q7,[-16,400])
        sage: P = E.lift_x(4)
        sage: Q = E.lift_x(8)
        sage: R = E.lift_x(11)
        sage: E.is_same_disc(P,Q) or E.is_same_disc(P,-Q)
        False
        sage: E.is_same_disc(P,R) or E.is_same_disc(P,-R)
        True

    Python

        >>> from sage.all import *
        >>> Q7 = pAdicField(Integer(7),Integer(6))
        >>> E = EllipticCurve(Q7,[-Integer(16),Integer(400)])
        >>> P = E.lift_x(Integer(4))
        >>> Q = E.lift_x(Integer(8))
        >>> R = E.lift_x(Integer(11))
        >>> E.is_same_disc(P,Q) or E.is_same_disc(P,-Q)
        False
        >>> E.is_same_disc(P,R) or E.is_same_disc(P,-R)
        True

  is_weierstrass(P)

    Check if \(P\) is a Weierstrass point (i.e., fixed by the hyperelliptic involution).

    EXAMPLES:

    Sage

        sage: K = Qp(5,8)
        sage: E = EllipticCurve(K, [-10,9])
        sage: P = E([0,3])
        sage: E.is_weierstrass(P)
        False
        sage: Q = E([0,1,0])
        sage: E.is_weierstrass(Q)
        True
        sage: S = E([1,0])
        sage: E.is_weierstrass(S)
        True
        sage: T = E.lift_x(1+3*5^2); T
        (1 + 3*5^2 + O(5^8) : 3*5 + 4*5^2 + 5^4 + 3*5^5 + 5^6 + O(5^7) : 1 + O(5^8))
        sage: E.is_weierstrass(T)
        False

    Python

        >>> from sage.all import *
        >>> K = Qp(Integer(5),Integer(8))
        >>> E = EllipticCurve(K, [-Integer(10),Integer(9)])
        >>> P = E([Integer(0),Integer(3)])
        >>> E.is_weierstrass(P)
        False
        >>> Q = E([Integer(0),Integer(1),Integer(0)])
        >>> E.is_weierstrass(Q)
        True
        >>> S = E([Integer(1),Integer(0)])
        >>> E.is_weierstrass(S)
        True
        >>> T = E.lift_x(Integer(1)+Integer(3)*Integer(5)**Integer(2)); T
        (1 + 3*5^2 + O(5^8) : 3*5 + 4*5^2 + 5^4 + 3*5^5 + 5^6 + O(5^7) : 1 + O(5^8))
        >>> E.is_weierstrass(T)
        False

    AUTHOR:

    - Jennifer Balakrishnan (2010-02)

  local_analytic_interpolation(P, Q)

    For points \(P\), \(Q\) in the same residue disc, this constructs an interpolation from \(P\) to \(Q\) (in homogeneous coordinates) in a power series in the local parameter \(t\), with precision equal to the \(p\)-adic precision of the underlying ring.

    INPUT:

    - `P`, `Q` – points on `self` in the same residue disc

    OUTPUT:

    Returns a point \(X(t) = ( x(t) : y(t) : z(t) )\) such that:

    1. \(X(0) = P\) and \(X(1) = Q\) if \(P, Q\) are not in the infinite disc

    2. \(X(P[0]/P[1]) = P\) and \(X(Q[0]/Q[1]) = Q\) if \(P, Q\) are in the infinite disc

    EXAMPLES:

    Sage

        sage: Q7 = pAdicField(7)
        sage: E = EllipticCurve(Q7,[1,1])
        sage: P = E.lift_x(2)
        sage: Q = E.lift_x(9)
        sage: X = E.local_analytic_interpolation(P,Q)
        sage: X[0](1) == Q[0]
        True
        sage: X[0](0) == P[0]
        True

    Python

        >>> from sage.all import *
        >>> Q7 = pAdicField(Integer(7))
        >>> E = EllipticCurve(Q7,[Integer(1),Integer(1)])
        >>> P = E.lift_x(Integer(2))
        >>> Q = E.lift_x(Integer(9))
        >>> X = E.local_analytic_interpolation(P,Q)
        >>> X[Integer(0)](Integer(1)) == Q[Integer(0)]
        True
        >>> X[Integer(0)](Integer(0)) == P[Integer(0)]
        True

    AUTHORS:

    - Robert Bradshaw (2007-03)

    - Jennifer Balakrishnan (2010-02)

  local_coord(P, prec=20, name='t')

    Return the local coordinates of the elliptic curve at \(P\).

    TODO: extend to general Weierstrass form, and move to ell_generic ?

    INPUT:

    - `P` – a point on `self`

    - `prec` – desired precision of the local coordinates

    - `name` – generator of the power series ring (default: `t`)

    OUTPUT:

    \((x(t),y(t))\) such that \(y(t)^2 = f(x(t))\), where \(t\) is the local parameter at \(P\)

    EXAMPLES:

    Sage

        sage: Qp = pAdicField(11)
        sage: E = EllipticCurve(Qp,[0,1,0,0,4])
        sage: f,_ = E.hyperelliptic_polynomials()
        sage: P1 = E([-2,0])
        sage: x1,y1 = E.local_coord(P1, prec=3)
        sage: y1^2 == f(x1)
        True
        sage: P2 = E([6,-16])
        sage: x2,y2 = E.local_coord(P2, prec=3)
        sage: y2^2 == f(x2)
        True
        sage: O = E.zero()
        sage: x3,y3 = E.local_coord(O, prec=3)
        sage: y3^2 == f(x3)
        True

    Python

        >>> from sage.all import *
        >>> Qp = pAdicField(Integer(11))
        >>> E = EllipticCurve(Qp,[Integer(0),Integer(1),Integer(0),Integer(0),Integer(4)])
        >>> f,_ = E.hyperelliptic_polynomials()
        >>> P1 = E([-Integer(2),Integer(0)])
        >>> x1,y1 = E.local_coord(P1, prec=Integer(3))
        >>> y1**Integer(2) == f(x1)
        True
        >>> P2 = E([Integer(6),-Integer(16)])
        >>> x2,y2 = E.local_coord(P2, prec=Integer(3))
        >>> y2**Integer(2) == f(x2)
        True
        >>> O = E.zero()
        >>> x3,y3 = E.local_coord(O, prec=Integer(3))
        >>> y3**Integer(2) == f(x3)
        True

    AUTHOR:

    - Jennifer Balakrishnan (2007-12)

  local_coordinates_at_infinity(prec=20, name='t')

    For the elliptic curve \(y^2 = f(x)\), return \((x(t), y(t))\) such that \((y(t))^2 = f(x(t))\), where \(t = x/y\) is the local parameter at infinity

    INPUT:

    - `prec` – desired precision of the local coordinates

    - `name` – generator of the power series ring (default: `t`)

    OUTPUT:

    \((x(t),y(t))\) such that \(y(t)^2 = f(x(t))\) and \(t = x/y\) is the local parameter at infinity

    EXAMPLES:

    Sage

        sage: Q5 = pAdicField(5)
        sage: E = EllipticCurve(Q5, [1,0])
        sage: xt,yt = E.local_coordinates_at_infinity(prec=5)
        sage: xt[-2]
        1 + O(5^20)
        sage: yt[-3]
        1 + O(5^20)

    Python

        >>> from sage.all import *
        >>> Q5 = pAdicField(Integer(5))
        >>> E = EllipticCurve(Q5, [Integer(1),Integer(0)])
        >>> xt,yt = E.local_coordinates_at_infinity(prec=Integer(5))
        >>> xt[-Integer(2)]
        1 + O(5^20)
        >>> yt[-Integer(3)]
        1 + O(5^20)

    AUTHOR:

    - Jennifer Balakrishnan (2007-12)

  local_coordinates_at_nonweierstrass(P, prec=20, name='t')

    For a non-Weierstrass point \(P = (a,b)\) on the elliptic curve \(y^2 = f(x)\), return \((x(t), y(t))\) such that \((y(t))^2 = f(x(t))\), where \(t = x - a\) is the local parameter.

    INPUT:

    - `P = (a, b)` – a non-Weierstrass point on `self`

    - `prec` – desired precision of the local coordinates

    - `name` – gen of the power series ring (default: `t`)

    OUTPUT:

    \((x(t),y(t))\) such that \(y(t)^2 = f(x(t))\) and \(t = x - a\) is the local parameter at \(P\)

    EXAMPLES:

    Sage

        sage: Qp = pAdicField(13)
        sage: E = EllipticCurve(Qp,[5,22])
        sage: P = E([-1,4])
        sage: xt,yt = E.local_coordinates_at_nonweierstrass(P, prec=5)
        sage: xt
        12 + 12*13 + 12*13^2 + 12*13^3 + 12*13^4 + 12*13^5 + 12*13^6 + 12*13^7 + 12*13^8 + 12*13^9 + 12*13^10 + 12*13^11 + 12*13^12 + 12*13^13 + 12*13^14 + 12*13^15 + 12*13^16 + 12*13^17 + 12*13^18 + 12*13^19 + O(13^20) + (1 + O(13^20))*t + O(t^5)
        sage: yt
        4 + O(13^20) + (1 + O(13^20))*t + (6 + 6*13 + 6*13^2 + 6*13^3 + 6*13^4 + 6*13^5 + 6*13^6 + 6*13^7 + 6*13^8 + 6*13^9 + 6*13^10 + 6*13^11 + 6*13^12 + 6*13^13 + 6*13^14 + 6*13^15 + 6*13^16 + 6*13^17 + 6*13^18 + 6*13^19 + O(13^20))*t^2 + (10 + 9*13 + 9*13^2 + 9*13^3 + 9*13^4 + 9*13^5 + 9*13^6 + 9*13^7 + 9*13^8 + 9*13^9 + 9*13^10 + 9*13^11 + 9*13^12 + 9*13^13 + 9*13^14 + 9*13^15 + 9*13^16 + 9*13^17 + 9*13^18 + 9*13^19 + O(13^20))*t^3 + (6 + 4*13 + 9*13^2 + 7*13^3 + 12*13^4 + 10*13^5 + 2*13^6 + 13^7 + 6*13^8 + 4*13^9 + 9*13^10 + 7*13^11 + 12*13^12 + 10*13^13 + 2*13^14 + 13^15 + 6*13^16 + 4*13^17 + 9*13^18 + 7*13^19 + O(13^20))*t^4 + O(t^5)

    Python

        >>> from sage.all import *
        >>> Qp = pAdicField(Integer(13))
        >>> E = EllipticCurve(Qp,[Integer(5),Integer(22)])
        >>> P = E([-Integer(1),Integer(4)])
        >>> xt,yt = E.local_coordinates_at_nonweierstrass(P, prec=Integer(5))
        >>> xt
        12 + 12*13 + 12*13^2 + 12*13^3 + 12*13^4 + 12*13^5 + 12*13^6 + 12*13^7 + 12*13^8 + 12*13^9 + 12*13^10 + 12*13^11 + 12*13^12 + 12*13^13 + 12*13^14 + 12*13^15 + 12*13^16 + 12*13^17 + 12*13^18 + 12*13^19 + O(13^20) + (1 + O(13^20))*t + O(t^5)
        >>> yt
        4 + O(13^20) + (1 + O(13^20))*t + (6 + 6*13 + 6*13^2 + 6*13^3 + 6*13^4 + 6*13^5 + 6*13^6 + 6*13^7 + 6*13^8 + 6*13^9 + 6*13^10 + 6*13^11 + 6*13^12 + 6*13^13 + 6*13^14 + 6*13^15 + 6*13^16 + 6*13^17 + 6*13^18 + 6*13^19 + O(13^20))*t^2 + (10 + 9*13 + 9*13^2 + 9*13^3 + 9*13^4 + 9*13^5 + 9*13^6 + 9*13^7 + 9*13^8 + 9*13^9 + 9*13^10 + 9*13^11 + 9*13^12 + 9*13^13 + 9*13^14 + 9*13^15 + 9*13^16 + 9*13^17 + 9*13^18 + 9*13^19 + O(13^20))*t^3 + (6 + 4*13 + 9*13^2 + 7*13^3 + 12*13^4 + 10*13^5 + 2*13^6 + 13^7 + 6*13^8 + 4*13^9 + 9*13^10 + 7*13^11 + 12*13^12 + 10*13^13 + 2*13^14 + 13^15 + 6*13^16 + 4*13^17 + 9*13^18 + 7*13^19 + O(13^20))*t^4 + O(t^5)

    AUTHOR:

    - Jennifer Balakrishnan (2007-12)

  local_coordinates_at_weierstrass(P, prec=20, name='t')

    For a finite Weierstrass point on the elliptic curve \(y^2 = f(x)\), return \((x(t), y(t))\) such that \((y(t))^2 = f(x(t))\), where \(t = y\) is the local parameter.

    INPUT:

    - `P` – a finite Weierstrass point on `self`

    - `prec` – desired precision of the local coordinates

    - `name` – gen of the power series ring (default: \(t\))

    OUTPUT:

    \((x(t),y(t))\) such that \(y(t)^2 = f(x(t))\) and \(t = y\) is the local parameter at \(P\)

    EXAMPLES:

    Sage

        sage: Q5 = pAdicField(5)
        sage: E = EllipticCurve(Q5, [1,0])
        sage: P = E([0,0])
        sage: xt,yt = E.local_coordinates_at_weierstrass(P, prec=5)
        sage: xt
        (1 + O(5^20))*t^2 + O(t^5)
        sage: yt
        (1 + O(5^20))*t + O(t^5)
        sage: O = E([0,1,0])
        sage: xt,yt = E.local_coordinates_at_weierstrass(O, prec=5)
        Traceback (most recent call last):
        ...
        ValueError:  P = (0 : 1 + O(5^20) : 0) is not a finite Weierstrass point. Use local_coordinates_at_nonweierstrass instead!

    Python

        >>> from sage.all import *
        >>> Q5 = pAdicField(Integer(5))
        >>> E = EllipticCurve(Q5, [Integer(1),Integer(0)])
        >>> P = E([Integer(0),Integer(0)])
        >>> xt,yt = E.local_coordinates_at_weierstrass(P, prec=Integer(5))
        >>> xt
        (1 + O(5^20))*t^2 + O(t^5)
        >>> yt
        (1 + O(5^20))*t + O(t^5)
        >>> O = E([Integer(0),Integer(1),Integer(0)])
        >>> xt,yt = E.local_coordinates_at_weierstrass(O, prec=Integer(5))
        Traceback (most recent call last):
        ...
        ValueError:  P = (0 : 1 + O(5^20) : 0) is not a finite Weierstrass point. Use local_coordinates_at_nonweierstrass instead!

    AUTHOR:

      - Jennifer Balakrishnan (2007-12)

      - Francis Clarke (2012-08-26)

  monsky_washnitzer_gens()

    Return the generators of the special hyperelliptic quotient ring.

    TODO: Should this function be moved to ell_generic and made available over more general base rings?

    EXAMPLES:

    Sage

        sage: Q5 = pAdicField(5,10)
        sage: E = EllipticCurve(Q5,[1,0])
        sage: x,y = E.monsky_washnitzer_gens()
        sage: x^3 + x == y^2
        True

    Python

        >>> from sage.all import *
        >>> Q5 = pAdicField(Integer(5),Integer(10))
        >>> E = EllipticCurve(Q5,[Integer(1),Integer(0)])
        >>> x,y = E.monsky_washnitzer_gens()
        >>> x**Integer(3) + x == y**Integer(2)
        True

  residue_disc(P)

    Return the residue disc of \(P\).

    EXAMPLES:

    Sage

        sage: K = Qp(5,8)
        sage: E = EllipticCurve(K, [-10,9])
        sage: P = E.lift_x(5); P
        (5 + O(5^9) : 2 + 4*5 + 5^2 + 2*5^3 + 5^4 + 2*5^5 + 2*5^6 + 5^7 + O(5^8) : 1 + O(5^8))
        sage: E.residue_disc(P)
        (0 : 2 : 1)
        sage: E.residue_disc(P) == P.change_ring(GF(5))
        True

    Python

        >>> from sage.all import *
        >>> K = Qp(Integer(5),Integer(8))
        >>> E = EllipticCurve(K, [-Integer(10),Integer(9)])
        >>> P = E.lift_x(Integer(5)); P
        (5 + O(5^9) : 2 + 4*5 + 5^2 + 2*5^3 + 5^4 + 2*5^5 + 2*5^6 + 5^7 + O(5^8) : 1 + O(5^8))
        >>> E.residue_disc(P)
        (0 : 2 : 1)
        >>> E.residue_disc(P) == P.change_ring(GF(Integer(5)))
        True

    Note that the residue disc can also be computed when the coordinates have negative valuation (in which case \(change_ring\) does not work):

    Sage

        sage: Q = E.lift_x(5^(-2))
        sage: E.residue_disc(Q)
        (0 : 1 : 0)
        sage: Q.change_ring(GF(5))
        Traceback (most recent call last):
        ...
        ValueError: element must have nonnegative valuation in order to compute residue

    [Python]

        >>> from sage.all import *
        >>> Q = E.lift_x(Integer(5)**(-Integer(2)))
        >>> E.residue_disc(Q)
        (0 : 1 : 0)
        >>> Q.change_ring(GF(Integer(5)))
        Traceback (most recent call last):
        ...
        ValueError: element must have nonnegative valuation in order to compute residue

    AUTHOR:

    - Jennifer Balakrishnan

  teichmuller(P)

    Find a Teichm:uller point in the same residue class of \(P\).

    Because this lift of frobenius acts as \(x \mapsto x^p\), take the Teichmuller lift of \(x\) and then find a matching \(y\) from that.

    EXAMPLES:

    Sage

        sage: K = pAdicField(7, 5)
        sage: E = EllipticCurve(K, [-31/3, -2501/108]) # 11a
        sage: P = E(K(14/3), K(11/2))
        sage: E.frobenius(P) == P
        False
        sage: TP = E.teichmuller(P); TP
        (0 : 2 + 3*7 + 3*7^2 + 3*7^4 + O(7^5) : 1 + O(7^5))
        sage: E.frobenius(TP) == TP
        True
        sage: (TP[0] - P[0]).valuation() > 0, (TP[1] - P[1]).valuation() > 0
        (True, True)

    Python

        >>> from sage.all import *
        >>> K = pAdicField(Integer(7), Integer(5))
        >>> E = EllipticCurve(K, [-Integer(31)/Integer(3), -Integer(2501)/Integer(108)]) # 11a
        >>> P = E(K(Integer(14)/Integer(3)), K(Integer(11)/Integer(2)))
        >>> E.frobenius(P) == P
        False
        >>> TP = E.teichmuller(P); TP
        (0 : 2 + 3*7 + 3*7^2 + 3*7^4 + O(7^5) : 1 + O(7^5))
        >>> E.frobenius(TP) == TP
        True
        >>> (TP[Integer(0)] - P[Integer(0)]).valuation() > Integer(0), (TP[Integer(1)] - P[Integer(1)]).valuation() > Integer(0)
        (True, True)

  tiny_integrals(F, P, Q)

    Evaluate the integrals of \(f_i dx/2y\) from \(P\) to \(Q\) for each \(f_i\) in \(F\) by formally integrating a power series in a local parameter \(t\)

    \(P\) and \(Q\) MUST be in the same residue disc for this result to make sense.

    INPUT:

    - `F` – list of functions \(f_i\)

    - `P` – point on `self`

    - `Q` – point on `self` (in the same residue disc as \(P\))

    OUTPUT: the integrals \(\int_P^Q f_i dx/2y\)

    EXAMPLES:

    Sage

        sage: K = pAdicField(17, 5)
        sage: E = EllipticCurve(K, [-31/3, -2501/108]) # 11a
        sage: P = E(K(14/3), K(11/2))
        sage: TP = E.teichmuller(P);
        sage: x,y = E.monsky_washnitzer_gens()
        sage: E.tiny_integrals([1,x], P, TP) == E.tiny_integrals_on_basis(P, TP)
        True

    Python

        >>> from sage.all import *
        >>> K = pAdicField(Integer(17), Integer(5))
        >>> E = EllipticCurve(K, [-Integer(31)/Integer(3), -Integer(2501)/Integer(108)]) # 11a
        >>> P = E(K(Integer(14)/Integer(3)), K(Integer(11)/Integer(2)))
        >>> TP = E.teichmuller(P);
        >>> x,y = E.monsky_washnitzer_gens()
        >>> E.tiny_integrals([Integer(1),x], P, TP) == E.tiny_integrals_on_basis(P, TP)
        True

  tiny_integrals_on_basis(P, Q)

    Evaluate the integrals \(\{\int_P^Q x^i dx/2y \}_{i=0}^{2g-1}\) by formally integrating a power series in a local parameter \(t\). \(P\) and \(Q\) MUST be in the same residue disc for this result to make sense.

    INPUT:

    - `P` – point on `self`

    - `Q` – point on `self` (in the same residue disc as \(P\))

    OUTPUT: the integrals \(\{\int_P^Q x^i dx/2y \}_{i=0}^{2g-1}\)

    EXAMPLES:

    Sage

        sage: K = pAdicField(17, 5)
        sage: E = EllipticCurve(K, [-31/3, -2501/108]) # 11a
        sage: P = E(K(14/3), K(11/2))
        sage: TP = E.teichmuller(P);
        sage: E.tiny_integrals_on_basis(P, TP)
        (17 + 14*17^2 + 17^3 + 8*17^4 + O(17^5), 16*17 + 5*17^2 + 8*17^3 + 14*17^4 + O(17^5))

    Python

        >>> from sage.all import *
        >>> K = pAdicField(Integer(17), Integer(5))
        >>> E = EllipticCurve(K, [-Integer(31)/Integer(3), -Integer(2501)/Integer(108)]) # 11a
        >>> P = E(K(Integer(14)/Integer(3)), K(Integer(11)/Integer(2)))
        >>> TP = E.teichmuller(P);
        >>> E.tiny_integrals_on_basis(P, TP)
        (17 + 14*17^2 + 17^3 + 8*17^4 + O(17^5), 16*17 + 5*17^2 + 8*17^3 + 14*17^4 + O(17^5))

  weierstrass_points()

    Return the Weierstrass points of `self` defined over `self.base_ring()`, that is, the point at infinity and those points in the support of the divisor of \(y\).

    EXAMPLES:

    Sage

        sage: Q5 = pAdicField(5,10)
        sage: E = EllipticCurve(Q5,[1,0])
        sage: E.weierstrass_points()
        [(0 : 1 + O(5^10) : 0),
         (2 + 5 + 2*5^2 + 5^3 + 3*5^4 + 4*5^5 + 2*5^6 + 3*5^7 + 3*5^9 + O(5^10) : 0 : 1 + O(5^10)),
         (3 + 3*5 + 2*5^2 + 3*5^3 + 5^4 + 2*5^6 + 5^7 + 4*5^8 + 5^9 + O(5^10) : 0 : 1 + O(5^10)),
         (O(5^10) : 0 : 1 + O(5^10))]

        sage: Q7 = pAdicField(7,10)
        sage: E = EllipticCurve(Q7,[1,0])
        sage: E.weierstrass_points()
        [(0 : 1 + O(7^10) : 0), (O(7^10) : 0 : 1 + O(7^10))]

    Python

        >>> from sage.all import *
        >>> Q5 = pAdicField(Integer(5),Integer(10))
        >>> E = EllipticCurve(Q5,[Integer(1),Integer(0)])
        >>> E.weierstrass_points()
        [(0 : 1 + O(5^10) : 0),
         (2 + 5 + 2*5^2 + 5^3 + 3*5^4 + 4*5^5 + 2*5^6 + 3*5^7 + 3*5^9 + O(5^10) : 0 : 1 + O(5^10)),
         (3 + 3*5 + 2*5^2 + 3*5^3 + 5^4 + 2*5^6 + 5^7 + 4*5^8 + 5^9 + O(5^10) : 0 : 1 + O(5^10)),
         (O(5^10) : 0 : 1 + O(5^10))]

        >>> Q7 = pAdicField(Integer(7),Integer(10))
        >>> E = EllipticCurve(Q7,[Integer(1),Integer(0)])
        >>> E.weierstrass_points()
        [(0 : 1 + O(7^10) : 0), (O(7^10) : 0 : 1 + O(7^10))]