Module: sage.combinat.skew_partition
Skew Partitions
A skew partition
of size
is a pair of partitions
where
is a partition of the integer
,
is a partition
of the integer
,
is an inner partition of
, and
. We say that
and
are respectively
the inner and outer partitions of
.
A skew partition can be depicted by a diagram made of rows of boxes,
in the same way as a partition. Only the boxes of the outer
partition
which are not in the inner partition
appear
in the picture. For example, this is the diagram of the skew
partition [[5,4,3,1],[3,3,1]].
sage: print SkewPartition([[5,4,3,1],[3,3,1]]).diagram() ## # ## #
A skew partition can be connected, which can easily be described in graphic terms: for each pair of consecutive rows, there are at least two boxes (one in each row) which have a common edge. This is the diagram of the connected skew partition [[5,4,3,1],[3,1]]:
sage: print SkewPartition([[5,4,3,1],[3,1]]).diagram() ## ### ### # sage: SkewPartition([[5,4,3,1],[3,1]]).is_connected() True
The first example of a skew partition is not a connected one.
Applying a reflection with respect to the main diagonal yields the diagram of the conjugate skew partition, here [[4,3,3,2,1],[3,3,2]]:
sage: SkewPartition([[5,4,3,1],[3,3,1]]).conjugate() [[4, 3, 3, 2, 1], [3, 2, 2]] sage: print SkewPartition([[5,4,3,1],[3,3,1]]).conjugate().diagram() # # # ## #
The outer corners of a skew partition are the corners of its outer partition. The inner corners are the internal corners of the outer partition when the inner partition is taken off. Shown below are the coordinates of the inner and outer corners.
sage: SkewPartition([[5,4,3,1],[3,3,1]]).outer_corners() [[0, 4], [1, 3], [2, 2], [3, 0]] sage: SkewPartition([[5,4,3,1],[3,3,1]]).inner_corners() [[0, 3], [2, 1], [3, 0]]
There are 9 skew partitions of size 3.
sage: SkewPartitions(3).count() 9 sage: SkewPartitions(3).list() [[[1, 1, 1], []], [[2, 2, 1], [1, 1]], [[2, 1, 1], [1]], [[3, 2, 1], [2, 1]], [[2, 2], [1]], [[3, 2], [2]], [[2, 1], []], [[3, 1], [1]], [[3], []]]
There are 4 connected skew partitions of size 3.
sage: SkewPartitions(3, overlap=1).count() 4 sage: SkewPartitions(3, overlap=1).list() [[[1, 1, 1], []], [[2, 2], [1]], [[2, 1], []], [[3], []]]
This is the conjugate of the skew partition [[4,3,1],[2]]
sage: SkewPartition([[4,3,1],[2]]).conjugate() [[3, 2, 2, 1], [1, 1]]
Geometrically, we just applied a relection with respect to the main diagonal on the diagram of the partition. Of course, this operation is an involution:
sage: SkewPartition([[4,3,1],[2]]).conjugate().conjugate() [[4, 3, 1], [2]]
The jacobi_trudy() method computes the Jacobi-Trudi matrix. See Macdonald I.-G., (1995), "Symmetric Functions and Hall Polynomials", Oxford Science Publication for a definition and discussion.
sage: SkewPartition([[4,3,1],[2]]).jacobi_trudi() [h[2] h[] 0] [h[5] h[3] h[]] [h[6] h[4] h[1]]
This example shows how to compute the corners of a skew partition.
sage: SkewPartition([[4,3,1],[2]]).inner_corners() [[0, 2], [1, 0]] sage: SkewPartition([[4,3,1],[2]]).outer_corners() [[0, 3], [1, 2], [2, 0]]
Module-level Functions
skp) |
Returns the skew partition object corresponding to skp.
sage: skp = SkewPartition([[3,2,1],[2,1]]); skp [[3, 2, 1], [2, 1]] sage: skp.inner() [2, 1] sage: skp.outer() [3, 2, 1]
[n=None], [row_lengths=None], [overlap=0]) |
Returns the combinatorial class of skew partitions.
sage: SkewPartitions(4) Skew partitions of 4 sage: SkewPartitions(4).count() 28 sage: SkewPartitions(row_lengths=[2,1,2]) Skew partitions with row lengths [2, 1, 2] sage: SkewPartitions(4, overlap=2) Skew partitions of 4 with overlap of 2 sage: SkewPartitions(4, overlap=2).list() [[[2, 2], []], [[4], []]]
skp) |
sage: from sage.combinat.skew_partition import row_lengths_aux sage: row_lengths_aux([[5,4,3,1],[3,3,1]]) [2, 1, 2] sage: row_lengths_aux([[5,4,3,1],[3,1]]) [2, 3]
Class: SkewPartition_class
self, skp) |
TESTS:
sage: skp = SkewPartition([[3,2,1],[2,1]]) sage: skp == loads(dumps(skp)) True
Functions: column_lengths,
columns_intersection_set,
conjugate,
diagram,
ferrers_diagram,
inner,
inner_corners,
is_connected,
is_overlap,
jacobi_trudi,
k_conjugate,
outer,
outer_corners,
overlap,
pieri_macdonald_coeffs,
r_quotient,
row_lengths,
rows_intersection_set,
size,
to_dag,
to_list
self) |
Returns the column lengths of the skew partition.
sage: SkewPartition([[3,2,1],[1,1]]).column_lengths() [1, 2, 1] sage: SkewPartition([[5,2,2,2],[2,1]]).column_lengths() [2, 3, 1, 1, 1]
self) |
Returns the set of boxes in the lines of lambda which intersect the skew partition.
sage: skp = SkewPartition([[3,2,1],[2,1]]) sage: boxes = Set([ (0,0), (0, 1), (0,2), (1, 0), (1, 1), (2, 0)]) sage: skp.columns_intersection_set() == boxes True
self) |
Returns the conjugate of the skew partition skp.
sage: SkewPartition([[3,2,1],[2]]).conjugate() [[3, 2, 1], [1, 1]]
self) |
Return the Ferrers diagram of self.
sage: print SkewPartition([[5,4,3,1],[3,3,1]]).ferrers_diagram() ## # ## # sage: print SkewPartition([[5,4,3,1],[3,1]]).diagram() ## ### ### #
self) |
Return the Ferrers diagram of self.
sage: print SkewPartition([[5,4,3,1],[3,3,1]]).ferrers_diagram() ## # ## # sage: print SkewPartition([[5,4,3,1],[3,1]]).diagram() ## ### ### #
self) |
Returns the inner partition of the skew partition.
sage: SkewPartition([[3,2,1],[1,1]]).inner() [1, 1]
self) |
Returns a list of the inner corners of the skew partition skp.
sage: SkewPartition([[4, 3, 1], [2]]).inner_corners() [[0, 2], [1, 0]]
self) |
Returns True if self is a connected skew partition.
A skew partition is said to be connected if for each pair of consecutive rows, there are at least two boxes (one in each row) which have a common edge.
sage: SkewPartition([[5,4,3,1],[3,3,1]]).is_connected() False sage: SkewPartition([[5,4,3,1],[3,1]]).is_connected() True
self, n) |
Returns True if n <= self.overlap()
SEE ALSO: .overlap()
sage: SkewPartition([[5,4,3,1],[3,1]]).is_overlap(1) True
self) |
sage: SkewPartition([[3,2,1],[2,1]]).jacobi_trudi() [h[1] 0 0] [h[3] h[1] 0] [h[5] h[3] h[1]] sage: SkewPartition([[4,3,2],[2,1]]).jacobi_trudi() [h[2] h[] 0] [h[4] h[2] h[]] [h[6] h[4] h[2]]
self, k) |
Returns the k-conjugate of the skew partition.
sage: SkewPartition([[3,2,1],[2,1]]).k_conjugate(3) [[2, 1, 1, 1, 1], [2, 1]] sage: SkewPartition([[3,2,1],[2,1]]).k_conjugate(4) [[2, 2, 1, 1], [2, 1]] sage: SkewPartition([[3,2,1],[2,1]]).k_conjugate(5) [[3, 2, 1], [2, 1]]
self) |
Returns the outer partition of the skew partition.
sage: SkewPartition([[3,2,1],[1,1]]).outer() [3, 2, 1]
self) |
Returns a list of the outer corners of the skew partition skp.
sage: SkewPartition([[4, 3, 1], [2]]).outer_corners() [[0, 3], [1, 2], [2, 0]]
self) |
Returns the overlap of self.
The overlap of two consecutive rows in a skew partition is the number of pairs of boxes (one in each row) that share a common edge. This number can be positive, zero, or negative.
The overlap of a skew partition is the minimum of the overlap of the consecutive rows, or infinity in the case of at most one row. If the overlap is positive, then the skew partition is called connected.
sage: SkewPartition([[],[]]).overlap() +Infinity sage: SkewPartition([[1],[]]).overlap() +Infinity sage: SkewPartition([[10],[]]).overlap() +Infinity sage: SkewPartition([[10],[2]]).overlap() +Infinity sage: SkewPartition([[10,1],[2]]).overlap() -1 sage: SkewPartition([[10,10],[1]]).overlap() 9
self) |
Computation of the coefficients which appear in the Pieri formula for Macdonald polynomails given in his book ( Chapter 6.6 formula 6.24(ii) )
sage: SkewPartition([[3,2,1],[2,1]]).pieri_macdonald_coeffs() 1 sage: SkewPartition([[3,2,1],[2,2]]).pieri_macdonald_coeffs() (q^2*t^3 - q^2*t - t^2 + 1)/(q^2*t^3 - q*t^2 - q*t + 1) sage: SkewPartition([[3,2,1],[2,2,1]]).pieri_macdonald_coeffs() (q^6*t^8 - q^6*t^6 - q^4*t^7 - q^5*t^5 + q^4*t^5 - q^3*t^6 + q^5*t^3 + 2*q^3*t^4 + q*t^5 - q^3*t^2 + q^2*t^3 - q*t^3 - q^2*t - t^2 + 1)/(q^6*t^8 - q^5*t^7 - q^5*t^6 - q^4*t^6 + q^3*t^5 + 2*q^3*t^4 + q^3*t^3 - q^2*t^2 - q*t^2 - q*t + 1) sage: SkewPartition([[3,3,2,2],[3,2,2,1]]).pieri_macdonald_coeffs() (q^5*t^6 - q^5*t^5 + q^4*t^6 - q^4*t^5 - q^4*t^3 + q^4*t^2 - q^3*t^3 - q^2*t^4 + q^3*t^2 + q^2*t^3 - q*t^4 + q*t^3 + q*t - q + t - 1)/(q^5*t^6 - q^4*t^5 - q^3*t^4 - q^3*t^3 + q^2*t^3 + q^2*t^2 + q*t - 1)
self, k) |
The quotient map extended to skew partitions.
sage: SkewPartition([[3, 3, 2, 1], [2, 1]]).r_quotient(2) [[[3], []], [[], []]]
self) |
Returns the row lengths of the skew partition.
sage: SkewPartition([[3,2,1],[1,1]]).row_lengths() [2, 1, 1]
self) |
Returns the set of boxes in the lines of lambda which intersect the skew partition.
sage: skp = SkewPartition([[3,2,1],[2,1]]) sage: boxes = Set([ (0,0), (0, 1), (0,2), (1, 0), (1, 1), (2, 0)]) sage: skp.rows_intersection_set() == boxes True
self) |
Returns the size of the skew partition.
sage: SkewPartition([[3,2,1],[1,1]]).size() 4
self) |
Returns a directed acyclic graph corresponding to the skew partition.
sage: dag = SkewPartition([[3, 2, 1], [1, 1]]).to_dag() sage: dag.edges() [('0,1', '0,2', None), ('0,1', '1,1', None)] sage: dag.vertices() ['0,1', '0,2', '1,1', '2,0']
self) |
Returns self as a list of lists.
sage: s = SkewPartition([[4,3,1],[2]]) sage: s.to_list() [[4, 3, 1], [2]] sage: type(s.to_list()) <type 'list'>
Special Functions: __init__
Class: SkewPartitions_all
self) |
TESTS:
sage: S = SkewPartitions() sage: S == loads(dumps(S)) True
Functions: list
self) |
TESTS:
sage: SkewPartitions().list() Traceback (most recent call last): ... NotImplementedError
Special Functions: __contains__,
__init__,
__repr__
self, x) |
TESTS:
sage: [[], []] in SkewPartitions() True sage: [[], [1]] in SkewPartitions() False sage: [[], [-1]] in SkewPartitions() False sage: [[], [0]] in SkewPartitions() False sage: [[3,2,1],[]] in SkewPartitions() True sage: [[3,2,1],[1]] in SkewPartitions() True sage: [[3,2,1],[2]] in SkewPartitions() True sage: [[3,2,1],[3]] in SkewPartitions() True sage: [[3,2,1],[4]] in SkewPartitions() False sage: [[3,2,1],[1,1]] in SkewPartitions() True sage: [[3,2,1],[1,2]] in SkewPartitions() False sage: [[3,2,1],[2,1]] in SkewPartitions() True sage: [[3,2,1],[2,2]] in SkewPartitions() True sage: [[3,2,1],[3,2]] in SkewPartitions() True sage: [[3,2,1],[1,1,1]] in SkewPartitions() True sage: [[7, 4, 3, 2], [8, 2, 1]] in SkewPartitions() False sage: [[7, 4, 3, 2], [5, 2, 1]] in SkewPartitions() True sage: [[4,2,1],[1,1,1,1]] in SkewPartitions() False
self) |
TESTS:
sage: repr(SkewPartitions()) 'Skew partitions'
Class: SkewPartitions_n
self, n, [overlap=0]) |
TESTS:
sage: S = SkewPartitions(3) sage: S == loads(dumps(S)) True sage: S = SkewPartitions(3, overlap=1) sage: S == loads(dumps(S)) True
Functions: count,
list
self) |
Returns the number of skew partitions of the integer n.
sage: SkewPartitions(0).count() 1 sage: SkewPartitions(4).count() 28 sage: SkewPartitions(5).count() 87 sage: SkewPartitions(4, overlap=1).count() 9 sage: SkewPartitions(5, overlap=1).count() 20 sage: s = SkewPartitions(5, overlap=-1) sage: s.count() == len(s.list()) True
self) |
Returns a list of the skew partitions of n.
sage: SkewPartitions(3).list() [[[1, 1, 1], []], [[2, 2, 1], [1, 1]], [[2, 1, 1], [1]], [[3, 2, 1], [2, 1]], [[2, 2], [1]], [[3, 2], [2]], [[2, 1], []], [[3, 1], [1]], [[3], []]] sage: SkewPartitions(3, overlap=0).list() [[[1, 1, 1], []], [[2, 2, 1], [1, 1]], [[2, 1, 1], [1]], [[3, 2, 1], [2, 1]], [[2, 2], [1]], [[3, 2], [2]], [[2, 1], []], [[3, 1], [1]], [[3], []]] sage: SkewPartitions(3, overlap=1).list() [[[1, 1, 1], []], [[2, 2], [1]], [[2, 1], []], [[3], []]] sage: SkewPartitions(3, overlap=2).list() [[[3], []]] sage: SkewPartitions(3, overlap=3).list() [[[3], []]] sage: SkewPartitions(3, overlap=4).list() []
Special Functions: __contains__,
__init__,
__repr__,
_count_slide
self, x) |
TESTS:
sage: [[],[]] in SkewPartitions(0) True sage: [[3,2,1], []] in SkewPartitions(6) True sage: [[3,2,1], []] in SkewPartitions(7) False sage: [[3,2,1], []] in SkewPartitions(5) False sage: [[7, 4, 3, 2], [8, 2, 1]] in SkewPartitions(8) False sage: [[7, 4, 3, 2], [5, 2, 1]] in SkewPartitions(8) False sage: [[7, 4, 3, 2], [5, 2, 1]] in SkewPartitions(5) False sage: [[7, 4, 3, 2], [5, 2, 1]] in SkewPartitions(5, overlap=-1) False sage: [[7, 4, 3, 2], [5, 2, 1]] in SkewPartitions(8, overlap=-1) True sage: [[7, 4, 3, 2], [5, 2, 1]] in SkewPartitions(8, overlap=0) False sage: [[7, 4, 3, 2], [5, 2, 1]] in SkewPartitions(8, overlap='connected') False sage: [[7, 4, 3, 2], [5, 2, 1]] in SkewPartitions(8, overlap=-2) True
self) |
TESTS:
sage: repr(SkewPartitions(3)) 'Skew partitions of 3' sage: repr(SkewPartitions(3, overlap=1)) 'Skew partitions of 3 with overlap of 1'
self, co, [overlap=0]) |
Returns the number of skew partitions related to the composition co by 'sliding'. The composition co is the list of row lengths of the skew partition.
sage: s = SkewPartitions(3) sage: s._count_slide([2,1]) 2 sage: [ sp for sp in s if sp.row_lengths() == [2,1] ] [[[2, 1], []], [[3, 1], [1]]] sage: s = SkewPartitions(3, overlap=1) sage: s._count_slide([2,1], overlap=1) 1 sage: [ sp for sp in s if sp.row_lengths() == [2,1] ] [[[2, 1], []]]
Class: SkewPartitions_rowlengths
self, co, [overlap=0]) |
TESTS:
sage: S = SkewPartitions(row_lengths=[2,1]) sage: S == loads(dumps(S)) True
Functions: list
self) |
Returns a list of all the skew partitions that have row lengths given by the composition self.co.
sage: SkewPartitions(row_lengths=[2,2]).list() [[[2, 2], []], [[3, 2], [1]], [[4, 2], [2]]] sage: SkewPartitions(row_lengths=[2,2], overlap=1).list() [[[2, 2], []], [[3, 2], [1]]]
Special Functions: __contains__,
__init__,
__repr__,
_from_row_lengths_aux
self, x) |
sage: [[4,3,1],[2]] in SkewPartitions(row_lengths=[2,3,1]) True sage: [[4,3,1],[2]] in SkewPartitions(row_lengths=[2,1,3]) False sage: [[5,4,3,1],[3,3,1]] in SkewPartitions(row_lengths=[2,1,1,2]) False sage: [[5,4,3,1],[3,3,1]] in SkewPartitions(row_lengths=[2,1,2,1]) True
self) |
TESTS:
sage: repr(SkewPartitions(row_lengths=[2,1])) 'Skew partitions with row lengths [2, 1]'
self, sskp, ck_1, ck, [overlap=0]) |
sage: s = SkewPartitions(row_lengths=[2,1]) sage: s._from_row_lengths_aux([[1], []], 1, 1, overlap=0) [[[1, 1], []], [[2, 1], [1]]] sage: s._from_row_lengths_aux([[1, 1], []], 1, 1, overlap=0) [[[1, 1, 1], []], [[2, 2, 1], [1, 1]]] sage: s._from_row_lengths_aux([[2, 1], [1]], 1, 1, overlap=0) [[[2, 1, 1], [1]], [[3, 2, 1], [2, 1]]] sage: s._from_row_lengths_aux([[1], []], 1, 2, overlap=0) [[[2, 2], [1]], [[3, 2], [2]]] sage: s._from_row_lengths_aux([[2], []], 2, 1, overlap=0) [[[2, 1], []], [[3, 1], [1]]]