Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sagesmc
Path: blob/master/src/sage/algebras/nil_coxeter_algebra.py
8818 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 IwahoriHeckeAlgebra
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(IwahoriHeckeAlgebra.T):
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
u[0,1,2,3] + 3*u[0,1] + 2*u[0] + 1
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
49
group `W` over the base ring.
50
51
EXAMPLES::
52
53
sage: U = NilCoxeterAlgebra(WeylGroup(['A',3,1])); U
54
The Nil-Coxeter Algebra of Type A3~ over Rational Field
55
sage: TestSuite(U).run()
56
57
sage: U = NilCoxeterAlgebra(WeylGroup(['C',3]), ZZ); U
58
The Nil-Coxeter Algebra of Type C3 over Integer Ring
59
sage: TestSuite(U).run()
60
"""
61
62
self._W = W
63
self._n = W.n
64
self._base_ring = base_ring
65
self._cartan_type = W.cartan_type()
66
H = IwahoriHeckeAlgebra(W, 0, 0, base_ring=base_ring)
67
super(IwahoriHeckeAlgebra.T,self).__init__(H, 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
u[1,0] + u[2,0] + u[0,3] + u[3,2] + u[3,1] + u[2,1]
96
97
sage: U = NilCoxeterAlgebra(WeylGroup(['B',4]))
98
sage: U.homogeneous_generator_noncommutative_variables(2)
99
u[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]
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
u[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]
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
This function is currently only defined in type `A^{(1)}`.
154
155
INPUT:
156
157
- ``la`` -- a partition with first part bounded by the rank of the Weyl group
158
159
EXAMPLES::
160
161
sage: A = NilCoxeterAlgebra(WeylGroup(['A',3,1]))
162
sage: A.k_schur_noncommutative_variables([2,2])
163
u[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]
164
165
TESTS::
166
167
sage: A = NilCoxeterAlgebra(WeylGroup(['A',3,1]))
168
sage: A.k_schur_noncommutative_variables([])
169
1
170
171
sage: A.k_schur_noncommutative_variables([1,2])
172
Traceback (most recent call last):
173
...
174
AssertionError: [1, 2] is not a partition.
175
176
sage: A.k_schur_noncommutative_variables([4,2])
177
Traceback (most recent call last):
178
...
179
AssertionError: [4, 2] is not a 3-bounded partition.
180
181
sage: C = NilCoxeterAlgebra(WeylGroup(['C',3,1]))
182
sage: C.k_schur_noncommutative_variables([2,2])
183
Traceback (most recent call last):
184
...
185
AssertionError: Weyl Group of type ['C', 3, 1] (as a matrix group acting on the root space) is not affine type A.
186
187
188
"""
189
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)
190
assert la in Partitions(), "%s is not a partition."%(la)
191
assert (len(la) == 0 or la[0] < self._W.n), "%s is not a %s-bounded partition."%(la, self._W.n-1)
192
Sym = SymmetricFunctions(self._base_ring)
193
h = Sym.homogeneous()
194
ks = Sym.kschur(self._n-1,1)
195
f = h(ks[la])
196
return sum(f.coefficient(x)*self.homogeneous_noncommutative_variables(x) for x in f.support())
197
198