# 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?

edit retag close merge delete

Please provide some code to generate E. People are more likely to explore the question and give help.

( 2015-04-28 02:29:40 -0500 )edit

Sort by ยป oldest newest most voted

Alternatively, 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)

more

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)

more