-
-
Notifications
You must be signed in to change notification settings - Fork 480
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
number_field_elements_from_algebraics: Fix CyclotomicField embedding when embedding=False #38441
Conversation
Documentation preview for this PR (built with commit 6c56c15; changes) is ready! 🎉 |
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.
Something strange got merged into this PR: there are 3036 files changed with 80k+ lines of changes.... |
…when embedding=False
Co-authored-by: Travis Scrimshaw <[email protected]>
Looks like the merge commit go wrong. Should be fixed now. (the |
src/sage/rings/qqbar.py
Outdated
From: Number Field in zeta6 with defining polynomial x^2 - x + 1 | ||
To: Algebraic Field | ||
Defn: zeta6 |--> 0.500000000000000? + 0.866025403784439?*I) | ||
sage: _[0].coerce_embedding() |
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'm surprised that the underscore would work here. Even if it does, I think it's clearer to give the return value explicit names.
Looks good to me, other than the underscore comment. |
Looks good to me. |
…icField embedding when embedding=False Fixes sagemath#38440. Uses `.coerce_embedding()` to determine the existence of the embedding and modify the field accordingly, instead of doing what the code does currently (assume the field is unembedded by default). Note that there's a behavior change --- now when `embedding=False` it will return a `NumberField` instead of `CyclotomicField` (even though it is technically possible to create a `CyclotomicField(5, embedding=None)`). I don't think this matters. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. - [x] I have updated the documentation and checked the documentation preview. (only part that change is https://doc-pr-38441--sagemath.netlif y.app/html/en/reference/number_fields/sage/rings/qqbar.html#sage.rings.q qbar.number_field_elements_from_algebraics ) URL: sagemath#38441 Reported by: user202729 Reviewer(s): roed314, Travis Scrimshaw, user202729
…icField embedding when embedding=False Fixes sagemath#38440. Uses `.coerce_embedding()` to determine the existence of the embedding and modify the field accordingly, instead of doing what the code does currently (assume the field is unembedded by default). Note that there's a behavior change --- now when `embedding=False` it will return a `NumberField` instead of `CyclotomicField` (even though it is technically possible to create a `CyclotomicField(5, embedding=None)`). I don't think this matters. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. - [x] I have updated the documentation and checked the documentation preview. (only part that change is https://doc-pr-38441--sagemath.netlif y.app/html/en/reference/number_fields/sage/rings/qqbar.html#sage.rings.q qbar.number_field_elements_from_algebraics ) URL: sagemath#38441 Reported by: user202729 Reviewer(s): roed314, Travis Scrimshaw, user202729
Fixes #38440.
Uses
.coerce_embedding()
to determine the existence of the embedding and modify the field accordingly, instead of doing what the code does currently (assume the field is unembedded by default).Note that there's a behavior change --- now when
embedding=False
it will return aNumberField
instead ofCyclotomicField
(even though it is technically possible to create aCyclotomicField(5, embedding=None)
). I don't think this matters.📝 Checklist