Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use semi-primitive root when checking kernel polynomials of isogenies #36187

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions src/sage/schemes/elliptic_curves/isogeny_small_degree.py
Original file line number Diff line number Diff line change
Expand Up @@ -2397,14 +2397,18 @@
if m == 2 or m == 3:
return True

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

from sage.rings.finite_rings.integer_mod_ring import Integers
for a in Integers(m).unit_gens():
if m & 1 and m.is_prime_power():
gens = _least_semi_primitive(m),
else:
from sage.rings.finite_rings.integer_mod_ring import Integers
gens = Integers(m).unit_gens()

Check warning on line 2409 in src/sage/schemes/elliptic_curves/isogeny_small_degree.py

View check run for this annotation

Codecov / codecov/patch

src/sage/schemes/elliptic_curves/isogeny_small_degree.py#L2408-L2409

Added lines #L2408 - L2409 were not covered by tests

for a in gens:
mu = E.multiplication_by_m(a, x_only=True)
if f( S(mu.numerator()) / S(mu.denominator()) ) != 0:
return False
Expand Down