-
-
Notifications
You must be signed in to change notification settings - Fork 465
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
Dropping support for power with Finite Field Polynomial Element #38754
Conversation
Documentation preview for this PR (built with commit 6f01dba; changes) is ready! 🎉 |
@tscrim please have a look. |
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.
I don't think this is the correct way to fix the issue. Adding very special cases in generic code for deciding coercion should not be done without a very good reason. Contrast your code with the generic base class IntegerModRing
. Hence, my proposed change, get every other case that is not an IntegerModRing
but a finite field.
src/sage/structure/parent.pyx
Outdated
from sage.rings.finite_rings.finite_field_pari_ffelt import FiniteField_pari_ffelt | ||
from sage.rings.finite_rings.finite_field_ntl_gf2e import FiniteField_ntl_gf2e | ||
from sage.rings.finite_rings.finite_field_givaro import FiniteField_givaro | ||
if isinstance(S, (FiniteField_pari_ffelt, FiniteField_ntl_gf2e, FiniteField_givaro)): |
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.
from sage.rings.finite_rings.finite_field_pari_ffelt import FiniteField_pari_ffelt | |
from sage.rings.finite_rings.finite_field_ntl_gf2e import FiniteField_ntl_gf2e | |
from sage.rings.finite_rings.finite_field_givaro import FiniteField_givaro | |
if isinstance(S, (FiniteField_pari_ffelt, FiniteField_ntl_gf2e, FiniteField_givaro)): | |
elif isinstance(S, FiniteField): |
You will also need to add
from sage.rings.finite_rings.finite_field_base import FiniteField
# See Issue : #32287 | ||
# Disallowing Finite Field Polynomial Element | ||
# to be used to raise power | ||
raise TypeError('Unable to raise power using finite field polynomial element') |
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.
raise TypeError('Unable to raise power using finite field polynomial element') | |
_record_exception() |
I think this is the correct thing to do.
I understood the 1st part But I couldn't understand the second part |
Sorry, I forgot what |
Understood I will close this and look for another approach.
Like
|
Fixes issue : #32287
Reference : pow ( Int, Finite Field)
It was noticed that raising power with ModN field numbers and Gravio/NTL was not consistent.
Change:
Removed support for Gravio/NTL/Pari_ffelt in powering scenario.
📝 Checklist
⌛ Dependencies