# Revision history [back]

Here a code that for a given elliptic curve $E$ and $n$ returns polynomials $f_{n1}, g_{n1}, f_{n2}, g_{n2}$:

def get_poly(E, n):
P.<s,t> = PolynomialRing(E.base_ring())
a = E.a_invariants()
R = P.quotient_ring(t^2 + (a[0]*x + a[2])*t - (s^3 + a[1]*s^2 + a[3]*s + a[4])).fraction_field()
Q = E.change_ring(R)(s,t) * n
return Q[0].numerator().lift(), Q[0].denominator().lift(), Q[1].numerator().lift(), Q[1].denominator().lift()


For example, get_poly( EllipticCurve(QQ,[1,2]), 2) gives:

(s*t^2 - 3*s^2 - 18*s + 1,  4*t^2,  t^4 + 3*s*t^2 - 9*s^2 + 36*t^2 - 54*s - 109,  8*t^3)


Here a code that for a given elliptic curve $E$ and an integer $n$ returns polynomials $f_{n1}, g_{n1}, f_{n2}, g_{n2}$:

def get_poly(E, n):
P.<s,t> = PolynomialRing(E.base_ring())
a = E.a_invariants()
R = P.quotient_ring(t^2 + (a[0]*x + a[2])*t - (s^3 + a[1]*s^2 + a[3]*s + a[4])).fraction_field()
Q = E.change_ring(R)(s,t) * n
return Q[0].numerator().lift(), Q[0].denominator().lift(), Q[1].numerator().lift(), Q[1].denominator().lift()


For example, get_poly( EllipticCurve(QQ,[1,2]), 2)2 ) gives:

(s*t^2 - 3*s^2 - 18*s + 1,  4*t^2,  t^4 + 3*s*t^2 - 9*s^2 + 36*t^2 - 54*s - 109,  8*t^3)


Here a code that for a given elliptic curve $E$ and an integer $n$ returns polynomials $f_{n1}, g_{n1}, f_{n2}, g_{n2}$:

def get_poly(E, n):
P.<s,t> = PolynomialRing(E.base_ring())
a = E.a_invariants()
R = P.quotient_ring(t^2 + (a[0]*x (a[0]*s + a[2])*t - (s^3 + a[1]*s^2 + a[3]*s + a[4])).fraction_field()
Q = E.change_ring(R)(s,t) * n
return Q[0].numerator().lift(), Q[0].denominator().lift(), Q[1].numerator().lift(), Q[1].denominator().lift()


For example, get_poly( EllipticCurve(QQ,[1,2]), 2 ) gives:

(s*t^2 - 3*s^2 - 18*s + 1,  4*t^2,  t^4 + 3*s*t^2 - 9*s^2 + 36*t^2 - 54*s - 109,  8*t^3)