ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sat, 06 May 2023 20:29:34 +0200how to create an elliptic curve in sagehttps://ask.sagemath.org/question/68216/how-to-create-an-elliptic-curve-in-sage/the following code
from sage.schemes.elliptic_curves import EllipticCurve
E = EllipticCurve('y^2 = x^3 + 1', field='GF(8)')
points = E.points()
print(points)
E.plots()
always returns the following error : ImportError: cannot import name 'EllipticCurve' from 'sage.schemes.elliptic_curves'Sat, 06 May 2023 09:44:49 +0200https://ask.sagemath.org/question/68216/how-to-create-an-elliptic-curve-in-sage/Comment by John Palmieri for <p>the following code</p>
<pre><code>from sage.schemes.elliptic_curves import EllipticCurve
E = EllipticCurve('y^2 = x^3 + 1', field='GF(8)')
points = E.points()
print(points)
E.plots()
</code></pre>
<p>always returns the following error : ImportError: cannot import name 'EllipticCurve' from 'sage.schemes.elliptic_curves'</p>
https://ask.sagemath.org/question/68216/how-to-create-an-elliptic-curve-in-sage/?comment=68224#post-id-68224You could try `from sage.schemes.elliptic_curves.all import EllipticCurve`.Sat, 06 May 2023 20:29:34 +0200https://ask.sagemath.org/question/68216/how-to-create-an-elliptic-curve-in-sage/?comment=68224#post-id-68224Answer by achrzesz for <p>the following code</p>
<pre><code>from sage.schemes.elliptic_curves import EllipticCurve
E = EllipticCurve('y^2 = x^3 + 1', field='GF(8)')
points = E.points()
print(points)
E.plots()
</code></pre>
<p>always returns the following error : ImportError: cannot import name 'EllipticCurve' from 'sage.schemes.elliptic_curves'</p>
https://ask.sagemath.org/question/68216/how-to-create-an-elliptic-curve-in-sage/?answer=68217#post-id-68217You are trying to define a singular curve
For real elliptic curves you can try
F=GF(5^2,'a')
E=EllipticCurve([F(0),F(1)])
E
Elliptic Curve defined by y^2 = x^3 + 1 over Finite Field in a of size 5^2
pp=E.points()
[p.xy() for p in pp[1:]]
gives all finite points
For finite fields plot is defined for prime fields
F=GF(101)
E=EllipticCurve([F(0),F(1)])
E
Elliptic Curve defined by y^2 = x^3 + 1 over Finite Field of size 101
E.plot()
gives the plotSat, 06 May 2023 15:00:38 +0200https://ask.sagemath.org/question/68216/how-to-create-an-elliptic-curve-in-sage/?answer=68217#post-id-68217Comment by andriam for <p>You are trying to define a singular curve</p>
<p>For real elliptic curves you can try</p>
<pre><code>F=GF(5^2,'a')
E=EllipticCurve([F(0),F(1)])
E
Elliptic Curve defined by y^2 = x^3 + 1 over Finite Field in a of size 5^2
pp=E.points()
[p.xy() for p in pp[1:]]
</code></pre>
<p>gives all finite points</p>
<p>For finite fields plot is defined for prime fields</p>
<pre><code>F=GF(101)
E=EllipticCurve([F(0),F(1)])
E
Elliptic Curve defined by y^2 = x^3 + 1 over Finite Field of size 101
E.plot()
</code></pre>
<p>gives the plot</p>
https://ask.sagemath.org/question/68216/how-to-create-an-elliptic-curve-in-sage/?comment=68219#post-id-68219Many thanks to achrzesz; now its works !Sat, 06 May 2023 18:25:26 +0200https://ask.sagemath.org/question/68216/how-to-create-an-elliptic-curve-in-sage/?comment=68219#post-id-68219