-
-
Notifications
You must be signed in to change notification settings - Fork 405
/
verma_module.py
1322 lines (1116 loc) · 50.2 KB
/
verma_module.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"""
Verma Modules
AUTHORS:
- Travis Scrimshaw (2017-06-30): Initial version
.. TODO::
Implement a :class:`sage.categories.pushout.ConstructionFunctor`
and return as the ``construction()``.
"""
#*****************************************************************************
# Copyright (C) 2017 Travis Scrimshaw <tcscrims at gmail.com>
#
# 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 sage.misc.lazy_attribute import lazy_attribute
from sage.misc.cachefunc import cached_method
from sage.categories.modules import Modules
from sage.categories.morphism import Morphism
from sage.categories.homset import Hom, Homset
from sage.monoids.indexed_free_monoid import IndexedFreeAbelianMonoid
from sage.combinat.free_module import CombinatorialFreeModule
from sage.modules.free_module_element import vector
from sage.sets.family import Family
from sage.structure.richcmp import richcmp
from sage.rings.all import ZZ, QQ
class VermaModule(CombinatorialFreeModule):
r"""
A Verma module.
Let `\lambda` be a weight and `\mathfrak{g}` be a Kac--Moody Lie
algebra with a fixed Borel subalgebra `\mathfrak{b} = \mathfrak{h}
\oplus \mathfrak{g}^+`. The *Verma module* `M_{\lambda}` is a
`U(\mathfrak{g})`-module given by
.. MATH::
M_{\lambda} := U(\mathfrak{g}) \otimes_{U(\mathfrak{b})} F_{\lambda},
where `F_{\lambda}` is the `U(\mathfrak{b})` module such that
`h \in U(\mathfrak{h})` acts as multiplication by
`\langle \lambda, h \rangle` and `U\mathfrak{g}^+) F_{\lambda} = 0`.
INPUT:
- ``g`` -- a Lie algebra
- ``weight`` -- a weight
EXAMPLES::
sage: L = lie_algebras.sl(QQ, 3)
sage: La = L.cartan_type().root_system().weight_lattice().fundamental_weights()
sage: M = L.verma_module(2*La[1] + 3*La[2])
sage: pbw = M.pbw_basis()
sage: E1,E2,F1,F2,H1,H2 = [pbw(g) for g in L.gens()]
sage: v = M.highest_weight_vector()
sage: x = F2^3 * F1 * v
sage: x
f[-alpha[2]]^3*f[-alpha[1]]*v[2*Lambda[1] + 3*Lambda[2]]
sage: F1 * x
f[-alpha[2]]^3*f[-alpha[1]]^2*v[2*Lambda[1] + 3*Lambda[2]]
+ 3*f[-alpha[2]]^2*f[-alpha[1]]*f[-alpha[1] - alpha[2]]*v[2*Lambda[1] + 3*Lambda[2]]
sage: E1 * x
2*f[-alpha[2]]^3*v[2*Lambda[1] + 3*Lambda[2]]
sage: H1 * x
3*f[-alpha[2]]^3*f[-alpha[1]]*v[2*Lambda[1] + 3*Lambda[2]]
sage: H2 * x
-2*f[-alpha[2]]^3*f[-alpha[1]]*v[2*Lambda[1] + 3*Lambda[2]]
REFERENCES:
- :wikipedia:`Verma_module`
"""
def __init__(self, g, weight, basis_key=None, prefix='f', **kwds):
"""
Initialize ``self``.
TESTS::
sage: L = lie_algebras.sl(QQ, 3)
sage: La = L.cartan_type().root_system().weight_lattice().fundamental_weights()
sage: M = L.verma_module(La[1] + 4*La[2])
sage: TestSuite(M).run()
sage: M = L.verma_module(La[1] - 2*La[2])
sage: TestSuite(M).run()
sage: L = lie_algebras.sp(QQ, 4)
sage: La = L.cartan_type().root_system().ambient_space().fundamental_weights()
sage: M = L.verma_module(-1/2*La[1] + 3/7*La[2])
sage: TestSuite(M).run()
"""
if basis_key is not None:
self._basis_key = basis_key
else:
self._basis_key = g._basis_key
self._weight = weight
R = g.base_ring()
self._g = g
self._pbw = g.pbw_basis(basis_key=self._triangular_key)
monomials = IndexedFreeAbelianMonoid(g._negative_half_index_set(),
prefix,
sorting_key=self._monoid_key,
**kwds)
CombinatorialFreeModule.__init__(self, R, monomials,
prefix='', bracket=False, latex_bracket=False,
sorting_key=self._monomial_key,
category=Modules(R).WithBasis().Graded())
def _triangular_key(self, x):
"""
Return a key for sorting for the index ``x`` that respects
the triangular decomposition by `U^-, U^0, U^+`.
EXAMPLES::
sage: L = lie_algebras.sl(QQ, 3)
sage: La = L.cartan_type().root_system().weight_lattice().fundamental_weights()
sage: M = L.verma_module(La[1])
sage: sorted(L.basis().keys(), key=L._basis_key)
[alpha[2], alpha[1], alpha[1] + alpha[2],
alphacheck[1], alphacheck[2],
-alpha[2], -alpha[1], -alpha[1] - alpha[2]]
sage: sorted(L.basis().keys(), key=M._triangular_key)
[-alpha[2], -alpha[1], -alpha[1] - alpha[2],
alphacheck[1], alphacheck[2],
alpha[2], alpha[1], alpha[1] + alpha[2]]
sage: def neg_key(x):
....: return -L.basis().keys().index(x)
sage: sorted(L.basis().keys(), key=neg_key)
[-alpha[1] - alpha[2], -alpha[1], -alpha[2],
alphacheck[2], alphacheck[1],
alpha[1] + alpha[2], alpha[1], alpha[2]]
sage: N = L.verma_module(La[1], basis_key=neg_key)
sage: sorted(L.basis().keys(), key=N._triangular_key)
[-alpha[1] - alpha[2], -alpha[1], -alpha[2],
alphacheck[2], alphacheck[1],
alpha[1] + alpha[2], alpha[1], alpha[2]]
"""
return (self._g._part_on_basis(x), self._basis_key(x))
def _monoid_key(self, x):
"""
Return a key for comparison in the underlying monoid of ``self``.
EXAMPLES::
sage: L = lie_algebras.sl(QQ, 3)
sage: La = L.cartan_type().root_system().weight_lattice().fundamental_weights()
sage: M = L.verma_module(La[1])
sage: monoid = M.basis().keys()
sage: prod(monoid.gens()) # indirect doctest
f[-alpha[2]]*f[-alpha[1]]*f[-alpha[1] - alpha[2]]
sage: [M._monoid_key(x) for x in monoid.an_element()._sorted_items()]
[5, 6, 7]
sage: def neg_key(x):
....: return -L.basis().keys().index(x)
sage: M = L.verma_module(La[1], basis_key=neg_key)
sage: monoid = M.basis().keys()
sage: prod(monoid.gens()) # indirect doctest
f[-alpha[1] - alpha[2]]*f[-alpha[1]]*f[-alpha[2]]
sage: [M._monoid_key(x) for x in monoid.an_element()._sorted_items()]
[-7, -6, -5]
"""
return self._basis_key(x[0])
def _monomial_key(self, x):
"""
Compute the key for ``x`` so that the comparison is done by
triangular decomposition and then reverse degree lexicographic order.
EXAMPLES::
sage: L = lie_algebras.sl(QQ, 3)
sage: La = L.cartan_type().root_system().weight_lattice().fundamental_weights()
sage: M = L.verma_module(La[1])
sage: pbw = M.pbw_basis()
sage: f1,f2 = pbw(L.f(1)), pbw(L.f(2))
sage: f1 * f2 * f1 * M.highest_weight_vector() # indirect doctest
f[-alpha[2]]*f[-alpha[1]]^2*v[Lambda[1]]
+ f[-alpha[1]]*f[-alpha[1] - alpha[2]]*v[Lambda[1]]
sage: def neg_key(x):
....: return -L.basis().keys().index(x)
sage: M = L.verma_module(La[1], basis_key=neg_key)
sage: f1 * f2 * f1 * M.highest_weight_vector() # indirect doctest
f[-alpha[1]]^2*f[-alpha[2]]*v[Lambda[1]]
- f[-alpha[1] - alpha[2]]*f[-alpha[1]]*v[Lambda[1]]
"""
return (-len(x), [self._triangular_key(l) for l in x.to_word_list()])
def _repr_(self):
"""
Return a string representation of ``self``.
EXAMPLES::
sage: L = LieAlgebra(QQ, cartan_type=['E',6])
sage: La = L.cartan_type().root_system().weight_lattice().fundamental_weights()
sage: M = L.verma_module(2*La[1] + 3*La[2] - 5*La[5])
sage: M
Verma module with highest weight 2*Lambda[1] + 3*Lambda[2] - 5*Lambda[5]
of Lie algebra of ['E', 6] in the Chevalley basis
"""
return "Verma module with highest weight {} of {}".format(self._weight, self._g)
def _latex_(self):
r"""
Return a latex representation of ``self``.
EXAMPLES::
sage: L = LieAlgebra(QQ, cartan_type=['E',7])
sage: La = L.cartan_type().root_system().weight_space().fundamental_weights()
sage: M = L.verma_module(2*La[1] + 7*La[4] - 3/4*La[7])
sage: latex(M)
M_{2\Lambda_{1} + 7\Lambda_{4} - \frac{3}{4}\Lambda_{7}}
"""
from sage.misc.latex import latex
return "M_{{{}}}".format(latex(self._weight))
def _repr_generator(self, m):
r"""
Return a string representation of the generator indexed by ``m``.
EXAMPLES::
sage: L = lie_algebras.sp(QQ, 4)
sage: La = L.cartan_type().root_system().ambient_space().fundamental_weights()
sage: M = L.verma_module(-1/2*La[1] + 3/7*La[2])
sage: f1, f2 = L.f(1), L.f(2)
sage: x = M.pbw_basis()(L([f1, [f1, f2]]))
sage: v = x * M.highest_weight_vector()
sage: M._repr_generator(v.leading_support())
'f[-2*alpha[1] - alpha[2]]*v[(-1/14, 3/7)]'
sage: M.highest_weight_vector()
v[(-1/14, 3/7)]
sage: 2 * M.highest_weight_vector()
2*v[(-1/14, 3/7)]
"""
ret = super(VermaModule, self)._repr_generator(m)
if ret == '1':
ret = ''
else:
ret += '*'
return ret + "v[{}]".format(self._weight)
def _latex_generator(self, m):
r"""
Return a latex representation of the generator indexed by ``m``.
EXAMPLES::
sage: L = lie_algebras.sp(QQ, 4)
sage: La = L.cartan_type().root_system().ambient_space().fundamental_weights()
sage: M = L.verma_module(-1/2*La[1] + 3/7*La[2])
sage: f1, f2 = L.f(1), L.f(2)
sage: x = M.pbw_basis()(L([f1, [f1, f2]]))
sage: v = x * M.highest_weight_vector()
sage: M._latex_generator(v.leading_support())
f_{-2\alpha_{1} - \alpha_{2}} v_{-\frac{1}{14}e_{0} + \frac{3}{7}e_{1}}
sage: latex(2 * M.highest_weight_vector())
2 v_{-\frac{1}{14}e_{0} + \frac{3}{7}e_{1}}
sage: latex(M.highest_weight_vector())
v_{-\frac{1}{14}e_{0} + \frac{3}{7}e_{1}}
"""
ret = super(VermaModule, self)._latex_generator(m)
if ret == '1':
ret = ''
from sage.misc.latex import latex
return ret + " v_{{{}}}".format(latex(self._weight))
_repr_term = _repr_generator
_latex_term = _latex_generator
def lie_algebra(self):
"""
Return the underlying Lie algebra of ``self``.
EXAMPLES::
sage: L = lie_algebras.so(QQ, 9)
sage: La = L.cartan_type().root_system().weight_space().fundamental_weights()
sage: M = L.verma_module(La[3] - 1/2*La[1])
sage: M.lie_algebra()
Lie algebra of ['B', 4] in the Chevalley basis
"""
return self._g
def pbw_basis(self):
"""
Return the PBW basis of the underlying Lie algebra
used to define ``self``.
EXAMPLES::
sage: L = lie_algebras.so(QQ, 8)
sage: La = L.cartan_type().root_system().weight_lattice().fundamental_weights()
sage: M = L.verma_module(La[2] - 2*La[3])
sage: M.pbw_basis()
Universal enveloping algebra of Lie algebra of ['D', 4] in the Chevalley basis
in the Poincare-Birkhoff-Witt basis
"""
return self._pbw
poincare_birkhoff_witt_basis = pbw_basis
@cached_method
def highest_weight_vector(self):
"""
Return the highest weight vector of ``self``.
EXAMPLES::
sage: L = lie_algebras.sp(QQ, 6)
sage: La = L.cartan_type().root_system().weight_lattice().fundamental_weights()
sage: M = L.verma_module(La[1] - 3*La[2])
sage: M.highest_weight_vector()
v[Lambda[1] - 3*Lambda[2]]
"""
one = self.base_ring().one()
return self._from_dict({self._indices.one(): one},
remove_zeros=False, coerce=False)
def gens(self):
r"""
Return the generators of ``self`` as a `U(\mathfrak{g})`-module.
EXAMPLES::
sage: L = lie_algebras.sp(QQ, 6)
sage: La = L.cartan_type().root_system().weight_lattice().fundamental_weights()
sage: M = L.verma_module(La[1] - 3*La[2])
sage: M.gens()
(v[Lambda[1] - 3*Lambda[2]],)
"""
return (self.highest_weight_vector(),)
def highest_weight(self):
r"""
Return the highest weight of ``self``.
EXAMPLES::
sage: L = lie_algebras.so(QQ, 7)
sage: La = L.cartan_type().root_system().weight_space().fundamental_weights()
sage: M = L.verma_module(4*La[1] - 3/2*La[2])
sage: M.highest_weight()
4*Lambda[1] - 3/2*Lambda[2]
"""
return self._weight
def degree_on_basis(self, m):
r"""
Return the degree (or weight) of the basis element indexed by ``m``.
EXAMPLES::
sage: L = lie_algebras.sl(QQ, 3)
sage: La = L.cartan_type().root_system().weight_lattice().fundamental_weights()
sage: M = L.verma_module(2*La[1] + 3*La[2])
sage: v = M.highest_weight_vector()
sage: M.degree_on_basis(v.leading_support())
2*Lambda[1] + 3*Lambda[2]
sage: pbw = M.pbw_basis()
sage: G = list(pbw.gens())
sage: f1, f2 = L.f()
sage: x = pbw(f1.bracket(f2)) * pbw(f1) * v
sage: x.degree()
-Lambda[1] + 3*Lambda[2]
"""
P = self._weight.parent()
return self._weight + P.sum(P(e * self._g.degree_on_basis(k))
for k,e in m.dict().items())
def _coerce_map_from_(self, R):
r"""
Return if there is a coercion map from ``R`` to ``self``.
There is a coercion map from ``R`` if and only if
- there is a coercion from ``R`` into the base ring;
- ``R`` is a Verma module over the same Lie algebra and
there is a non-zero Verma module morphism from ``R``
into ``self``.
EXAMPLES::
sage: L = lie_algebras.so(QQ, 8)
sage: La = L.cartan_type().root_system().weight_lattice().fundamental_weights()
sage: M = L.verma_module(La[1] + La[2])
sage: Mp = L.verma_module(M.highest_weight().dot_action([1,2]))
sage: Mpp = L.verma_module(M.highest_weight().dot_action([1,2]) + La[1])
sage: M._coerce_map_from_(Mp) is not None
True
sage: Mp._coerce_map_from_(M)
sage: M._coerce_map_from_(Mpp)
sage: M._coerce_map_from_(ZZ)
True
"""
if self.base_ring().has_coerce_map_from(R):
return True
if isinstance(R, VermaModule) and R._g is self._g:
H = Hom(R, self)
if H.dimension() == 1:
return H.natural_map()
return super(VermaModule, self)._coerce_map_from_(R)
def _element_constructor_(self, x):
r"""
Construct an element of ``self`` from ``x``.
EXAMPLES::
sage: L = lie_algebras.sl(QQ, 3)
sage: La = L.cartan_type().root_system().weight_lattice().fundamental_weights()
sage: M = L.verma_module(La[1] + 2*La[2])
sage: M(3)
3*v[Lambda[1] + 2*Lambda[2]]
sage: pbw = M.pbw_basis()
sage: [M(g) for g in pbw.gens()]
[0,
0,
0,
v[Lambda[1] + 2*Lambda[2]],
2*v[Lambda[1] + 2*Lambda[2]],
f[-alpha[2]]*v[Lambda[1] + 2*Lambda[2]],
f[-alpha[1]]*v[Lambda[1] + 2*Lambda[2]],
f[-alpha[1] - alpha[2]]*v[Lambda[1] + 2*Lambda[2]]]
"""
if x in self.base_ring():
return self._from_dict({self._indices.one(): x})
if isinstance(x, self._pbw.element_class):
return self.highest_weight_vector()._acted_upon_(x, False)
return super(VermaModule, self)._element_constructor_(self, x)
@lazy_attribute
def _dominant_data(self):
r"""
Return the closest to dominant weight in the dot orbit of
the highest weight of ``self`` and the corresponding reduced word.
EXAMPLES::
sage: L = lie_algebras.sl(QQ, 3)
sage: La = L.cartan_type().root_system().weight_lattice().fundamental_weights()
sage: M = L.verma_module(La[1] + La[2])
sage: M._dominant_data
(Lambda[1] + Lambda[2], [])
sage: M = L.verma_module(M.highest_weight().dot_action([1,2]))
sage: M._dominant_data
(Lambda[1] + Lambda[2], [1, 2])
sage: M = L.verma_module(-4*La[1] - La[2])
sage: M._dominant_data
(-Lambda[1] + 2*Lambda[2], [1, 2])
"""
P = self._weight.parent()
wt, w = (self._weight + P.rho()).to_dominant_chamber(reduced_word=True)
return (wt - P.rho(), w)
def is_singular(self):
r"""
Return if ``self`` is a singular Verma module.
A Verma module `M_{\lambda}` is *singular* if there does not
exist a dominant weight `\tilde{\lambda}` that is in the dot
orbit of `\lambda`. We call a Verma module *regular* otherwise.
EXAMPLES::
sage: L = lie_algebras.sl(QQ, 3)
sage: La = L.cartan_type().root_system().weight_lattice().fundamental_weights()
sage: M = L.verma_module(La[1] + La[2])
sage: M.is_singular()
False
sage: M = L.verma_module(La[1] - La[2])
sage: M.is_singular()
True
sage: M = L.verma_module(2*La[1] - 10*La[2])
sage: M.is_singular()
False
sage: M = L.verma_module(-2*La[1] - 2*La[2])
sage: M.is_singular()
False
sage: M = L.verma_module(-4*La[1] - La[2])
sage: M.is_singular()
True
"""
return not self._dominant_data[0].is_dominant()
def homogeneous_component_basis(self, d):
r"""
Return a basis for the ``d``-th homogeneous component of ``self``.
EXAMPLES::
sage: L = lie_algebras.sl(QQ, 3)
sage: P = L.cartan_type().root_system().weight_lattice()
sage: La = P.fundamental_weights()
sage: al = P.simple_roots()
sage: mu = 2*La[1] + 3*La[2]
sage: M = L.verma_module(mu)
sage: M.homogeneous_component_basis(mu - al[2])
[f[-alpha[2]]*v[2*Lambda[1] + 3*Lambda[2]]]
sage: M.homogeneous_component_basis(mu - 3*al[2])
[f[-alpha[2]]^3*v[2*Lambda[1] + 3*Lambda[2]]]
sage: M.homogeneous_component_basis(mu - 3*al[2] - 2*al[1])
[f[-alpha[2]]*f[-alpha[1] - alpha[2]]^2*v[2*Lambda[1] + 3*Lambda[2]],
f[-alpha[2]]^2*f[-alpha[1]]*f[-alpha[1] - alpha[2]]*v[2*Lambda[1] + 3*Lambda[2]],
f[-alpha[2]]^3*f[-alpha[1]]^2*v[2*Lambda[1] + 3*Lambda[2]]]
sage: M.homogeneous_component_basis(mu - La[1])
Family ()
"""
diff = _convert_wt_to_root(d - self._weight)
if diff is None or not all(coeff <= 0 and coeff in ZZ for coeff in diff):
return Family([])
return sorted(self._homogeneous_component_f(diff))
@cached_method
def _homogeneous_component_f(self, d):
r"""
Return a basis of the PBW given by ``d`` expressed in the
root lattice in terms of the simple roots.
INPUT:
- ``d`` -- the coefficients of the simple roots as a vector
EXAMPLES::
sage: L = lie_algebras.sl(QQ, 3)
sage: La = L.cartan_type().root_system().weight_lattice().fundamental_weights()
sage: M = L.verma_module(La[1] + La[2])
sage: sorted(M._homogeneous_component_f(vector([-1,-2])), key=str)
[f[-alpha[2]]*f[-alpha[1] - alpha[2]]*v[Lambda[1] + Lambda[2]],
f[-alpha[2]]^2*f[-alpha[1]]*v[Lambda[1] + Lambda[2]]]
sage: sorted(M._homogeneous_component_f(vector([-5,-4])), key=str)
[f[-alpha[1]]*f[-alpha[1] - alpha[2]]^4*v[Lambda[1] + Lambda[2]],
f[-alpha[2]]*f[-alpha[1]]^2*f[-alpha[1] - alpha[2]]^3*v[Lambda[1] + Lambda[2]],
f[-alpha[2]]^2*f[-alpha[1]]^3*f[-alpha[1] - alpha[2]]^2*v[Lambda[1] + Lambda[2]],
f[-alpha[2]]^3*f[-alpha[1]]^4*f[-alpha[1] - alpha[2]]*v[Lambda[1] + Lambda[2]],
f[-alpha[2]]^4*f[-alpha[1]]^5*v[Lambda[1] + Lambda[2]]]
"""
if not d:
return frozenset([self.highest_weight_vector()])
f = {i: self._pbw(g) for i,g in enumerate(self._g.f())}
basis = d.parent().basis() # Standard basis vectors
ret = set()
def degree(m):
m = m.dict()
if not m:
return d.parent().zero()
return sum(e * self._g.degree_on_basis(k) for k,e in m.items()).to_vector()
for i in f:
if d[i] == 0:
continue
for b in self._homogeneous_component_f(d + basis[i]):
temp = f[i] * b
ret.update([self.monomial(m) for m in temp.support() if degree(m) == d])
return frozenset(ret)
def _Hom_(self, Y, category=None, **options):
r"""
Return the homset from ``self`` to ``Y`` in the
category ``category``.
INPUT:
- ``Y`` -- an object
- ``category`` -- a subcategory of :class:`Crystals`() or ``None``
The sole purpose of this method is to construct the homset as a
:class:`~sage.algebras.lie_algebras.verma_module.VermaModuleHomset`.
If ``category`` is specified and is not a subcategory of
``self.category()``, a ``TypeError`` is raised instead.
This method is not meant to be called directly. Please use
:func:`sage.categories.homset.Hom` instead.
EXAMPLES::
sage: L = lie_algebras.sl(QQ, 3)
sage: La = L.cartan_type().root_system().weight_space().fundamental_weights()
sage: M = L.verma_module(La[1] + La[2])
sage: Mp = L.verma_module(3*La[1] - 3*La[2])
sage: H = Hom(M, Mp)
sage: type(H)
<...VermaModuleHomset_with_category_with_equality_by_id'>
"""
if not (isinstance(Y, VermaModule) and self._g is Y._g):
raise TypeError("{} must be a Verma module of {}".format(Y, self._g))
if category is not None and not category.is_subcategory(self.category()):
raise TypeError("{} is not a subcategory of {}".format(category, self.category()))
return VermaModuleHomset(self, Y)
class Element(CombinatorialFreeModule.Element):
def _acted_upon_(self, scalar, self_on_left=False):
"""
Return the action of ``scalar`` on ``self``.
Check that other PBW algebras have an action::
sage: L = lie_algebras.sp(QQ, 6)
sage: La = L.cartan_type().root_system().weight_lattice().fundamental_weights()
sage: M = L.verma_module(La[1] - 3*La[2])
sage: PBW = L.pbw_basis()
sage: F1 = PBW(L.f(1))
sage: F1 * M.highest_weight_vector()
f[-alpha[1]]*v[Lambda[1] - 3*Lambda[2]]
sage: F1.parent() is M.pbw_basis()
False
sage: F1 * M.highest_weight_vector()
f[-alpha[1]]*v[Lambda[1] - 3*Lambda[2]]
sage: E1 = PBW(L.e(1))
sage: E1 * F1
PBW[alpha[1]]*PBW[-alpha[1]]
sage: E1 * F1 * M.highest_weight_vector()
v[Lambda[1] - 3*Lambda[2]]
sage: M.pbw_basis()(E1 * F1)
PBW[-alpha[1]]*PBW[alpha[1]] + PBW[alphacheck[1]]
"""
P = self.parent()
# Check for scalars first
if scalar in P.base_ring():
# Don't have this be a super call
return CombinatorialFreeModule.Element._acted_upon_(self, scalar, self_on_left)
# Check for Lie algebra elements
try:
scalar = P._g(scalar)
except (ValueError, TypeError):
pass
# Check for PBW elements
try:
scalar = P._pbw(scalar)
except (ValueError, TypeError):
# Cannot be made into a PBW element, so propogate it up
return CombinatorialFreeModule.Element._acted_upon_(self,
scalar, self_on_left)
# We only implement x * self, i.e., as a left module
if self_on_left:
return None
# Lift ``self`` to the PBW basis and do multiplication there
mc = self._monomial_coefficients
d = {P._pbw._indices(x.dict()): mc[x] for x in mc} # Lift the index set
ret = scalar * P._pbw._from_dict(d, remove_zeros=False, coerce=False)
# Now have ``ret`` act on the highest weight vector
d = {}
for m in ret._monomial_coefficients:
c = ret._monomial_coefficients[m]
mp = {}
for k,e in reversed(m._sorted_items()):
part = P._g._part_on_basis(k)
if part > 0:
mp = None
break
elif part == 0:
c *= P._g._weight_action(k, P._weight)**e
else:
mp[k] = e
# This term is 0, so nothing to do
if mp is None:
continue
# Convert back to an element of the indexing set
mp = P._indices(mp)
if mp in d:
d[mp] += c
else:
d[mp] = c
return P._from_dict(d)
_lmul_ = _acted_upon_
_rmul_ = _acted_upon_
#####################################################################
## Morphisms and Homset
class VermaModuleMorphism(Morphism):
"""
A morphism of Verma modules.
"""
def __init__(self, parent, scalar):
"""
Initialize ``self``.
EXAMPLES::
sage: L = lie_algebras.sl(QQ, 3)
sage: La = L.cartan_type().root_system().weight_lattice().fundamental_weights()
sage: M = L.verma_module(La[1] + La[2])
sage: Mp = L.verma_module(M.highest_weight().dot_action([1,2]))
sage: phi = Hom(Mp, M).natural_map()
sage: TestSuite(phi).run()
"""
self._scalar = scalar
Morphism.__init__(self, parent)
def _repr_type(self):
"""
Return a string describing the specific type of this map,
to be used when printing ``self``.
EXAMPLES::
sage: L = lie_algebras.sl(QQ, 3)
sage: La = L.cartan_type().root_system().weight_lattice().fundamental_weights()
sage: M = L.verma_module(La[1] + La[2])
sage: Mp = L.verma_module(M.highest_weight().dot_action([1,2]))
sage: phi = Hom(Mp, M).natural_map()
sage: phi._repr_type()
'Verma module'
"""
return "Verma module"
def _repr_defn(self):
"""
Return a string describing the definition of ``self``,
to be used when printing ``self``.
sage: L = lie_algebras.sl(QQ, 3)
sage: La = L.cartan_type().root_system().weight_lattice().fundamental_weights()
sage: M = L.verma_module(La[1] + La[2])
sage: Mp = L.verma_module(M.highest_weight().dot_action([1,2]))
sage: phi = Hom(Mp, M).natural_map()
sage: phi._repr_defn()
'v[-5*Lambda[1] + Lambda[2]] |--> f[-alpha[2]]^2*f[-alpha[1]]^4*v[Lambda[1]
+ Lambda[2]] + 8*f[-alpha[2]]*f[-alpha[1]]^3*f[-alpha[1] - alpha[2]]*v[Lambda[1]
+ Lambda[2]] + 12*f[-alpha[1]]^2*f[-alpha[1] - alpha[2]]^2*v[Lambda[1] + Lambda[2]]'
alpha[1]]^2*f[-alpha[1] - alpha[2]]^2*v[Lambda[1] + Lambda[2]]'
sage: psi = Hom(M, Mp).natural_map()
sage: psi
Verma module morphism:
From: Verma module with highest weight Lambda[1] + Lambda[2]
of Lie algebra of ['A', 2] in the Chevalley basis
To: Verma module with highest weight -5*Lambda[1] + Lambda[2]
of Lie algebra of ['A', 2] in the Chevalley basis
Defn: v[Lambda[1] + Lambda[2]] |--> 0
"""
v = self.domain().highest_weight_vector()
if not self._scalar:
return "{} |--> {}".format(v, self.codomain().zero())
return "{} |--> {}".format(v, self._scalar * self.parent().singular_vector())
def _richcmp_(self, other, op):
r"""
Return whether this morphism and ``other`` satisfy ``op``.
EXAMPLES::
sage: L = lie_algebras.sl(QQ, 3)
sage: La = L.cartan_type().root_system().weight_lattice().fundamental_weights()
sage: M = L.verma_module(La[1] + La[2])
sage: Mp = L.verma_module(M.highest_weight().dot_action([1,2]))
sage: H = Hom(Mp, M)
sage: H(1) < H(2)
True
sage: H(2) < H(1)
False
sage: H.zero() == H(0)
True
sage: H(3) <= H(3)
True
"""
return richcmp(self._scalar, other._scalar, op)
def _call_(self, x):
r"""
Apply this morphism to ``x``.
EXAMPLES::
sage: L = lie_algebras.sl(QQ, 3)
sage: La = L.cartan_type().root_system().weight_lattice().fundamental_weights()
sage: M = L.verma_module(La[1] + La[2])
sage: Mp = L.verma_module(M.highest_weight().dot_action([1,2]))
sage: pbw = M.pbw_basis()
sage: f1, f2 = pbw(L.f(1)), pbw(L.f(2))
sage: v = Mp.highest_weight_vector()
sage: phi = Hom(Mp, M).natural_map()
sage: phi(f1 * v) == f1 * phi(v)
True
sage: phi(f2 * f1 * v) == f2 * f1 * phi(v)
True
sage: phi(f1 * f2 * f1 * v) == f1 * f2 * f1 * phi(v)
True
sage: Mpp = L.verma_module(M.highest_weight().dot_action([1,2]) + La[1])
sage: psi = Hom(Mpp, M).natural_map()
sage: v = Mpp.highest_weight_vector()
sage: psi(v)
0
"""
if not self._scalar or self.parent().singular_vector() is None:
return self.codomain().zero()
mc = x.monomial_coefficients(copy=False)
return self.codomain().linear_combination((self._on_basis(m), self._scalar * c)
for m,c in mc.items())
def _on_basis(self, m):
"""
Return the image of the basis element indexed by ``m``.
EXAMPLES::
sage: L = lie_algebras.sl(QQ, 3)
sage: La = L.cartan_type().root_system().weight_lattice().fundamental_weights()
sage: M = L.verma_module(La[1] + La[2])
sage: Mp = L.verma_module(M.highest_weight().dot_action([1,2]))
sage: pbw = M.pbw_basis()
sage: f1, f2 = pbw(L.f(1)), pbw(L.f(2))
sage: v = Mp.highest_weight_vector()
sage: phi = Hom(Mp, M).natural_map()
sage: phi._on_basis((f1 * v).leading_support()) == f1 * phi(v)
True
"""
pbw = self.codomain()._pbw
return pbw.monomial(pbw._indices(m.dict())) * self.parent().singular_vector()
def _add_(self, other):
"""
Add ``self`` and ``other``.
EXAMPLES::
sage: L = lie_algebras.sl(QQ, 3)
sage: La = L.cartan_type().root_system().weight_lattice().fundamental_weights()
sage: M = L.verma_module(La[1] + La[2])
sage: Mp = L.verma_module(M.highest_weight().dot_action([1,2]))
sage: phi = Hom(Mp, M).natural_map()
sage: (phi + 3/2 * phi)._scalar
5/2
"""
return type(self)(self.parent(), self._scalar + other._scalar)
def _sub_(self, other):
"""
Subtract ``self`` and ``other``.
EXAMPLES::
sage: L = lie_algebras.sl(QQ, 3)
sage: La = L.cartan_type().root_system().weight_lattice().fundamental_weights()
sage: M = L.verma_module(La[1] + La[2])
sage: Mp = L.verma_module(M.highest_weight().dot_action([1,2]))
sage: phi = Hom(Mp, M).natural_map()
sage: (phi - 3/2 * phi)._scalar
-1/2
"""
return type(self)(self.parent(), self._scalar - other._scalar)
def _acted_upon_(self, other, self_on_left):
"""
Return the action of ``other`` on ``self``.
EXAMPLES::
sage: L = lie_algebras.sl(QQ, 3)
sage: La = L.cartan_type().root_system().weight_lattice().fundamental_weights()
sage: M = L.verma_module(La[1] + La[2])
sage: Mp = L.verma_module(M.highest_weight().dot_action([1,2]))
sage: phi = Hom(Mp, M).natural_map()
sage: phi._scalar
1
sage: (0 * phi)._scalar
0
sage: R.<x> = QQ[]
sage: x * phi
Traceback (most recent call last):
...
TypeError: unsupported operand parent(s) for *: ...
"""
R = self.parent().base_ring()
if other not in R:
return None
return type(self)(self.parent(), R(other) * self._scalar)
def _composition_(self, right, homset):
r"""
Return the composition of ``self`` and ``right``.
INPUT:
- ``self``, ``right`` -- maps
- homset -- a homset
ASSUMPTION:
The codomain of ``right`` is contained in the domain of ``self``.
This assumption is not verified.
EXAMPLES::
sage: L = lie_algebras.sl(QQ, 3)
sage: La = L.cartan_type().root_system().weight_lattice().fundamental_weights()
sage: M = L.verma_module(La[1] + La[2])
sage: Mp = L.verma_module(M.highest_weight().dot_action([1,2]))
sage: Mpp = L.verma_module(M.highest_weight().dot_action([1,2]) + La[1])
sage: phi = Hom(Mp, M).natural_map()
sage: psi = Hom(Mpp, Mp).natural_map()
sage: xi = phi * psi
sage: xi._scalar
0
"""
if (isinstance(right, VermaModuleMorphism)
and right.domain()._g is self.codomain()._g):
return homset.element_class(homset, right._scalar * self._scalar)
return super(VermaModuleMorphism, self)._composition_(right, homset)
def is_injective(self):
r"""
Return if ``self`` is injective or not.
A Verma module morphism `\phi : M \to M'` is injective if
and only if `\dim \hom(M, M') = 1` and `\phi \neq 0`.
EXAMPLES::
sage: L = lie_algebras.sl(QQ, 3)
sage: La = L.cartan_type().root_system().weight_lattice().fundamental_weights()
sage: M = L.verma_module(La[1] + La[2])
sage: Mp = L.verma_module(M.highest_weight().dot_action([1,2]))
sage: Mpp = L.verma_module(M.highest_weight().dot_action([1,2]) + La[1])
sage: phi = Hom(Mp, M).natural_map()
sage: phi.is_injective()
True
sage: (0 * phi).is_injective()
False
sage: psi = Hom(Mpp, Mp).natural_map()
sage: psi.is_injective()
False
"""
return self.parent().singular_vector() is not None and bool(self._scalar)
def is_surjective(self):
"""
Return if ``self`` is surjective or not.
A Verma module morphism is surjective if and only if the
domain is equal to the codomain and it is not the zero
morphism.
EXAMPLES::
sage: L = lie_algebras.sl(QQ, 3)
sage: La = L.cartan_type().root_system().weight_lattice().fundamental_weights()
sage: M = L.verma_module(La[1] + La[2])
sage: Mp = L.verma_module(M.highest_weight().dot_action([1,2]))
sage: phi = Hom(M, M).natural_map()
sage: phi.is_surjective()
True
sage: (0 * phi).is_surjective()
False
sage: psi = Hom(Mp, M).natural_map()
sage: psi.is_surjective()
False
"""
return self.domain() == self.codomain() and bool(self._scalar)
class VermaModuleHomset(Homset):
r"""
The set of morphisms from one Verma module to another
considered as `U(\mathfrak{g})`-representations.
Let `M_{w \cdot \lambda}` and `M_{w' \cdot \lambda'}` be
Verma modules, `\cdot` is the dot action, and `\lambda + \rho`,
`\lambda' + \rho` are dominant weights. Then we have
.. MATH::
\dim \hom(M_{w \cdot \lambda}, M_{w' \cdot \lambda'}) = 1
if and only if `\lambda = \lambda'` and `w' \leq w` in Bruhat
order. Otherwise the homset is 0 dimensional.
"""
def __call__(self, x, **options):
"""
Construct a morphism in this homset from ``x`` if possible.
EXAMPLES::