-
-
Notifications
You must be signed in to change notification settings - Fork 488
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
I.parent() should not be the symbolic ring #18036
Comments
comment:1
I'm not so sure it should. Which quadratic field is the appropriate one? There are many, distinguishable by the name of their generator (that would be 'I') for this one, but also by their specified embeddings, and it's not clear which one to choose. Is there an argument for doing this? Ticket #17860 referenced in the description makes no mention of it. I'd imagine there might be evaluation reasons that might make it attractive. Perhaps those also give an indication of which quadratic field would be the appropriate one. |
comment:2
Replying to @nbruin:
I also thought of this in the train... and I do not see much possible choices. I found two rather natural choices for the adoption of
Some reasons (in favor of the first choice):
Vincent |
comment:3
|
comment:4
Replying to @nbruin:
In short: the same reason that |
comment:5
Replying to @videlec:
The ring As for the distinguished embedding, is there a specific reason for choosing |
This comment has been minimized.
This comment has been minimized.
comment:6
Thank you all for working on this - this kind of thing has been on the radar for years but after Burcin left day-to-day operations around here there hasn't been the combination of energy and know-how to do this "correctly", whatever that might mean. Just keep in mind it would be nice for |
comment:8
Proof of concept to see what would break: In particular:
Tangentially related: now may be a good time to deprecate (or remove directly?) the bogus coercion from |
comment:10
Very nice that it worked! I do not quite understand why you need the creation of a new class of For embedding in QQbar I guess that what should be fixed is embedding of number fields. In the ideal world, you would declare:
But then, there might be an infinite loop with the definition of Vincent |
comment:11
Replying to @videlec:
I don't remember, it could be that the reason no longer exists due to later changes.
Yes, the idea is to switch to an embedding into QQbar when other number fields do. |
comment:12
Replying to @mezzarobba:
One reason was that having separate classes makes it easy to test if we are in the special case of QQ[i] using |
comment:13
Replying to @mezzarobba:
Anyway this will be instantiated at startup so why not keeping one instance |
comment:14
Replying to @videlec:
If I remember right, currently, just adding
Yes. Having a separate class would also be natural if we want A related question is whether What do you think? |
comment:16
Replying to @mezzarobba:
Here we can probably cheat with
Yes! Having a custom representation should be done in the main class. It is already possible:
More generally, do we want unique representation for (absolute) number fields? I would tend to say yes. And the natural keys would be:
Vincent |
comment:17
Replying to @videlec:
If all we want is a different string representation, yes, perhaps it makes sense to use
I think everyone agrees that absolute number fields should have unique representation. My question was whether Q[i] should be an absolute number field in this sense, or if it should be a “special” object such that people could work with both Q[i]-as-a-subset-of-complex-numbers and Q[i]-as-a-number field, possibly at the same time. I'd prefer a single object as well, but I am sure I have missed some of the implications, so if anyone has arguments in favor of the other option, I would be interested in hearing them. |
comment:18
Replying to @mezzarobba:
I would be interested in working with any number field seeing them as a subfield of the real or complex numbers! Not only Note that it is already partly possible to play with element of number fields as real numbers (especially with quadratic fields)
About having methods
Which is very different from
At the time Sage would support embedding of number fields into p-adic fields, I think it might be worse to have that dedicated class! But in the meantime, I have no strong opinion. Vincent |
comment:19
See also https://groups.google.com/forum/?hl=en#!topic/sage-devel/Oa0kOC-VGds |
comment:20
Replying to @videlec:
Still, if we ever want this new non-symbolic
|
Commit: |
New commits:
|
comment:24
Hi! I'd like to revive this discussion a bit because we're getting a doctest failure at pynac/pynac#162 which would probably be fixed along the lines of this ticket. For starters, I had a look at the current branch and some of the resulting doctest failures; this should roughly resemble the tasks that are still to be done:
These are certainly not all failures, but they should give an idea of what breaks down. The biggest issue seems to be coercion... |
comment:25
Replying to @behackl:
And stuff like |
comment:26
Replying to @behackl:
It's just missing coercion of number field elements into the infinity ring. It would give a |
comment:69
Replying to @vbraun:
How many times are we supposed to play this game? :) |
Branch pushed to git repo; I updated commit sha1. This was a forced push. Last 10 new commits:
|
comment:73
PDF docs don't build |
comment:74
could be because of + An element of ℚ[i]. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:76
Thanks Volker and Frédéric. |
Changed branch from u/mmezzarobba/18036-QQi to |
…h#18036, sagemath#29738, sagemath#32386, sagemath#32638, sagemath#32665, sagemath#34215 <!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes sagemath#1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> <!-- Why is this change required? What problem does it solve? --> <!-- If this PR resolves an open issue, please link to it here. For example "Fixes sagemath#12345". --> <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [ ] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - sagemath#12345: short description why this is a dependency - sagemath#34567: ... --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: sagemath#36304 Reported by: Matthias Köppe Reviewer(s): David Coudert
…h#18036, sagemath#29738, sagemath#32386, sagemath#32638, sagemath#32665, sagemath#34215 <!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes sagemath#1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> <!-- Why is this change required? What problem does it solve? --> <!-- If this PR resolves an open issue, please link to it here. For example "Fixes sagemath#12345". --> <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [ ] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - sagemath#12345: short description why this is a dependency - sagemath#34567: ... --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: sagemath#36304 Reported by: Matthias Köppe Reviewer(s): David Coudert
As suggested in #7545, this ticket defines the imaginary unit
I
directly as the generator ofQuadraticField(-1)
instead of wrapping it in a symbolic expression.Why? To allow it to be used in combination with elements of QQbar, CC, etc., without coercion forcing the expression to SR. For example,
1.0 + I
is now an element of CC instead of SR.How? We set
I
in sage.all to the generator of ℚ[i], and deprecate importing it fromsage.symbolic.I
. The symbolicI
remains available fromsage.symbolic.constants
for library code working with symbolic expressions, and asSR(I)
orSR.I()
. We create a dedicated subclass of quadratic number field elements to make it possible to support features similar to those of symbolic expressions of the forma + I*b
that would not make sense for number field elements (or be too hard to implement, or pollute the namespace).Why not ℤ[i]? Because the class hierarchy of number field and order elements makes it difficult to provide the compatibility features mentioned above for elements of both ℤ[i] and ℚ[i]. Having
I
be an element of ℚ[i] covers almost all use cases (all except working with algebraic integers?), and people who work with orders are sophisticated enough to explicitly ask for I ∈ ℤ[i] when they need that. (This is a debatable choice. We could probably do without the dedicated subclass for elements of ℚ[i], at the price of breaking backward compatibility a bit more.)CC: @categorie @jdemeyer @mezzarobba @behackl @rwst @kliem @mwageringel
Component: number fields
Author: Marc Mezzarobba
Branch/Commit:
54a34a7
Reviewer: Vincent Delecroix
Issue created by migration from https://trac.sagemath.org/ticket/18036
The text was updated successfully, but these errors were encountered: