# Descent on elliptic curves over $$\QQ$$ with a 2-isogeny¶

sage.schemes.elliptic_curves.descent_two_isogeny.test_els(a, b, c, d, e)

Doctest function for cdef int everywhere_locally_soluble(mpz_t, mpz_t, mpz_t, mpz_t, mpz_t).

EXAMPLES:

sage: from sage.schemes.elliptic_curves.descent_two_isogeny import test_els
sage: for _ in range(1000):
....:     a,b,c,d,e = randint(1,1000), randint(1,1000), randint(1,1000), randint(1,1000), randint(1,1000)
....:     if pari.Pol([a,b,c,d,e]).hyperellratpoints(1000, 1):
....:         try:
....:             if not test_els(a,b,c,d,e):
....:                 print("This never happened", a, b, c, d, e)
....:         except ValueError:
....:             continue

sage.schemes.elliptic_curves.descent_two_isogeny.test_padic_square(a, p)

Doctest function for cdef int padic_square(mpz_t, unsigned long).

EXAMPLES:

sage: from sage.schemes.elliptic_curves.descent_two_isogeny import test_padic_square as ps
sage: for i in [1..300]:
....:     for p in prime_range(100):
....:          if not Qp(p)(i).is_square()==bool(ps(i,p)):
....:              print(i, p)

sage.schemes.elliptic_curves.descent_two_isogeny.test_qpls(a, b, c, d, e, p)

Testing function for Qp_soluble.

EXAMPLES:

sage: from sage.schemes.elliptic_curves.descent_two_isogeny import test_qpls as tq
sage: tq(1,2,3,4,5,7)
1

sage.schemes.elliptic_curves.descent_two_isogeny.test_valuation(a, p)

Doctest function for cdef long valuation(mpz_t, mpz_t).

EXAMPLES:

sage: from sage.schemes.elliptic_curves.descent_two_isogeny import test_valuation as tv
sage: for i in [1..20]:
....:     print('{:>10} {} {} {}'.format(str(factor(i)), tv(i,2), tv(i,3), tv(i,5)))
1 0 0 0
2 1 0 0
3 0 1 0
2^2 2 0 0
5 0 0 1
2 * 3 1 1 0
7 0 0 0
2^3 3 0 0
3^2 0 2 0
2 * 5 1 0 1
11 0 0 0
2^2 * 3 2 1 0
13 0 0 0
2 * 7 1 0 0
3 * 5 0 1 1
2^4 4 0 0
17 0 0 0
2 * 3^2 1 2 0
19 0 0 0
2^2 * 5 2 0 1

sage.schemes.elliptic_curves.descent_two_isogeny.two_descent_by_two_isogeny(E, global_limit_small=10, global_limit_large=10000, verbosity=0, selmer_only=0, proof=1)

Given an elliptic curve E with a two-isogeny phi : E –> E’ and dual isogeny phi’, runs a two-isogeny descent on E, returning n1, n2, n1’ and n2’. Here n1 is the number of quartic covers found with a rational point, and n2 is the number which are ELS.

EXAMPLES:

sage: from sage.schemes.elliptic_curves.descent_two_isogeny import two_descent_by_two_isogeny
sage: E = EllipticCurve('14a')
sage: n1, n2, n1_prime, n2_prime = two_descent_by_two_isogeny(E)
sage: log(n1,2) + log(n1_prime,2) - 2 # the rank
0
sage: E = EllipticCurve('65a')
sage: n1, n2, n1_prime, n2_prime = two_descent_by_two_isogeny(E)
sage: log(n1,2) + log(n1_prime,2) - 2 # the rank
1
sage: x,y = var('x,y')
sage: E = EllipticCurve(y^2 == x^3 + x^2 - 25*x + 39)
sage: n1, n2, n1_prime, n2_prime = two_descent_by_two_isogeny(E)
sage: log(n1,2) + log(n1_prime,2) - 2 # the rank
2
sage: E = EllipticCurve(y^2 + x*y + y == x^3 - 131*x + 558)
sage: n1, n2, n1_prime, n2_prime = two_descent_by_two_isogeny(E)
sage: log(n1,2) + log(n1_prime,2) - 2 # the rank
3


Using the verbosity option:

sage: E = EllipticCurve('14a')
sage: two_descent_by_two_isogeny(E, verbosity=1)
2-isogeny
Results:
2 <= #E(Q)/phi'(E'(Q)) <= 2
2 <= #E'(Q)/phi(E(Q)) <= 2
#Sel^(phi')(E'/Q) = 2
#Sel^(phi)(E/Q) = 2
1 <= #Sha(E'/Q)[phi'] <= 1
1 <= #Sha(E/Q)[phi] <= 1
1 <= #Sha(E/Q)[2], #Sha(E'/Q)[2] <= 1
0 <= rank of E(Q) = rank of E'(Q) <= 0
(2, 2, 2, 2)


Handling curves whose discriminants involve larger than wordsize primes:

sage: E = EllipticCurve('14a')
sage: E = E.quadratic_twist(next_prime(10^20))
sage: E
Elliptic Curve defined by y^2 = x^3 + x^2 + 716666666666666667225666666666666666775672*x - 391925925925925926384240370370370370549019837037037037060249356 over Rational Field
sage: E.discriminant().factor()
-1 * 2^18 * 7^3 * 100000000000000000039^6
sage: log(100000000000000000039.0, 2.0)
66.438...
sage: n1, n2, n1_prime, n2_prime = two_descent_by_two_isogeny(E)
sage: log(n1,2) + log(n1_prime,2) - 2 # the rank
0

sage.schemes.elliptic_curves.descent_two_isogeny.two_descent_by_two_isogeny_work(c, d, global_limit_small=10, global_limit_large=10000, verbosity=0, selmer_only=0, proof=1)

Do all the work in doing a two-isogeny descent.

EXAMPLES:

sage: from sage.schemes.elliptic_curves.descent_two_isogeny import two_descent_by_two_isogeny_work
sage: n1, n2, n1_prime, n2_prime = two_descent_by_two_isogeny_work(13,128)
sage: log(n1,2) + log(n1_prime,2) - 2 # the rank
0
sage: n1, n2, n1_prime, n2_prime = two_descent_by_two_isogeny_work(1,-16)
sage: log(n1,2) + log(n1_prime,2) - 2 # the rank
1
sage: n1, n2, n1_prime, n2_prime = two_descent_by_two_isogeny_work(10,8)
sage: log(n1,2) + log(n1_prime,2) - 2 # the rank
2
sage: n1, n2, n1_prime, n2_prime = two_descent_by_two_isogeny_work(85,320)
sage: log(n1,2) + log(n1_prime,2) - 2 # the rank
3