-
-
Notifications
You must be signed in to change notification settings - Fork 535
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
K.gen() where K = GF(p) returns 1, not a primitive element #3045
Comments
comment:1
This is actually the correct behaviour. The function that returns a primitive element is K.multiplicative_generator(), not K.gen(). There was some inconsistency in the docstrings of the various types of finite fields, which is fixed by the attached patch. |
comment:2
This otherwise deserves a positive review, except that I couldn't verify the claim in the doctest that the outputs of gen() and multiplicative_generator() can vary between runs. Is that really true? |
comment:3
Attachment: trac_3045.patch.gz Kiran, I tried to find some examples and couldn't. I think the point of the warning in the docstring is that we are not guaranteeing that the finite fields code wouldn't change in the future in such a way that other generators would be returned; or, for that matter, that the same version of Sage running on wildly different architectures won't return different generators. I modified the docstrings a bit to (hopefully) make that more clear. Note that multiplicative_generator() calls pari's znprimroot(), so whatever fuzziness there is in pari's finding a generator gets automatically inherited by Sage. |
comment:4
Looks good to me. I think the docstrings are clear enough. |
comment:5
Merged in Sage 3.3.alpha2. Cheers, Michael |
Component: number theory
Keywords: galois field
Issue created by migration from https://trac.sagemath.org/ticket/3045
The text was updated successfully, but these errors were encountered: