Ask Your Question
1

Coordinates do not define a point on Elliptic Curve over complex field? [closed]

asked 2021-03-13 14:59:56 +0100

lsage gravatar image

updated 2021-03-13 15:17:59 +0100

slelievre gravatar image

I have an elliptic curve defined over $\mathbb{C}$ by the equation $y^2 = x^3 + i$ and a point $P = (0, \frac{1+I}{\sqrt{2}})$ on this curve, however when I translate it into code I get an error.

First of all, let's define the elliptic curve:

E = EllipticCurve(CC, [0, I])
print(E)

Obtaining:

Elliptic Curve defined by y^2 = x^3 + 1.00000000000000*I over Complex Field with 53 bits of precision

So, up to now everything looks fine, but then if I insert:

P = E([0, (1 + I)/math.sqrt(2)])

Here is what I obtain:

KeyError                                  Traceback (most recent call last)
/usr/lib/python3/dist-packages/sage/structure/category_object.pyx in sage.structure.category_object.CategoryObject.getattr_from_category (build/cythonized/sage/structure/category_object.c:6958)()
    837         try:
--> 838             return self.__cached_methods[name]
    839         except KeyError:

KeyError: 'point_homset'

During handling of the above exception, another exception occurred:

AttributeError                            Traceback (most recent call last)
/usr/lib/python3/dist-packages/sage/schemes/projective/projective_subscheme.py in point(self, v, check)
    117             try:
--> 118                 return self._point(self.point_homset(), v, check=check)
    119             except AttributeError:  # legacy code without point_homset

/usr/lib/python3/dist-packages/sage/schemes/elliptic_curves/ell_point.py in __init__(self, curve, v, check)
    259         """
--> 260         point_homset = curve.point_homset()
    261         if is_SchemeMorphism(v) or isinstance(v, EllipticCurvePoint_field):

/usr/lib/python3/dist-packages/sage/structure/category_object.pyx in sage.structure.category_object.CategoryObject.__getattr__ (build/cythonized/sage/structure/category_object.c:6880)()
    831         """
--> 832         return self.getattr_from_category(name)
    833 

/usr/lib/python3/dist-packages/sage/structure/category_object.pyx in sage.structure.category_object.CategoryObject.getattr_from_category (build/cythonized/sage/structure/category_object.c:7043)()
    846 
--> 847             attr = getattr_from_other_class(self, cls, name)
    848             self.__cached_methods[name] = attr

/usr/lib/python3/dist-packages/sage/cpython/getattr.pyx in sage.cpython.getattr.getattr_from_other_class (build/cythonized/sage/cpython/getattr.c:2547)()
    388         dummy_error_message.name = name
--> 389         raise AttributeError(dummy_error_message)
    390     cdef PyObject* attr = instance_getattr(cls, name)

AttributeError: 'ComplexField_class_with_category' object has no attribute '__custom_name'

During handling of the above exception, another exception occurred:

TypeError                                 Traceback (most recent call last)
<ipython-input-1-06cb782d02c0> in <module>
      1 E = EllipticCurve(CC,[Integer(0),I])
      2 print(E)
----> 3 P = E([Integer(0), (Integer(1)+I)/math.sqrt(Integer(2))])
      4 print(P)

/usr/lib/python3/dist-packages/sage/schemes/elliptic_curves/ell_generic.py in __call__(self, *args, **kwds)
    547             args = tuple(args[0])
    548 
--> 549         return plane_curve.ProjectivePlaneCurve.__call__(self, *args, **kwds)
    550 
    551     def _reduce_point(self, R, p):

/usr/lib/python3/dist-packages/sage/schemes/generic/scheme.py in __call__(self, *args)
    264                     return S
    265                 args = S
--> 266         return self.point(args)
    267 
    268     @cached_method

/usr/lib/python3/dist-packages/sage/schemes/projective/projective_subscheme.py in point(self, v, check)
    118                 return self._point(self.point_homset(), v, check=check)
    119             except AttributeError:  # legacy code without point_homset
--> 120                 return self._point(self, v, check=check)
    121 
    122         return self.point_homset()(v, check=check)

/usr/lib/python3/dist-packages/sage/schemes/elliptic_curves/ell_point.py in __init__(self, curve, v, check)
    300                 test = y**2 + (a1*x+a3)*y - (((x+a2)*x+a4)*x+a6)
    301             if not test == 0:
--> 302                 raise TypeError("Coordinates %s do not define a point on %s" % (list(v), curve))
    303 
    304         SchemeMorphism_point_abelian_variety_field.__init__(self, point_homset, v, check=False)

TypeError: Coordinates [0.000000000000000, 0.707106781186547 + 0.707106781186547*I, 1.00000000000000] do not define a point on Elliptic Curve defined by y^2 = x^3 + 1.00000000000000*I over Complex Field with 53 bits of precision
edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by lsage
close date 2021-03-13 21:21:34.928726

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-03-13 15:21:44 +0100

slelievre gravatar image

Floating point complex numbers CC can be picky.

Try using algebraic complex numbers QQbar.

sage: E = EllipticCurve(QQbar, [0, I])

sage: x, y = 0, (1 + I)/sqrt(2)
sage: x^3 + i
I
sage: y^2
I

sage: E((x, y))
(0 : 0.7071067811865475? + 0.7071067811865475?*I : 1)
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2021-03-13 14:59:56 +0100

Seen: 604 times

Last updated: Mar 13 '21