#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 mmezzarobba):
Salut Vincent,
Replying to [comment:60 vdelecroix]:
> 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)
I think the reason is that `RR` explicitly asks for coercions into it
through `RLF` (see the very last line of
`RealField_class._coerce_map_from_`. So the step of the coercion discovery
algorithm that calls `_coerce_map_from_` (step 2 with my patch) succeeds.
The map it finds is of type `FormalCompositeMap`, so the next step (which
would consider the coercions defined using `_populate_coercion_lists_`,
including `_mpfr_`) is not even tried.
As far as I understand, this is the intended behavior from the point of
view of the coercion discovery algorithm—`_coerce_map_from_` “knows
better”, do as it says. In any case the fact that the coercion from `K` to
`RLF` is an embedding doesn't come into play. (But this ticket should make
it possible to chose the coercion via `_mpfr_` by modifying
`RealField_class._coerce_map_from_`, while this wouldn't work now due to
the special treatment of embeddings.)
--
Ticket URL: <http://trac.sagemath.org/ticket/14982#comment:61>
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.