Plane partitions - Combinatorics

Skip to content
Back to top
View this page
Edit this page

# Plane partitions

AUTHORS:

- Jang Soo Kim (2016): initial implementation

- Jessica Striker (2016): added additional methods

- Kevin Dilks (2021): added symmetry classes

class sage.combinat.plane_partition.PlanePartition(parent, pp, check=True)

  Bases: `ClonableArray`

  A plane partition.

  A plane partition is a stack of cubes in the positive orthant.

  INPUT:

  - `PP` – list of lists which represents a tableau

  - `box_size` – (optional) a list `[A, B, C]` of 3 positive integers, where `A`, `B`, `C` are the lengths of the box in the \(x\)-axis, \(y\)-axis, \(z\)-axis, respectively; if this is not given, it is determined by the smallest box bounding `PP`

  OUTPUT: the plane partition whose tableau representation is `PP`

  EXAMPLES:

  Sage

      sage: PP = PlanePartition([[4,3,3,1],[2,1,1],[1,1]])
      sage: PP
      Plane partition [[4, 3, 3, 1], [2, 1, 1], [1, 1]]

  Python

      >>> from sage.all import *
      >>> PP = PlanePartition([[Integer(4),Integer(3),Integer(3),Integer(1)],[Integer(2),Integer(1),Integer(1)],[Integer(1),Integer(1)]])
      >>> PP
      Plane partition [[4, 3, 3, 1], [2, 1, 1], [1, 1]]

  bounding_box()

    Return the smallest box \((a, b, c)\) that `self` is contained in.

    EXAMPLES:

    Sage

        sage: PP = PlanePartition([[5,2,1,1], [2,2], [2]])
        sage: PP.bounding_box()
        (3, 4, 5)

    Python

        >>> from sage.all import *
        >>> PP = PlanePartition([[Integer(5),Integer(2),Integer(1),Integer(1)], [Integer(2),Integer(2)], [Integer(2)]])
        >>> PP.bounding_box()
        (3, 4, 5)

  cells()

    Return the list of cells inside `self`.

    Each cell is a tuple.

    EXAMPLES:

    Sage

        sage: PP = PlanePartition([[3,1],[2]])
        sage: PP.cells()
        [(0, 0, 0), (0, 0, 1), (0, 0, 2), (0, 1, 0), (1, 0, 0), (1, 0, 1)]

    Python

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

  check()

    Check to see that `self` is a valid plane partition.

    EXAMPLES:

    Sage

        sage: a = PlanePartition([[4,3,3,1],[2,1,1],[1,1]])
        sage: a.check()
        sage: b = PlanePartition([[1,2],[1]])
        Traceback (most recent call last):
        ...
        ValueError: not weakly decreasing along rows
        sage: c = PlanePartition([[1,1],[2]])
        Traceback (most recent call last):
        ...
        ValueError: not weakly decreasing along columns
        sage: d = PlanePartition([[2,-1],[-2]])
        Traceback (most recent call last):
        ...
        ValueError: entries not all nonnegative
        sage: e = PlanePartition([[3/2,1],[.5]])
        Traceback (most recent call last):
        ...
        ValueError: entries not all integers

    Python

        >>> from sage.all import *
        >>> a = PlanePartition([[Integer(4),Integer(3),Integer(3),Integer(1)],[Integer(2),Integer(1),Integer(1)],[Integer(1),Integer(1)]])
        >>> a.check()
        >>> b = PlanePartition([[Integer(1),Integer(2)],[Integer(1)]])
        Traceback (most recent call last):
        ...
        ValueError: not weakly decreasing along rows
        >>> c = PlanePartition([[Integer(1),Integer(1)],[Integer(2)]])
        Traceback (most recent call last):
        ...
        ValueError: not weakly decreasing along columns
        >>> d = PlanePartition([[Integer(2),-Integer(1)],[-Integer(2)]])
        Traceback (most recent call last):
        ...
        ValueError: entries not all nonnegative
        >>> e = PlanePartition([[Integer(3)/Integer(2),Integer(1)],[RealNumber('.5')]])
        Traceback (most recent call last):
        ...
        ValueError: entries not all integers

  complement(tableau_only=False)

    Return the complement of `self`.

    If the parent of `self` consists only of partitions inside a given box, then the complement is taken in this box. Otherwise, the complement is taken in the smallest box containing the plane partition. The empty plane partition with no box specified is its own complement.

    If `tableau_only` is set to `True`, then only the tableau consisting of the projection of boxes size onto the \(xy\)-plane is returned instead of a `PlanePartition`. This output will not have empty trailing rows or trailing zeros removed.

    EXAMPLES:

    Sage

        sage: PP = PlanePartition([[4,3,3,1],[2,1,1],[1,1]])
        sage: PP.complement()
        Plane partition [[4, 4, 3, 3], [4, 3, 3, 2], [3, 1, 1]]
        sage: PP.complement(True)
        [[4, 4, 3, 3], [4, 3, 3, 2], [3, 1, 1, 0]]

    Python

        >>> from sage.all import *
        >>> PP = PlanePartition([[Integer(4),Integer(3),Integer(3),Integer(1)],[Integer(2),Integer(1),Integer(1)],[Integer(1),Integer(1)]])
        >>> PP.complement()
        Plane partition [[4, 4, 3, 3], [4, 3, 3, 2], [3, 1, 1]]
        >>> PP.complement(True)
        [[4, 4, 3, 3], [4, 3, 3, 2], [3, 1, 1, 0]]

  contains(PP)

    Return `True` if `PP` is a plane partition that fits inside `self`.

    Specifically, `self` contains `PP` if, for all \(i\), \(j\), the height of `PP` at \(ij\) is less than or equal to the height of `self` at \(ij\).

    EXAMPLES:

    Sage

        sage: P1 = PlanePartition([[5,4,3], [3,2,2], [1]])
        sage: P2 = PlanePartition([[3,2], [1,1], [0,0], [0,0]])
        sage: P3 = PlanePartition([[5,5,5], [2,1,0]])
        sage: P1.contains(P2)
        True
        sage: P2.contains(P1)
        False
        sage: P1.contains(P3)
        False
        sage: P3.contains(P2)
        True

    Python

        >>> from sage.all import *
        >>> P1 = PlanePartition([[Integer(5),Integer(4),Integer(3)], [Integer(3),Integer(2),Integer(2)], [Integer(1)]])
        >>> P2 = PlanePartition([[Integer(3),Integer(2)], [Integer(1),Integer(1)], [Integer(0),Integer(0)], [Integer(0),Integer(0)]])
        >>> P3 = PlanePartition([[Integer(5),Integer(5),Integer(5)], [Integer(2),Integer(1),Integer(0)]])
        >>> P1.contains(P2)
        True
        >>> P2.contains(P1)
        False
        >>> P1.contains(P3)
        False
        >>> P3.contains(P2)
        True

  cyclically_rotate(preserve_parent=False)

    Return the cyclic rotation of `self`.

    By default, if the parent of `self` consists of plane partitions inside an \(a \times b \times c\) box, the result will have a parent consisting of partitions inside a \(c \times a \times b\) box, unless the optional parameter `preserve_parent` is set to `True`. Enabling this setting may give an element that is not an element of its parent.

    EXAMPLES:

    Sage

        sage: PlanePartition([[3,2,1],[2,2],[2]]).cyclically_rotate()
        Plane partition [[3, 3, 1], [2, 2], [1]]
        sage: PP = PlanePartition([[4,1],[1],[1]])
        sage: PP.cyclically_rotate()
        Plane partition [[3, 1, 1, 1], [1]]
        sage: PP == PP.cyclically_rotate().cyclically_rotate().cyclically_rotate()
        True

        sage: # needs sage.graphs sage.modules
        sage: PP = PlanePartitions([4,3,2]).random_element()
        sage: PP.cyclically_rotate().parent()
        Plane partitions inside a 2 x 4 x 3 box
        sage: PP = PlanePartitions([3,4,2])([[2,2,2,2],[2,2,2,2],[2,2,2,2]])
        sage: PP_rotated = PP.cyclically_rotate(preserve_parent=True)
        sage: PP_rotated in PP_rotated.parent()
        False

    Python

        >>> from sage.all import *
        >>> PlanePartition([[Integer(3),Integer(2),Integer(1)],[Integer(2),Integer(2)],[Integer(2)]]).cyclically_rotate()
        Plane partition [[3, 3, 1], [2, 2], [1]]
        >>> PP = PlanePartition([[Integer(4),Integer(1)],[Integer(1)],[Integer(1)]])
        >>> PP.cyclically_rotate()
        Plane partition [[3, 1, 1, 1], [1]]
        >>> PP == PP.cyclically_rotate().cyclically_rotate().cyclically_rotate()
        True

        >>> # needs sage.graphs sage.modules
        >>> PP = PlanePartitions([Integer(4),Integer(3),Integer(2)]).random_element()
        >>> PP.cyclically_rotate().parent()
        Plane partitions inside a 2 x 4 x 3 box
        >>> PP = PlanePartitions([Integer(3),Integer(4),Integer(2)])([[Integer(2),Integer(2),Integer(2),Integer(2)],[Integer(2),Integer(2),Integer(2),Integer(2)],[Integer(2),Integer(2),Integer(2),Integer(2)]])
        >>> PP_rotated = PP.cyclically_rotate(preserve_parent=True)
        >>> PP_rotated in PP_rotated.parent()
        False

  is_CSPP()

    Return whether `self` is a cyclically symmetric plane partition.

    A plane partition is cyclically symmetric if its \(x\), \(y\), and \(z\) tableaux are all equal.

    EXAMPLES:

    Sage

        sage: PP = PlanePartition([[4,3,3,1],[2,1,1],[1,1]])
        sage: PP.is_CSPP()
        False
        sage: PP = PlanePartition([[3,2,2],[3,1,0],[1,1,0]])
        sage: PP.is_CSPP()
        True

    Python

        >>> from sage.all import *
        >>> PP = PlanePartition([[Integer(4),Integer(3),Integer(3),Integer(1)],[Integer(2),Integer(1),Integer(1)],[Integer(1),Integer(1)]])
        >>> PP.is_CSPP()
        False
        >>> PP = PlanePartition([[Integer(3),Integer(2),Integer(2)],[Integer(3),Integer(1),Integer(0)],[Integer(1),Integer(1),Integer(0)]])
        >>> PP.is_CSPP()
        True

  is_CSSCPP()

    Return whether `self` is a cyclically symmetric and self-complementary plane partition.

    EXAMPLES:

    Sage

        sage: PP = PlanePartition([[4,3,3,1],[2,1,1],[1,1]])
        sage: PP.is_CSSCPP()
        False
        sage: PP = PlanePartition([[4,4,4,1],[3,3,2,1],[3,2,1,1],[3,0,0,0]])
        sage: PP.is_CSSCPP()
        True

    Python

        >>> from sage.all import *
        >>> PP = PlanePartition([[Integer(4),Integer(3),Integer(3),Integer(1)],[Integer(2),Integer(1),Integer(1)],[Integer(1),Integer(1)]])
        >>> PP.is_CSSCPP()
        False
        >>> PP = PlanePartition([[Integer(4),Integer(4),Integer(4),Integer(1)],[Integer(3),Integer(3),Integer(2),Integer(1)],[Integer(3),Integer(2),Integer(1),Integer(1)],[Integer(3),Integer(0),Integer(0),Integer(0)]])
        >>> PP.is_CSSCPP()
        True

  is_CSTCPP()

    Return whether `self` is a cyclically symmetric and transpose-complementary plane partition.

    EXAMPLES:

    Sage

        sage: PP = PlanePartition([[4,3,3,1],[2,1,1],[1,1]])
        sage: PP.is_CSTCPP()
        False
        sage: PP = PlanePartition([[4,4,3,2],[4,3,2,1],[3,2,1,0],[2,1,0,0]])
        sage: PP.is_CSTCPP()
        True

    Python

        >>> from sage.all import *
        >>> PP = PlanePartition([[Integer(4),Integer(3),Integer(3),Integer(1)],[Integer(2),Integer(1),Integer(1)],[Integer(1),Integer(1)]])
        >>> PP.is_CSTCPP()
        False
        >>> PP = PlanePartition([[Integer(4),Integer(4),Integer(3),Integer(2)],[Integer(4),Integer(3),Integer(2),Integer(1)],[Integer(3),Integer(2),Integer(1),Integer(0)],[Integer(2),Integer(1),Integer(0),Integer(0)]])
        >>> PP.is_CSTCPP()
        True

  is_SCPP()

    Return whether `self` is a self-complementary plane partition.

    Note that the complement of a plane partition (and thus the property of being self-complementary) is dependent on the choice of a box that it is contained in. If no parent/bounding box is specified, the box is taken to be the smallest box that contains the plane partition.

    EXAMPLES:

    Sage

        sage: PP = PlanePartition([[4,3,3,1],[2,1,1],[1,1]])
        sage: PP.is_SCPP()
        False
        sage: PP = PlanePartition([[4,4,4,4],[4,4,2,0],[4,2,0,0],[0,0,0,0]])
        sage: PP.is_SCPP()
        False
        sage: PP = PlanePartitions([4,4,4])([[4,4,4,4],[4,4,2,0],[4,2,0,0],[0,0,0,0]])
        sage: PP.is_SCPP()
        True

    Python

        >>> from sage.all import *
        >>> PP = PlanePartition([[Integer(4),Integer(3),Integer(3),Integer(1)],[Integer(2),Integer(1),Integer(1)],[Integer(1),Integer(1)]])
        >>> PP.is_SCPP()
        False
        >>> PP = PlanePartition([[Integer(4),Integer(4),Integer(4),Integer(4)],[Integer(4),Integer(4),Integer(2),Integer(0)],[Integer(4),Integer(2),Integer(0),Integer(0)],[Integer(0),Integer(0),Integer(0),Integer(0)]])
        >>> PP.is_SCPP()
        False
        >>> PP = PlanePartitions([Integer(4),Integer(4),Integer(4)])([[Integer(4),Integer(4),Integer(4),Integer(4)],[Integer(4),Integer(4),Integer(2),Integer(0)],[Integer(4),Integer(2),Integer(0),Integer(0)],[Integer(0),Integer(0),Integer(0),Integer(0)]])
        >>> PP.is_SCPP()
        True

  is_SPP()

    Return whether `self` is a symmetric plane partition.

    A plane partition is symmetric if the corresponding tableau is symmetric about the diagonal.

    EXAMPLES:

    Sage

        sage: PP = PlanePartition([[4,3,3,1],[2,1,1],[1,1]])
        sage: PP.is_SPP()
        False
        sage: PP = PlanePartition([[3,3,2],[3,3,2],[2,2,2]])
        sage: PP.is_SPP()
        True
        sage: PP = PlanePartition([[3,2,1],[2,0,0]])
        sage: PP.is_SPP()
        False
        sage: PP = PlanePartition([[3,2,0],[2,0,0]])
        sage: PP.is_SPP()
        True
        sage: PP = PlanePartition([[3,2],[2,0],[1,0]])
        sage: PP.is_SPP()
        False
        sage: PP = PlanePartition([[3,2],[2,0],[0,0]])
        sage: PP.is_SPP()
        True

    Python

        >>> from sage.all import *
        >>> PP = PlanePartition([[Integer(4),Integer(3),Integer(3),Integer(1)],[Integer(2),Integer(1),Integer(1)],[Integer(1),Integer(1)]])
        >>> PP.is_SPP()
        False
        >>> PP = PlanePartition([[Integer(3),Integer(3),Integer(2)],[Integer(3),Integer(3),Integer(2)],[Integer(2),Integer(2),Integer(2)]])
        >>> PP.is_SPP()
        True
        >>> PP = PlanePartition([[Integer(3),Integer(2),Integer(1)],[Integer(2),Integer(0),Integer(0)]])
        >>> PP.is_SPP()
        False
        >>> PP = PlanePartition([[Integer(3),Integer(2),Integer(0)],[Integer(2),Integer(0),Integer(0)]])
        >>> PP.is_SPP()
        True
        >>> PP = PlanePartition([[Integer(3),Integer(2)],[Integer(2),Integer(0)],[Integer(1),Integer(0)]])
        >>> PP.is_SPP()
        False
        >>> PP = PlanePartition([[Integer(3),Integer(2)],[Integer(2),Integer(0)],[Integer(0),Integer(0)]])
        >>> PP.is_SPP()
        True

  is_SSCPP()

    Return whether `self` is a symmetric, self-complementary plane partition.

    EXAMPLES:

    Sage

        sage: PP = PlanePartition([[4,3,3,1],[2,1,1],[1,1]])
        sage: PP.is_SSCPP()
        False
        sage: PP = PlanePartition([[4,3,3,2],[3,2,2,1],[3,2,2,1],[2,1,1,0]])
        sage: PP.is_SSCPP()
        True
        sage: PP = PlanePartition([[2,1],[1,0]])
        sage: PP.is_SSCPP()
        True
        sage: PP = PlanePartition([[4,3,2],[3,2,1],[2,1,0]])
        sage: PP.is_SSCPP()
        True
        sage: PP = PlanePartition([[4,2,2,2],[2,2,2,2],[2,2,2,2],[2,2,2,0]])
        sage: PP.is_SSCPP()
        True

    Python

        >>> from sage.all import *
        >>> PP = PlanePartition([[Integer(4),Integer(3),Integer(3),Integer(1)],[Integer(2),Integer(1),Integer(1)],[Integer(1),Integer(1)]])
        >>> PP.is_SSCPP()
        False
        >>> PP = PlanePartition([[Integer(4),Integer(3),Integer(3),Integer(2)],[Integer(3),Integer(2),Integer(2),Integer(1)],[Integer(3),Integer(2),Integer(2),Integer(1)],[Integer(2),Integer(1),Integer(1),Integer(0)]])
        >>> PP.is_SSCPP()
        True
        >>> PP = PlanePartition([[Integer(2),Integer(1)],[Integer(1),Integer(0)]])
        >>> PP.is_SSCPP()
        True
        >>> PP = PlanePartition([[Integer(4),Integer(3),Integer(2)],[Integer(3),Integer(2),Integer(1)],[Integer(2),Integer(1),Integer(0)]])
        >>> PP.is_SSCPP()
        True
        >>> PP = PlanePartition([[Integer(4),Integer(2),Integer(2),Integer(2)],[Integer(2),Integer(2),Integer(2),Integer(2)],[Integer(2),Integer(2),Integer(2),Integer(2)],[Integer(2),Integer(2),Integer(2),Integer(0)]])
        >>> PP.is_SSCPP()
        True

  is_TCPP()

    Return whether `self` is a transpose-complementary plane partition.

    EXAMPLES:

    Sage

        sage: PP = PlanePartition([[4,3,3,1],[2,1,1],[1,1]])
        sage: PP.is_TCPP()
        False
        sage: PP = PlanePartition([[4,4,3,2],[4,4,2,1],[4,2,0,0],[2,0,0,0]])
        sage: PP.is_TCPP()
        True

    Python

        >>> from sage.all import *
        >>> PP = PlanePartition([[Integer(4),Integer(3),Integer(3),Integer(1)],[Integer(2),Integer(1),Integer(1)],[Integer(1),Integer(1)]])
        >>> PP.is_TCPP()
        False
        >>> PP = PlanePartition([[Integer(4),Integer(4),Integer(3),Integer(2)],[Integer(4),Integer(4),Integer(2),Integer(1)],[Integer(4),Integer(2),Integer(0),Integer(0)],[Integer(2),Integer(0),Integer(0),Integer(0)]])
        >>> PP.is_TCPP()
        True

  is_TSPP()

    Return whether `self` is a totally symmetric plane partition.

    A plane partition is totally symmetric if it is both symmetric and cyclically symmetric.

    EXAMPLES:

    Sage

        sage: PP = PlanePartition([[4,3,3,1],[2,1,1],[1,1]])
        sage: PP.is_TSPP()
        False
        sage: PP = PlanePartition([[3,3,3],[3,3,2],[3,2,1]])
        sage: PP.is_TSPP()
        True

    Python

        >>> from sage.all import *
        >>> PP = PlanePartition([[Integer(4),Integer(3),Integer(3),Integer(1)],[Integer(2),Integer(1),Integer(1)],[Integer(1),Integer(1)]])
        >>> PP.is_TSPP()
        False
        >>> PP = PlanePartition([[Integer(3),Integer(3),Integer(3)],[Integer(3),Integer(3),Integer(2)],[Integer(3),Integer(2),Integer(1)]])
        >>> PP.is_TSPP()
        True

  is_TSSCPP()

    Return whether `self` is a totally symmetric self-complementary plane partition.

    EXAMPLES:

    Sage

        sage: PP = PlanePartition([[4,3,3,1],[2,1,1],[1,1]])
        sage: PP.is_TSSCPP()
        False
        sage: PP = PlanePartition([[4,4,3,2],[4,3,2,1],[3,2,1,0],[2,1,0,0]])
        sage: PP.is_TSSCPP()
        True

    Python

        >>> from sage.all import *
        >>> PP = PlanePartition([[Integer(4),Integer(3),Integer(3),Integer(1)],[Integer(2),Integer(1),Integer(1)],[Integer(1),Integer(1)]])
        >>> PP.is_TSSCPP()
        False
        >>> PP = PlanePartition([[Integer(4),Integer(4),Integer(3),Integer(2)],[Integer(4),Integer(3),Integer(2),Integer(1)],[Integer(3),Integer(2),Integer(1),Integer(0)],[Integer(2),Integer(1),Integer(0),Integer(0)]])
        >>> PP.is_TSSCPP()
        True

  maximal_boxes()

    Return the coordinates of the maximal boxes of `self`.

    The maximal boxes of a plane partitions are the boxes that can be removed from a plane partition and still yield a valid plane partition.

    EXAMPLES:

    Sage

        sage: sorted(PlanePartition([[3,2,1],[2,2],[2]]).maximal_boxes())
        [[0, 0, 2], [0, 2, 0], [1, 1, 1], [2, 0, 1]]
        sage: sorted(PlanePartition([[2,1],[1],[1]]).maximal_boxes())
        [[0, 0, 1], [0, 1, 0], [2, 0, 0]]

    Python

        >>> from sage.all import *
        >>> sorted(PlanePartition([[Integer(3),Integer(2),Integer(1)],[Integer(2),Integer(2)],[Integer(2)]]).maximal_boxes())
        [[0, 0, 2], [0, 2, 0], [1, 1, 1], [2, 0, 1]]
        >>> sorted(PlanePartition([[Integer(2),Integer(1)],[Integer(1)],[Integer(1)]]).maximal_boxes())
        [[0, 0, 1], [0, 1, 0], [2, 0, 0]]

  number_of_boxes()

    Return the number of boxes in the plane partition.

    EXAMPLES:

    Sage

        sage: PP = PlanePartition([[3,1],[2]])
        sage: PP.number_of_boxes()
        6

    Python

        >>> from sage.all import *
        >>> PP = PlanePartition([[Integer(3),Integer(1)],[Integer(2)]])
        >>> PP.number_of_boxes()
        6

  plot(show_box=False, colors=None)

    Return a plot of `self`.

    INPUT:

    - `show_box` – boolean (default: `False`); if `True`, also shows the visible tiles on the \(xy\)-, \(yz\)-, \(zx\)-planes

    - `colors` – (default: `["white", "lightgray", "darkgray"]`) list `[A, B, C]` of 3 strings representing colors

    EXAMPLES:

    Sage

        sage: PP = PlanePartition([[4,3,3,1],[2,1,1],[1,1]])
        sage: PP.plot()                                                             # needs sage.plot
        Graphics object consisting of 27 graphics primitives

    Python

        >>> from sage.all import *
        >>> PP = PlanePartition([[Integer(4),Integer(3),Integer(3),Integer(1)],[Integer(2),Integer(1),Integer(1)],[Integer(1),Integer(1)]])
        >>> PP.plot()                                                             # needs sage.plot
        Graphics object consisting of 27 graphics primitives

  plot3d(colors=None)

    Return a 3D-plot of `self`.

    INPUT:

    - `colors` – (default: `["white", "lightgray", "darkgray"]`) list `[A, B, C]` of 3 strings representing colors

    EXAMPLES:

    Sage

        sage: PP = PlanePartition([[4,3,3,1],[2,1,1],[1,1]])
        sage: PP.plot3d()                                                           # needs sage.plot
        Graphics3d Object

    Python

        >>> from sage.all import *
        >>> PP = PlanePartition([[Integer(4),Integer(3),Integer(3),Integer(1)],[Integer(2),Integer(1),Integer(1)],[Integer(1),Integer(1)]])
        >>> PP.plot3d()                                                           # needs sage.plot
        Graphics3d Object

  pp(show_box=False)

    Return a pretty print of the plane partition.

    INPUT:

    - `show_box` – boolean (default: `False`); if `True`, also shows the visible tiles on the \(xy\)-, \(yz\)-, \(zx\)-planes

    OUTPUT: a pretty print of the plane partition

    EXAMPLES:

    Sage

        sage: PlanePartition([[4,3,3,1],[2,1,1],[1,1]]).pp()
                __
               /\_\
            __/\/_/
         __/\_\/\_\
        /\_\/_/\/\_\
        \/\_\_\/\/_/
         \/_/\_\/_/
            \/_/\_\
               \/_/
        sage: PlanePartition([[4,3,3,1],[2,1,1],[1,1]]).pp(True)
            ______
           /_/_/\_\
          /_/_/\/_/\
         /_/\_\/\_\/\
        /\_\/_/\/\_\/\
        \/\_\_\/\/_/\/
         \/_/\_\/_/\/
          \_\/_/\_\/
           \_\_\/_/

    Python

        >>> from sage.all import *
        >>> PlanePartition([[Integer(4),Integer(3),Integer(3),Integer(1)],[Integer(2),Integer(1),Integer(1)],[Integer(1),Integer(1)]]).pp()
                __
               /\_\
            __/\/_/
         __/\_\/\_\
        /\_\/_/\/\_\
        \/\_\_\/\/_/
         \/_/\_\/_/
            \/_/\_\
               \/_/
        >>> PlanePartition([[Integer(4),Integer(3),Integer(3),Integer(1)],[Integer(2),Integer(1),Integer(1)],[Integer(1),Integer(1)]]).pp(True)
            ______
           /_/_/\_\
          /_/_/\/_/\
         /_/\_\/\_\/\
        /\_\/_/\/\_\/\
        \/\_\_\/\/_/\/
         \/_/\_\/_/\/
          \_\/_/\_\/
           \_\_\/_/

  to_order_ideal()

    Return the order ideal corresponding to `self`.

    Todo

    As many families of symmetric plane partitions are in bijection with order ideals in an associated poset, this function could feasibly have options to send symmetric plane partitions to the associated order ideal in that poset, instead.

    EXAMPLES:

    Sage

        sage: PlanePartition([[3,2,1],[2,2],[2]]).to_order_ideal()                  # needs sage.graphs sage.modules
        [(0, 0, 0), (0, 0, 1), (0, 0, 2), (0, 1, 0), (0, 1, 1), (0, 2, 0),
         (1, 0, 0), (1, 0, 1), (1, 1, 0), (1, 1, 1), (2, 0, 0), (2, 0, 1)]
        sage: PlanePartition([[2,1],[1],[1]]).to_order_ideal()                      # needs sage.graphs sage.modules
        [(0, 0, 0), (0, 0, 1), (0, 1, 0), (1, 0, 0), (2, 0, 0)]

    Python

        >>> from sage.all import *
        >>> PlanePartition([[Integer(3),Integer(2),Integer(1)],[Integer(2),Integer(2)],[Integer(2)]]).to_order_ideal()                  # needs sage.graphs sage.modules
        [(0, 0, 0), (0, 0, 1), (0, 0, 2), (0, 1, 0), (0, 1, 1), (0, 2, 0),
         (1, 0, 0), (1, 0, 1), (1, 1, 0), (1, 1, 1), (2, 0, 0), (2, 0, 1)]
        >>> PlanePartition([[Integer(2),Integer(1)],[Integer(1)],[Integer(1)]]).to_order_ideal()                      # needs sage.graphs sage.modules
        [(0, 0, 0), (0, 0, 1), (0, 1, 0), (1, 0, 0), (2, 0, 0)]

  to_tableau()

    Return the tableau class of `self`.

    EXAMPLES:

    Sage

        sage: PP = PlanePartition([[4,3,3,1],[2,1,1],[1,1]])
        sage: PP.to_tableau()
        [[4, 3, 3, 1], [2, 1, 1], [1, 1]]

    Python

        >>> from sage.all import *
        >>> PP = PlanePartition([[Integer(4),Integer(3),Integer(3),Integer(1)],[Integer(2),Integer(1),Integer(1)],[Integer(1),Integer(1)]])
        >>> PP.to_tableau()
        [[4, 3, 3, 1], [2, 1, 1], [1, 1]]

  transpose(tableau_only=False)

    Return the transpose of `self`.

    If `tableau_only` is set to `True`, then only the tableau consisting of the projection of boxes size onto the \(xy\)-plane is returned instead of a `PlanePartition`. This will not necessarily have trailing rows or trailing zeros removed.

    EXAMPLES:

    Sage

        sage: PP = PlanePartition([[4,3,3,1],[2,1,1],[1,1]])
        sage: PP.transpose()
        Plane partition [[4, 2, 1], [3, 1, 1], [3, 1], [1]]
        sage: PP.transpose(True)
        [[4, 2, 1], [3, 1, 1], [3, 1, 0], [1, 0, 0]]

        sage: PPP = PlanePartitions([1, 2, 3])
        sage: PP = PPP([[1, 1]])
        sage: PT = PP.transpose(); PT
        Plane partition [[1], [1]]
        sage: PT.parent()
        Plane partitions inside a 2 x 1 x 3 box

    Python

        >>> from sage.all import *
        >>> PP = PlanePartition([[Integer(4),Integer(3),Integer(3),Integer(1)],[Integer(2),Integer(1),Integer(1)],[Integer(1),Integer(1)]])
        >>> PP.transpose()
        Plane partition [[4, 2, 1], [3, 1, 1], [3, 1], [1]]
        >>> PP.transpose(True)
        [[4, 2, 1], [3, 1, 1], [3, 1, 0], [1, 0, 0]]

        >>> PPP = PlanePartitions([Integer(1), Integer(2), Integer(3)])
        >>> PP = PPP([[Integer(1), Integer(1)]])
        >>> PT = PP.transpose(); PT
        Plane partition [[1], [1]]
        >>> PT.parent()
        Plane partitions inside a 2 x 1 x 3 box

  x_tableau(tableau=True)

    Return the projection of `self` in the \(x\) direction.

    If `tableau` is set to `False`, then only the list of lists consisting of the projection of boxes size onto the \(yz\)-plane is returned instead of a `Tableau` object. This output will not have empty trailing rows or trailing zeros removed.

    EXAMPLES:

    Sage

        sage: PP = PlanePartition([[4,3,3,1],[2,1,1],[1,1]])
        sage: PP.x_tableau()
        [[3, 2, 1, 1], [3, 1, 1, 0], [2, 1, 1, 0], [1, 0, 0, 0]]

    Python

        >>> from sage.all import *
        >>> PP = PlanePartition([[Integer(4),Integer(3),Integer(3),Integer(1)],[Integer(2),Integer(1),Integer(1)],[Integer(1),Integer(1)]])
        >>> PP.x_tableau()
        [[3, 2, 1, 1], [3, 1, 1, 0], [2, 1, 1, 0], [1, 0, 0, 0]]

  y_tableau(tableau=True)

    Return the projection of `self` in the \(y\) direction.

    If `tableau` is set to `False`, then only the list of lists consisting of the projection of boxes size onto the \(xz\)-plane is returned instead of a `Tableau` object. This output will not have empty trailing rows or trailing zeros removed.

    EXAMPLES:

    Sage

        sage: PP = PlanePartition([[4,3,3,1],[2,1,1],[1,1]])
        sage: PP.y_tableau()
        [[4, 3, 2], [3, 1, 0], [3, 0, 0], [1, 0, 0]]

    Python

        >>> from sage.all import *
        >>> PP = PlanePartition([[Integer(4),Integer(3),Integer(3),Integer(1)],[Integer(2),Integer(1),Integer(1)],[Integer(1),Integer(1)]])
        >>> PP.y_tableau()
        [[4, 3, 2], [3, 1, 0], [3, 0, 0], [1, 0, 0]]

  z_tableau(tableau=True)

    Return the projection of `self` in the \(z\) direction.

    If `tableau` is set to `False`, then only the list of lists consisting of the projection of boxes size onto the \(xy\)-plane is returned instead of a `Tableau` object. This output will not have empty trailing rows or trailing zeros removed.

    EXAMPLES:

    Sage

        sage: PP = PlanePartition([[4,3,3,1],[2,1,1],[1,1]])
        sage: PP.z_tableau()
        [[4, 3, 3, 1], [2, 1, 1, 0], [1, 1, 0, 0]]

    Python

        >>> from sage.all import *
        >>> PP = PlanePartition([[Integer(4),Integer(3),Integer(3),Integer(1)],[Integer(2),Integer(1),Integer(1)],[Integer(1),Integer(1)]])
        >>> PP.z_tableau()
        [[4, 3, 3, 1], [2, 1, 1, 0], [1, 1, 0, 0]]

