Ribbon tableaux - Combinatorics

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

# Ribbon tableaux

class sage.combinat.ribbon_tableau.MultiSkewTableau(parent, *args, **kwds)

  Bases: `CombinatorialElement`

  A multi skew tableau which is a tuple of skew tableaux.

  EXAMPLES:

  Sage

      sage: s = MultiSkewTableau([ [[None,1],[2,3]], [[1,2],[2]] ])
      sage: s.size()
      6
      sage: s.weight()
      [2, 3, 1]
      sage: s.shape()
      [[2, 2] / [1], [2, 1] / []]

  Python

      >>> from sage.all import *
      >>> s = MultiSkewTableau([ [[None,Integer(1)],[Integer(2),Integer(3)]], [[Integer(1),Integer(2)],[Integer(2)]] ])
      >>> s.size()
      6
      >>> s.weight()
      [2, 3, 1]
      >>> s.shape()
      [[2, 2] / [1], [2, 1] / []]

  inversion_pairs()

    Return a list of the inversion pairs of `self`.

    EXAMPLES:

    Sage

        sage: s = MultiSkewTableau([ [[2,3],[5,5]], [[1,1],[3,3]], [[2],[6]] ])
        sage: s.inversion_pairs()
        [((0, (0, 0)), (1, (0, 0))),
         ((0, (1, 0)), (1, (0, 1))),
         ((0, (1, 1)), (1, (0, 0))),
         ((0, (1, 1)), (1, (1, 1))),
         ((0, (1, 1)), (2, (0, 0))),
         ((1, (0, 1)), (2, (0, 0))),
         ((1, (1, 1)), (2, (0, 0)))]

    Python

        >>> from sage.all import *
        >>> s = MultiSkewTableau([ [[Integer(2),Integer(3)],[Integer(5),Integer(5)]], [[Integer(1),Integer(1)],[Integer(3),Integer(3)]], [[Integer(2)],[Integer(6)]] ])
        >>> s.inversion_pairs()
        [((0, (0, 0)), (1, (0, 0))),
         ((0, (1, 0)), (1, (0, 1))),
         ((0, (1, 1)), (1, (0, 0))),
         ((0, (1, 1)), (1, (1, 1))),
         ((0, (1, 1)), (2, (0, 0))),
         ((1, (0, 1)), (2, (0, 0))),
         ((1, (1, 1)), (2, (0, 0)))]

  inversions()

    Return the number of inversion pairs of `self`.

    EXAMPLES:

    Sage

        sage: t1 = SkewTableau([[1]])
        sage: t2 = SkewTableau([[2]])
        sage: MultiSkewTableau([t1,t1]).inversions()
        0
        sage: MultiSkewTableau([t1,t2]).inversions()
        0
        sage: MultiSkewTableau([t2,t2]).inversions()
        0
        sage: MultiSkewTableau([t2,t1]).inversions()
        1
        sage: s = MultiSkewTableau([ [[2,3],[5,5]], [[1,1],[3,3]], [[2],[6]] ])
        sage: s.inversions()
        7

    Python

        >>> from sage.all import *
        >>> t1 = SkewTableau([[Integer(1)]])
        >>> t2 = SkewTableau([[Integer(2)]])
        >>> MultiSkewTableau([t1,t1]).inversions()
        0
        >>> MultiSkewTableau([t1,t2]).inversions()
        0
        >>> MultiSkewTableau([t2,t2]).inversions()
        0
        >>> MultiSkewTableau([t2,t1]).inversions()
        1
        >>> s = MultiSkewTableau([ [[Integer(2),Integer(3)],[Integer(5),Integer(5)]], [[Integer(1),Integer(1)],[Integer(3),Integer(3)]], [[Integer(2)],[Integer(6)]] ])
        >>> s.inversions()
        7

  shape()

    Return the shape of `self`.

    EXAMPLES:

    Sage

        sage: s = SemistandardSkewTableaux([[2,2],[1]]).list()
        sage: a = MultiSkewTableau([s[0],s[1],s[2]])
        sage: a.shape()
        [[2, 2] / [1], [2, 2] / [1], [2, 2] / [1]]

    Python

        >>> from sage.all import *
        >>> s = SemistandardSkewTableaux([[Integer(2),Integer(2)],[Integer(1)]]).list()
        >>> a = MultiSkewTableau([s[Integer(0)],s[Integer(1)],s[Integer(2)]])
        >>> a.shape()
        [[2, 2] / [1], [2, 2] / [1], [2, 2] / [1]]

  size()

    Return the size of `self`.

    This is the sum of the sizes of the skew tableaux in `self`.

    EXAMPLES:

    Sage

        sage: s = SemistandardSkewTableaux([[2,2],[1]]).list()
        sage: a = MultiSkewTableau([s[0],s[1],s[2]])
        sage: a.size()
        9

    Python

        >>> from sage.all import *
        >>> s = SemistandardSkewTableaux([[Integer(2),Integer(2)],[Integer(1)]]).list()
        >>> a = MultiSkewTableau([s[Integer(0)],s[Integer(1)],s[Integer(2)]])
        >>> a.size()
        9

  weight()

    Return the weight of `self`.

    EXAMPLES:

    Sage

        sage: s = SemistandardSkewTableaux([[2,2],[1]]).list()
        sage: a = MultiSkewTableau([s[0],s[1],s[2]])
        sage: a.weight()
        [5, 3, 1]

    Python

        >>> from sage.all import *
        >>> s = SemistandardSkewTableaux([[Integer(2),Integer(2)],[Integer(1)]]).list()
        >>> a = MultiSkewTableau([s[Integer(0)],s[Integer(1)],s[Integer(2)]])
        >>> a.weight()
        [5, 3, 1]

class sage.combinat.ribbon_tableau.MultiSkewTableaux(category=None)

  Bases: `UniqueRepresentation`, `Parent`

  Multiskew tableaux.

  Element

    alias of `MultiSkewTableau`

class sage.combinat.ribbon_tableau.RibbonTableau(parent, st)

  Bases: `SkewTableau`

  A ribbon tableau.

  A ribbon is a connected skew shape which does not contain any \(2 \times 2\) boxes. A ribbon tableau is a skew tableau whose shape is partitioned into ribbons, each of which is filled with identical entries.

  EXAMPLES:

  Sage

      sage: rt = RibbonTableau([[None, 1],[2,3]]); rt
      [[None, 1], [2, 3]]
      sage: rt.inner_shape()
      [1]
      sage: rt.outer_shape()
      [2, 2]

      sage: rt = RibbonTableau([[None, None, 0, 0, 0], [None, 0, 0, 2], [1, 0, 1]]); rt.pp()
        .  .  0  0  0
        .  0  0  2
        1  0  1

  Python

      >>> from sage.all import *
      >>> rt = RibbonTableau([[None, Integer(1)],[Integer(2),Integer(3)]]); rt
      [[None, 1], [2, 3]]
      >>> rt.inner_shape()
      [1]
      >>> rt.outer_shape()
      [2, 2]

      >>> rt = RibbonTableau([[None, None, Integer(0), Integer(0), Integer(0)], [None, Integer(0), Integer(0), Integer(2)], [Integer(1), Integer(0), Integer(1)]]); rt.pp()
        .  .  0  0  0
        .  0  0  2
        1  0  1

  In the previous example, each ribbon is uniquely determined by a nonzero entry. The 0 entries are used to fill in the rest of the skew shape.

  Note

  Sanity checks are not performed; lists can contain any object.

  Sage

      sage: RibbonTableau(expr=[[1,1],[[5],[3,4],[1,2]]])
      [[None, 1, 2], [None, 3, 4], [5]]

  [Python]

      >>> from sage.all import *
      >>> RibbonTableau(expr=[[Integer(1),Integer(1)],[[Integer(5)],[Integer(3),Integer(4)],[Integer(1),Integer(2)]]])
      [[None, 1, 2], [None, 3, 4], [5]]

  length()

    Return the length of the ribbons into a ribbon tableau.

    EXAMPLES:

    Sage

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

    Python

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

  to_word()

    Return a word obtained from a row reading of `self`.

    Warning

    Unlike the `to_word` method on skew tableaux (which are a superclass of this), this method does not filter out `None` entries.

    EXAMPLES:

    Sage

        sage: R = RibbonTableau([[0, 0, 3, 0], [1, 1, 0], [2, 0, 4]])
        sage: R.to_word()
        word: 2041100030

    Python

        >>> from sage.all import *
        >>> R = RibbonTableau([[Integer(0), Integer(0), Integer(3), Integer(0)], [Integer(1), Integer(1), Integer(0)], [Integer(2), Integer(0), Integer(4)]])
        >>> R.to_word()
        word: 2041100030

