-
-
Notifications
You must be signed in to change notification settings - Fork 718
Fix bug with pari interface in classical_modular_polynomial
#37094
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
Fix bug with pari interface in classical_modular_polynomial
#37094
Conversation
eead343 to
2c761b1
Compare
| True | ||
| sage: p = 2^216 * 3^137 - 1 | ||
| sage: F.<i> = GF(p^2, modulus=[1,0,1]) | ||
| sage: l = random_prime(50) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could use the syntax GF((p,2),...) to avoid factoring.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I didn't know this constructor!
|
Documentation preview for this PR (built with commit b372660; changes) is ready! 🎉 |
|
Shouldn't the result be converted into a polynomial over Z/pZ where p is the characteristic of the finite field? |
Why? I think the PR is fine, it returns a polynomial over |
|
You are right. I was puzzled by the conversion to Z[Y], and did not notice that changing Z to Z/pZ would not make a difference, due to the final conversion to R. The fact that |
pjbruin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likely a PARI bug, the patch looks like a good workaround to me
|
Now fixed in PARI: https://pari.math.u-bordeaux.fr/cgi-bin/bugreport.cgi?bug=2533 |
|
Thanks for the reporting and fixing in PARI! |
There is a bug in the new
classical_modular_polynomialfunction created in #36190.A simple example to reproduce the bug is the following
This will fail with a
TypeError.The bug is due to the interface with the pari function$\Phi_\ell(j, Y)$ for $j$ -invariants that are defined over $\mathbb F_p$ , and not over any generic finite field.
polmodular. In particular, contrary to the documentation, thepolmodularfunction will only evaluateIf however
j.parent()is a generic finite field, butjitself 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$\mathbb Z/n\mathbb Z[Y]$ .
ZZ['Y'], since the result ofpolmodularcurrently returns a polynomial in the correct#sd123