Opened 8 years ago
Last modified 4 years ago
#12715 new defect
Number field embeddings should go via AA and QQbar
Reported by: | davidloeffler | Owned by: | davidloeffler |
---|---|---|---|
Priority: | major | Milestone: | sage-6.4 |
Component: | number fields | Keywords: | qqbar coercion |
Cc: | Merged in: | ||
Authors: | Reviewers: | ||
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
Sage has a very nice module for the fields of algebraic numbers and algebraic real numbers (defined internally by a number field element and a choice of embedding).
This is almost tautologically the right target for real/complex embeddings of number fields, but at the moment it is *impossible* to create such embeddings -- the target is silently changed to the real/complex "lazy" fields in sage.rings.real_lazy
, which do not (and should not) coerce to AA / QQbar.
sage: K.<a> = NumberField(x^3 - x - 1, embedding = AA(1)) sage: K.coerce_embedding() Generic morphism: From: Number Field in a with defining polynomial x^3 - x - 1 To: Real Lazy Field Defn: a -> 1.324717957244746? sage: AA.has_coerce_map_from(K)
The above code should clearly return an embedding into AA; and more generally any embedding into any real field should be automagically refined to one into AA (not into RLF)
Change History (8)
comment:1 Changed 8 years ago by
- Type changed from PLEASE CHANGE to defect
comment:2 Changed 7 years ago by
comment:3 Changed 6 years ago by
- Milestone changed from sage-5.11 to sage-5.12
comment:4 Changed 6 years ago by
- Milestone changed from sage-6.1 to sage-6.2
comment:5 Changed 6 years ago by
Related: #5355
comment:6 Changed 5 years ago by
- Milestone changed from sage-6.2 to sage-6.3
comment:7 Changed 5 years ago by
- Milestone changed from sage-6.3 to sage-6.4
comment:8 Changed 4 years ago by
Related: #19356
Just wanted to point out that actually it is possible, though slightly roundabout, to create such embeddings.
If you look at the code that produces the embedding (create_embedding_from_approx(K, gen_image) in number_field_morphisms.pyx) you see that it chooses a lazy embedding if gen_image.parent() is not exact (which is not the case here) *or* gen_image is not a root of the defining polynomial of K. The latter is the case in your example. Perhaps sage is calling you lazy for passing it an approximation to the root! Joking aside I think it would be a capital idea to have AA as the codomain rather than RLF. One way to accomplish this would be to take replace gen_name with AA(gen_name.exact_rational()) (and analogously for the real and imaginary parts if gen_name is complex) and replace RLF with AA. Sound good?
It would probably also make sense to do this with the Minkowski_embedding function (though maybe that would follow from this change?).