You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gh-37094: Fix bug with pari interface in `classical_modular_polynomial`
There is a bug in the new `classical_modular_polynomial` function
created in #36190.
A simple example to reproduce the bug is the following
```
p = 2^216 * 3^137 - 1
F.<i> = GF(p^2, modulus=[1,0,1])
E = EllipticCurve(F, [0, 6, 0, 1, 0])
classical_modular_polynomial(2, E.j_invariant())
```
This will fail with a `TypeError`.
The bug is due to the interface with the pari function `polmodular`. In
particular, contrary to the [documentation](http://pari.math.u-
bordeaux.fr/dochtml/ref/Polynomials_and_power_series.html#polmodular),
the `polmodular` function will only evaluate $\Phi_\ell(j, Y)$ for
$j$-invariants that are defined over $\mathbb F_p$, and not over any
generic finite field.
If however `j.parent()` is a generic finite field, but `j` itself is
defined over the prime field, pari will evaluate that and the current
implementation fails to convert back to a sage polynomial.
The proposed fix is to cast the result of the pari call to `ZZ['Y']`,
since the result of `polmodular` currently returns a polynomial in the
correct $\mathbb Z/n\mathbb Z[Y]$.
#sd123
URL: #37094
Reported by: Riccardo Zanotto
Reviewer(s): Frédéric Chapoton, Peter Bruin, Riccardo Zanotto
0 commit comments