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