Ejemplo n.º 1
0
    def __init__(self, R, cartan_matrix, wt, prefix):
        """
        Initialize ``self``.
        """
        self._cartan_matrix = cartan_matrix
        self._weight = wt
        self._d = sum(wt)

        # Reduced words
        #red_words = Family(Permutations(self._d), lambda p: tuple(p.reduced_word()))
        red_words = FiniteEnumeratedSet([tuple(p.reduced_word())
                                         for p in Permutations(self._d)])
        red_words.rename("reduced words of S_{}".format(self._d))
        # The monomials
        M = FreeAbelianMonoid(self._d, names=['x%s'%i for i in range(1, self._d+1)])
        # Idempotents (i.e. the colors of the strands)
        index_set = self._cartan_matrix.index_set()
        P = Permutations(sum([[index_set[i]]*v for i,v in enumerate(wt)],[]))
        I = cartesian_product([red_words, M, P])
        CombinatorialFreeModule.__init__(self, R, I, prefix=prefix,
                                         monomial_key=KLRAlgebra._monomial_key,
                                         category=Algebras(R).WithBasis().Graded())