Hi,
I wanted to make a little script that given an elliptic curve and two
points, it would plot the addition with the corresponding lines,
labels, etc. to use in a talk for undergraduates.
I wanted to only specify the x-coordinates and choices for the
corresponding y's (the larger value, or the smaller), and have the
script compute the exact value for the y's. Since I would be
plotting, I was working over the reals. The problem is that the
approximations do not allow me to define points on the curve, I think
due to imprecision. More precisely:
sage: E=EllipticCurve(RR,[0,-1])
sage: x0=RR(4)^(1/3)
sage: y0=sqrt(RR(3))
sage: E([x0,y0])
---------------------------------------------------------------------------
<type 'exceptions.TypeError'> Traceback (most recent call last)
/home/finotti/<ipython console> in <module>()
/usr/local/sage-1.5.1.2/local/lib/python2.5/site-packages/sage/schemes/elliptic_curves/ell_generic.py
in __call__(self, *args)
300 R = self.base_ring()
301 return self.point([R(0),R(1),R(0)], check=False)
--> 302 return plane_curve.ProjectiveCurve_generic.__call__(self, *args)
303
304 def _homset_class(self, *args, **kwds):
/usr/local/sage-1.5.1.2/local/lib/python2.5/site-packages/sage/schemes/generic/scheme.py
in __call__(self, *args)
124 if S.codomain() == self:
125 return S
--> 126 return self.point(args)
127
128 def point_homset(self, R=None):
/usr/local/sage-1.5.1.2/local/lib/python2.5/site-packages/sage/schemes/generic/scheme.py
in point(self, v, check)
140
141 def point(self, v, check=True):
--> 142 return self._point_class(self, v, check=check)
143
144 def _point_class(self):
/usr/local/sage-1.5.1.2/local/lib/python2.5/site-packages/sage/schemes/generic/morphism.py
in __init__(self, X, v, check)
372 raise ValueError, "%s does not define a valid
point since all entries are 0"%v
373
--> 374 X.codomain()._check_satisfies_equations(v)
375
376 self._coords = v
/usr/local/sage-1.5.1.2/local/lib/python2.5/site-packages/sage/schemes/generic/algebraic_scheme.py
in _check_satisfies_equations(self, v)
226 for f in self.defining_polynomials():
227 if f(v) != 0:
--> 228 self._error_bad_coords(v)
229
230 def base_extend(self, R):
/usr/local/sage-1.5.1.2/local/lib/python2.5/site-packages/sage/schemes/generic/algebraic_scheme.py
in _error_bad_coords(self, v)
217
218 def _error_bad_coords(self, v):
--> 219 raise TypeError, "coordinates %s do not define a point
on %s"%(v,self)
220
221 def _check_satisfies_equations(self, v):
<type 'exceptions.TypeError'>: coordinates [1.58740105196819,
1.73205080756887, 1.00000000000000] do not define a point on Elliptic
Curve defined by y^2 + 0.000000000000000*x*y + 0.000000000000000*y =
x^3 + 0.000000000000000*x^2 + 0.000000000000000*x - 1.00000000000000
over Real Field with 53 bits of precision
I can implement the addition formula and work with the approximations
instead of using Sage to add the points (or call Pari, which I think
does it), but I thought I should see if I am missing something and/or
if this is the expected behavior.
Thanks,
Luis
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sage-support
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~----------~----~----~----~------~----~------~--~---