# Integer partitions#

A partition $$p$$ of a nonnegative integer $$n$$ is a non-increasing list of positive integers (the parts of the partition) with total sum $$n$$.

A partition can be depicted by a diagram made of rows of cells, where the number of cells in the $$i^{th}$$ row starting from the top is the $$i^{th}$$ part of the partition.

The coordinate system related to a partition applies from the top to the bottom and from left to right. So, the corners of the partition $$[5, 3, 1]$$ are $$[[0,4], [1,2], [2,0]]$$.

For display options, see Partitions.options.

Note

• Boxes is a synonym for cells. All methods will use ‘cell’ and ‘cells’ instead of ‘box’ and ‘boxes’.

• Partitions are 0 based with coordinates in the form of (row-index, column-index).

• If given coordinates of the form (r, c), then use Python’s *-operator.

• Throughout this documentation, for a partition $$\lambda$$ we will denote its conjugate partition by $$\lambda^{\prime}$$. For more on conjugate partitions, see Partition.conjugate().

• The comparisons on partitions use lexicographic order.

Note

We use the convention that lexicographic ordering is read from left-to-right. That is to say $$[1, 3, 7]$$ is smaller than $$[2, 3, 4]$$.

AUTHORS:

• Mike Hansen (2007): initial version

• Dan Drake (2009-03-28): deprecate RestrictedPartitions and implement Partitions_parts_in

• Travis Scrimshaw (2012-01-12): Implemented latex function to Partition_class

• Travis Scrimshaw (2012-05-09): Fixed Partitions(-1).list() infinite recursion loop by saying Partitions_n is the empty set.

• Travis Scrimshaw (2012-05-11): Fixed bug in inner where if the length was longer than the length of the inner partition, it would include 0’s.

• Andrew Mathas (2012-06-01): Removed deprecated functions and added compatibility with the PartitionTuple classes. See Issue #13072

• Travis Scrimshaw (2012-10-12): Added options. Made Partition_class to the element Partition. Partitions* are now all in the category framework except PartitionsRestricted (which will eventually be removed). Cleaned up documentation.

• Matthew Lancellotti (2018-09-14): Added a bunch of “k” methods to Partition.

EXAMPLES:

There are $$5$$ partitions of the integer $$4$$:

sage: Partitions(4).cardinality()                                                   # needs sage.libs.flint
5
sage: Partitions(4).list()
[[4], [3, 1], [2, 2], [2, 1, 1], [1, 1, 1, 1]]

>>> from sage.all import *
>>> Partitions(Integer(4)).cardinality()                                                   # needs sage.libs.flint
5
>>> Partitions(Integer(4)).list()
[[4], [3, 1], [2, 2], [2, 1, 1], [1, 1, 1, 1]]


We can use the method .first() to get the ‘first’ partition of a number:

sage: Partitions(4).first()
[4]

>>> from sage.all import *
>>> Partitions(Integer(4)).first()
[4]


Using the method .next(p), we can calculate the ‘next’ partition after $$p$$. When we are at the last partition, None will be returned:

sage: Partitions(4).next([4])
[3, 1]
sage: Partitions(4).next([1,1,1,1]) is None
True

>>> from sage.all import *
>>> Partitions(Integer(4)).next([Integer(4)])
[3, 1]
>>> Partitions(Integer(4)).next([Integer(1),Integer(1),Integer(1),Integer(1)]) is None
True


We can use iter to get an object which iterates over the partitions one by one to save memory. Note that when we do something like for part in Partitions(4) this iterator is used in the background:

sage: g = iter(Partitions(4))
sage: next(g)
[4]
sage: next(g)
[3, 1]
sage: next(g)
[2, 2]
sage: for p in Partitions(4): print(p)
[4]
[3, 1]
[2, 2]
[2, 1, 1]
[1, 1, 1, 1]

>>> from sage.all import *
>>> g = iter(Partitions(Integer(4)))
>>> next(g)
[4]
>>> next(g)
[3, 1]
>>> next(g)
[2, 2]
>>> for p in Partitions(Integer(4)): print(p)
[4]
[3, 1]
[2, 2]
[2, 1, 1]
[1, 1, 1, 1]


We can add constraints to the type of partitions we want. For example, to get all of the partitions of $$4$$ of length $$2$$, we’d do the following:

sage: Partitions(4, length=2).list()
[[3, 1], [2, 2]]

>>> from sage.all import *
>>> Partitions(Integer(4), length=Integer(2)).list()
[[3, 1], [2, 2]]


Here is the list of partitions of length at least $$2$$ and the list of ones with length at most $$2$$:

sage: Partitions(4, min_length=2).list()
[[3, 1], [2, 2], [2, 1, 1], [1, 1, 1, 1]]
sage: Partitions(4, max_length=2).list()
[[4], [3, 1], [2, 2]]

>>> from sage.all import *
>>> Partitions(Integer(4), min_length=Integer(2)).list()
[[3, 1], [2, 2], [2, 1, 1], [1, 1, 1, 1]]
>>> Partitions(Integer(4), max_length=Integer(2)).list()
[[4], [3, 1], [2, 2]]


The options min_part and max_part can be used to set constraints on the sizes of all parts. Using max_part, we can select partitions having only ‘small’ entries. The following is the list of the partitions of $$4$$ with parts at most $$2$$:

sage: Partitions(4, max_part=2).list()
[[2, 2], [2, 1, 1], [1, 1, 1, 1]]

>>> from sage.all import *
>>> Partitions(Integer(4), max_part=Integer(2)).list()
[[2, 2], [2, 1, 1], [1, 1, 1, 1]]


The min_part options is complementary to max_part and selects partitions having only ‘large’ parts. Here is the list of all partitions of $$4$$ with each part at least $$2$$:

sage: Partitions(4, min_part=2).list()
[[4], [2, 2]]

>>> from sage.all import *
>>> Partitions(Integer(4), min_part=Integer(2)).list()
[[4], [2, 2]]


The options inner and outer can be used to set part-by-part constraints. This is the list of partitions of $$4$$ with [3, 1, 1] as an outer bound (that is, partitions of $$4$$ contained in the partition [3, 1, 1]):

sage: Partitions(4, outer=[3,1,1]).list()
[[3, 1], [2, 1, 1]]

>>> from sage.all import *
>>> Partitions(Integer(4), outer=[Integer(3),Integer(1),Integer(1)]).list()
[[3, 1], [2, 1, 1]]


outer sets max_length to the length of its argument. Moreover, the parts of outer may be infinite to clear constraints on specific parts. Here is the list of the partitions of $$4$$ of length at most $$3$$ such that the second and third part are $$1$$ when they exist:

sage: Partitions(4, outer=[oo,1,1]).list()
[[4], [3, 1], [2, 1, 1]]

>>> from sage.all import *
>>> Partitions(Integer(4), outer=[oo,Integer(1),Integer(1)]).list()
[[4], [3, 1], [2, 1, 1]]


Finally, here are the partitions of $$4$$ with [1,1,1] as an inner bound (i. e., the partitions of $$4$$ containing the partition [1,1,1]). Note that inner sets min_length to the length of its argument:

sage: Partitions(4, inner=[1,1,1]).list()
[[2, 1, 1], [1, 1, 1, 1]]

>>> from sage.all import *
>>> Partitions(Integer(4), inner=[Integer(1),Integer(1),Integer(1)]).list()
[[2, 1, 1], [1, 1, 1, 1]]


The options min_slope and max_slope can be used to set constraints on the slope, that is on the difference p[i+1]-p[i] of two consecutive parts. Here is the list of the strictly decreasing partitions of $$4$$:

sage: Partitions(4, max_slope=-1).list()
[[4], [3, 1]]

>>> from sage.all import *
>>> Partitions(Integer(4), max_slope=-Integer(1)).list()
[[4], [3, 1]]


The constraints can be combined together in all reasonable ways. Here are all the partitions of $$11$$ of length between $$2$$ and $$4$$ such that the difference between two consecutive parts is between $$-3$$ and $$-1$$:

sage: Partitions(11,min_slope=-3,max_slope=-1,min_length=2,max_length=4).list()
[[7, 4], [6, 5], [6, 4, 1], [6, 3, 2], [5, 4, 2], [5, 3, 2, 1]]

>>> from sage.all import *
>>> Partitions(Integer(11),min_slope=-Integer(3),max_slope=-Integer(1),min_length=Integer(2),max_length=Integer(4)).list()
[[7, 4], [6, 5], [6, 4, 1], [6, 3, 2], [5, 4, 2], [5, 3, 2, 1]]


Partition objects can also be created individually with Partition:

sage: Partition([2,1])
[2, 1]

>>> from sage.all import *
>>> Partition([Integer(2),Integer(1)])
[2, 1]


Once we have a partition object, then there are a variety of methods that we can use. For example, we can get the conjugate of a partition. Geometrically, the conjugate of a partition is the reflection of that partition through its main diagonal. Of course, this operation is an involution:

sage: Partition([4,1]).conjugate()
[2, 1, 1, 1]
sage: Partition([4,1]).conjugate().conjugate()
[4, 1]

>>> from sage.all import *
>>> Partition([Integer(4),Integer(1)]).conjugate()
[2, 1, 1, 1]
>>> Partition([Integer(4),Integer(1)]).conjugate().conjugate()
[4, 1]


If we create a partition with extra zeros at the end, they will be dropped:

sage: Partition([4,1,0,0])
[4, 1]
sage: Partition([0])
[]
sage: Partition([0,0])
[]

>>> from sage.all import *
>>> Partition([Integer(4),Integer(1),Integer(0),Integer(0)])
[4, 1]
>>> Partition([Integer(0)])
[]
>>> Partition([Integer(0),Integer(0)])
[]


The idea of a partition being followed by infinitely many parts of size $$0$$ is consistent with the get_part method:

sage: p = Partition([5, 2])
sage: p.get_part(0)
5
sage: p.get_part(10)
0

>>> from sage.all import *
>>> p = Partition([Integer(5), Integer(2)])
>>> p.get_part(Integer(0))
5
>>> p.get_part(Integer(10))
0


We can go back and forth between the standard and the exponential notations of a partition. The exponential notation can be padded with extra zeros:

sage: Partition([6,4,4,2,1]).to_exp()
[1, 1, 0, 2, 0, 1]
sage: Partition(exp=[1,1,0,2,0,1])
[6, 4, 4, 2, 1]
sage: Partition([6,4,4,2,1]).to_exp(5)
[1, 1, 0, 2, 0, 1]
sage: Partition([6,4,4,2,1]).to_exp(7)
[1, 1, 0, 2, 0, 1, 0]
sage: Partition([6,4,4,2,1]).to_exp(10)
[1, 1, 0, 2, 0, 1, 0, 0, 0, 0]

>>> from sage.all import *
>>> Partition([Integer(6),Integer(4),Integer(4),Integer(2),Integer(1)]).to_exp()
[1, 1, 0, 2, 0, 1]
>>> Partition(exp=[Integer(1),Integer(1),Integer(0),Integer(2),Integer(0),Integer(1)])
[6, 4, 4, 2, 1]
>>> Partition([Integer(6),Integer(4),Integer(4),Integer(2),Integer(1)]).to_exp(Integer(5))
[1, 1, 0, 2, 0, 1]
>>> Partition([Integer(6),Integer(4),Integer(4),Integer(2),Integer(1)]).to_exp(Integer(7))
[1, 1, 0, 2, 0, 1, 0]
>>> Partition([Integer(6),Integer(4),Integer(4),Integer(2),Integer(1)]).to_exp(Integer(10))
[1, 1, 0, 2, 0, 1, 0, 0, 0, 0]


We can get the (zero-based!) coordinates of the corners of a partition:

sage: Partition([4,3,1]).corners()
[(0, 3), (1, 2), (2, 0)]

>>> from sage.all import *
>>> Partition([Integer(4),Integer(3),Integer(1)]).corners()
[(0, 3), (1, 2), (2, 0)]


We can compute the core and quotient of a partition and build the partition back up from them:

sage: Partition([6,3,2,2]).core(3)
[2, 1, 1]
sage: Partition([7,7,5,3,3,3,1]).quotient(3)
([2], [1], [2, 2, 2])
sage: p = Partition([11,5,5,3,2,2,2])
sage: p.core(3)
[]
sage: p.quotient(3)
([2, 1], [4], [1, 1, 1])
sage: Partition(core=[],quotient=([2, 1], [4], [1, 1, 1]))
[11, 5, 5, 3, 2, 2, 2]

>>> from sage.all import *
>>> Partition([Integer(6),Integer(3),Integer(2),Integer(2)]).core(Integer(3))
[2, 1, 1]
>>> Partition([Integer(7),Integer(7),Integer(5),Integer(3),Integer(3),Integer(3),Integer(1)]).quotient(Integer(3))
([2], [1], [2, 2, 2])
>>> p = Partition([Integer(11),Integer(5),Integer(5),Integer(3),Integer(2),Integer(2),Integer(2)])
>>> p.core(Integer(3))
[]
>>> p.quotient(Integer(3))
([2, 1], [4], [1, 1, 1])
>>> Partition(core=[],quotient=([Integer(2), Integer(1)], [Integer(4)], [Integer(1), Integer(1), Integer(1)]))
[11, 5, 5, 3, 2, 2, 2]


We can compute the $$0-1$$ sequence and go back and forth:

sage: Partitions().from_zero_one([1, 1, 1, 1, 0, 1, 0])
[5, 4]
sage: all(Partitions().from_zero_one(mu.zero_one_sequence())
....:     == mu for n in range(5) for mu in Partitions(n))
True

>>> from sage.all import *
>>> Partitions().from_zero_one([Integer(1), Integer(1), Integer(1), Integer(1), Integer(0), Integer(1), Integer(0)])
[5, 4]
>>> all(Partitions().from_zero_one(mu.zero_one_sequence())
...     == mu for n in range(Integer(5)) for mu in Partitions(n))
True


We can compute the Frobenius coordinates and go back and forth:

sage: Partition([7,3,1]).frobenius_coordinates()
([6, 1], [2, 0])
sage: Partition(frobenius_coordinates=([6,1],[2,0]))
[7, 3, 1]
sage: all(mu == Partition(frobenius_coordinates=mu.frobenius_coordinates())
....:     for n in range(12) for mu in Partitions(n))
True

>>> from sage.all import *
>>> Partition([Integer(7),Integer(3),Integer(1)]).frobenius_coordinates()
([6, 1], [2, 0])
>>> Partition(frobenius_coordinates=([Integer(6),Integer(1)],[Integer(2),Integer(0)]))
[7, 3, 1]
>>> all(mu == Partition(frobenius_coordinates=mu.frobenius_coordinates())
...     for n in range(Integer(12)) for mu in Partitions(n))
True


We use the lexicographic ordering:

sage: pl = Partition([4,1,1])
sage: ql = Partitions()([3,3])
sage: pl > ql
True
sage: PL = Partitions()
sage: pl = PL([4,1,1])
sage: ql = PL([3,3])
sage: pl > ql
True

>>> from sage.all import *
>>> pl = Partition([Integer(4),Integer(1),Integer(1)])
>>> ql = Partitions()([Integer(3),Integer(3)])
>>> pl > ql
True
>>> PL = Partitions()
>>> pl = PL([Integer(4),Integer(1),Integer(1)])
>>> ql = PL([Integer(3),Integer(3)])
>>> pl > ql
True

class sage.combinat.partition.OrderedPartitions(n, k)[source]#

Bases: Partitions

The class of ordered partitions of $$n$$. If $$k$$ is specified, then this contains only the ordered partitions of length $$k$$.

An ordered partition of a nonnegative integer $$n$$ means a list of positive integers whose sum is $$n$$. This is the same as a composition of $$n$$.

Note

It is recommended that you use Compositions() instead as OrderedPartitions() wraps GAP.

EXAMPLES:

sage: OrderedPartitions(3)
Ordered partitions of 3
sage: OrderedPartitions(3).list()                                               # needs sage.libs.gap
[[3], [2, 1], [1, 2], [1, 1, 1]]
sage: OrderedPartitions(3,2)
Ordered partitions of 3 of length 2
sage: OrderedPartitions(3,2).list()                                             # needs sage.libs.gap
[[2, 1], [1, 2]]

sage: OrderedPartitions(10, k=2).list()                                         # needs sage.libs.gap
[[9, 1], [8, 2], [7, 3], [6, 4], [5, 5], [4, 6], [3, 7], [2, 8], [1, 9]]
sage: OrderedPartitions(4).list()                                               # needs sage.libs.gap
[[4], [3, 1], [2, 2], [2, 1, 1], [1, 3], [1, 2, 1], [1, 1, 2], [1, 1, 1, 1]]

>>> from sage.all import *
>>> OrderedPartitions(Integer(3))
Ordered partitions of 3
>>> OrderedPartitions(Integer(3)).list()                                               # needs sage.libs.gap
[[3], [2, 1], [1, 2], [1, 1, 1]]
>>> OrderedPartitions(Integer(3),Integer(2))
Ordered partitions of 3 of length 2
>>> OrderedPartitions(Integer(3),Integer(2)).list()                                             # needs sage.libs.gap
[[2, 1], [1, 2]]

>>> OrderedPartitions(Integer(10), k=Integer(2)).list()                                         # needs sage.libs.gap
[[9, 1], [8, 2], [7, 3], [6, 4], [5, 5], [4, 6], [3, 7], [2, 8], [1, 9]]
>>> OrderedPartitions(Integer(4)).list()                                               # needs sage.libs.gap
[[4], [3, 1], [2, 2], [2, 1, 1], [1, 3], [1, 2, 1], [1, 1, 2], [1, 1, 1, 1]]

cardinality()[source]#

Return the cardinality of self.

EXAMPLES:

sage: # needs sage.libs.gap
sage: OrderedPartitions(3).cardinality()
4
sage: OrderedPartitions(3,2).cardinality()
2
sage: OrderedPartitions(10,2).cardinality()
9
sage: OrderedPartitions(15).cardinality()
16384

>>> from sage.all import *
>>> # needs sage.libs.gap
>>> OrderedPartitions(Integer(3)).cardinality()
4
>>> OrderedPartitions(Integer(3),Integer(2)).cardinality()
2
>>> OrderedPartitions(Integer(10),Integer(2)).cardinality()
9
>>> OrderedPartitions(Integer(15)).cardinality()
16384

list()[source]#

Return a list of partitions in self.

EXAMPLES:

sage: OrderedPartitions(3).list()                                           # needs sage.libs.gap
[[3], [2, 1], [1, 2], [1, 1, 1]]
sage: OrderedPartitions(3,2).list()                                         # needs sage.libs.gap
[[2, 1], [1, 2]]

>>> from sage.all import *
>>> OrderedPartitions(Integer(3)).list()                                           # needs sage.libs.gap
[[3], [2, 1], [1, 2], [1, 1, 1]]
>>> OrderedPartitions(Integer(3),Integer(2)).list()                                         # needs sage.libs.gap
[[2, 1], [1, 2]]

class sage.combinat.partition.Partition(parent, mu)[source]#

A partition $$p$$ of a nonnegative integer $$n$$ is a non-increasing list of positive integers (the parts of the partition) with total sum $$n$$.

A partition is often represented as a diagram consisting of cells, or boxes, placed in rows on top of each other such that the number of cells in the $$i^{th}$$ row, reading from top to bottom, is the $$i^{th}$$ part of the partition. The rows are left-justified (and become shorter and shorter the farther down one goes). This diagram is called the Young diagram of the partition, or more precisely its Young diagram in English notation. (French and Russian notations are variations on this representation.)

The coordinate system related to a partition applies from the top to the bottom and from left to right. So, the corners of the partition [5, 3, 1] are [[0,4], [1,2], [2,0]].

For display options, see Partitions.options().

Note

Partitions are 0 based with coordinates in the form of (row-index, column-index). For example consider the partition mu=Partition([4,3,2,2]), the first part is mu[0] (which is 4), the second is mu[1], and so on, and the upper-left cell in English convention is (0, 0).

A partition can be specified in one of the following ways:

• a list (the default)

• using exponential notation

• by Frobenius coordinates

• specifying its $$0-1$$ sequence

• specifying the core and the quotient

See the examples below.

EXAMPLES:

Creating partitions though parents:

sage: mu = Partitions(8)([3,2,1,1,1]); mu
[3, 2, 1, 1, 1]
sage: nu = Partition([3,2,1,1,1]); nu
[3, 2, 1, 1, 1]
sage: mu == nu
True
sage: mu is nu
False
sage: mu in Partitions()
True
sage: mu.parent()
Partitions of the integer 8
sage: mu.size()
8
sage: mu.category()
Category of elements of Partitions of the integer 8
sage: nu.parent()
Partitions
sage: nu.category()
Category of elements of Partitions
sage: mu[0]
3
sage: mu[1]
2
sage: mu[2]
1
sage: mu.pp()
***
**
*
*
*
sage: mu.removable_cells()
[(0, 2), (1, 1), (4, 0)]
sage: mu.down_list()
[[2, 2, 1, 1, 1], [3, 1, 1, 1, 1], [3, 2, 1, 1]]
[(0, 3), (1, 2), (2, 1), (5, 0)]
sage: mu.up_list()
[[4, 2, 1, 1, 1], [3, 3, 1, 1, 1], [3, 2, 2, 1, 1], [3, 2, 1, 1, 1, 1]]
sage: mu.conjugate()
[5, 2, 1]
sage: mu.dominates(nu)
True
sage: nu.dominates(mu)
True

>>> from sage.all import *
>>> mu = Partitions(Integer(8))([Integer(3),Integer(2),Integer(1),Integer(1),Integer(1)]); mu
[3, 2, 1, 1, 1]
>>> nu = Partition([Integer(3),Integer(2),Integer(1),Integer(1),Integer(1)]); nu
[3, 2, 1, 1, 1]
>>> mu == nu
True
>>> mu is nu
False
>>> mu in Partitions()
True
>>> mu.parent()
Partitions of the integer 8
>>> mu.size()
8
>>> mu.category()
Category of elements of Partitions of the integer 8
>>> nu.parent()
Partitions
>>> nu.category()
Category of elements of Partitions
>>> mu[Integer(0)]
3
>>> mu[Integer(1)]
2
>>> mu[Integer(2)]
1
>>> mu.pp()
***
**
*
*
*
>>> mu.removable_cells()
[(0, 2), (1, 1), (4, 0)]
>>> mu.down_list()
[[2, 2, 1, 1, 1], [3, 1, 1, 1, 1], [3, 2, 1, 1]]
[(0, 3), (1, 2), (2, 1), (5, 0)]
>>> mu.up_list()
[[4, 2, 1, 1, 1], [3, 3, 1, 1, 1], [3, 2, 2, 1, 1], [3, 2, 1, 1, 1, 1]]
>>> mu.conjugate()
[5, 2, 1]
>>> mu.dominates(nu)
True
>>> nu.dominates(mu)
True


Creating partitions using Partition:

sage: Partition([3,2,1])
[3, 2, 1]
sage: Partition(exp=[2,1,1])
[3, 2, 1, 1]
sage: Partition(core=[2,1], quotient=[[2,1],[3],[1,1,1]])
[11, 5, 5, 3, 2, 2, 2]
sage: Partition(frobenius_coordinates=([3,2],[4,0]))
[4, 4, 1, 1, 1]
sage: Partitions().from_zero_one([1, 1, 1, 1, 0, 1, 0])
[5, 4]
sage: [2,1] in Partitions()
True
sage: [2,1,0] in Partitions()
True
sage: Partition([1,2,3])
Traceback (most recent call last):
...
ValueError: [1, 2, 3] is not an element of Partitions

>>> from sage.all import *
>>> Partition([Integer(3),Integer(2),Integer(1)])
[3, 2, 1]
>>> Partition(exp=[Integer(2),Integer(1),Integer(1)])
[3, 2, 1, 1]
>>> Partition(core=[Integer(2),Integer(1)], quotient=[[Integer(2),Integer(1)],[Integer(3)],[Integer(1),Integer(1),Integer(1)]])
[11, 5, 5, 3, 2, 2, 2]
>>> Partition(frobenius_coordinates=([Integer(3),Integer(2)],[Integer(4),Integer(0)]))
[4, 4, 1, 1, 1]
>>> Partitions().from_zero_one([Integer(1), Integer(1), Integer(1), Integer(1), Integer(0), Integer(1), Integer(0)])
[5, 4]
>>> [Integer(2),Integer(1)] in Partitions()
True
>>> [Integer(2),Integer(1),Integer(0)] in Partitions()
True
>>> Partition([Integer(1),Integer(2),Integer(3)])
Traceback (most recent call last):
...
ValueError: [1, 2, 3] is not an element of Partitions


Sage ignores trailing zeros at the end of partitions:

sage: Partition([3,2,1,0])
[3, 2, 1]
sage: Partitions()([3,2,1,0])
[3, 2, 1]
sage: Partitions(6)([3,2,1,0])
[3, 2, 1]

>>> from sage.all import *
>>> Partition([Integer(3),Integer(2),Integer(1),Integer(0)])
[3, 2, 1]
>>> Partitions()([Integer(3),Integer(2),Integer(1),Integer(0)])
[3, 2, 1]
>>> Partitions(Integer(6))([Integer(3),Integer(2),Integer(1),Integer(0)])
[3, 2, 1]


Return a partition corresponding to self with a cell added in row i. (This does not change self.)

EXAMPLES:

sage: Partition([3, 2, 1, 1]).add_cell(0)
[4, 2, 1, 1]
sage: cell = [4, 0]; Partition([3, 2, 1, 1]).add_cell(*cell)
[3, 2, 1, 1, 1]

>>> from sage.all import *
[4, 2, 1, 1]
>>> cell = [Integer(4), Integer(0)]; Partition([Integer(3), Integer(2), Integer(1), Integer(1)]).add_cell(*cell)
[3, 2, 1, 1, 1]


Return a list of all the partitions that can be obtained by adding a horizontal border strip of length k to self.

EXAMPLES:

sage: Partition([]).add_horizontal_border_strip(0)
[[]]
[[3, 2, 1]]
[[2]]
[[4, 2], [3, 2, 1], [2, 2, 2]]
[[5, 2, 2], [4, 3, 2], [4, 2, 2, 1], [3, 3, 2, 1], [3, 2, 2, 2]]

>>> from sage.all import *
[[]]
[[3, 2, 1]]
[[2]]
[[4, 2], [3, 2, 1], [2, 2, 2]]
[[5, 2, 2], [4, 3, 2], [4, 2, 2, 1], [3, 3, 2, 1], [3, 2, 2, 2]]


Return a list of all the partitions that can be obtained by adding a vertical border strip of length k to self.

EXAMPLES:

sage: Partition([]).add_vertical_border_strip(0)
[[]]
[[3, 2, 1]]
[[1, 1]]
[[3, 3], [3, 2, 1], [2, 2, 1, 1]]
[[4, 3, 2], [4, 2, 2, 1], [3, 3, 3], [3, 3, 2, 1], [3, 2, 2, 1, 1]]

>>> from sage.all import *
[[]]
[[3, 2, 1]]
[[1, 1]]
[[3, 3], [3, 2, 1], [2, 2, 1, 1]]
[[4, 3, 2], [4, 2, 2, 1], [3, 3, 3], [3, 3, 2, 1], [3, 2, 2, 1, 1]]


Return a list of the outside corners of the partition self.

An outside corner (also called a cocorner) of a partition $$\lambda$$ is a cell on $$\ZZ^2$$ which does not belong to the Young diagram of $$\lambda$$ but can be added to this Young diagram to still form a straight-shape Young diagram.

The entries of the list returned are pairs of the form $$(i,j)$$, where $$i$$ and $$j$$ are the coordinates of the respective corner. The coordinates are counted from $$0$$.

Note

These are called “outer corners” in [Sag2001].

EXAMPLES:

sage: Partition([2,2,1]).outside_corners()
[(0, 2), (2, 1), (3, 0)]
sage: Partition([2,2]).outside_corners()
[(0, 2), (2, 0)]
sage: Partition([6,3,3,1,1,1]).outside_corners()
[(0, 6), (1, 3), (3, 1), (6, 0)]
sage: Partition([]).outside_corners()
[(0, 0)]

>>> from sage.all import *
>>> Partition([Integer(2),Integer(2),Integer(1)]).outside_corners()
[(0, 2), (2, 1), (3, 0)]
>>> Partition([Integer(2),Integer(2)]).outside_corners()
[(0, 2), (2, 0)]
>>> Partition([Integer(6),Integer(3),Integer(3),Integer(1),Integer(1),Integer(1)]).outside_corners()
[(0, 6), (1, 3), (3, 1), (6, 0)]
>>> Partition([]).outside_corners()
[(0, 0)]


Return a list of the outside corners of the partition self having l-residue i.

An outside corner (also called a cocorner) of a partition $$\lambda$$ is a cell on $$\ZZ^2$$ which does not belong to the Young diagram of $$\lambda$$ but can be added to this Young diagram to still form a straight-shape Young diagram. See residue() for the definition of the l-residue.

The entries of the list returned are pairs of the form $$(i,j)$$, where $$i$$ and $$j$$ are the coordinates of the respective corner. The coordinates are counted from $$0$$.

EXAMPLES:

sage: Partition([3,2,1]).outside_corners_residue(0, 3)
[(0, 3), (3, 0)]
sage: Partition([3,2,1]).outside_corners_residue(1, 3)
[(1, 2)]
sage: Partition([3,2,1]).outside_corners_residue(2, 3)
[(2, 1)]

>>> from sage.all import *
>>> Partition([Integer(3),Integer(2),Integer(1)]).outside_corners_residue(Integer(0), Integer(3))
[(0, 3), (3, 0)]
>>> Partition([Integer(3),Integer(2),Integer(1)]).outside_corners_residue(Integer(1), Integer(3))
[(1, 2)]
>>> Partition([Integer(3),Integer(2),Integer(1)]).outside_corners_residue(Integer(2), Integer(3))
[(2, 1)]

arm_cells(i, j)[source]#

Return the list of the cells of the arm of cell $$(i,j)$$ in self.

The arm of cell $$c = (i,j)$$ is the boxes that appear to the right of $$c$$.

The cell coordinates are zero-based, i. e., the northwesternmost cell is $$(0,0)$$.

INPUT:

• i, j – two integers

OUTPUT:

A list of pairs of integers

EXAMPLES:

sage: Partition([4,4,3,1]).arm_cells(1,1)
[(1, 2), (1, 3)]

sage: Partition([]).arm_cells(0,0)
Traceback (most recent call last):
...
ValueError: the cell is not in the diagram

>>> from sage.all import *
>>> Partition([Integer(4),Integer(4),Integer(3),Integer(1)]).arm_cells(Integer(1),Integer(1))
[(1, 2), (1, 3)]

>>> Partition([]).arm_cells(Integer(0),Integer(0))
Traceback (most recent call last):
...
ValueError: the cell is not in the diagram

arm_length(i, j)[source]#

Return the length of the arm of cell $$(i,j)$$ in self.

The arm of cell $$(i,j)$$ is the cells that appear to the right of cell $$(i,j)$$.

The cell coordinates are zero-based, i. e., the northwesternmost cell is $$(0,0)$$.

INPUT:

• i, j – two integers

OUTPUT:

An integer or a ValueError

EXAMPLES:

sage: p = Partition([2,2,1])
sage: p.arm_length(0, 0)
1
sage: p.arm_length(0, 1)
0
sage: p.arm_length(2, 0)
0
sage: Partition([3,3]).arm_length(0, 0)
2
sage: Partition([3,3]).arm_length(*[0,0])
2

>>> from sage.all import *
>>> p = Partition([Integer(2),Integer(2),Integer(1)])
>>> p.arm_length(Integer(0), Integer(0))
1
>>> p.arm_length(Integer(0), Integer(1))
0
>>> p.arm_length(Integer(2), Integer(0))
0
>>> Partition([Integer(3),Integer(3)]).arm_length(Integer(0), Integer(0))
2
>>> Partition([Integer(3),Integer(3)]).arm_length(*[Integer(0),Integer(0)])
2

arm_lengths(flat=False)[source]#

Return a tableau of shape self where each cell is filled with its arm length.

The optional boolean parameter flat provides the option of returning a flat list.

EXAMPLES:

sage: Partition([2,2,1]).arm_lengths()
[[1, 0], [1, 0], [0]]
sage: Partition([2,2,1]).arm_lengths(flat=True)
[1, 0, 1, 0, 0]
sage: Partition([3,3]).arm_lengths()
[[2, 1, 0], [2, 1, 0]]
sage: Partition([3,3]).arm_lengths(flat=True)
[2, 1, 0, 2, 1, 0]

>>> from sage.all import *
>>> Partition([Integer(2),Integer(2),Integer(1)]).arm_lengths()
[[1, 0], [1, 0], [0]]
>>> Partition([Integer(2),Integer(2),Integer(1)]).arm_lengths(flat=True)
[1, 0, 1, 0, 0]
>>> Partition([Integer(3),Integer(3)]).arm_lengths()
[[2, 1, 0], [2, 1, 0]]
>>> Partition([Integer(3),Integer(3)]).arm_lengths(flat=True)
[2, 1, 0, 2, 1, 0]

arms_legs_coeff(i, j)[source]#

This is a statistic on a cell $$c = (i,j)$$ in the diagram of partition $$p$$ given by

$\frac{ 1 - q^a \cdot t^{\ell + 1} }{ 1 - q^{a + 1} \cdot t^{\ell} }$

where $$a$$ is the arm length of $$c$$ and $$\ell$$ is the leg length of $$c$$.

The coordinates i and j of the cell are understood to be $$0$$-based, so that (0, 0) is the northwesternmost cell (in English notation).

EXAMPLES:

sage: Partition([3,2,1]).arms_legs_coeff(1,1)
(-t + 1)/(-q + 1)
sage: Partition([3,2,1]).arms_legs_coeff(0,0)
(-q^2*t^3 + 1)/(-q^3*t^2 + 1)
sage: Partition([3,2,1]).arms_legs_coeff(*[0,0])
(-q^2*t^3 + 1)/(-q^3*t^2 + 1)

>>> from sage.all import *
>>> Partition([Integer(3),Integer(2),Integer(1)]).arms_legs_coeff(Integer(1),Integer(1))
(-t + 1)/(-q + 1)
>>> Partition([Integer(3),Integer(2),Integer(1)]).arms_legs_coeff(Integer(0),Integer(0))
(-q^2*t^3 + 1)/(-q^3*t^2 + 1)
>>> Partition([Integer(3),Integer(2),Integer(1)]).arms_legs_coeff(*[Integer(0),Integer(0)])
(-q^2*t^3 + 1)/(-q^3*t^2 + 1)

atom()[source]#

Return a list of the standard tableaux of size self.size() whose atom is equal to self.

EXAMPLES:

sage: Partition([2,1]).atom()
[[[1, 2], [3]]]
sage: Partition([3,2,1]).atom()
[[[1, 2, 3, 6], [4, 5]], [[1, 2, 3], [4, 5], [6]]]

>>> from sage.all import *
>>> Partition([Integer(2),Integer(1)]).atom()
[[[1, 2], [3]]]
>>> Partition([Integer(3),Integer(2),Integer(1)]).atom()
[[[1, 2, 3, 6], [4, 5]], [[1, 2, 3], [4, 5], [6]]]

attacking_pairs()[source]#

Return a list of the attacking pairs of the Young diagram of self.

A pair of cells $$(c, d)$$ of a Young diagram (in English notation) is said to be attacking if one of the following conditions holds:

1. $$c$$ and $$d$$ lie in the same row with $$c$$ strictly to the west of $$d$$.

2. $$c$$ is in the row immediately to the south of $$d$$, and $$c$$ lies strictly east of $$d$$.

This particular method returns each pair $$(c, d)$$ as a tuple, where each of $$c$$ and $$d$$ is given as a tuple $$(i, j)$$ with $$i$$ and $$j$$ zero-based (so $$i = 0$$ means that the cell lies in the topmost row).

EXAMPLES:

sage: p = Partition([3, 2])
sage: p.attacking_pairs()
[((0, 0), (0, 1)),
((0, 0), (0, 2)),
((0, 1), (0, 2)),
((1, 0), (1, 1)),
((1, 1), (0, 0))]
sage: Partition([]).attacking_pairs()
[]

>>> from sage.all import *
>>> p = Partition([Integer(3), Integer(2)])
>>> p.attacking_pairs()
[((0, 0), (0, 1)),
((0, 0), (0, 2)),
((0, 1), (0, 2)),
((1, 0), (1, 1)),
((1, 1), (0, 0))]
>>> Partition([]).attacking_pairs()
[]

aut(t=0, q=0)[source]#

Return the size of the centralizer of any permutation of cycle type self.

If $$m_i$$ is the multiplicity of $$i$$ as a part of $$p$$, this is given by

$\prod_i m_i! i^{m_i}.$

Including the optional parameters $$t$$ and $$q$$ gives the $$q,t$$ analog, which is the former product times

$\prod_{i=1}^{\mathrm{length}(p)} \frac{1 - q^{p_i}}{1 - t^{p_i}}.$

See Section 1.3, p. 24, in [Ke1991].

EXAMPLES:

sage: Partition([2,2,1]).centralizer_size()
8
sage: Partition([2,2,2]).centralizer_size()
48
sage: Partition([2,2,1]).centralizer_size(q=2, t=3)
9/16
sage: Partition([]).centralizer_size()
1
sage: Partition([]).centralizer_size(q=2, t=4)
1

>>> from sage.all import *
>>> Partition([Integer(2),Integer(2),Integer(1)]).centralizer_size()
8
>>> Partition([Integer(2),Integer(2),Integer(2)]).centralizer_size()
48
>>> Partition([Integer(2),Integer(2),Integer(1)]).centralizer_size(q=Integer(2), t=Integer(3))
9/16
>>> Partition([]).centralizer_size()
1
>>> Partition([]).centralizer_size(q=Integer(2), t=Integer(4))
1

beta_numbers(length=None)[source]#

Return the set of beta numbers corresponding to self.

The optional argument length specifies the length of the beta set (which must be at least the length of self).

For more on beta numbers, see frobenius_coordinates().

EXAMPLES:

sage: Partition([4,3,2]).beta_numbers()
[6, 4, 2]
sage: Partition([4,3,2]).beta_numbers(5)
[8, 6, 4, 1, 0]
sage: Partition([]).beta_numbers()
[]
sage: Partition([]).beta_numbers(3)
[2, 1, 0]
sage: Partition([6,4,1,1]).beta_numbers()
[9, 6, 2, 1]
sage: Partition([6,4,1,1]).beta_numbers(6)
[11, 8, 4, 3, 1, 0]
sage: Partition([1,1,1]).beta_numbers()
[3, 2, 1]
sage: Partition([1,1,1]).beta_numbers(4)
[4, 3, 2, 0]

>>> from sage.all import *
>>> Partition([Integer(4),Integer(3),Integer(2)]).beta_numbers()
[6, 4, 2]
>>> Partition([Integer(4),Integer(3),Integer(2)]).beta_numbers(Integer(5))
[8, 6, 4, 1, 0]
>>> Partition([]).beta_numbers()
[]
>>> Partition([]).beta_numbers(Integer(3))
[2, 1, 0]
>>> Partition([Integer(6),Integer(4),Integer(1),Integer(1)]).beta_numbers()
[9, 6, 2, 1]
>>> Partition([Integer(6),Integer(4),Integer(1),Integer(1)]).beta_numbers(Integer(6))
[11, 8, 4, 3, 1, 0]
>>> Partition([Integer(1),Integer(1),Integer(1)]).beta_numbers()
[3, 2, 1]
>>> Partition([Integer(1),Integer(1),Integer(1)]).beta_numbers(Integer(4))
[4, 3, 2, 0]

block(e, multicharge=(0,))[source]#

Return a dictionary $$\beta$$ that determines the block associated to the partition self and the quantum_characteristic() e.

INPUT:

• e – the quantum characteristic

• multicharge – the multicharge (default $$(0,)$$)

OUTPUT:

• A dictionary giving the multiplicities of the residues in the partition tuple self

In more detail, the value beta[i] is equal to the number of nodes of residue i. This corresponds to the positive root

$\sum_{i\in I} \beta_i \alpha_i \in Q^+,$

a element of the positive root lattice of the corresponding Kac-Moody algebra. See [DJM1998] and [BK2009] for more details.

This is a useful statistics because two Specht modules for a Hecke algebra of type $$A$$ belong to the same block if and only if they correspond to same element $$\beta$$ of the root lattice, given above.

We return a dictionary because when the quantum characteristic is $$0$$, the Cartan type is $$A_{\infty}$$, in which case the simple roots are indexed by the integers.

EXAMPLES:

sage: Partition([4,3,2]).block(0)
{-2: 1, -1: 2, 0: 2, 1: 2, 2: 1, 3: 1}
sage: Partition([4,3,2]).block(2)
{0: 4, 1: 5}
sage: Partition([4,3,2]).block(2, multicharge=(1,))
{0: 5, 1: 4}
sage: Partition([4,3,2]).block(3)
{0: 3, 1: 3, 2: 3}
sage: Partition([4,3,2]).block(4)
{0: 2, 1: 2, 2: 2, 3: 3}

>>> from sage.all import *
>>> Partition([Integer(4),Integer(3),Integer(2)]).block(Integer(0))
{-2: 1, -1: 2, 0: 2, 1: 2, 2: 1, 3: 1}
>>> Partition([Integer(4),Integer(3),Integer(2)]).block(Integer(2))
{0: 4, 1: 5}
>>> Partition([Integer(4),Integer(3),Integer(2)]).block(Integer(2), multicharge=(Integer(1),))
{0: 5, 1: 4}
>>> Partition([Integer(4),Integer(3),Integer(2)]).block(Integer(3))
{0: 3, 1: 3, 2: 3}
>>> Partition([Integer(4),Integer(3),Integer(2)]).block(Integer(4))
{0: 2, 1: 2, 2: 2, 3: 3}

boundary()[source]#

Return the integer coordinates of points on the boundary of self.

For the following description, picture the Ferrer’s diagram of self using the French convention. Recall that the French convention puts the longest row on the bottom and the shortest row on the top. In addition, interpret the Ferrer’s diagram as 1 x 1 cells in the Euclidean plane. So if self was the partition [3, 1], the lower-left vertices of the 1 x 1 cells in the Ferrer’s diagram would be (0, 0), (1, 0), (2, 0), and (0, 1).

The boundary of a partition is the set $$\{ \text{NE}(d) \mid \forall d\:\text{diagonal} \}$$. That is, for every diagonal line $$y = x + b$$ where $$b \in \mathbb{Z}$$, we find the northeasternmost (NE) point on that diagonal which is also in the Ferrer’s diagram.

The boundary will go from bottom-right to top-left.

EXAMPLES:

Consider the partition (1) depicted as a square on a cartesian plane with vertices (0, 0), (1, 0), (1, 1), and (0, 1). Three of those vertices in the appropriate order form the boundary:

sage: Partition([1]).boundary()
[(1, 0), (1, 1), (0, 1)]

>>> from sage.all import *
>>> Partition([Integer(1)]).boundary()
[(1, 0), (1, 1), (0, 1)]


The partition (3, 1) can be visualized as three squares on a cartesian plane. The coordinates of the appropriate vertices form the boundary:

sage: Partition([3, 1]).boundary()
[(3, 0), (3, 1), (2, 1), (1, 1), (1, 2), (0, 2)]

>>> from sage.all import *
>>> Partition([Integer(3), Integer(1)]).boundary()
[(3, 0), (3, 1), (2, 1), (1, 1), (1, 2), (0, 2)]


k_rim(). You might have been looking for k_boundary() instead.

cell_poset(orientation='SE')[source]#

Return the Young diagram of self as a poset. The optional keyword variable orientation determines the order relation of the poset.

The poset always uses the set of cells of the Young diagram of self as its ground set. The order relation of the poset depends on the orientation variable (which defaults to "SE"). Concretely, orientation has to be specified to one of the strings "NW", "NE", "SW", and "SE", standing for “northwest”, “northeast”, “southwest” and “southeast”, respectively. If orientation is "SE", then the order relation of the poset is such that a cell $$u$$ is greater or equal to a cell $$v$$ in the poset if and only if $$u$$ lies weakly southeast of $$v$$ (this means that $$u$$ can be reached from $$v$$ by a sequence of south and east steps; the sequence is allowed to consist of south steps only, or of east steps only, or even be empty). Similarly the order relation is defined for the other three orientations. The Young diagram is supposed to be drawn in English notation.

The elements of the poset are the cells of the Young diagram of self, written as tuples of zero-based coordinates (so that $$(3, 7)$$ stands for the $$8$$-th cell of the $$4$$-th row, etc.).

EXAMPLES:

sage: # needs sage.graphs
sage: p = Partition([3,3,1])
sage: Q = p.cell_poset(); Q
Finite poset containing 7 elements
sage: sorted(Q)
[(0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2), (2, 0)]
sage: sorted(Q.maximal_elements())
[(1, 2), (2, 0)]
sage: Q.minimal_elements()
[(0, 0)]
sage: sorted(Q.upper_covers((1, 0)))
[(1, 1), (2, 0)]
sage: Q.upper_covers((1, 1))
[(1, 2)]

sage: # needs sage.graphs
sage: P = p.cell_poset(orientation="NW"); P
Finite poset containing 7 elements
sage: sorted(P)
[(0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2), (2, 0)]
sage: sorted(P.minimal_elements())
[(1, 2), (2, 0)]
sage: P.maximal_elements()
[(0, 0)]
sage: P.upper_covers((2, 0))
[(1, 0)]
sage: sorted(P.upper_covers((1, 2)))
[(0, 2), (1, 1)]
sage: sorted(P.upper_covers((1, 1)))
[(0, 1), (1, 0)]
sage: sorted([len(P.upper_covers(v)) for v in P])
[0, 1, 1, 1, 1, 2, 2]

sage: # needs sage.graphs
sage: R = p.cell_poset(orientation="NE"); R
Finite poset containing 7 elements
sage: sorted(R)
[(0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2), (2, 0)]
sage: R.maximal_elements()
[(0, 2)]
sage: R.minimal_elements()
[(2, 0)]
sage: sorted([len(R.upper_covers(v)) for v in R])
[0, 1, 1, 1, 1, 2, 2]
sage: R.is_isomorphic(P)
False
sage: R.is_isomorphic(P.dual())
False

>>> from sage.all import *
>>> # needs sage.graphs
>>> p = Partition([Integer(3),Integer(3),Integer(1)])
>>> Q = p.cell_poset(); Q
Finite poset containing 7 elements
>>> sorted(Q)
[(0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2), (2, 0)]
>>> sorted(Q.maximal_elements())
[(1, 2), (2, 0)]
>>> Q.minimal_elements()
[(0, 0)]
>>> sorted(Q.upper_covers((Integer(1), Integer(0))))
[(1, 1), (2, 0)]
>>> Q.upper_covers((Integer(1), Integer(1)))
[(1, 2)]

>>> # needs sage.graphs
>>> P = p.cell_poset(orientation="NW"); P
Finite poset containing 7 elements
>>> sorted(P)
[(0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2), (2, 0)]
>>> sorted(P.minimal_elements())
[(1, 2), (2, 0)]
>>> P.maximal_elements()
[(0, 0)]
>>> P.upper_covers((Integer(2), Integer(0)))
[(1, 0)]
>>> sorted(P.upper_covers((Integer(1), Integer(2))))
[(0, 2), (1, 1)]
>>> sorted(P.upper_covers((Integer(1), Integer(1))))
[(0, 1), (1, 0)]
>>> sorted([len(P.upper_covers(v)) for v in P])
[0, 1, 1, 1, 1, 2, 2]

>>> # needs sage.graphs
>>> R = p.cell_poset(orientation="NE"); R
Finite poset containing 7 elements
>>> sorted(R)
[(0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2), (2, 0)]
>>> R.maximal_elements()
[(0, 2)]
>>> R.minimal_elements()
[(2, 0)]
>>> sorted([len(R.upper_covers(v)) for v in R])
[0, 1, 1, 1, 1, 2, 2]
>>> R.is_isomorphic(P)
False
>>> R.is_isomorphic(P.dual())
False


Linear extensions of p.cell_poset() are in 1-to-1 correspondence with standard Young tableaux of shape $$p$$:

sage: all( len(p.cell_poset().linear_extensions())                          # needs sage.graphs
....:      == len(p.standard_tableaux())
....:      for n in range(8) for p in Partitions(n) )
True

>>> from sage.all import *
>>> all( len(p.cell_poset().linear_extensions())                          # needs sage.graphs
...      == len(p.standard_tableaux())
...      for n in range(Integer(8)) for p in Partitions(n) )
True


This is not the case for northeast orientation:

sage: q = Partition([3, 1])
sage: q.cell_poset(orientation="NE").is_chain()                             # needs sage.graphs
True

>>> from sage.all import *
>>> q = Partition([Integer(3), Integer(1)])
>>> q.cell_poset(orientation="NE").is_chain()                             # needs sage.graphs
True

cells()[source]#

Return the coordinates of the cells of self.

EXAMPLES:

sage: Partition([2,2]).cells()
[(0, 0), (0, 1), (1, 0), (1, 1)]
sage: Partition([3,2]).cells()
[(0, 0), (0, 1), (0, 2), (1, 0), (1, 1)]

>>> from sage.all import *
>>> Partition([Integer(2),Integer(2)]).cells()
[(0, 0), (0, 1), (1, 0), (1, 1)]
>>> Partition([Integer(3),Integer(2)]).cells()
[(0, 0), (0, 1), (0, 2), (1, 0), (1, 1)]

centralizer_size(t=0, q=0)[source]#

Return the size of the centralizer of any permutation of cycle type self.

If $$m_i$$ is the multiplicity of $$i$$ as a part of $$p$$, this is given by

$\prod_i m_i! i^{m_i}.$

Including the optional parameters $$t$$ and $$q$$ gives the $$q,t$$ analog, which is the former product times

$\prod_{i=1}^{\mathrm{length}(p)} \frac{1 - q^{p_i}}{1 - t^{p_i}}.$

See Section 1.3, p. 24, in [Ke1991].

EXAMPLES:

sage: Partition([2,2,1]).centralizer_size()
8
sage: Partition([2,2,2]).centralizer_size()
48
sage: Partition([2,2,1]).centralizer_size(q=2, t=3)
9/16
sage: Partition([]).centralizer_size()
1
sage: Partition([]).centralizer_size(q=2, t=4)
1

>>> from sage.all import *
>>> Partition([Integer(2),Integer(2),Integer(1)]).centralizer_size()
8
>>> Partition([Integer(2),Integer(2),Integer(2)]).centralizer_size()
48
>>> Partition([Integer(2),Integer(2),Integer(1)]).centralizer_size(q=Integer(2), t=Integer(3))
9/16
>>> Partition([]).centralizer_size()
1
>>> Partition([]).centralizer_size(q=Integer(2), t=Integer(4))
1

character_polynomial()[source]#

Return the character polynomial associated to the partition self.

The character polynomial $$q_\mu$$ associated to a partition $$\mu$$ is defined by

$q_\mu(x_1, x_2, \ldots, x_k) = \downarrow \sum_{\alpha \vdash k} \frac{ \chi^\mu_\alpha }{1^{a_1}2^{a_2}\cdots k^{a_k}a_1!a_2!\cdots a_k!} \prod_{i=1}^{k} (ix_i-1)^{a_i}$

where $$k$$ is the size of $$\mu$$, and $$a_i$$ is the multiplicity of $$i$$ in $$\alpha$$.

It is computed in the following manner:

1. Expand the Schur function $$s_\mu$$ in the power-sum basis,

2. Replace each $$p_i$$ with $$ix_i-1$$,

3. Apply the umbral operator $$\downarrow$$ to the resulting polynomial.

EXAMPLES:

sage: Partition([1]).character_polynomial()                                 # needs sage.modules
x - 1
sage: Partition([1,1]).character_polynomial()                               # needs sage.modules
1/2*x0^2 - 3/2*x0 - x1 + 1
sage: Partition([2,1]).character_polynomial()                               # needs sage.modules
1/3*x0^3 - 2*x0^2 + 8/3*x0 - x2

>>> from sage.all import *
>>> Partition([Integer(1)]).character_polynomial()                                 # needs sage.modules
x - 1
>>> Partition([Integer(1),Integer(1)]).character_polynomial()                               # needs sage.modules
1/2*x0^2 - 3/2*x0 - x1 + 1
>>> Partition([Integer(2),Integer(1)]).character_polynomial()                               # needs sage.modules
1/3*x0^3 - 2*x0^2 + 8/3*x0 - x2

components()[source]#

Return a list containing the shape of self.

This method exists only for compatibility with PartitionTuples.

EXAMPLES:

sage: Partition([3,2]).components()
[[3, 2]]

>>> from sage.all import *
>>> Partition([Integer(3),Integer(2)]).components()
[[3, 2]]

conjugacy_class_size()[source]#

Return the size of the conjugacy class of the symmetric group indexed by self.

EXAMPLES:

sage: Partition([2,2,2]).conjugacy_class_size()
15
sage: Partition([2,2,1]).conjugacy_class_size()
15
sage: Partition([2,1,1]).conjugacy_class_size()
6

>>> from sage.all import *
>>> Partition([Integer(2),Integer(2),Integer(2)]).conjugacy_class_size()
15
>>> Partition([Integer(2),Integer(2),Integer(1)]).conjugacy_class_size()
15
>>> Partition([Integer(2),Integer(1),Integer(1)]).conjugacy_class_size()
6

conjugate()[source]#

Return the conjugate partition of the partition self. This is also called the associated partition or the transpose in the literature.

EXAMPLES:

sage: Partition([2,2]).conjugate()
[2, 2]
sage: Partition([6,3,1]).conjugate()
[3, 2, 2, 1, 1, 1]

>>> from sage.all import *
>>> Partition([Integer(2),Integer(2)]).conjugate()
[2, 2]
>>> Partition([Integer(6),Integer(3),Integer(1)]).conjugate()
[3, 2, 2, 1, 1, 1]


The conjugate partition is obtained by transposing the Ferrers diagram of the partition (see ferrers_diagram()):

sage: print(Partition([6,3,1]).ferrers_diagram())
******
***
*
sage: print(Partition([6,3,1]).conjugate().ferrers_diagram())
***
**
**
*
*
*

>>> from sage.all import *
>>> print(Partition([Integer(6),Integer(3),Integer(1)]).ferrers_diagram())
******
***
*
>>> print(Partition([Integer(6),Integer(3),Integer(1)]).conjugate().ferrers_diagram())
***
**
**
*
*
*

contains(x)[source]#

Return True if x is a partition whose Ferrers diagram is contained in the Ferrers diagram of self.

EXAMPLES:

sage: p = Partition([3,2,1])
sage: p.contains([2,1])
True
sage: all(p.contains(mu) for mu in Partitions(3))
True
sage: all(p.contains(mu) for mu in Partitions(4))
False

>>> from sage.all import *
>>> p = Partition([Integer(3),Integer(2),Integer(1)])
>>> p.contains([Integer(2),Integer(1)])
True
>>> all(p.contains(mu) for mu in Partitions(Integer(3)))
True
>>> all(p.contains(mu) for mu in Partitions(Integer(4)))
False

content(r, c, multicharge=(0,))[source]#

Return the content of the cell at row $$r$$ and column $$c$$.

The content of a cell is $$c - r$$.

For consistency with partition tuples there is also an optional multicharge argument which is an offset to the usual content. By setting the multicharge equal to the 0-element of the ring $$\ZZ/e\ZZ$$, the corresponding $$e$$-residue will be returned. This is the content modulo $$e$$.

The content (and residue) do not strictly depend on the partition, however, this method is included because it is often useful in the context of partitions.

EXAMPLES:

sage: Partition([2,1]).content(1,0)
-1
sage: p = Partition([3,2])
sage: sum([p.content(*c) for c in p.cells()])
2

>>> from sage.all import *
>>> Partition([Integer(2),Integer(1)]).content(Integer(1),Integer(0))
-1
>>> p = Partition([Integer(3),Integer(2)])
>>> sum([p.content(*c) for c in p.cells()])
2


and now we return the 3-residue of a cell:

sage: Partition([2,1]).content(1,0, multicharge=[IntegerModRing(3)(0)])
2

>>> from sage.all import *
>>> Partition([Integer(2),Integer(1)]).content(Integer(1),Integer(0), multicharge=[IntegerModRing(Integer(3))(Integer(0))])
2

contents_tableau(multicharge=(0,))[source]#

Return the tableau which has (k,r,c)-th cell equal to the content multicharge[k] - r + c of the cell.

EXAMPLES:

sage: Partition([2,1]).contents_tableau()
[[0, 1], [-1]]
sage: Partition([3,2,1,1]).contents_tableau().pp()
0  1  2
-1  0
-2
-3
sage: Partition([3,2,1,1]).contents_tableau([ IntegerModRing(3)(0)] ).pp()
0  1  2
2  0
1
0

>>> from sage.all import *
>>> Partition([Integer(2),Integer(1)]).contents_tableau()
[[0, 1], [-1]]
>>> Partition([Integer(3),Integer(2),Integer(1),Integer(1)]).contents_tableau().pp()
0  1  2
-1  0
-2
-3
>>> Partition([Integer(3),Integer(2),Integer(1),Integer(1)]).contents_tableau([ IntegerModRing(Integer(3))(Integer(0))] ).pp()
0  1  2
2  0
1
0

core(length)[source]#

Return the length-core of the partition – in the literature the core is commonly referred to as the $$k$$-core, $$p$$-core, $$r$$-core, … .

The $$r$$-core of a partition $$\lambda$$ can be obtained by repeatedly removing rim hooks of size $$r$$ from (the Young diagram of) $$\lambda$$ until this is no longer possible. The remaining partition is the core.

EXAMPLES:

sage: Partition([6,3,2,2]).core(3)
[2, 1, 1]
sage: Partition([]).core(3)
[]
sage: Partition([8,7,7,4,1,1,1,1,1]).core(3)
[2, 1, 1]

>>> from sage.all import *
>>> Partition([Integer(6),Integer(3),Integer(2),Integer(2)]).core(Integer(3))
[2, 1, 1]
>>> Partition([]).core(Integer(3))
[]
>>> Partition([Integer(8),Integer(7),Integer(7),Integer(4),Integer(1),Integer(1),Integer(1),Integer(1),Integer(1)]).core(Integer(3))
[2, 1, 1]

corners()[source]#

Return a list of the corners of the partition self.

A corner of a partition $$\lambda$$ is a cell of the Young diagram of $$\lambda$$ which can be removed from the Young diagram while still leaving a straight shape behind.

The entries of the list returned are pairs of the form $$(i,j)$$, where $$i$$ and $$j$$ are the coordinates of the respective corner. The coordinates are counted from $$0$$.

Note

This is referred to as an “inner corner” in [Sag2001].

EXAMPLES:

sage: Partition([3,2,1]).corners()
[(0, 2), (1, 1), (2, 0)]
sage: Partition([3,3,1]).corners()
[(1, 2), (2, 0)]
sage: Partition([]).corners()
[]

>>> from sage.all import *
>>> Partition([Integer(3),Integer(2),Integer(1)]).corners()
[(0, 2), (1, 1), (2, 0)]
>>> Partition([Integer(3),Integer(3),Integer(1)]).corners()
[(1, 2), (2, 0)]
>>> Partition([]).corners()
[]

corners_residue(i, l)[source]#

Return a list of the corners of the partition self having l-residue i.

A corner of a partition $$\lambda$$ is a cell of the Young diagram of $$\lambda$$ which can be removed from the Young diagram while still leaving a straight shape behind. See residue() for the definition of the l-residue.

The entries of the list returned are pairs of the form $$(i,j)$$, where $$i$$ and $$j$$ are the coordinates of the respective corner. The coordinates are counted from $$0$$.

EXAMPLES:

sage: Partition([3,2,1]).corners_residue(0, 3)
[(1, 1)]
sage: Partition([3,2,1]).corners_residue(1, 3)
[(2, 0)]
sage: Partition([3,2,1]).corners_residue(2, 3)
[(0, 2)]

>>> from sage.all import *
>>> Partition([Integer(3),Integer(2),Integer(1)]).corners_residue(Integer(0), Integer(3))
[(1, 1)]
>>> Partition([Integer(3),Integer(2),Integer(1)]).corners_residue(Integer(1), Integer(3))
[(2, 0)]
>>> Partition([Integer(3),Integer(2),Integer(1)]).corners_residue(Integer(2), Integer(3))
[(0, 2)]

crank()[source]#

Return the Dyson crank of self.

The Dyson crank of a partition $$\lambda$$ is defined as follows: If $$\lambda$$ contains at least one $$1$$, then the crank is $$\mu(\lambda) - \omega(\lambda)$$, where $$\omega(\lambda)$$ is the number of $$1s in \lambda$$, and $$\mu(\lambda)$$ is the number of parts of $$\lambda$$ larger than $$\omega(\lambda)$$. If $$\lambda$$ contains no $$1$$, then the crank is simply the largest part of $$\lambda$$.

REFERENCES:

EXAMPLES:

sage: Partition([]).crank()
0
sage: Partition([3,2,2]).crank()
3
sage: Partition([5,4,2,1,1]).crank()
0
sage: Partition([1,1,1]).crank()
-3
sage: Partition([6,4,4,3]).crank()
6
sage: Partition([6,3,3,1,1]).crank()
1
sage: Partition([6]).crank()
6
sage: Partition([5,1]).crank()
0
sage: Partition([4,2]).crank()
4
sage: Partition([4,1,1]).crank()
-1
sage: Partition([3,3]).crank()
3
sage: Partition([3,2,1]).crank()
1
sage: Partition([3,1,1,1]).crank()
-3
sage: Partition([2,2,2]).crank()
2
sage: Partition([2,2,1,1]).crank()
-2
sage: Partition([2,1,1,1,1]).crank()
-4
sage: Partition([1,1,1,1,1,1]).crank()
-6

>>> from sage.all import *
>>> Partition([]).crank()
0
>>> Partition([Integer(3),Integer(2),Integer(2)]).crank()
3
>>> Partition([Integer(5),Integer(4),Integer(2),Integer(1),Integer(1)]).crank()
0
>>> Partition([Integer(1),Integer(1),Integer(1)]).crank()
-3
>>> Partition([Integer(6),Integer(4),Integer(4),Integer(3)]).crank()
6
>>> Partition([Integer(6),Integer(3),Integer(3),Integer(1),Integer(1)]).crank()
1
>>> Partition([Integer(6)]).crank()
6
>>> Partition([Integer(5),Integer(1)]).crank()
0
>>> Partition([Integer(4),Integer(2)]).crank()
4
>>> Partition([Integer(4),Integer(1),Integer(1)]).crank()
-1
>>> Partition([Integer(3),Integer(3)]).crank()
3
>>> Partition([Integer(3),Integer(2),Integer(1)]).crank()
1
>>> Partition([Integer(3),Integer(1),Integer(1),Integer(1)]).crank()
-3
>>> Partition([Integer(2),Integer(2),Integer(2)]).crank()
2
>>> Partition([Integer(2),Integer(2),Integer(1),Integer(1)]).crank()
-2
>>> Partition([Integer(2),Integer(1),Integer(1),Integer(1),Integer(1)]).crank()
-4
>>> Partition([Integer(1),Integer(1),Integer(1),Integer(1),Integer(1),Integer(1)]).crank()
-6

defect(e, multicharge=(0,))[source]#

Return the e-defect or the e-weight of self.

The $$e$$-defect is the number of (connected) $$e$$-rim hooks that can be removed from the partition.

The defect of a partition is given by

$\text{defect}(\beta) = (\Lambda, \beta) - \tfrac12(\beta, \beta),$

where $$\Lambda = \sum_r \Lambda_{\kappa_r}$$ for the multicharge $$(\kappa_1, \ldots, \kappa_{\ell})$$ and $$\beta = \sum_{(r,c)} \alpha_{(c-r) \pmod e}$$, with the sum being over the cells in the partition.

INPUT:

• e – the quantum characteristic

• multicharge – the multicharge (default $$(0,)$$)

OUTPUT:

• a non-negative integer, which is the defect of the block containing the partition self

EXAMPLES:

sage: Partition([4,3,2]).defect(2)
3
sage: Partition([0]).defect(2)
0
sage: Partition([3]).defect(2)
1
sage: Partition([6]).defect(2)
3
sage: Partition([9]).defect(2)
4
sage: Partition([12]).defect(2)
6
sage: Partition([4,3,2]).defect(3)
3
sage: Partition([0]).defect(3)
0
sage: Partition([3]).defect(3)
1
sage: Partition([6]).defect(3)
2
sage: Partition([9]).defect(3)
3
sage: Partition([12]).defect(3)
4

>>> from sage.all import *
>>> Partition([Integer(4),Integer(3),Integer(2)]).defect(Integer(2))
3
>>> Partition([Integer(0)]).defect(Integer(2))
0
>>> Partition([Integer(3)]).defect(Integer(2))
1
>>> Partition([Integer(6)]).defect(Integer(2))
3
>>> Partition([Integer(9)]).defect(Integer(2))
4
>>> Partition([Integer(12)]).defect(Integer(2))
6
>>> Partition([Integer(4),Integer(3),Integer(2)]).defect(Integer(3))
3
>>> Partition([Integer(0)]).defect(Integer(3))
0
>>> Partition([Integer(3)]).defect(Integer(3))
1
>>> Partition([Integer(6)]).defect(Integer(3))
2
>>> Partition([Integer(9)]).defect(Integer(3))
3
>>> Partition([Integer(12)]).defect(Integer(3))
4

degree(e)[source]#

Return the e-th degree of self.

The $$e$$-th degree of a partition $$\lambda$$ is the sum of the $$e$$-th degrees of the standard tableaux of shape $$\lambda$$. The $$e$$-th degree is the exponent of $$\Phi_e(q)$$ in the Gram determinant of the Specht module for a semisimple Iwahori-Hecke algebra of type $$A$$ with parameter $$q$$.

INPUT:

• e – an integer $$e > 1$$

OUTPUT:

A non-negative integer.

EXAMPLES:

sage: Partition([4,3]).degree(2)
28
sage: Partition([4,3]).degree(3)
15
sage: Partition([4,3]).degree(4)
8
sage: Partition([4,3]).degree(5)
13
sage: Partition([4,3]).degree(6)
0
sage: Partition([4,3]).degree(7)
0

>>> from sage.all import *
>>> Partition([Integer(4),Integer(3)]).degree(Integer(2))
28
>>> Partition([Integer(4),Integer(3)]).degree(Integer(3))
15
>>> Partition([Integer(4),Integer(3)]).degree(Integer(4))
8
>>> Partition([Integer(4),Integer(3)]).degree(Integer(5))
13
>>> Partition([Integer(4),Integer(3)]).degree(Integer(6))
0
>>> Partition([Integer(4),Integer(3)]).degree(Integer(7))
0


Therefore, the Gram determinant of $$S(5,3)$$ when the Hecke parameter $$q$$ is “generic” is

$q^N \Phi_2(q)^{28} \Phi_3(q)^{15} \Phi_4(q)^8 \Phi_5(q)^{13}$

for some integer $$N$$. Compare with prime_degree().

dimension(smaller=None, k=1)[source]#

Return the number of paths from the smaller partition to the partition self, where each step consists of adding a $$k$$-ribbon while keeping a partition.

Note that a 1-ribbon is just a single cell, so this counts paths in the Young graph when $$k = 1$$.

Note also that the default case ($$k = 1$$ and smaller = []) gives the dimension of the irreducible representation of the symmetric group corresponding to self.

INPUT:

• smaller – a partition (default: an empty list [])

• $$k$$ – a positive integer (default: 1)

OUTPUT:

The number of such paths

EXAMPLES:

Looks at the number of ways of getting from [5,4] to the empty partition, removing one cell at a time:

sage: mu = Partition([5,4])
sage: mu.dimension()
42

>>> from sage.all import *
>>> mu = Partition([Integer(5),Integer(4)])
>>> mu.dimension()
42


Same, but removing one 3-ribbon at a time. Note that the 3-core of mu is empty:

sage: mu.dimension(k=3)
3

>>> from sage.all import *
>>> mu.dimension(k=Integer(3))
3


The 2-core of mu is not the empty partition:

sage: mu.dimension(k=2)
0

>>> from sage.all import *
>>> mu.dimension(k=Integer(2))
0


Indeed, the 2-core of mu is [1]:

sage: mu.dimension(Partition([1]),k=2)
2

>>> from sage.all import *
>>> mu.dimension(Partition([Integer(1)]),k=Integer(2))
2


ALGORITHM:

Depending on the parameters given, different simplifications occur. When $$k=1$$ and smaller is empty, this function uses the hook formula. When $$k=1$$ and smaller is not empty, it uses a formula from [ORV].

When $$k \neq 1$$, we first check that both self and smaller have the same $$k$$-core, then use the $$k$$-quotients and the same algorithm on each of the $$k$$-quotients.

AUTHORS:

• Paul-Olivier Dehaye (2011-06-07)

dominated_partitions(rows=None)[source]#

Return a list of the partitions dominated by $$n$$. If rows is specified, then it only returns the ones whose number of rows is at most rows.

EXAMPLES:

sage: Partition([3,2,1]).dominated_partitions()
[[3, 2, 1], [3, 1, 1, 1], [2, 2, 2], [2, 2, 1, 1], [2, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1]]
sage: Partition([3,2,1]).dominated_partitions(rows=3)
[[3, 2, 1], [2, 2, 2]]

>>> from sage.all import *
>>> Partition([Integer(3),Integer(2),Integer(1)]).dominated_partitions()
[[3, 2, 1], [3, 1, 1, 1], [2, 2, 2], [2, 2, 1, 1], [2, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1]]
>>> Partition([Integer(3),Integer(2),Integer(1)]).dominated_partitions(rows=Integer(3))
[[3, 2, 1], [2, 2, 2]]

dominates(p2)[source]#

Return True if self dominates the partition p2. Otherwise it returns False.

EXAMPLES:

sage: p = Partition([3,2])
sage: p.dominates([3,1])
True
sage: p.dominates([2,2])
True
sage: p.dominates([2,1,1])
True
sage: p.dominates([3,3])
False
sage: p.dominates([4])
False
sage: Partition([4]).dominates(p)
False
sage: Partition([]).dominates([1])
False
sage: Partition([]).dominates([])
True
sage: Partition([1]).dominates([])
True

>>> from sage.all import *
>>> p = Partition([Integer(3),Integer(2)])
>>> p.dominates([Integer(3),Integer(1)])
True
>>> p.dominates([Integer(2),Integer(2)])
True
>>> p.dominates([Integer(2),Integer(1),Integer(1)])
True
>>> p.dominates([Integer(3),Integer(3)])
False
>>> p.dominates([Integer(4)])
False
>>> Partition([Integer(4)]).dominates(p)
False
>>> Partition([]).dominates([Integer(1)])
False
>>> Partition([]).dominates([])
True
>>> Partition([Integer(1)]).dominates([])
True

down()[source]#

Return a generator for partitions that can be obtained from self by removing a cell.

EXAMPLES:

sage: [p for p in Partition([2,1,1]).down()]
[[1, 1, 1], [2, 1]]
sage: [p for p in Partition([3,2]).down()]
[[2, 2], [3, 1]]
sage: [p for p in Partition([3,2,1]).down()]
[[2, 2, 1], [3, 1, 1], [3, 2]]

>>> from sage.all import *
>>> [p for p in Partition([Integer(2),Integer(1),Integer(1)]).down()]
[[1, 1, 1], [2, 1]]
>>> [p for p in Partition([Integer(3),Integer(2)]).down()]
[[2, 2], [3, 1]]
>>> [p for p in Partition([Integer(3),Integer(2),Integer(1)]).down()]
[[2, 2, 1], [3, 1, 1], [3, 2]]

down_list()[source]#

Return a list of the partitions that can be obtained from self by removing a cell.

EXAMPLES:

sage: Partition([2,1,1]).down_list()
[[1, 1, 1], [2, 1]]
sage: Partition([3,2]).down_list()
[[2, 2], [3, 1]]
sage: Partition([3,2,1]).down_list()
[[2, 2, 1], [3, 1, 1], [3, 2]]
sage: Partition([]).down_list()  #checks :issue:11435
[]

>>> from sage.all import *
>>> Partition([Integer(2),Integer(1),Integer(1)]).down_list()
[[1, 1, 1], [2, 1]]
>>> Partition([Integer(3),Integer(2)]).down_list()
[[2, 2], [3, 1]]
>>> Partition([Integer(3),Integer(2),Integer(1)]).down_list()
[[2, 2, 1], [3, 1, 1], [3, 2]]
>>> Partition([]).down_list()  #checks :issue:11435
[]

dual_equivalence_graph(directed=False, coloring=None)[source]#

Return the dual equivalence graph of self.

Two permutations $$p$$ and $$q$$ in the symmetric group $$S_n$$ differ by an $$i$$-elementary dual equivalence (or dual Knuth) relation (where $$i$$ is an integer with $$1 < i < n$$) when the following two conditions are satisfied:

• In the one-line notation of the permutation $$p$$, the letter $$i$$ does not appear inbetween $$i-1$$ and $$i+1$$.

• The permutation $$q$$ is obtained from $$p$$ by switching two of the three letters $$i-1, i, i+1$$ (in its one-line notation) – namely, the leftmost and the rightmost one in order of their appearance in $$p$$.

Notice that this is equivalent to the statement that the permutations $$p^{-1}$$ and $$q^{-1}$$ differ by an elementary Knuth equivalence at positions $$i-1, i, i+1$$.

Two standard Young tableaux of shape $$\lambda$$ differ by an $$i$$-elementary dual equivalence relation (of color $$i$$), if their reading words differ by an $$i$$-elementary dual equivalence relation.

The dual equivalence graph of the partition $$\lambda$$ is the edge-colored graph whose vertices are the standard Young tableaux of shape $$\lambda$$, and whose edges colored by $$i$$ are given by the $$i$$-elementary dual equivalences.

INPUT:

• directed – (default: False) whether to have the dual equivalence graph be directed (where we have a directed edge $$S \to T$$ if $$i$$ appears to the left of $$i+1$$ in the reading word of $$T$$; otherwise we have the directed edge $$T \to S$$)

• coloring – (optional) a function which sends each integer $$i > 1$$ to a color (as a string, e.g., 'red' or 'black') to be used when visually representing the resulting graph using dot2tex; the default choice is 2 -> 'red', 3 -> 'blue', 4 -> 'green', 5 -> 'purple', 6 -> 'brown', 7 -> 'orange', 8 -> 'yellow', anything greater than 8 -> 'black'.

REFERENCES:

EXAMPLES:

sage: # needs sage.graphs
sage: P = Partition([3,1,1])
sage: G = P.dual_equivalence_graph()
sage: G.edges(sort=True)
[([[1, 2, 3], [4], [5]], [[1, 2, 4], [3], [5]], 3),
([[1, 2, 4], [3], [5]], [[1, 2, 5], [3], [4]], 4),
([[1, 2, 4], [3], [5]], [[1, 3, 4], [2], [5]], 2),
([[1, 2, 5], [3], [4]], [[1, 3, 5], [2], [4]], 2),
([[1, 3, 4], [2], [5]], [[1, 3, 5], [2], [4]], 4),
([[1, 3, 5], [2], [4]], [[1, 4, 5], [2], [3]], 3)]
sage: G = P.dual_equivalence_graph(directed=True)
sage: G.edges(sort=True)
[([[1, 2, 4], [3], [5]], [[1, 2, 3], [4], [5]], 3),
([[1, 2, 5], [3], [4]], [[1, 2, 4], [3], [5]], 4),
([[1, 3, 4], [2], [5]], [[1, 2, 4], [3], [5]], 2),
([[1, 3, 5], [2], [4]], [[1, 2, 5], [3], [4]], 2),
([[1, 3, 5], [2], [4]], [[1, 3, 4], [2], [5]], 4),
([[1, 4, 5], [2], [3]], [[1, 3, 5], [2], [4]], 3)]

>>> from sage.all import *
>>> # needs sage.graphs
>>> P = Partition([Integer(3),Integer(1),Integer(1)])
>>> G = P.dual_equivalence_graph()
>>> G.edges(sort=True)
[([[1, 2, 3], [4], [5]], [[1, 2, 4], [3], [5]], 3),
([[1, 2, 4], [3], [5]], [[1, 2, 5], [3], [4]], 4),
([[1, 2, 4], [3], [5]], [[1, 3, 4], [2], [5]], 2),
([[1, 2, 5], [3], [4]], [[1, 3, 5], [2], [4]], 2),
([[1, 3, 4], [2], [5]], [[1, 3, 5], [2], [4]], 4),
([[1, 3, 5], [2], [4]], [[1, 4, 5], [2], [3]], 3)]
>>> G = P.dual_equivalence_graph(directed=True)
>>> G.edges(sort=True)
[([[1, 2, 4], [3], [5]], [[1, 2, 3], [4], [5]], 3),
([[1, 2, 5], [3], [4]], [[1, 2, 4], [3], [5]], 4),
([[1, 3, 4], [2], [5]], [[1, 2, 4], [3], [5]], 2),
([[1, 3, 5], [2], [4]], [[1, 2, 5], [3], [4]], 2),
([[1, 3, 5], [2], [4]], [[1, 3, 4], [2], [5]], 4),
([[1, 4, 5], [2], [3]], [[1, 3, 5], [2], [4]], 3)]

evaluation()[source]#

Return the evaluation of self.

The commutative evaluation, often shortened to evaluation, of a word (we think of a partition as a word in $$\{1, 2, 3, \ldots\}$$) is its image in the free commutative monoid. In other words, this counts how many occurrences there are of each letter.

This is also is known as Parikh vector and abelianization and has the same output as to_exp().

EXAMPLES:

sage: Partition([4,3,1,1]).evaluation()
[2, 0, 1, 1]

>>> from sage.all import *
>>> Partition([Integer(4),Integer(3),Integer(1),Integer(1)]).evaluation()
[2, 0, 1, 1]

ferrers_diagram()[source]#

Return the Ferrers diagram of self.

EXAMPLES:

sage: mu = Partition([5,5,2,1])
sage: Partitions.options(diagram_str='*', convention="english")
sage: print(mu.ferrers_diagram())
*****
*****
**
*
sage: Partitions.options(diagram_str='▉')
sage: print(mu.ferrers_diagram())
▉▉▉▉▉
▉▉▉▉▉
▉▉
▉
sage: Partitions.options.convention="french"
sage: print(mu.ferrers_diagram())
▉
▉▉
▉▉▉▉▉
▉▉▉▉▉
sage: print(Partition([]).ferrers_diagram())
-
sage: Partitions.options(diagram_str='-')
sage: print(Partition([]).ferrers_diagram())
(/)
sage: Partitions.options._reset()

>>> from sage.all import *
>>> mu = Partition([Integer(5),Integer(5),Integer(2),Integer(1)])
>>> Partitions.options(diagram_str='*', convention="english")
>>> print(mu.ferrers_diagram())
*****
*****
**
*
>>> Partitions.options(diagram_str='▉')
>>> print(mu.ferrers_diagram())
▉▉▉▉▉
▉▉▉▉▉
▉▉
▉
>>> Partitions.options.convention="french"
>>> print(mu.ferrers_diagram())
▉
▉▉
▉▉▉▉▉
▉▉▉▉▉
>>> print(Partition([]).ferrers_diagram())
-
>>> Partitions.options(diagram_str='-')
>>> print(Partition([]).ferrers_diagram())
(/)
>>> Partitions.options._reset()

frobenius_coordinates()[source]#

Return a pair of sequences of Frobenius coordinates aka beta numbers of the partition.

These are two strictly decreasing sequences of nonnegative integers of the same length.

EXAMPLES:

sage: Partition([]).frobenius_coordinates()
([], [])
sage: Partition([1]).frobenius_coordinates()
([0], [0])
sage: Partition([3,3,3]).frobenius_coordinates()
([2, 1, 0], [2, 1, 0])
sage: Partition([9,1,1,1,1,1,1]).frobenius_coordinates()
([8], [6])

>>> from sage.all import *
>>> Partition([]).frobenius_coordinates()
([], [])
>>> Partition([Integer(1)]).frobenius_coordinates()
([0], [0])
>>> Partition([Integer(3),Integer(3),Integer(3)]).frobenius_coordinates()
([2, 1, 0], [2, 1, 0])
>>> Partition([Integer(9),Integer(1),Integer(1),Integer(1),Integer(1),Integer(1),Integer(1)]).frobenius_coordinates()
([8], [6])

frobenius_rank()[source]#

Return the Frobenius rank of the partition self.

The Frobenius rank of a partition $$\lambda = (\lambda_1, \lambda_2, \lambda_3, \cdots)$$ is defined to be the largest $$i$$ such that $$\lambda_i \geq i$$. In other words, it is the number of cells on the main diagonal of $$\lambda$$. In yet other words, it is the size of the largest square fitting into the Young diagram of $$\lambda$$.

EXAMPLES:

sage: Partition([]).frobenius_rank()
0
sage: Partition([1]).frobenius_rank()
1
sage: Partition([3,3,3]).frobenius_rank()
3
sage: Partition([9,1,1,1,1,1]).frobenius_rank()
1
sage: Partition([2,1,1,1,1,1]).frobenius_rank()
1
sage: Partition([2,2,1,1,1,1]).frobenius_rank()
2
sage: Partition([3,2]).frobenius_rank()
2
sage: Partition([3,2,2]).frobenius_rank()
2
sage: Partition([8,4,4,4,4]).frobenius_rank()
4
sage: Partition([8,4,1]).frobenius_rank()
2
sage: Partition([3,3,1]).frobenius_rank()
2

>>> from sage.all import *
>>> Partition([]).frobenius_rank()
0
>>> Partition([Integer(1)]).frobenius_rank()
1
>>> Partition([Integer(3),Integer(3),Integer(3)]).frobenius_rank()
3
>>> Partition([Integer(9),Integer(1),Integer(1),Integer(1),Integer(1),Integer(1)]).frobenius_rank()
1
>>> Partition([Integer(2),Integer(1),Integer(1),Integer(1),Integer(1),Integer(1)]).frobenius_rank()
1
>>> Partition([Integer(2),Integer(2),Integer(1),Integer(1),Integer(1),Integer(1)]).frobenius_rank()
2
>>> Partition([Integer(3),Integer(2)]).frobenius_rank()
2
>>> Partition([Integer(3),Integer(2),Integer(2)]).frobenius_rank()
2
>>> Partition([Integer(8),Integer(4),Integer(4),Integer(4),Integer(4)]).frobenius_rank()
4
>>> Partition([Integer(8),Integer(4),Integer(1)]).frobenius_rank()
2
>>> Partition([Integer(3),Integer(3),Integer(1)]).frobenius_rank()
2

from_kbounded_to_grassmannian(k)[source]#

Maps a $$k$$-bounded partition to a Grassmannian element in the affine Weyl group of type $$A_k^{(1)}$$.

For details, see the documentation of the method from_kbounded_to_reduced_word() .

EXAMPLES:

sage: p = Partition([2,1,1])
sage: p.from_kbounded_to_grassmannian(2)                                    # needs sage.modules
[-1  1  1]
[-2  2  1]
[-2  1  2]
sage: p = Partition([])
sage: p.from_kbounded_to_grassmannian(2)                                    # needs sage.modules
[1 0 0]
[0 1 0]
[0 0 1]

>>> from sage.all import *
>>> p = Partition([Integer(2),Integer(1),Integer(1)])
>>> p.from_kbounded_to_grassmannian(Integer(2))                                    # needs sage.modules
[-1  1  1]
[-2  2  1]
[-2  1  2]
>>> p = Partition([])
>>> p.from_kbounded_to_grassmannian(Integer(2))                                    # needs sage.modules
[1 0 0]
[0 1 0]
[0 0 1]

from_kbounded_to_reduced_word(k)[source]#

Maps a $$k$$-bounded partition to a reduced word for an element in the affine permutation group.

This uses the fact that there is a bijection between $$k$$-bounded partitions and $$(k+1)$$-cores and an action of the affine nilCoxeter algebra of type $$A_k^{(1)}$$ on $$(k+1)$$-cores as described in [LM2006b].

EXAMPLES:

sage: p = Partition([2,1,1])
sage: p.from_kbounded_to_reduced_word(2)
[2, 1, 2, 0]
sage: p = Partition([3,1])
sage: p.from_kbounded_to_reduced_word(3)
[3, 2, 1, 0]
sage: p.from_kbounded_to_reduced_word(2)
Traceback (most recent call last):
...
ValueError: the partition must be 2-bounded
sage: p = Partition([])
sage: p.from_kbounded_to_reduced_word(2)
[]

>>> from sage.all import *
>>> p = Partition([Integer(2),Integer(1),Integer(1)])
>>> p.from_kbounded_to_reduced_word(Integer(2))
[2, 1, 2, 0]
>>> p = Partition([Integer(3),Integer(1)])
>>> p.from_kbounded_to_reduced_word(Integer(3))
[3, 2, 1, 0]
>>> p.from_kbounded_to_reduced_word(Integer(2))
Traceback (most recent call last):
...
ValueError: the partition must be 2-bounded
>>> p = Partition([])
>>> p.from_kbounded_to_reduced_word(Integer(2))
[]

garnir_tableau(*cell)[source]#

Return the Garnir tableau of shape self corresponding to the cell cell. If cell $$= (a,c)$$ then $$(a+1,c)$$ must belong to the diagram of self.

The Garnir tableaux play an important role in integral and non-semisimple representation theory because they determine the “straightening” rules for the Specht modules over an arbitrary ring.

The Garnir tableaux are the “first” non-standard tableaux which arise when you act by simple transpositions. If $$(a,c)$$ is a cell in the Young diagram of a partition, which is not at the bottom of its column, then the corresponding Garnir tableau has the integers $$1, 2, \ldots, n$$ entered in order from left to right along the rows of the diagram up to the cell $$(a,c-1)$$, then along the cells $$(a+1,1)$$ to $$(a+1,c)$$, then $$(a,c)$$ until the end of row $$a$$ and then continuing from left to right in the remaining positions. The examples below probably make this clearer!

Note

The function also sets g._garnir_cell, where g is the resulting Garnir tableau, equal to cell which is used by some other functions.

EXAMPLES:

sage: g = Partition([5,3,3,2]).garnir_tableau((0,2)); g.pp()
1  2  6  7  8
3  4  5
9 10 11
12 13
sage: g.is_row_strict(); g.is_column_strict()
True
False

sage: Partition([5,3,3,2]).garnir_tableau(0,2).pp()
1  2  6  7  8
3  4  5
9 10 11
12 13
sage: Partition([5,3,3,2]).garnir_tableau(2,1).pp()
1  2  3  4  5
6  7  8
9 12 13
10 11
sage: Partition([5,3,3,2]).garnir_tableau(2,2).pp()
Traceback (most recent call last):
...
ValueError: (row+1, col) must be inside the diagram

>>> from sage.all import *
>>> g = Partition([Integer(5),Integer(3),Integer(3),Integer(2)]).garnir_tableau((Integer(0),Integer(2))); g.pp()
1  2  6  7  8
3  4  5
9 10 11
12 13
>>> g.is_row_strict(); g.is_column_strict()
True
False

>>> Partition([Integer(5),Integer(3),Integer(3),Integer(2)]).garnir_tableau(Integer(0),Integer(2)).pp()
1  2  6  7  8
3  4  5
9 10 11
12 13
>>> Partition([Integer(5),Integer(3),Integer(3),Integer(2)]).garnir_tableau(Integer(2),Integer(1)).pp()
1  2  3  4  5
6  7  8
9 12 13
10 11
>>> Partition([Integer(5),Integer(3),Integer(3),Integer(2)]).garnir_tableau(Integer(2),Integer(2)).pp()
Traceback (most recent call last):
...
ValueError: (row+1, col) must be inside the diagram


garsia_procesi_module(base_ring=None)[source]#

Return the Garsia-Procesi module corresponding to self.

INPUT:

• base_ring – (default: $$\QQ$$) the base ring

EXAMPLES:

sage: GP = Partition([3,2,1]).garsia_procesi_module(QQ); GP
Garsia-Procesi module of shape [3, 2, 1] over Rational Field
q^4*s[3, 2, 1] + q^3*s[3, 3] + q^3*s[4, 1, 1] + (q^3+q^2)*s[4, 2]
+ (q^2+q)*s[5, 1] + s[6]

sage: Partition([3,2,1]).garsia_procesi_module(GF(3))
Garsia-Procesi module of shape [3, 2, 1] over Finite Field of size 3

>>> from sage.all import *
>>> GP = Partition([Integer(3),Integer(2),Integer(1)]).garsia_procesi_module(QQ); GP
Garsia-Procesi module of shape [3, 2, 1] over Rational Field
q^4*s[3, 2, 1] + q^3*s[3, 3] + q^3*s[4, 1, 1] + (q^3+q^2)*s[4, 2]
+ (q^2+q)*s[5, 1] + s[6]

>>> Partition([Integer(3),Integer(2),Integer(1)]).garsia_procesi_module(GF(Integer(3)))
Garsia-Procesi module of shape [3, 2, 1] over Finite Field of size 3

generalized_pochhammer_symbol(a, alpha)[source]#

Return the generalized Pochhammer symbol $$(a)_{self}^{(\alpha)}$$. This is the product over all cells $$(i,j)$$ in self of $$a - (i-1) / \alpha + j - 1$$.

EXAMPLES:

sage: Partition([2,2]).generalized_pochhammer_symbol(2,1)
12

>>> from sage.all import *
>>> Partition([Integer(2),Integer(2)]).generalized_pochhammer_symbol(Integer(2),Integer(1))
12

get_part(i, default=0)[source]#

Return the $$i^{th}$$ part of self, or default if it does not exist.

EXAMPLES:

sage: p = Partition([2,1])
sage: p.get_part(0), p.get_part(1), p.get_part(2)
(2, 1, 0)
sage: p.get_part(10,-1)
-1
sage: Partition([]).get_part(0)
0

>>> from sage.all import *
>>> p = Partition([Integer(2),Integer(1)])
>>> p.get_part(Integer(0)), p.get_part(Integer(1)), p.get_part(Integer(2))
(2, 1, 0)
>>> p.get_part(Integer(10),-Integer(1))
-1
>>> Partition([]).get_part(Integer(0))
0

glaisher_franklin(s)[source]#

Apply the Glaisher-Franklin bijection to self.

The Franklin-Glaisher bijection, with parameter $$s$$, returns a partition whose set of parts that are repeated at least $$s$$ times equals the set of parts divisible by $$s$$ in self, after dividing each part by $$s$$.

INPUT:

• s – positive integer

EXAMPLES:

sage: Partition([4, 3, 2, 2, 1]).glaisher_franklin(2)
[3, 2, 2, 1, 1, 1, 1, 1]

>>> from sage.all import *
>>> Partition([Integer(4), Integer(3), Integer(2), Integer(2), Integer(1)]).glaisher_franklin(Integer(2))
[3, 2, 2, 1, 1, 1, 1, 1]

glaisher_franklin_inverse(s)[source]#

Apply the inverse of the Glaisher-Franklin bijection to self.

The inverse of the Franklin-Glaisher bijection, with parameter $$s$$, returns a partition whose set of parts that are divisible by $$s$$, after dividing each by $$s$$, equals the equals the set of parts repeated at least $$s$$ times in self.

INPUT:

• s – positive integer

EXAMPLES:

sage: Partition([4, 3, 2, 2, 1]).glaisher_franklin(2)
[3, 2, 2, 1, 1, 1, 1, 1]
sage: Partition([3, 2, 2, 1, 1, 1, 1, 1]).glaisher_franklin_inverse(2)
[4, 3, 2, 2, 1]

>>> from sage.all import *
>>> Partition([Integer(4), Integer(3), Integer(2), Integer(2), Integer(1)]).glaisher_franklin(Integer(2))
[3, 2, 2, 1, 1, 1, 1, 1]
>>> Partition([Integer(3), Integer(2), Integer(2), Integer(1), Integer(1), Integer(1), Integer(1), Integer(1)]).glaisher_franklin_inverse(Integer(2))
[4, 3, 2, 2, 1]

has_k_rectangle(k)[source]#

Return True if the Ferrer’s diagram of self contains $$k-i+1$$ rows (or more) of length $$i$$ (exactly) for any $$i$$ in $$[1, k]$$.

This is mainly a helper function for is_k_reducible() and is_k_irreducible(), the only difference between this function and is_k_reducible() being that this function allows any partition as input while is_k_reducible() requires the input to be $$k$$-bounded.

EXAMPLES:

The partition [1, 1, 1] has at least 2 rows of length 1:

sage: Partition([1, 1, 1]).has_k_rectangle(2)
True

>>> from sage.all import *
>>> Partition([Integer(1), Integer(1), Integer(1)]).has_k_rectangle(Integer(2))
True


The partition [1, 1, 1] does not have 4 rows of length 1, 3 rows of length 2, 2 rows of length 3, nor 1 row of length 4:

sage: Partition([1, 1, 1]).has_k_rectangle(4)
False

>>> from sage.all import *
>>> Partition([Integer(1), Integer(1), Integer(1)]).has_k_rectangle(Integer(4))
False

has_rectangle(h, w)[source]#

Return True if the Ferrer’s diagram of self has h (or more) rows of length w (exactly).

INPUT:

• h – An integer $$h \geq 1$$. The (minimum) height of the rectangle.

• w – An integer $$w \geq 1$$. The width of the rectangle.

EXAMPLES:

sage: Partition([3, 3, 3, 3]).has_rectangle(2, 3)
True
sage: Partition([3, 3]).has_rectangle(2, 3)
True
sage: Partition([4, 3]).has_rectangle(2, 3)
False
sage: Partition([3]).has_rectangle(2, 3)
False

>>> from sage.all import *
>>> Partition([Integer(3), Integer(3), Integer(3), Integer(3)]).has_rectangle(Integer(2), Integer(3))
True
>>> Partition([Integer(3), Integer(3)]).has_rectangle(Integer(2), Integer(3))
True
>>> Partition([Integer(4), Integer(3)]).has_rectangle(Integer(2), Integer(3))
False
>>> Partition([Integer(3)]).has_rectangle(Integer(2), Integer(3))
False

hook_length(i, j)[source]#

Return the length of the hook of cell $$(i,j)$$ in self.

The (length of the) hook of cell $$(i,j)$$ of a partition $$\lambda$$ is

$\lambda_i + \lambda^{\prime}_j - i - j + 1$

where $$\lambda^{\prime}$$ is the conjugate partition. In English convention, the hook length is the number of cells horizontally to the right and vertically below the cell $$(i,j)$$ (including that cell).

EXAMPLES:

sage: p = Partition([2,2,1])
sage: p.hook_length(0, 0)
4
sage: p.hook_length(0, 1)
2
sage: p.hook_length(2, 0)
1
sage: Partition([3,3]).hook_length(0, 0)
4
sage: cell = [0,0]; Partition([3,3]).hook_length(*cell)
4

>>> from sage.all import *
>>> p = Partition([Integer(2),Integer(2),Integer(1)])
>>> p.hook_length(Integer(0), Integer(0))
4
>>> p.hook_length(Integer(0), Integer(1))
2
>>> p.hook_length(Integer(2), Integer(0))
1
>>> Partition([Integer(3),Integer(3)]).hook_length(Integer(0), Integer(0))
4
>>> cell = [Integer(0),Integer(0)]; Partition([Integer(3),Integer(3)]).hook_length(*cell)
4

