Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
src/sage/algebras/steenrod/steenrod_algebra.py: Use key=...tuple(....…
Browse files Browse the repository at this point in the history
…support()) for sorting by lex support
  • Loading branch information
Matthias Koeppe committed Sep 11, 2022
1 parent 88fe278 commit 026d8a5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/sage/algebras/steenrod/steenrod_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,13 +402,13 @@
(1, (2, 1))
sage: c.monomial_coefficients() == {(2, 1): 1, (5,): 1}
True
sage: sorted(c.monomials(), key=lambda x: x.support())
sage: sorted(c.monomials(), key=lambda x: tuple(x.support()))
[Sq(2,1), Sq(5)]
sage: sorted(c.support())
[(2, 1), (5,)]
sage: Adem = SteenrodAlgebra(basis='adem')
sage: elt = Adem.Sq(10) + Adem.Sq(9) * Adem.Sq(1)
sage: sorted(elt.monomials(), key=lambda x: x.support())
sage: sorted(elt.monomials(), key=lambda x: tuple(x.support()))
[Sq^9 Sq^1, Sq^10]
sage: A7 = SteenrodAlgebra(p=7)
Expand Down Expand Up @@ -3100,7 +3100,7 @@ class Element(CombinatorialFreeModule.Element):
(1, (2, 1))
sage: c.monomial_coefficients() == {(2, 1): 1, (5,): 1}
True
sage: sorted(c.monomials(), key=lambda x: x.support())
sage: sorted(c.monomials(), key=lambda x: tuple(x.support()))
[Sq(2,1), Sq(5)]
sage: sorted(c.support())
[(2, 1), (5,)]
Expand Down Expand Up @@ -3458,7 +3458,7 @@ def excess(self):
sage: (Sq(0,0,1) + Sq(4,1) + Sq(7)).excess()
1
sage: elt = Sq(0,0,1) + Sq(4,1) + Sq(7)
sage: M = sorted(elt.monomials(), key=lambda x: x.support())
sage: M = sorted(elt.monomials(), key=lambda x: tuple(x.support()))
sage: [m.excess() for m in M]
[1, 5, 7]
sage: [m for m in M]
Expand Down

0 comments on commit 026d8a5

Please sign in to comment.