示例#1
0
    def __init__(self, R, n, q=None):
        """
        TESTS::
        
            sage: HeckeAlgebraSymmetricGroupT(QQ, 3)
            Hecke algebra of the symmetric group of order 3 on the T basis over Univariate Polynomial Ring in q over Rational Field
        
        ::
        
            sage: HeckeAlgebraSymmetricGroupT(QQ, 3, q=1)
            Hecke algebra of the symmetric group of order 3 with q=1 on the T basis over Rational Field
        """
        self.n = n
        self._basis_keys = permutation.Permutations(n)
        self._name = "Hecke algebra of the symmetric group of order %s"%self.n
        self._one = permutation.Permutation(range(1,n+1))

        if q is None:
            q = PolynomialRing(R, 'q').gen()
            R = q.parent()
        else:
            if q not in R:
                raise ValueError, "q must be in R (= %s)"%R
            self._name += " with q=%s"%q

        self._q = q
        
        CombinatorialAlgebra.__init__(self, R)
        # _repr_ customization: output the basis element indexed by [1,2,3] as [1,2,3]
        self.print_options(prefix="")
示例#2
0
def graph_implementation_rec(skp, weight, length, function):
    """
    TESTS::

        sage: from sage.combinat.ribbon_tableau import graph_implementation_rec, list_rec
        sage: graph_implementation_rec(SkewPartition([[1], []]), [1], 1, list_rec)
        [[[], [[1]]]]
        sage: graph_implementation_rec(SkewPartition([[2, 1], []]), [1, 2], 1, list_rec)
        [[[], [[2], [1, 2]]]]
        sage: graph_implementation_rec(SkewPartition([[], []]), [0], 1, list_rec)
        [[[], []]]
    """
    if sum(weight) == 0:
        weight = []

    partp = skp[0].conjugate()

    ## Some tests in order to know if the shape and the weight are compatible.
    if weight != [] and weight[-1] <= len(partp):
        perms = permutation.Permutations([0] * (len(partp) - weight[-1]) +
                                         [length] * (weight[-1])).list()
    else:
        return function([], [], skp, weight, length)

    selection = []

    for j in range(len(perms)):
        retire = [(partp[i] + len(partp) - (i + 1) - perms[j][i])
                  for i in range(len(partp))]
        retire.sort(reverse=True)
        retire = [retire[i] - len(partp) + (i + 1) for i in range(len(retire))]

        if retire[-1] >= 0 and retire == [i for i in reversed(sorted(retire))]:
            retire = Partition([x for x in retire if x != 0]).conjugate()

            # Cutting branches if the retired partition has a line strictly included into the inner one
            append = True
            padded_retire = retire + [0] * (len(skp[1]) - len(retire))
            for k in range(len(skp[1])):
                if padded_retire[k] - skp[1][k] < 0:
                    append = False
                    break
            if append:
                selection.append([retire, perms[j]])

    #selection contains the list of current nodes
    #print "selection", selection

    if len(weight) == 1:
        return function([], selection, skp, weight, length)
    else:
        #The recursive calls permit us to construct the list of the sons
        #of all current nodes in selection
        a = [
            graph_implementation_rec([p[0], skp[1]], weight[:-1], length,
                                     function) for p in selection
        ]
        #print "a", a
        return function(a, selection, skp, weight, length)
示例#3
0
    def _conjugacy_classes_representatives_underlying_group(self):
        r"""
        Return a complete list of representatives of conjugacy
        classes of the underlying symmetric group.

        EXAMPLES::

            sage: SG=SymmetricGroupAlgebra(ZZ,3)
            sage: SG._conjugacy_classes_representatives_underlying_group()
            [[2, 3, 1], [2, 1, 3], [1, 2, 3]]
        """
        return [permutation.Permutations(self.n).element_in_conjugacy_classes(nu) for nu in partition.Partitions(self.n)]
示例#4
0
    def __init__(self, R, n):
        """
        TESTS::

            sage: QS3 = SymmetricGroupAlgebra(QQ, 3)
            sage: TestSuite(QS3).run()
        """
        self.n = n
        self._name = "Symmetric group algebra of order %s"%self.n
        CombinatorialFreeModule.__init__(self, R, permutation.Permutations(n), prefix='', latex_prefix='', category = (GroupAlgebras(R),FiniteDimensionalAlgebrasWithBasis(R)))
        # This is questionable, and won't be inherited properly
        if n > 0:
            S = SymmetricGroupAlgebra(R, n-1)
            self.register_coercion(S.canonical_embedding(self))
示例#5
0
    def __init__(self, R):
        """
        EXAMPLES::

            sage: X = SchubertPolynomialRing(QQ)
            sage: X == loads(dumps(X))
            True
        """
        self._name = "Schubert polynomial ring with X basis"
        self._repr_option_bracket = False
        self._one = permutation.Permutation([1])
        CombinatorialAlgebra.__init__(self,
                                      R,
                                      cc=permutation.Permutations(),
                                      category=GradedAlgebrasWithBasis(R))
        self.print_options(prefix='X')
示例#6
0
 def _coerce_start(self, x):
     """
     EXAMPLES::
     
         sage: H3 = HeckeAlgebraSymmetricGroupT(QQ, 3)
         sage: H3._coerce_start([2,1])
         T[2, 1, 3]
     """
     ###################################################
     # Coerce permutations of size smaller that self.n #
     ###################################################
     if x == []:
         return self( self._one )
     if len(x) < self.n and x in permutation.Permutations():
         return self( list(x) + range(len(x)+1, self.n+1) )
     raise TypeError
示例#7
0
    def divided_difference(self, i):
        """
        EXAMPLES::

            sage: X = SchubertPolynomialRing(ZZ)
            sage: a = X([3,2,1])
            sage: a.divided_difference(1)
            X[2, 3, 1]
            sage: a.divided_difference([3,2,1])
            X[1]
        """
        if isinstance(i, Integer):
            return symmetrica.divdiff_schubert(i, self)
        elif i in permutation.Permutations():
            return symmetrica.divdiff_perm_schubert(i, self)
        else:
            raise TypeError, "i must either be an integer or permutation"