Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

r""" 

Kazhdan-Lusztig Polynomials 

 

AUTHORS: 

 

- Daniel Bump (2008): initial version 

 

- Alan J.X. Guo (2014-03-18): ``R_tilde()`` method. 

 

""" 

 

#***************************************************************************** 

# Copyright (C) 2008 Daniel Bump <bump at match.stanford.edu> 

# 

# This program is free software: you can redistribute it and/or modify 

# it under the terms of the GNU General Public License as published by 

# the Free Software Foundation, either version 2 of the License, or 

# (at your option) any later version. 

# http://www.gnu.org/licenses/ 

#***************************************************************************** 

 

from __future__ import absolute_import, print_function, division 

 

from sage.rings.polynomial.polynomial_element import is_Polynomial 

from sage.functions.other import floor 

from sage.misc.cachefunc import cached_method 

from sage.rings.polynomial.laurent_polynomial import LaurentPolynomial 

from sage.structure.sage_object import SageObject 

from sage.structure.unique_representation import UniqueRepresentation 

 

 

class KazhdanLusztigPolynomial(UniqueRepresentation, SageObject): 

""" 

A Kazhdan-Lusztig polynomial. 

 

INPUT: 

 

- ``W`` -- a Weyl Group 

- ``q`` -- an indeterminate 

 

OPTIONAL: 

 

- ``trace`` -- if ``True``, then this displays the trace: the intermediate 

results. This is instructive and fun. 

 

The parent of ``q`` may be a :class:`PolynomialRing` or a 

:class:`LaurentPolynomialRing`. 

 

REFERENCES: 

 

.. [KL79] \D. Kazhdan and G. Lusztig. *Representations of Coxeter 

groups and Hecke algebras*. Invent. Math. **53** (1979). 

no. 2, 165--184. :doi:`10.1007/BF01390031` :mathscinet:`MR0560412` 

 

.. [Dy93] \M. J. Dyer. *Hecke algebras and shellings of Bruhat 

intervals*. Compositio Mathematica, 1993, 89(1): 91-115. 

 

.. [BB05] \A. Bjorner, F. Brenti. *Combinatorics of Coxeter 

groups*. New York: Springer, 2005. 

 

EXAMPLES:: 

 

sage: W = WeylGroup("B3",prefix="s") 

sage: [s1,s2,s3] = W.simple_reflections() 

sage: R.<q> = LaurentPolynomialRing(QQ) 

sage: KL = KazhdanLusztigPolynomial(W,q) 

sage: KL.P(s2,s3*s2*s3*s1*s2) 

1 + q 

 

A faster implementation (using the optional package Coxeter 3) is given by:: 

 

sage: W = CoxeterGroup(['B', 3], implementation='coxeter3') # optional - coxeter3 

sage: W.kazhdan_lusztig_polynomial([2], [3,2,3,1,2]) # optional - coxeter3 

q + 1 

""" 

def __init__(self, W, q, trace=False): 

""" 

Initialize ``self``. 

 

EXAMPLES:: 

 

sage: W = WeylGroup("B3",prefix="s") 

sage: R.<q> = LaurentPolynomialRing(QQ) 

sage: KL = KazhdanLusztigPolynomial(W,q) 

sage: TestSuite(KL).run() 

""" 

self._coxeter_group = W 

self._q = q 

self._trace = trace 

self._one = W.one() 

self._base_ring = q.parent() 

if is_Polynomial(q): 

self._base_ring_type = "polynomial" 

elif isinstance(q, LaurentPolynomial): 

self._base_ring_type = "laurent" 

else: 

self._base_ring_type = "unknown" 

 

@cached_method 

def R(self, x, y): 

""" 

Return the Kazhdan-Lusztig `R` polynomial. 

 

INPUT: 

 

- ``x``, ``y`` -- elements of the underlying Coxeter group 

 

EXAMPLES:: 

 

sage: R.<q>=QQ[] 

sage: W = WeylGroup("A2", prefix="s") 

sage: [s1,s2]=W.simple_reflections() 

sage: KL = KazhdanLusztigPolynomial(W, q) 

sage: [KL.R(x,s2*s1) for x in [1,s1,s2,s1*s2]] 

[q^2 - 2*q + 1, q - 1, q - 1, 0] 

""" 

if x == 1: 

x = self._one 

if y == 1: 

y = self._one 

if x == y: 

return self._base_ring.one() 

if not x.bruhat_le(y): 

return self._base_ring.zero() 

if y.length() == 0: 

if x.length() == 0: 

return self._base_ring.one() 

else: 

return self._base_ring.zero() 

s = self._coxeter_group.simple_reflection(y.first_descent(side="left")) 

if (s*x).length() < x.length(): 

ret = self.R(s*x,s*y) 

if self._trace: 

print(" R(%s,%s)=%s" % (x, y, ret)) 

return ret 

else: 

ret = (self._q-1)*self.R(s*x,y)+self._q*self.R(s*x,s*y) 

if self._trace: 

print(" R(%s,%s)=%s" % (x, y, ret)) 

return ret 

 

@cached_method 

def R_tilde(self, x, y): 

r""" 

Return the Kazhdan-Lusztig `\tilde{R}` polynomial. 

 

Information about the `\tilde{R}` polynomials can be found in 

[Dy93]_ and [BB05]_. 

 

INPUT: 

 

- ``x``, ``y`` -- elements of the underlying Coxeter group 

 

EXAMPLES:: 

 

sage: R.<q> = QQ[] 

sage: W = WeylGroup("A2", prefix="s") 

sage: [s1,s2] = W.simple_reflections() 

sage: KL = KazhdanLusztigPolynomial(W, q) 

sage: [KL.R_tilde(x,s2*s1) for x in [1,s1,s2,s1*s2]] 

[q^2, q, q, 0] 

""" 

if x == 1: 

x = self._one 

if y == 1: 

y = self._one 

if not x.bruhat_le(y): 

return self._base_ring.zero() 

if x == y: 

return self._base_ring.one() 

s = self._coxeter_group.simple_reflection(y.first_descent(side="right")) 

if (x * s).length() < x.length(): 

ret = self.R_tilde(x * s, y * s) 

if self._trace: 

print(" R_tilde(%s,%s)=%s" % (x, y, ret)) 

return ret 

else: 

ret = self.R_tilde(x * s, y * s) + self._q * self.R_tilde(x, y * s) 

if self._trace: 

print(" R_tilde(%s,%s)=%s" % (x, y, ret)) 

return ret 

 

@cached_method 

def P(self, x, y): 

""" 

Return the Kazhdan-Lusztig `P` polynomial. 

 

If the rank is large, this runs slowly at first but speeds up 

as you do repeated calculations due to the caching. 

 

INPUT: 

 

- ``x``, ``y`` -- elements of the underlying Coxeter group 

 

.. SEEALSO:: 

 

:mod:`~sage.libs.coxeter3.coxeter_group.CoxeterGroup.kazhdan_lusztig_polynomial` 

for a faster implementation using Fokko Ducloux's Coxeter3 C++ library. 

 

EXAMPLES:: 

 

sage: R.<q> = QQ[] 

sage: W = WeylGroup("A3", prefix="s") 

sage: [s1,s2,s3] = W.simple_reflections() 

sage: KL = KazhdanLusztigPolynomial(W, q) 

sage: KL.P(s2,s2*s1*s3*s2) 

q + 1 

""" 

if x == 1: 

x = self._one 

if y == 1: 

y = self._one 

if x == y: 

return self._base_ring.one() 

if not x.bruhat_le(y): 

return self._base_ring.zero() 

if y.length() == 0: 

if x.length() == 0: 

return self._base_ring.one() 

else: 

return self._base_ring.zero() 

p = sum(-self.R(x, t) * self.P(t, y) 

for t in self._coxeter_group.bruhat_interval(x, y) if t != x) 

tr = (y.length() - x.length() + 1) // 2 

ret = p.truncate(tr) 

if self._trace: 

print(" P({},{})={}".format(x, y, ret)) 

return ret