Path: blob/master/sage/algebras/nil_coxeter_algebra.py
4097 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 IwahoriHeckeAlgebraT11from 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(IwahoriHeckeAlgebraT):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()422*u0 + 3*u0*u1 + 1 + u0*u1*u2*u343"""4445def __init__(self, W, base_ring = QQ, prefix='u'):46r"""47Initiate the affine nil-Coxeter algebra corresponding to the Weyl group `W` over the base ring.4849EXAMPLES::5051sage: U = NilCoxeterAlgebra(WeylGroup(['A',3,1])); U52The Nil-Coxeter Algebra of Type A3~ over Rational Field53sage: TestSuite(U).run()5455sage: U = NilCoxeterAlgebra(WeylGroup(['C',3]), ZZ); U56The Nil-Coxeter Algebra of Type C3 over Integer Ring57sage: TestSuite(U).run()58"""5960self._W = W61self._n = W.n62self._base_ring = base_ring63self._cartan_type = W.cartan_type()64IwahoriHeckeAlgebraT.__init__(self, W, 0, 0, base_ring, prefix=prefix)6566def _repr_(self):67r"""68EXAMPLES ::6970sage: NilCoxeterAlgebra(WeylGroup(['A',3,1])) # indirect doctest71The Nil-Coxeter Algebra of Type A3~ over Rational Field7273"""7475return "The Nil-Coxeter Algebra of Type %s over %s"%(self._cartan_type._repr_(compact=True), self.base_ring())7677def homogeneous_generator_noncommutative_variables(self, r):78r"""79Give the `r^{th}` homogeneous function inside the Nil-Coxeter algebra.80In finite type `A` this is the sum of all decreasing elements of length `r`.81In affine type `A` this is the sum of all cyclically decreasing elements of length `r`.82This is only defined in finite type `A`, `B` and affine types `A^{(1)}`, `B^{(1)}`, `C^{(1)}`, `D^{(1)}`.8384INPUT:8586- ``r`` -- a positive integer at most the rank of the Weyl group8788EXAMPLES::8990sage: U = NilCoxeterAlgebra(WeylGroup(['A',3,1]))91sage: U.homogeneous_generator_noncommutative_variables(2)92u1*u0 + u2*u0 + u0*u3 + u3*u2 + u3*u1 + u2*u19394sage: U = NilCoxeterAlgebra(WeylGroup(['B',4]))95sage: U.homogeneous_generator_noncommutative_variables(2)96u1*u2 + u2*u1 + u3*u1 + u4*u1 + u2*u3 + u3*u2 + u4*u2 + u3*u4 + u4*u39798sage: U = NilCoxeterAlgebra(WeylGroup(['C',3]))99sage: U.homogeneous_generator_noncommutative_variables(2)100Traceback (most recent call last):101...102AssertionError: Analogue of symmetric functions in noncommutative variables is not defined in type ['C', 3]103104TESTS::105106sage: U = NilCoxeterAlgebra(WeylGroup(['B',3,1]))107sage: U.homogeneous_generator_noncommutative_variables(-1)1080109sage: U.homogeneous_generator_noncommutative_variables(0)1101111112"""113assert (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)114if r >= self._n:115return self.zero()116return self.sum_of_monomials(w for w in self._W.pieri_factors() if w.length() == r)117118def homogeneous_noncommutative_variables(self,la):119r"""120Give the homogeneous function indexed by `la`, viewed inside the Nil-Coxeter algebra.121This is only defined in finite type `A`, `B` and affine types `A^{(1)}`, `B^{(1)}`, `C^{(1)}`, `D^{(1)}`.122123INPUT:124125- ``la`` -- a partition with first part bounded by the rank of the Weyl group126127EXAMPLES::128129sage: U = NilCoxeterAlgebra(WeylGroup(['B',2,1]))130sage: U.homogeneous_noncommutative_variables([2,1])131u1*u2*u0 + 2*u2*u1*u0 + u0*u2*u0 + u0*u2*u1 + u1*u2*u1 + u2*u1*u2 + u2*u0*u2 + u1*u0*u2132133TESTS::134135sage: U = NilCoxeterAlgebra(WeylGroup(['B',2,1]))136sage: U.homogeneous_noncommutative_variables([])1371138139"""140return prod(self.homogeneous_generator_noncommutative_variables(p) for p in la)141142def k_schur_noncommutative_variables(self, la):143r"""144In type `A^{(1)}` this is the `k`-Schur function in noncommutative variables defined by Thomas Lam.145146REFERENCES:147148.. [Lam2005] T. Lam, Affine Stanley symmetric functions, Amer. J. Math. 128 (2006), no. 6, 1553--1586.149150This function is currently only defined in type `A^{(1)}`.151152INPUT:153154- ``la`` -- a partition with first part bounded by the rank of the Weyl group155156EXAMPLES::157158sage: A = NilCoxeterAlgebra(WeylGroup(['A',3,1]))159sage: A.k_schur_noncommutative_variables([2,2])160u0*u3*u1*u0 + u3*u1*u2*u0 + u1*u2*u0*u1 + u3*u2*u0*u3 + u2*u0*u3*u1 + u2*u3*u1*u2161162TESTS::163164sage: A = NilCoxeterAlgebra(WeylGroup(['A',3,1]))165sage: A.k_schur_noncommutative_variables([])1661167168sage: A.k_schur_noncommutative_variables([1,2])169Traceback (most recent call last):170...171AssertionError: [1, 2] is not a partition.172173sage: A.k_schur_noncommutative_variables([4,2])174Traceback (most recent call last):175...176AssertionError: [4, 2] is not a 3-bounded partition.177178sage: C = NilCoxeterAlgebra(WeylGroup(['C',3,1]))179sage: C.k_schur_noncommutative_variables([2,2])180Traceback (most recent call last):181...182AssertionError: Weyl Group of type ['C', 3, 1] (as a matrix group acting on the root space) is not affine type A.183184185"""186assert 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)187assert la in Partitions(), "%s is not a partition."%(la)188assert (len(la) == 0 or la[0] < self._W.n), "%s is not a %s-bounded partition."%(la, self._W.n-1)189ks = kSchurFunctions(self._base_ring,self._n-1,1);190SF = SymmetricFunctions(ks.base_ring())191h = SF.homogeneous()192f = h(ks[la])193return sum(f.coefficient(x)*self.homogeneous_noncommutative_variables(x) for x in f.support())194195196