class sage.combinat.plane_partition.PlanePartitions(box_size=None, symmetry=None, category=None)

  Bases: `UniqueRepresentation`, `Parent`

  Plane partitions.

  `PlanePartitions()` returns the class of all plane partitions.

  `PlanePartitions(n)` return the class of all plane partitions with precisely \(n\) boxes.

  `PlanePartitions([a, b, c])` returns the class of plane partitions that fit inside an \(a \times b \times c\) box.

  `PlanePartitions([a, b, c])` has the optional keyword `symmetry`, which restricts the plane partitions inside a box of the specified size satisfying certain symmetry conditions.

  - `symmetry='SPP'` gives the class of symmetric plane partitions. which is all plane partitions fixed under reflection across the diagonal. Requires that \(a = b\).

  - `symmetry='CSPP'` gives the class of cyclic plane partitions, which is all plane partitions fixed under cyclic rotation of coordinates. Requires that \(a = b = c\).

  - `symmetry='TSPP'` gives the class of totally symmetric plane partitions, which is all plane partitions fixed under any interchanging of coordinates. Requires that \(a = b = c\).

  - `symmetry='SCPP'` gives the class of self-complementary plane partitions. which is all plane partitions that are equal to their own complement in the specified box. Requires at least one of \(a,b,c\) be even.

  - `symmetry='TCPP'` gives the class of transpose complement plane partitions, which is all plane partitions whose complement in the box of the specified size is equal to their transpose. Requires \(a = b\) and at least one of \(a, b, c\) be even.

  - `symmetry='SSCPP'` gives the class of symmetric self-complementary plane partitions, which is all plane partitions that are both symmetric and self-complementary. Requires \(a = b\) and at least one of \(a, b, c\) be even.

  - `symmetry='CSTCPP'` gives the class of cyclically symmetric transpose complement plane partitions, which is all plane partitions that are both symmetric and equal to the transpose of their complement. Requires \(a = b = c\).

  - `symmetry='CSSCPP'` gives the class of cyclically symmetric self-complementary plane partitions, which is all plane partitions that are both cyclically symmetric and self-complementary. Requires \(a = b = c\) and all \(a, b, c\) be even.

  - `symmetry='TSSCPP'` gives the class of totally symmetric self-complementary plane partitions, which is all plane partitions that are totally symmetric and also self-complementary. Requires \(a = b = c\) and all \(a, b, c\) be even.

  EXAMPLES:

  If no arguments are passed, then the class of all plane partitions is returned:

  Sage

      sage: PlanePartitions()
      Plane partitions
      sage: [[2,1],[1]] in PlanePartitions()
      True

  Python

      >>> from sage.all import *
      >>> PlanePartitions()
      Plane partitions
      >>> [[Integer(2),Integer(1)],[Integer(1)]] in PlanePartitions()
      True

  If an integer \(n\) is passed, then the class of plane partitions of \(n\) is returned:

  Sage

      sage: PlanePartitions(3)
      Plane partitions of size 3
      sage: PlanePartitions(3).list()
      [Plane partition [[3]],
       Plane partition [[2, 1]],
       Plane partition [[1, 1, 1]],
       Plane partition [[2], [1]],
       Plane partition [[1, 1], [1]],
       Plane partition [[1], [1], [1]]]

  [Python]

      >>> from sage.all import *
      >>> PlanePartitions(Integer(3))
      Plane partitions of size 3
      >>> PlanePartitions(Integer(3)).list()
      [Plane partition [[3]],
       Plane partition [[2, 1]],
       Plane partition [[1, 1, 1]],
       Plane partition [[2], [1]],
       Plane partition [[1, 1], [1]],
       Plane partition [[1], [1], [1]]]

  If a three-element tuple or list \([a,b,c]\) is passed, then the class of all plane partitions that fit inside and \(a \times b \times c\) box is returned:

  Sage

      sage: PlanePartitions([2,2,2])
      Plane partitions inside a 2 x 2 x 2 box
      sage: [[2,1],[1]] in PlanePartitions([2,2,2])
      True

  Python

      >>> from sage.all import *
      >>> PlanePartitions([Integer(2),Integer(2),Integer(2)])
      Plane partitions inside a 2 x 2 x 2 box
      >>> [[Integer(2),Integer(1)],[Integer(1)]] in PlanePartitions([Integer(2),Integer(2),Integer(2)])
      True

  If an additional keyword `symmetry` is pass along with a three-element tuple or list \([a, b,c ]\), then the class of all plane partitions that fit inside an \(a \times b \times c\) box with the specified symmetry is returned:

  Sage

      sage: PlanePartitions([2,2,2], symmetry='CSPP')
      Cyclically symmetric plane partitions inside a 2 x 2 x 2 box
      sage: [[2,1],[1]] in PlanePartitions([2,2,2], symmetry='CSPP')
      True

  [Python]

      >>> from sage.all import *
      >>> PlanePartitions([Integer(2),Integer(2),Integer(2)], symmetry='CSPP')
      Cyclically symmetric plane partitions inside a 2 x 2 x 2 box
      >>> [[Integer(2),Integer(1)],[Integer(1)]] in PlanePartitions([Integer(2),Integer(2),Integer(2)], symmetry='CSPP')
      True

  See also

  - `PlanePartition`

  - `PlanePartitions_all`

  - `PlanePartitions_n`

  - `PlanePartitions_box`

  - `PlanePartitions_SPP`

  - `PlanePartitions_CSPP`

  - `PlanePartitions_TSPP`

  - `PlanePartitions_SCPP`

  - `PlanePartitions_TCPP`

  - `PlanePartitions_SSCPP`

  - `PlanePartitions_CSTCPP`

  - `PlanePartitions_CSSCPP`

  - `PlanePartitions_TSSCPP`

  Element

    alias of `PlanePartition`

  box()

    Return the size of the box of the plane partition of `self` is contained in.

    EXAMPLES:

    Sage

        sage: P = PlanePartitions([4,3,5])
        sage: P.box()
        (4, 3, 5)

        sage: PP = PlanePartitions()
        sage: PP.box() is None
        True

    Python

        >>> from sage.all import *
        >>> P = PlanePartitions([Integer(4),Integer(3),Integer(5)])
        >>> P.box()
        (4, 3, 5)

        >>> PP = PlanePartitions()
        >>> PP.box() is None
        True

  symmetry()

    Return the symmetry class of `self`.

    EXAMPLES:

    Sage

        sage: PP = PlanePartitions([3,3,2], symmetry='SPP')
        sage: PP.symmetry()
        'SPP'
        sage: PP = PlanePartitions()
        sage: PP.symmetry() is None
        True

    Python

        >>> from sage.all import *
        >>> PP = PlanePartitions([Integer(3),Integer(3),Integer(2)], symmetry='SPP')
        >>> PP.symmetry()
        'SPP'
        >>> PP = PlanePartitions()
        >>> PP.symmetry() is None
        True

class sage.combinat.plane_partition.PlanePartitions_CSPP(box_size)

  Bases: `PlanePartitions`

  Plane partitions that fit inside a box of a specified size that are cyclically symmetric.

  cardinality()

    Return the cardinality of `self`.

    The number of cyclically symmetric plane partitions inside an \(a \times a \times a\) box is equal to

    \[\left(\prod_{i=1}^{a} \frac{3i - 1}{3i - 2}\right) \left(\prod_{1 \leq i < j \leq a} \frac{i+j+a-1}{2i+j-1}\right).\]

    EXAMPLES:

    Sage

        sage: P = PlanePartitions([4,4,4], symmetry='CSPP')
        sage: P.cardinality()
        132

    Python

        >>> from sage.all import *
        >>> P = PlanePartitions([Integer(4),Integer(4),Integer(4)], symmetry='CSPP')
        >>> P.cardinality()
        132

  from_antichain(acl)

    Return the cyclically symmetric plane partition corresponding to an antichain in the poset given in `to_poset()`.

    EXAMPLES:

    Sage

        sage: PP = PlanePartitions([3,3,3], symmetry='CSPP')
        sage: A = [(0, 2, 2), (1, 1, 1)]
        sage: PP.from_antichain(A)
        Plane partition [[3, 3, 3], [3, 2, 1], [3, 1, 1]]

    Python

        >>> from sage.all import *
        >>> PP = PlanePartitions([Integer(3),Integer(3),Integer(3)], symmetry='CSPP')
        >>> A = [(Integer(0), Integer(2), Integer(2)), (Integer(1), Integer(1), Integer(1))]
        >>> PP.from_antichain(A)
        Plane partition [[3, 3, 3], [3, 2, 1], [3, 1, 1]]

  from_order_ideal(I)

    Return the cyclically symmetric plane partition corresponding to an order ideal in the poset given in `to_poset()`.

    EXAMPLES:

    Sage

        sage: PP = PlanePartitions([3,3,3], symmetry='CSPP')
        sage: I = [(0, 0, 0), (0, 0, 1), (0, 0, 2), (0, 1, 1), (0, 1, 2),
        ....:      (1, 0, 2), (0, 2, 2), (1, 1, 1), (1, 1, 2), (1, 2, 2)]
        sage: PP.from_order_ideal(I)                                                # needs sage.graphs
        Plane partition [[3, 3, 3], [3, 3, 3], [3, 3, 2]]

    Python

        >>> from sage.all import *
        >>> PP = PlanePartitions([Integer(3),Integer(3),Integer(3)], symmetry='CSPP')
        >>> I = [(Integer(0), Integer(0), Integer(0)), (Integer(0), Integer(0), Integer(1)), (Integer(0), Integer(0), Integer(2)), (Integer(0), Integer(1), Integer(1)), (Integer(0), Integer(1), Integer(2)),
        ...      (Integer(1), Integer(0), Integer(2)), (Integer(0), Integer(2), Integer(2)), (Integer(1), Integer(1), Integer(1)), (Integer(1), Integer(1), Integer(2)), (Integer(1), Integer(2), Integer(2))]
        >>> PP.from_order_ideal(I)                                                # needs sage.graphs
        Plane partition [[3, 3, 3], [3, 3, 3], [3, 3, 2]]

  random_element()

    Return a uniformly random element of `self`.

    ALGORITHM:

    This uses the `random_order_ideal()` method and the natural bijection between cyclically symmetric plane partitions and order ideals in an associated poset.

    EXAMPLES:

    Sage

        sage: PP = PlanePartitions([3,3,3], symmetry='CSPP')
        sage: PP.random_element()  # random                                         # needs sage.graphs
        Plane partition [[3, 2, 2], [3, 1], [1, 1]]

    Python

        >>> from sage.all import *
        >>> PP = PlanePartitions([Integer(3),Integer(3),Integer(3)], symmetry='CSPP')
        >>> PP.random_element()  # random                                         # needs sage.graphs
        Plane partition [[3, 2, 2], [3, 1], [1, 1]]

  to_poset()

    Return a partially ordered set whose order ideals are in bijection with cyclically symmetric plane partitions.

    EXAMPLES:

    Sage

        sage: PP = PlanePartitions([3,3,3], symmetry='CSPP')
        sage: PP.to_poset()                                                         # needs sage.graphs
        Finite poset containing 11 elements
        sage: PP.to_poset().order_ideals_lattice().cardinality() == PP.cardinality()            # needs sage.graphs
        True

    Python

        >>> from sage.all import *
        >>> PP = PlanePartitions([Integer(3),Integer(3),Integer(3)], symmetry='CSPP')
        >>> PP.to_poset()                                                         # needs sage.graphs
        Finite poset containing 11 elements
        >>> PP.to_poset().order_ideals_lattice().cardinality() == PP.cardinality()            # needs sage.graphs
        True

