-
-
Notifications
You must be signed in to change notification settings - Fork 508
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
Implement from_integer and to_integer for all finite fields, extending and replacing fetch_int and integer_representation #33941
Comments
Branch pushed to git repo; I updated commit sha1. New commits:
|
This comment has been minimized.
This comment has been minimized.
comment:3
I just found out that #31605 already tracks this issue and that binary finite fields have This leaves us with three options for naming these methods:
Personally I'm still in favor of (3) because the others lack symmetry. Opinions? |
comment:5
Replying to @yyyyx4:
+1 to option 3 |
comment:6
Also +1 for (3) for the sake of symmetry and consistency. |
comment:8
Thanks for the responses! It seems the only remaining question is whether we want to deprecate |
comment:9
Replying to @yyyyx4:
The only reason I would see not to would be consistency Do Magma, Maple, Mathematica have similar functions, |
comment:10
I don't know. Some quick online searches didn't find anything. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:14
Replying to Samuel Lelièvre:
I could not find one for Magma and Maple. Mathematica has I think Sage is the leading software in this regard. No worry for consistency. +1 to option 3. |
comment:16
Thanks. One more thing. I think the hyphen in |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:18
Done. (IMHO the hyphens improve readability even when they are not strictly needed to disambiguate, but it's obviously a matter of personal preference.) |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:21
Replying to Lorenz Panny:
Thanks! The boundary of consistency and personal preference is blurred and unfortunately is a source of perpetual debates. I made minor edits on spaces. Otherwise, the branch looks good to me. Set it positive review once tests pass. |
Reviewer: Kwankyu Lee |
comment:23
Bot looks green. Thank you! |
Changed branch from public/implement_inverse_of_finite_field_fetch_int to |
Finite fields have
.fetch_int()
to decode integers into finite-field elements by reinterpreting the base-p
representation as a polynomial:However, the inverse operation is a bit cumbersome:
In this patch, we add an inverse to
.fetch_int()
, named.to_integer()
in resemblance with the Python methodint.to_bytes()
.For symmetry, we then rename
.fetch_int()
to.from_integer()
: I, for one, could never remember if.fetch_int()
refers to "fetching an element from an int" or "fetching this element into an int", so I think the new name makes a lot more sense.Also, some code cleanup and optimization while we're at it.
CC: @DaveWitteMorris @slel
Component: finite rings
Author: Lorenz Panny
Branch/Commit:
0eabc46
Reviewer: Kwankyu Lee
Issue created by migration from https://trac.sagemath.org/ticket/33941
The text was updated successfully, but these errors were encountered: