#14982: When a parent is equipped with an embedding, consider coercions that
don't
go through the embedding
-------------------------------------+-------------------------------------
Reporter: mmezzarobba | Owner:
Type: defect | Status: needs_review
Priority: major | Milestone: sage-6.4
Component: coercion | Resolution:
Keywords: embedding | Merged in:
Authors: Marc Mezzarobba, | Reviewers:
Vincent Delecroix | Work issues:
Report Upstream: N/A | Commit:
Branch: | d99564520a5fd599c0fea62b86d0bdbfbd35c1a4
u/mmezzarobba/14982-coerce_embeddings| Stopgaps:
Dependencies: |
-------------------------------------+-------------------------------------
Comment (by vdelecroix):
Salut Marc,
I am quite confused by the following
{{{
sage: K = QuadraticField(2)
sage: RR.coerce_map_from(K)
Composite map:
From: Number Field in a with defining polynomial x^2 - 2
To: Real Field with 53 bits of precision
Defn: Generic morphism:
From: Number Field in a with defining polynomial x^2 - 2
To: Real Lazy Field
Defn: a -> 1.414213562373095?
then
Conversion via _mpfr_ method map:
From: Real Lazy Field
To: Real Field with 53 bits of precision
}}}
But elements of `K` do implement directly an `_mpfr_` method
{{{
sage: K.an_element()._mpfr_
<built-in method _mpfr_ of
sage.rings.number_field.number_field_element_quadratic.NumberFieldElement_quadratic
object at 0x7f3e3d94ff68>
}}}
So why the discovery does not choose this direct conversion map instead of
going through the real lazy field? (note: this method `_mpfr_` is
completely broken, but it does not change anything to the story)
Vincent
--
Ticket URL: <http://trac.sagemath.org/ticket/14982#comment:60>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.