hook_lengths()[source]#

Return a tableau of shape self with the cells filled in with the hook lengths.

In each cell, put the sum of one plus the number of cells horizontally to the right and vertically below the cell (the hook length).

For example, consider the partition [3,2,1] of 6 with Ferrers diagram:

# # #
# #
#


When we fill in the cells with the hook lengths, we obtain:

5 3 1
3 1
1


EXAMPLES:

sage: Partition([2,2,1]).hook_lengths()
[[4, 2], [3, 1], [1]]
sage: Partition([3,3]).hook_lengths()
[[4, 3, 2], [3, 2, 1]]
sage: Partition([3,2,1]).hook_lengths()
[[5, 3, 1], [3, 1], [1]]
sage: Partition([2,2]).hook_lengths()
[[3, 2], [2, 1]]
sage: Partition([5]).hook_lengths()
[[5, 4, 3, 2, 1]]

>>> from sage.all import *
>>> Partition([Integer(2),Integer(2),Integer(1)]).hook_lengths()
[[4, 2], [3, 1], [1]]
>>> Partition([Integer(3),Integer(3)]).hook_lengths()
[[4, 3, 2], [3, 2, 1]]
>>> Partition([Integer(3),Integer(2),Integer(1)]).hook_lengths()
[[5, 3, 1], [3, 1], [1]]
>>> Partition([Integer(2),Integer(2)]).hook_lengths()
[[3, 2], [2, 1]]
>>> Partition([Integer(5)]).hook_lengths()
[[5, 4, 3, 2, 1]]


REFERENCES:

hook_polynomial(q, t)[source]#

Return the two-variable hook polynomial.

EXAMPLES:

sage: R.<q,t> = PolynomialRing(QQ)
sage: a = Partition([2,2]).hook_polynomial(q,t)
sage: a == (1 - t)*(1 - q*t)*(1 - t^2)*(1 - q*t^2)
True
sage: a = Partition([3,2,1]).hook_polynomial(q,t)
sage: a == (1 - t)^3*(1 - q*t^2)^2*(1 - q^2*t^3)
True

>>> from sage.all import *
>>> R = PolynomialRing(QQ, names=('q', 't',)); (q, t,) = R._first_ngens(2)
>>> a = Partition([Integer(2),Integer(2)]).hook_polynomial(q,t)
>>> a == (Integer(1) - t)*(Integer(1) - q*t)*(Integer(1) - t**Integer(2))*(Integer(1) - q*t**Integer(2))
True
>>> a = Partition([Integer(3),Integer(2),Integer(1)]).hook_polynomial(q,t)
>>> a == (Integer(1) - t)**Integer(3)*(Integer(1) - q*t**Integer(2))**Integer(2)*(Integer(1) - q**Integer(2)*t**Integer(3))
True

hook_product(a)[source]#

Return the Jack hook-product.

EXAMPLES:

sage: Partition([3,2,1]).hook_product(x)                                    # needs sage.symbolic
(2*x + 3)*(x + 2)^2
sage: Partition([2,2]).hook_product(x)                                      # needs sage.symbolic
2*(x + 2)*(x + 1)

>>> from sage.all import *
>>> Partition([Integer(3),Integer(2),Integer(1)]).hook_product(x)                                    # needs sage.symbolic
(2*x + 3)*(x + 2)^2
>>> Partition([Integer(2),Integer(2)]).hook_product(x)                                      # needs sage.symbolic
2*(x + 2)*(x + 1)

hooks()[source]#

Return a sorted list of the hook lengths in self.

EXAMPLES:

sage: Partition([3,2,1]).hooks()
[5, 3, 3, 1, 1, 1]

>>> from sage.all import *
>>> Partition([Integer(3),Integer(2),Integer(1)]).hooks()
[5, 3, 3, 1, 1, 1]

horizontal_border_strip_cells(k)[source]#

Return a list of all the horizontal border strips of length k which can be added to self, where each horizontal border strip is a generator of cells.

EXAMPLES:

sage: list(Partition([]).horizontal_border_strip_cells(0))
[]
sage: list(Partition([3,2,1]).horizontal_border_strip_cells(0))
[]
sage: list(Partition([]).horizontal_border_strip_cells(2))
[[(0, 0), (0, 1)]]
sage: list(Partition([2,2]).horizontal_border_strip_cells(2))
[[(0, 2), (0, 3)], [(0, 2), (2, 0)], [(2, 0), (2, 1)]]
sage: list(Partition([3,2,2]).horizontal_border_strip_cells(2))
[[(0, 3), (0, 4)],
[(0, 3), (1, 2)],
[(0, 3), (3, 0)],
[(1, 2), (3, 0)],
[(3, 0), (3, 1)]]

>>> from sage.all import *
>>> list(Partition([]).horizontal_border_strip_cells(Integer(0)))
[]
>>> list(Partition([Integer(3),Integer(2),Integer(1)]).horizontal_border_strip_cells(Integer(0)))
[]
>>> list(Partition([]).horizontal_border_strip_cells(Integer(2)))
[[(0, 0), (0, 1)]]
>>> list(Partition([Integer(2),Integer(2)]).horizontal_border_strip_cells(Integer(2)))
[[(0, 2), (0, 3)], [(0, 2), (2, 0)], [(2, 0), (2, 1)]]
>>> list(Partition([Integer(3),Integer(2),Integer(2)]).horizontal_border_strip_cells(Integer(2)))
[[(0, 3), (0, 4)],
[(0, 3), (1, 2)],
[(0, 3), (3, 0)],
[(1, 2), (3, 0)],
[(3, 0), (3, 1)]]

initial_column_tableau()[source]#

Return the initial column tableau of shape self.

The initial column tableau of shape self is the standard tableau that has the numbers $$1$$ to $$n$$, where $$n$$ is the size() of self, entered in order from top to bottom and then left to right down the columns of self.

EXAMPLES:

sage: Partition([3,2]).initial_column_tableau()
[[1, 3, 5], [2, 4]]

>>> from sage.all import *
>>> Partition([Integer(3),Integer(2)]).initial_column_tableau()
[[1, 3, 5], [2, 4]]

initial_tableau()[source]#

Return the standard tableau which has the numbers $$1, 2, \ldots, n$$ where $$n$$ is the size() of self entered in order from left to right along the rows of each component, where the components are ordered from left to right.

EXAMPLES:

sage: Partition([3,2,2]).initial_tableau()
[[1, 2, 3], [4, 5], [6, 7]]

>>> from sage.all import *
>>> Partition([Integer(3),Integer(2),Integer(2)]).initial_tableau()
[[1, 2, 3], [4, 5], [6, 7]]

inside_corners()[source]#

Return a list of the corners of the partition self.

A corner of a partition $$\lambda$$ is a cell of the Young diagram of $$\lambda$$ which can be removed from the Young diagram while still leaving a straight shape behind.

The entries of the list returned are pairs of the form $$(i,j)$$, where $$i$$ and $$j$$ are the coordinates of the respective corner. The coordinates are counted from $$0$$.

Note

This is referred to as an “inner corner” in [Sag2001].

EXAMPLES:

sage: Partition([3,2,1]).corners()
[(0, 2), (1, 1), (2, 0)]
sage: Partition([3,3,1]).corners()
[(1, 2), (2, 0)]
sage: Partition([]).corners()
[]

>>> from sage.all import *
>>> Partition([Integer(3),Integer(2),Integer(1)]).corners()
[(0, 2), (1, 1), (2, 0)]
>>> Partition([Integer(3),Integer(3),Integer(1)]).corners()
[(1, 2), (2, 0)]
>>> Partition([]).corners()
[]

inside_corners_residue(i, l)[source]#

Return a list of the corners of the partition self having l-residue i.

A corner of a partition $$\lambda$$ is a cell of the Young diagram of $$\lambda$$ which can be removed from the Young diagram while still leaving a straight shape behind. See residue() for the definition of the l-residue.

The entries of the list returned are pairs of the form $$(i,j)$$, where $$i$$ and $$j$$ are the coordinates of the respective corner. The coordinates are counted from $$0$$.

EXAMPLES:

sage: Partition([3,2,1]).corners_residue(0, 3)
[(1, 1)]
sage: Partition([3,2,1]).corners_residue(1, 3)
[(2, 0)]
sage: Partition([3,2,1]).corners_residue(2, 3)
[(0, 2)]

>>> from sage.all import *
>>> Partition([Integer(3),Integer(2),Integer(1)]).corners_residue(Integer(0), Integer(3))
[(1, 1)]
>>> Partition([Integer(3),Integer(2),Integer(1)]).corners_residue(Integer(1), Integer(3))
[(2, 0)]
>>> Partition([Integer(3),Integer(2),Integer(1)]).corners_residue(Integer(2), Integer(3))
[(0, 2)]

is_core(k)[source]#

Return True if the Partition self is a k-core.

A partition is said to be a k-core if it has no hooks of length $$k$$. Equivalently, a partition is said to be a $$k$$-core if it is its own $$k$$-core (where the latter is defined as in core()).

Visually, this can be checked by trying to remove border strips of size $$k$$ from self. If this is not possible, then self is a $$k$$-core.

EXAMPLES:

In the partition (2, 1), a hook length of 2 does not occur, but a hook length of 3 does:

sage: p = Partition([2, 1])
sage: p.is_core(2)
True
sage: p.is_core(3)
False

sage: q = Partition([12, 8, 5, 5, 2, 2, 1])
sage: q.is_core(4)
False
sage: q.is_core(5)
True
sage: q.is_core(0)
True

>>> from sage.all import *
>>> p = Partition([Integer(2), Integer(1)])
>>> p.is_core(Integer(2))
True
>>> p.is_core(Integer(3))
False

>>> q = Partition([Integer(12), Integer(8), Integer(5), Integer(5), Integer(2), Integer(2), Integer(1)])
>>> q.is_core(Integer(4))
False
>>> q.is_core(Integer(5))
True
>>> q.is_core(Integer(0))
True


is_empty()[source]#

Return True if self is the empty partition.

EXAMPLES:

sage: Partition([]).is_empty()
True
sage: Partition([2,1,1]).is_empty()
False

>>> from sage.all import *
>>> Partition([]).is_empty()
True
>>> Partition([Integer(2),Integer(1),Integer(1)]).is_empty()
False

is_k_bounded(k)[source]#

Return True if the partition self is bounded by k.

EXAMPLES:

sage: Partition([4, 3, 1]).is_k_bounded(4)
True
sage: Partition([4, 3, 1]).is_k_bounded(7)
True
sage: Partition([4, 3, 1]).is_k_bounded(3)
False

>>> from sage.all import *
>>> Partition([Integer(4), Integer(3), Integer(1)]).is_k_bounded(Integer(4))
True
>>> Partition([Integer(4), Integer(3), Integer(1)]).is_k_bounded(Integer(7))
True
>>> Partition([Integer(4), Integer(3), Integer(1)]).is_k_bounded(Integer(3))
False

is_k_irreducible(k)[source]#

Return True if the partition self is k-irreducible.

A $$k$$-bounded partition is $$k$$-irreducible if its Ferrer’s diagram does not contain $$k-i+1$$ rows (or more) of length $$i$$ (exactly) for every $$i \in [1, k]$$.

(Also, a $$k$$-bounded partition is $$k$$-irreducible if and only if it is not $$k$$-reducible.)

EXAMPLES:

The partition [1, 1, 1] has at least 2 rows of length 1:

sage: Partition([1, 1, 1]).is_k_irreducible(2)
False

>>> from sage.all import *
>>> Partition([Integer(1), Integer(1), Integer(1)]).is_k_irreducible(Integer(2))
False


The partition [1, 1, 1] does not have 4 rows of length 1, 3 rows of length 2, 2 rows of length 3, nor 1 row of length 4:

sage: Partition([1, 1, 1]).is_k_irreducible(4)
True

>>> from sage.all import *
>>> Partition([Integer(1), Integer(1), Integer(1)]).is_k_irreducible(Integer(4))
True

is_k_reducible(k)[source]#

Return True if the partition self is k-reducible.

A $$k$$-bounded partition is $$k$$-reducible if its Ferrer’s diagram contains $$k-i+1$$ rows (or more) of length $$i$$ (exactly) for some $$i \in [1, k]$$.

(Also, a $$k$$-bounded partition is $$k$$-reducible if and only if it is not $$k$$-irreducible.)

EXAMPLES:

The partition [1, 1, 1] has at least 2 rows of length 1:

sage: Partition([1, 1, 1]).is_k_reducible(2)
True

>>> from sage.all import *
>>> Partition([Integer(1), Integer(1), Integer(1)]).is_k_reducible(Integer(2))
True


The partition [1, 1, 1] does not have 4 rows of length 1, 3 rows of length 2, 2 rows of length 3, nor 1 row of length 4:

sage: Partition([1, 1, 1]).is_k_reducible(4)
False

>>> from sage.all import *
>>> Partition([Integer(1), Integer(1), Integer(1)]).is_k_reducible(Integer(4))
False

is_regular(e, multicharge=(0,))[source]#

Return True is this is an e-regular partition.

A partition is $$e$$-regular if it does not have $$e$$ equal non-zero parts.

EXAMPLES:

sage: Partition([4,3,3,3]).is_regular(2)
False
sage: Partition([4,3,3,3]).is_regular(3)
False
sage: Partition([4,3,3,3]).is_regular(4)
True

>>> from sage.all import *
>>> Partition([Integer(4),Integer(3),Integer(3),Integer(3)]).is_regular(Integer(2))
False
>>> Partition([Integer(4),Integer(3),Integer(3),Integer(3)]).is_regular(Integer(3))
False
>>> Partition([Integer(4),Integer(3),Integer(3),Integer(3)]).is_regular(Integer(4))
True

is_restricted(e, multicharge=(0,))[source]#

Return True is this is an e-restricted partition.

An $$e$$-restricted partition is a partition such that the difference of consecutive parts is always strictly less than $$e$$, where partitions are considered to have an infinite number of $$0$$ parts. I.e., the last part must be strictly less than $$e$$.

EXAMPLES:

sage: Partition([4,3,3,2]).is_restricted(2)
False
sage: Partition([4,3,3,2]).is_restricted(3)
True
sage: Partition([4,3,3,2]).is_restricted(4)
True
sage: Partition([4]).is_restricted(4)
False

>>> from sage.all import *
>>> Partition([Integer(4),Integer(3),Integer(3),Integer(2)]).is_restricted(Integer(2))
False
>>> Partition([Integer(4),Integer(3),Integer(3),Integer(2)]).is_restricted(Integer(3))
True
>>> Partition([Integer(4),Integer(3),Integer(3),Integer(2)]).is_restricted(Integer(4))
True
>>> Partition([Integer(4)]).is_restricted(Integer(4))
False

is_symmetric()[source]#

Return True if the partition self equals its own transpose.

EXAMPLES:

sage: Partition([2, 1]).is_symmetric()
True
sage: Partition([3, 1]).is_symmetric()
False

>>> from sage.all import *
>>> Partition([Integer(2), Integer(1)]).is_symmetric()
True
>>> Partition([Integer(3), Integer(1)]).is_symmetric()
False

jacobi_trudi()[source]#

Return the Jacobi-Trudi matrix of self thought of as a skew partition. See SkewPartition.jacobi_trudi().

EXAMPLES:

sage: # needs sage.modules
sage: part = Partition([3,2,1])
sage: jt = part.jacobi_trudi(); jt
[h[3] h[1]    0]
[h[4] h[2]  h[]]
[h[5] h[3] h[1]]
sage: s = SymmetricFunctions(QQ).schur()
sage: h = SymmetricFunctions(QQ).homogeneous()
sage: h( s(part) )
h[3, 2, 1] - h[3, 3] - h[4, 1, 1] + h[5, 1]
sage: jt.det()
h[3, 2, 1] - h[3, 3] - h[4, 1, 1] + h[5, 1]

>>> from sage.all import *
>>> # needs sage.modules
>>> part = Partition([Integer(3),Integer(2),Integer(1)])
>>> jt = part.jacobi_trudi(); jt
[h[3] h[1]    0]
[h[4] h[2]  h[]]
[h[5] h[3] h[1]]
>>> s = SymmetricFunctions(QQ).schur()
>>> h = SymmetricFunctions(QQ).homogeneous()
>>> h( s(part) )
h[3, 2, 1] - h[3, 3] - h[4, 1, 1] + h[5, 1]
>>> jt.det()
h[3, 2, 1] - h[3, 3] - h[4, 1, 1] + h[5, 1]

k_atom(k)[source]#

Return a list of the standard tableaux of size self.size() whose k-atom is equal to self.

EXAMPLES:

sage: p = Partition([3,2,1])
sage: p.k_atom(1)
[]
sage: p.k_atom(3)
[[[1, 1, 1, 2, 3], [2]],
[[1, 1, 1, 3], [2, 2]],
[[1, 1, 1, 2], [2], [3]],
[[1, 1, 1], [2, 2], [3]]]
sage: Partition([3,2,1]).k_atom(4)
[[[1, 1, 1, 3], [2, 2]], [[1, 1, 1], [2, 2], [3]]]

>>> from sage.all import *
>>> p = Partition([Integer(3),Integer(2),Integer(1)])
>>> p.k_atom(Integer(1))
[]
>>> p.k_atom(Integer(3))
[[[1, 1, 1, 2, 3], [2]],
[[1, 1, 1, 3], [2, 2]],
[[1, 1, 1, 2], [2], [3]],
[[1, 1, 1], [2, 2], [3]]]
>>> Partition([Integer(3),Integer(2),Integer(1)]).k_atom(Integer(4))
[[[1, 1, 1, 3], [2, 2]], [[1, 1, 1], [2, 2], [3]]]

k_boundary(k)[source]#

Return the skew partition formed by removing the cells of the k-interior, see k_interior().

EXAMPLES:

sage: p = Partition([3,2,1])
sage: p.k_boundary(2)
[3, 2, 1] / [2, 1]
sage: p.k_boundary(3)
[3, 2, 1] / [1]

sage: p = Partition([12,8,5,5,2,2,1])
sage: p.k_boundary(4)
[12, 8, 5, 5, 2, 2, 1] / [8, 5, 2, 2]

>>> from sage.all import *
>>> p = Partition([Integer(3),Integer(2),Integer(1)])
>>> p.k_boundary(Integer(2))
[3, 2, 1] / [2, 1]
>>> p.k_boundary(Integer(3))
[3, 2, 1] / [1]

>>> p = Partition([Integer(12),Integer(8),Integer(5),Integer(5),Integer(2),Integer(2),Integer(1)])
>>> p.k_boundary(Integer(4))
[12, 8, 5, 5, 2, 2, 1] / [8, 5, 2, 2]

k_column_lengths(k)[source]#

Return the k-column-shape of the partition self.

This is the ‘column’ analog of k_row_lengths().

EXAMPLES:

sage: Partition([6, 1]).k_column_lengths(2)
[1, 0, 0, 0, 1, 1]

sage: Partition([4, 4, 4, 3, 2]).k_column_lengths(2)
[1, 1, 1, 2]

>>> from sage.all import *
>>> Partition([Integer(6), Integer(1)]).k_column_lengths(Integer(2))
[1, 0, 0, 0, 1, 1]

>>> Partition([Integer(4), Integer(4), Integer(4), Integer(3), Integer(2)]).k_column_lengths(Integer(2))
[1, 1, 1, 2]

k_conjugate(k)[source]#

Return the k-conjugate of self.

The $$k$$-conjugate is the partition that is given by the columns of the $$k$$-skew diagram of the partition.

We can also define the $$k$$-conjugate in the following way. Let $$P$$ denote the bijection from $$(k+1)$$-cores to $$k$$-bounded partitions. The $$k$$-conjugate of a $$(k+1)$$-core $$\lambda$$ is

$\lambda^{(k)} = P^{-1}\left( (P(\lambda))^{\prime} \right).$

EXAMPLES:

sage: p = Partition([4,3,2,2,1,1])
sage: p.k_conjugate(4)
[3, 2, 2, 1, 1, 1, 1, 1, 1]

>>> from sage.all import *
>>> p = Partition([Integer(4),Integer(3),Integer(2),Integer(2),Integer(1),Integer(1)])
>>> p.k_conjugate(Integer(4))
[3, 2, 2, 1, 1, 1, 1, 1, 1]

k_interior(k)[source]#

Return the partition consisting of the cells of self whose hook lengths are greater than k.

EXAMPLES:

sage: p = Partition([3,2,1])
sage: p.hook_lengths()
[[5, 3, 1], [3, 1], [1]]
sage: p.k_interior(2)
[2, 1]
sage: p.k_interior(3)
[1]

sage: p = Partition([])
sage: p.k_interior(3)
[]

>>> from sage.all import *
>>> p = Partition([Integer(3),Integer(2),Integer(1)])
>>> p.hook_lengths()
[[5, 3, 1], [3, 1], [1]]
>>> p.k_interior(Integer(2))
[2, 1]
>>> p.k_interior(Integer(3))
[1]

>>> p = Partition([])
>>> p.k_interior(Integer(3))
[]

k_irreducible(k)[source]#

Return the partition with all $$r \times (k+1-r)$$ rectangles removed.

If self is a $$k$$-bounded partition, then this method will return the partition where all rectangles of dimension $$r \times (k+1-r)$$ for $$1 \leq r \leq k$$ have been deleted.

If self is not a $$k$$-bounded partition then the method will raise an error.

INPUT:

• k – a non-negative integer

OUTPUT:

• a partition

EXAMPLES:

sage: Partition([3,2,2,1,1,1]).k_irreducible(4)
[3, 2, 2, 1, 1, 1]
sage: Partition([3,2,2,1,1,1]).k_irreducible(3)
[]
sage: Partition([3,3,3,2,2,2,2,2,1,1,1,1]).k_irreducible(3)
[2, 1]

>>> from sage.all import *
>>> Partition([Integer(3),Integer(2),Integer(2),Integer(1),Integer(1),Integer(1)]).k_irreducible(Integer(4))
[3, 2, 2, 1, 1, 1]
>>> Partition([Integer(3),Integer(2),Integer(2),Integer(1),Integer(1),Integer(1)]).k_irreducible(Integer(3))
[]
>>> Partition([Integer(3),Integer(3),Integer(3),Integer(2),Integer(2),Integer(2),Integer(2),Integer(2),Integer(1),Integer(1),Integer(1),Integer(1)]).k_irreducible(Integer(3))
[2, 1]

k_rim(k)[source]#

Return the k-rim of self as a list of integer coordinates.

The $$k$$-rim of a partition is the “line between” (or “intersection of”) the $$k$$-boundary and the $$k$$-interior. (Section 2.3 of [HM2011])

It will be output as an ordered list of integer coordinates, where the origin is $$(0, 0)$$. It will start at the top-left of the $$k$$-rim (using French convention) and end at the bottom-right.

EXAMPLES:

Consider the partition (3, 1) split up into its 1-interior and 1-boundary:

The line shown in bold is the 1-rim, and that information is equivalent to the integer coordinates of the points that occur along that line:

sage: Partition([3, 1]).k_rim(1)
[(3, 0), (2, 0), (2, 1), (1, 1), (0, 1), (0, 2)]

>>> from sage.all import *
>>> Partition([Integer(3), Integer(1)]).k_rim(Integer(1))
[(3, 0), (2, 0), (2, 1), (1, 1), (0, 1), (0, 2)]

k_row_lengths(k)[source]#

Return the k-row-shape of the partition self.

This is equivalent to taking the $$k$$-boundary of the partition and then returning the row-shape of that. We do not discard rows of length 0. (Section 2.2 of [LLMS2013])

EXAMPLES:

sage: Partition([6, 1]).k_row_lengths(2)
[2, 1]

sage: Partition([4, 4, 4, 3, 2]).k_row_lengths(2)
[0, 1, 1, 1, 2]

>>> from sage.all import *
>>> Partition([Integer(6), Integer(1)]).k_row_lengths(Integer(2))
[2, 1]

>>> Partition([Integer(4), Integer(4), Integer(4), Integer(3), Integer(2)]).k_row_lengths(Integer(2))
[0, 1, 1, 1, 2]

k_size(k)[source]#

Given a partition self and a k, return the size of the $$k$$-boundary.

This is the same as the length method sage.combinat.core.Core.length() of the sage.combinat.core.Core object, with the exception that here we don’t require self to be a $$k+1$$-core.

EXAMPLES:

sage: Partition([2, 1, 1]).k_size(1)
2
sage: Partition([2, 1, 1]).k_size(2)
3
sage: Partition([2, 1, 1]).k_size(3)
3
sage: Partition([2, 1, 1]).k_size(4)
4

>>> from sage.all import *
>>> Partition([Integer(2), Integer(1), Integer(1)]).k_size(Integer(1))
2
>>> Partition([Integer(2), Integer(1), Integer(1)]).k_size(Integer(2))
3
>>> Partition([Integer(2), Integer(1), Integer(1)]).k_size(Integer(3))
3
>>> Partition([Integer(2), Integer(1), Integer(1)]).k_size(Integer(4))
4

k_skew(k)[source]#

Return the $$k$$-skew partition.

The $$k$$-skew diagram of a $$k$$-bounded partition is the skew diagram denoted $$\lambda/^k$$ satisfying the conditions:

1. row $$i$$ of $$\lambda/^k$$ has length $$\lambda_i$$,

2. no cell in $$\lambda/^k$$ has hook-length exceeding $$k$$,

3. every square above the diagram of $$\lambda/^k$$ has hook length exceeding $$k$$.

REFERENCES:

EXAMPLES:

sage: p = Partition([4,3,2,2,1,1])
sage: p.k_skew(4)
[9, 5, 3, 2, 1, 1] / [5, 2, 1]

>>> from sage.all import *
>>> p = Partition([Integer(4),Integer(3),Integer(2),Integer(2),Integer(1),Integer(1)])
>>> p.k_skew(Integer(4))
[9, 5, 3, 2, 1, 1] / [5, 2, 1]

k_split(k)[source]#

Return the k-split of self.

EXAMPLES:

sage: Partition([4,3,2,1]).k_split(3)
[]
sage: Partition([4,3,2,1]).k_split(4)
[[4], [3, 2], [1]]
sage: Partition([4,3,2,1]).k_split(5)
[[4, 3], [2, 1]]
sage: Partition([4,3,2,1]).k_split(6)
[[4, 3, 2], [1]]
sage: Partition([4,3,2,1]).k_split(7)
[[4, 3, 2, 1]]
sage: Partition([4,3,2,1]).k_split(8)
[[4, 3, 2, 1]]

>>> from sage.all import *
>>> Partition([Integer(4),Integer(3),Integer(2),Integer(1)]).k_split(Integer(3))
[]
>>> Partition([Integer(4),Integer(3),Integer(2),Integer(1)]).k_split(Integer(4))
[[4], [3, 2], [1]]
>>> Partition([Integer(4),Integer(3),Integer(2),Integer(1)]).k_split(Integer(5))
[[4, 3], [2, 1]]
>>> Partition([Integer(4),Integer(3),Integer(2),Integer(1)]).k_split(Integer(6))
[[4, 3, 2], [1]]
>>> Partition([Integer(4),Integer(3),Integer(2),Integer(1)]).k_split(Integer(7))
[[4, 3, 2, 1]]
>>> Partition([Integer(4),Integer(3),Integer(2),Integer(1)]).k_split(Integer(8))
[[4, 3, 2, 1]]


Return the ladder tableau of shape self.

The $$e$$-ladder tableau is the standard Young tableau obtained by reading the ladders, the set of cells $$(i, j)$$ that differ from $$(i+e-1, j-1)$$, of the partition $$\lambda$$ from left-to-right.

INPUT:

• e – a nonnegative integer; 0 is considered as $$\infty$$ (analogous to the characteristic of a ring)

• ladder_sizes – (default: False) if True, also return the sizes of the ladders

EXAMPLES:

sage: la = Partition([6, 5, 3, 1])
1  2  3  5  7 10
4  6  8 11 13
9 12 14
15
[1, 1, 2, 2, 3, 3, 3]

1  2  3  4  5  6
7  8  9 10 11
12 13 14
15
True

>>> from sage.all import *
>>> la = Partition([Integer(6), Integer(5), Integer(3), Integer(1)])
1  2  3  5  7 10
4  6  8 11 13
9 12 14
15
[1, 1, 2, 2, 3, 3, 3]

1  2  3  4  5  6
7  8  9 10 11
12 13 14
15
True


Return a dictionary containing the ladders in the diagram of self.

For $$e > 0$$, a node $$(i, j)$$ in a partition belongs to the $$l$$-th $$e$$-ladder if $$l = (e - 1) r + c$$.

INPUT:

• e – a nonnegative integer; if 0, then we set e = self.size() + 1

EXAMPLES:

sage: Partition([3, 2]).ladders(3)
{0: [(0, 0)], 1: [(0, 1)], 2: [(0, 2), (1, 0)], 3: [(1, 1)]}

>>> from sage.all import *
{0: [(0, 0)], 1: [(0, 1)], 2: [(0, 2), (1, 0)], 3: [(1, 1)]}


When e is 0, the cells are in bijection with the ladders, but the index of the ladder depends on the size of the partition:

sage: Partition([3, 2]).ladders(0)
{0: [(0, 0)], 1: [(0, 1)], 2: [(0, 2)], 5: [(1, 0)], 6: [(1, 1)]}
{0: [(0, 0)], 1: [(0, 1)], 2: [(0, 2)], 6: [(1, 0)], 7: [(1, 1)],
12: [(2, 0)]}
{0: [(0, 0)], 1: [(0, 1)], 2: [(0, 2)], 5: [(1, 0)], 10: [(2, 0)]}
{0: [(0, 0)], 3: [(1, 0)], 6: [(2, 0)]}

>>> from sage.all import *
{0: [(0, 0)], 1: [(0, 1)], 2: [(0, 2)], 5: [(1, 0)], 6: [(1, 1)]}
{0: [(0, 0)], 1: [(0, 1)], 2: [(0, 2)], 6: [(1, 0)], 7: [(1, 1)],
12: [(2, 0)]}
{0: [(0, 0)], 1: [(0, 1)], 2: [(0, 2)], 5: [(1, 0)], 10: [(2, 0)]}
{0: [(0, 0)], 3: [(1, 0)], 6: [(2, 0)]}

larger_lex(rhs)[source]#

Return True if self is larger than rhs in lexicographic order. Otherwise return False.

EXAMPLES:

sage: p = Partition([3,2])
sage: p.larger_lex([3,1])
True
sage: p.larger_lex([1,4])
True
sage: p.larger_lex([3,2,1])
False
sage: p.larger_lex([3])
True
sage: p.larger_lex([5])
False
sage: p.larger_lex([3,1,1,1,1,1,1,1])
True

>>> from sage.all import *
>>> p = Partition([Integer(3),Integer(2)])
>>> p.larger_lex([Integer(3),Integer(1)])
True
>>> p.larger_lex([Integer(1),Integer(4)])
True
>>> p.larger_lex([Integer(3),Integer(2),Integer(1)])
False
>>> p.larger_lex([Integer(3)])
True
>>> p.larger_lex([Integer(5)])
False
>>> p.larger_lex([Integer(3),Integer(1),Integer(1),Integer(1),Integer(1),Integer(1),Integer(1),Integer(1)])
True

leg_cells(i, j)[source]#

Return the list of the cells of the leg of cell $$(i,j)$$ in self.

The leg of cell $$c = (i,j)$$ is defined to be the cells below $$c$$ (in English convention).

The cell coordinates are zero-based, i. e., the northwesternmost cell is $$(0,0)$$.

INPUT:

• i, j – two integers

OUTPUT:

A list of pairs of integers

EXAMPLES:

sage: Partition([4,4,3,1]).leg_cells(1,1)
[(2, 1)]
sage: Partition([4,4,3,1]).leg_cells(0,1)
[(1, 1), (2, 1)]

sage: Partition([]).leg_cells(0,0)
Traceback (most recent call last):
...
ValueError: the cell is not in the diagram

>>> from sage.all import *
>>> Partition([Integer(4),Integer(4),Integer(3),Integer(1)]).leg_cells(Integer(1),Integer(1))
[(2, 1)]
>>> Partition([Integer(4),Integer(4),Integer(3),Integer(1)]).leg_cells(Integer(0),Integer(1))
[(1, 1), (2, 1)]

>>> Partition([]).leg_cells(Integer(0),Integer(0))
Traceback (most recent call last):
...
ValueError: the cell is not in the diagram

leg_length(i, j)[source]#

Return the length of the leg of cell $$(i,j)$$ in self.

The leg of cell $$c = (i,j)$$ is defined to be the cells below $$c$$ (in English convention).

The cell coordinates are zero-based, i. e., the northwesternmost cell is $$(0,0)$$.

INPUT:

• i, j – two integers

OUTPUT:

An integer or a ValueError

EXAMPLES:

sage: p = Partition([2,2,1])
sage: p.leg_length(0, 0)
2
sage: p.leg_length(0,1)
1
sage: p.leg_length(2,0)
0
sage: Partition([3,3]).leg_length(0, 0)
1
sage: cell = [0,0]; Partition([3,3]).leg_length(*cell)
1

>>> from sage.all import *
>>> p = Partition([Integer(2),Integer(2),Integer(1)])
>>> p.leg_length(Integer(0), Integer(0))
2
>>> p.leg_length(Integer(0),Integer(1))
1
>>> p.leg_length(Integer(2),Integer(0))
0
>>> Partition([Integer(3),Integer(3)]).leg_length(Integer(0), Integer(0))
1
>>> cell = [Integer(0),Integer(0)]; Partition([Integer(3),Integer(3)]).leg_length(*cell)
1

leg_lengths(flat=False)[source]#

Return a tableau of shape self with each cell filled in with its leg length. The optional boolean parameter flat provides the option of returning a flat list.

EXAMPLES:

sage: Partition([2,2,1]).leg_lengths()
[[2, 1], [1, 0], [0]]
sage: Partition([2,2,1]).leg_lengths(flat=True)
[2, 1, 1, 0, 0]
sage: Partition([3,3]).leg_lengths()
[[1, 1, 1], [0, 0, 0]]
sage: Partition([3,3]).leg_lengths(flat=True)
[1, 1, 1, 0, 0, 0]

>>> from sage.all import *
>>> Partition([Integer(2),Integer(2),Integer(1)]).leg_lengths()
[[2, 1], [1, 0], [0]]
>>> Partition([Integer(2),Integer(2),Integer(1)]).leg_lengths(flat=True)
[2, 1, 1, 0, 0]
>>> Partition([Integer(3),Integer(3)]).leg_lengths()
[[1, 1, 1], [0, 0, 0]]
>>> Partition([Integer(3),Integer(3)]).leg_lengths(flat=True)
[1, 1, 1, 0, 0, 0]

length()[source]#

Return the number of parts in self.

EXAMPLES:

sage: Partition([3,2]).length()
2
sage: Partition([2,2,1]).length()
3
sage: Partition([]).length()
0

>>> from sage.all import *
>>> Partition([Integer(3),Integer(2)]).length()
2
>>> Partition([Integer(2),Integer(2),Integer(1)]).length()
3
>>> Partition([]).length()
0

level()[source]#

Return the level of self, which is always 1.

This method exists only for compatibility with PartitionTuples.

EXAMPLES:

sage: Partition([4,3,2]).level()
1

>>> from sage.all import *
>>> Partition([Integer(4),Integer(3),Integer(2)]).level()
1

lower_hook(i, j, alpha)[source]#

Return the lower hook length of the cell $$(i,j)$$ in self. When alpha = 1, this is just the normal hook length.

The lower hook length of a cell $$(i,j)$$ in a partition $$\kappa$$ is defined by

$h_*^\kappa(i,j) = \kappa^\prime_j - i + 1 + \alpha(\kappa_i - j).$

EXAMPLES:

sage: p = Partition([2,1])
sage: p.lower_hook(0,0,1)
3
sage: p.hook_length(0,0)
3
sage: [ p.lower_hook(i,j,x) for i,j in p.cells() ]                          # needs sage.symbolic
[x + 2, 1, 1]

>>> from sage.all import *
>>> p = Partition([Integer(2),Integer(1)])
>>> p.lower_hook(Integer(0),Integer(0),Integer(1))
3
>>> p.hook_length(Integer(0),Integer(0))
3
>>> [ p.lower_hook(i,j,x) for i,j in p.cells() ]                          # needs sage.symbolic
[x + 2, 1, 1]

lower_hook_lengths(alpha)[source]#

Return a tableau of shape self with the cells filled in with the lower hook lengths. When alpha = 1, these are just the normal hook lengths.

The lower hook length of a cell $$(i,j)$$ in a partition $$\kappa$$ is defined by

$h_*^\kappa(i,j) = \kappa^\prime_j - i + 1 + \alpha(\kappa_i - j).$

EXAMPLES:

sage: Partition([3,2,1]).lower_hook_lengths(x)                              # needs sage.symbolic
[[2*x + 3, x + 2, 1], [x + 2, 1], [1]]
sage: Partition([3,2,1]).lower_hook_lengths(1)
[[5, 3, 1], [3, 1], [1]]
sage: Partition([3,2,1]).hook_lengths()
[[5, 3, 1], [3, 1], [1]]

>>> from sage.all import *
>>> Partition([Integer(3),Integer(2),Integer(1)]).lower_hook_lengths(x)                              # needs sage.symbolic
[[2*x + 3, x + 2, 1], [x + 2, 1], [1]]
>>> Partition([Integer(3),Integer(2),Integer(1)]).lower_hook_lengths(Integer(1))
[[5, 3, 1], [3, 1], [1]]
>>> Partition([Integer(3),Integer(2),Integer(1)]).hook_lengths()
[[5, 3, 1], [3, 1], [1]]

next()[source]#

Return the partition that lexicographically follows self, of the same size. If self is the last partition, then return False.

EXAMPLES:

sage: next(Partition([4]))
[3, 1]
sage: next(Partition([1,1,1,1]))
False

>>> from sage.all import *
>>> next(Partition([Integer(4)]))
[3, 1]
>>> next(Partition([Integer(1),Integer(1),Integer(1),Integer(1)]))
False

next_within_bounds(min=[], max=None, partition_type=None)[source]#

Get the next partition lexicographically that contains min and is contained in max.

INPUT:

• min – (default [], the empty partition) The ‘minimum partition’ that next_within_bounds(self) must contain.

• max – (default None) The ‘maximum partition’ that next_within_bounds(self) must be contained in. If set to None, then there is no restriction.

• partition_type – (default None) The type of partitions allowed. For example, ‘strict’ for strictly decreasing partitions, or None to allow any valid partition.

EXAMPLES:

sage: m = [1, 1]
sage: M = [3, 2, 1]
sage: Partition([1, 1]).next_within_bounds(min=m, max=M)
[1, 1, 1]
sage: Partition([1, 1, 1]).next_within_bounds(min=m, max=M)
[2, 1]
sage: Partition([2, 1]).next_within_bounds(min=m, max=M)
[2, 1, 1]
sage: Partition([2, 1, 1]).next_within_bounds(min=m, max=M)
[2, 2]
sage: Partition([2, 2]).next_within_bounds(min=m, max=M)
[2, 2, 1]
sage: Partition([2, 2, 1]).next_within_bounds(min=m, max=M)
[3, 1]
sage: Partition([3, 1]).next_within_bounds(min=m, max=M)
[3, 1, 1]
sage: Partition([3, 1, 1]).next_within_bounds(min=m, max=M)
[3, 2]
sage: Partition([3, 2]).next_within_bounds(min=m, max=M)
[3, 2, 1]
sage: Partition([3, 2, 1]).next_within_bounds(min=m, max=M) == None
True

>>> from sage.all import *
>>> m = [Integer(1), Integer(1)]
>>> M = [Integer(3), Integer(2), Integer(1)]
>>> Partition([Integer(1), Integer(1)]).next_within_bounds(min=m, max=M)
[1, 1, 1]
>>> Partition([Integer(1), Integer(1), Integer(1)]).next_within_bounds(min=m, max=M)
[2, 1]
>>> Partition([Integer(2), Integer(1)]).next_within_bounds(min=m, max=M)
[2, 1, 1]
>>> Partition([Integer(2), Integer(1), Integer(1)]).next_within_bounds(min=m, max=M)
[2, 2]
>>> Partition([Integer(2), Integer(2)]).next_within_bounds(min=m, max=M)
[2, 2, 1]
>>> Partition([Integer(2), Integer(2), Integer(1)]).next_within_bounds(min=m, max=M)
[3, 1]
>>> Partition([Integer(3), Integer(1)]).next_within_bounds(min=m, max=M)
[3, 1, 1]
>>> Partition([Integer(3), Integer(1), Integer(1)]).next_within_bounds(min=m, max=M)
[3, 2]
>>> Partition([Integer(3), Integer(2)]).next_within_bounds(min=m, max=M)
[3, 2, 1]
>>> Partition([Integer(3), Integer(2), Integer(1)]).next_within_bounds(min=m, max=M) == None
True

outer_rim()[source]#

Return the outer rim of self.

The outer rim of a partition $$\lambda$$ is defined as the cells which do not belong to $$\lambda$$ and which are adjacent to cells in $$\lambda$$.

EXAMPLES:

The outer rim of the partition $$[4,1]$$ consists of the cells marked with # below:

****#
*####
##

sage: Partition([4,1]).outer_rim()
[(2, 0), (2, 1), (1, 1), (1, 2), (1, 3), (1, 4), (0, 4)]

sage: Partition([2,2,1]).outer_rim()
[(3, 0), (3, 1), (2, 1), (2, 2), (1, 2), (0, 2)]
sage: Partition([2,2]).outer_rim()
[(2, 0), (2, 1), (2, 2), (1, 2), (0, 2)]
sage: Partition([6,3,3,1,1]).outer_rim()
[(5, 0), (5, 1), (4, 1), (3, 1), (3, 2), (3, 3), (2, 3), (1, 3), (1, 4), (1, 5), (1, 6), (0, 6)]
sage: Partition([]).outer_rim()
[(0, 0)]

>>> from sage.all import *
>>> Partition([Integer(4),Integer(1)]).outer_rim()
[(2, 0), (2, 1), (1, 1), (1, 2), (1, 3), (1, 4), (0, 4)]

>>> Partition([Integer(2),Integer(2),Integer(1)]).outer_rim()
[(3, 0), (3, 1), (2, 1), (2, 2), (1, 2), (0, 2)]
>>> Partition([Integer(2),Integer(2)]).outer_rim()
[(2, 0), (2, 1), (2, 2), (1, 2), (0, 2)]
>>> Partition([Integer(6),Integer(3),Integer(3),Integer(1),Integer(1)]).outer_rim()
[(5, 0), (5, 1), (4, 1), (3, 1), (3, 2), (3, 3), (2, 3), (1, 3), (1, 4), (1, 5), (1, 6), (0, 6)]
>>> Partition([]).outer_rim()
[(0, 0)]

outline(variable=None)[source]#

Return the outline of the partition self.

This is a piecewise linear function, normalized so that the area under the partition [1] is 2.

INPUT:

• variable – a variable (default: 'x' in the symbolic ring)

EXAMPLES:

sage: # needs sage.symbolic
sage: [Partition([5,4]).outline()(x=i) for i in range(-10,11)]
[10, 9, 8, 7, 6, 5, 6, 5, 6, 5, 4, 3, 2, 3, 4, 5, 6, 7, 8, 9, 10]
sage: Partition([]).outline()
abs(x)
sage: Partition([1]).outline()
abs(x + 1) + abs(x - 1) - abs(x)
sage: y = SR.var("y")
sage: Partition([6,5,1]).outline(variable=y)
abs(y + 6) - abs(y + 5) + abs(y + 4) - abs(y + 3)
+ abs(y - 1) - abs(y - 2) + abs(y - 3)

>>> from sage.all import *
>>> # needs sage.symbolic
>>> [Partition([Integer(5),Integer(4)]).outline()(x=i) for i in range(-Integer(10),Integer(11))]
[10, 9, 8, 7, 6, 5, 6, 5, 6, 5, 4, 3, 2, 3, 4, 5, 6, 7, 8, 9, 10]
>>> Partition([]).outline()
abs(x)
>>> Partition([Integer(1)]).outline()
abs(x + 1) + abs(x - 1) - abs(x)
>>> y = SR.var("y")
>>> Partition([Integer(6),Integer(5),Integer(1)]).outline(variable=y)
abs(y + 6) - abs(y + 5) + abs(y + 4) - abs(y + 3)
+ abs(y - 1) - abs(y - 2) + abs(y - 3)

outside_corners()[source]#

Return a list of the outside corners of the partition self.

An outside corner (also called a cocorner) of a partition $$\lambda$$ is a cell on $$\ZZ^2$$ which does not belong to the Young diagram of $$\lambda$$ but can be added to this Young diagram to still form a straight-shape Young diagram.

The entries of the list returned are pairs of the form $$(i,j)$$, where $$i$$ and $$j$$ are the coordinates of the respective corner. The coordinates are counted from $$0$$.

Note

These are called “outer corners” in [Sag2001].

EXAMPLES:

sage: Partition([2,2,1]).outside_corners()
[(0, 2), (2, 1), (3, 0)]
sage: Partition([2,2]).outside_corners()
[(0, 2), (2, 0)]
sage: Partition([6,3,3,1,1,1]).outside_corners()
[(0, 6), (1, 3), (3, 1), (6, 0)]
sage: Partition([]).outside_corners()
[(0, 0)]

>>> from sage.all import *
>>> Partition([Integer(2),Integer(2),Integer(1)]).outside_corners()
[(0, 2), (2, 1), (3, 0)]
>>> Partition([Integer(2),Integer(2)]).outside_corners()
[(0, 2), (2, 0)]
>>> Partition([Integer(6),Integer(3),Integer(3),Integer(1),Integer(1),Integer(1)]).outside_corners()
[(0, 6), (1, 3), (3, 1), (6, 0)]
>>> Partition([]).outside_corners()
[(0, 0)]

outside_corners_residue(i, l)[source]#

Return a list of the outside corners of the partition self having l-residue i.

An outside corner (also called a cocorner) of a partition $$\lambda$$ is a cell on $$\ZZ^2$$ which does not belong to the Young diagram of $$\lambda$$ but can be added to this Young diagram to still form a straight-shape Young diagram. See residue() for the definition of the l-residue.

The entries of the list returned are pairs of the form $$(i,j)$$, where $$i$$ and $$j$$ are the coordinates of the respective corner. The coordinates are counted from $$0$$.

EXAMPLES:

sage: Partition([3,2,1]).outside_corners_residue(0, 3)
[(0, 3), (3, 0)]
sage: Partition([3,2,1]).outside_corners_residue(1, 3)
[(1, 2)]
sage: Partition([3,2,1]).outside_corners_residue(2, 3)
[(2, 1)]

>>> from sage.all import *
>>> Partition([Integer(3),Integer(2),Integer(1)]).outside_corners_residue(Integer(0), Integer(3))
[(0, 3), (3, 0)]
>>> Partition([Integer(3),Integer(2),Integer(1)]).outside_corners_residue(Integer(1), Integer(3))
[(1, 2)]
>>> Partition([Integer(3),Integer(2),Integer(1)]).outside_corners_residue(Integer(2), Integer(3))
[(2, 1)]

plancherel_measure()[source]#

Return the probability of self under the Plancherel probability measure on partitions of the same size.

This probability distribution comes from the uniform distribution on permutations via the Robinson-Schensted correspondence.

EXAMPLES:

sage: Partition([]).plancherel_measure()
1
sage: Partition([1]).plancherel_measure()
1
sage: Partition([2]).plancherel_measure()
1/2
sage: [mu.plancherel_measure() for mu in Partitions(3)]
[1/6, 2/3, 1/6]
sage: Partition([5,4]).plancherel_measure()
7/1440

