PS Your second example is a Weierstrass model but not integral:

sage: E = EllipticCurve([0,0,0,0,-81/4])
sage: E.integral_points()
---------------------------------------------------------------------------
...
ValueError: integral_points() can only be called on an integral model

But you can do this:

sage: E1 = E.integral_model(); E1
Elliptic Curve defined by y^2 = x^3 - 1296 over Rational Field
sage: E1.integral_points()
[(193 : 2681 : 1)]

and also this:

sage: E1.S_integral_points([2])
[(193 : 2681 : 1)]

which I think shows taht the only integral (or {2}-integral) solution
to your equation is x=193, y=2681.  Does that help?

To see the documentation create an elliptic curve E (as above, say, or
try EllipticCurve? to see other ways), and then do
E.integral_points?  or E.S_integral_points?

John Cremona
On Dec 7, 12:53 pm, Jaakko Seppälä <jaakko.j.sepp...@gmail.com> wrote:
> Hello again!
>
> Is that method general? I tried now to find the integer points of x^3
> - 3*x*y^2-y^3-1 without success.
>
> Jaakko
>
> sage: R.<x,y> = QQ[]
> sage: P = x^3 - 81/4 + y^2
> sage: E=EllipticCurve(P)
> ---------------------------------------------------------------------------
> NotImplementedError                       Traceback (most recent call
> last)
>
> /home/jaakko/Matikka/sage-4.2.1-linux-Ubuntu_9.10-i686-Linux/<ipython
> console> in <module>()
>
> /home/jaakko/Matikka/sage-4.2.1-linux-Ubuntu_9.10-i686-Linux/local/lib/
> python2.6/site-packages/sage/schemes/elliptic_curves/constructor.pyc
> in EllipticCurve(x, y, j)
>     214             return EllipticCurve([a1, a2, a3, a4, a6])
>     215         except AssertionError:
> --> 216             raise NotImplementedError, "Construction of an
> elliptic curve from a generic cubic not yet implemented."
>     217
>     218     if rings.is_Ring(x):
>
> NotImplementedError: Construction of an elliptic curve from a generic
> cubic not yet implemented.
> sage: P = x^3 - 3*x*y^2-y^3-1
> sage: E=EllipticCurve(P)
> ---------------------------------------------------------------------------
> NotImplementedError                       Traceback (most recent call
> last)
>
> /home/jaakko/Matikka/sage-4.2.1-linux-Ubuntu_9.10-i686-Linux/<ipython
> console> in <module>()
>
> /home/jaakko/Matikka/sage-4.2.1-linux-Ubuntu_9.10-i686-Linux/local/lib/
> python2.6/site-packages/sage/schemes/elliptic_curves/constructor.pyc
> in EllipticCurve(x, y, j)
>     186         elif len(f.parent().gens()) == 2 or len(f.parent().gens
> ()) == 3 and f.is_homogeneous():
>     187             # We'd need a point too...
> --> 188             raise NotImplementedError, "Construction of an
> elliptic curve from a generic cubic not yet implemented."
>     189         else:
>     190             raise ValueError, "Defining polynomial must be a
> cubic polynomial in two variables."
>
> NotImplementedError: Construction of an elliptic curve from a generic
> cubic not yet implemented.
>
> On Dec 7, 1:42 am, Yann <yannlaiglecha...@gmail.com> wrote:
>
> > From the example you give:
>
> > 2x**3+385x**2+256x-58195=3y**2  , over the rational field
>
> > it's not direct because sage does not handle general cubic equation
> > yet.
> > In sage, let's define:
> > {{{
> > sage: R.<x,y> = QQ[]
> > sage: P = 2*x**3 + 385*x**2 + 256*x - 58195 - 3*y**2}}}
>
> > Given an equation
>
> > A6 + A4 x + A3 y + A2 x**2 + A1 xy + A5 y**2 + A7 x**3 = 0.
>
> > You can obtain do by hand the change of variables Q(x' , y' ) = P( -
> > x*A5*A7 , y * A7**2 * A5 ) / ( A5**3 * A7**4 )
> > a simplified equation:
> > {{{
> > sage: Q = P( x=-x*(-3)*2 , y=y*2**2*(-3) ) / ( (-3)**3*2**4 )
> > sage: Q
> > -x^3 - 385/12*x^2 + y^2 - 32/9*x + 58195/432
>
> > }}}
>
> > You can then define the elliptic curve and compute integral points
> > {{{
> > sage: E = EllipticCurve(Q)
> > sage: time pts = E.integral_model().integral_points()
> > CPU times: user 2.74 s, sys: 0.02 s, total: 2.76 s
> > Wall time: 7.58 s
>
> > }}}
>
> > at this point, you need to come back to the original curve, removing
> > solutions not integral after the inverse change of variables
>
> > {{{
> > sage: x_coords = [ x/6 for x,y,z in pts if 6.divides(ZZ(x)) ]
> > sage: x_coords
> > [-191, -157, -67, -49, -23, -19, 19, 23, 61, 103, 521, 817, 3857,
> > 10687, 276251]
>
> > }}}
>
> > On Dec 6, 6:41 pm, Jaakko Seppälä <jaakko.j.sepp...@gmail.com> wrote:
>
> > > I read 
> > > fromhttp://mathoverflow.net/questions/7907/elliptic-curves-integer-points
> > > than Sage can determine the integer points of an elliptic curve. What
> > > commands will do the trick?

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to