Path: blob/master/src/sage/algebras/nil_coxeter_algebra.py
8818 views
"""1Nil-Coxeter Algebra2"""3#*****************************************************************************4# Copyright (C) 2011 Chris Berg <cberg at fields.utoronto.ca>5# Anne Schilling <anne at math.ucdavis.edu>6#7# Distributed under the terms of the GNU General Public License (GPL)8# http://www.gnu.org/licenses/9#*****************************************************************************10from sage.algebras.iwahori_hecke_algebra import IwahoriHeckeAlgebra11from sage.combinat.sf.sf import SymmetricFunctions12from sage.combinat.sf.kschur import kSchurFunctions13from sage.misc.misc_c import prod14from sage.rings.rational_field import QQ15from sage.combinat.partition import Partitions1617class NilCoxeterAlgebra(IwahoriHeckeAlgebra.T):18r"""19Construct the Nil-Coxeter algebra of given type. This is the algebra20with generators `u_i` for every node `i` of the corresponding Dynkin21diagram. It has the usual braid relations (from the Weyl group) as well22as the quadratic relation `u_i^2 = 0`.2324INPUT:2526- ``W`` -- a Weyl group2728OPTIONAL ARGUEMENTS:2930- ``base_ring`` -- a ring (default is the rational numbers)31- ``prefix`` -- a label for the generators (default "u")3233EXAMPLES::3435sage: U = NilCoxeterAlgebra(WeylGroup(['A',3,1]))36sage: u0, u1, u2, u3 = U.algebra_generators()37sage: u1*u138039sage: u2*u1*u2 == u1*u2*u140True41sage: U.an_element()42u[0,1,2,3] + 3*u[0,1] + 2*u[0] + 143"""4445def __init__(self, W, base_ring = QQ, prefix='u'):46r"""47Initiate the affine nil-Coxeter algebra corresponding to the Weyl48group `W` over the base ring.4950EXAMPLES::5152sage: U = NilCoxeterAlgebra(WeylGroup(['A',3,1])); U53The Nil-Coxeter Algebra of Type A3~ over Rational Field54sage: TestSuite(U).run()5556sage: U = NilCoxeterAlgebra(WeylGroup(['C',3]), ZZ); U57The Nil-Coxeter Algebra of Type C3 over Integer Ring58sage: TestSuite(U).run()59"""6061self._W = W62self._n = W.n63self._base_ring = base_ring64self._cartan_type = W.cartan_type()65H = IwahoriHeckeAlgebra(W, 0, 0, base_ring=base_ring)66super(IwahoriHeckeAlgebra.T,self).__init__(H, prefix=prefix)6768def _repr_(self):69r"""70EXAMPLES ::7172sage: NilCoxeterAlgebra(WeylGroup(['A',3,1])) # indirect doctest73The Nil-Coxeter Algebra of Type A3~ over Rational Field7475"""7677return "The Nil-Coxeter Algebra of Type %s over %s"%(self._cartan_type._repr_(compact=True), self.base_ring())7879def homogeneous_generator_noncommutative_variables(self, r):80r"""81Give the `r^{th}` homogeneous function inside the Nil-Coxeter algebra.82In finite type `A` this is the sum of all decreasing elements of length `r`.83In affine type `A` this is the sum of all cyclically decreasing elements of length `r`.84This is only defined in finite type `A`, `B` and affine types `A^{(1)}`, `B^{(1)}`, `C^{(1)}`, `D^{(1)}`.8586INPUT:8788- ``r`` -- a positive integer at most the rank of the Weyl group8990EXAMPLES::9192sage: U = NilCoxeterAlgebra(WeylGroup(['A',3,1]))93sage: U.homogeneous_generator_noncommutative_variables(2)94u[1,0] + u[2,0] + u[0,3] + u[3,2] + u[3,1] + u[2,1]9596sage: U = NilCoxeterAlgebra(WeylGroup(['B',4]))97sage: U.homogeneous_generator_noncommutative_variables(2)98u[1,2] + u[2,1] + u[3,1] + u[4,1] + u[2,3] + u[3,2] + u[4,2] + u[3,4] + u[4,3]99100sage: U = NilCoxeterAlgebra(WeylGroup(['C',3]))101sage: U.homogeneous_generator_noncommutative_variables(2)102Traceback (most recent call last):103...104AssertionError: Analogue of symmetric functions in noncommutative variables is not defined in type ['C', 3]105106TESTS::107108sage: U = NilCoxeterAlgebra(WeylGroup(['B',3,1]))109sage: U.homogeneous_generator_noncommutative_variables(-1)1100111sage: U.homogeneous_generator_noncommutative_variables(0)1121113114"""115assert (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)116if r >= self._n:117return self.zero()118return self.sum_of_monomials(w for w in self._W.pieri_factors() if w.length() == r)119120def homogeneous_noncommutative_variables(self,la):121r"""122Give the homogeneous function indexed by `la`, viewed inside the Nil-Coxeter algebra.123This is only defined in finite type `A`, `B` and affine types `A^{(1)}`, `B^{(1)}`, `C^{(1)}`, `D^{(1)}`.124125INPUT:126127- ``la`` -- a partition with first part bounded by the rank of the Weyl group128129EXAMPLES::130131sage: U = NilCoxeterAlgebra(WeylGroup(['B',2,1]))132sage: U.homogeneous_noncommutative_variables([2,1])133u[1,2,0] + 2*u[2,1,0] + u[0,2,0] + u[0,2,1] + u[1,2,1] + u[2,1,2] + u[2,0,2] + u[1,0,2]134135TESTS::136137sage: U = NilCoxeterAlgebra(WeylGroup(['B',2,1]))138sage: U.homogeneous_noncommutative_variables([])1391140141"""142return prod(self.homogeneous_generator_noncommutative_variables(p) for p in la)143144def k_schur_noncommutative_variables(self, la):145r"""146In type `A^{(1)}` this is the `k`-Schur function in noncommutative variables defined by Thomas Lam.147148REFERENCES:149150.. [Lam2005] T. Lam, Affine Stanley symmetric functions, Amer. J. Math. 128 (2006), no. 6, 1553--1586.151152This function is currently only defined in type `A^{(1)}`.153154INPUT:155156- ``la`` -- a partition with first part bounded by the rank of the Weyl group157158EXAMPLES::159160sage: A = NilCoxeterAlgebra(WeylGroup(['A',3,1]))161sage: A.k_schur_noncommutative_variables([2,2])162u[0,3,1,0] + u[3,1,2,0] + u[1,2,0,1] + u[3,2,0,3] + u[2,0,3,1] + u[2,3,1,2]163164TESTS::165166sage: A = NilCoxeterAlgebra(WeylGroup(['A',3,1]))167sage: A.k_schur_noncommutative_variables([])1681169170sage: A.k_schur_noncommutative_variables([1,2])171Traceback (most recent call last):172...173AssertionError: [1, 2] is not a partition.174175sage: A.k_schur_noncommutative_variables([4,2])176Traceback (most recent call last):177...178AssertionError: [4, 2] is not a 3-bounded partition.179180sage: C = NilCoxeterAlgebra(WeylGroup(['C',3,1]))181sage: C.k_schur_noncommutative_variables([2,2])182Traceback (most recent call last):183...184AssertionError: Weyl Group of type ['C', 3, 1] (as a matrix group acting on the root space) is not affine type A.185186187"""188assert 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)189assert la in Partitions(), "%s is not a partition."%(la)190assert (len(la) == 0 or la[0] < self._W.n), "%s is not a %s-bounded partition."%(la, self._W.n-1)191Sym = SymmetricFunctions(self._base_ring)192h = Sym.homogeneous()193ks = Sym.kschur(self._n-1,1)194f = h(ks[la])195return sum(f.coefficient(x)*self.homogeneous_noncommutative_variables(x) for x in f.support())196197198