Esempio n. 1
0
        def coproduct_on_basis(self, t):
            r"""
            Return the coproduct of the basis element indexed by ``t``.

            EXAMPLES::

                sage: FSym = algebras.FSym(QQ)
                sage: G = FSym.G()
                sage: t = StandardTableau([[1,2,5], [3,4]])
                sage: G.coproduct_on_basis(t)
                G[] # G[125|34] + G[1] # G[12|34] + G[1] # G[124|3]
                 + G[1|2] # G[13|2] + G[12] # G[12|3] + G[12] # G[123]
                 + G[12|34] # G[1] + G[123] # G[12] + G[125|34] # G[]
                 + G[13|2] # G[1|2] + G[13|2] # G[12] + G[134|2] # G[1]
            """
            # we use the duality to compute this
            n = t.size()
            L = []
            dual_basis = self.dual_basis()
            for i in range(n + 1):
                for t1 in StandardTableaux(i):
                    for t2 in StandardTableaux(n - i):
                        coeff = (dual_basis[t1] * dual_basis[t2])[t]
                        if coeff:
                            L.append(((t1, t2), coeff))
            TT = self.tensor_square()
            return TT.sum_of_terms(L)
Esempio n. 2
0
        def basis(self, degree=None):
            r"""
            The basis elements (optionally: of the specified degree).

            OUTPUT: Family

            EXAMPLES::

                sage: FSym = algebras.FSym(QQ)
                sage: TG = FSym.G()
                sage: TG.basis()
                Lazy family (Term map from Standard tableaux to Hopf algebra of standard tableaux
                 over the Rational Field in the Fundamental basis(i))_{i in Standard tableaux}
                sage: TG.basis().keys()
                Standard tableaux
                sage: TG.basis(degree=3).keys()
                Standard tableaux of size 3
                sage: TG.basis(degree=3).list()
                [G[123], G[13|2], G[12|3], G[1|2|3]]
            """
            from sage.combinat.family import Family
            if degree is None:
                return Family(self._indices, self.monomial)
            else:
                return Family(StandardTableaux(degree), self.monomial)
Esempio n. 3
0
        def product_on_basis(self, t1, t2):
            r"""
            Return the product of basis elements indexed by ``t1`` and ``t2``.

            EXAMPLES::

                sage: FSym = algebras.FSym(QQ)
                sage: G = FSym.G()
                sage: t1 = StandardTableau([[1,2], [3]])
                sage: t2 = StandardTableau([[1,2,3]])
                sage: G.product_on_basis(t1, t2)
                G[12456|3] + G[1256|3|4] + G[1256|34] + G[126|35|4]

                sage: t1 = StandardTableau([[1],[2]])
                sage: t2 = StandardTableau([[1,2]])
                sage: G.product_on_basis(t1, t2)
                G[134|2] + G[14|2|3]

                sage: t1 = StandardTableau([[1,2],[3]])
                sage: t2 = StandardTableau([[1],[2]])
                sage: G.product_on_basis(t1, t2)
                G[12|3|4|5] + G[12|34|5] + G[124|3|5] + G[124|35]
            """
            n = t1.size()
            m = n + t2.size()
            tableaux = []
            for t in StandardTableaux(m):
                if t.restrict(n) == t1 and standardize(
                        t.anti_restrict(n).rectify()) == t2:
                    tableaux.append(t)
            return self.sum_of_monomials(tableaux)
Esempio n. 4
0
    def __init__(self, alg, graded=True):
        r"""
        Initialize ``self``.

        EXAMPLES::

            sage: G = algebras.FSym(QQ).G()
            sage: TestSuite(G).run()  # long time

        Checks for the antipode::

            sage: FSym = algebras.FSym(QQ)
            sage: G = FSym.G()
            sage: for b in G.basis(degree=3):
            ....:     print("%s : %s" % (b, b.antipode()))
            G[123] : -G[1|2|3]
            G[13|2] : -G[13|2]
            G[12|3] : -G[12|3]
            G[1|2|3] : -G[123]

            sage: F = FSym.dual().F()
            sage: for b in F.basis(degree=3):
            ....:     print("%s : %s" % (b, b.antipode()))
            F[123] : -F[1|2|3]
            F[13|2] : -F[13|2]
            F[12|3] : -F[12|3]
            F[1|2|3] : -F[123]
        """
        CombinatorialFreeModule.__init__(self,
                                         alg.base_ring(),
                                         StandardTableaux(),
                                         category=FSymBases(alg),
                                         bracket="",
                                         prefix=self._prefix)
def syt_promotion(lam):
    r"""
    Return the invertible finite discrete dynamical system
    consisting of all standard tableaux of shape ``lam`` (a
    given partition) and evolving according to promotion.

    EXAMPLES::

        sage: F = finite_dynamical_systems.syt_promotion([4, 4, 4])
        sage: sorted(F.orbit_lengths())
        [3, 3, 4, 4, 4, 6, 6, 6, 6, 12, 12, 12, 12, 12, 12,
         12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
         12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
         12, 12, 12, 12, 12]
        sage: G = finite_dynamical_systems.syt_promotion([4, 3, 1])
        sage: sorted(G.orbit_lengths())
        [16, 22, 32]
        sage: G.verify_inverse_evolution()
        True
    """
    from sage.combinat.partition import Partition
    lam = Partition(lam)
    from sage.combinat.tableau import StandardTableaux
    X = StandardTableaux(lam)
    return InvertibleFiniteDynamicalSystem(
        X, lambda T: T.promotion(), inverse=lambda T: T.promotion_inverse())
Esempio n. 6
0
def standardize(t):
    r"""
    Return the standard tableau corresponding to a given
    semistandard tableau ``t`` with no repeated entries.

    .. NOTE::

        This is an optimized version of :meth:`Tableau.standardization`
        for computations in `FSym` by using the assumption of no
        repeated entries in ``t``.

    EXAMPLES::

        sage: from sage.combinat.chas.fsym import standardize
        sage: t = Tableau([[1,3,5,7],[2,4,8],[9]])
        sage: standardize(t)
        [[1, 3, 5, 6], [2, 4, 7], [8]]
        sage: t = Tableau([[3,8,9,15],[5,10,12],[133]])
        sage: standardize(t)
        [[1, 3, 4, 7], [2, 5, 6], [8]]

    Returns an equal tableau if already standard::

        sage: t = Tableau([[1,3,4,5],[2,6,7],[8]])
        sage: standardize(t)
        [[1, 3, 4, 5], [2, 6, 7], [8]]
        sage: standardize(t) == t
        True
    """
    A = sorted(sum(t, ()))
    std = {j: i + 1 for i, j in enumerate(A)}
    ST = StandardTableaux()
    return ST([[std[i] for i in row] for row in t])
Esempio n. 7
0
    def cardinality(self):
        r"""
        Return the number of all standard super tableaux of size ``n``.

        The standard super tableaux of size `n` are in bijection with the
        corresponding standard tableaux (under the alphabet relabeling). Refer
        :class:`sage.combinat.tableau.StandardTableaux_size` for more details.

        EXAMPLES::

            sage: StandardSuperTableaux(3).cardinality()
            4
            sage: ns = [1,2,3,4,5,6]
            sage: sts = [StandardSuperTableaux(n) for n in ns]
            sage: all(st.cardinality() == len(st.list()) for st in sts)
            True
            sage: StandardSuperTableaux(50).cardinality()  # long time
            27886995605342342839104615869259776

        TESTS::

            sage: def cardinality_using_hook_formula(n):
            ....:     c = 0
            ....:     for p in Partitions(n):
            ....:         c += StandardSuperTableaux(p).cardinality()
            ....:     return c
            sage: all(cardinality_using_hook_formula(i) ==
            ....:       StandardSuperTableaux(i).cardinality()
            ....:       for i in range(10))
            True
        """
        return StandardTableaux(self.size).cardinality()
    def _tableau_dict(self):
        r"""
        A dictionary pairing the vertices of the underlying Yang-Baxter
        graph with standard tableau.

        EXAMPLES::

            sage: orth = SymmetricGroupRepresentation([3,2], "orthogonal")
            sage: orth._tableau_dict
            {(0, 2, 1, -1, 0): [[1, 3, 4], [2, 5]], (2, 0, -1, 1, 0): [[1, 2, 5], [3, 4]], (2, 0, 1, -1, 0): [[1, 3, 5], [2, 4]], (0, 2, -1, 1, 0): [[1, 2, 4], [3, 5]], (0, -1, 2, 1, 0): [[1, 2, 3], [4, 5]]}
        """
        # construct a dictionary pairing vertices with tableau
        t = StandardTableaux(self._partition).last()
        tableau_dict = {self._yang_baxter_graph.root():t}
        for (u,w,(i,beta)) in self._yang_baxter_graph._edges_in_bfs():
            # TODO: improve the following
            si = PermutationGroupElement((i,i+1))
            tableau_dict[w] = Tableau([map(si, row) for row in tableau_dict[u]])
        return tableau_dict
Esempio n. 9
0
    def __iter__(self):
        r"""
        An iterator for the standard super tableaux associated to the
        shape `p` of ``self``.

        EXAMPLES::

            sage: [t for t in StandardSuperTableaux([2,2])]
            [[[1', 2'], [1, 2]], [[1', 1], [2', 2]]]
            sage: [t for t in StandardSuperTableaux([3,2])]
            [[[1', 2', 3'], [1, 2]],
             [[1', 1, 3'], [2', 2]],
             [[1', 2', 2], [1, 3']],
             [[1', 1, 2], [2', 3']],
             [[1', 1, 2'], [2, 3']]]
            sage: st = StandardSuperTableaux([2,1])
            sage: st[0].parent() is st
            True
        """
        pi = self.shape
        for tableau in StandardTableaux(pi):
            yield self.element_class(self, [[PrimedEntry(ZZ(val)/2) for val in row]
                                            for row in tableau])
Esempio n. 10
0
    def cardinality(self):
        r"""
        Return the number of standard super tableaux of given shape.

        The standard super tableaux of a fixed shape `p` are in bijection with
        the corresponding standard tableaux (under the alphabet relabeling).
        Refer :class:`sage.combinat.tableau.StandardTableaux_shape` for more
        details.

        EXAMPLES::

            sage: StandardSuperTableaux([3,2,1]).cardinality()
            16
            sage: StandardSuperTableaux([2,2]).cardinality()
            2
            sage: StandardSuperTableaux([5]).cardinality()
            1
            sage: StandardSuperTableaux([6,5,5,3]).cardinality()
            6651216
            sage: StandardSuperTableaux([]).cardinality()
            1
        """
        pi = self.shape
        return StandardTableaux(pi).cardinality()
Esempio n. 11
0
 def s_to_F_on_basis(mu):
     return self.sum_of_monomials(StandardTableaux(mu))
Esempio n. 12
0
 def R_to_G_on_basis(alpha):
     return self.sum_of_monomials(
         ST(t) for t in StandardTableaux(alpha.size())
         if descent_composition(t) == alpha)
Esempio n. 13
0
 def f(partition):
     n = partition.size()
     return (StandardTableaux(partition).cardinality() * t**n /
             factorial(n))