#13856: Add a top_class method to the Steenrod algebra
--------------------------------------+-------------------------------------
       Reporter:  cnassau             |         Owner:  jhpalmieri  
           Type:  enhancement         |        Status:  needs_review
       Priority:  minor               |     Milestone:  sage-5.7    
      Component:  algebraic topology  |    Resolution:              
       Keywords:  Steenrod algebra    |   Work issues:              
Report Upstream:  N/A                 |     Reviewers:              
        Authors:  Christian Nassau    |     Merged in:              
   Dependencies:                      |      Stopgaps:              
--------------------------------------+-------------------------------------

Comment (by jhpalmieri):

 Perhaps for another ticket: I think your code reveals a bug. What do you
 think about this change:
 {{{
 #!diff
 diff --git a/sage/algebras/steenrod/steenrod_algebra.py
 b/sage/algebras/steenrod/steenrod_algebra.py
 --- a/sage/algebras/steenrod/steenrod_algebra.py
 +++ b/sage/algebras/steenrod/steenrod_algebra.py
 @@ -2008,8 +2008,9 @@
              else:
                  a = x.milnor()
                  if self.basis_name() == 'milnor':
 -                    return a
 -                return a.change_basis(self.basis_name())
 +                    return self._from_dict(a.monomial_coefficients(),
 coerce=True)
 +                a = a.change_basis(self.basis_name())
 +                return self._from_dict(a.monomial_coefficients(),
 coerce=True)
          raise ValueError("Element does not lie in this Steenrod algebra")

      def __contains__(self, x):
 }}}
 As it stands:
 {{{
 sage: SteenrodAlgebra(2,profile=(3,2,1), basis='pst')(Sq(4)).parent()
 mod 2 Steenrod algebra, pst_revz basis
 }}}
 With the change:
 {{{
 sage: SteenrodAlgebra(2,profile=(3,2,1), basis='pst')(Sq(4)).parent()
 sub-Hopf algebra of mod 2 Steenrod algebra, pst_revz basis, profile
 function [3, 2, 1]
 }}}
 My suggested patch would need some doctests, but it would also allow you
 to change your last line:
 {{{
 #!diff
 diff --git a/sage/algebras/steenrod/steenrod_algebra.py
 b/sage/algebras/steenrod/steenrod_algebra.py
 --- a/sage/algebras/steenrod/steenrod_algebra.py
 +++ b/sage/algebras/steenrod/steenrod_algebra.py
 @@ -2821,7 +2822,7 @@
              e = [k for k in range(0,len(ep)) if ep[k]==2]
              r = [p**k-1 for k in rp]
              ans = AM.monomial((tuple(e),tuple(r)))
 -        return self(ans.change_basis(self.basis_name()))
 +        return self(ans)

      def order(self):
          r"""
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13856#comment:4>
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to