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.Thu, 30 Apr 2015 17:27:56 +0200Listing a few points in an elliptic curvehttps://ask.sagemath.org/question/26660/listing-a-few-points-in-an-elliptic-curve/ I have a generated elliptic curve of a modulus. I want to list just a few points on it (doesn't matter what they are, I just need one or two) and I was hoping to do:
E.points()
However due to the size of the curve this generates the error:
OverflowError: range() result has too many items
Is there any way I can make it list just a few points?Tue, 28 Apr 2015 02:12:45 +0200https://ask.sagemath.org/question/26660/listing-a-few-points-in-an-elliptic-curve/Comment by slelievre for <p>I have a generated elliptic curve of a modulus. I want to list just a few points on it (doesn't matter what they are, I just need one or two) and I was hoping to do:</p>
<pre><code>E.points()
</code></pre>
<p>However due to the size of the curve this generates the error:</p>
<pre><code>OverflowError: range() result has too many items
</code></pre>
<p>Is there any way I can make it list just a few points?</p>
https://ask.sagemath.org/question/26660/listing-a-few-points-in-an-elliptic-curve/?comment=26664#post-id-26664Please provide some code to generate `E`. People are more likely to explore the question and give help.Tue, 28 Apr 2015 09:29:40 +0200https://ask.sagemath.org/question/26660/listing-a-few-points-in-an-elliptic-curve/?comment=26664#post-id-26664Answer by vdelecroix for <p>I have a generated elliptic curve of a modulus. I want to list just a few points on it (doesn't matter what they are, I just need one or two) and I was hoping to do:</p>
<pre><code>E.points()
</code></pre>
<p>However due to the size of the curve this generates the error:</p>
<pre><code>OverflowError: range() result has too many items
</code></pre>
<p>Is there any way I can make it list just a few points?</p>
https://ask.sagemath.org/question/26660/listing-a-few-points-in-an-elliptic-curve/?answer=26693#post-id-26693Alternatively, you can also start to iterate the points on the curve without having to construct the whole list:
sage: k = GF(next_prime(7^5))
sage: E = EllipticCurve(k,[3,4])
sage: it = iter(E)
sage: it.next()
(0 : 1 : 0)
sage: it.next()
(0 : 2 : 1)
sage: it.next()
(0 : 16809 : 1)
sage: it.next()
(4 : 5217 : 1)
sage: it.next()
(4 : 11594 : 1)
sage: it.next()
(5 : 12 : 1)
What takes effort is to build the generators of the group. Once you have them, you just have to consider linear combinations. So you can also do
sage: gens = E.gens()
sage: gens
[(11860 : 14157 : 1), (15856 : 8344 : 1)]
sage: 12*gens[0] + 17*gens[1]
(14914 : 10227 : 1)
sage: 1243*gens[0] + 2*gens[1]
(7777 : 15736 : 1)Thu, 30 Apr 2015 17:27:56 +0200https://ask.sagemath.org/question/26660/listing-a-few-points-in-an-elliptic-curve/?answer=26693#post-id-26693Answer by Castor for <p>I have a generated elliptic curve of a modulus. I want to list just a few points on it (doesn't matter what they are, I just need one or two) and I was hoping to do:</p>
<pre><code>E.points()
</code></pre>
<p>However due to the size of the curve this generates the error:</p>
<pre><code>OverflowError: range() result has too many items
</code></pre>
<p>Is there any way I can make it list just a few points?</p>
https://ask.sagemath.org/question/26660/listing-a-few-points-in-an-elliptic-curve/?answer=26688#post-id-26688See the [SageMath reference manual for elliptic curves over finite fields](http://doc.sagemath.org/html/en/reference/curves/sage/schemes/elliptic_curves/ell_finite_field.html).
Here there are some examples that may help:
sage: k = GF(next_prime(7^5))
sage: E = EllipticCurve(k,[2,4])
sage: P = E.random_element(); P
(16740 : 12486 : 1)Thu, 30 Apr 2015 08:19:52 +0200https://ask.sagemath.org/question/26660/listing-a-few-points-in-an-elliptic-curve/?answer=26688#post-id-26688