class sage.combinat.ribbon_tableau.RibbonTableau_class(parent, st)

  Bases: `RibbonTableau`

  This exists solely for unpickling `RibbonTableau_class` objects.

class sage.combinat.ribbon_tableau.RibbonTableaux

  Bases: `UniqueRepresentation`, `Parent`

  Ribbon tableaux.

  A ribbon tableau is a skew tableau whose skew shape `shape` is tiled by ribbons of length `length`. The weight `weight` is calculated from the labels on the ribbons.

  Note

  Here we impose the condition that the ribbon tableaux are semistandard.

  INPUT(Optional):

  - `shape` – skew shape as a list of lists or an object of type SkewPartition

  - `length` – integer; `shape` is partitioned into ribbons of length `length`

  - `weight` – list of integers; computed from the values of nonzero entries labeling the ribbons

  EXAMPLES:

  Sage

      sage: RibbonTableaux([[2,1],[]], [1,1,1], 1)
      Ribbon tableaux of shape [2, 1] / [] and weight [1, 1, 1] with 1-ribbons

      sage: R = RibbonTableaux([[5,4,3],[2,1]], [2,1], 3)
      sage: for i in R: i.pp(); print("\n")
        .  .  0  0  0
        .  0  0  2
        1  0  1

        .  .  1  0  0
        .  0  0  0
        1  0  2

        .  .  0  0  0
        .  1  0  1
        2  0  0

  Python

      >>> from sage.all import *
      >>> RibbonTableaux([[Integer(2),Integer(1)],[]], [Integer(1),Integer(1),Integer(1)], Integer(1))
      Ribbon tableaux of shape [2, 1] / [] and weight [1, 1, 1] with 1-ribbons

      >>> R = RibbonTableaux([[Integer(5),Integer(4),Integer(3)],[Integer(2),Integer(1)]], [Integer(2),Integer(1)], Integer(3))
      >>> for i in R: i.pp(); print("\n")
        .  .  0  0  0
        .  0  0  2
        1  0  1
      <BLANKLINE>
        .  .  1  0  0
        .  0  0  0
        1  0  2
      <BLANKLINE>
        .  .  0  0  0
        .  1  0  1
        2  0  0
      <BLANKLINE>

  REFERENCES:

  [vanLeeuwen91]

  Marc. A. A. van Leeuwen, Edge sequences, ribbon tableaux, and an action of affine permutations. Europe J. Combinatorics. 20 (1999). http://wwwmathlabo.univ-poitiers.fr/~maavl/pdf/edgeseqs.pdf

  Element

    alias of `RibbonTableau`

  from_expr(l)

    Return a `RibbonTableau` from a MuPAD-Combinat expr for a skew tableau. The first list in `expr` is the inner shape of the skew tableau. The second list are the entries in the rows of the skew tableau from bottom to top.

    Provided primarily for compatibility with MuPAD-Combinat.

    EXAMPLES:

    Sage

        sage: RibbonTableaux().from_expr([[1,1],[[5],[3,4],[1,2]]])
        [[None, 1, 2], [None, 3, 4], [5]]

    Python

        >>> from sage.all import *
        >>> RibbonTableaux().from_expr([[Integer(1),Integer(1)],[[Integer(5)],[Integer(3),Integer(4)],[Integer(1),Integer(2)]]])
        [[None, 1, 2], [None, 3, 4], [5]]

  options = Current options for Tableaux - ascii_art: repr - convention: English - display: list - latex: diagram

class sage.combinat.ribbon_tableau.RibbonTableaux_shape_weight_length(shape, weight, length)

  Bases: `RibbonTableaux`

  Ribbon tableaux of a given shape, weight, and length.

  cardinality()

    Return the cardinality of `self`.

    EXAMPLES:

    Sage

        sage: RibbonTableaux([[2,1],[]],[1,1,1],1).cardinality()
        2
        sage: RibbonTableaux([[2,2],[]],[1,1],2).cardinality()
        2
        sage: RibbonTableaux([[4,3,3],[]],[2,1,1,1],2).cardinality()
        5

    Python

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

