Skip to content
This repository was archived by the owner on Feb 1, 2023. It is now read-only.

Commit cf92498

Browse files
author
Release Manager
committed
Trac #29525: SSTPosets are lattices
https://doc.sagemath.org/html/en/reference/combinat/sage/combinat/posets /poset_examples.html#sage.combinat.posets.poset_examples.Posets.SSTPoset : > static SSTPoset(s, f=None) > The poset on semistandard tableaux of shape s and largest entry f that is ordered by componentwise comparison of the entries. This isn't just some finite poset; it's a lattice, with minimum and maximum being defined entrywise. That should be in the code and in the doc. Any volunteers? (My Sage isn't working and I have a long to-do list of papers right now, so I pass.) URL: https://trac.sagemath.org/29525 Reported by: gh-darijgr Ticket author(s): Frédéric Chapoton Reviewer(s): Darij Grinberg
2 parents bc4b0ec + de3ea1f commit cf92498

File tree

1 file changed

+11
-19
lines changed

1 file changed

+11
-19
lines changed

src/sage/combinat/posets/poset_examples.py

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -933,7 +933,7 @@ def covers(x):
933933
@staticmethod
934934
def SSTPoset(s, f=None):
935935
"""
936-
The poset on semistandard tableaux of shape ``s`` and largest
936+
The lattice poset on semistandard tableaux of shape ``s`` and largest
937937
entry ``f`` that is ordered by componentwise comparison of the
938938
entries.
939939
@@ -945,16 +945,18 @@ def SSTPoset(s, f=None):
945945
argument. If no maximal number is given, it will use
946946
the number of cells in the shape.
947947
948-
NOTE: This is a basic implementation and most certainly
949-
not the most efficient.
948+
.. NOTE::
949+
950+
This is a basic implementation and most certainly
951+
not the most efficient.
950952
951953
EXAMPLES::
952954
953955
sage: posets.SSTPoset([2,1])
954-
Finite poset containing 8 elements
956+
Finite lattice containing 8 elements
955957
956958
sage: posets.SSTPoset([2,1],4)
957-
Finite poset containing 20 elements
959+
Finite lattice containing 20 elements
958960
959961
sage: posets.SSTPoset([2,1],2).cover_relations()
960962
[[[[1, 1], [2]], [[1, 2], [2]]]]
@@ -968,22 +970,12 @@ def SSTPoset(s, f=None):
968970
from sage.combinat.tableau import SemistandardTableaux
969971

970972
def tableaux_is_less_than(a, b):
971-
atstring = []
972-
btstring = []
973-
for i in a:
974-
atstring += i
975-
for i in b:
976-
btstring += i
977-
for i in range(len(atstring)):
978-
if atstring[i] > btstring[i]:
979-
return False
980-
return True
973+
return all(ix <= iy for x, y in zip(a, b) for ix, iy in zip(x, y))
974+
981975
if f is None:
982-
f=0
983-
for i in s:
984-
f += i
976+
f = sum(i for i in s)
985977
E = SemistandardTableaux(s, max_entry=f)
986-
return Poset((E, tableaux_is_less_than))
978+
return LatticePoset((E, tableaux_is_less_than))
987979

988980
@staticmethod
989981
def StandardExample(n, facade=None):

0 commit comments

Comments
 (0)