class sage.combinat.plane_partition.PlanePartitions_CSSCPP(box_size)

  Bases: `PlanePartitions`

  Plane partitions that fit inside a box of a specified size that are cyclically symmetric self-complementary.

  cardinality()

    Return the cardinality of `self`.

    The number of cyclically symmetric self-complementary plane partitions inside a \(2a \times 2a \times 2a\) box is equal to

    \[\left( \prod_{i=0}^{a-1} \frac{(3i+1)!}{(a+i)!} \right)^2.\]

    EXAMPLES:

    Sage

        sage: P = PlanePartitions([6,6,6], symmetry='CSSCPP')
        sage: P.cardinality()
        49

    Python

        >>> from sage.all import *
        >>> P = PlanePartitions([Integer(6),Integer(6),Integer(6)], symmetry='CSSCPP')
        >>> P.cardinality()
        49

class sage.combinat.plane_partition.PlanePartitions_CSTCPP(box_size)

  Bases: `PlanePartitions`

  Plane partitions that fit inside a box of a specified size that are cyclically symmetric and transpose-complement.

  cardinality()

    Return the cardinality of `self`.

    The number of cyclically symmetric transpose complement plane partitions inside a \(2a \times 2a \times 2a\) box is equal to

    \[\prod_{i=0}^{a-1} \frac{(3i+1)(6i)!(2i)!}{(4i+1)!(4i)!}.\]

    EXAMPLES:

    Sage

        sage: P = PlanePartitions([6,6,6], symmetry='CSTCPP')
        sage: P.cardinality()
        11

    Python

        >>> from sage.all import *
        >>> P = PlanePartitions([Integer(6),Integer(6),Integer(6)], symmetry='CSTCPP')
        >>> P.cardinality()
        11

class sage.combinat.plane_partition.PlanePartitions_SCPP(box_size)

  Bases: `PlanePartitions`

  Plane partitions that fit inside a box of a specified size that are self-complementary.

  cardinality()

    Return the cardinality of `self`.

    The number of self complementary plane partitions inside a \(2a \times 2b \times 2c\) box is equal to

    \[\left(\prod_{i=1}^{r}\prod_{j=1}^{b} \frac{i + j + c - 1}{i + j - 1}\right)^2.\]

    The number of self complementary plane partitions inside an \((2a+1) \times 2b \times 2c\) box is equal to

    \[\left(\prod_{i=1}^{a} \prod_{j=1}^{b} \frac{i+j+c-1}{i+j-1} \right) \left(\prod_{i=1}^{a+1} \prod_{j=1}^{b} \frac{i+j+c-1}{i+j-1} \right).\]

    The number of self complementary plane partitions inside an \((2a+1) \times (2b+1) \times 2c\) box is equal to

    \[\left(\prod_{i=1}^{a+1} \prod_{j=1}^{b} \frac{i+j+c-1}{i+j-1} \right) \left(\prod_{i=1}^{a} \prod_{j=1}^{b+1} \frac{i+j+c-1}{i+j-1} \right).\]

    EXAMPLES:

    Sage

        sage: P = PlanePartitions([4,4,4], symmetry='SCPP')
        sage: P.cardinality()
        400

        sage: P = PlanePartitions([5,4,4], symmetry='SCPP')
        sage: P.cardinality()
        1000
        sage: P = PlanePartitions([4,5,4], symmetry='SCPP')
        sage: P.cardinality()
        1000
        sage: P = PlanePartitions([4,4,5], symmetry='SCPP')
        sage: P.cardinality()
        1000

        sage: P = PlanePartitions([5,5,4], symmetry='SCPP')
        sage: P.cardinality()
        2500
        sage: P = PlanePartitions([5,4,5], symmetry='SCPP')
        sage: P.cardinality()
        2500
        sage: P = PlanePartitions([4,5,5], symmetry='SCPP')
        sage: P.cardinality()
        2500

    Python

        >>> from sage.all import *
        >>> P = PlanePartitions([Integer(4),Integer(4),Integer(4)], symmetry='SCPP')
        >>> P.cardinality()
        400

        >>> P = PlanePartitions([Integer(5),Integer(4),Integer(4)], symmetry='SCPP')
        >>> P.cardinality()
        1000
        >>> P = PlanePartitions([Integer(4),Integer(5),Integer(4)], symmetry='SCPP')
        >>> P.cardinality()
        1000
        >>> P = PlanePartitions([Integer(4),Integer(4),Integer(5)], symmetry='SCPP')
        >>> P.cardinality()
        1000

        >>> P = PlanePartitions([Integer(5),Integer(5),Integer(4)], symmetry='SCPP')
        >>> P.cardinality()
        2500
        >>> P = PlanePartitions([Integer(5),Integer(4),Integer(5)], symmetry='SCPP')
        >>> P.cardinality()
        2500
        >>> P = PlanePartitions([Integer(4),Integer(5),Integer(5)], symmetry='SCPP')
        >>> P.cardinality()
        2500