class sage.combinat.ribbon_tableau.SemistandardMultiSkewTableaux(shape, weight)

  Bases: `MultiSkewTableaux`

  Semistandard multi skew tableaux.

  A multi skew tableau is a \(k\)-tuple of skew tableaux of given shape with a specified total weight.

  EXAMPLES:

  Sage

      sage: S = SemistandardMultiSkewTableaux([ [[2,1],[]], [[2,2],[1]] ], [2,2,2]); S
      Semistandard multi skew tableaux of shape [[2, 1] / [], [2, 2] / [1]] and weight [2, 2, 2]
      sage: S.list()
      [[[[1, 1], [2]], [[None, 2], [3, 3]]],
       [[[1, 2], [2]], [[None, 1], [3, 3]]],
       [[[1, 3], [2]], [[None, 2], [1, 3]]],
       [[[1, 3], [2]], [[None, 1], [2, 3]]],
       [[[1, 1], [3]], [[None, 2], [2, 3]]],
       [[[1, 2], [3]], [[None, 2], [1, 3]]],
       [[[1, 2], [3]], [[None, 1], [2, 3]]],
       [[[2, 2], [3]], [[None, 1], [1, 3]]],
       [[[1, 3], [3]], [[None, 1], [2, 2]]],
       [[[2, 3], [3]], [[None, 1], [1, 2]]]]

  Python

      >>> from sage.all import *
      >>> S = SemistandardMultiSkewTableaux([ [[Integer(2),Integer(1)],[]], [[Integer(2),Integer(2)],[Integer(1)]] ], [Integer(2),Integer(2),Integer(2)]); S
      Semistandard multi skew tableaux of shape [[2, 1] / [], [2, 2] / [1]] and weight [2, 2, 2]
      >>> S.list()
      [[[[1, 1], [2]], [[None, 2], [3, 3]]],
       [[[1, 2], [2]], [[None, 1], [3, 3]]],
       [[[1, 3], [2]], [[None, 2], [1, 3]]],
       [[[1, 3], [2]], [[None, 1], [2, 3]]],
       [[[1, 1], [3]], [[None, 2], [2, 3]]],
       [[[1, 2], [3]], [[None, 2], [1, 3]]],
       [[[1, 2], [3]], [[None, 1], [2, 3]]],
       [[[2, 2], [3]], [[None, 1], [1, 3]]],
       [[[1, 3], [3]], [[None, 1], [2, 2]]],
       [[[2, 3], [3]], [[None, 1], [1, 2]]]]

sage.combinat.ribbon_tableau.cospin_polynomial(part, weight, length)

  Return the cospin polynomial associated to `part`, `weight`, and `length`.

  EXAMPLES:

  Sage

      sage: from sage.combinat.ribbon_tableau import cospin_polynomial
      sage: cospin_polynomial([6,6,6],[4,2],3)
      t^4 + t^3 + 2*t^2 + t + 1
      sage: cospin_polynomial([3,3,3,2,1], [3,1], 3)
      1
      sage: cospin_polynomial([3,3,3,2,1], [2,2], 3)
      t + 1
      sage: cospin_polynomial([3,3,3,2,1], [2,1,1], 3)
      t^2 + 2*t + 2
      sage: cospin_polynomial([3,3,3,2,1], [1,1,1,1], 3)
      t^3 + 3*t^2 + 5*t + 3
      sage: cospin_polynomial([5,4,3,2,1,1,1], [2,2,1], 3)
      2*t^2 + 6*t + 2
      sage: cospin_polynomial([[6]*6, [3,3]], [4,4,2], 3)
      3*t^4 + 6*t^3 + 9*t^2 + 5*t + 3

  Python

      >>> from sage.all import *
      >>> from sage.combinat.ribbon_tableau import cospin_polynomial
      >>> cospin_polynomial([Integer(6),Integer(6),Integer(6)],[Integer(4),Integer(2)],Integer(3))
      t^4 + t^3 + 2*t^2 + t + 1
      >>> cospin_polynomial([Integer(3),Integer(3),Integer(3),Integer(2),Integer(1)], [Integer(3),Integer(1)], Integer(3))
      1
      >>> cospin_polynomial([Integer(3),Integer(3),Integer(3),Integer(2),Integer(1)], [Integer(2),Integer(2)], Integer(3))
      t + 1
      >>> cospin_polynomial([Integer(3),Integer(3),Integer(3),Integer(2),Integer(1)], [Integer(2),Integer(1),Integer(1)], Integer(3))
      t^2 + 2*t + 2
      >>> cospin_polynomial([Integer(3),Integer(3),Integer(3),Integer(2),Integer(1)], [Integer(1),Integer(1),Integer(1),Integer(1)], Integer(3))
      t^3 + 3*t^2 + 5*t + 3
      >>> cospin_polynomial([Integer(5),Integer(4),Integer(3),Integer(2),Integer(1),Integer(1),Integer(1)], [Integer(2),Integer(2),Integer(1)], Integer(3))
      2*t^2 + 6*t + 2
      >>> cospin_polynomial([[Integer(6)]*Integer(6), [Integer(3),Integer(3)]], [Integer(4),Integer(4),Integer(2)], Integer(3))
      3*t^4 + 6*t^3 + 9*t^2 + 5*t + 3

sage.combinat.ribbon_tableau.count_rec(nexts, current, part, weight, length)

  INPUT:

  - `nexts, current, part` – skew partitions

  - `weight` – nonnegative integer list

  - `length` – integer

sage.combinat.ribbon_tableau.graph_implementation_rec(skp, weight, length, function)

sage.combinat.ribbon_tableau.insertion_tableau(skp, perm, evaluation, tableau, length)

  INPUT:

  - `skp` – skew partitions

  - `perm, evaluation` – nonnegative integers

  - `tableau` – skew tableau

  - `length` – integer

sage.combinat.ribbon_tableau.list_rec(nexts, current, part, weight, length)

  INPUT:

  - `nexts, current, part` – skew partitions

  - `weight` – nonnegative integer list

  - `length` – integer

sage.combinat.ribbon_tableau.spin_polynomial(part, weight, length)

  Return the spin polynomial associated to `part`, `weight`, and `length`.

  EXAMPLES:

  Sage

      sage: # needs sage.symbolic
      sage: from sage.combinat.ribbon_tableau import spin_polynomial
      sage: spin_polynomial([6,6,6],[4,2],3)
      t^6 + t^5 + 2*t^4 + t^3 + t^2
      sage: spin_polynomial([6,6,6],[4,1,1],3)
      t^6 + 2*t^5 + 3*t^4 + 2*t^3 + t^2
      sage: spin_polynomial([3,3,3,2,1], [2,2], 3)
      t^(7/2) + t^(5/2)
      sage: spin_polynomial([3,3,3,2,1], [2,1,1], 3)
      2*t^(7/2) + 2*t^(5/2) + t^(3/2)
      sage: spin_polynomial([3,3,3,2,1], [1,1,1,1], 3)
      3*t^(7/2) + 5*t^(5/2) + 3*t^(3/2) + sqrt(t)
      sage: spin_polynomial([5,4,3,2,1,1,1], [2,2,1], 3)
      2*t^(9/2) + 6*t^(7/2) + 2*t^(5/2)
      sage: spin_polynomial([[6]*6, [3,3]], [4,4,2], 3)
      3*t^9 + 5*t^8 + 9*t^7 + 6*t^6 + 3*t^5

  Python

      >>> from sage.all import *
      >>> # needs sage.symbolic
      >>> from sage.combinat.ribbon_tableau import spin_polynomial
      >>> spin_polynomial([Integer(6),Integer(6),Integer(6)],[Integer(4),Integer(2)],Integer(3))
      t^6 + t^5 + 2*t^4 + t^3 + t^2
      >>> spin_polynomial([Integer(6),Integer(6),Integer(6)],[Integer(4),Integer(1),Integer(1)],Integer(3))
      t^6 + 2*t^5 + 3*t^4 + 2*t^3 + t^2
      >>> spin_polynomial([Integer(3),Integer(3),Integer(3),Integer(2),Integer(1)], [Integer(2),Integer(2)], Integer(3))
      t^(7/2) + t^(5/2)
      >>> spin_polynomial([Integer(3),Integer(3),Integer(3),Integer(2),Integer(1)], [Integer(2),Integer(1),Integer(1)], Integer(3))
      2*t^(7/2) + 2*t^(5/2) + t^(3/2)
      >>> spin_polynomial([Integer(3),Integer(3),Integer(3),Integer(2),Integer(1)], [Integer(1),Integer(1),Integer(1),Integer(1)], Integer(3))
      3*t^(7/2) + 5*t^(5/2) + 3*t^(3/2) + sqrt(t)
      >>> spin_polynomial([Integer(5),Integer(4),Integer(3),Integer(2),Integer(1),Integer(1),Integer(1)], [Integer(2),Integer(2),Integer(1)], Integer(3))
      2*t^(9/2) + 6*t^(7/2) + 2*t^(5/2)
      >>> spin_polynomial([[Integer(6)]*Integer(6), [Integer(3),Integer(3)]], [Integer(4),Integer(4),Integer(2)], Integer(3))
      3*t^9 + 5*t^8 + 9*t^7 + 6*t^6 + 3*t^5

