As a follow-up: it seems that the class EllipticCurvePoint simply does not
have any functionality. It seems that about 12 years ago in #1975 it was
decided to set the class to EllipticCurvePoint_finite_field in these cases so
as to be able to do some arithmetic. I guess if that was accepted then, it
should be reasonable to test against x**3 instead of x when z=0. It shouldn't
hurt performance and would produce the right reductions. I'll open a ticket to
see what people think
R.
>To unsubscribe from this group and stop receiving emails from it, send an email to
sage-devel+...@googlegroups.com.
>To view this discussion on the web visit
https://groups.google.com/d/msgid/sage-devel/20200514165730.GA197854%40vertex.
> [33mdiff --git a/src/sage/schemes/elliptic_curves/ell_generic.py b/src/sage/schemes/elliptic_curves/ell_generic.py [m
> [33mindex 730cb2bce9..e94832250e 100644 [m
> [33m--- a/src/sage/schemes/elliptic_curves/ell_generic.py [m
> [33m+++ b/src/sage/schemes/elliptic_curves/ell_generic.py [m
> [36m@@ -543,66 +543,14 @@ [m [mclass EllipticCurve_generic(WithEqualityById, plane_curve.ProjectivePlaneCurve): [m
> characteristic = self.base_ring().characteristic() [m
> if characteristic != 0 and isinstance(args[0][0], rings.Rational) and isinstance(args[0][1], rings.Rational): [m
> if rings.mod(args[0][0].denominator(),characteristic) == 0 or rings.mod(args[0][1].denominator(),characteristic) == 0: [m
> [31m- return self._reduce_point(args[0], characteristic) [m
> [32m+ [m [32m x, y = args[0].xy() [m
> [32m+ [m [32m d = lcm(x.denominator(), y.denominator()) [m
> [32m+ [m [32m args = ([x*d, y*d, d],) [m
> [32m+ [m
> args = tuple(args[0]) [m
> [m
> return plane_curve.ProjectivePlaneCurve.__call__(self, *args, **kwds) [m
> [m
> [31m- def _reduce_point(self, R, p): [m
> [31m- r""" [m
> [31m- Reduces a point R on an elliptic curve to the corresponding point on [m
> [31m- the elliptic curve reduced modulo p. [m
> [31m- [m
> [31m- Used to coerce points between [m
> [31m- curves when p is a factor of the denominator of one of the [m
> [31m- coordinates. [m
> [31m- [m
> [31m- This functionality is used internally in the ``call`` method for [m
> [31m- elliptic curves. [m
> [31m- [m
> [31m- INPUT: [m
> [31m- [m
> [31m- - R -- a point on an elliptic curve [m
> [31m- - p -- a prime [m
> [31m- [m
> [31m- OUTPUT: [m
> [31m- [m
> [31m- S -- the corresponding point of the elliptic curve containing [m
> [31m- R, but reduced modulo p [m
> [31m- [m
> [31m- EXAMPLES: [m
> [31m- [m
> [31m- Suppose we have a point with large height on a rational elliptic curve [m
> [31m- whose denominator contains a factor of 11:: [m
> [31m- [m
> [31m- sage: E = EllipticCurve([1,-1,0,94,9]) [m
> [31m- sage: R = E([0,3]) + 5*E([8,31]) [m
> [31m- sage: factor(R.xy()[0].denominator()) [m
> [31m- 2^2 * 11^2 * 1457253032371^2 [m
> [31m- [m
> [31m- Since 11 is a factor of the denominator, this point corresponds to the [m
> [31m- point at infinity on the same curve but reduced modulo 11. The reduce [m
> [31m- function tells us this:: [m
> [31m- [m
> [31m- sage: E11 = E.change_ring(GF(11)) [m
> [31m- sage: S = E11._reduce_point(R, 11) [m
> [31m- sage: E11(S) [m
> [31m- (0 : 1 : 0) [m
> [31m- [m
> [31m- The 0 point reduces as expected:: [m
> [31m- [m
> [31m- sage: E11._reduce_point(E(0), 11) [m
> [31m- (0 : 1 : 0) [m
> [31m- [m
> [31m- Note that one need not explicitly call [m
> [31m- \code{EllipticCurve._reduce_point} [m
> [31m- """ [m
> [31m- if R.is_zero(): [m
> [31m- return R.curve().change_ring(rings.GF(p))(0) [m
> [31m- x, y = R.xy() [m
> [31m- d = lcm(x.denominator(), y.denominator()) [m
> [31m- return R.curve().change_ring(rings.GF(p))([x*d, y*d, d]) [m
> [31m- [m
> def is_x_coord(self, x): [m
> r""" [m
> Return True if ``x`` is the `x`-coordinate of a point on this curve. [m
> [33mdiff --git a/src/sage/schemes/elliptic_curves/ell_point.py b/src/sage/schemes/elliptic_curves/ell_point.py [m
> [33mindex fdd20ab16f..e7f1256c35 100644 [m
> [33m--- a/src/sage/schemes/elliptic_curves/ell_point.py [m
> [33m+++ b/src/sage/schemes/elliptic_curves/ell_point.py [m
> [36m@@ -294,7 +294,7 @@ [m [mclass EllipticCurvePoint_field(SchemeMorphism_point_abelian_variety_field): [m
> [m
> x, y, z = v [m
> if z == 0: [m
> [31m- test = x [m
> [32m+ [m [32m test = x**3 [m
> else: [m
> a1, a2, a3, a4, a6 = curve.ainvs() [m
> test = y**2 + (a1*x+a3)*y - (((x+a2)*x+a4)*x+a6) [m