class sage.combinat.plane_partition.PlanePartitions_SPP(box_size)

  Bases: `PlanePartitions`

  Plane partitions that fit inside a box of a specified size that are symmetric.

  cardinality()

    Return the cardinality of `self`.

    The number of symmetric plane partitions inside an \(a \times a \times b\) box is equal to

    \[\left(\prod_{i=1}^{a} \frac{2i + b - 1}{2i - 1}\right) \left(\prod_{1 \leq i < j \leq a} \frac{i+j+b-1}{i+j-1}\right).\]

    EXAMPLES:

    Sage

        sage: P = PlanePartitions([3,3,2], symmetry='SPP')
        sage: P.cardinality()
        35

    Python

        >>> from sage.all import *
        >>> P = PlanePartitions([Integer(3),Integer(3),Integer(2)], symmetry='SPP')
        >>> P.cardinality()
        35

  from_antichain(A)

    Return the symmetric plane partition corresponding to an antichain in the poset given in `to_poset()`.

    EXAMPLES:

    Sage

        sage: PP = PlanePartitions([3,3,2], symmetry='SPP')
        sage: A = [(2, 2, 0), (1, 0, 1), (1, 1, 0)]
        sage: PP.from_antichain(A)
        Plane partition [[2, 2, 1], [2, 1, 1], [1, 1, 1]]

    Python

        >>> from sage.all import *
        >>> PP = PlanePartitions([Integer(3),Integer(3),Integer(2)], symmetry='SPP')
        >>> A = [(Integer(2), Integer(2), Integer(0)), (Integer(1), Integer(0), Integer(1)), (Integer(1), Integer(1), Integer(0))]
        >>> PP.from_antichain(A)
        Plane partition [[2, 2, 1], [2, 1, 1], [1, 1, 1]]

  from_order_ideal(I)

    Return the symmetric plane partition corresponding to an order ideal in the poset given in `to_poset()`.

    EXAMPLES:

    Sage

        sage: PP = PlanePartitions([3,3,2], symmetry='SPP')
        sage: I = [(0, 0, 0), (1, 0, 0), (1, 1, 0), (2, 0, 0)]
        sage: PP.from_order_ideal(I)                                                # needs sage.graphs
        Plane partition [[1, 1, 1], [1, 1], [1]]

    Python

        >>> from sage.all import *
        >>> PP = PlanePartitions([Integer(3),Integer(3),Integer(2)], symmetry='SPP')
        >>> I = [(Integer(0), Integer(0), Integer(0)), (Integer(1), Integer(0), Integer(0)), (Integer(1), Integer(1), Integer(0)), (Integer(2), Integer(0), Integer(0))]
        >>> PP.from_order_ideal(I)                                                # needs sage.graphs
        Plane partition [[1, 1, 1], [1, 1], [1]]

  random_element()

    Return a uniformly random element of `self`.

    ALGORITHM:

    This uses the `random_order_ideal()` method and the natural bijection between symmetric plane partitions and order ideals in an associated poset.

    EXAMPLES:

    Sage

        sage: PP = PlanePartitions([3,3,2], symmetry='SPP')
        sage: PP.random_element()  # random                                         # needs sage.graphs
        Plane partition [[2, 2, 2], [2, 2], [2]]

    Python

        >>> from sage.all import *
        >>> PP = PlanePartitions([Integer(3),Integer(3),Integer(2)], symmetry='SPP')
        >>> PP.random_element()  # random                                         # needs sage.graphs
        Plane partition [[2, 2, 2], [2, 2], [2]]

  to_poset()

    Return a poset whose order ideals are in bijection with symmetric plane partitions.

    EXAMPLES:

    Sage

        sage: PP = PlanePartitions([3,3,2], symmetry='SPP')
        sage: PP.to_poset()                                                         # needs sage.graphs
        Finite poset containing 12 elements
        sage: PP.to_poset().order_ideals_lattice().cardinality() == PP.cardinality()            # needs sage.graphs sage.modules sage.rings.finite_rings
        True

    Python

        >>> from sage.all import *
        >>> PP = PlanePartitions([Integer(3),Integer(3),Integer(2)], symmetry='SPP')
        >>> PP.to_poset()                                                         # needs sage.graphs
        Finite poset containing 12 elements
        >>> PP.to_poset().order_ideals_lattice().cardinality() == PP.cardinality()            # needs sage.graphs sage.modules sage.rings.finite_rings
        True