sage.combinat.ribbon_tableau.spin_polynomial_square(part, weight, length)

  Return the spin polynomial associated with `part`, `weight`, and `length`, with the substitution \(t \to t^2\) made.

  EXAMPLES:

  Sage

      sage: from sage.combinat.ribbon_tableau import spin_polynomial_square
      sage: spin_polynomial_square([6,6,6],[4,2],3)
      t^12 + t^10 + 2*t^8 + t^6 + t^4
      sage: spin_polynomial_square([6,6,6],[4,1,1],3)
      t^12 + 2*t^10 + 3*t^8 + 2*t^6 + t^4
      sage: spin_polynomial_square([3,3,3,2,1], [2,2], 3)
      t^7 + t^5
      sage: spin_polynomial_square([3,3,3,2,1], [2,1,1], 3)
      2*t^7 + 2*t^5 + t^3
      sage: spin_polynomial_square([3,3,3,2,1], [1,1,1,1], 3)
      3*t^7 + 5*t^5 + 3*t^3 + t
      sage: spin_polynomial_square([5,4,3,2,1,1,1], [2,2,1], 3)
      2*t^9 + 6*t^7 + 2*t^5
      sage: spin_polynomial_square([[6]*6, [3,3]], [4,4,2], 3)
      3*t^18 + 5*t^16 + 9*t^14 + 6*t^12 + 3*t^10

  Python

      >>> from sage.all import *
      >>> from sage.combinat.ribbon_tableau import spin_polynomial_square
      >>> spin_polynomial_square([Integer(6),Integer(6),Integer(6)],[Integer(4),Integer(2)],Integer(3))
      t^12 + t^10 + 2*t^8 + t^6 + t^4
      >>> spin_polynomial_square([Integer(6),Integer(6),Integer(6)],[Integer(4),Integer(1),Integer(1)],Integer(3))
      t^12 + 2*t^10 + 3*t^8 + 2*t^6 + t^4
      >>> spin_polynomial_square([Integer(3),Integer(3),Integer(3),Integer(2),Integer(1)], [Integer(2),Integer(2)], Integer(3))
      t^7 + t^5
      >>> spin_polynomial_square([Integer(3),Integer(3),Integer(3),Integer(2),Integer(1)], [Integer(2),Integer(1),Integer(1)], Integer(3))
      2*t^7 + 2*t^5 + t^3
      >>> spin_polynomial_square([Integer(3),Integer(3),Integer(3),Integer(2),Integer(1)], [Integer(1),Integer(1),Integer(1),Integer(1)], Integer(3))
      3*t^7 + 5*t^5 + 3*t^3 + t
      >>> spin_polynomial_square([Integer(5),Integer(4),Integer(3),Integer(2),Integer(1),Integer(1),Integer(1)], [Integer(2),Integer(2),Integer(1)], Integer(3))
      2*t^9 + 6*t^7 + 2*t^5
      >>> spin_polynomial_square([[Integer(6)]*Integer(6), [Integer(3),Integer(3)]], [Integer(4),Integer(4),Integer(2)], Integer(3))
      3*t^18 + 5*t^16 + 9*t^14 + 6*t^12 + 3*t^10

sage.combinat.ribbon_tableau.spin_rec(t, nexts, current, part, weight, length)

  Routine used for constructing the spin polynomial.

  INPUT:

  - `weight` – list of nonnegative integers

  - `length` – the length of the ribbons we’re tiling with

  - `t` – the variable

  EXAMPLES:

  Sage

      sage: from sage.combinat.ribbon_tableau import spin_rec
      sage: sp = SkewPartition
      sage: t = ZZ['t'].gen()
      sage: spin_rec(t, [], [[[], [3, 3]]], sp([[2, 2, 2], []]), [2], 3)
      [t^4]
      sage: spin_rec(t, [[0], [t^4]], [[[2, 1, 1, 1, 1], [0, 3]], [[2, 2, 2], [3, 0]]], sp([[2, 2, 2, 2, 1], []]), [2, 1], 3)
      [t^5]
      sage: spin_rec(t, [], [[[], [3, 3, 0]]], sp([[3, 3], []]), [2], 3)
      [t^2]
      sage: spin_rec(t, [[t^4], [t^3], [t^2]], [[[2, 2, 2], [0, 0, 3]], [[3, 2, 1], [0, 3, 0]], [[3, 3], [3, 0, 0]]], sp([[3, 3, 3], []]), [2, 1], 3)
      [t^6 + t^4 + t^2]
      sage: spin_rec(t, [[t^5], [t^4], [t^6 + t^4 + t^2]], [[[2, 2, 2, 2, 1], [0, 0, 3]], [[3, 3, 1, 1, 1], [0, 3, 0]], [[3, 3, 3], [3, 0, 0]]], sp([[3, 3, 3, 2, 1], []]), [2, 1, 1], 3)
      [2*t^7 + 2*t^5 + t^3]

  Python

      >>> from sage.all import *
      >>> from sage.combinat.ribbon_tableau import spin_rec
      >>> sp = SkewPartition
      >>> t = ZZ['t'].gen()
      >>> spin_rec(t, [], [[[], [Integer(3), Integer(3)]]], sp([[Integer(2), Integer(2), Integer(2)], []]), [Integer(2)], Integer(3))
      [t^4]
      >>> spin_rec(t, [[Integer(0)], [t**Integer(4)]], [[[Integer(2), Integer(1), Integer(1), Integer(1), Integer(1)], [Integer(0), Integer(3)]], [[Integer(2), Integer(2), Integer(2)], [Integer(3), Integer(0)]]], sp([[Integer(2), Integer(2), Integer(2), Integer(2), Integer(1)], []]), [Integer(2), Integer(1)], Integer(3))
      [t^5]
      >>> spin_rec(t, [], [[[], [Integer(3), Integer(3), Integer(0)]]], sp([[Integer(3), Integer(3)], []]), [Integer(2)], Integer(3))
      [t^2]
      >>> spin_rec(t, [[t**Integer(4)], [t**Integer(3)], [t**Integer(2)]], [[[Integer(2), Integer(2), Integer(2)], [Integer(0), Integer(0), Integer(3)]], [[Integer(3), Integer(2), Integer(1)], [Integer(0), Integer(3), Integer(0)]], [[Integer(3), Integer(3)], [Integer(3), Integer(0), Integer(0)]]], sp([[Integer(3), Integer(3), Integer(3)], []]), [Integer(2), Integer(1)], Integer(3))
      [t^6 + t^4 + t^2]
      >>> spin_rec(t, [[t**Integer(5)], [t**Integer(4)], [t**Integer(6) + t**Integer(4) + t**Integer(2)]], [[[Integer(2), Integer(2), Integer(2), Integer(2), Integer(1)], [Integer(0), Integer(0), Integer(3)]], [[Integer(3), Integer(3), Integer(1), Integer(1), Integer(1)], [Integer(0), Integer(3), Integer(0)]], [[Integer(3), Integer(3), Integer(3)], [Integer(3), Integer(0), Integer(0)]]], sp([[Integer(3), Integer(3), Integer(3), Integer(2), Integer(1)], []]), [Integer(2), Integer(1), Integer(1)], Integer(3))
      [2*t^7 + 2*t^5 + t^3]