Skip to content

Commit eed72b2

Browse files
committed
Fixing the iterator of SemistandardMultiSkewTableaux.
1 parent 6ea1fe9 commit eed72b2

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

src/sage/combinat/ribbon_tableau.py

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,7 +1083,9 @@ def __contains__(self, x):
10831083
return all(xi.is_semistandard() for xi in x)
10841084

10851085
def __iter__(self):
1086-
"""
1086+
r"""
1087+
Iterate over ``self``.
1088+
10871089
EXAMPLES::
10881090
10891091
sage: sp = SkewPartitions(3).list()
@@ -1098,6 +1100,21 @@ def __iter__(self):
10981100
34
10991101
sage: RibbonTableaux(a,weight,k).cardinality()
11001102
34
1103+
1104+
TESTS:
1105+
1106+
Check that :issue:`36196` is fixed::
1107+
1108+
sage: shapes = [[[1], [0]], [[1], [0]], [[1], [0]]]
1109+
sage: weight = [1, 1, 1]
1110+
sage: SMST = SemistandardMultiSkewTableaux(shapes, weight)
1111+
sage: list(SMST)
1112+
[[[[1]], [[2]], [[3]]],
1113+
[[[2]], [[1]], [[3]]],
1114+
[[[1]], [[3]], [[2]]],
1115+
[[[2]], [[3]], [[1]]],
1116+
[[[3]], [[1]], [[2]]],
1117+
[[[3]], [[2]], [[1]]]]
11011118
"""
11021119
parts = self._shape
11031120
mu = self._weight
@@ -1122,9 +1139,12 @@ def __iter__(self):
11221139
S = SkewTableaux()
11231140
for lk in l:
11241141
pos = 0 # Double check this
1125-
restmp = [S.from_shape_and_word(parts[0], [lk[j] for j in range(s[0])])]
1142+
lk = list(lk)
1143+
w = lk[:s[0]]
1144+
restmp = [S.from_shape_and_word(parts[0], w)]
11261145
for i in range(1, len(parts)):
1127-
w = [lk[j] for j in range(pos + s[i - 1], pos + s[i - 1] + s[i])]
1146+
pos += s[i-1]
1147+
w = lk[pos: pos + s[i]]
11281148
restmp.append(S.from_shape_and_word(parts[i], w))
11291149
yield self.element_class(self, restmp)
11301150

0 commit comments

Comments
 (0)