class sage.combinat.plane_partition.PlanePartitions_SSCPP(box_size)

  Bases: `PlanePartitions`

  Plane partitions that fit inside a box of a specified size that are symmetric self-complementary.

  cardinality()

    Return the cardinality of `self`.

    The number of symmetric self-complementary plane partitions inside a \(2a \times 2a \times 2b\) box is equal to

    \[\prod_{i=1}^a \prod_{j=1}^a \frac{i + j + b - 1}{i + j - 1}.\]

    The number of symmetric self-complementary plane partitions inside a \((2a+1) \times (2a+1) \times 2b\) box is equal to

    \[\prod_{i=1}^a \prod_{j=1}^{a+1} \frac{i + j + b - 1}{i + j - 1}.\]

    EXAMPLES:

    Sage

        sage: P = PlanePartitions([4,4,2], symmetry='SSCPP')
        sage: P.cardinality()
        6
        sage: Q = PlanePartitions([3,3,2], symmetry='SSCPP')
        sage: Q.cardinality()
        3

    Python

        >>> from sage.all import *
        >>> P = PlanePartitions([Integer(4),Integer(4),Integer(2)], symmetry='SSCPP')
        >>> P.cardinality()
        6
        >>> Q = PlanePartitions([Integer(3),Integer(3),Integer(2)], symmetry='SSCPP')
        >>> Q.cardinality()
        3

class sage.combinat.plane_partition.PlanePartitions_TCPP(box_size)

  Bases: `PlanePartitions`

  Plane partitions that fit inside a box of a specified size that are transpose-complement.

  cardinality()

    Return the cardinality of `self`.

    The number of transpose complement plane partitions inside an \(a \times a \times 2b\) box is equal to

    \[\binom{b+1-1}{a-1} \prod_{1\leq i,j \leq a-2} \frac{i + j + 2b - 1}{i + j - 1}.\]

    EXAMPLES:

    Sage

        sage: P = PlanePartitions([3,3,2], symmetry='TCPP')
        sage: P.cardinality()
        5

    Python

        >>> from sage.all import *
        >>> P = PlanePartitions([Integer(3),Integer(3),Integer(2)], symmetry='TCPP')
        >>> P.cardinality()
        5

class sage.combinat.plane_partition.PlanePartitions_TSPP(box_size)

  Bases: `PlanePartitions`

  Plane partitions that fit inside a box of a specified size that are totally symmetric.

  cardinality()

    Return the cardinality of `self`.

    The number of totally symmetric plane partitions inside an \(a \times a \times a\) box is equal to

    \[\prod_{1 \leq i \leq j \leq a} \frac{i+j+a-1}{i+2j-2}.\]

    EXAMPLES:

    Sage

        sage: P = PlanePartitions([4,4,4], symmetry='TSPP')
        sage: P.cardinality()
        66

    Python

        >>> from sage.all import *
        >>> P = PlanePartitions([Integer(4),Integer(4),Integer(4)], symmetry='TSPP')
        >>> P.cardinality()
        66

  from_antichain(acl)

    Return the totally symmetric plane partition corresponding to an antichain in the poset given in `to_poset()`.

    EXAMPLES:

    Sage

        sage: PP = PlanePartitions([3,3,3], symmetry='TSPP')
        sage: A = [(0, 0, 2), (0, 1, 1)]
        sage: PP.from_antichain(A)
        Plane partition [[3, 2, 1], [2, 1], [1]]

    Python

        >>> from sage.all import *
        >>> PP = PlanePartitions([Integer(3),Integer(3),Integer(3)], symmetry='TSPP')
        >>> A = [(Integer(0), Integer(0), Integer(2)), (Integer(0), Integer(1), Integer(1))]
        >>> PP.from_antichain(A)
        Plane partition [[3, 2, 1], [2, 1], [1]]

  from_order_ideal(I)

    Return the totally symmetric plane partition corresponding to an order ideal in the poset given in `to_poset()`.

    EXAMPLES:

    Sage

        sage: PP = PlanePartitions([3,3,3], symmetry='TSPP')
        sage: I = [(0, 0, 0), (0, 0, 1), (0, 0, 2), (0, 1, 1)]
        sage: PP.from_order_ideal(I)                                                # needs sage.graphs
        Plane partition [[3, 2, 1], [2, 1], [1]]

    Python

        >>> from sage.all import *
        >>> PP = PlanePartitions([Integer(3),Integer(3),Integer(3)], symmetry='TSPP')
        >>> I = [(Integer(0), Integer(0), Integer(0)), (Integer(0), Integer(0), Integer(1)), (Integer(0), Integer(0), Integer(2)), (Integer(0), Integer(1), Integer(1))]
        >>> PP.from_order_ideal(I)                                                # needs sage.graphs
        Plane partition [[3, 2, 1], [2, 1], [1]]

  to_poset()

    Return a poset whose order ideals are in bijection with totally symmetric plane partitions.

    EXAMPLES:

    Sage

        sage: PP = PlanePartitions([3,3,3], symmetry='TSPP')
        sage: PP.to_poset()                                                         # needs sage.graphs
        Finite poset containing 10 elements
        sage: (PP.to_poset().order_ideals_lattice().cardinality()                   # needs sage.graphs sage.modules sage.rings.finite_rings
        ....:     == PP.cardinality())
        True

    Python

        >>> from sage.all import *
        >>> PP = PlanePartitions([Integer(3),Integer(3),Integer(3)], symmetry='TSPP')
        >>> PP.to_poset()                                                         # needs sage.graphs
        Finite poset containing 10 elements
        >>> (PP.to_poset().order_ideals_lattice().cardinality()                   # needs sage.graphs sage.modules sage.rings.finite_rings
        ...     == PP.cardinality())
        True

