#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:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/mmezzarobba/14982-coerce_embeddings|
b40ed6c6aafe4301a81213e6b581f89b4d6d2930
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Description changed by mmezzarobba:
Old description:
> `Parent.discover_coerce_map_from` used to always give priority to
> coercions that start with applying an embedding over those provided by
> `_coerce_map_from_`. This leads to coercion failures such as the
> following:
>
> {{{
> sage: K.<a> = NumberField(x^2+1/2, embedding=CC(0,1))
> sage: L = NumberField(x^2+2, 'b', embedding=1/a)
> sage: R = PolynomialRing(L, 'x')
> sage: R.coerce_map_from(R.base_ring())
> ---------------------------------------------------------------------------
> AttributeError Traceback (most recent call
> last)
> <ipython-input-8-fb89bb074d92> in <module>()
> ----> 1 R.coerce_map_from(R.base_ring())
> ...
> AttributeError: 'NoneType' object has no attribute 'domain'
> }}}
>
> This patch series modifies the coercion discovery algorithm to fix the
> issue, and fixes or works around a few weaknesses in existing code
> exposed by the change.
New description:
`Parent.discover_coerce_map_from` used to always give priority to
coercions that start with applying an embedding over those provided by
`_coerce_map_from_`. This leads to coercion failures such as the
following:
{{{
sage: K.<a> = NumberField(x^2+1/2, embedding=CC(0,1))
sage: L = NumberField(x^2+2, 'b', embedding=1/a)
sage: R = PolynomialRing(L, 'x')
sage: R.coerce_map_from(R.base_ring())
---------------------------------------------------------------------------
AttributeError Traceback (most recent call
last)
<ipython-input-8-fb89bb074d92> in <module>()
----> 1 R.coerce_map_from(R.base_ring())
...
AttributeError: 'NoneType' object has no attribute 'domain'
}}}
This patch series modifies the coercion discovery algorithm to fix the
issue, and fixes or works around a few weaknesses in existing code exposed
by the change. See the individual commit messages for details.
--
--
Ticket URL: <http://trac.sagemath.org/ticket/14982#comment:38>
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.