Ticket #11290: trac_11290-nilCoxeter-cb.patch

File trac_11290-nilCoxeter-cb.patch, 11.1 KB (added by chrisjamesberg, 8 years ago)

Enjoy Jason!

  • doc/en/reference/algebras.rst

    # HG changeset patch
    # User Chris Berg
    # Date 1304798337 14400
    # Node ID a1c7dc1ad621fd35e20379909dc33e51db2cf3ae
    # Parent  fe8a0df7909f9e801af993e335d4a956a6d691e9
    trac_11290: Implementation of the Nil-Coxeter algebra and the non-commutative k-Schur functions in this algebra.
    
    diff --git a/doc/en/reference/algebras.rst b/doc/en/reference/algebras.rst
    a b Algebras 
    1414
    1515   sage/algebras/steenrod_algebra
    1616   sage/algebras/steenrod_algebra_element
    17    sage/algebras/steenrod_algebra_bases
    18  No newline at end of file
     17   sage/algebras/steenrod_algebra_bases
  • doc/en/reference/combinat/algebra.rst

    diff --git a/doc/en/reference/combinat/algebra.rst b/doc/en/reference/combinat/algebra.rst
    a b Combinatorial Algebras 
    1010   ../sage/combinat/schubert_polynomial
    1111   ../sage/combinat/partition_algebra
    1212   ../sage/algebras/iwahori_hecke_algebra
     13   ../sage/algebras/nil_coxeter
     14   ../sage/algebras/affine_nil_temperley_lieb
  • sage/algebras/affine_nil_temperley_lieb.py

    diff --git a/sage/algebras/affine_nil_temperley_lieb.py b/sage/algebras/affine_nil_temperley_lieb.py
    a b class AffineNilTemperleyLiebTypeA(Combin 
    177177
    178178    def product_on_basis(self, w, w1):
    179179        """
    180         Returns `a_w a_w1`, where `w` and `w1` are in the Weyl group
     180        Returns `a_w a_{w1}`, where `w` and `w1` are in the Weyl group
    181181        assuming that `w` does not contain any braid relations.
    182182
    183183        EXAMPLES::
  • sage/algebras/all.py

    diff --git a/sage/algebras/all.py b/sage/algebras/all.py
    a b from group_algebra import GroupAlgebra,  
    3737
    3838from iwahori_hecke_algebra import IwahoriHeckeAlgebraT
    3939from affine_nil_temperley_lieb import AffineNilTemperleyLiebTypeA
     40from nil_coxeter_algebra import NilCoxeterAlgebra
    4041   
    4142def is_R_algebra(Q, R):
    4243    # TODO: do something nontrivial when morphisms are defined.
  • sage/algebras/iwahori_hecke_algebra.py

    diff --git a/sage/algebras/iwahori_hecke_algebra.py b/sage/algebras/iwahori_hecke_algebra.py
    a b class IwahoriHeckeAlgebraT(Combinatorial 
    158158    """
    159159
    160160    @staticmethod
    161     def __classcall__(cls, W, q1, q2=-1, base_ring=None, prefix="T"):
     161    def __classcall_private__(cls, W, q1, q2=-1, base_ring=None, prefix="T"):
    162162        """
    163163        TESTS::
    164164
    class IwahoriHeckeAlgebraT(Combinatorial 
    177177        if base_ring is None:
    178178            base_ring = q1.parent()
    179179        q2 = base_ring(q2)
    180         return super(IwahoriHeckeAlgebraT, cls).__classcall__(cls, W, q1=q1, q2=q2, base_ring=base_ring, prefix=prefix)
     180        return super(IwahoriHeckeAlgebraT, cls).__classcall_private__(cls, W, q1=q1, q2=q2, base_ring=base_ring, prefix=prefix)
    181181
    182182    def __init__(self, W, q1, q2, base_ring, prefix):
    183183         """
  • new file sage/algebras/nil_coxeter_algebra.py

    diff --git a/sage/algebras/nil_coxeter_algebra.py b/sage/algebras/nil_coxeter_algebra.py
    new file mode 100644
    - +  
     1"""
     2Nil-Coxeter Algebra
     3"""
     4#*****************************************************************************
     5#  Copyright (C) 2011 Chris Berg <cberg at fields.utoronto.ca>
     6#                     Anne Schilling <anne at math.ucdavis.edu>
     7#
     8#  Distributed under the terms of the GNU General Public License (GPL)
     9#                  http://www.gnu.org/licenses/
     10#*****************************************************************************
     11from sage.algebras.iwahori_hecke_algebra import IwahoriHeckeAlgebraT
     12from sage.combinat.sf.sf import SymmetricFunctions
     13from sage.combinat.sf.kschur import kSchurFunctions
     14from sage.combinat.root_system.weyl_group import WeylGroup
     15from sage.misc.misc_c import prod
     16from sage.rings.rational_field import QQ
     17from sage.combinat.partition import Partitions
     18
     19class NilCoxeterAlgebra(IwahoriHeckeAlgebraT):
     20    r"""
     21    Construct the Nil-Coxeter algebra of given type. This is the algebra
     22    with generators `u_i` for every node `i` of the corresponding Dynkin
     23    diagram. It has the usual braid relations (from the Weyl group) as well
     24    as the quadratic relation `u_i^2 = 0`.
     25
     26    INPUT:
     27
     28    - ``W`` -- a Weyl group
     29
     30    OPTIONAL ARGUEMENTS:
     31   
     32    - ``base_ring`` -- a ring (default is the rational numbers)
     33    - ``prefix`` -- a label for the generators (default "u")
     34
     35    EXAMPLES::
     36
     37        sage: U = NilCoxeterAlgebra(WeylGroup(['A',3,1]))
     38        sage: u0, u1, u2, u3 = U.algebra_generators()
     39        sage: u1*u1
     40        0
     41        sage: u2*u1*u2 == u1*u2*u1
     42        True
     43        sage: U.an_element()
     44        u0
     45       
     46    """
     47
     48    def __init__(self, W, base_ring = QQ, prefix='u'):
     49        r"""
     50        Initiate the affine nil-Coxeter algebra corresponding to the Weyl group `W` over the base ring.
     51
     52        EXAMPLES::
     53
     54            sage: U = NilCoxeterAlgebra(WeylGroup(['A',3,1])); U
     55            The Nil-Coxeter Algebra of Type A3~ over Rational Field
     56            sage: TestSuite(U).run()
     57
     58            sage: U = NilCoxeterAlgebra(WeylGroup(['C',3]), ZZ); U
     59            The Nil-Coxeter Algebra of Type C3 over Integer Ring
     60            sage: TestSuite(U).run()
     61        """
     62       
     63        self._W = W
     64        self._n = W.n
     65        self._base_ring = base_ring
     66        self._cartan_type = W.cartan_type()
     67        IwahoriHeckeAlgebraT.__init__(self, W, 0, 0, base_ring, prefix=prefix)
     68
     69    def _repr_(self):
     70        r"""
     71        EXAMPLES ::
     72
     73            sage: NilCoxeterAlgebra(WeylGroup(['A',3,1])) # indirect doctest
     74            The Nil-Coxeter Algebra of Type A3~ over Rational Field
     75           
     76        """
     77
     78        return "The Nil-Coxeter Algebra of Type %s over %s"%(self._cartan_type._repr_(compact=True), self.base_ring())
     79
     80    def homogeneous_generator_noncommutative_variables(self, r):
     81        r"""
     82        Give the `r^{th}` homogeneous function inside the Nil-Coxeter algebra.
     83        In finite type `A` this is the sum of all decreasing elements of length `r`.
     84        In affine type `A` this is the sum of all cyclically decreasing elements of length `r`.
     85        This is only defined in finite type `A`, `B` and affine types `A^{(1)}`, `B^{(1)}`, `C^{(1)}`, `D^{(1)}`.
     86
     87        INPUT:
     88
     89        - ``r`` -- a positive integer at most the rank of the Weyl group
     90       
     91        EXAMPLES::
     92
     93            sage: U = NilCoxeterAlgebra(WeylGroup(['A',3,1]))
     94            sage: U.homogeneous_generator_noncommutative_variables(2)
     95            u1*u0 + u2*u0 + u0*u3 + u3*u2 + u3*u1 + u2*u1
     96
     97            sage: U = NilCoxeterAlgebra(WeylGroup(['B',4]))
     98            sage: U.homogeneous_generator_noncommutative_variables(2)
     99            u1*u2 + u2*u1 + u3*u1 + u4*u1 + u2*u3 + u3*u2 + u4*u2 + u3*u4 + u4*u3
     100
     101            sage: U = NilCoxeterAlgebra(WeylGroup(['C',3]))
     102            sage: U.homogeneous_generator_noncommutative_variables(2)
     103            Traceback (most recent call last):
     104            ...
     105            AssertionError: Analogue of symmetric functions in noncommutative variables is not defined in type ['C', 3]
     106
     107        TESTS::
     108
     109            sage: U = NilCoxeterAlgebra(WeylGroup(['B',3,1]))
     110            sage: U.homogeneous_generator_noncommutative_variables(-1)
     111            0
     112            sage: U.homogeneous_generator_noncommutative_variables(0)
     113            1
     114           
     115        """
     116        assert (len(self._cartan_type) == 2 and self._cartan_type[0] in ['A','B']) or (len(self._cartan_type) == 3 and self._cartan_type[2] == 1), "Analogue of symmetric functions in noncommutative variables is not defined in type %s"%(self._cartan_type)
     117        if r >= self._n:
     118            return self.zero()
     119        return self.sum_of_monomials(w for w in self._W.pieri_factors() if w.length() == r)
     120       
     121    def homogeneous_noncommutative_variables(self,la):
     122        r"""
     123        Give the homogeneous function indexed by `la`, viewed inside the Nil-Coxeter algebra.
     124        This is only defined in finite type `A`, `B` and affine types `A^{(1)}`, `B^{(1)}`, `C^{(1)}`, `D^{(1)}`.
     125
     126        INPUT:
     127
     128        - ``la`` -- a partition with first part bounded by the rank of the Weyl group
     129
     130        EXAMPLES::
     131
     132            sage: U = NilCoxeterAlgebra(WeylGroup(['B',2,1]))
     133            sage: U.homogeneous_noncommutative_variables([2,1])
     134            u1*u2*u0 + 2*u2*u1*u0 + u0*u2*u0 + u0*u2*u1 + u1*u2*u1 + u2*u1*u2 + u2*u0*u2 + u1*u0*u2
     135
     136        TESTS::
     137
     138            sage: U = NilCoxeterAlgebra(WeylGroup(['B',2,1]))
     139            sage: U.homogeneous_noncommutative_variables([])
     140            1
     141           
     142        """
     143        return prod(self.homogeneous_generator_noncommutative_variables(p) for p in la)
     144
     145    def k_schur_noncommutative_variables(self, la):
     146        r"""
     147        In type `A^{(1)}` this is the `k`-Schur function in noncommutative variables defined by Thomas Lam.
     148
     149        REFERENCES:
     150
     151           .. [Lam2005] T. Lam, Affine Stanley symmetric functions, Amer. J. Math.  128  (2006),  no. 6, 1553--1586.
     152
     153           .. [LSS2010] T. Lam, A. Schilling, M. Shimozono, Schubert Polynomials for the affine Grassmannian of the symplectic
     154                        group, Mathematische Zeitschrift 264(4) (2010) 765-811
     155
     156        This function is only defined in finite type `A`, `B` and affine types `A^{(1)}`, `B^{(1)}`, `C^{(1)}`, `D^{(1)}`.
     157
     158
     159        INPUT:
     160
     161        - ``la`` -- a partition with first part bounded by the rank of the Weyl group
     162
     163        EXAMPLES::
     164       
     165            sage: A = NilCoxeterAlgebra(WeylGroup(['A',3,1]))
     166            sage: A.k_schur_noncommutative_variables([2,2])
     167            u0*u3*u1*u0 + u3*u1*u2*u0 + u1*u2*u0*u1 + u3*u2*u0*u3 + u2*u0*u3*u1 + u2*u3*u1*u2
     168
     169        TESTS::
     170
     171            sage: A = NilCoxeterAlgebra(WeylGroup(['A',3,1]))
     172            sage: A.k_schur_noncommutative_variables([])
     173            1
     174
     175            sage: A.k_schur_noncommutative_variables([1,2])
     176            Traceback (most recent call last):
     177            ...
     178            AssertionError: [1, 2] is not a partition.
     179
     180            sage: A.k_schur_noncommutative_variables([4,2])
     181            Traceback (most recent call last):
     182            ...
     183            AssertionError: [4, 2] is not a 3-bounded partition.
     184
     185            sage: C = NilCoxeterAlgebra(WeylGroup(['C',3,1]))
     186            sage: C.k_schur_noncommutative_variables([2,2])
     187            Traceback (most recent call last):
     188            ...
     189            AssertionError: Weyl Group of type ['C', 3, 1] (as a matrix group acting on the root space) is not affine type A.
     190
     191
     192        """
     193        assert self._cartan_type[0] == 'A' and len(self._cartan_type) == 3 and self._cartan_type[2] == 1, "%s is not affine type A."%(self._W)
     194        assert la in Partitions(), "%s is not a partition."%(la)
     195        assert (len(la) == 0 or la[0] < self._W.n), "%s is not a %s-bounded partition."%(la, self._W.n-1)
     196        ks = kSchurFunctions(self._base_ring,self._n-1,1);
     197        SF = SymmetricFunctions(ks.base_ring())
     198        h = SF.homogeneous()
     199        f = h(ks[la])
     200        return sum(f.coefficient(x)*self.homogeneous_noncommutative_variables(x) for x in f.support())