All published worksheets from http://sagenb.org
Image: ubuntu2004
sage has a built-in "elliptic curve factoring" program ecm. We can do some ecm factoring by hand. We first create an RSF modulus that we want to factor and then produce a "reasonably random'' point on a random elliptic curve mod .
Unfortunately, we have to temporarily trick sage into thinking that is a field (which is isn't).
Note that we have chosen in the coefficient of the elliptic curve so that is a point on the curve. It is hard to construct random points on given curves because you don't know whether the for an that you choose is actually a square.
Note that the third coordinate of is ; is `"completely affine.'' However, some multiple of is likely to be the point at modulo one of the prime factors of but not the other factor of . If this occurs, we can factor .
When you see a ZeroDivisionError you know that something is up.
Stein's code for a simple ecm routine is in his "Elementary number theory" book (available for download), p. 134. Here it comes.
Sato-Tate:
Checking problem 5.3:
File: /usr/local/sage/local/lib/python2.6/site-packages/sage/schemes/elliptic_curves/ell_rational_field.py
Type: <type ‘instancemethod’>
Definition: E.integral_points(mw_base=’auto’, both_signs=False, verbose=False)
Docstring:
Computes all integral points (up to sign) on this elliptic curve.
INPUT:
- mw_base - list of EllipticCurvePoint generating the Mordell-Weil group of E (default: ‘auto’ - calls E.gens())
- both_signs - True/False (default False): if True the output contains both P and -P, otherwise only one of each pair.
- verbose - True/False (default False): if True, some details of the computation are output
OUTPUT: A sorted list of all the integral points on E (up to sign unless both_signs is True)
Note
The complexity increases exponentially in the rank of curve E. The computation time (but not the output!) depends on the Mordell-Weil basis. If mw_base is given but is not a basis for the Mordell-Weil group (modulo torsion), integral points which are not in the subgroup generated by the given points will almost certainly not be listed.
EXAMPLES: A curve of rank 3 with no torsion points
sage: E=EllipticCurve([0,0,1,-7,6]) sage: P1=E.point((2,0)); P2=E.point((-1,3)); P3=E.point((4,6)) sage: a=E.integral_points([P1,P2,P3]); a [(-3 : 0 : 1), (-2 : 3 : 1), (-1 : 3 : 1), (0 : 2 : 1), (1 : 0 : 1), (2 : 0 : 1), (3 : 3 : 1), (4 : 6 : 1), (8 : 21 : 1), (11 : 35 : 1), (14 : 51 : 1), (21 : 95 : 1), (37 : 224 : 1), (52 : 374 : 1), (93 : 896 : 1), (342 : 6324 : 1), (406 : 8180 : 1), (816 : 23309 : 1)]sage: a = E.integral_points([P1,P2,P3], verbose=True) Using mw_basis [(2 : 0 : 1), (3 : -4 : 1), (8 : -22 : 1)] e1,e2,e3: -3.0124303725933... 1.0658205476962... 1.94660982489710 Minimal eigenvalue of height pairing matrix: 0.63792081458500... x-coords of points on compact component with -3 <=x<= 1 [-3, -2, -1, 0, 1] x-coords of points on non-compact component with 2 <=x<= 6 [2, 3, 4] starting search of remaining points using coefficient bound 5 x-coords of extra integral points: [2, 3, 4, 8, 11, 14, 21, 37, 52, 93, 342, 406, 816] Total number of integral points: 18It is not necessary to specify mw_base; if it is not provided, then the Mordell-Weil basis must be computed, which may take much longer.
sage: E=EllipticCurve([0,0,1,-7,6]) sage: a=E.integral_points(both_signs=True); a [(-3 : -1 : 1), (-3 : 0 : 1), (-2 : -4 : 1), (-2 : 3 : 1), (-1 : -4 : 1), (-1 : 3 : 1), (0 : -3 : 1), (0 : 2 : 1), (1 : -1 : 1), (1 : 0 : 1), (2 : -1 : 1), (2 : 0 : 1), (3 : -4 : 1), (3 : 3 : 1), (4 : -7 : 1), (4 : 6 : 1), (8 : -22 : 1), (8 : 21 : 1), (11 : -36 : 1), (11 : 35 : 1), (14 : -52 : 1), (14 : 51 : 1), (21 : -96 : 1), (21 : 95 : 1), (37 : -225 : 1), (37 : 224 : 1), (52 : -375 : 1), (52 : 374 : 1), (93 : -897 : 1), (93 : 896 : 1), (342 : -6325 : 1), (342 : 6324 : 1), (406 : -8181 : 1), (406 : 8180 : 1), (816 : -23310 : 1), (816 : 23309 : 1)]An example with negative discriminant:
sage: EllipticCurve('900d1').integral_points() [(-11 : 27 : 1), (-4 : 34 : 1), (4 : 18 : 1), (16 : 54 : 1)]Another example with rank 5 and no torsion points
sage: E=EllipticCurve([-879984,319138704]) sage: P1=E.point((540,1188)); P2=E.point((576,1836)) sage: P3=E.point((468,3132)); P4=E.point((612,3132)) sage: P5=E.point((432,4428)) sage: a=E.integral_points([P1,P2,P3,P4,P5]); len(a) # long time (400s!) 54The bug reported on trac #4525 is now fixed:
sage: EllipticCurve('91b1').integral_points() [(-1 : 3 : 1), (1 : 0 : 1), (3 : 4 : 1)]sage: [len(e.integral_points(both_signs=False)) for e in cremona_curves([11..100])] # long time [2, 0, 2, 3, 2, 1, 3, 0, 2, 4, 2, 4, 3, 0, 0, 1, 2, 1, 2, 0, 2, 1, 0, 1, 3, 3, 1, 1, 4, 2, 3, 2, 0, 0, 5, 3, 2, 2, 1, 1, 1, 0, 1, 3, 0, 1, 0, 1, 1, 3, 6, 1, 2, 2, 2, 0, 0, 2, 3, 1, 2, 2, 1, 1, 0, 3, 2, 1, 0, 1, 0, 1, 3, 3, 1, 1, 5, 1, 0, 1, 1, 0, 1, 2, 0, 2, 0, 1, 1, 3, 1, 2, 2, 4, 4, 2, 1, 0, 0, 5, 1, 0, 1, 2, 0, 2, 2, 0, 0, 0, 1, 0, 3, 1, 5, 1, 2, 4, 1, 0, 1, 0, 1, 0, 1, 0, 2, 2, 0, 0, 1, 0, 1, 1, 4, 1, 0, 1, 1, 0, 4, 2, 0, 1, 1, 2, 3, 1, 1, 1, 1, 6, 2, 1, 1, 0, 2, 0, 6, 2, 0, 4, 2, 2, 0, 0, 1, 2, 0, 2, 1, 0, 3, 1, 2, 1, 4, 6, 3, 2, 1, 0, 2, 2, 0, 0, 5, 4, 1, 0, 0, 1, 0, 2, 2, 0, 0, 2, 3, 1, 3, 1, 1, 0, 1, 0, 0, 1, 2, 2, 0, 2, 0, 0, 1, 2, 0, 0, 4, 1, 0, 1, 1, 0, 1, 2, 0, 1, 4, 3, 1, 2, 2, 1, 1, 1, 1, 6, 3, 3, 3, 3, 1, 1, 1, 1, 1, 0, 7, 3, 0, 1, 3, 2, 1, 0, 3, 2, 1, 0, 2, 2, 6, 0, 0, 6, 2, 2, 3, 3, 5, 5, 1, 0, 6, 1, 0, 3, 1, 1, 2, 3, 1, 2, 1, 1, 0, 1, 0, 1, 0, 5, 5, 2, 2, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1]The bug reported at #4897 is now fixed:
sage: [P[0] for P in EllipticCurve([0,0,0,-468,2592]).integral_points()] [-24, -18, -14, -6, -3, 4, 6, 18, 21, 24, 36, 46, 102, 168, 186, 381, 1476, 2034, 67246]Note
This function uses the algorithm given in [Co1].
REFERENCES:
- [Co1] Cohen H., Number Theory Vol I: Tools and Diophantine Equations GTM 239, Springer 2007
AUTHORS:
- Michael Mardaus (2008-07)
- Tobias Nagel (2008-07)
- John Cremona (2008-07)