class sage.combinat.plane_partition.PlanePartitions_TSSCPP(box_size)

  Bases: `PlanePartitions`

  Plane partitions that fit inside a box of a specified size that are totally symmetric self-complementary.

  cardinality()

    Return the cardinality of `self`.

    The number of totally symmetric self-complementary plane partitions inside a \(2a \times 2a \times 2a\) box is equal to

    \[\prod_{i=0}^{a-1} \frac{(3i+1)!}{(a+i)!}.\]

    EXAMPLES:

    Sage

        sage: P = PlanePartitions([6,6,6], symmetry='TSSCPP')
        sage: P.cardinality()
        7

    Python

        >>> from sage.all import *
        >>> P = PlanePartitions([Integer(6),Integer(6),Integer(6)], symmetry='TSSCPP')
        >>> P.cardinality()
        7

  from_antichain(acl)

    Return the totally symmetric self-complementary plane partition corresponding to an antichain in the poset given in `to_poset()`.

    EXAMPLES:

    Sage

        sage: PP = PlanePartitions([6,6,6], symmetry='TSSCPP')
        sage: A = [(0, 0, 1), (1, 1, 0)]
        sage: PP.from_antichain(A)
        Plane partition [[6, 6, 6, 5, 5, 3], [6, 5, 5, 4, 3, 1], [6, 5, 4, 3, 2, 1],
                         [5, 4, 3, 2, 1], [5, 3, 2, 1, 1], [3, 1, 1]]

    Python

        >>> from sage.all import *
        >>> PP = PlanePartitions([Integer(6),Integer(6),Integer(6)], symmetry='TSSCPP')
        >>> A = [(Integer(0), Integer(0), Integer(1)), (Integer(1), Integer(1), Integer(0))]
        >>> PP.from_antichain(A)
        Plane partition [[6, 6, 6, 5, 5, 3], [6, 5, 5, 4, 3, 1], [6, 5, 4, 3, 2, 1],
                         [5, 4, 3, 2, 1], [5, 3, 2, 1, 1], [3, 1, 1]]

  from_order_ideal(I)

    Return the totally symmetric self-complementary plane partition corresponding to an order ideal in the poset given in `to_poset()`.

    EXAMPLES:

    Sage

        sage: PP = PlanePartitions([6,6,6], symmetry='TSSCPP')                      # needs sage.graphs
        sage: I = [(0, 0, 0), (0, 1, 0), (1, 1, 0)]
        sage: PP.from_order_ideal(I)                                                # needs sage.graphs
        Plane partition [[6, 6, 6, 5, 5, 3], [6, 5, 5, 3, 3, 1], [6, 5, 5, 3, 3, 1],
                         [5, 3, 3, 1, 1], [5, 3, 3, 1, 1], [3, 1, 1]]

    Python

        >>> from sage.all import *
        >>> PP = PlanePartitions([Integer(6),Integer(6),Integer(6)], symmetry='TSSCPP')                      # needs sage.graphs
        >>> I = [(Integer(0), Integer(0), Integer(0)), (Integer(0), Integer(1), Integer(0)), (Integer(1), Integer(1), Integer(0))]
        >>> PP.from_order_ideal(I)                                                # needs sage.graphs
        Plane partition [[6, 6, 6, 5, 5, 3], [6, 5, 5, 3, 3, 1], [6, 5, 5, 3, 3, 1],
                         [5, 3, 3, 1, 1], [5, 3, 3, 1, 1], [3, 1, 1]]

  to_poset()

    Return a poset whose order ideals are in bijection with totally symmetric self-complementary plane partitions.

    EXAMPLES:

    Sage

        sage: PP = PlanePartitions([6,6,6], symmetry='TSSCPP')
        sage: PP.to_poset()                                                         # needs sage.graphs sage.modules
        Finite poset containing 4 elements
        sage: PP.to_poset().order_ideals_lattice().cardinality() == PP.cardinality()            # needs sage.graphs sage.modules
        True

    Python

        >>> from sage.all import *
        >>> PP = PlanePartitions([Integer(6),Integer(6),Integer(6)], symmetry='TSSCPP')
        >>> PP.to_poset()                                                         # needs sage.graphs sage.modules
        Finite poset containing 4 elements
        >>> PP.to_poset().order_ideals_lattice().cardinality() == PP.cardinality()            # needs sage.graphs sage.modules
        True

class sage.combinat.plane_partition.PlanePartitions_all

  Bases: `PlanePartitions`, `DisjointUnionEnumeratedSets`

  All plane partitions.

  an_element()

    Return a particular element of the class.

class sage.combinat.plane_partition.PlanePartitions_box(box_size)

  Bases: `PlanePartitions`

  All plane partitions that fit inside a box of a specified size.

  By convention, a plane partition in an \(a \times b \times c\) box will have at most \(a\) rows, of lengths at most \(b\), with entries at most \(c\).

  cardinality()

    Return the cardinality of `self`.

    The number of plane partitions inside an \(a \times b \times c\) box is equal to

    \[\prod_{i=1}^{a} \prod_{j=1}^{b} \prod_{k=1}^{c} \frac{i+j+k-1}{i+j+k-2}.\]

    EXAMPLES:

    Sage

        sage: P = PlanePartitions([4,3,5])
        sage: P.cardinality()
        116424

    Python

        >>> from sage.all import *
        >>> P = PlanePartitions([Integer(4),Integer(3),Integer(5)])
        >>> P.cardinality()
        116424

  from_antichain(A)

    Return the plane partition corresponding to an antichain in the poset given in `to_poset()`.

    EXAMPLES:

    Sage

        sage: A = [(1,0,1), (0,1,1), (1,1,0)]
        sage: PlanePartitions([2,2,2]).from_antichain(A)
        Plane partition [[2, 2], [2, 1]]

    Python

        >>> from sage.all import *
        >>> A = [(Integer(1),Integer(0),Integer(1)), (Integer(0),Integer(1),Integer(1)), (Integer(1),Integer(1),Integer(0))]
        >>> PlanePartitions([Integer(2),Integer(2),Integer(2)]).from_antichain(A)
        Plane partition [[2, 2], [2, 1]]

  from_order_ideal(I)

    Return the plane partition corresponding to an order ideal in the poset given in `to_poset()`.

    EXAMPLES:

    Sage

        sage: I = [(1, 0, 0), (1, 0, 1), (1, 1, 0), (0, 1, 0),
        ....:      (0, 0, 0), (0, 0, 1), (0, 1, 1)]
        sage: PlanePartitions([2,2,2]).from_order_ideal(I)                          # needs sage.graphs sage.modules
        Plane partition [[2, 2], [2, 1]]

    Python

        >>> from sage.all import *
        >>> I = [(Integer(1), Integer(0), Integer(0)), (Integer(1), Integer(0), Integer(1)), (Integer(1), Integer(1), Integer(0)), (Integer(0), Integer(1), Integer(0)),
        ...      (Integer(0), Integer(0), Integer(0)), (Integer(0), Integer(0), Integer(1)), (Integer(0), Integer(1), Integer(1))]
        >>> PlanePartitions([Integer(2),Integer(2),Integer(2)]).from_order_ideal(I)                          # needs sage.graphs sage.modules
        Plane partition [[2, 2], [2, 1]]

  random_element()

    Return a uniformly random plane partition inside a box.

    ALGORITHM:

    This uses the `random_order_ideal()` method and the natural bijection with plane partitions.

    EXAMPLES:

    Sage

        sage: P = PlanePartitions([4,3,5])
        sage: P.random_element()  # random                                          # needs sage.graphs sage.modules
        Plane partition [[4, 3, 3], [4], [2]]

    Python

        >>> from sage.all import *
        >>> P = PlanePartitions([Integer(4),Integer(3),Integer(5)])
        >>> P.random_element()  # random                                          # needs sage.graphs sage.modules
        Plane partition [[4, 3, 3], [4], [2]]

  to_poset()

    Return the product of three chains poset, whose order ideals are naturally in bijection with plane partitions inside a box.

    EXAMPLES:

    Sage

        sage: PlanePartitions([2,2,2]).to_poset()                                   # needs sage.graphs sage.modules
        Finite lattice containing 8 elements

    Python

        >>> from sage.all import *
        >>> PlanePartitions([Integer(2),Integer(2),Integer(2)]).to_poset()                                   # needs sage.graphs sage.modules
        Finite lattice containing 8 elements

class sage.combinat.plane_partition.PlanePartitions_n(n)

  Bases: `PlanePartitions`

  Plane partitions with a fixed number of boxes.

  cardinality()

    Return the number of plane partitions with `n` boxes.

    Calculated using the recurrence relation

    \[PL(n) = \sum_{k=1}^n PL(n-k) \sigma_2(k),\]

    where \(\sigma_k(n)\) is the sum of the \(k\)-th powers of divisors of \(n\).

    EXAMPLES:

    Sage

        sage: P = PlanePartitions(17)
        sage: P.cardinality()
        18334

    Python

        >>> from sage.all import *
        >>> P = PlanePartitions(Integer(17))
        >>> P.cardinality()
        18334