0

I'm trying to write a program to calculate a generator point of an elliptic curve in sage.

The function to do this is is:

E.gen(0)

Where E is some Elliptic Curve.

If I do this on the online version of Sage it works without issue:

sage: E = EllipticCurve(GF(73),[6,0])
sage: E.gen(0)
(18 : 10 : 1)

However, if I try it locally:

sage: E = EllipticCurve(GF(73),[6,0])
sage: E.gen(0)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-3-cfa3068996f9> in <module>()
----> 1 E.gen(Integer(0))

/usr/lib/python2.7/site-packages/sage/schemes/elliptic_curves/ell_generic.pyc in gen(self, i)
   1309             NotImplementedError: not implemented.
   1310         """
-> 1311         return self.gens()[i]
   1312 
   1313     def rst_transform(self, r, s, t):

TypeError: 'NoneType' object has no attribute '__getitem__'

I'm on Sage version 6.6, and all the documentation that I've seen so far says this should work, and does in the online version of sage. Can anyone shed some light on this?

user2059300
  • 361
  • 1
  • 5
  • 17
  • I think that to help you we would need a little more information about your platform, what exact binary you downloaded, and of course most importantly which elliptic curve you tried this on. – kcrisman May 01 '15 at 14:56
  • In Sage 6.7.beta2 I get `(68 : 65 : 1)`, and in 6.6 I get `(54 : 53 : 1)` (this is on Mac 10.7). Perhaps this isn't particularly deterministic... anyway, your error seems to imply there are no points at all on your curve. What does `E.gens()` do? (I assume it will give an empty list or `None`.) – kcrisman May 01 '15 at 18:02
  • (Again, your *platform* and what binary (for what platform) you downloaded would be very helpful.) – kcrisman May 01 '15 at 18:02
  • I get `(18 : 63 : 1)` in Sage 6.6 on Gentoo. How did you install sage? Did you use your distribution's package manager, or a [pre-built tarball from the sagemath site](http://sagemath.org/download.html)? If it is the former, as the file path from the traceback suggests, could you try the latter? – MvG May 02 '15 at 18:31
  • From the documentation of `E.gens()`: “The algorithm uses random points on the curve, and hence the generators are likely to differ from one run to another; but they are cached so will be consistent in any one run of Sage.” Can you reproduce the problem, or could it be that this only happens for some random choices? – MvG May 02 '15 at 20:24

1 Answers1

0

I did a fresh install of Arch Linux and that fixed the problem. I'm guessing it probably had something to do with my python2/3 configuration.

user2059300
  • 361
  • 1
  • 5
  • 17