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

Commit

Permalink
Add examples and fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorkarn committed Oct 15, 2022
1 parent a1f8e8a commit 6f729f4
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/sage/combinat/permutation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2994,6 +2994,15 @@ def reduced_word_lexmin(self):
def rothe_diagram(self):
r"""
Return the Rothe diagram of ``self``.
EXAMPLES::
sage: w = Permutation([1,4,3,2])
sage: w.rothe_diagram().pp()
. . . .
. O O .
. O . .
. . . .
"""
from sage.combinat.diagram import RotheDiagram
return RotheDiagram(self)
Expand All @@ -3002,9 +3011,14 @@ def n_reduced_words(self):
r"""
Return the number of reduced words of ``self`` without explicitly
computing them all.
EXAMPLES::
sage: w = Permutation([1,4,3,2])
sage: w.n_reduced_words()
2
"""
Tx = self.rothe_diagram().peelable_tableaux()

return sum(map(_tableau_contribution, Tx))

def stanley_symmetric_function(self):
Expand Down Expand Up @@ -5282,7 +5296,10 @@ def _tableau_contribution(T):
r"""
Get the number of SYT of shape(``T``).
"""
from sage.combinat.tableau import StandardTableaux
return(StandardTableaux(T.shape()).cardinality())


################################################################
# Parent classes
################################################################
Expand Down

0 comments on commit 6f729f4

Please sign in to comment.