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
Set up embeddings for extensions created using the syntax R[alg] #23117
Comments
Author: Marc Mezzarobba |
Commit: |
Branch: u/mmezzarobba/ticket/23117 |
comment:4
Some comments:
Otherwise everything seems to be good. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:6
Thanks for your comments! Replying to @tscrim:
Having an internal function makes it easy to exit at any point of the chain of
That's what I thought, but I had another look thanks to your comment, and it turns out it was a weakness in my code (or perhaps in |
comment:7
Replying to @mezzarobba:
At least right now you don't really have a chain (and your current order is suboptimal when it fails for from sage.rings.all import CIF, CLF, RIF, RLF
try:
iv = CIF(elt)
except (TypeError, ValueError):
emb = None
else:
try:
RIF(elt) # There is a better check for realness, correct?
LF = RLF
except (TypeError, ValueError):
LF = CLF
# First try creating an ANRoot manually, because extension(...,
# embedding=CLF(expr)) (or ...QQbar(expr)) would normalize the
# expression in QQbar, which currently is VERY slow in many
# cases. This may fail when minpoly has close roots or elt is a
# complicated symbolic expression.
# TODO: Rewrite using #19362 and/or #17886 and/or #15600 once
# those issues are solved.
from sage.rings.qqbar import AlgebraicNumber, ANRoot
try:
elt = AlgebraicNumber(ANRoot(minpoly, iv))
except ValueError:
pass
emb = LF(elt)
So it is a necessary evil at present until another part of code is improved? Am I understanding your comment correctly? |
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
comment:10
Replying to @tscrim:
Why not—I changed the implementation to something like that.
I don't know. I'm now testing
but I don't think it makes a significant difference.
No, sorry if I was not clear: it was a weakness of my initial implementation, fixed in a469c70 (itself now squashed into 742c8a4). |
comment:11
Thanks. LGTM. |
Reviewer: Travis Scrimshaw |
Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. This was a forced push. New commits:
|
comment:13
As it turns out, some of the doctest changes were no longer necessary (nor correct!) with the new version that sets up real embeddings when possible. |
Changed branch from u/mmezzarobba/ticket/23117 to |
This fixes in particular the following issue, found thanks to a question
of Paul Zimmermann:
Also fix the conversion of elements of ℚ[i] to CIF to correctly take into account the choice of embedding.
CC: @zimmermann6
Component: algebra
Author: Marc Mezzarobba
Branch/Commit:
db64578
Reviewer: Travis Scrimshaw
Issue created by migration from https://trac.sagemath.org/ticket/23117
The text was updated successfully, but these errors were encountered: