-
-
Notifications
You must be signed in to change notification settings - Fork 588
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
Horrible bug in number field conversion #11869
Comments
comment:1
I am working on a patch... |
Dependencies: #11870 |
Work Issues: p-adic embeddings, problems with #11873 |
comment:6
From the patch:
Is that second bit absolutely necessary? I think this is horrible. Throwing an error would be much preferable. With this, it would be possible to have two fields K and L, elements a,b in K and have |
Changed work issues from p-adic embeddings, problems with #11873 to more examples |
comment:8
Replying to @nbruin:
All this should be fixed now. |
Changed work issues from more examples to none |
comment:10
Of course the second one must equal the first one or raise an error. |
comment:11
In the case of my example above, there is a preferred embedding of L into K, but your patch does not find it. In general, even if there really is no preferred embedding of L into K, then just choosing one will still lead to trouble, as you'll get non-commuting diagrams of embeddings. Instead of just choosing an embedding, I strongly think you must raise an error (but other people may say warning, as David did on sage-nt). This could be discussed on the mailing list. |
comment:13
Replying to @mstreng:
So may I paraphrase your proposal as follows: |
comment:14
Replying to @jdemeyer:
Yes. |
comment:16
Done (raising |
comment:17
Thanks, I hope to look at the patch soon. In the mean time: maybe the message "TypeError: No compatible embedding found for conversion" becomes clearer if you add the word "natural" or "preferred", and perhaps add the fields to the message, i.e., append "from %s to %s" % (....) |
comment:18
Done, error message changed. |
comment:19
There is one doctest error:
|
comment:20
I simply removed the failing test because it makes assumptions which are no longer valid. Also, the result of the test is mathematically anyway. |
comment:21
I recall some discussion on sage-nt going into that example (introduced in #8800 together with the "Horrible bug"). I'm CC'ing its author. |
comment:22
Attachment: 11869.patch.gz I am a bit confused: In the keywords, you name it "coercion". But in your example, you just talk about conversion. If it really is a coercion (please check: Does that conversion happens implicitly?) then I agree it is a bug. Otherwise, I'd say that a conversion that is not a coercion is allowed to do arbitrary nasty stuff (such as |
comment:23
Replying to @simon-king-jena:
It certainly used to be a stupid "conversion". My patch actually implements something which is much closer to coercion. Essentially, it is coercion on subfields of the given number fields. Suppose I have two number fields |
comment:24
I'm satisfied with the patch, and all tests pass. In the sage-nt discussion, it seems that most number field users want to disallow senseless conversions. And all the time-consuming computation happens after the point where I would have given up with an Error. So I'd like to give this a positive review. |
Author: Jeroen Demeyer |
Reviewer: Marco Streng |
Merged: sage-4.7.3.alpha0 |
Milestone sage-4.7.3 deleted |
Changed merged from sage-4.7.3.alpha0 to sage-4.8.alpha0 |
Depends on #11873
Depends on #11876
CC: @simon-king-jena
Component: number fields
Author: Jeroen Demeyer
Reviewer: Marco Streng
Merged: sage-4.8.alpha0
Issue created by migration from https://trac.sagemath.org/ticket/11869
The text was updated successfully, but these errors were encountered: