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 13, 2022
1 parent e37448e commit 6056efd
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 @@ -3002,6 +3002,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 @@ -3010,9 +3019,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))

################
Expand Down Expand Up @@ -5267,7 +5281,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 6056efd

Please sign in to comment.