Changes between Initial Version and Version 22 of Ticket #14982


Ignore:
Timestamp:
01/27/14 16:12:55 (8 years ago)
Author:
mmezzarobba
Comment:

(git-)Rebased on top of 6.1.rc0, removed dependency on #15303.


New commits:

0faffdeCleanup after querying the coercion system with a temporary element_class in NumberField_cyclotomic
bd4f772Make coercions that go through lazy fields more robust
2fcc47314982: consider coercions of parents with embeddings that do not use the embedding

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #14982

    • Property Status changed from new to needs_review
    • Property Authors changed from to Marc Mezzarobba
    • Property Cc robertwb SimonKing jpflori added
    • Property Summary changed from Coercion from base ring fails for some polynomial rings over number fields with embeddings to Coercion from rings with coerce_embedding into constructions over those rings is broken
    • Property Branch changed from to u/mmezzarobba/14982-coerce_embeddings
    • Property Milestone changed from sage-5.12 to sage-6.1
    • Property Keywords embedding added
    • Property Commit changed from to 2fcc47300d619cd8c0c96ab57686096993e64e5d
  • Ticket #14982 – Description

    initial v22  
     1`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:
     2
    13{{{
    24sage: K.<a> = NumberField(x^2+1/2, embedding=CC(0,1))
     
    810<ipython-input-8-fb89bb074d92> in <module>()
    911----> 1 R.coerce_map_from(R.base_ring())
    10 
    11 /home/marc/co/sage/local/lib/python2.7/site-packages/sage/structure/parent.so in sage.structure.parent.Parent.coerce_map_from (sage/structure/parent.c:14807)()
    12 
    13 /home/marc/co/sage/local/lib/python2.7/site-packages/sage/structure/parent.so in sage.structure.parent.Parent.coerce_map_from (sage/structure/parent.c:14563)()
    14 
    15 /home/marc/co/sage/local/lib/python2.7/site-packages/sage/structure/parent.so in sage.structure.parent.Parent.discover_coerce_map_from (sage/structure/parent.c:14932)()
    16 
    17 /home/marc/co/sage/local/lib/python2.7/site-packages/sage/structure/parent.so in sage.structure.parent.Parent.coerce_map_from (sage/structure/parent.c:14563)()
    18 
    19 /home/marc/co/sage/local/lib/python2.7/site-packages/sage/structure/parent.so in sage.structure.parent.Parent.discover_coerce_map_from (sage/structure/parent.c:14985)()
    20 
    21 /home/marc/co/sage/local/lib/python2.7/site-packages/sage/structure/parent_old.so in sage.structure.parent_old.Parent._coerce_map_from_ (sage/structure/parent_old.c:6658)()
    22 
    23 /home/marc/co/sage/local/lib/python2.7/site-packages/sage/rings/polynomial/polynomial_ring.pyc in _coerce_map_from_(self, P)
    24     560             connecting = base_ring.coerce_map_from(P)
    25     561             if connecting is not None:
    26 --> 562                 return self.coerce_map_from(base_ring) * connecting
    27     563         except TypeError:
    28     564             pass
    29 
    30 /home/marc/co/sage/local/lib/python2.7/site-packages/sage/categories/map.so in sage.categories.map.Map.__mul__ (sage/categories/map.c:4796)()
    31 
     12...
    3213AttributeError: 'NoneType' object has no attribute 'domain'
    3314}}}
    3415
    35 Note that apparently P is K (not L) in the call to `_coerce_map_from_` at the end of the backtrace.
     16This 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.