Skip to content

Commit 1b9ac4d

Browse files
author
Release Manager
committed
Trac #34727: .multiplication_by_m_isogeny() fails for negative m
{{{#!sage sage: EllipticCurve([5,5]).multiplication_by_m_isogeny(-1) # ... AssertionError: bug in multiplication_by_m_isogeny() }}} {{{#!sage sage: EllipticCurve([5,5]).multiplication_by_m_isogeny(-2) # ... NotImplementedError: Kohel's algorithm currently only supports cyclic isogenies (except for [2]) }}} {{{#!sage sage: EllipticCurve([5,5]).multiplication_by_m_isogeny(-3) # ... ValueError: n must be a positive integer (or -1 or -2) }}} All of these are because `.multiplication_by_m_isogeny()` calls `.torsion_polynomial()` with `m`, which may be negative, rather than `abs(m)`. As the last error message indicates, the values `-1` and `-2` additionally have special meaning for `.torsion_polynomial()`, which made debugging a bit more confusing... URL: https://trac.sagemath.org/34727 Reported by: lorenz Ticket author(s): Lorenz Panny Reviewer(s): Frédéric Chapoton
2 parents bcabe95 + a6e99a7 commit 1b9ac4d

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/sage/schemes/elliptic_curves/ell_generic.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2352,10 +2352,23 @@ def multiplication_by_m_isogeny(self, m):
23522352
sage: E.multiplication_by_m_isogeny(2).rational_maps()
23532353
((1/4*x^4 + 33/4*x^2 - 121/2*x + 363/4)/(x^3 - 3/4*x^2 - 33/2*x + 121/4),
23542354
(-1/256*x^7 + 1/128*x^6*y - 7/256*x^6 - 3/256*x^5*y - 105/256*x^5 - 165/256*x^4*y + 1255/256*x^4 + 605/128*x^3*y - 473/64*x^3 - 1815/128*x^2*y - 10527/256*x^2 + 2541/128*x*y + 4477/32*x - 1331/128*y - 30613/256)/(1/16*x^6 - 3/32*x^5 - 519/256*x^4 + 341/64*x^3 + 1815/128*x^2 - 3993/64*x + 14641/256))
2355+
2356+
Test for :trac:`34727`::
2357+
2358+
sage: E = EllipticCurve([5,5])
2359+
sage: E.multiplication_by_m_isogeny(-1)
2360+
Isogeny of degree 1 from Elliptic Curve defined by y^2 = x^3 + 5*x + 5 over Rational Field to Elliptic Curve defined by y^2 = x^3 + 5*x + 5 over Rational Field
2361+
sage: E.multiplication_by_m_isogeny(-2)
2362+
Isogeny of degree 4 from Elliptic Curve defined by y^2 = x^3 + 5*x + 5 over Rational Field to Elliptic Curve defined by y^2 = x^3 + 5*x + 5 over Rational Field
2363+
sage: E.multiplication_by_m_isogeny(-3)
2364+
Isogeny of degree 9 from Elliptic Curve defined by y^2 = x^3 + 5*x + 5 over Rational Field to Elliptic Curve defined by y^2 = x^3 + 5*x + 5 over Rational Field
2365+
sage: mu = E.multiplication_by_m_isogeny
2366+
sage: all(mu(-m) == -mu(m) for m in (1,2,3,5,7))
2367+
True
23552368
"""
23562369
mx, my = self.multiplication_by_m(m)
23572370

2358-
torsion_poly = self.torsion_polynomial(m).monic()
2371+
torsion_poly = self.torsion_polynomial(abs(m)).monic()
23592372
phi = self.isogeny(torsion_poly, codomain=self)
23602373
phi._EllipticCurveIsogeny__initialize_rational_maps(precomputed_maps=(mx, my))
23612374

0 commit comments

Comments
 (0)