Skip to content

Commit 7b8b6b6

Browse files
author
Release Manager
committed
gh-36187: use semi-primitive root when checking kernel polynomials of isogenies The existing code takes a generating set of the unit group, but as a comment in the code suggests, a set of generators for $(\mathbb Z/m)^\times/\pm$ suffices. The existing function `_least_semi_primitive` computes such a semiprimitive root when $m$ is an odd prime power, so we may use it. URL: #36187 Reported by: Lorenz Panny Reviewer(s): Travis Scrimshaw
2 parents 50b1d02 + c518b47 commit 7b8b6b6

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/sage/schemes/elliptic_curves/isogeny_small_degree.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2411,14 +2411,18 @@ def is_kernel_polynomial(E, m, f):
24112411
if m == 2 or m == 3:
24122412
return True
24132413

2414-
# For each a in a set of generators of (Z/mZ)^* we check that the
2415-
# multiplication-by-a map permutes the roots of f. It would be
2416-
# enough to take a generating (Z/mZ)^*/{1,-1} but that is not
2417-
# implemented. If m is prime (or more generally, has a primitive
2418-
# root) then only one a will be needed.
2414+
# For each a in a set of generators of (Z/mZ)^*/{1,-1} we check
2415+
# that the multiplication-by-a map permutes the roots of f.
2416+
# If m is prime (or more generally, has a primitive root) then
2417+
# only one a will be needed.
24192418

2420-
from sage.rings.finite_rings.integer_mod_ring import Integers
2421-
for a in Integers(m).unit_gens():
2419+
if m & 1 and m.is_prime_power():
2420+
gens = _least_semi_primitive(m),
2421+
else:
2422+
from sage.rings.finite_rings.integer_mod_ring import Integers
2423+
gens = Integers(m).unit_gens()
2424+
2425+
for a in gens:
24222426
mu = E.multiplication_by_m(a, x_only=True)
24232427
if f( S(mu.numerator()) / S(mu.denominator()) ) != 0:
24242428
return False

0 commit comments

Comments
 (0)