Skip to content

Commit

Permalink
Fixing the iterator of SemistandardMultiSkewTableaux.
Browse files Browse the repository at this point in the history
  • Loading branch information
tscrim committed Sep 7, 2023
1 parent 6ea1fe9 commit eed72b2
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions src/sage/combinat/ribbon_tableau.py
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,9 @@ def __contains__(self, x):
return all(xi.is_semistandard() for xi in x)

def __iter__(self):
"""
r"""
Iterate over ``self``.
EXAMPLES::
sage: sp = SkewPartitions(3).list()
Expand All @@ -1098,6 +1100,21 @@ def __iter__(self):
34
sage: RibbonTableaux(a,weight,k).cardinality()
34
TESTS:
Check that :issue:`36196` is fixed::
sage: shapes = [[[1], [0]], [[1], [0]], [[1], [0]]]
sage: weight = [1, 1, 1]
sage: SMST = SemistandardMultiSkewTableaux(shapes, weight)
sage: list(SMST)
[[[[1]], [[2]], [[3]]],
[[[2]], [[1]], [[3]]],
[[[1]], [[3]], [[2]]],
[[[2]], [[3]], [[1]]],
[[[3]], [[1]], [[2]]],
[[[3]], [[2]], [[1]]]]
"""
parts = self._shape
mu = self._weight
Expand All @@ -1122,9 +1139,12 @@ def __iter__(self):
S = SkewTableaux()
for lk in l:
pos = 0 # Double check this
restmp = [S.from_shape_and_word(parts[0], [lk[j] for j in range(s[0])])]
lk = list(lk)
w = lk[:s[0]]
restmp = [S.from_shape_and_word(parts[0], w)]
for i in range(1, len(parts)):
w = [lk[j] for j in range(pos + s[i - 1], pos + s[i - 1] + s[i])]
pos += s[i-1]
w = lk[pos: pos + s[i]]
restmp.append(S.from_shape_and_word(parts[i], w))
yield self.element_class(self, restmp)

Expand Down

0 comments on commit eed72b2

Please sign in to comment.