AUTHORS:
This file consists of the following major classes:
Element classes:
Factory classes:
Parent classes:
For display options, see Tableaux.global_options().
Bases: sage.combinat.tableau.Tableau
A class to model a semistandard tableau.
INPUT:
OUTPUT:
A semistandard tableau is a tableau whose entries are positive integers, which are weakly increasing in rows and strictly increasing down columns.
EXAMPLES:
sage: t = SemistandardTableau([[1,2,3],[2,3]]); t
[[1, 2, 3], [2, 3]]
sage: t.shape()
[3, 2]
sage: t.pp() # pretty print
1 2 3
2 3
sage: t = Tableau([[1,2],[2]])
sage: s = SemistandardTableau(t); s
[[1, 2], [2]]
sage: SemistandardTableau([]) # The empty tableau
[]
When using code that will generate a lot of tableaux, it is slightly more efficient to construct a SemistandardTableau from the appropriate Parent object:
sage: SST = SemistandardTableaux()
sage: SST([[1, 2, 3], [4, 5]])
[[1, 2, 3], [4, 5]]
TESTS:
sage: SemistandardTableau([[1,2,3],[1]])
Traceback (most recent call last):
...
ValueError: [[1, 2, 3], [1]] is not a column strict tableau
sage: SemistandardTableau([[1,2,1]])
Traceback (most recent call last):
...
ValueError: The rows of [[1, 2, 1]] are not weakly increasing
sage: SemistandardTableau([[0,1]])
Traceback (most recent call last):
...
ValueError: entries must be positive integers
Bases: sage.combinat.tableau.Tableaux
A factory class for the various classes of semistandard tableaux.
INPUT:
Keyword arguments:
Positional arguments:
OUTPUT:
A semistandard tableau is a tableau whose entries are positive integers, which are weakly increasing in rows and strictly increasing down columns. Note that Sage uses the English convention for partitions and tableaux; the longer rows are displayed on top.
Classes of semistandard tableaux can be iterated over if and only if there is some restriction.
EXAMPLES:
sage: SST = SemistandardTableaux([2,1]); SST
Semistandard tableaux of shape [2, 1] and maximum entry 3
sage: SST.list()
[[[1, 1], [2]],
[[1, 1], [3]],
[[1, 2], [2]],
[[1, 2], [3]],
[[1, 3], [2]],
[[1, 3], [3]],
[[2, 2], [3]],
[[2, 3], [3]]]
sage: SST = SemistandardTableaux(3); SST
Semistandard tableaux of size 3 and maximum entry 3
sage: SST.list()
[[[1, 1, 1]],
[[1, 1, 2]],
[[1, 1, 3]],
[[1, 2, 2]],
[[1, 2, 3]],
[[1, 3, 3]],
[[2, 2, 2]],
[[2, 2, 3]],
[[2, 3, 3]],
[[3, 3, 3]],
[[1, 1], [2]],
[[1, 1], [3]],
[[1, 2], [2]],
[[1, 2], [3]],
[[1, 3], [2]],
[[1, 3], [3]],
[[2, 2], [3]],
[[2, 3], [3]],
[[1], [2], [3]]]
sage: SST = SemistandardTableaux(3, max_entry=2); SST
Semistandard tableaux of size 3 and maximum entry 2
sage: SST.list()
[[[1, 1, 1]],
[[1, 1, 2]],
[[1, 2, 2]],
[[2, 2, 2]],
[[1, 1], [2]],
[[1, 2], [2]]]
sage: SST = SemistandardTableaux(3, max_entry=oo); SST
Semistandard tableaux of size 3
sage: SST[123]
[[3, 4], [6]]
sage: SemistandardTableaux(max_entry=2)[11]
[[1, 1], [2]]
sage: SemistandardTableaux()[0]
[]
alias of SemistandardTableau
Bases: sage.combinat.tableau.SemistandardTableaux, sage.sets.disjoint_union_enumerated_sets.DisjointUnionEnumeratedSets
All semistandard tableaux.
Warning
Input is not checked; please use SemistandardTableaux to ensure the options are properly parsed.
TESTS:
sage: SemistandardTableaux().list()
Traceback (most recent call last):
...
NotImplementedError
Bases: sage.combinat.tableau.SemistandardTableaux
Semistandard tableaux of fixed shape with a given max entry.
A semistandard tableau with max entry is required to have all
its entries less or equal to
. It is not required to actually
contain an entry
.
INPUT:
Warning
Input is not checked; please use SemistandardTableaux to ensure the options are properly parsed.
Returns the cardinality of self.
EXAMPLES:
sage: SemistandardTableaux([2,1]).cardinality()
8
sage: SemistandardTableaux([2,2,1]).cardinality()
75
sage: SymmetricFunctions(QQ).schur()([2,2,1]).expand(5)(1,1,1,1,1) # cross check
75
sage: SemistandardTableaux([5]).cardinality()
126
sage: SemistandardTableaux([3,2,1]).cardinality()
896
sage: SemistandardTableaux([3,2,1], max_entry=7).cardinality()
2352
Bases: sage.combinat.tableau.SemistandardTableaux
Semistandard tableaux of fixed shape and no maximum entry.
Warning
Input is not checked; please use SemistandardTableaux to ensure the options are properly parsed.
Bases: sage.combinat.tableau.SemistandardTableaux_shape
Semistandard tableaux of fixed shape and weight
.
Warning
Input is not checked; please use SemistandardTableaux to ensure the options are properly parsed.
Returns the number of semistandard tableaux of the given shape and weight, as computed by kostka_number function of symmetrica.
EXAMPLES:
sage: SemistandardTableaux([2,2], [2, 1, 1]).cardinality()
1
sage: SemistandardTableaux([2,2,2], [2, 2, 1,1]).cardinality()
1
sage: SemistandardTableaux([2,2,2], [2, 2, 2]).cardinality()
1
sage: SemistandardTableaux([3,2,1], [2, 2, 2]).cardinality()
2
Return a list of all semistandard tableaux in self generated by symmetrica.
EXAMPLES:
sage: SemistandardTableaux([2,2], [2, 1, 1]).list()
[[[1, 1], [2, 3]]]
sage: SemistandardTableaux([2,2,2], [2, 2, 1,1]).list()
[[[1, 1], [2, 2], [3, 4]]]
sage: SemistandardTableaux([2,2,2], [2, 2, 2]).list()
[[[1, 1], [2, 2], [3, 3]]]
sage: SemistandardTableaux([3,2,1], [2, 2, 2]).list()
[[[1, 1, 2], [2, 3], [3]], [[1, 1, 3], [2, 2], [3]]]
Bases: sage.combinat.tableau.SemistandardTableaux
Semistandard tableaux of fixed size .
Warning
Input is not checked; please use SemistandardTableaux to ensure the options are properly parsed.
Return the cardinality of self.
EXAMPLES:
sage: SemistandardTableaux(3).cardinality()
19
sage: SemistandardTableaux(4).cardinality()
116
sage: SemistandardTableaux(4, max_entry=2).cardinality()
9
sage: SemistandardTableaux(4, max_entry=10).cardinality()
4225
sage: ns = range(1, 6)
sage: ssts = [ SemistandardTableaux(n) for n in ns ]
sage: all([sst.cardinality() == len(sst.list()) for sst in ssts])
True
Bases: sage.combinat.tableau.SemistandardTableaux
Semistandard tableaux of fixed size with no maximum entry.
Warning
Input is not checked; please use SemistandardTableaux to ensure the options are properly parsed.
TESTS:
sage: SemistandardTableaux(3, max_entry=oo).list()
Traceback (most recent call last):
...
NotImplementedError
Bases: sage.combinat.tableau.SemistandardTableaux
Semistandard tableaux of fixed size and weight
.
Warning
Input is not checked; please use SemistandardTableaux to ensure the options are properly parsed.
Return the cardinality of self.
EXAMPLES:
sage: SemistandardTableaux(3, [2,1]).cardinality()
2
sage: SemistandardTableaux(4, [2,2]).cardinality()
3
Bases: sage.combinat.tableau.SemistandardTableau
A class to model a standard tableau.
INPUT:
OUTPUT:
A standard tableau is a semistandard tableau whose entries are exactly the
positive integers from 1 to , where
is the size of the tableau.
EXAMPLES:
sage: t = StandardTableau([[1,2,3],[4,5]]); t
[[1, 2, 3], [4, 5]]
sage: t.shape()
[3, 2]
sage: t.pp() # pretty print
1 2 3
4 5
sage: t.is_standard()
True
sage: StandardTableau([]) # The empty tableau
[]
When using code that will generate a lot of tableaux, it is slightly more efficient to construct a StandardTableau from the appropriate Parent object:
sage: ST = StandardTableaux()
sage: ST([[1, 2, 3], [4, 5]])
[[1, 2, 3], [4, 5]]
Returns the content of k in a standard tableau. That is, if
k appears in row and column
of the tableau then we
return
.
The multicharge is a list of length 1 which gives an offset for all of the contents. It is included mainly for compatibility with TableauTuple.
EXAMPLES:
sage: StandardTableau([[1,2],[3,4]]).content(3)
-1
sage: StandardTableau([[1,2],[3,4]]).content(6)
Traceback (most recent call last):
...
ValueError: 6 does not appear in tableau
Return True if self dominates the tableau t. That is,
if the shape of the tableau restricted to dominates the shape of
t restricted to
, for
.
When the two tableaux have the same shape, then this ordering coincides with the Bruhat ordering for the corresponding permutations.
INPUT:
EXAMPLES:
sage: s=StandardTableau([[1,2,3],[4,5]])
sage: t=StandardTableau([[1,2],[3,5],[4]])
sage: s.dominates(t)
True
sage: t.dominates(s)
False
sage: all(StandardTableau(s).dominates(t) for t in StandardTableaux([3,2]))
True
sage: s.dominates([[1,2,3,4,5]])
False
An iterator for all the standard tableaux that can be obtained from self by removing a cell. Note that this iterates just over a single tableau (or nothing if self is empty).
EXAMPLES:
sage: t = StandardTableau([[1,2],[3]])
sage: [x for x in t.down()]
[[[1, 2]]]
sage: t = StandardTableau([])
sage: [x for x in t.down()]
[]
Return a list of all the standard tableaux that can be obtained from self by removing a cell. Note that this is just a singleton list if self is nonempty, and an empty list otherwise.
EXAMPLES:
sage: t = StandardTableau([[1,2],[3]])
sage: t.down_list()
[[[1, 2]]]
sage: t = StandardTableau([])
sage: t.down_list()
[]
Return True since self is a standard tableau.
EXAMPLES:
sage: StandardTableau([[1, 3], [2, 4]]).is_standard()
True
Return the image of self under the promotion operator.
The promotion operator, applied to a standard tableau , does the
following:
Remove the letter from
, thus leaving a hole where it used to be.
Apply jeu de taquin to move this hole southwest (in French notation)
until it reaches the inner boundary of
. Fill
into the hole once
jeu de taquin has completed. Finally, add
to each letter in the
tableau. The resulting standard tableau is the image of
under the
promotion operator.
This definition of promotion is precisely the one given in [Hai1992] (p. 90). It is the inverse of the maps called “promotion” in [Sg2011] (p. 23) and in [Stan2009].
See the promotion() method for a more general operator.
EXAMPLES:
sage: ST = StandardTableaux(7)
sage: all( st.promotion().promotion_inverse() == st for st in ST ) # long time
True
sage: all( st.promotion_inverse().promotion() == st for st in ST ) # long time
True
sage: st = StandardTableau([[1,2,5],[3,4]])
sage: parent(st.promotion())
Standard tableaux
Return the image of self under the inverse promotion operator.
The optional variable should be set to the size of self minus
for a minimal speedup; otherwise, it defaults to this number.
The inverse promotion operator, applied to a standard tableau ,
does the following:
Remove the letter from
, thus leaving a hole where it used to be.
Apply jeu de taquin to move this hole northeast (in French notation)
until it reaches the outer boundary of
. Fill
into this hole,
where
is the size of
. Finally, subtract
from each letter in
the tableau. This yields a new standard tableau.
This definition of inverse promotion is the map called “promotion” in [Sg2011] (p. 23) and in [Stan2009], and is the inverse of the map called “promotion” in [Hai1992] (p. 90).
See the promotion_inverse() method for a more general operator.
EXAMPLES:
sage: t = StandardTableau([[1,3],[2,4]])
sage: t.promotion_inverse()
[[1, 2], [3, 4]]
We check the equivalence of two definitions of inverse promotion on standard tableaux:
sage: ST = StandardTableaux(7)
sage: def bk_promotion_inverse7(st):
....: st2 = st
....: for i in range(1, 7):
....: st2 = st2.bender_knuth_involution(i, check=False)
....: return st2
sage: all( bk_promotion_inverse7(st) == st.promotion_inverse() for st in ST ) # long time
True
Return a list of the integers such that
appears
strictly further north than
in self (this is not
to say that
and
must be in the same column). The
list is sorted in increasing order.
EXAMPLES:
sage: StandardTableau( [[1,3,4],[2,5]] ).standard_descents()
[1, 4]
sage: StandardTableau( [[1,2],[3,4]] ).standard_descents()
[2]
sage: StandardTableau( [[1,2,5],[3,4],[6,7],[8],[9]] ).standard_descents()
[2, 5, 7, 8]
sage: StandardTableau( [] ).standard_descents()
[]
Return the major index of the standard tableau self in the standard meaning of the word. The major index is defined to be the sum of the descents of self (see standard_descents() for their definition).
EXAMPLES:
sage: StandardTableau( [[1,4,5],[2,6],[3]] ).standard_major_index()
8
sage: StandardTableau( [[1,2],[3,4]] ).standard_major_index()
2
sage: StandardTableau( [[1,2,3],[4,5]] ).standard_major_index()
3
Return the number of all integers such that
appears
strictly further north than
in self (this is not
to say that
and
must be in the same column). A
list of these integers can be obtained using the
standard_descents() method.
EXAMPLES:
sage: StandardTableau( [[1,2],[3,4],[5]] ).standard_number_of_descents()
2
sage: StandardTableau( [] ).standard_number_of_descents()
0
sage: tabs = StandardTableaux(5)
sage: all( t.standard_number_of_descents() == t.schuetzenberger_involution().standard_number_of_descents() for t in tabs )
True
An iterator for all the standard tableaux that can be obtained from self by adding a cell.
EXAMPLES:
sage: t = StandardTableau([[1,2]])
sage: [x for x in t.up()]
[[[1, 2, 3]], [[1, 2], [3]]]
Return a list of all the standard tableaux that can be obtained from self by adding a cell.
EXAMPLES:
sage: t = StandardTableau([[1,2]])
sage: t.up_list()
[[[1, 2, 3]], [[1, 2], [3]]]
Bases: sage.combinat.tableau.SemistandardTableaux
A factory for the various classes of standard tableaux.
INPUT:
OUTPUT:
A standard tableau is a semistandard tableaux which contains each of the entries from 1 to n exactly once.
All classes of standard tableaux are iterable.
EXAMPLES:
sage: ST = StandardTableaux(3); ST
Standard tableaux of size 3
sage: ST.first()
[[1, 2, 3]]
sage: ST.last()
[[1], [2], [3]]
sage: ST.cardinality()
4
sage: ST.list()
[[[1, 2, 3]], [[1, 3], [2]], [[1, 2], [3]], [[1], [2], [3]]]
TESTS:
sage: StandardTableaux()([])
[]
sage: ST = StandardTableaux([2,2]); ST
Standard tableaux of shape [2, 2]
sage: ST.first()
[[1, 3], [2, 4]]
sage: ST.last()
[[1, 2], [3, 4]]
sage: ST.cardinality()
2
sage: ST.list()
[[[1, 3], [2, 4]], [[1, 2], [3, 4]]]
alias of StandardTableau
Bases: sage.combinat.tableau.StandardTableaux, sage.sets.disjoint_union_enumerated_sets.DisjointUnionEnumeratedSets
All standard tableaux.
Bases: sage.combinat.tableau.StandardTableaux
Semistandard tableaux of a fixed shape .
Warning
Input is not checked; please use SemistandardTableaux to ensure the options are properly parsed.
Return the number of standard Young tableaux of this shape.
This method uses the so-called hook length formula, a formula
for the number of Young tableaux associated with a given
partition. The formula says the following: Let be a
partition. For each cell
of the Young diagram of
,
let the hook length of
be defined as
plus the number of
cells horizontally to the right of
plus the number of cells
vertically below
. The number of standard Young tableaux of
shape
is then
divided by the product of the hook
lengths of the shape of
, where
.
For example, consider the partition [3,2,1] of 6 with Ferrers diagram:
# # #
# #
#
When we fill in the cells with their respective hook lengths, we obtain:
5 3 1
3 1
1
The hook length formula returns
EXAMPLES:
sage: StandardTableaux([3,2,1]).cardinality()
16
sage: StandardTableaux([2,2]).cardinality()
2
sage: StandardTableaux([5]).cardinality()
1
sage: StandardTableaux([6,5,5,3]).cardinality()
6651216
sage: StandardTableaux([]).cardinality()
1
REFERENCES:
Return a list of the standard Young tableaux of the specified shape.
EXAMPLES:
sage: StandardTableaux([2,2]).list()
[[[1, 3], [2, 4]], [[1, 2], [3, 4]]]
sage: StandardTableaux([5]).list()
[[[1, 2, 3, 4, 5]]]
sage: StandardTableaux([3,2,1]).list()
[[[1, 4, 6], [2, 5], [3]],
[[1, 3, 6], [2, 5], [4]],
[[1, 2, 6], [3, 5], [4]],
[[1, 3, 6], [2, 4], [5]],
[[1, 2, 6], [3, 4], [5]],
[[1, 4, 5], [2, 6], [3]],
[[1, 3, 5], [2, 6], [4]],
[[1, 2, 5], [3, 6], [4]],
[[1, 3, 4], [2, 6], [5]],
[[1, 2, 4], [3, 6], [5]],
[[1, 2, 3], [4, 6], [5]],
[[1, 3, 5], [2, 4], [6]],
[[1, 2, 5], [3, 4], [6]],
[[1, 3, 4], [2, 5], [6]],
[[1, 2, 4], [3, 5], [6]],
[[1, 2, 3], [4, 5], [6]]]
Return a random standard tableau of the given shape using the Greene-Nijenhuis-Wilf Algorithm.
EXAMPLES:
sage: StandardTableaux([2,2]).random_element()
[[1, 2], [3, 4]]
sage: StandardTableaux([]).random_element()
[]
Bases: sage.combinat.tableau.StandardTableaux
Standard tableaux of fixed size .
Warning
Input is not checked; please use StandardTableaux to ensure the options are properly parsed.
Return the number of all standard tableaux of size n.
The number of standard tableaux of size is equal to the
number of involutions in the symmetric group
.
This is a consequence of the symmetry of the RSK
correspondence, that if
, then
. For more information, see
Wikipedia article Robinson-Schensted-Knuth_correspondence#Symmetry.
ALGORITHM:
The algorithm uses the fact that standard tableaux of size n are in bijection with the involutions of size n, (see page 41 in section 4.1 of [Ful1997]). For each number of fixed points, you count the number of ways to choose those fixed points multiplied by the number of perfect matchings on the remaining values.
REFERENCES:
[Ful1997] | (1, 2, 3) William Fulton, Young Tableaux. Cambridge University Press, 1997. |
EXAMPLES:
sage: StandardTableaux(3).cardinality()
4
sage: ns = [1,2,3,4,5,6]
sage: sts = [StandardTableaux(n) for n in ns]
sage: all([st.cardinality() == len(st.list()) for st in sts])
True
sage: StandardTableaux(50).cardinality()
27886995605342342839104615869259776
TESTS:
sage: def cardinality_using_hook_formula(n):
....: c = 0
....: for p in Partitions(n):
....: c += StandardTableaux(p).cardinality()
....: return c
sage: all([cardinality_using_hook_formula(i) == StandardTableaux(i).cardinality() for i in range(10)])
True
Return a random StandardTableau with uniform probability.
This algorithm uses the fact that the Robinson-Schensted correspondence returns a pair of identical standard Young tableaux (SYTs) if and only if the permutation was an involution. Thus, generating a random SYT is equivalent to generating a random involution.
To generate an involution, we first need to choose its number of
fixed points (if the size of the involution is even, the
number of fixed points will be even, and if the size is odd, the
number of fixed points will be odd). To do this, we choose a
random integer
between 0 and the number
of all
involutions of size
. We then decompose the interval
into subintervals whose lengths are the
numbers of involutions of size
with respectively
,
,
,
fixed points. The
interval in which our random integer
lies then decides how
many fixed points our random involution will have. We then
place those fixed points randomly and then compute a perfect
matching (an involution without fixed points) on the remaining
values.
EXAMPLES:
sage: StandardTableaux(5).random_element() # random
[[1, 4, 5], [2], [3]]
sage: StandardTableaux(0).random_element()
[]
sage: StandardTableaux(1).random_element()
[[1]]
TESTS:
sage: all([StandardTableaux(10).random_element() in StandardTableaux(10) for i in range(20)])
True
Bases: sage.combinat.combinat.CombinatorialObject, sage.structure.element.Element
A class to model a tableau.
INPUT:
OUTPUT:
A tableau in Sage is a finite list of lists, whose lengths are weakly decreasing, or an empty list, representing the empty tableau. The entries of a tableau can be any sage object.
Note that Sage uses the English convention for partitions and tableaux; the longer rows are displayed on top.
EXAMPLES:
sage: t = Tableau([[1,2,3],[4,5]]); t
[[1, 2, 3], [4, 5]]
sage: t.shape()
[3, 2]
sage: t.pp() # pretty print
1 2 3
4 5
sage: t.is_standard()
True
sage: Tableau([['a','c','b'],[[],(2,1)]])
[['a', 'c', 'b'], [[], (2, 1)]]
sage: Tableau([]) # The empty tableau
[]
When using code that will generate a lot of tableaux, it is slightly more efficient to construct a Tableau from the appropriate Parent object:
sage: T = Tableaux()
sage: T([[1, 2, 3], [4, 5]])
[[1, 2, 3], [4, 5]]
TESTS:
sage: Tableau([[1],[2,3]])
Traceback (most recent call last):
...
ValueError: A tableau must be a list of lists of weakly decreasing length.
sage: Tableau([1,2,3])
Traceback (most recent call last):
...
ValueError: A tableau must be a list of lists.
Set the entry in cell equal to m. If the cell does not exist then extend the tableau, otherwise just replace the entry.
EXAMPLES:
sage: s=StandardTableau([[1,2,5],[3,4]]); s.pp()
1 2 5
3 4
sage: t=s.add_entry( (1,2), 6); t.pp()
1 2 5
3 4 6
sage: t.category()
Category of elements of Standard tableaux
sage: s.add_entry( (2,0), 6).pp()
1 2 5
3 4
6
sage: u=s.add_entry( (1,2), 3); u.pp()
1 2 5
3 4 3
sage: u.category()
Category of elements of Tableaux
sage: s.add_entry( (2,2),3)
Traceback (most recent call last):
...
IndexError: (2, 2) is not an addable cell of the tableau
Return the skew tableau formed by removing all of the cells from
self that are filled with a number at most .
EXAMPLES:
sage: t = Tableau([[1,2,3],[4,5]]); t
[[1, 2, 3], [4, 5]]
sage: t.anti_restrict(1)
[[None, 2, 3], [4, 5]]
sage: t.anti_restrict(2)
[[None, None, 3], [4, 5]]
sage: t.anti_restrict(3)
[[None, None, None], [4, 5]]
sage: t.anti_restrict(4)
[[None, None, None], [None, 5]]
sage: t.anti_restrict(5)
[[None, None, None], [None, None]]
EXAMPLES:
sage: Tableau([[1,2],[3,4]]).atom()
[2, 2]
sage: Tableau([[1,2,3],[4,5],[6]]).atom()
[3, 2, 1]
Deprecated in trac ticket #15327. Use T.shape().attacking_pairs() instead for a tableau T.
Return a list of the attacking pairs of self. A pair of
cells of a Young tableau is said to be attacking if one
of the following conditions holds:
This only depends on the shape of self, not on the entries.
EXAMPLES:
sage: t = Tableau([[1,2,3],[2,5]])
sage: t.attacking_pairs()
doctest:...: DeprecationWarning: attacking_pairs() is deprecated. Instead, use shape().attacking_pairs()
See http://trac.sagemath.org/15327 for details.
[((0, 0), (0, 1)),
((0, 0), (0, 2)),
((0, 1), (0, 2)),
((1, 0), (1, 1)),
((1, 1), (0, 0))]
Return the image of self under the -th Bender–Knuth
involution, assuming self is a semistandard tableau.
Let be a tableau, then a lower free `k` in `T` means a cell of
which is filled with the integer
and whose direct lower
neighbor is not filled with the integer
(in particular,
this lower neighbor might not exist at all). Let an upper free `k + 1`
in `T` mean a cell of
which is filled with the integer
and whose direct upper neighbor is not filled with the integer
(in particular, this neighbor might not exist at all). It is clear
that for any row
of
, the lower free
‘s and the upper
free
‘s in
together form a contiguous interval or
.
The `k`-th Bender–Knuth switch at row `i` changes the entries of
the cells in this interval in such a way that if it used to have
entries of
and
entries of
, it will now
have
entries of
and
entries of
. For fixed
, the
-th Bender–Knuth switches for different
commute. The
composition of the
-th Bender–Knuth switches for all rows is
called the `k`-th Bender-Knuth involution. This is used to show that
the Schur functions defined by semistandard tableaux are symmetric
functions.
INPUT:
OUTPUT:
The image of self under either the -th Bender–Knuth
involution, the
-th Bender–Knuth switch at a certain row, or
the composition of such switches, as detailed in the INPUT section.
EXAMPLES:
sage: t = Tableau([[1,1,3,4,4,5,6,7],[2,2,4,6,7,7,7],[3,4,5,8,8,9],[6,6,7,10],[7,8,8,11],[8]])
sage: t.bender_knuth_involution(1) == t
True
sage: t.bender_knuth_involution(2)
[[1, 1, 2, 4, 4, 5, 6, 7], [2, 3, 4, 6, 7, 7, 7], [3, 4, 5, 8, 8, 9], [6, 6, 7, 10], [7, 8, 8, 11], [8]]
sage: t.bender_knuth_involution(3)
[[1, 1, 3, 3, 3, 5, 6, 7], [2, 2, 4, 6, 7, 7, 7], [3, 4, 5, 8, 8, 9], [6, 6, 7, 10], [7, 8, 8, 11], [8]]
sage: t.bender_knuth_involution(4)
[[1, 1, 3, 4, 5, 5, 6, 7], [2, 2, 4, 6, 7, 7, 7], [3, 5, 5, 8, 8, 9], [6, 6, 7, 10], [7, 8, 8, 11], [8]]
sage: t.bender_knuth_involution(5)
[[1, 1, 3, 4, 4, 5, 6, 7], [2, 2, 4, 5, 7, 7, 7], [3, 4, 6, 8, 8, 9], [5, 5, 7, 10], [7, 8, 8, 11], [8]]
sage: t.bender_knuth_involution(666) == t
True
sage: t.bender_knuth_involution(4, 2) == t
True
sage: t.bender_knuth_involution(4, 3)
[[1, 1, 3, 4, 4, 5, 6, 7], [2, 2, 4, 6, 7, 7, 7], [3, 5, 5, 8, 8, 9], [6, 6, 7, 10], [7, 8, 8, 11], [8]]
The rows keyword can be an iterator:
sage: t.bender_knuth_involution(6, iter([1,2])) == t
False
sage: t.bender_knuth_involution(6, iter([3,4])) == t
True
The Bender–Knuth involution is an involution:
sage: T = SemistandardTableaux(shape=[3,1,1], max_entry=4)
sage: all(all(t.bender_knuth_involution(k).bender_knuth_involution(k) == t for k in range(1,5)) for t in T)
True
The same holds for the single switches:
sage: all(all(t.bender_knuth_involution(k, j).bender_knuth_involution(k, j) == t for k in range(1,5) for j in range(1, 5)) for t in T)
True
Locality of the Bender–Knuth involutions:
sage: all(all(t.bender_knuth_involution(k).bender_knuth_involution(l) == t.bender_knuth_involution(l).bender_knuth_involution(k) for k in range(1,5) for l in range(1,5) if abs(k - l) > 1) for t in T)
True
Coxeter relation of the Bender–Knuth involutions (they have the form
):
sage: p = lambda t, k: t.bender_knuth_involution(k).bender_knuth_involution(k + 1)
sage: all(all(p(p(p(p(p(p(t,k),k),k),k),k),k) == t for k in range(1,5)) for t in T)
True
TESTS:
sage: t = Tableau([])
sage: t.bender_knuth_involution(3)
[]
Insert x into self using Schensted’s row-bumping (or row-insertion) algorithm.
EXAMPLES:
sage: t = Tableau([[1,2],[3]])
sage: t.bump(1)
[[1, 1], [2], [3]]
sage: t
[[1, 2], [3]]
sage: t.bump(2)
[[1, 2, 2], [3]]
sage: t.bump(3)
[[1, 2, 3], [3]]
sage: t
[[1, 2], [3]]
sage: t = Tableau([[1,2,2,3],[2,3,5,5],[4,4,6],[5,6]])
sage: t.bump(2)
[[1, 2, 2, 2], [2, 3, 3, 5], [4, 4, 5], [5, 6, 6]]
Multiply two tableaux using Schensted’s bump.
This product makes the set of semistandard tableaux into an associative monoid. The empty tableau is the unit in this monoid. See pp. 11-12 of [Ful1997].
The same product operation is implemented in a different way in slide_multiply().
EXAMPLES:
sage: t = Tableau([[1,2,2,3],[2,3,5,5],[4,4,6],[5,6]])
sage: t2 = Tableau([[1,2],[3]])
sage: t.bump_multiply(t2)
[[1, 1, 2, 2, 3], [2, 2, 3, 5], [3, 4, 5], [4, 6, 6], [5]]
Remove the top row of self and insert it back in using column Schensted insertion (starting with the largest letter).
EXAMPLES:
sage: Tableau([]).catabolism()
[]
sage: Tableau([[1,2,3,4,5]]).catabolism()
[[1, 2, 3, 4, 5]]
sage: Tableau([[1,1,3,3],[2,3],[3]]).catabolism()
[[1, 1, 2, 3, 3, 3], [3]]
sage: Tableau([[1, 1, 2, 3, 3, 3], [3]]).catabolism()
[[1, 1, 2, 3, 3, 3, 3]]
EXAMPLES:
sage: t = Tableau([[1,1,3,3],[2,3],[3]])
sage: t.catabolism_projector([[4,2,1]])
[[1, 1, 3, 3], [2, 3], [3]]
sage: t.catabolism_projector([[1]])
[]
sage: t.catabolism_projector([[2,1],[1]])
[]
sage: t.catabolism_projector([[1,1],[4,1]])
[[1, 1, 3, 3], [2, 3], [3]]
Perform catabolism() on self until it returns a tableau consisting of a single row.
EXAMPLES:
sage: t = Tableau([[1,2,3,4,5,6,8],[7,9]])
sage: t.catabolism_sequence()
[[[1, 2, 3, 4, 5, 6, 8], [7, 9]],
[[1, 2, 3, 4, 5, 6, 7, 9], [8]],
[[1, 2, 3, 4, 5, 6, 7, 8], [9]],
[[1, 2, 3, 4, 5, 6, 7, 8, 9]]]
sage: Tableau([]).catabolism_sequence()
[[]]
Return a list of the coordinates of the cells of self.
Coordinates start at , so the northwesternmost cell (in
English notation) has coordinates
.
EXAMPLES:
sage: Tableau([[1,2],[3,4]]).cells()
[(0, 0), (0, 1), (1, 0), (1, 1)]
Return the list of cells in which the letter appears in the
tableau self. The list is ordered with cells appearing from
left to right.
Cells are given as pairs of coordinates , where both
rows and columns are counted from
(so
means the cell
lies in the leftmost column of the tableau, etc.).
EXAMPLES:
sage: t = Tableau([[1,1,3],[2,3,5],[4,5]])
sage: t.cells_containing(5)
[(2, 1), (1, 2)]
sage: t.cells_containing(4)
[(2, 0)]
sage: t.cells_containing(6)
[]
sage: t = Tableau([[1,1,2,4],[2,4,4],[4]])
sage: t.cells_containing(4)
[(2, 0), (1, 1), (1, 2), (0, 3)]
sage: t = Tableau([[1,1,2,8,9],[2,5,6,11],[3,7,7,13],[4,8,9],[5],[13],[14]])
sage: t.cells_containing(8)
[(3, 1), (0, 3)]
sage: Tableau([]).cells_containing(3)
[]
Return the charge of the reading word of self. See charge() for more information.
EXAMPLES:
sage: Tableau([[1,1],[2,2],[3]]).charge()
0
sage: Tableau([[1,1,3],[2,2]]).charge()
1
sage: Tableau([[1,1,2],[2],[3]]).charge()
1
sage: Tableau([[1,1,2],[2,3]]).charge()
2
sage: Tableau([[1,1,2,3],[2]]).charge()
2
sage: Tableau([[1,1,2,2],[3]]).charge()
3
sage: Tableau([[1,1,2,2,3]]).charge()
4
Return the cocharge of the reading word of self. See cocharge() for more information.
EXAMPLES:
sage: Tableau([[1,1],[2,2],[3]]).cocharge()
4
sage: Tableau([[1,1,3],[2,2]]).cocharge()
3
sage: Tableau([[1,1,2],[2],[3]]).cocharge()
3
sage: Tableau([[1,1,2],[2,3]]).cocharge()
2
sage: Tableau([[1,1,2,3],[2]]).cocharge()
2
sage: Tableau([[1,1,2,2],[3]]).cocharge()
1
sage: Tableau([[1,1,2,2,3]]).cocharge()
0
Return the PermutationGroup corresponding to the column stabilizer of self.
This assumes that every integer from to the size of self
appears exactly once in self.
EXAMPLES:
sage: cs = Tableau([[1,2,3],[4,5]]).column_stabilizer()
sage: cs.order() == factorial(2)*factorial(2)
True
sage: PermutationGroupElement([(1,3,2),(4,5)]) in cs
False
sage: PermutationGroupElement([(1,4)]) in cs
True
This function returns a list containing itself. It exists mainly for compatibility with TableauTuple as it allows constructions like the example below.
EXAMPLES:
sage: t = Tableau([[1,2,3],[4,5]]);
sage: for s in t.components(): print s.to_list()
[[1, 2, 3], [4, 5]]
Return the conjugate of self.
EXAMPLES:
sage: Tableau([[1,2],[3,4]]).conjugate()
[[1, 3], [2, 4]]
sage: c = StandardTableau([[1,2],[3,4]]).conjugate()
sage: c.parent()
Standard tableaux
Return the corners of the tableau self.
EXAMPLES:
sage: Tableau([[1, 4, 6], [2, 5], [3]]).corners()
[(0, 2), (1, 1), (2, 0)]
sage: Tableau([[1, 3], [2, 4]]).corners()
[(1, 1)]
Return a list of the cells (i,j) such that self[i][j] > self[i-1][j].
Warning
This is not to be confused with the descents of a standard tableau.
EXAMPLES:
sage: Tableau( [[1,4],[2,3]] ).descents()
[(1, 0)]
sage: Tableau( [[1,2],[3,4]] ).descents()
[(1, 0), (1, 1)]
sage: Tableau( [[1,2,3],[4,5]] ).descents()
[(1, 0), (1, 1)]
Return a list of all entries of self, in the order obtained by reading across the rows from top to bottom (in English notation).
EXAMPLES:
sage: t = Tableau([[1,3], [2]])
sage: t.entries()
[1, 3, 2]
Returns the entry of cell cell in the tableau self. Here,
cell should be given as a tuple of zero-based
coordinates (so the northwesternmost cell in English notation
is
).
EXAMPLES:
sage: t = Tableau([[1,2],[3,4]])
sage: t.entry( (0,0) )
1
sage: t.entry( (1,1) )
4
Return the weight of the tableau self. Trailing zeroes are omitted when returning the weight.
The weight of a tableau is the sequence
,
where
is the number of entries of
equal to
. This
sequence contains only finitely many nonzero entries.
The weight of a tableau is the same as the weight of the
reading word of
, for any reading order.
EXAMPLES:
sage: Tableau([[1,2],[3,4]]).weight()
[1, 1, 1, 1]
sage: Tableau([]).weight()
[]
sage: Tableau([[1,3,3,7],[4,2],[2,3]]).weight()
[1, 2, 3, 1, 0, 0, 1]
TESTS:
We check that this agrees with going to the word:
sage: t = Tableau([[1,3,4,7],[6,2],[2,3]])
sage: def by_word(T):
....: ed = T.to_word().evaluation_dict()
....: m = max(ed.keys()) + 1
....: return [ed.get(k,0) for k in range(1,m)]
sage: by_word(t) == t.weight()
True
sage: SST = SemistandardTableaux(shape=[3,1,1])
sage: all(by_word(t) == t.weight() for t in SST)
True
Return the number of flush segments in self, as in [S14].
Let and suppose
is the smallest integer
greater than
such that there exists an
-segment in the
-st row of
. A
-segment in the
-th row of
is
called flush if the leftmost box in the
-segment and the leftmost
box of the
-segment are in the same column of
. If, however,
no such
exists, then this
-segment is said to be flush if
the number of boxes in the
-segment is equal to
, where
and the shape of
is
. Denote the
number of flush
-segments in
by
.
EXAMPLES:
sage: t = Tableau([[1,1,2,3,5],[2,3,5,5],[3,4]])
sage: t.flush()
3
sage: B = crystals.Tableaux("A4",shape=[4,3,2,1])
sage: t = B[32].to_tableau()
sage: t.flush()
4
Return the height of self.
EXAMPLES:
sage: Tableau([[1,2,3],[4,5]]).height()
2
sage: Tableau([[1,2,3]]).height()
1
sage: Tableau([]).height()
0
Insert the word w into the tableau self letter by letter using Schensted insertion. By default, the word w is being processed from left to right, and the insertion used is row insertion. If the optional keyword left is set to True, the word w is being processed from right to left, and column insertion is used instead.
EXAMPLES:
sage: t0 = Tableau([])
sage: w = [1,1,2,3,3,3,3]
sage: t0.insert_word(w)
[[1, 1, 2, 3, 3, 3, 3]]
sage: t0.insert_word(w,left=True)
[[1, 1, 2, 3, 3, 3, 3]]
sage: w.reverse()
sage: t0.insert_word(w)
[[1, 1, 3, 3], [2, 3], [3]]
sage: t0.insert_word(w,left=True)
[[1, 1, 3, 3], [2, 3], [3]]
sage: t1 = Tableau([[1,3],[2]])
sage: t1.insert_word([4,5])
[[1, 3, 4, 5], [2]]
sage: t1.insert_word([4,5], left=True)
[[1, 3], [2, 5], [4]]
Return the inversion number of self.
The inversion number is defined to be the number of inversions of self minus the sum of the arm lengths of the descents of self (see the inversions() and descents() methods for the relevant definitions).
Warning
This has none of the meanings in which the word “inversion” is used in the theory of standard tableaux.
EXAMPLES:
sage: t = Tableau([[1,2,3],[2,5]])
sage: t.inversion_number()
0
sage: t = Tableau([[1,2,4],[3,5]])
sage: t.inversion_number()
0
Return a list of the inversions of self.
Let be a tableau. An inversion is an attacking pair
of
the shape of
(see
attacking_pairs() for
a definition of this) such that the entry of
in
is
greater than the entry of
.
Warning
Do not mistake this for the inversions of a standard tableau.
EXAMPLES:
sage: t = Tableau([[1,2,3],[2,5]])
sage: t.inversions()
[((1, 1), (0, 0))]
sage: t = Tableau([[1,4,3],[5,2],[2,6],[3]])
sage: t.inversions()
[((0, 1), (0, 2)), ((1, 0), (1, 1)), ((1, 1), (0, 0)), ((2, 1), (1, 0))]
Return True if self is a column strict tableau and False otherwise.
A tableau is column strict if the entries in each column are in (strictly) increasing order.
EXAMPLES:
sage: Tableau([[1, 3], [2, 4]]).is_column_strict()
True
sage: Tableau([[1, 2], [2, 4]]).is_column_strict()
True
sage: Tableau([[2, 3], [2, 4]]).is_column_strict()
False
sage: Tableau([[5, 3], [2, 4]]).is_column_strict()
False
sage: Tableau([[]]).is_column_strict()
True
sage: Tableau([[1, 4, 2]]).is_column_strict()
True
sage: Tableau([[1, 4, 2], [2, 5]]).is_column_strict()
True
sage: Tableau([[1, 4, 2], [2, 3]]).is_column_strict()
False
Return True if self is an increasing tableau and False otherwise.
A tableau is increasing if it is both row strict and column strict.
EXAMPLES:
sage: Tableau([[1, 3], [2, 4]]).is_increasing()
True
sage: Tableau([[1, 2], [2, 4]]).is_increasing()
True
sage: Tableau([[2, 3], [2, 4]]).is_increasing()
False
sage: Tableau([[5, 3], [2, 4]]).is_increasing()
False
sage: Tableau([[1, 2, 3], [2, 3], [3]]).is_increasing()
True
Checks whether self is a valid weak -tableau.
EXAMPLES:
sage: t = Tableau([[1,2,3],[2,3],[3]])
sage: t.is_k_tableau(3)
True
sage: t = Tableau([[1,1,3],[2,2],[3]])
sage: t.is_k_tableau(3)
False
Return True if self is a key tableau or False otherwise.
A tableau is a key tableau if the set of entries in the -th
column is a subset of the set of entries in the
-st column.
REFERENCES:
[LS90] | (1, 2) A. Lascoux, M.-P. Schutzenberger. Keys and standard bases, invariant theory and tableaux. IMA Volumes in Math and its Applications (D. Stanton, ED.). Southend on Sea, UK, 19 (1990). 125-144. |
[Willis10] | (1, 2) M. Willis. A direct way to find the right key of a semistandard Young tableau. Arxiv 1110.6184v1. |
EXAMPLES:
sage: t = Tableau([[1,1,1],[2,3],[3]])
sage: t.is_key_tableau()
True
sage: t = Tableau([[1,1,2],[2,3],[3]])
sage: t.is_key_tableau()
False
Return True if the tableau self is rectangular and False otherwise.
EXAMPLES:
sage: Tableau([[1,2],[3,4]]).is_rectangular()
True
sage: Tableau([[1,2,3],[4,5],[6]]).is_rectangular()
False
sage: Tableau([]).is_rectangular()
True
Return True if self is a row strict tableau and False otherwise.
A tableau is row strict if the entries in each row are in (strictly) increasing order.
EXAMPLES:
sage: Tableau([[1, 3], [2, 4]]).is_row_strict()
True
sage: Tableau([[1, 2], [2, 4]]).is_row_strict()
True
sage: Tableau([[2, 3], [2, 4]]).is_row_strict()
True
sage: Tableau([[5, 3], [2, 4]]).is_row_strict()
False
Return True if self is a standard tableau and False otherwise.
EXAMPLES:
sage: Tableau([[1, 3], [2, 4]]).is_standard()
True
sage: Tableau([[1, 2], [2, 4]]).is_standard()
False
sage: Tableau([[2, 3], [2, 4]]).is_standard()
False
sage: Tableau([[5, 3], [2, 4]]).is_standard()
False
Return the k-weight of self.
EXAMPLES:
sage: Tableau([[1,2],[2,3]]).k_weight(1)
[1, 1, 1]
sage: Tableau([[1,2],[2,3]]).k_weight(2)
[1, 2, 1]
sage: t = Tableau([[1,1,1,2,5],[2,3,6],[3],[4]])
sage: t.k_weight(1)
[2, 1, 1, 1, 1, 1]
sage: t.k_weight(2)
[3, 2, 2, 1, 1, 1]
sage: t.k_weight(3)
[3, 1, 2, 1, 1, 1]
sage: t.k_weight(4)
[3, 2, 2, 1, 1, 1]
sage: t.k_weight(5)
[3, 2, 2, 1, 1, 1]
Return the part-catabolism of self, where part is a partition (which can be just given as an array).
For a partition and a tableau
, the
-catabolism of
is defined by performing the following
steps.
EXAMPLES:
sage: Tableau([[1,1,3],[2,4,5]]).lambda_catabolism([2,1])
[[3, 5], [4]]
sage: t = Tableau([[1,1,3,3],[2,3],[3]])
sage: t.lambda_catabolism([])
[[1, 1, 3, 3], [2, 3], [3]]
sage: t.lambda_catabolism([1])
[[1, 2, 3, 3, 3], [3]]
sage: t.lambda_catabolism([1,1])
[[1, 3, 3, 3], [3]]
sage: t.lambda_catabolism([2,1])
[[3, 3, 3, 3]]
sage: t.lambda_catabolism([4,2,1])
[]
sage: t.lambda_catabolism([5,1])
[[3, 3]]
sage: t.lambda_catabolism([4,1])
[[3, 3]]
Return True if self is less than or equal to tab2 in the last letter ordering.
EXAMPLES:
sage: st = StandardTableaux([3,2])
sage: f = lambda b: 1 if b else 0
sage: matrix( [ [ f(t1.last_letter_lequal(t2)) for t2 in st] for t1 in st] )
[1 1 1 1 1]
[0 1 1 1 1]
[0 0 1 1 1]
[0 0 0 1 1]
[0 0 0 0 1]
Return the left key tableau of self.
The left key tableau of a tableau is the key tableau whose entries
are weakly lesser than the corresponding entries in
, and whose column
reading word is subject to certain conditions. See [LS90] for the full definition.
ALGORITHM:
The following algorithm follows [Willis10]. Note that if is a key tableau
then the output of the algorithm is
.
To compute the left key tableau of a tableau
we iterate over the columns
of
. Let
be the
-th column of
and iterate over the entires
in
from bottom to top. Initialize the corresponding entry
in
as the
largest entry in
. Scan the columns to the left of
and with each column
update
to be the lowest entry in that column which is weakly less than
.
Update
and all columns to the left by removing all scanned entries.
See also
EXAMPLES:
sage: t = Tableau([[1,2],[2,3]])
sage: t.left_key_tableau()
[[1, 1], [2, 2]]
sage: t = Tableau([[1,1,2,4],[2,3,3],[4],[5]])
sage: t.left_key_tableau()
[[1, 1, 1, 2], [2, 2, 2], [4], [5]]
TESTS:
We check that if we have a key tableau, we return the same tableau:
sage: t = Tableau([[1,1,1,2], [2,2,2], [4], [5]])
sage: t.is_key_tableau()
True
sage: t.left_key_tableau() == t
True
Returns the level of self, which is always 1.
This function exists mainly for compatibility with TableauTuple.
EXAMPLE:
sage: Tableau([[1,2,3],[4,5]]).level()
1
Return the major index of self.
The major index of a tableau is defined to be the sum of the number
of descents of T (defined in descents()) with the sum of
their legs’ lengths.
Warning
This is not to be confused with the major index of a standard tableau.
EXAMPLES:
sage: Tableau( [[1,4],[2,3]] ).major_index()
1
sage: Tableau( [[1,2],[3,4]] ).major_index()
2
If the major index would be defined in the sense of standard tableaux theory, then the following would give 3 for a result:
sage: Tableau( [[1,2,3],[4,5]] ).major_index()
2
Returns a pretty print string of the tableau.
EXAMPLES:
sage: T = Tableau([[1,2,3],[3,4],[5]])
sage: T.pp()
1 2 3
3 4
5
sage: Tableaux.global_options(convention="french")
sage: T.pp()
5
3 4
1 2 3
sage: Tableaux.global_options.reset()
Return the image of self under the promotion operator.
Warning
You might know this operator as the inverse promotion operator – literature does not agree on the name. You might also be looking for the Lapointe-Lascoux-Morse promotion operator (promotion_operator()).
The promotion operator, applied to a tableau , does the following:
Iterate over all letters in the tableau
, from left to right.
For each of these letters, do the following:
Once this all is done, add to each letter in the tableau.
This is not always well-defined. Restricted to the class of
semistandard tableaux whose entries are all
, this is the
usual promotion operator defined on this class.
When self is a standard tableau of size n + 1, this definition of promotion is precisely the one given in [Hai1992] (p. 90). It is the inverse of the maps called “promotion” in [Sg2011] (p. 23) and in [Stan2009].
Warning
To my (Darij’s) knowledge, the fact that the above promotion operator really is the inverse of the “inverse promotion operator” promotion_inverse() for semistandard tableaux has never been proven in literature. Corrections are welcome.
REFERENCES:
[Hai1992] | (1, 2, 3, 4) Mark D. Haiman, Dual equivalence with applications, including a conjecture of Proctor, Discrete Mathematics 99 (1992), 79-113, http://www.sciencedirect.com/science/article/pii/0012365X9290368P |
[Sg2011] | (1, 2, 3, 4) Bruce E. Sagan, The cyclic sieving phenomenon: a survey, Arxiv 1008.0790v3 |
EXAMPLES:
sage: t = Tableau([[1,2],[3,3]])
sage: t.promotion(2)
[[1, 1], [2, 3]]
sage: t = Tableau([[1,1,1],[2,2,3],[3,4,4]])
sage: t.promotion(3)
[[1, 1, 2], [2, 2, 3], [3, 4, 4]]
sage: t = Tableau([[1,2],[2]])
sage: t.promotion(3)
[[2, 3], [3]]
sage: t = Tableau([[1,1,3],[2,2]])
sage: t.promotion(2)
[[1, 2, 2], [3, 3]]
sage: t = Tableau([[1,1,3],[2,3]])
sage: t.promotion(2)
[[1, 1, 2], [2, 3]]
sage: t = Tableau([])
sage: t.promotion(2)
[]
TESTS:
We check the equivalence of two definitions of promotion on semistandard tableaux:
sage: ST = SemistandardTableaux(shape=[3,2,2,1], max_entry=6)
sage: def bk_promotion6(st):
....: st2 = st
....: for i in range(5, 0, -1):
....: st2 = st2.bender_knuth_involution(i, check=False)
....: return st2
sage: all( bk_promotion6(st) == st.promotion(5) for st in ST ) # long time
True
sage: ST = SemistandardTableaux(shape=[4,4], max_entry=6)
sage: all( bk_promotion6(st) == st.promotion(5) for st in ST ) # long time
True
We also check promotion_inverse() is the inverse of promotion():
sage: ST = SemistandardTableaux(shape=[3,2,1], max_entry=7)
sage: all( st.promotion(6).promotion_inverse(6) == st for st in ST ) # long time
True
Return the image of self under the inverse promotion operator.
Warning
You might know this operator as the promotion operator (without “inverse”) – literature does not agree on the name.
The inverse promotion operator, applied to a tableau , does the
following:
Iterate over all letters in the tableau
, from right to left.
For each of these letters, do the following:
Once this all is done, subtract from each letter in the tableau.
This is not always well-defined. Restricted to the class of
semistandard tableaux whose entries are all
, this is the
usual inverse promotion operator defined on this class.
When self is a standard tableau of size n + 1, this definition of inverse promotion is the map called “promotion” in [Sg2011] (p. 23) and in [Stan2009], and is the inverse of the map called “promotion” in [Hai1992] (p. 90).
Warning
To my (Darij’s) knowledge, the fact that the above “inverse promotion operator” really is the inverse of the promotion operator promotion() for semistandard tableaux has never been proven in literature. Corrections are welcome.
EXAMPLES:
sage: t = Tableau([[1,2],[3,3]])
sage: t.promotion_inverse(2)
[[1, 2], [2, 3]]
sage: t = Tableau([[1,2],[2,3]])
sage: t.promotion_inverse(2)
[[1, 1], [2, 3]]
sage: t = Tableau([[1,2,5],[3,3,6],[4,7]])
sage: t.promotion_inverse(8)
[[1, 2, 4], [2, 5, 9], [3, 6]]
sage: t = Tableau([])
sage: t.promotion_inverse(2)
[]
TESTS:
We check the equivalence of two definitions of inverse promotion on semistandard tableaux:
sage: ST = SemistandardTableaux(shape=[4,2,1], max_entry=7)
sage: def bk_promotion_inverse7(st):
....: st2 = st
....: for i in range(1, 7):
....: st2 = st2.bender_knuth_involution(i, check=False)
....: return st2
sage: all( bk_promotion_inverse7(st) == st.promotion_inverse(6) for st in ST ) # long time
True
sage: ST = SemistandardTableaux(shape=[2,2,2], max_entry=7)
sage: all( bk_promotion_inverse7(st) == st.promotion_inverse(6) for st in ST ) # long time
True
A test for trac ticket #13203:
sage: T = Tableau([[1]])
sage: type(T.promotion_inverse(2)[0][0])
<type 'sage.rings.integer.Integer'>
Return a list of semistandard tableaux obtained by the -th
Lapointe-Lascoux-Morse promotion operator from the
semistandard tableau self.
This operator is defined by taking the maximum entry of
, then adding a horizontal
-strip to
in all possible
ways, each time filling this strip with
‘s, and finally
letting the permutation
act on each of the resulting tableaux via the
Lascoux-Schuetzenberger action
(symmetric_group_action_on_values()). This method
returns the list of all resulting tableaux. See [LLM01] for
the purpose of this operator.
REFERENCES:
[LLM01] | (1, 2) L. Lapointe, A. Lascoux, J. Morse. Tableau atoms and a new Macdonald positivity conjecture. Arxiv math/0008073v2. |
EXAMPLES:
sage: t = Tableau([[1,2],[3]])
sage: t.promotion_operator(1)
[[[1, 2], [3], [4]], [[1, 2], [3, 4]], [[1, 2, 4], [3]]]
sage: t.promotion_operator(2)
[[[1, 1], [2, 3], [4]],
[[1, 1, 2], [3], [4]],
[[1, 1, 4], [2, 3]],
[[1, 1, 2, 4], [3]]]
sage: Tableau([[1]]).promotion_operator(2)
[[[1, 1], [2]], [[1, 1, 2]]]
sage: Tableau([[1,1],[2]]).promotion_operator(3)
[[[1, 1, 1], [2, 2], [3]],
[[1, 1, 1, 2], [2], [3]],
[[1, 1, 1, 3], [2, 2]],
[[1, 1, 1, 2, 3], [2]]]
The example from [LLM01] p. 12:
sage: Tableau([[1,1],[2,2]]).promotion_operator(3)
[[[1, 1, 1], [2, 2], [3, 3]],
[[1, 1, 1, 3], [2, 2], [3]],
[[1, 1, 1, 3, 3], [2, 2]]]
TESTS:
sage: Tableau([]).promotion_operator(2)
[[[1, 1]]]
sage: Tableau([]).promotion_operator(1)
[[[1]]]
EXAMPLES:
sage: from sage.combinat.tableau import symmetric_group_action_on_values
sage: import functools
sage: t = Tableau([[1,1,3,3],[2,3],[3]])
sage: f = functools.partial(t.raise_action_from_words, symmetric_group_action_on_values)
sage: f([1,2,3])
[[1, 1, 3, 3], [2, 3], [3]]
sage: f([3,2,1])
[[1, 1, 1, 1], [2, 3], [3]]
sage: f([1,3,2])
[[1, 1, 2, 2], [2, 2], [3]]
Return the permutation obtained by reading the entries of the standardization of self row by row, starting with the bottommost row (in English notation).
EXAMPLES:
sage: StandardTableau([[1,2],[3,4]]).reading_word_permutation()
[3, 4, 1, 2]
Check that trac ticket #14724 is fixed:
sage: SemistandardTableau([[1,1]]).reading_word_permutation()
[1, 2]
EXAMPLES:
sage: t = Tableau([[1,1,3,3],[2,3],[3]])
sage: t.reduced_lambda_catabolism([])
[[1, 1, 3, 3], [2, 3], [3]]
sage: t.reduced_lambda_catabolism([1])
[[1, 2, 3, 3, 3], [3]]
sage: t.reduced_lambda_catabolism([1,1])
[[1, 3, 3, 3], [3]]
sage: t.reduced_lambda_catabolism([2,1])
[[3, 3, 3, 3]]
sage: t.reduced_lambda_catabolism([4,2,1])
[]
sage: t.reduced_lambda_catabolism([5,1])
0
sage: t.reduced_lambda_catabolism([4,1])
0
Return the restriction of the semistandard tableau self to n. If possible, the restricted tableau will have the same parent as this tableau.
If is a semistandard tableau and
is a nonnegative integer,
then the restriction of
to
is defined as the
(semistandard) tableau obtained by removing all cells filled with
entries greater than
from
.
Note
If only the shape of the restriction, rather than the whole restriction, is needed, then the faster method restriction_shape() is preferred.
EXAMPLES:
sage: Tableau([[1,2],[3],[4]]).restrict(3)
[[1, 2], [3]]
sage: StandardTableau([[1,2],[3],[4]]).restrict(2)
[[1, 2]]
sage: Tableau([[1,2,3],[2,4,4],[3]]).restrict(0)
[]
sage: Tableau([[1,2,3],[2,4,4],[3]]).restrict(2)
[[1, 2], [2]]
sage: Tableau([[1,2,3],[2,4,4],[3]]).restrict(3)
[[1, 2, 3], [2], [3]]
sage: Tableau([[1,2,3],[2,4,4],[3]]).restrict(5)
[[1, 2, 3], [2, 4, 4], [3]]
If possible the restricted tableau will belong to the same category as the original tableau:
sage: S=StandardTableau([[1,2,4,7],[3,5],[6]]); S.category()
Category of elements of Standard tableaux
sage: S.restrict(4).category()
Category of elements of Standard tableaux
sage: SS=StandardTableaux([4,2,1])([[1,2,4,7],[3,5],[6]]); SS.category()
Category of elements of Standard tableaux of shape [4, 2, 1]
sage: SS.restrict(4).category()
Category of elements of Standard tableaux
sage: Tableau([[1,2],[3],[4]]).restrict(3)
[[1, 2], [3]]
sage: Tableau([[1,2],[3],[4]]).restrict(2)
[[1, 2]]
sage: SemistandardTableau([[1,1],[2]]).restrict(1)
[[1, 1]]
sage: _.category()
Category of elements of Semistandard tableaux
Return the shape of the restriction of the semistandard tableau self to n.
If is a semistandard tableau and
is a nonnegative integer,
then the restriction of
to
is defined as the
(semistandard) tableau obtained by removing all cells filled with
entries greater than
from
.
This method computes merely the shape of the restriction. For the restriction itself, use restrict().
EXAMPLES:
sage: Tableau([[1,2],[2,3],[3,4]]).restriction_shape(3)
[2, 2, 1]
sage: StandardTableau([[1,2],[3],[4],[5]]).restriction_shape(2)
[2]
sage: Tableau([[1,3,3,5],[2,4,4],[17]]).restriction_shape(0)
[]
sage: Tableau([[1,3,3,5],[2,4,4],[17]]).restriction_shape(2)
[1, 1]
sage: Tableau([[1,3,3,5],[2,4,4],[17]]).restriction_shape(3)
[3, 1]
sage: Tableau([[1,3,3,5],[2,4,4],[17]]).restriction_shape(5)
[4, 3]
sage: all( T.restriction_shape(i) == T.restrict(i).shape()
....: for T in StandardTableaux(5) for i in range(1, 5) )
True
Return the right key tableau of self.
The right key tableau of a tableau is a key tableau whose entries
are weakly greater than the corresponding entries in
, and whose column
reading word is subject to certain conditions. See [LS90] for the full definition.
ALGORITHM:
The following algorithm follows [Willis10]. Note that if is a key tableau
then the output of the algorithm is
.
To compute the right key tableau of a tableau
we iterate over the columns
of
. Let
be the
-th column of
and iterate over the entires
in
from bottom to top. Initialize the corresponding entry
in
to be
the largest entry in
. Scan the bottom of each column of
to the right of
, updating
to be the scanned entry whenever the scanned entry is weakly
greater than
. Update
and all columns to the right by removing all
scanned entries.
See also
EXAMPLES:
sage: t = Tableau([[1,2],[2,3]])
sage: t.right_key_tableau()
[[2, 2], [3, 3]]
sage: t = Tableau([[1,1,2,4],[2,3,3],[4],[5]])
sage: t.right_key_tableau()
[[2, 2, 2, 4], [3, 4, 4], [4], [5]]
TESTS:
We check that if we have a key tableau, we return the same tableau:
sage: t = Tableau([[1,1,1,2], [2,2,2], [4], [5]])
sage: t.is_key_tableau()
True
sage: t.right_key_tableau() == t
True
Return the tableau obtained by rotating self by degrees.
This only works for rectangular tableaux.
EXAMPLES:
sage: Tableau([[1,2],[3,4]]).rotate_180()
[[4, 3], [2, 1]]
Return the PermutationGroup corresponding to the row stabilizer of self.
This assumes that every integer from to the size of self
appears exactly once in self.
EXAMPLES:
sage: rs = Tableau([[1,2,3],[4,5]]).row_stabilizer()
sage: rs.order() == factorial(3)*factorial(2)
True
sage: PermutationGroupElement([(1,3,2),(4,5)]) in rs
True
sage: PermutationGroupElement([(1,4)]) in rs
False
sage: rs = Tableau([[1, 2],[3]]).row_stabilizer()
sage: PermutationGroupElement([(1,2),(3,)]) in rs
True
sage: rs.one().domain()
[1, 2, 3]
sage: rs = Tableau([[1],[2],[3]]).row_stabilizer()
sage: rs.order()
1
sage: rs = Tableau([[2,4,5],[1,3]]).row_stabilizer()
sage: rs.order()
12
sage: rs = Tableau([]).row_stabilizer()
sage: rs.order()
1
EXAMPLES:
sage: t = Tableau([[3,5],[7]])
sage: t.schensted_insert(8)
[[3, 5, 8], [7]]
sage: t.schensted_insert(8, left=True)
[[3, 5], [7], [8]]
Return the Schuetzenberger involution of the tableau self.
This method relies on the analogous method on words, which reverts the
word and then complements all letters within the underlying ordered
alphabet. If is specified, the underlying alphabet is assumed to
be
. If no alphabet is specified,
is the maximal
letter appearing in self.
INPUT:
OUTPUT:
EXAMPLES:
sage: t = Tableau([[1,1,1],[2,2]])
sage: t.schuetzenberger_involution(3)
[[2, 2, 3], [3, 3]]
sage: t = Tableau([[1,2,3],[4,5]])
sage: t.schuetzenberger_involution()
[[1, 2, 5], [3, 4]]
sage: t = Tableau([[1,3,5,7],[2,4,6],[8,9]])
sage: t.schuetzenberger_involution()
[[1, 2, 6, 8], [3, 4, 9], [5, 7]]
sage: t = Tableau([])
sage: t.schuetzenberger_involution()
[]
sage: t = StandardTableau([[1,2,3],[4,5]])
sage: s = t.schuetzenberger_involution()
sage: s.parent()
Standard tableaux
Return the total number of segments in self, as in [S14].
Let be a tableaux. We define a
-segment of
(in the
-th
row) to be a maximal consecutive sequence of
-boxes in the
-th
row for any
. Denote the total number of
-segments in
by
.
REFERENCES:
[S14] | (1, 2) B. Salisbury. The flush statistic on semistandard Young tableaux. Arxiv 1401.1185 |
EXAMPLES:
sage: t = Tableau([[1,1,2,3,5],[2,3,5,5],[3,4]])
sage: t.seg()
6
sage: B = crystals.Tableaux("A4",shape=[4,3,2,1])
sage: t = B[31].to_tableau()
sage: t.seg()
3
Return the shape of a tableau self.
EXAMPLES:
sage: Tableau([[1,2,3],[4,5],[6]]).shape()
[3, 2, 1]
Return the size of the shape of the tableau self.
EXAMPLES:
sage: Tableau([[1, 4, 6], [2, 5], [3]]).size()
6
sage: Tableau([[1, 3], [2, 4]]).size()
4
Multiply two tableaux using jeu de taquin.
This product makes the set of semistandard tableaux into an associative monoid. The empty tableau is the unit in this monoid.
See pp. 15 of [Ful1997].
The same product operation is implemented in a different way in bump_multiply().
EXAMPLES:
sage: t = Tableau([[1,2,2,3],[2,3,5,5],[4,4,6],[5,6]])
sage: t2 = Tableau([[1,2],[3]])
sage: t.slide_multiply(t2)
[[1, 1, 2, 2, 3], [2, 2, 3, 5], [3, 4, 5], [4, 6, 6], [5]]
EXAMPLES:
sage: Tableau([[1,2],[3,4]]).socle()
2
sage: Tableau([[1,2,3,4]]).socle()
4
Return the standardization of self, assuming self is a semistandard tableau.
The standardization of a semistandard tableau is the standard
tableau
of the same shape as
whose
reversed reading word is the standardization of the reversed reading
word of
.
The standardization of a word can be formed by replacing all
‘s in
by
from left to right, all
‘s in
by
, and repeating for all letters which
appear in
.
See also Word.standard_permutation().
INPUT:
EXAMPLES:
sage: t = Tableau([[1,3,3,4],[2,4,4],[5,16]])
sage: t.standardization()
[[1, 3, 4, 7], [2, 5, 6], [8, 9]]
Standard tableaux are fixed under standardization:
sage: all((t == t.standardization() for t in StandardTableaux(6)))
True
sage: t = Tableau([])
sage: t.standardization()
[]
The reading word of the standardization is the standardization of the reading word:
sage: T = SemistandardTableaux(shape=[6,3,3,1], max_entry=5)
sage: all(t.to_word().standard_permutation() == t.standardization().reading_word_permutation() for t in T) # long time
True
Return the tableau obtained form this tableau by acting by the permutation w.
Let be a standard tableau of size
, then the action of
is defined by permuting the entries of
(recall they
are
). In particular, suppose the entry at cell
is
, then the entry becomes
. In general, the
resulting tableau
may not be standard.
Note
This is different than symmetric_group_action_on_values() which is defined on semistandard tableaux and is guaranteed to return a semistandard tableau.
INPUT:
EXAMPLES:
sage: StandardTableau([[1,2,4],[3,5]]).symmetric_group_action_on_entries( Permutation(((4,5))) )
[[1, 2, 5], [3, 4]]
sage: _.category()
Category of elements of Standard tableaux
sage: StandardTableau([[1,2,4],[3,5]]).symmetric_group_action_on_entries( Permutation(((1,2))) )
[[2, 1, 4], [3, 5]]
sage: _.category()
Category of elements of Tableaux
Return the image of the semistandard tableau self under the
action of the permutation perm using the
Lascoux-Schuetzenberger action of the symmetric group on
the semistandard tableaux with ceiling
.
If is a nonnegative integer, then the
Lascoux-Schuetzenberger action is a group action of the
symmetric group
on the set of semistandard Young tableaux
with ceiling
(that is, with entries taken from the set
. It is defined as follows:
Let , and let
be a
semistandard tableau with ceiling
. Let
be the reading
word (to_word()) of
. Replace all letters
in
by closing parentheses, and all letters
in
by
opening parentheses. Whenever an opening parenthesis stands
left of a closing parenthesis without there being any
parentheses inbetween (it is allowed to have letters
inbetween as long as they are not parentheses), consider these
two parentheses as matched with each other, and replace them
back by the letters
and
. Repeat this procedure until
there are no more opening parentheses standing left of closing
parentheses. Then, let
be the number of opening
parentheses in the word, and
the number of closing
parentheses (notice that all opening parentheses are left of
all closing parentheses). Replace the first
parentheses
by the letters
, and replace the remaining
parentheses
by the letters
. Let
be the resulting word. Let
be the tableau with the same shape as
but with reading
word
. This tableau
can be shown to be semistandard.
We define the image of
under the action of the simple
transposition
to be this tableau
.
It can be shown that these actions
satisfy the Moore-Coxeter relations of
, and thus this
extends to a unique action of the symmetric group
on
the set of semistandard tableaux with ceiling
. This is the
Lascoux-Schuetzenberger action.
This action of the symmetric group on the set of all
semistandard tableaux of given shape
with entries
in
is the one defined in
[Loth02] Theorem 5.6.3. In particular, the action of
is denoted by
in said source. (Beware of the typo
in the definition of
: it should say
, not
.)
EXAMPLES:
sage: t = Tableau([[1,1,3,3],[2,3],[3]])
sage: t.symmetric_group_action_on_values([1,2,3])
[[1, 1, 3, 3], [2, 3], [3]]
sage: t.symmetric_group_action_on_values([2,1,3])
[[1, 2, 3, 3], [2, 3], [3]]
sage: t.symmetric_group_action_on_values([3,1,2])
[[1, 2, 2, 2], [2, 3], [3]]
sage: t.symmetric_group_action_on_values([2,3,1])
[[1, 1, 1, 1], [2, 2], [3]]
sage: t.symmetric_group_action_on_values([3,2,1])
[[1, 1, 1, 1], [2, 3], [3]]
sage: t.symmetric_group_action_on_values([1,3,2])
[[1, 1, 2, 2], [2, 2], [3]]
TESTS:
sage: t = Tableau([])
sage: t.symmetric_group_action_on_values([])
[]
Return the Gelfand-Tsetlin pattern corresponding to self when semistandard.
EXAMPLES:
sage: T = Tableau([[1,2,3],[2,3],[3]])
sage: G = T.to_Gelfand_Tsetlin_pattern(); G
[[3, 2, 1], [2, 1], [1]]
sage: G.to_tableau() == T
True
sage: T = Tableau([[1,3],[2]])
sage: T.to_Gelfand_Tsetlin_pattern()
[[2, 1, 0], [1, 1], [1]]
Return the chain of partitions corresponding to the (semi)standard tableau self.
The optional keyword parameter max_entry can be used to
customize the length of the chain. Specifically, if this parameter
is set to a nonnegative integer n, then the chain is
constructed from the positions of the letters
in the tableau.
EXAMPLES:
sage: Tableau([[1,2],[3],[4]]).to_chain()
[[], [1], [2], [2, 1], [2, 1, 1]]
sage: Tableau([[1,1],[2]]).to_chain()
[[], [2], [2, 1]]
sage: Tableau([[1,1],[3]]).to_chain()
[[], [2], [2], [2, 1]]
sage: Tableau([]).to_chain()
[[]]
sage: Tableau([[1,1],[2],[3]]).to_chain(max_entry=2)
[[], [2], [2, 1]]
sage: Tableau([[1,1],[2],[3]]).to_chain(max_entry=3)
[[], [2], [2, 1], [2, 1, 1]]
sage: Tableau([[1,1],[2],[3]]).to_chain(max_entry=4)
[[], [2], [2, 1], [2, 1, 1], [2, 1, 1]]
sage: Tableau([[1,1,2],[2,3],[4,5]]).to_chain(max_entry=6)
[[], [2], [3, 1], [3, 2], [3, 2, 1], [3, 2, 2], [3, 2, 2]]
EXAMPLES:
sage: t = Tableau([[1,2],[3,4]])
sage: l = t.to_list(); l
[[1, 2], [3, 4]]
sage: l[0][0] = 2
sage: t
[[1, 2], [3, 4]]
An alias for to_word_by_row().
EXAMPLES:
sage: Tableau([[1,2],[3,4]]).to_word()
word: 3412
sage: Tableau([[1, 4, 6], [2, 5], [3]]).to_word()
word: 325146
Return the word obtained from a column reading of the tableau self (starting with the leftmost column, reading every column from bottom to top).
EXAMPLES:
sage: Tableau([[1,2],[3,4]]).to_word_by_column()
word: 3142
sage: Tableau([[1, 4, 6], [2, 5], [3]]).to_word_by_column()
word: 321546
Return the word obtained from a row reading of the tableau self (starting with the lowermost row, reading every row from left to right).
EXAMPLES:
sage: Tableau([[1,2],[3,4]]).to_word_by_row()
word: 3412
sage: Tableau([[1, 4, 6], [2, 5], [3]]).to_word_by_row()
word: 325146
Return the tableau obtained by vertically flipping the tableau self.
This only works for rectangular tableaux.
EXAMPLES:
sage: Tableau([[1,2],[3,4]]).vertical_flip()
[[3, 4], [1, 2]]
Return the weight of the tableau self. Trailing zeroes are omitted when returning the weight.
The weight of a tableau is the sequence
,
where
is the number of entries of
equal to
. This
sequence contains only finitely many nonzero entries.
The weight of a tableau is the same as the weight of the
reading word of
, for any reading order.
EXAMPLES:
sage: Tableau([[1,2],[3,4]]).weight()
[1, 1, 1, 1]
sage: Tableau([]).weight()
[]
sage: Tableau([[1,3,3,7],[4,2],[2,3]]).weight()
[1, 2, 3, 1, 0, 0, 1]
TESTS:
We check that this agrees with going to the word:
sage: t = Tableau([[1,3,4,7],[6,2],[2,3]])
sage: def by_word(T):
....: ed = T.to_word().evaluation_dict()
....: m = max(ed.keys()) + 1
....: return [ed.get(k,0) for k in range(1,m)]
sage: by_word(t) == t.weight()
True
sage: SST = SemistandardTableaux(shape=[3,1,1])
sage: all(by_word(t) == t.weight() for t in SST)
True
Bases: sage.structure.unique_representation.UniqueRepresentation, sage.structure.parent.Parent
A factory class for the various classes of tableaux.
INPUT:
OUTPUT:
A tableau in Sage is a finite list of lists, whose lengths are weakly decreasing, or an empty list, representing the empty tableau. The entries of a tableau can be any sage object. Because of this, no enumeration through the set of Tableaux is possible.
EXAMPLES:
sage: T = Tableaux(); T
Tableaux
sage: T3 = Tableaux(3); T3
Tableaux of size 3
sage: [['a','b']] in T
True
sage: [['a','b']] in T3
False
sage: t = T3([[1,1,1]]); t
[[1, 1, 1]]
sage: t in T
True
sage: t.parent()
Tableaux of size 3
sage: T([]) # the empty tableau
[]
sage: T.category()
Category of sets
TESTS:
sage: TestSuite( Tableaux() ).run()
sage: TestSuite( Tableaux(5) ).run()
sage: t = Tableaux(3)([[1,2],[3]])
sage: t.parent()
Tableaux of size 3
sage: Tableaux(t)
Traceback (most recent call last):
...
ValueError: The argument to Tableaux() must be a non-negative integer.
sage: Tableaux(3)([[1, 1]])
Traceback (most recent call last):
...
ValueError: [[1, 1]] is not an element of Tableaux of size 3.
sage: t0 = Tableau([[1]])
sage: t1 = Tableaux()([[1]])
sage: t2 = Tableaux()(t1)
sage: t0 == t1 == t2
True
sage: t1 in Tableaux()
True
sage: t1 in Tableaux(1)
True
sage: t1 in Tableaux(2)
False
sage: [[1]] in Tableaux()
True
sage: [] in Tableaux(0)
True
Check that trac: has been fixed:
sage: 1 in Tableaux()
False
Sets the global options for elements of the tableau, skew_tableau, and tableau tuple classes. The defaults are for tableau to be displayed as a list, latexed as a Young diagram using the English convention.
OPTIONS:
Note
Changing the convention for tableaux also changes the convention for partitions.
If no parameters are set, then the function returns a copy of the options dictionary.
EXAMPLES:
sage: T = Tableau([[1,2,3],[4,5]])
sage: T
[[1, 2, 3], [4, 5]]
sage: Tableaux.global_options(display="array")
sage: T
1 2 3
4 5
sage: Tableaux.global_options(convention="french")
sage: T
4 5
1 2 3
Changing the convention for tableaux also changes the convention for partitions and vice versa:
sage: P = Partition([3,3,1])
sage: print P.ferrers_diagram()
*
***
***
sage: Partitions.global_options(convention="english")
sage: print P.ferrers_diagram()
***
***
*
sage: T
1 2 3
4 5
The ASCII art can also be changed:
sage: t = Tableau([[1,2,3],[4,5]])
sage: ascii_art(t)
1 2 3
4 5
sage: Tableaux.global_options(ascii_art="normal")
sage: ascii_art(t)
+---+---+
| 4 | 5 |
+---+---+---+
| 1 | 2 | 3 |
+---+---+---+
sage: Tableaux.global_options(ascii_art="compact")
sage: ascii_art(t)
|4|5|
|1|2|3|
sage: Tableaux.global_options.reset()
See GlobalOptions for more features of these options.
Bases: sage.combinat.tableau.Tableaux
Initializes the class of all tableaux
TESTS:
sage: T = sage.combinat.tableau.Tableaux_all()
sage: TestSuite(T).run()
Returns a particular element of the class.
TESTS:
sage: T = Tableaux()
sage: T.an_element()
[[1, 1], [1]]
Bases: sage.combinat.tableau.Tableaux
Tableaux of a fixed size .
Returns a particular element of the class.
TESTS:
sage: T = sage.combinat.tableau.Tableaux_size(3)
sage: T.an_element()
[[1, 1], [1]]
sage: T = sage.combinat.tableau.Tableaux_size(0)
sage: T.an_element()
[]
Returns a semistandard tableau from a chain of partitions.
EXAMPLES:
sage: from sage.combinat.tableau import from_chain
sage: from_chain([[], [2], [2, 1], [3, 2, 1]])
[[1, 1, 3], [2, 3], [3]]
Returns a tableau from a shape and word.
INPUT:
OUTPUT:
A tableau, whose shape is shape and whose reading word is w. If the convention is specified as "French", the reading word is to be read starting from the top row in French convention (= the bottom row in English convention). If the convention is specified as "English", the reading word is to be read starting with the top row in English convention.
EXAMPLES:
sage: from sage.combinat.tableau import from_shape_and_word
sage: t = Tableau([[1, 3], [2], [4]])
sage: shape = t.shape(); shape
[2, 1, 1]
sage: word = t.to_word(); word
word: 4213
sage: from_shape_and_word(shape, word)
[[1, 3], [2], [4]]
sage: word = Word(flatten(t))
sage: from_shape_and_word(shape, word, convention = "English")
[[1, 3], [2], [4]]
EXAMPLES:
sage: from sage.combinat.tableau import symmetric_group_action_on_values
sage: symmetric_group_action_on_values([1,1,1],[1,3,2])
[1, 1, 1]
sage: symmetric_group_action_on_values([1,1,1],[2,1,3])
[2, 2, 2]
sage: symmetric_group_action_on_values([1,2,1],[2,1,3])
[2, 2, 1]
sage: symmetric_group_action_on_values([2,2,2],[2,1,3])
[1, 1, 1]
sage: symmetric_group_action_on_values([2,1,2],[2,1,3])
[2, 1, 1]
sage: symmetric_group_action_on_values([2,2,3,1,1,2,2,3],[1,3,2])
[2, 3, 3, 1, 1, 2, 3, 3]
sage: symmetric_group_action_on_values([2,1,1],[2,1])
[2, 1, 2]
sage: symmetric_group_action_on_values([2,2,1],[2,1])
[1, 2, 1]
sage: symmetric_group_action_on_values([1,2,1],[2,1])
[2, 2, 1]
EXAMPLES:
sage: from sage.combinat.tableau import unmatched_places
sage: unmatched_places([2,2,2,1,1,1],2,1)
([], [])
sage: unmatched_places([1,1,1,2,2,2],2,1)
([0, 1, 2], [3, 4, 5])
sage: unmatched_places([], 2, 1)
([], [])
sage: unmatched_places([1,2,4,6,2,1,5,3],2,1)
([0], [1])
sage: unmatched_places([2,2,1,2,4,6,2,1,5,3], 2, 1)
([], [0, 3])
sage: unmatched_places([3,1,1,1,2,1,2], 2, 1)
([1, 2, 3], [6])