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
In sage 9.3, raising an integer to a finite-field element in some cases coerces the base into the finite field. I think the correct behaviour should be to throw an error, or attempt to interpret the exponent as an integer (which is mathematically ill-defined but perhaps convenient).
Example:
sage: x = 123**GF(49)(5); x, x.parent()
(2, Finite Field in z2 of size 7^2)
Interestingly, this does not happen with prime finite fields, which inherit from integers modulo n:
sage: x = 123**GF(47)(5); x, x.parent()
(28153056843, Integer Ring)
I was looking into the issue and found some of the past issue related to this #24247 : It allowed coercion in power operation. #15709 : It mentioned some inconvenience caused due to coercion.
I believe this issue can be fixed by making some changes here.
Shall we add support for FiniteField_givaro too? (and others FiniteField_ntl_gf2e or FiniteField_pari_ffelt)
Additional Info:
sage: x = 123**GF(64, impl='givaro')(5); x, x.parent()
(1, Finite Field in z6 of size 2^6)
sage: x = 123**GF(64, impl='pari_ffelt')(5); x, x.parent()
(1, Finite Field in z6 of size 2^6)
sage:
sage: x = 123**GF(64, impl='ntl')(5); x, x.parent()
...
...
...
TypeError: unsupported operand parent(s) for ^: 'Finite Field in z6 of size 2^6' and 'Finite Field in z6 of size 2^6'
What should be right course of action here ?
Maybe we can remove feature
Maybe we can provide support for givaro and others
Maybe we can create a backend variable to handle such cases (similar to with proof which is used for primality testing)
In sage 9.3, raising an integer to a finite-field element in some cases coerces the base into the finite field. I think the correct behaviour should be to throw an error, or attempt to interpret the exponent as an integer (which is mathematically ill-defined but perhaps convenient).
Example:
Interestingly, this does not happen with prime finite fields, which inherit from integers modulo n:
Component: coercion
Keywords: finite fields, exponentiation
Issue created by migration from https://trac.sagemath.org/ticket/32287
The text was updated successfully, but these errors were encountered: