Ask Your Question

Revision history [back]

f and one*f are the same mathematical object, but are not represented in the same way by Sage:

sage: g = f*one
sage: type(f)
<class 'sage.rings.number_field.morphism.CyclotomicFieldHomomorphism_im_gens'>
sage: type(g)
<type 'sage.categories.map.FormalCompositeMap'>

You should not worry about that, since:

sage: g in Hom(U,U)
True
sage: f == g
True
sage: g.parent()
Automorphism group of Cyclotomic Field of order 3 and degree 2
sage: f.parent()
Automorphism group of Cyclotomic Field of order 3 and degree 2

f and one*f are the same mathematical object, but are not represented in the same way by Sage:

sage: g = f*one
sage: type(f)
<class 'sage.rings.number_field.morphism.CyclotomicFieldHomomorphism_im_gens'>
sage: type(g)
<type 'sage.categories.map.FormalCompositeMap'>

You should not worry about that, since:

sage: g in Hom(U,U)
True
sage: f == g
True
sage: g.parent()
Automorphism group of Cyclotomic Field of order 3 and degree 2
sage: f.parent()
Automorphism group of Cyclotomic Field of order 3 and degree 2

EDIT regarding the comment, a possible workaround would be to define the one not as the identity of Hom(U,U).identity() but as Hom(U,U)[0] since it will be of the same type as f and everything will work well:

sage: Hom(U,U)[0]
Ring endomorphism of Cyclotomic Field of order 3 and degree 2
  Defn: zeta3 |--> zeta3
sage: Hom(U,U).identity()
Identity endomorphism of Cyclotomic Field of order 3 and degree 2
sage: Hom(U,U)[0] == Hom(U,U).identity()
True

sage: one = Hom(U,U)[0]
sage: type(one)
<class 'sage.rings.number_field.morphism.CyclotomicFieldHomomorphism_im_gens'>
sage: one*f
Ring endomorphism of Cyclotomic Field of order 3 and degree 2
  Defn: zeta3 |--> -zeta3 - 1
sage: f*one
Ring endomorphism of Cyclotomic Field of order 3 and degree 2
  Defn: zeta3 |--> -zeta3 - 1
sage: one
Ring endomorphism of Cyclotomic Field of order 3 and degree 2
  Defn: zeta3 |--> zeta3
sage: f
Ring endomorphism of Cyclotomic Field of order 3 and degree 2
  Defn: zeta3 |--> -zeta3 - 1