Skip to content

Commit 2254e02

Browse files
committed
fix .inverse_image() returning the zero element on the wrong curve
1 parent 28a7d04 commit 2254e02

File tree

1 file changed

+6
-1
lines changed
  • src/sage/schemes/elliptic_curves

1 file changed

+6
-1
lines changed

src/sage/schemes/elliptic_curves/hom.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,11 @@ def inverse_image(self, Q, /, *, all=False):
633633
sage: f.inverse_image(f.codomain().zero())
634634
(0 : 1 : 0)
635635
636+
Make sure the inverse image of zero is returned on the correct curve (:issue:`41529`)::
637+
638+
sage: f.inverse_image(0).curve() is f.domain()
639+
True
640+
636641
You can give a tuple as input::
637642
638643
sage: f.inverse_image((0, 2)) # random
@@ -666,7 +671,7 @@ def inverse_image(self, Q, /, *, all=False):
666671
if all:
667672
return self.kernel_points()
668673
else:
669-
return Q
674+
return self.domain().zero()
670675
if all:
671676
try:
672677
P = self.inverse_image(Q)

0 commit comments

Comments
 (0)