>>> from sage.all import *
>>> Partition([]).plancherel_measure()
1
>>> Partition([Integer(1)]).plancherel_measure()
1
>>> Partition([Integer(2)]).plancherel_measure()
1/2
>>> [mu.plancherel_measure() for mu in Partitions(Integer(3))]
[1/6, 2/3, 1/6]
>>> Partition([Integer(5),Integer(4)]).plancherel_measure()
7/1440

power(k)[source]#

Return the cycle type of the $$k$$-th power of any permutation with cycle type self (thus describes the powermap of symmetric groups).

Equivalent to GAP’s PowerPartition.

EXAMPLES:

sage: p = Partition([5,3])
sage: p.power(1)
[5, 3]
sage: p.power(2)
[5, 3]
sage: p.power(3)
[5, 1, 1, 1]
sage: p.power(4)
[5, 3]

>>> from sage.all import *
>>> p = Partition([Integer(5),Integer(3)])
>>> p.power(Integer(1))
[5, 3]
>>> p.power(Integer(2))
[5, 3]
>>> p.power(Integer(3))
[5, 1, 1, 1]
>>> p.power(Integer(4))
[5, 3]


Now let us compare this to the power map on $$S_8$$:

sage: # needs sage.groups
sage: G = SymmetricGroup(8)
sage: g = G([(1,2,3,4,5),(6,7,8)]); g
(1,2,3,4,5)(6,7,8)
sage: g^2
(1,3,5,2,4)(6,8,7)
sage: g^3
(1,4,2,5,3)
sage: g^4
(1,5,4,3,2)(6,7,8)

>>> from sage.all import *
>>> # needs sage.groups
>>> G = SymmetricGroup(Integer(8))
>>> g = G([(Integer(1),Integer(2),Integer(3),Integer(4),Integer(5)),(Integer(6),Integer(7),Integer(8))]); g
(1,2,3,4,5)(6,7,8)
>>> g**Integer(2)
(1,3,5,2,4)(6,8,7)
>>> g**Integer(3)
(1,4,2,5,3)
>>> g**Integer(4)
(1,5,4,3,2)(6,7,8)

sage: Partition([3,2,1]).power(3)
[2, 1, 1, 1, 1]

>>> from sage.all import *
>>> Partition([Integer(3),Integer(2),Integer(1)]).power(Integer(3))
[2, 1, 1, 1, 1]

pp()[source]#

Print the Ferrers diagram.

See ferrers_diagram() for more on the Ferrers diagram.

EXAMPLES:

sage: Partition([5,5,2,1]).pp()
*****
*****
**
*
sage: Partitions.options.convention='French'
sage: Partition([5,5,2,1]).pp()
*
**
*****
*****
sage: Partitions.options._reset()

>>> from sage.all import *
>>> Partition([Integer(5),Integer(5),Integer(2),Integer(1)]).pp()
*****
*****
**
*
>>> Partitions.options.convention='French'
>>> Partition([Integer(5),Integer(5),Integer(2),Integer(1)]).pp()
*
**
*****
*****
>>> Partitions.options._reset()

prime_degree(p)[source]#

Return the prime degree for the prime integerp for self.

INPUT:

• p – a prime integer

OUTPUT:

A non-negative integer

The degree of a partition $$\lambda$$ is the sum of the $$e$$-degree() of the standard tableaux of shape $$\lambda$$, for $$e$$ a power of the prime $$p$$. The prime degree gives the exponent of $$p$$ in the Gram determinant of the integral Specht module of the symmetric group.

EXAMPLES:

sage: Partition([4,3]).prime_degree(2)
36
sage: Partition([4,3]).prime_degree(3)
15
sage: Partition([4,3]).prime_degree(5)
13
sage: Partition([4,3]).prime_degree(7)
0

>>> from sage.all import *
>>> Partition([Integer(4),Integer(3)]).prime_degree(Integer(2))
36
>>> Partition([Integer(4),Integer(3)]).prime_degree(Integer(3))
15
>>> Partition([Integer(4),Integer(3)]).prime_degree(Integer(5))
13
>>> Partition([Integer(4),Integer(3)]).prime_degree(Integer(7))
0


Therefore, the Gram determinant of $$S(5,3)$$ when $$q = 1$$ is $$2^{36} 3^{15} 5^{13}$$. Compare with degree().

quotient(length)[source]#

Return the quotient of the partition – in the literature the quotient is commonly referred to as the $$k$$-quotient, $$p$$-quotient, $$r$$-quotient, … .

The $$r$$-quotient of a partition $$\lambda$$ is a list of $$r$$ partitions (labelled from $$0$$ to $$r-1$$), constructed in the following way. Label each cell in the Young diagram of $$\lambda$$ with its content modulo $$r$$. Let $$R_i$$ be the set of rows ending in a cell labelled $$i$$, and $$C_i$$ be the set of columns ending in a cell labelled $$i$$. Then the $$j$$-th component of the quotient of $$\lambda$$ is the partition defined by intersecting $$R_j$$ with $$C_{j+1}$$. (See Theorem 2.7.37 in [JK1981].)

EXAMPLES:

sage: Partition([7,7,5,3,3,3,1]).quotient(3)
([2], [1], [2, 2, 2])

>>> from sage.all import *
>>> Partition([Integer(7),Integer(7),Integer(5),Integer(3),Integer(3),Integer(3),Integer(1)]).quotient(Integer(3))
([2], [1], [2, 2, 2])


Return the RSK recording tableau of the reading word of the (standard) tableau $$T$$ labeled down (in English convention) each column to the shape of self.

For an example of the tableau $$T$$, consider the partition $$\lambda = (3,2,1)$$, then we have:

1 4 6
2 5
3


For more, see RSK().

EXAMPLES:

sage: Partition([3,2,1]).reading_tableau()
[[1, 3, 6], [2, 5], [4]]

>>> from sage.all import *
[[1, 3, 6], [2, 5], [4]]

removable_cells()[source]#

Return a list of the corners of the partition self.

A corner of a partition $$\lambda$$ is a cell of the Young diagram of $$\lambda$$ which can be removed from the Young diagram while still leaving a straight shape behind.

The entries of the list returned are pairs of the form $$(i,j)$$, where $$i$$ and $$j$$ are the coordinates of the respective corner. The coordinates are counted from $$0$$.

Note

This is referred to as an “inner corner” in [Sag2001].

EXAMPLES:

sage: Partition([3,2,1]).corners()
[(0, 2), (1, 1), (2, 0)]
sage: Partition([3,3,1]).corners()
[(1, 2), (2, 0)]
sage: Partition([]).corners()
[]

>>> from sage.all import *
>>> Partition([Integer(3),Integer(2),Integer(1)]).corners()
[(0, 2), (1, 1), (2, 0)]
>>> Partition([Integer(3),Integer(3),Integer(1)]).corners()
[(1, 2), (2, 0)]
>>> Partition([]).corners()
[]

removable_cells_residue(i, l)[source]#

Return a list of the corners of the partition self having l-residue i.

A corner of a partition $$\lambda$$ is a cell of the Young diagram of $$\lambda$$ which can be removed from the Young diagram while still leaving a straight shape behind. See residue() for the definition of the l-residue.

The entries of the list returned are pairs of the form $$(i,j)$$, where $$i$$ and $$j$$ are the coordinates of the respective corner. The coordinates are counted from $$0$$.

EXAMPLES:

sage: Partition([3,2,1]).corners_residue(0, 3)
[(1, 1)]
sage: Partition([3,2,1]).corners_residue(1, 3)
[(2, 0)]
sage: Partition([3,2,1]).corners_residue(2, 3)
[(0, 2)]

>>> from sage.all import *
>>> Partition([Integer(3),Integer(2),Integer(1)]).corners_residue(Integer(0), Integer(3))
[(1, 1)]
>>> Partition([Integer(3),Integer(2),Integer(1)]).corners_residue(Integer(1), Integer(3))
[(2, 0)]
>>> Partition([Integer(3),Integer(2),Integer(1)]).corners_residue(Integer(2), Integer(3))
[(0, 2)]

remove_cell(i, j=None)[source]#

Return the partition obtained by removing a cell at the end of row i of self.

EXAMPLES:

sage: Partition([2,2]).remove_cell(1)
[2, 1]
sage: Partition([2,2,1]).remove_cell(2)
[2, 2]
sage: #Partition([2,2]).remove_cell(0)

>>> from sage.all import *
>>> Partition([Integer(2),Integer(2)]).remove_cell(Integer(1))
[2, 1]
>>> Partition([Integer(2),Integer(2),Integer(1)]).remove_cell(Integer(2))
[2, 2]
>>> #Partition([2,2]).remove_cell(0)

sage: Partition([2,2]).remove_cell(1,1)
[2, 1]
sage: #Partition([2,2]).remove_cell(1,0)

>>> from sage.all import *
>>> Partition([Integer(2),Integer(2)]).remove_cell(Integer(1),Integer(1))
[2, 1]
>>> #Partition([2,2]).remove_cell(1,0)

remove_horizontal_border_strip(k)[source]#

Return the partitions obtained from self by removing an horizontal border strip of length k.

EXAMPLES:

sage: Partition([5,3,1]).remove_horizontal_border_strip(0).list()
[[5, 3, 1]]
sage: Partition([5,3,1]).remove_horizontal_border_strip(1).list()
[[5, 3], [5, 2, 1], [4, 3, 1]]
sage: Partition([5,3,1]).remove_horizontal_border_strip(2).list()
[[5, 2], [5, 1, 1], [4, 3], [4, 2, 1], [3, 3, 1]]
sage: Partition([5,3,1]).remove_horizontal_border_strip(3).list()
[[5, 1], [4, 2], [4, 1, 1], [3, 3], [3, 2, 1]]
sage: Partition([5,3,1]).remove_horizontal_border_strip(4).list()
[[4, 1], [3, 2], [3, 1, 1]]
sage: Partition([5,3,1]).remove_horizontal_border_strip(5).list()
[[3, 1]]
sage: Partition([5,3,1]).remove_horizontal_border_strip(6).list()
[]

>>> from sage.all import *
>>> Partition([Integer(5),Integer(3),Integer(1)]).remove_horizontal_border_strip(Integer(0)).list()
[[5, 3, 1]]
>>> Partition([Integer(5),Integer(3),Integer(1)]).remove_horizontal_border_strip(Integer(1)).list()
[[5, 3], [5, 2, 1], [4, 3, 1]]
>>> Partition([Integer(5),Integer(3),Integer(1)]).remove_horizontal_border_strip(Integer(2)).list()
[[5, 2], [5, 1, 1], [4, 3], [4, 2, 1], [3, 3, 1]]
>>> Partition([Integer(5),Integer(3),Integer(1)]).remove_horizontal_border_strip(Integer(3)).list()
[[5, 1], [4, 2], [4, 1, 1], [3, 3], [3, 2, 1]]
>>> Partition([Integer(5),Integer(3),Integer(1)]).remove_horizontal_border_strip(Integer(4)).list()
[[4, 1], [3, 2], [3, 1, 1]]
>>> Partition([Integer(5),Integer(3),Integer(1)]).remove_horizontal_border_strip(Integer(5)).list()
[[3, 1]]
>>> Partition([Integer(5),Integer(3),Integer(1)]).remove_horizontal_border_strip(Integer(6)).list()
[]


The result is returned as an instance of Partitions_with_constraints:

sage: Partition([5,3,1]).remove_horizontal_border_strip(5)
The subpartitions of [5, 3, 1] obtained by removing a horizontal border strip of length 5

>>> from sage.all import *
>>> Partition([Integer(5),Integer(3),Integer(1)]).remove_horizontal_border_strip(Integer(5))
The subpartitions of [5, 3, 1] obtained by removing a horizontal border strip of length 5

residue(r, c, l)[source]#

Return the l-residue of the cell at row r and column c.

The $$\ell$$-residue of a cell is $$c - r$$ modulo $$\ell$$.

This does not strictly depend upon the partition, however, this method is included because it is often useful in the context of partitions.

EXAMPLES:

sage: Partition([2,1]).residue(1, 0, 3)
2

>>> from sage.all import *
>>> Partition([Integer(2),Integer(1)]).residue(Integer(1), Integer(0), Integer(3))
2

rim()[source]#

Return the rim of self.

The rim of a partition $$\lambda$$ is defined as the cells which belong to $$\lambda$$ and which are adjacent to cells not in $$\lambda$$.

EXAMPLES:

The rim of the partition $$[5,5,2,1]$$ consists of the cells marked with # below:

****#
*####
##
#

sage: Partition([5,5,2,1]).rim()
[(3, 0), (2, 0), (2, 1), (1, 1), (1, 2), (1, 3), (1, 4), (0, 4)]

sage: Partition([2,2,1]).rim()
[(2, 0), (1, 0), (1, 1), (0, 1)]
sage: Partition([2,2]).rim()
[(1, 0), (1, 1), (0, 1)]
sage: Partition([6,3,3,1,1]).rim()
[(4, 0), (3, 0), (2, 0), (2, 1), (2, 2), (1, 2), (0, 2), (0, 3), (0, 4), (0, 5)]
sage: Partition([]).rim()
[]

row_standard_tableaux()[source]#

Return the row standard tableaux of shape self.

EXAMPLES:

sage: Partition([3,2,2,1]).row_standard_tableaux()
Row standard tableaux of shape [3, 2, 2, 1]

>>> from sage.all import *
>>> Partition([Integer(3),Integer(2),Integer(2),Integer(1)]).row_standard_tableaux()
Row standard tableaux of shape [3, 2, 2, 1]

sign()[source]#

Return the sign of any permutation with cycle type self.

This function corresponds to a homomorphism from the symmetric group $$S_n$$ into the cyclic group of order 2, whose kernel is exactly the alternating group $$A_n$$. Partitions of sign $$1$$ are called even partitions while partitions of sign $$-1$$ are called odd.

EXAMPLES:

sage: Partition([5,3]).sign()
1
sage: Partition([5,2]).sign()
-1

>>> from sage.all import *
>>> Partition([Integer(5),Integer(3)]).sign()
1
>>> Partition([Integer(5),Integer(2)]).sign()
-1


Zolotarev’s lemma states that the Legendre symbol $$\left(\frac{a}{p}\right)$$ for an integer $$a \pmod p$$ ($$p$$ a prime number), can be computed as sign(p_a), where sign denotes the sign of a permutation and p_a the permutation of the residue classes $$\pmod p$$ induced by modular multiplication by $$a$$, provided $$p$$ does not divide $$a$$.

We verify this in some examples.

sage: F = GF(11)                                                            # needs sage.rings.finite_rings
sage: a = F.multiplicative_generator();a                                    # needs sage.rings.finite_rings
2
sage: plist = [int(a*F(x)) for x in range(1,11)]; plist                     # needs sage.rings.finite_rings
[2, 4, 6, 8, 10, 1, 3, 5, 7, 9]

>>> from sage.all import *
>>> F = GF(Integer(11))                                                            # needs sage.rings.finite_rings
>>> a = F.multiplicative_generator();a                                    # needs sage.rings.finite_rings
2
>>> plist = [int(a*F(x)) for x in range(Integer(1),Integer(11))]; plist                     # needs sage.rings.finite_rings
[2, 4, 6, 8, 10, 1, 3, 5, 7, 9]


This corresponds to the permutation (1, 2, 4, 8, 5, 10, 9, 7, 3, 6) (acting the set $$\{1,2,...,10\}$$) and to the partition [10].

sage: p = PermutationGroupElement('(1, 2, 4, 8, 5, 10, 9, 7, 3, 6)')        # needs sage.groups
sage: p.sign()                                                              # needs sage.groups
-1
sage: Partition([10]).sign()
-1
sage: kronecker_symbol(11,2)
-1

>>> from sage.all import *
>>> p = PermutationGroupElement('(1, 2, 4, 8, 5, 10, 9, 7, 3, 6)')        # needs sage.groups
>>> p.sign()                                                              # needs sage.groups
-1
>>> Partition([Integer(10)]).sign()
-1
>>> kronecker_symbol(Integer(11),Integer(2))
-1


Now replace $$2$$ by $$3$$:

sage: plist = [int(F(3*x)) for x in range(1,11)]; plist                     # needs sage.rings.finite_rings
[3, 6, 9, 1, 4, 7, 10, 2, 5, 8]
sage: list(range(1, 11))
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
sage: p = PermutationGroupElement('(3,4,8,7,9)')                            # needs sage.groups
sage: p.sign()                                                              # needs sage.groups
1
sage: kronecker_symbol(3,11)
1
sage: Partition([5,1,1,1,1,1]).sign()
1

>>> from sage.all import *
>>> plist = [int(F(Integer(3)*x)) for x in range(Integer(1),Integer(11))]; plist                     # needs sage.rings.finite_rings
[3, 6, 9, 1, 4, 7, 10, 2, 5, 8]
>>> list(range(Integer(1), Integer(11)))
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
>>> p = PermutationGroupElement('(3,4,8,7,9)')                            # needs sage.groups
>>> p.sign()                                                              # needs sage.groups
1
>>> kronecker_symbol(Integer(3),Integer(11))
1
>>> Partition([Integer(5),Integer(1),Integer(1),Integer(1),Integer(1),Integer(1)]).sign()
1


In both cases, Zolotarev holds.

REFERENCES:

simple_module_dimension(base_ring=None)[source]#

Return the dimension of the simple module corresponding to self.

When the base ring is a field of characteristic $$0$$, this is equal to the dimension of the Specht module.

INPUT:

• base_ring – (default: $$\QQ$$) the base ring

EXAMPLES:

sage: Partition([2,2,1]).simple_module_dimension()
5
sage: Partition([2,2,1]).specht_module_dimension(GF(3))                     # needs sage.rings.finite_rings
5
sage: Partition([2,2,1]).simple_module_dimension(GF(3))                     # needs sage.rings.finite_rings
4

sage: for la in Partitions(6, regular=3):
....:     print(la, la.specht_module_dimension(), la.simple_module_dimension(GF(3)))
[6] 1 1
[5, 1] 5 4
[4, 2] 9 9
[4, 1, 1] 10 6
[3, 3] 5 1
[3, 2, 1] 16 4
[2, 2, 1, 1] 9 9

>>> from sage.all import *
>>> Partition([Integer(2),Integer(2),Integer(1)]).simple_module_dimension()
5
>>> Partition([Integer(2),Integer(2),Integer(1)]).specht_module_dimension(GF(Integer(3)))                     # needs sage.rings.finite_rings
5
>>> Partition([Integer(2),Integer(2),Integer(1)]).simple_module_dimension(GF(Integer(3)))                     # needs sage.rings.finite_rings
4

>>> for la in Partitions(Integer(6), regular=Integer(3)):
...     print(la, la.specht_module_dimension(), la.simple_module_dimension(GF(Integer(3))))
[6] 1 1
[5, 1] 5 4
[4, 2] 9 9
[4, 1, 1] 10 6
[3, 3] 5 1
[3, 2, 1] 16 4
[2, 2, 1, 1] 9 9

size()[source]#

Return the size of self.

EXAMPLES:

sage: Partition([2,2]).size()
4
sage: Partition([3,2,1]).size()
6

>>> from sage.all import *
>>> Partition([Integer(2),Integer(2)]).size()
4
>>> Partition([Integer(3),Integer(2),Integer(1)]).size()
6

specht_module(base_ring=None)[source]#

Return the Specht module corresponding to self.

EXAMPLES:

sage: SM = Partition([2,2,1]).specht_module(QQ); SM                         # needs sage.modules
Specht module of [2, 2, 1] over Rational Field
sage: SM.frobenius_image()                                                  # needs sage.modules
s[2, 2, 1]

>>> from sage.all import *
>>> SM = Partition([Integer(2),Integer(2),Integer(1)]).specht_module(QQ); SM                         # needs sage.modules
Specht module of [2, 2, 1] over Rational Field
>>> SM.frobenius_image()                                                  # needs sage.modules
s[2, 2, 1]

specht_module_dimension(base_ring=None)[source]#

Return the dimension of the Specht module corresponding to self.

This is equal to the number of standard tableaux of shape self when over a field of characteristic $$0$$.

INPUT:

• base_ring – (default: $$\QQ$$) the base ring

EXAMPLES:

sage: Partition([2,2,1]).specht_module_dimension()
5
sage: Partition([2,2,1]).specht_module_dimension(GF(2))                     # needs sage.rings.finite_rings
5

>>> from sage.all import *
>>> Partition([Integer(2),Integer(2),Integer(1)]).specht_module_dimension()
5
>>> Partition([Integer(2),Integer(2),Integer(1)]).specht_module_dimension(GF(Integer(2)))                     # needs sage.rings.finite_rings
5

standard_tableaux()[source]#

Return the standard tableaux of shape self.

EXAMPLES:

sage: Partition([3,2,2,1]).standard_tableaux()
Standard tableaux of shape [3, 2, 2, 1]

>>> from sage.all import *
>>> Partition([Integer(3),Integer(2),Integer(2),Integer(1)]).standard_tableaux()
Standard tableaux of shape [3, 2, 2, 1]

stretch(k)[source]#

Return the partition obtained by multiplying each part with the given number.

EXAMPLES:

sage: p = Partition([4,2,2,1,1])
sage: p.stretch(3)
[12, 6, 6, 3, 3]

>>> from sage.all import *
>>> p = Partition([Integer(4),Integer(2),Integer(2),Integer(1),Integer(1)])
>>> p.stretch(Integer(3))
[12, 6, 6, 3, 3]

suter_diagonal_slide(n, exp=1)[source]#

Return the image of self in $$Y_n$$ under Suter’s diagonal slide $$\sigma_n$$, where the notations used are those defined in [Sut2002].

The set $$Y_n$$ is defined as the set of all partitions $$\lambda$$ such that the hook length of the $$(0, 0)$$-cell (i.e. the northwestern most cell in English notation) of $$\lambda$$ is less than $$n$$, including the empty partition.

The map $$\sigma_n$$ sends a partition (with non-zero entries) $$(\lambda_1, \lambda_2, \ldots, \lambda_m) \in Y_n$$ to the partition $$(\lambda_2 + 1, \lambda_3 + 1, \ldots, \lambda_m + 1, \underbrace{1, 1, \ldots, 1}_{n - m - \lambda_1\text{ ones}})$$. In other words, it pads the partition with trailing zeroes until it has length $$n - \lambda_1$$, then removes its first part, and finally adds $$1$$ to each part.

By Theorem 2.1 of [Sut2002], the dihedral group $$D_n$$ with $$2n$$ elements acts on $$Y_n$$ by letting the primitive rotation act as $$\sigma_n$$ and the reflection act as conjugation of partitions (conjugate()). This action is faithful if $$n \geq 3$$.

INPUT:

• n – nonnegative integer

• exp – (default: 1) how many times $$\sigma_n$$ should be applied

OUTPUT:

The result of applying Suter’s diagonal slide $$\sigma_n$$ to self, assuming that self lies in $$Y_n$$. If the optional argument exp is set, then the slide $$\sigma_n$$ is applied not just once, but exp times (note that exp is allowed to be negative, since the slide has finite order).

EXAMPLES:

sage: Partition([5,4,1]).suter_diagonal_slide(8)
[5, 2]
sage: Partition([5,4,1]).suter_diagonal_slide(9)
[5, 2, 1]
sage: Partition([]).suter_diagonal_slide(7)
[1, 1, 1, 1, 1, 1]
sage: Partition([]).suter_diagonal_slide(1)
[]
sage: Partition([]).suter_diagonal_slide(7, exp=-1)
[6]
sage: Partition([]).suter_diagonal_slide(1, exp=-1)
[]
sage: P7 = Partitions(7)
sage: all( p == p.suter_diagonal_slide(9, exp=-1).suter_diagonal_slide(9)
....:      for p in P7 )
True
sage: all( p == p.suter_diagonal_slide(9, exp=3)
....:            .suter_diagonal_slide(9, exp=3)
....:            .suter_diagonal_slide(9, exp=3)
....:      for p in P7 )
True
sage: all( p == p.suter_diagonal_slide(9, exp=6)
....:            .suter_diagonal_slide(9, exp=6)
....:            .suter_diagonal_slide(9, exp=6)
....:      for p in P7 )
True
sage: all( p == p.suter_diagonal_slide(9, exp=-1)
....:            .suter_diagonal_slide(9, exp=1)
....:      for p in P7 )
True

>>> from sage.all import *
>>> Partition([Integer(5),Integer(4),Integer(1)]).suter_diagonal_slide(Integer(8))
[5, 2]
>>> Partition([Integer(5),Integer(4),Integer(1)]).suter_diagonal_slide(Integer(9))
[5, 2, 1]
>>> Partition([]).suter_diagonal_slide(Integer(7))
[1, 1, 1, 1, 1, 1]
>>> Partition([]).suter_diagonal_slide(Integer(1))
[]
>>> Partition([]).suter_diagonal_slide(Integer(7), exp=-Integer(1))
[6]
>>> Partition([]).suter_diagonal_slide(Integer(1), exp=-Integer(1))
[]
>>> P7 = Partitions(Integer(7))
>>> all( p == p.suter_diagonal_slide(Integer(9), exp=-Integer(1)).suter_diagonal_slide(Integer(9))
...      for p in P7 )
True
>>> all( p == p.suter_diagonal_slide(Integer(9), exp=Integer(3))
...            .suter_diagonal_slide(Integer(9), exp=Integer(3))
...            .suter_diagonal_slide(Integer(9), exp=Integer(3))
...      for p in P7 )
True
>>> all( p == p.suter_diagonal_slide(Integer(9), exp=Integer(6))
...            .suter_diagonal_slide(Integer(9), exp=Integer(6))
...            .suter_diagonal_slide(Integer(9), exp=Integer(6))
...      for p in P7 )
True
>>> all( p == p.suter_diagonal_slide(Integer(9), exp=-Integer(1))
...            .suter_diagonal_slide(Integer(9), exp=Integer(1))
...      for p in P7 )
True


Check of the assertion in [Sut2002] that $$\sigma_n\bigl( \sigma_n( \lambda^{\prime})^{\prime} \bigr) = \lambda$$:

sage: all( p.suter_diagonal_slide(8).conjugate()
....:      == p.conjugate().suter_diagonal_slide(8, exp=-1)
....:      for p in P7 )
True

>>> from sage.all import *
>>> all( p.suter_diagonal_slide(Integer(8)).conjugate()
...      == p.conjugate().suter_diagonal_slide(Integer(8), exp=-Integer(1))
...      for p in P7 )
True


Check of Claim 1 in [Sut2002]:

sage: P5 = Partitions(5)
sage: all( all( (p.suter_diagonal_slide(6) in q.suter_diagonal_slide(6).down())
....:           or (q.suter_diagonal_slide(6) in p.suter_diagonal_slide(6).down())
....:           for p in q.down() )
....:      for q in P5 )
True

>>> from sage.all import *
>>> P5 = Partitions(Integer(5))
>>> all( all( (p.suter_diagonal_slide(Integer(6)) in q.suter_diagonal_slide(Integer(6)).down())
...           or (q.suter_diagonal_slide(Integer(6)) in p.suter_diagonal_slide(Integer(6)).down())
...           for p in q.down() )
...      for q in P5 )
True

t_completion(t)[source]#

Return the t-completion of the partition self.

If $$\lambda = (\lambda_1, \lambda_2, \lambda_3, \ldots)$$ is a partition and $$t$$ is an integer greater or equal to $$\left\lvert \lambda \right\rvert + \lambda_1$$, then the $$t$$-completion of $$\lambda$$ is defined as the partition $$(t - \left\lvert \lambda \right\rvert, \lambda_1, \lambda_2, \lambda_3, \ldots)$$ of $$t$$. This partition is denoted by $$\lambda[t]$$ in [BOR2009], by $$\lambda_{[t]}$$ in [BdVO2012], and by $$\lambda(t)$$ in [CO2010].

EXAMPLES:

sage: Partition([]).t_completion(0)
[]
sage: Partition([]).t_completion(1)
[1]
sage: Partition([]).t_completion(2)
[2]
sage: Partition([]).t_completion(3)
[3]
sage: Partition([2, 1]).t_completion(5)
[2, 2, 1]
sage: Partition([2, 1]).t_completion(6)
[3, 2, 1]
sage: Partition([4, 2, 2, 1]).t_completion(13)
[4, 4, 2, 2, 1]
sage: Partition([4, 2, 2, 1]).t_completion(19)
[10, 4, 2, 2, 1]
sage: Partition([4, 2, 2, 1]).t_completion(10)
Traceback (most recent call last):
...
ValueError: 10-completion is not defined
sage: Partition([4, 2, 2, 1]).t_completion(5)
Traceback (most recent call last):
...
ValueError: 5-completion is not defined

>>> from sage.all import *
>>> Partition([]).t_completion(Integer(0))
[]
>>> Partition([]).t_completion(Integer(1))
[1]
>>> Partition([]).t_completion(Integer(2))
[2]
>>> Partition([]).t_completion(Integer(3))
[3]
>>> Partition([Integer(2), Integer(1)]).t_completion(Integer(5))
[2, 2, 1]
>>> Partition([Integer(2), Integer(1)]).t_completion(Integer(6))
[3, 2, 1]
>>> Partition([Integer(4), Integer(2), Integer(2), Integer(1)]).t_completion(Integer(13))
[4, 4, 2, 2, 1]
>>> Partition([Integer(4), Integer(2), Integer(2), Integer(1)]).t_completion(Integer(19))
[10, 4, 2, 2, 1]
>>> Partition([Integer(4), Integer(2), Integer(2), Integer(1)]).t_completion(Integer(10))
Traceback (most recent call last):
...
ValueError: 10-completion is not defined
>>> Partition([Integer(4), Integer(2), Integer(2), Integer(1)]).t_completion(Integer(5))
Traceback (most recent call last):
...
ValueError: 5-completion is not defined

tabloid_module(base_ring=None)[source]#

Return the tabloid module corresponding to self.

EXAMPLES:

sage: TM = Partition([2,2,1]).tabloid_module(QQ); TM
Tabloid module of [2, 2, 1] over Rational Field
sage: TM.frobenius_image()
s[2, 2, 1] + s[3, 1, 1] + 2*s[3, 2] + 2*s[4, 1] + s[5]

>>> from sage.all import *
>>> TM = Partition([Integer(2),Integer(2),Integer(1)]).tabloid_module(QQ); TM
Tabloid module of [2, 2, 1] over Rational Field
>>> TM.frobenius_image()
s[2, 2, 1] + s[3, 1, 1] + 2*s[3, 2] + 2*s[4, 1] + s[5]

to_core(k)[source]#

Maps the $$k$$-bounded partition self to its corresponding $$k+1$$-core.

See also k_skew().

EXAMPLES:

sage: p = Partition([4,3,2,2,1,1])
sage: c = p.to_core(4); c
[9, 5, 3, 2, 1, 1]
sage: type(c)
<class 'sage.combinat.core.Cores_length_with_category.element_class'>
sage: c.to_bounded_partition() == p
True

>>> from sage.all import *
>>> p = Partition([Integer(4),Integer(3),Integer(2),Integer(2),Integer(1),Integer(1)])
>>> c = p.to_core(Integer(4)); c
[9, 5, 3, 2, 1, 1]
>>> type(c)
<class 'sage.combinat.core.Cores_length_with_category.element_class'>
>>> c.to_bounded_partition() == p
True

to_dyck_word(n=None)[source]#

Return the n-Dyck word whose corresponding partition is self (or, if n is not specified, the $$n$$-Dyck word with smallest $$n$$ to satisfy this property).

If $$w$$ is an $$n$$-Dyck word (that is, a Dyck word with $$n$$ open symbols and $$n$$ close symbols), then the Dyck path corresponding to $$w$$ can be regarded as a lattice path in the northeastern half of an $$n \times n$$-square. The region to the northeast of this Dyck path can be regarded as a partition. It is called the partition corresponding to the Dyck word $$w$$. (See to_partition().)

For every partition $$\lambda$$ and every nonnegative integer $$n$$, there exists at most one $$n$$-Dyck word $$w$$ such that the partition corresponding to $$w$$ is $$\lambda$$ (in fact, such $$w$$ exists if and only if $$\lambda_i + i \leq n$$ for every $$i$$, where $$\lambda$$ is written in the form $$(\lambda_1, \lambda_2, \ldots, \lambda_k)$$ with $$\lambda_k > 0$$). This method computes this $$w$$ for a given $$\lambda$$ and $$n$$. If $$n$$ is not specified, this method computes the $$w$$ for the smallest possible $$n$$ for which such an $$w$$ exists. (The minimality of $$n$$ means that the partition demarcated by the Dyck path touches the diagonal.)

EXAMPLES:

sage: Partition([2,2]).to_dyck_word()
[1, 1, 0, 0, 1, 1, 0, 0]
sage: Partition([2,2]).to_dyck_word(4)
[1, 1, 0, 0, 1, 1, 0, 0]
sage: Partition([2,2]).to_dyck_word(5)
[1, 1, 1, 0, 0, 1, 1, 0, 0, 0]
sage: Partition([6,3,1]).to_dyck_word()
[1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0]
sage: Partition([]).to_dyck_word()
[]
sage: Partition([]).to_dyck_word(3)
[1, 1, 1, 0, 0, 0]

>>> from sage.all import *
>>> Partition([Integer(2),Integer(2)]).to_dyck_word()
[1, 1, 0, 0, 1, 1, 0, 0]
>>> Partition([Integer(2),Integer(2)]).to_dyck_word(Integer(4))
[1, 1, 0, 0, 1, 1, 0, 0]
>>> Partition([Integer(2),Integer(2)]).to_dyck_word(Integer(5))
[1, 1, 1, 0, 0, 1, 1, 0, 0, 0]
>>> Partition([Integer(6),Integer(3),Integer(1)]).to_dyck_word()
[1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0]
>>> Partition([]).to_dyck_word()
[]
>>> Partition([]).to_dyck_word(Integer(3))
[1, 1, 1, 0, 0, 0]


The partition corresponding to self.dyck_word() is self indeed:

sage: all( p.to_dyck_word().to_partition() == p
....:      for p in Partitions(5) )
True

>>> from sage.all import *
>>> all( p.to_dyck_word().to_partition() == p
...      for p in Partitions(Integer(5)) )
True

to_exp(k=0)[source]#

Return a list of the multiplicities of the parts of a partition. Use the optional parameter k to get a return list of length at least k.

EXAMPLES:

sage: Partition([3,2,2,1]).to_exp()
[1, 2, 1]
sage: Partition([3,2,2,1]).to_exp(5)
[1, 2, 1, 0, 0]

>>> from sage.all import *
>>> Partition([Integer(3),Integer(2),Integer(2),Integer(1)]).to_exp()
[1, 2, 1]
>>> Partition([Integer(3),Integer(2),Integer(2),Integer(1)]).to_exp(Integer(5))
[1, 2, 1, 0, 0]

to_exp_dict()[source]#

Return a dictionary containing the multiplicities of the parts of self.

EXAMPLES:

sage: p = Partition([4,2,2,1])
sage: d = p.to_exp_dict()
sage: d[4]
1
sage: d[2]
2
sage: d[1]
1
sage: 5 in d
False

>>> from sage.all import *
>>> p = Partition([Integer(4),Integer(2),Integer(2),Integer(1)])
>>> d = p.to_exp_dict()
>>> d[Integer(4)]
1
>>> d[Integer(2)]
2
>>> d[Integer(1)]
1
>>> Integer(5) in d
False

to_list()[source]#

Return self as a list.

EXAMPLES:

sage: p = Partition([2,1]).to_list(); p
[2, 1]
sage: type(p)
<class 'list'>

>>> from sage.all import *
>>> p = Partition([Integer(2),Integer(1)]).to_list(); p
[2, 1]
>>> type(p)
<class 'list'>

top_garnir_tableau(e, cell)[source]#

Return the most dominant standard tableau which dominates the corresponding Garnir tableau and has the same e-residue.

The Garnir tableau play an important role in integral and non-semisimple representation theory because they determine the “straightening” rules for the Specht modules. The top Garnir tableaux arise in the graded representation theory of the symmetric groups and higher level Hecke algebras. They were introduced in [KMR2012].

If the Garnir node is cell=(r,c) and $$m$$ and $$M$$ are the entries in the cells (r,c) and (r+1,c), respectively, in the initial tableau then the top e-Garnir tableau is obtained by inserting the numbers $$m, m+1, \ldots, M$$ in order from left to right first in the cells in row r+1 which are not in the e-Garnir belt, then in the cell in rows r and r+1 which are in the Garnir belt and then, finally, in the remaining cells in row r which are not in the Garnir belt. All other entries in the tableau remain unchanged.

If e = 0, or if there are no e-bricks in either row r or r+1, then the top Garnir tableau is the corresponding Garnir tableau.

EXAMPLES:

sage: Partition([5,4,3,2]).top_garnir_tableau(2,(0,2)).pp()
1  2  4  5  8
3  6  7  9
10 11 12
13 14
sage: Partition([5,4,3,2]).top_garnir_tableau(3,(0,2)).pp()
1  2  3  4  5
6  7  8  9
10 11 12
13 14
sage: Partition([5,4,3,2]).top_garnir_tableau(4,(0,2)).pp()
1  2  6  7  8
3  4  5  9
10 11 12
13 14
sage: Partition([5,4,3,2]).top_garnir_tableau(0,(0,2)).pp()
1  2  6  7  8
3  4  5  9
10 11 12
13 14

>>> from sage.all import *
>>> Partition([Integer(5),Integer(4),Integer(3),Integer(2)]).top_garnir_tableau(Integer(2),(Integer(0),Integer(2))).pp()
1  2  4  5  8
3  6  7  9
10 11 12
13 14
>>> Partition([Integer(5),Integer(4),Integer(3),Integer(2)]).top_garnir_tableau(Integer(3),(Integer(0),Integer(2))).pp()
1  2  3  4  5
6  7  8  9
10 11 12
13 14
>>> Partition([Integer(5),Integer(4),Integer(3),Integer(2)]).top_garnir_tableau(Integer(4),(Integer(0),Integer(2))).pp()
1  2  6  7  8
3  4  5  9
10 11 12
13 14
>>> Partition([Integer(5),Integer(4),Integer(3),Integer(2)]).top_garnir_tableau(Integer(0),(Integer(0),Integer(2))).pp()
1  2  6  7  8
3  4  5  9
10 11 12
13 14


REFERENCES:

up()[source]#

Return a generator for partitions that can be obtained from self by adding a cell.

EXAMPLES:

sage: list(Partition([2,1,1]).up())
[[3, 1, 1], [2, 2, 1], [2, 1, 1, 1]]
sage: list(Partition([3,2]).up())
[[4, 2], [3, 3], [3, 2, 1]]
sage: [p for p in Partition([]).up()]
[[1]]

>>> from sage.all import *
>>> list(Partition([Integer(2),Integer(1),Integer(1)]).up())
[[3, 1, 1], [2, 2, 1], [2, 1, 1, 1]]
>>> list(Partition([Integer(3),Integer(2)]).up())
[[4, 2], [3, 3], [3, 2, 1]]
>>> [p for p in Partition([]).up()]
[[1]]

up_list()[source]#

Return a list of the partitions that can be formed from self by adding a cell.

EXAMPLES:

sage: Partition([2,1,1]).up_list()
[[3, 1, 1], [2, 2, 1], [2, 1, 1, 1]]
sage: Partition([3,2]).up_list()
[[4, 2], [3, 3], [3, 2, 1]]
sage: Partition([]).up_list()
[[1]]

>>> from sage.all import *
>>> Partition([Integer(2),Integer(1),Integer(1)]).up_list()
[[3, 1, 1], [2, 2, 1], [2, 1, 1, 1]]
>>> Partition([Integer(3),Integer(2)]).up_list()
[[4, 2], [3, 3], [3, 2, 1]]
>>> Partition([]).up_list()
[[1]]

upper_hook(i, j, alpha)[source]#

Return the upper hook length of the cell $$(i,j)$$ in self. When alpha = 1, this is just the normal hook length.

The upper hook length of a cell $$(i,j)$$ in a partition $$\kappa$$ is defined by

$h^*_\kappa(i,j) = \kappa^\prime_j - i + \alpha(\kappa_i - j + 1).$

EXAMPLES:

sage: p = Partition([2,1])
sage: p.upper_hook(0,0,1)
3
sage: p.hook_length(0,0)
3
sage: [ p.upper_hook(i,j,x) for i,j in p.cells() ]                          # needs sage.symbolic
[2*x + 1, x, x]

>>> from sage.all import *
>>> p = Partition([Integer(2),Integer(1)])
>>> p.upper_hook(Integer(0),Integer(0),Integer(1))
3
>>> p.hook_length(Integer(0),Integer(0))
3
>>> [ p.upper_hook(i,j,x) for i,j in p.cells() ]                          # needs sage.symbolic
[2*x + 1, x, x]

upper_hook_lengths(alpha)[source]#

Return a tableau of shape self with the cells filled in with the upper hook lengths. When alpha = 1, these are just the normal hook lengths.

The upper hook length of a cell $$(i,j)$$ in a partition $$\kappa$$ is defined by

$h^*_\kappa(i,j) = \kappa^\prime_j - i + \alpha(\kappa_i - j + 1).$

EXAMPLES:

sage: Partition([3,2,1]).upper_hook_lengths(x)                              # needs sage.symbolic
[[3*x + 2, 2*x + 1, x], [2*x + 1, x], [x]]
sage: Partition([3,2,1]).upper_hook_lengths(1)
[[5, 3, 1], [3, 1], [1]]
sage: Partition([3,2,1]).hook_lengths()
[[5, 3, 1], [3, 1], [1]]

>>> from sage.all import *
>>> Partition([Integer(3),Integer(2),Integer(1)]).upper_hook_lengths(x)                              # needs sage.symbolic
[[3*x + 2, 2*x + 1, x], [2*x + 1, x], [x]]
>>> Partition([Integer(3),Integer(2),Integer(1)]).upper_hook_lengths(Integer(1))
[[5, 3, 1], [3, 1], [1]]
>>> Partition([Integer(3),Integer(2),Integer(1)]).hook_lengths()
[[5, 3, 1], [3, 1], [1]]

vertical_border_strip_cells(k)[source]#

Return a list of all the vertical border strips of length k which can be added to self, where each horizontal border strip is a generator of cells.

EXAMPLES:

sage: list(Partition([]).vertical_border_strip_cells(0))
[]
sage: list(Partition([3,2,1]).vertical_border_strip_cells(0))
[]
sage: list(Partition([]).vertical_border_strip_cells(2))
[[(0, 0), (1, 0)]]
sage: list(Partition([2,2]).vertical_border_strip_cells(2))
[[(0, 2), (1, 2)],
[(0, 2), (2, 0)],
[(2, 0), (3, 0)]]
sage: list(Partition([3,2,2]).vertical_border_strip_cells(2))
[[(0, 3), (1, 2)],
[(0, 3), (3, 0)],
[(1, 2), (2, 2)],
[(1, 2), (3, 0)],
[(3, 0), (4, 0)]]

>>> from sage.all import *
>>> list(Partition([]).vertical_border_strip_cells(Integer(0)))
[]
>>> list(Partition([Integer(3),Integer(2),Integer(1)]).vertical_border_strip_cells(Integer(0)))
[]
>>> list(Partition([]).vertical_border_strip_cells(Integer(2)))
[[(0, 0), (1, 0)]]
>>> list(Partition([Integer(2),Integer(2)]).vertical_border_strip_cells(Integer(2)))
[[(0, 2), (1, 2)],
[(0, 2), (2, 0)],
[(2, 0), (3, 0)]]
>>> list(Partition([Integer(3),Integer(2),Integer(2)]).vertical_border_strip_cells(Integer(2)))
[[(0, 3), (1, 2)],
[(0, 3), (3, 0)],
[(1, 2), (2, 2)],
[(1, 2), (3, 0)],
[(3, 0), (4, 0)]]

weighted_size()[source]#

Return the weighted size of self.

The weighted size of a partition $$\lambda$$ is

$\sum_i i \cdot \lambda_i,$

where $$\lambda = (\lambda_0, \lambda_1, \lambda_2, \cdots )$$.

This also the sum of the leg length of every cell in $$\lambda$$, or

$\sum_i \binom{\lambda^{\prime}_i}{2}$

where $$\lambda^{\prime}$$ is the conjugate partition of $$\lambda$$.

EXAMPLES:

sage: Partition([2,2]).weighted_size()
2
sage: Partition([3,3,3]).weighted_size()
9
sage: Partition([5,2]).weighted_size()
2
sage: Partition([]).weighted_size()
0

>>> from sage.all import *
>>> Partition([Integer(2),Integer(2)]).weighted_size()
2
>>> Partition([Integer(3),Integer(3),Integer(3)]).weighted_size()
9
>>> Partition([Integer(5),Integer(2)]).weighted_size()
2
>>> Partition([]).weighted_size()
0

young_subgroup()[source]#

Return the corresponding Young, or parabolic, subgroup of the symmetric group.

The Young subgroup of a partition $$\lambda = (\lambda_1, \lambda_2, \ldots, \lambda_{\ell})$$ of $$n$$ is the group:

$S_{\lambda_1} \times S_{\lambda_2} \times \cdots \times S_{\lambda_{\ell}}$

embedded into $$S_n$$ in the standard way (i.e., the $$S_{\lambda_i}$$ factor acts on the numbers from $$\lambda_1 + \lambda_2 + \cdots + \lambda_{i-1} + 1$$ to $$\lambda_1 + \lambda_2 + \cdots + \lambda_i$$).

EXAMPLES:

sage: Partition([4,2]).young_subgroup()                                     # needs sage.groups
Permutation Group with generators [(), (5,6), (3,4), (2,3), (1,2)]

>>> from sage.all import *
>>> Partition([Integer(4),Integer(2)]).young_subgroup()                                     # needs sage.groups
Permutation Group with generators [(), (5,6), (3,4), (2,3), (1,2)]

young_subgroup_generators()[source]#

Return an indexing set for the generators of the corresponding Young subgroup. Here the generators correspond to the simple adjacent transpositions $$s_i = (i \; i+1)$$.

EXAMPLES:

sage: Partition([4,2]).young_subgroup_generators()
[1, 2, 3, 5]
sage: Partition([1,1,1]).young_subgroup_generators()
[]
sage: Partition([2,2]).young_subgroup_generators()
[1, 3]

>>> from sage.all import *
>>> Partition([Integer(4),Integer(2)]).young_subgroup_generators()
[1, 2, 3, 5]
>>> Partition([Integer(1),Integer(1),Integer(1)]).young_subgroup_generators()
[]
>>> Partition([Integer(2),Integer(2)]).young_subgroup_generators()
[1, 3]

zero_one_sequence()[source]#

Compute the finite $$0-1$$ sequence of the partition.

The full $$0-1$$ sequence is the sequence (infinite in both directions) indicating the steps taken when following the outer rim of the diagram of the partition. We use the convention that in English convention, a 1 corresponds to an East step, and a 0 corresponds to a North step.

Note that every full $$0-1$$ sequence starts with infinitely many 0’s and ends with infinitely many 1’s.

One place where these arise is in the affine symmetric group where one takes an affine permutation $$w$$ and every $$i$$ such that $$w(i) \leq 0$$ corresponds to a 1 and $$w(i) > 0$$ corresponds to a 0. See pages 24-25 of [LLMSSZ2013] for connections to affine Grassmannian elements (note there they use the French convention for their partitions).

These are also known as path sequences, Maya diagrams, plus-minus diagrams, Comet code [Sta-EC2], among others.

OUTPUT:

The finite $$0-1$$ sequence is obtained from the full $$0-1$$ sequence by omitting all heading 0’s and trailing 1’s. The output sequence is finite, starts with a 1 and ends with a 0 (unless it is empty, for the empty partition). Its length is the sum of the first part of the partition with the length of the partition.

EXAMPLES: