Ticket #11122: trac_11122-demazure_product-cs.patch

File trac_11122-demazure_product-cs.patch, 2.2 KB (added by stumpc5, 11 years ago)
  • sage/categories/coxeter_groups.py

    # HG changeset patch
    # Parent b59ad7e66e832493bafef8ddfc5041aeab0c0859
    # 11122 Implementation of the Demazure products in Coxeter groups
    
    diff --git a/sage/categories/coxeter_groups.py b/sage/categories/coxeter_groups.py
    a b class CoxeterGroups(Category): 
    555555            from sage.sets.family import Family
    556556            return Family(self.index_set(), lambda i: self.simple_projection(i, side = side, toward_max = toward_max))
    557557
     558        def demazure_product(self, Q):
     559            r"""
     560            Returns the Demazure product of the list ``Q`` in ``self``.
     561
     562            The Demazure product `\delta` is recursively defined as follows:
     563            - if ``Q`` is empty: `\delta(Q) = 1`
     564            - if ``Q` equals `Q' \cup \{ s \}`:
     565                - if `\ell(\delta(Q')s) < \ell(\delta(Q'))`: `\delta(Q')`
     566                - if `\ell(\delta(Q')s) > \ell(\delta(Q'))`: `\delta(Q')s`
     567
     568            EXAMPLES::
     569
     570                sage: W = CoxeterGroup(['A',2],index_set=[1,2])
     571
     572                sage: w = W.demazure_product([2,2,1])
     573                sage: w.reduced_word()
     574                word: 21
     575
     576                sage: w = W.demazure_product([2,1,2,1,2])
     577                sage: w.reduced_word()
     578                word: 121
     579
     580                sage: W = CoxeterGroup(['B',2],index_set=[1,2])
     581
     582                sage: w = W.demazure_product([2,1,2,1,2])
     583                sage: w.reduced_word()
     584                word: 2121
     585
     586            """
     587            Q = [ x for x in Q ]
     588            I = self.index_set()
     589            if not all( i in I for i in Q ):
     590                raise ValueError, "All elements in Q = %s must be contained in the index set of %s"%(Q,self)
     591            if len(Q) == 0:
     592                return self.one()
     593            else:
     594                i = Q.pop(-1)
     595                w = self.demazure_product(Q)
     596                if i in w.descents(side='right'):
     597                    return w
     598                else:
     599                    return w.apply_simple_reflection(i,side="right")
     600
    558601        def bruhat_interval(self, x, y):
    559602            """
    560603            Returns the list of t such that x <= t <= y.