Sage: Ticket #12715: Number field embeddings should go via AA and QQbar
https://trac.sagemath.org/ticket/12715
<p>
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).
</p>
<p>
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 <code> sage.rings.real_lazy </code>, which do not (and should not) coerce to AA / QQbar.
</p>
<pre class="wiki">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)
</pre><p>
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)
</p>
en-usSagehttps://trac.sagemath.org/chrome/site/logo_sagemath_trac.png
https://trac.sagemath.org/ticket/12715
Trac 1.1.6davidloefflerWed, 21 Mar 2012 11:00:50 GMTtype changed
https://trac.sagemath.org/ticket/12715#comment:1
https://trac.sagemath.org/ticket/12715#comment:1
<ul>
<li><strong>type</strong>
changed from <em>PLEASE CHANGE</em> to <em>defect</em>
</li>
</ul>
TicketrobharronFri, 24 Aug 2012 21:37:25 GMT
https://trac.sagemath.org/ticket/12715#comment:2
https://trac.sagemath.org/ticket/12715#comment:2
<p>
Just wanted to point out that actually it is possible, though slightly roundabout, to create such embeddings.
</p>
<pre class="wiki">sage: x = polygen(QQ)
sage: f = x^3 - x -1
sage: r = f.roots(AA)[0][0]
sage: K.<a> = NumberField(x^3 - x - 1, embedding = r)
sage: K.coerce_embedding()
Generic morphism:
From: Number Field in a with defining polynomial x^3 - x - 1
To: Algebraic Real Field
Defn: a -> 1.324717957244746?
</pre><p>
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?
</p>
<p>
It would probably also make sense to do this with the Minkowski_embedding function (though maybe that would follow from this change?).
</p>
TicketjdemeyerTue, 13 Aug 2013 15:35:53 GMTmilestone changed
https://trac.sagemath.org/ticket/12715#comment:3
https://trac.sagemath.org/ticket/12715#comment:3
<ul>
<li><strong>milestone</strong>
changed from <em>sage-5.11</em> to <em>sage-5.12</em>
</li>
</ul>
Ticketvbraun_spamThu, 30 Jan 2014 21:20:52 GMTmilestone changed
https://trac.sagemath.org/ticket/12715#comment:4
https://trac.sagemath.org/ticket/12715#comment:4
<ul>
<li><strong>milestone</strong>
changed from <em>sage-6.1</em> to <em>sage-6.2</em>
</li>
</ul>
TicketmmezzarobbaSun, 16 Feb 2014 14:12:30 GMT
https://trac.sagemath.org/ticket/12715#comment:5
https://trac.sagemath.org/ticket/12715#comment:5
<p>
Related: <a class="new ticket" href="https://trac.sagemath.org/ticket/5355" title="enhancement: QQbar should have a coercion from number fields with embedding (new)">#5355</a>
</p>
Ticketvbraun_spamTue, 06 May 2014 15:20:58 GMTmilestone changed
https://trac.sagemath.org/ticket/12715#comment:6
https://trac.sagemath.org/ticket/12715#comment:6
<ul>
<li><strong>milestone</strong>
changed from <em>sage-6.2</em> to <em>sage-6.3</em>
</li>
</ul>
Ticketvbraun_spamSun, 10 Aug 2014 16:51:03 GMTmilestone changed
https://trac.sagemath.org/ticket/12715#comment:7
https://trac.sagemath.org/ticket/12715#comment:7
<ul>
<li><strong>milestone</strong>
changed from <em>sage-6.3</em> to <em>sage-6.4</em>
</li>
</ul>
TicketvdelecroixFri, 11 Mar 2016 20:24:54 GMT
https://trac.sagemath.org/ticket/12715#comment:8
https://trac.sagemath.org/ticket/12715#comment:8
<p>
Related: <a class="needs_work ticket" href="https://trac.sagemath.org/ticket/19356" title="enhancement: QQbar.polynomial_root(): allow approximate root (needs_work)">#19356</a>
</p>
Ticket