#10850: composition and comparison of number-field homomorphisms
------------------------------+---------------------------------------------
   Reporter:  fwclarke        |          Owner:  davidloeffler  
       Type:  defect          |         Status:  positive_review
   Priority:  major           |      Milestone:  sage-4.7.2     
  Component:  number fields   |       Keywords:                 
Work_issues:                  |       Upstream:  N/A            
   Reviewer:  David Loeffler  |         Author:  Francis Clarke 
     Merged:                  |   Dependencies:                 
------------------------------+---------------------------------------------
Description changed by leif:

Old description:

> As of 4.6.2.rc0, when homomorphisms of number fields are composed the
> result has type `RingHomomorphism_im_gens` rather than
> `NumberFieldHomomorphism_im_gens`:
> {{{
> sage: K = QuadraticField(2)
> sage: e, f = End(K)
> sage: type(f)
> <class
> 'sage.rings.number_field.morphism.NumberFieldHomomorphism_im_gens'>
> sage: type(f*f)
> <type 'sage.rings.morphism.RingHomomorphism_im_gens'>
> }}}
> Consequently, comparison fails to work correctly:
> {{{
> sage: f*f == e
> False
> sage: f*f
> Ring endomorphism of Number Field in a with defining polynomial x^2 - 2
>   Defn: a |--> a
> sage: e
> Ring endomorphism of Number Field in a with defining polynomial x^2 - 2
>   Defn: a |--> a
> }}}
>
> Moreover, for relative number fields composition yields a formal
> composite
> map:
> {{{
> sage: L.<a, b> = NumberField([x^2 - 2, x^2 - 3])
> sage: g = End(L)[1]
> sage: type(g*g)
> <type 'sage.categories.map.FormalCompositeMap'>
> }}}
> and this means that powers beyond cubes produce an error:
> {{{
> sage: g^4
> Traceback (most recent call last)
> ...
> AttributeError: 'sage.categories.map.FormalCompositeMap' object has no
> attribute '_rational_'
> }}}
> Comparison for homomorphisms out of relative number fields needs fixing
> too, because they are not standard im_gens homomorphisms.
>
> The patch deals with these issues.

New description:

 As of 4.6.2.rc0, when homomorphisms of number fields are composed the
 result has type `RingHomomorphism_im_gens` rather than
 `NumberFieldHomomorphism_im_gens`:
 {{{
 sage: K = QuadraticField(2)
 sage: e, f = End(K)
 sage: type(f)
 <class 'sage.rings.number_field.morphism.NumberFieldHomomorphism_im_gens'>
 sage: type(f*f)
 <type 'sage.rings.morphism.RingHomomorphism_im_gens'>
 }}}
 Consequently, comparison fails to work correctly:
 {{{
 sage: f*f == e
 False
 sage: f*f
 Ring endomorphism of Number Field in a with defining polynomial x^2 - 2
   Defn: a |--> a
 sage: e
 Ring endomorphism of Number Field in a with defining polynomial x^2 - 2
   Defn: a |--> a
 }}}

 Moreover, for relative number fields composition yields a formal composite
 map:
 {{{
 sage: L.<a, b> = NumberField([x^2 - 2, x^2 - 3])
 sage: g = End(L)[1]
 sage: type(g*g)
 <type 'sage.categories.map.FormalCompositeMap'>
 }}}
 and this means that powers beyond cubes produce an error:
 {{{
 sage: g^4
 Traceback (most recent call last)
 ...
 AttributeError: 'sage.categories.map.FormalCompositeMap' object has no
 attribute '_rational_'
 }}}
 Comparison for homomorphisms out of relative number fields needs fixing
 too, because they are not standard im_gens homomorphisms.

 The patch deals with these issues.

 ----

 Apply [attachment:trac_10850.patch] to the Sage library.

--

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10850#comment:3>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to