# HG changeset patch
# User Christian Stump <christian.stump at gmail.com>
# Date 1359026897 0
# Node ID f81654c53d6d617a5f10077abaa900ff374aebdb
# Parent 961b61f4565f4c5760b4dd27c07f8aad3d0aff21
#14002: Fixed 0 and 1 in Kazhdan-Lusztig polynomials to live in base ring
diff --git a/sage/combinat/kazhdan_lusztig.py b/sage/combinat/kazhdan_lusztig.py
a
|
b
|
class KazhdanLusztigPolynomial(SageObjec |
76 | 76 | if y == 1: |
77 | 77 | y = self._one |
78 | 78 | if x == y: |
79 | | return 1 |
| 79 | return self._base_ring.one() |
80 | 80 | if not x.bruhat_le(y): |
81 | | return 0 |
| 81 | return self._base_ring.zero() |
82 | 82 | if y.length() == 0: |
83 | 83 | if x.length() == 0: |
84 | | return 1 |
| 84 | return self._base_ring.one() |
85 | 85 | else: |
86 | | return 0 |
| 86 | return self._base_ring.zero() |
87 | 87 | s = self._coxeter_group.simple_reflection(y.first_descent(side="left")) |
88 | 88 | if (s*x).length() < x.length(): |
89 | 89 | ret = self.R(s*x,s*y) |
… |
… |
class KazhdanLusztigPolynomial(SageObjec |
117 | 117 | if y == 1: |
118 | 118 | y = self._one |
119 | 119 | if x == y: |
120 | | return 1 |
| 120 | return self._base_ring.one() |
121 | 121 | if not x.bruhat_le(y): |
122 | | return 0 |
| 122 | return self._base_ring.zero() |
123 | 123 | if y.length() == 0: |
124 | 124 | if x.length() == 0: |
125 | | return 1 |
| 125 | return self._base_ring.one() |
126 | 126 | else: |
127 | | return 0 |
| 127 | return self._base_ring.zero() |
128 | 128 | p = sum(-self.R(x,t)*self.P(t,y) for t in self._coxeter_group.bruhat_interval(x,y) if t != x) |
129 | 129 | tr = floor((y.length()-x.length()+1)/2) |
130 | 130 | try: |