Ticket #14763: trac_14763-suter_slides-dg.patch

File trac_14763-suter_slides-dg.patch, 7.8 KB (added by darij, 8 years ago)

Updated version, now also computes the inverse of the Suter slide without iterating it n-1 times

  • sage/combinat/partition.py

    # HG changeset patch
    # User darij grinberg <darijgrinberg@gmail.com>
    # Date 1371534119 25200
    # Node ID 32b718231a274c930c3f1795be225243d7b1319c
    # Parent  ad33c7dc3744f30146c26b6af84f1371b9839b11
    trac #14763: Suter's diagonal slides and minor improvements to partition.py
    
    diff --git a/sage/combinat/partition.py b/sage/combinat/partition.py
    a b class Partition(CombinatorialObject, Ele 
    16221622                conj.extend([i]*(p[i-1] - p[i]))
    16231623            return Partition(conj)
    16241624
     1625    def suter_diagonal_slide(self, n, iteration=1):
     1626        r"""
     1627        Return the image of the partition ``self`` under Suter's
     1628        diagonal slide `\sigma_n` on `Y_n`, where the notations used
     1629        are those defined in [Sut2002]_. (See also below for their
     1630        definitions. While [Sut2002]_ gives two *non-equivalent*
     1631        definitions for `\sigma_n`, we are using the formulaic one,
     1632        not the one using the four steps.)
     1633       
     1634        INPUT:
     1635
     1636        - ``n`` -- nonnegative integer.
     1637
     1638        - ``iteration`` -- an optional keyword argument which
     1639          defaults to `1`. It should be an integer, and
     1640          determines how often `\sigma_n` is to be applied.
     1641
     1642        OUTPUT:
     1643       
     1644        The result of applying Suter's diagonal slide `\sigma_n` to
     1645        ``self``, assuming that ``self`` lies in `Y_n`. If the
     1646        optional argument ``iteration`` is set, then the slide
     1647        `\sigma_n` is applied not just once, but ``iteration`` times
     1648        (note that ``iteration`` is allowed to be negative, since
     1649        the slide has finite order).
     1650
     1651        Here is how `Y_n` and `\sigma_n` are defined:
     1652
     1653        The set `Y_n` is defined as the set of all partitions
     1654        `\lambda` such that the hook length of the northwesternmost
     1655        cell of `\lambda` (i. e., the cell with coordinates `(1, 1)`
     1656        if we start counting from `1`) is less than `n`. (This is
     1657        considered true if `\lambda` is empty.)
     1658
     1659        The map `\sigma_n` sends a partition
     1660        `(\lambda_1, \lambda_2, ..., \lambda_m) \in Y_n` with length
     1661        `m` to the partition
     1662        `(\lambda_2 + 1, \lambda_3 + 1, ..., \lambda_m + 1,
     1663        \underbrace{1, 1, ..., 1}_{n - m - \lambda_1\text{ ones}})`.
     1664        In other words, it pads the partition with trailing zeroes
     1665        until it has length `n - \lambda_1`, then removes its first
     1666        part, and finally adds `1` to each part.
     1667
     1668        By Theorem 2.1 of [Sut2002]_, the dihedral group `D_n` with
     1669        `2n` elements acts on `Y_n` by letting the primitive rotation
     1670        act as `\sigma_n` and the reflection act as conjugation of
     1671        partitions (:meth:`conjugate()`). This action is faithful if
     1672        `n \geq 3`.
     1673
     1674        EXAMPLES:
     1675
     1676            sage: Partition([5,4,1]).suter_diagonal_slide(8)
     1677            [5, 2]
     1678            sage: Partition([5,4,1]).suter_diagonal_slide(9)
     1679            [5, 2, 1]
     1680            sage: Partition([]).suter_diagonal_slide(7)
     1681            [1, 1, 1, 1, 1, 1]
     1682            sage: Partition([]).suter_diagonal_slide(1)
     1683            []
     1684            sage: Partition([]).suter_diagonal_slide(7, iteration=-1)
     1685            [6]
     1686            sage: Partition([]).suter_diagonal_slide(1, iteration=-1)
     1687            []
     1688            sage: P7 = Partitions(7)
     1689            sage: all( p == p.suter_diagonal_slide(9, iteration=-1).suter_diagonal_slide(9)
     1690            ....:      for p in P7 )
     1691            True
     1692            sage: all( p == p.suter_diagonal_slide(9, iteration=3)
     1693            ....:            .suter_diagonal_slide(9, iteration=3)
     1694            ....:            .suter_diagonal_slide(9, iteration=3)
     1695            ....:      for p in P7 )
     1696            True
     1697            sage: all( p == p.suter_diagonal_slide(9, iteration=6)
     1698            ....:            .suter_diagonal_slide(9, iteration=6)
     1699            ....:            .suter_diagonal_slide(9, iteration=6)
     1700            ....:      for p in P7 )
     1701            True
     1702            sage: all( p == p.suter_diagonal_slide(9, iteration=-1)
     1703            ....:            .suter_diagonal_slide(9, iteration=1)
     1704            ....:      for p in P7 )
     1705            True
     1706            sage: all( p.suter_diagonal_slide(8).conjugate()
     1707            ....:      == p.conjugate().suter_diagonal_slide(8, iteration=-1)
     1708            ....:      for p in P7 )      # Check of [Sut2002]_'s assertion
     1709            ....:                         # that \sigma_n(\sigma_n(\lambda')') = \lambda
     1710            True
     1711            sage: P5 = Partitions(5)
     1712            sage: all( all( (p.suter_diagonal_slide(6) in q.suter_diagonal_slide(6).down())
     1713            ....:           or (q.suter_diagonal_slide(6) in p.suter_diagonal_slide(6).down())
     1714            ....:           for p in q.down() )
     1715            ....:      for q in P5 )    # Claim 1 in [Sut2002]_.
     1716            True
     1717
     1718        REFERENCES:
     1719       
     1720        .. [Sut2002] Ruedi Suter.
     1721           *Young’s Lattice and Dihedral Symmetries*.
     1722           Europ. J. Combinatorics (2002) 23, 233–238.
     1723           http://www.sciencedirect.com/science/article/pii/S0195669801905414
     1724        """
     1725        if iteration == 1:
     1726            # Suter's map \sigma_n
     1727            leng = self.length()
     1728            if leng == 0:   # Taking extra care about the empty partition.
     1729                return Partition([1] * (n - 1))
     1730            res = [i + 1 for i in self._list[1:]]
     1731            res += [1] * (n - leng - self._list[0])
     1732            return Partition(res)
     1733        elif iteration == -1:
     1734            # inverse map \sigma_n^{-1}
     1735            leng = self.length()
     1736            if leng == 0:   # Taking extra care about the empty partition.
     1737                return Partition([n - 1])
     1738            res = [n - leng - 1]
     1739            res.extend([i - 1 for i in self._list if i > 1])
     1740            return Partition(res)
     1741        # Arbitrary number of iterations
     1742        iteration = iteration % n
     1743        sc = self
     1744        if iteration < n/2:
     1745            while iteration > 0:
     1746                iteration -= 1
     1747                sc = sc.suter_diagonal_slide(n)
     1748        else:
     1749            iteration = -iteration
     1750            while iteration < 0:
     1751                iteration += 1
     1752                sc = sc.suter_diagonal_slide(n, iteration=-1)
     1753        return sc
     1754
    16251755    @combinatorial_map(name="reading tableau")
    16261756    def reading_tableau(self):
    16271757        r"""
    1628         Return the reading tableau of the reading word under the
    1629         Robinson-Schensted correspondence of the (standard) tableau `T` labeled
    1630         down (in English convention) each column to the shape of ``self``.
     1758        Return the RSK recording tableau of the reading word of the
     1759        (standard) tableau `T` labeled down (in English convention)
     1760        each column to the shape of ``self``.
    16311761
    16321762        For an example of the tableau `T`, consider the partition
    16331763        `\lambda = (3,2,1)`, then we have::
    class Partition(CombinatorialObject, Ele 
    16691799        r"""
    16701800        Return the Garnir tableau of shape ``self`` corresponding to the cell
    16711801        ``cell``. If ``cell`` `= (a,c)` then `(a+1,c)` must belong to the
    1672         diagram of the :class:`PartitionTuple`.
    1673 
    1674         The Garnir tableau play an important role in integral and
     1802        diagram of the :class:`Partition` ``self``.
     1803
     1804        The Garnir tableaux play an important role in integral and
    16751805        non-semisimple representation theory because they determine the
    16761806        "straightening" rules for the Specht modules over an arbitrary ring.
    16771807
    1678         The Garnir tableau are the "first" non-standard tableaux which arise
     1808        The Garnir tableaux are the "first" non-standard tableaux which arise
    16791809        when you act by simple transpositions. If `(a,c)` is a cell in the
    16801810        Young diagram of a partition, which is not at the bottom of its
    16811811        column, then the corresponding Garnir tableau has the integers