-
-
Notifications
You must be signed in to change notification settings - Fork 405
/
iwahori_hecke_algebra.py
2700 lines (2228 loc) · 102 KB
/
iwahori_hecke_algebra.py
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
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
r"""
Iwahori-Hecke Algebras
AUTHORS:
- Daniel Bump, Nicolas Thiery (2010): Initial version
- Brant Jones, Travis Scrimshaw, Andrew Mathas (2013):
Moved into the category framework and implemented the
Kazhdan-Lusztig `C` and `C^{\prime}` bases
"""
#*****************************************************************************
# Copyright (C) 2013 Brant Jones <brant at math.jmu.edu>
# Daniel Bump <bump at match.stanford.edu>
# Nicolas M. Thiery <nthiery at users.sf.net>
#
# Distributed under the terms of the GNU General Public License (GPL)
# http://www.gnu.org/licenses/
#*****************************************************************************
from functools import cmp_to_key
import six
from sage.misc.abstract_method import abstract_method
from sage.misc.cachefunc import cached_method
from sage.misc.bindable_class import BindableClass
from sage.structure.parent import Parent
from sage.structure.unique_representation import UniqueRepresentation
from sage.categories.realizations import Realizations, Category_realization_of_parent
from sage.categories.all import AlgebrasWithBasis, FiniteDimensionalAlgebrasWithBasis, CoxeterGroups
from sage.rings.all import ZZ
from sage.rings.polynomial.laurent_polynomial_ring import LaurentPolynomialRing
from sage.arith.all import is_square
from sage.combinat.root_system.coxeter_group import CoxeterGroup
from sage.combinat.family import Family
from sage.combinat.free_module import CombinatorialFreeModule
def normalized_laurent_polynomial(R, p):
r"""
Return a normalized version of the (Laurent polynomial) ``p`` in the
ring ``R``.
Various ring operations in ``sage`` return an element of the field of
fractions of the parent ring even though the element is "known" to belong to
the base ring. This function is a hack to recover from this. This occurs
somewhat haphazardly with Laurent polynomial rings::
sage: R.<q>=LaurentPolynomialRing(ZZ)
sage: [type(c) for c in (q**-1).coefficients()]
[<... 'sage.rings.integer.Integer'>]
It also happens in any ring when dividing by units::
sage: type ( 3/1 )
<... 'sage.rings.rational.Rational'>
sage: type ( -1/-1 )
<... 'sage.rings.rational.Rational'>
This function is a variation on a suggested workaround of Nils Bruin.
EXAMPLES::
sage: from sage.algebras.iwahori_hecke_algebra import normalized_laurent_polynomial
sage: type ( normalized_laurent_polynomial(ZZ, 3/1) )
<... 'sage.rings.integer.Integer'>
sage: R.<q>=LaurentPolynomialRing(ZZ)
sage: [type(c) for c in normalized_laurent_polynomial(R, q**-1).coefficients()]
[<... 'sage.rings.integer.Integer'>]
sage: R.<u,v>=LaurentPolynomialRing(ZZ,2)
sage: p=normalized_laurent_polynomial(R, 2*u**-1*v**-1+u*v)
sage: ui=normalized_laurent_polynomial(R, u^-1)
sage: vi=normalized_laurent_polynomial(R, v^-1)
sage: p(ui,vi)
2*u*v + u^-1*v^-1
sage: q= u+v+ui
sage: q(ui,vi)
u + v^-1 + u^-1
"""
try:
return R({k: R._base(c) for k, c in six.iteritems(p.dict())})
except (AttributeError, TypeError):
return R(p)
def index_cmp(x, y):
"""
Compare two term indices ``x`` and ``y`` by Bruhat order, then by word
length, and then by the generic comparison.
EXAMPLES::
sage: from sage.algebras.iwahori_hecke_algebra import index_cmp
sage: W = WeylGroup(['A',2,1])
sage: x = W.from_reduced_word([0,1])
sage: y = W.from_reduced_word([0,2,1])
sage: x.bruhat_le(y)
True
sage: index_cmp(x, y)
1
"""
if x.bruhat_le(y) or x.length() < y.length():
return 1
if y.bruhat_le(x) or x.length() > y.length():
return -1
# fallback case, in order to define a total order
if x < y:
return -1
if x > y:
return 1
return 0
sorting_key = cmp_to_key(index_cmp)
class IwahoriHeckeAlgebra(Parent, UniqueRepresentation):
r"""
The Iwahori-Hecke algebra of the Coxeter group ``W``
with the specified parameters.
INPUT:
- ``W`` -- a Coxeter group or Cartan type
- ``q1`` -- a parameter
OPTIONAL ARGUMENTS:
- ``q2`` -- (default ``-1``) another parameter
- ``base_ring`` -- (default ``q1.parent()``) a ring containing ``q1``
and ``q2``
The Iwahori-Hecke algebra [Iwa1964]_ is a deformation of the group algebra of
a Weyl group or, more generally, a Coxeter group. These algebras are
defined by generators and relations and they depend on a deformation
parameter `q`. Taking `q = 1`, as in the following example, gives a ring
isomorphic to the group algebra of the corresponding Coxeter group.
Let `(W, S)` be a Coxeter system and let `R` be a commutative ring
containing elements `q_1` and `q_2`. Then the *Iwahori-Hecke algebra*
`H = H_{q_1,q_2}(W,S)` of `(W,S)` with parameters `q_1` and `q_2` is the
unital associative algebra with generators `\{T_s \mid s\in S\}` and
relations:
.. MATH::
\begin{aligned}
(T_s - q_1)(T_s - q_2) &= 0\\
T_r T_s T_r \cdots &= T_s T_r T_s \cdots,
\end{aligned}
where the number of terms on either side of the second relations (the braid
relations) is the order of `rs` in the Coxeter group `W`, for `r,s \in S`.
Iwahori-Hecke algebras are fundamental in many areas of mathematics,
ranging from the representation theory of Lie groups and quantum groups,
to knot theory and statistical mechanics. For more information see,
for example, [KL79]_, [HKP2010]_, [Jon1987]_ and
:wikipedia:`Iwahori-Hecke_algebra`.
.. RUBRIC:: Bases
A reduced expression for an element `w \in W` is any minimal length
word `w = s_1 \cdots s_k`, with `s_i \in S`. If `w = s_1 \cdots s_k` is a
reduced expression for `w` then Matsumoto's Monoid Lemma implies that
`T_w = T_{s_1} \cdots T_{s_k}` depends on `w` and not on the choice of
reduced expressions. Moreover, `\{ T_w \mid w\in W \}` is a basis for the
Iwahori-Hecke algebra `H` and
.. MATH::
T_s T_w = \begin{cases}
T_{sw}, & \text{if } \ell(sw) = \ell(w)+1,\\
(q_1+q_2)T_w -q_1q_2 T_{sw}, & \text{if } \ell(sw) = \ell(w)-1.
\end{cases}
The `T`-basis of `H` is implemented for any choice of parameters
``q_1`` and ``q_2``::
sage: R.<u,v> = LaurentPolynomialRing(ZZ,2)
sage: H = IwahoriHeckeAlgebra('A3', u,v)
sage: T = H.T()
sage: T[1]
T[1]
sage: T[1,2,1] + T[2]
T[1,2,1] + T[2]
sage: T[1] * T[1,2,1]
(u+v)*T[1,2,1] + (-u*v)*T[2,1]
sage: T[1]^-1
(-u^-1*v^-1)*T[1] + (v^-1+u^-1)
Working over the Laurent polynomial ring `Z[q^{\pm 1/2}]` Kazhdan and
Lusztig proved that there exist two distinguished bases
`\{ C^{\prime}_w \mid w \in W \}` and `\{ C_w \mid w \in W \}` of `H`
which are uniquely determined by the properties that they are invariant
under the bar involution on `H` and have triangular transitions matrices
with polynomial entries of a certain form with the `T`-basis;
see [KL79]_ for a precise statement.
It turns out that the Kazhdan-Lusztig bases can be defined (by
specialization) in `H` whenever `-q_1 q_2` is a square in the base ring.
The Kazhdan-Lusztig bases are implemented inside `H` whenever `-q_1 q_2`
has a square root::
sage: H = IwahoriHeckeAlgebra('A3', u^2,-v^2)
sage: T=H.T(); Cp= H.Cp(); C=H.C()
sage: T(Cp[1])
(u^-1*v^-1)*T[1] + (u^-1*v)
sage: T(C[1])
(u^-1*v^-1)*T[1] + (-u*v^-1)
sage: Cp(C[1])
Cp[1] + (-u*v^-1-u^-1*v)
sage: elt = Cp[2]*Cp[3]+C[1]; elt
Cp[2,3] + Cp[1] + (-u*v^-1-u^-1*v)
sage: c = C(elt); c
C[2,3] + C[1] + (u*v^-1+u^-1*v)*C[3] + (u*v^-1+u^-1*v)*C[2] + (u^2*v^-2+2+u^-2*v^2)
sage: t = T(c); t
(u^-2*v^-2)*T[2,3] + (u^-1*v^-1)*T[1] + (u^-2)*T[3] + (u^-2)*T[2] + (-u*v^-1+u^-2*v^2)
sage: Cp(t)
Cp[2,3] + Cp[1] + (-u*v^-1-u^-1*v)
sage: Cp(c)
Cp[2,3] + Cp[1] + (-u*v^-1-u^-1*v)
The conversions to and from the Kazhdan-Lusztig bases are done behind the
scenes whenever the Kazhdan-Lusztig bases are well-defined. Once a suitable
Iwahori-Hecke algebra is defined they will work without further
intervention.
For example, with the "standard parameters", so that
`(T_r-q^2)(T_r+1) = 0`::
sage: R.<q> = LaurentPolynomialRing(ZZ)
sage: H = IwahoriHeckeAlgebra('A3', q^2)
sage: T=H.T(); Cp=H.Cp(); C=H.C()
sage: C(T[1])
q*C[1] + q^2
sage: elt = Cp(T[1,2,1]); elt
q^3*Cp[1,2,1] - q^2*Cp[2,1] - q^2*Cp[1,2] + q*Cp[1] + q*Cp[2] - 1
sage: C(elt)
q^3*C[1,2,1] + q^4*C[2,1] + q^4*C[1,2] + q^5*C[1] + q^5*C[2] + q^6
With the "normalized presentation", so that `(T_r-q)(T_r+q^{-1}) = 0`::
sage: R.<q> = LaurentPolynomialRing(ZZ)
sage: H = IwahoriHeckeAlgebra('A3', q, -q^-1)
sage: T=H.T(); Cp=H.Cp(); C=H.C()
sage: C(T[1])
C[1] + q
sage: elt = Cp(T[1,2,1]); elt
Cp[1,2,1] - (q^-1)*Cp[2,1] - (q^-1)*Cp[1,2] + (q^-2)*Cp[1] + (q^-2)*Cp[2] - (q^-3)
sage: C(elt)
C[1,2,1] + q*C[2,1] + q*C[1,2] + q^2*C[1] + q^2*C[2] + q^3
In the group algebra, so that `(T_r-1)(T_r+1) = 0`::
sage: H = IwahoriHeckeAlgebra('A3', 1)
sage: T=H.T(); Cp=H.Cp(); C=H.C()
sage: C(T[1])
C[1] + 1
sage: Cp(T[1,2,1])
Cp[1,2,1] - Cp[2,1] - Cp[1,2] + Cp[1] + Cp[2] - 1
sage: C(_)
C[1,2,1] + C[2,1] + C[1,2] + C[1] + C[2] + 1
On the other hand, if the Kazhdan-Lusztig bases are not well-defined (when
`-q_1 q_2` is not a square), attempting to use the Kazhdan-Lusztig bases
triggers an error::
sage: R.<q>=LaurentPolynomialRing(ZZ)
sage: H = IwahoriHeckeAlgebra('A3', q)
sage: C=H.C()
Traceback (most recent call last):
...
ValueError: The Kazhdan_Lusztig bases are defined only when -q_1*q_2 is a square
We give an example in affine type::
sage: R.<v> = LaurentPolynomialRing(ZZ)
sage: H = IwahoriHeckeAlgebra(['A',2,1], v^2)
sage: T=H.T(); Cp=H.Cp(); C=H.C()
sage: C(T[1,0,2])
v^3*C[1,0,2] + v^4*C[1,0] + v^4*C[0,2] + v^4*C[1,2]
+ v^5*C[0] + v^5*C[2] + v^5*C[1] + v^6
sage: Cp(T[1,0,2])
v^3*Cp[1,0,2] - v^2*Cp[1,0] - v^2*Cp[0,2] - v^2*Cp[1,2]
+ v*Cp[0] + v*Cp[2] + v*Cp[1] - 1
sage: T(C[1,0,2])
(v^-3)*T[1,0,2] - (v^-1)*T[1,0] - (v^-1)*T[0,2] - (v^-1)*T[1,2]
+ v*T[0] + v*T[2] + v*T[1] - v^3
sage: T(Cp[1,0,2])
(v^-3)*T[1,0,2] + (v^-3)*T[1,0] + (v^-3)*T[0,2] + (v^-3)*T[1,2]
+ (v^-3)*T[0] + (v^-3)*T[2] + (v^-3)*T[1] + (v^-3)
EXAMPLES:
We start by creating a Iwahori-Hecke algebra together with the three bases
for these algebras that are currently supported::
sage: R.<v> = LaurentPolynomialRing(QQ, 'v')
sage: H = IwahoriHeckeAlgebra('A3', v**2)
sage: T = H.T()
sage: C = H.C()
sage: Cp = H.Cp()
It is also possible to define these three bases quickly using
the :meth:`inject_shorthands` method.
Next we create our generators for the `T`-basis and do some basic
computations and conversions between the bases::
sage: T1,T2,T3 = T.algebra_generators()
sage: T1 == T[1]
True
sage: T1*T2 == T[1,2]
True
sage: T1 + T2
T[1] + T[2]
sage: T1*T1
-(1-v^2)*T[1] + v^2
sage: (T1 + T2)*T3 + T1*T1 - (v + v^-1)*T2
T[3,1] + T[2,3] - (1-v^2)*T[1] - (v^-1+v)*T[2] + v^2
sage: Cp(T1)
v*Cp[1] - 1
sage: Cp((v^1 - 1)*T1*T2 - T3)
-(v^2-v^3)*Cp[1,2] + (v-v^2)*Cp[1] - v*Cp[3] + (v-v^2)*Cp[2] + v
sage: C(T1)
v*C[1] + v^2
sage: p = C(T2*T3 - v*T1); p
v^2*C[2,3] - v^2*C[1] + v^3*C[3] + v^3*C[2] - (v^3-v^4)
sage: Cp(p)
v^2*Cp[2,3] - v^2*Cp[1] - v*Cp[3] - v*Cp[2] + (1+v)
sage: Cp(T2*T3 - v*T1)
v^2*Cp[2,3] - v^2*Cp[1] - v*Cp[3] - v*Cp[2] + (1+v)
In addition to explicitly creating generators, we have two shortcuts to
basis elements. The first is by using elements of the underlying Coxeter
group, the other is by using reduced words::
sage: s1,s2,s3 = H.coxeter_group().gens()
sage: T[s1*s2*s1*s3] == T[1,2,1,3]
True
sage: T[1,2,1,3] == T1*T2*T1*T3
True
TESTS:
We check the defining properties of the bases::
sage: R.<v> = LaurentPolynomialRing(QQ, 'v')
sage: H = IwahoriHeckeAlgebra('A3', v**2)
sage: W = H.coxeter_group()
sage: T = H.T()
sage: C = H.C()
sage: Cp = H.Cp()
sage: T(Cp[1])
(v^-1)*T[1] + (v^-1)
sage: T(C[1])
(v^-1)*T[1] - v
sage: C(Cp[1])
C[1] + (v^-1+v)
sage: Cp(C[1])
Cp[1] - (v^-1+v)
sage: all(C[x] == C[x].bar() for x in W) # long time
True
sage: all(Cp[x] == Cp[x].bar() for x in W) # long time
True
sage: all(T(C[x]).bar() == T(C[x]) for x in W) # long time
True
sage: all(T(Cp[x]).bar() == T(Cp[x]) for x in W) # long time
True
sage: KL = KazhdanLusztigPolynomial(W, v)
sage: term = lambda x,y: (-1)^y.length() * v^(-2*y.length()) * KL.P(y, x).substitute(v=v^-2)*T[y]
sage: all(T(C[x]) == (-v)^x.length()*sum(term(x,y) for y in W) for x in W) # long time
True
sage: all(T(Cp[x]) == v^-x.length()*sum(KL.P(y,x).substitute(v=v^2)*T[y] for y in W) for x in W) # long time
True
We check conversion between the bases for type `B_2` as well as some of
the defining properties::
sage: H = IwahoriHeckeAlgebra(['B',2], v**2)
sage: W = H.coxeter_group()
sage: T = H.T()
sage: C = H.C()
sage: Cp = H.Cp()
sage: all(T[x] == T(C(T[x])) for x in W) # long time
True
sage: all(T[x] == T(Cp(T[x])) for x in W) # long time
True
sage: all(C[x] == C(T(C[x])) for x in W) # long time
True
sage: all(C[x] == C(Cp(C[x])) for x in W) # long time
True
sage: all(Cp[x] == Cp(T(Cp[x])) for x in W) # long time
True
sage: all(Cp[x] == Cp(C(Cp[x])) for x in W) # long time
True
sage: all(T(C[x]).bar() == T(C[x]) for x in W) # long time
True
sage: all(T(Cp[x]).bar() == T(Cp[x]) for x in W) # long time
True
sage: KL = KazhdanLusztigPolynomial(W, v)
sage: term = lambda x,y: (-1)^y.length() * v^(-2*y.length()) * KL.P(y, x).substitute(v=v^-2)*T[y]
sage: all(T(C[x]) == (-v)^x.length()*sum(term(x,y) for y in W) for x in W) # long time
True
sage: all(T(Cp[x]) == v^-x.length()*sum(KL.P(y,x).substitute(v=v^2)*T[y] for y in W) for x in W) # long time
True
.. TODO::
Implement multi-parameter Iwahori-Hecke algebras together with their
Kazhdan-Lusztig bases. That is, Iwahori-Hecke algebras with (possibly)
different parameters for each conjugacy class of simple reflections
in the underlying Coxeter group.
.. TODO::
When given "generic parameters" we should return the generic
Iwahori-Hecke algebra with these parameters and allow the user to
work inside this algebra rather than doing calculations behind the
scenes in a copy of the generic Iwahori-Hecke algebra. The main
problem is that it is not clear how to recognise when the
parameters are "generic".
"""
@staticmethod
def __classcall_private__(cls, W, q1, q2=-1, base_ring=None):
r"""
TESTS::
sage: H = IwahoriHeckeAlgebra("A2", 1)
sage: W = CoxeterGroup("A2")
sage: H.coxeter_group() == W
True
sage: H.cartan_type() == CartanType("A2")
True
sage: H._q2 == -1
True
sage: H2 = IwahoriHeckeAlgebra(W, QQ(1), base_ring=ZZ)
sage: H is H2
True
"""
if W not in CoxeterGroups():
W = CoxeterGroup(W)
if base_ring is None:
base_ring = q1.parent()
else:
q1 = base_ring(q1)
q2 = base_ring(q2)
return super(IwahoriHeckeAlgebra, cls).__classcall__(cls, W, q1, q2, base_ring)
def __init__(self, W, q1, q2, base_ring):
r"""
Initialize and return the two parameter Iwahori-Hecke algebra ``self``.
EXAMPLES::
sage: R.<q1,q2> = QQ[]
sage: H = IwahoriHeckeAlgebra("A2", q1, q2=q2, base_ring=Frac(R))
sage: TestSuite(H).run()
"""
self._W = W
self._coxeter_type = W.coxeter_type()
self._q1 = q1
self._q2 = q2
# Used when multiplying generators: minor speed-up as it avoids the
# need to constantly add and multiply the parameters when applying the
# quadratic relation: T^2 = (q1+q2)T - q1*q2
self._q_sum = q1+q2
self._q_prod = -q1*q2
# If -q1*q2 is a square then it makes sense to talk of he Kazhdan-Lusztig
# basis of the Iwhaori-Hecke algebra. In this case we set
# self._root=\sqrt{q1*q2}. The Kazhdan-Lusztig bases will be computed in
# the generic case behind the scenes and then specialized to this # algebra.
is_Square, root = is_square(self._q_prod, root=True)
if is_Square:
# Attach the generic Hecke algebra and the basis change maps
self._root = root
self._generic_iwahori_hecke_algebra = IwahoriHeckeAlgebra_nonstandard(W)
self._shorthands = ['C', 'Cp', 'T']
else:
# Can we actually remove the bases C and Cp in this case?
self._root = None
self._shorthands = ['T']
# if 2 is a unit in the base ring then add th A and B bases
try:
base_ring(base_ring.one()/2)
self._shorthands.extend(['A','B'])
except (TypeError, ZeroDivisionError):
pass
if W.is_finite():
self._category = FiniteDimensionalAlgebrasWithBasis(base_ring)
else:
self._category = AlgebrasWithBasis(base_ring)
Parent.__init__(self, base=base_ring, category=self._category.WithRealizations())
self._is_generic=False # needed for initialisation of _KLHeckeBasis
# The following is used by the bar involution = self._bar_on_coefficients
try:
self._inverse_base_ring_generators = { g: self.base_ring()(g) ** -1
for g in self.base_ring().variable_names()}
except TypeError:
self._inverse_base_ring_generators = {}
def _repr_(self):
r"""
EXAMPLES::
sage: R.<q1,q2> = QQ[]
sage: IwahoriHeckeAlgebra("A2", q1**2, q2**2, base_ring=Frac(R))
Iwahori-Hecke algebra of type A2 in q1^2,q2^2 over Fraction Field of Multivariate Polynomial Ring in q1, q2 over Rational Field
"""
try:
ct = self._coxeter_type._repr_(compact=True)
except TypeError:
ct = repr(self._coxeter_type)
return "Iwahori-Hecke algebra of type {} in {},{} over {}".format(
ct, self._q1, self._q2, self.base_ring())
def _latex_(self):
r"""
Return a latex representation of ``self``.
EXAMPLES::
sage: R.<q1,q2> = QQ[]
sage: H = IwahoriHeckeAlgebra("A2", q1**2, q2**2, base_ring=Frac(R))
sage: latex(H)
\mathcal{H}_{q_{1}^{2},q_{2}^{2}}\left(A_{2},
\mathrm{Frac}(\Bold{Q}[q_{1}, q_{2}])\right)
sage: R.<q> = LaurentPolynomialRing(ZZ)
sage: H = IwahoriHeckeAlgebra("A2", q)
sage: latex(H)
\mathcal{H}_{q,-1}\left(A_{2}, \Bold{Z}[q^{\pm 1}]\right)
"""
from sage.misc.latex import latex
return "\\mathcal{{H}}_{{{},{}}}\\left({}, {}\\right)".format(latex(self._q1),
latex(self._q2), latex(self._coxeter_type), latex(self.base_ring()))
def _bar_on_coefficients(self, c):
r"""
Given a Laurent polynomial ``c`` return the Laurent polynomial obtained
by applying the (generic) bar involution to ``c`` .
This is the ring homomorphism of Laurent polynomials in
`\ZZ[u,u^{-1},v,v^{-1}]` which sends `u` to `u^{-1}` and `v`
to `v^{-1}.
EXAMPLES::
sage: R.<q>=LaurentPolynomialRing(ZZ)
sage: H = IwahoriHeckeAlgebra("A3",q^2)
sage: H._bar_on_coefficients(q)
q^-1
"""
return normalized_laurent_polynomial(self._base, c).substitute(**self._inverse_base_ring_generators)
def coxeter_type(self):
r"""
Return the Coxeter type of ``self``.
EXAMPLES::
sage: IwahoriHeckeAlgebra("D4", 1).coxeter_type()
Coxeter type of ['D', 4]
"""
return self._coxeter_type
def cartan_type(self):
r"""
Return the Cartan type of ``self``.
EXAMPLES::
sage: IwahoriHeckeAlgebra("D4", 1).cartan_type()
['D', 4]
"""
try:
return self._coxeter_type.cartan_type()
except AttributeError:
return None
def coxeter_group(self):
r"""
Return the Coxeter group of ``self``.
EXAMPLES::
sage: IwahoriHeckeAlgebra("B2", 1).coxeter_group()
Finite Coxeter group over Number Field in a with defining polynomial x^2 - 2 with Coxeter matrix:
[1 4]
[4 1]
"""
return self._W
def a_realization(self):
r"""
Return a particular realization of ``self`` (the `T`-basis).
EXAMPLES::
sage: H = IwahoriHeckeAlgebra("B2", 1)
sage: H.a_realization()
Iwahori-Hecke algebra of type B2 in 1,-1 over Integer Ring in the T-basis
"""
return self.T()
def q1(self):
"""
Return the parameter `q_1` of ``self``.
EXAMPLES::
sage: H = IwahoriHeckeAlgebra("B2", 1)
sage: H.q1()
1
"""
return self._q1
def q2(self):
"""
Return the parameter `q_2` of ``self``.
EXAMPLES::
sage: H = IwahoriHeckeAlgebra("B2", 1)
sage: H.q2()
-1
"""
return self._q2
class _BasesCategory(Category_realization_of_parent):
r"""
The category of bases of a Iwahori-Hecke algebra.
"""
def __init__(self, base):
r"""
Initialize the bases of a Iwahori-Hecke algebra.
INPUT:
- ``base`` -- a Iwahori-Hecke algebra
TESTS::
sage: H = IwahoriHeckeAlgebra("B2", 1)
sage: bases = H._BasesCategory()
sage: H.T() in bases
True
"""
Category_realization_of_parent.__init__(self, base)
def super_categories(self):
r"""
The super categories of ``self``.
EXAMPLES::
sage: H = IwahoriHeckeAlgebra("B2", 1)
sage: bases = H._BasesCategory()
sage: bases.super_categories()
[Category of realizations of Iwahori-Hecke algebra of type B2 in 1,-1 over Integer Ring,
Category of finite dimensional algebras with basis over Integer Ring]
"""
return [Realizations(self.base()), self.base()._category]
def _repr_(self):
r"""
Return the representation of ``self``.
EXAMPLES::
sage: H = IwahoriHeckeAlgebra("B2", 1)
sage: H._BasesCategory()
Category of bases of Iwahori-Hecke algebra of type B2 in 1,-1 over Integer Ring
"""
return "Category of bases of %s" % self.base()
class ParentMethods:
r"""
This class collects code common to all the various bases. In most
cases, these are just default implementations that will get
specialized in a basis.
"""
def _repr_(self):
"""
Text representation of this basis of Iwahori-Hecke algebra.
EXAMPLES::
sage: H = IwahoriHeckeAlgebra("B2", 1)
sage: H.T()
Iwahori-Hecke algebra of type B2 in 1,-1 over Integer Ring in the T-basis
sage: H.C()
Iwahori-Hecke algebra of type B2 in 1,-1 over Integer Ring in the C-basis
sage: H.Cp()
Iwahori-Hecke algebra of type B2 in 1,-1 over Integer Ring in the Cp-basis
"""
return "%s in the %s-basis"%(self.realization_of(), self._basis_name)
def __getitem__(self, i):
"""
Return the basis element indexed by ``i``.
INPUT:
- ``i`` -- either an element of the Coxeter group or a
reduced word
.. WARNING::
If `i`` is not a reduced expression then the basis element
indexed by the corresponding element of the algebra is
returned rather than the corresponding product of the
generators::
sage: R.<v> = LaurentPolynomialRing(QQ, 'v')
sage: T = IwahoriHeckeAlgebra('A3', v**2).T()
sage: T[1,1] == T[1] * T[1]
False
EXAMPLES::
sage: H = IwahoriHeckeAlgebra("B2", 1)
sage: T = H.T()
sage: G = H.coxeter_group()
sage: T[G.one()]
1
sage: T[G.simple_reflection(1)]
T[1]
sage: T[G.from_reduced_word([1,2,1])]
T[1,2,1]
sage: T[[]]
1
sage: T[1]
T[1]
sage: T[1,2,1]
T[1,2,1]
"""
W = self.realization_of().coxeter_group()
if i in ZZ:
return self(W.simple_reflection(i))
if i in W:
return self(i)
if i == []:
return self.one()
return self(W.from_reduced_word(i))
def is_field(self, proof=True):
"""
Return whether this Iwahori-Hecke algebra is a field.
EXAMPLES::
sage: T = IwahoriHeckeAlgebra("B2", 1).T()
sage: T.is_field()
False
"""
return False
def is_commutative(self):
"""
Return whether this Iwahori-Hecke algebra is commutative.
EXAMPLES::
sage: T = IwahoriHeckeAlgebra("B2", 1).T()
sage: T.is_commutative()
False
"""
return self.base_ring().is_commutative() \
and self.realization_of().coxeter_group().is_commutative()
@cached_method
def one_basis(self):
r"""
Return the identity element in the Weyl group, as per
``AlgebrasWithBasis.ParentMethods.one_basis``.
EXAMPLES::
sage: H = IwahoriHeckeAlgebra("B2", 1)
sage: H.T().one_basis()
[1 0]
[0 1]
"""
return self.realization_of().coxeter_group().one()
def index_set(self):
r"""
Return the index set of ``self``.
EXAMPLES::
sage: IwahoriHeckeAlgebra("B2", 1).T().index_set()
(1, 2)
"""
return self.realization_of().coxeter_group().index_set()
@cached_method
def algebra_generators(self):
r"""
Return the generators.
They do not have order two but satisfy a quadratic relation.
They coincide with the simple reflections in the Coxeter group
when `q_1 = 1` and `q_2 = -1`. In this special case,
the Iwahori-Hecke algebra is identified with the group algebra
of the Coxeter group.
EXAMPLES:
In the standard basis::
sage: R.<q> = QQ[]
sage: H = IwahoriHeckeAlgebra("A3", q).T()
sage: T = H.algebra_generators(); T
Finite family {1: T[1], 2: T[2], 3: T[3]}
sage: T.list()
[T[1], T[2], T[3]]
sage: [T[i] for i in [1,2,3]]
[T[1], T[2], T[3]]
sage: T1,T2,T3 = H.algebra_generators()
sage: T1
T[1]
sage: H = IwahoriHeckeAlgebra(['A',2,1], q).T()
sage: T = H.algebra_generators(); T
Finite family {0: T[0], 1: T[1], 2: T[2]}
sage: T.list()
[T[0], T[1], T[2]]
sage: [T[i] for i in [0,1,2]]
[T[0], T[1], T[2]]
sage: [T0, T1, T2] = H.algebra_generators()
sage: T0
T[0]
In the Kazhdan-Lusztig basis::
sage: R = LaurentPolynomialRing(QQ, 'v')
sage: v = R.gen(0)
sage: H = IwahoriHeckeAlgebra('A5', v**2)
sage: C = H.C()
sage: C.algebra_generators()
Finite family {1: C[1], 2: C[2], 3: C[3], 4: C[4], 5: C[5]}
sage: C.algebra_generators().list()
[C[1], C[2], C[3], C[4], C[5]]
"""
return self.basis().keys().simple_reflections().map(self.monomial)
def algebra_generator(self, i):
r"""
Return the `i`-th generator of ``self``.
EXAMPLES:
In the standard basis::
sage: R.<q>=QQ[]
sage: H = IwahoriHeckeAlgebra("A3", q).T()
sage: [H.algebra_generator(i) for i in H.index_set()]
[T[1], T[2], T[3]]
In the Kazhdan-Lusztig basis::
sage: R = LaurentPolynomialRing(QQ, 'v')
sage: v = R.gen(0)
sage: H = IwahoriHeckeAlgebra('A5', v**2)
sage: C = H.C()
sage: [C.algebra_generator(i) for i in H.coxeter_group().index_set()]
[C[1], C[2], C[3], C[4], C[5]]
"""
return self.algebra_generators()[i]
@abstract_method(optional=True)
def bar_on_basis(self, w):
"""
Return the bar involution on the basis element of ``self``
indexed by ``w``.
EXAMPLES::
sage: R.<v> = LaurentPolynomialRing(QQ)
sage: H = IwahoriHeckeAlgebra('A3', v**2)
sage: W = H.coxeter_group()
sage: s1,s2,s3 = W.simple_reflections()
sage: Cp = H.Cp()
sage: Cp.bar_on_basis(s1*s2*s1*s3)
Cp[1,2,3,1]
"""
@abstract_method(optional=True)
def hash_involution_on_basis(self, w):
"""
Return the bar involution on the basis element of ``self``
indexed by ``w``.
EXAMPLES::
sage: R.<v> = LaurentPolynomialRing(QQ)
sage: H = IwahoriHeckeAlgebra('A3', v**2)
sage: W = H.coxeter_group()
sage: s1,s2,s3 = W.simple_reflections()
sage: Cp = H.Cp()
sage: C = H.C()
sage: C(Cp.hash_involution_on_basis(s1*s2*s1*s3))
C[1,2,3,1]
"""
class ElementMethods:
def bar(self):
r"""
Return the bar involution of ``self``.
The bar involution `\overline{\phantom{x}}` is an antilinear
`\ZZ`-algebra involution defined by the identity on `\ZZ`,
sending `q^{1/2} \mapsto q^{-1/2}`, and `\overline{T_w} =
T_{w^{-1}}^{-1}`.
REFERENCES:
- :wikipedia:`Iwahori-Hecke_algebra#Canonical_basis`
EXAMPLES:
We first test on a single generator::
sage: R.<q> = LaurentPolynomialRing(QQ)
sage: H = IwahoriHeckeAlgebra('A3', q)
sage: T = H.T()
sage: T1,T2,T3 = T.algebra_generators()
sage: T1.bar()
(q^-1)*T[1] + (q^-1-1)
sage: T1.bar().bar() == T1
True
Next on a multiple of generators::
sage: b = (T1*T2*T1).bar(); b
(q^-3)*T[1,2,1] + (q^-3-q^-2)*T[2,1] + (q^-3-q^-2)*T[1,2]
+ (q^-3-2*q^-2+q^-1)*T[1] + (q^-3-2*q^-2+q^-1)*T[2]
+ (q^-3-2*q^-2+2*q^-1-1)
sage: b.bar() == T1*T2*T1
True
A sum::
sage: s = T1 + T2
sage: b = s.bar(); b
(q^-1)*T[1] + (q^-1)*T[2] + (2*q^-1-2)
sage: b.bar() == s
True
A more complicated example::
sage: p = T1*T2 + (1-q+q^-1)*T3 - q^3*T1*T3
sage: p.bar()
-(q^-5)*T[3,1] + (q^-2)*T[1,2]
- (q^-5-q^-4-q^-2+q^-1)*T[1]
- (q^-5-q^-4+q^-2-q^-1-1)*T[3]
+ (q^-2-q^-1)*T[2]
- (q^-5-2*q^-4+q^-3-1+q)
sage: p.bar().bar() == p
True
This also works for arbitrary ``q1`` and ``q2``::
sage: R.<q1,q2> = LaurentPolynomialRing(QQ)
sage: H = IwahoriHeckeAlgebra('A3', q1, q2=-q2)
sage: T = H.T()
sage: T1,T2,T3 = T.algebra_generators()
sage: p = T1*T3 + T2
sage: p.bar()
(q1^-2*q2^-2)*T[3,1]
+ (-q1^-1*q2^-2+q1^-2*q2^-1)*T[1]
+ (-q1^-1*q2^-2+q1^-2*q2^-1)*T[3]
+ (q1^-1*q2^-1)*T[2]
+ (-q2^-1+q1^-1+q2^-2-2*q1^-1*q2^-1+q1^-2)
sage: p.bar().bar() == p
True
Next we have an example in the `C` basis::
sage: R.<v> = LaurentPolynomialRing(QQ)
sage: H = IwahoriHeckeAlgebra('A3', v**2)
sage: C = H.C()
sage: p = C[1]*C[3] + C[2]
sage: p.bar()
C[3,1] + C[2]
sage: p.bar().bar() == p
True
For the `C^{\prime}` basis as well::
sage: R.<v> = LaurentPolynomialRing(QQ)
sage: H = IwahoriHeckeAlgebra('A3', v**2)
sage: Cp = H.Cp()
sage: p = Cp[1]*Cp[3] + Cp[2]