Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sagesmc
Path: blob/master/src/sage/combinat/crystals/kirillov_reshetikhin.py
8817 views
1
r"""
2
Kirillov-Reshetikhin Crystals
3
"""
4
5
#*****************************************************************************
6
# Copyright (C) 2009 Anne Schilling <anne at math.ucdavis.edu>
7
#
8
# Distributed under the terms of the GNU General Public License (GPL)
9
#
10
# This code is distributed in the hope that it will be useful,
11
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
# General Public License for more details.
14
#
15
# The full text of the GPL is available at:
16
#
17
# http://www.gnu.org/licenses/
18
#****************************************************************************
19
# Acknowledgment: most of the design and implementation of this
20
# library is heavily inspired from MuPAD-Combinat.
21
#****************************************************************************
22
23
from sage.misc.cachefunc import cached_method
24
from sage.misc.abstract_method import abstract_method
25
from sage.misc.functional import is_even, is_odd
26
from sage.functions.other import floor, ceil
27
from sage.combinat.combinat import CombinatorialObject
28
from sage.structure.parent import Parent
29
from sage.categories.regular_crystals import RegularCrystals
30
from sage.categories.finite_crystals import FiniteCrystals
31
from sage.rings.integer import Integer
32
from sage.rings.all import QQ
33
from sage.combinat.crystals.affine import AffineCrystalFromClassical, \
34
AffineCrystalFromClassicalElement, AffineCrystalFromClassicalAndPromotion, \
35
AffineCrystalFromClassicalAndPromotionElement
36
from sage.combinat.crystals.highest_weight_crystals import HighestWeightCrystal
37
from sage.combinat.crystals.littelmann_path import CrystalOfProjectedLevelZeroLSPaths
38
from sage.combinat.crystals.direct_sum import DirectSumOfCrystals
39
from sage.combinat.root_system.cartan_type import CartanType
40
from sage.combinat.root_system.root_system import RootSystem
41
from sage.combinat.crystals.tensor_product import CrystalOfTableaux, TensorProductOfCrystals
42
from sage.combinat.tableau import Tableau
43
from sage.combinat.partition import Partition, Partitions
44
from sage.combinat.integer_vector import IntegerVectors
45
46
47
def KirillovReshetikhinCrystalFromLSPaths(cartan_type, r, s=1):
48
r"""
49
Single column Kirillov-Reshetikhin crystals.
50
51
This yields the single column Kirillov-Reshetikhin crystals
52
from the projected level zero LS paths, see :class:`sage.combinat.crystals.littelmann_paths.CrystalOfLSPaths`.
53
This works for all types (even exceptional types).
54
The weight of the canonical element in this crystal is `\Lambda_r`.
55
For other implementation see :meth:`KirillovReshetikhinCrystal`.
56
57
EXAMPLES::
58
59
sage: from sage.combinat.crystals.kirillov_reshetikhin import KirillovReshetikhinCrystalFromLSPaths
60
sage: K = KirillovReshetikhinCrystalFromLSPaths(['A',2,1],2)
61
sage: KR = KirillovReshetikhinCrystal(['A',2,1],2,1)
62
sage: G = K.digraph()
63
sage: GR = KR.digraph()
64
sage: G.is_isomorphic(GR, edge_labels = True)
65
True
66
67
sage: K = KirillovReshetikhinCrystalFromLSPaths(['C',3,1],2)
68
sage: KR = KirillovReshetikhinCrystal(['C',3,1],2,1)
69
sage: G = K.digraph()
70
sage: GR = KR.digraph()
71
sage: G.is_isomorphic(GR, edge_labels = True)
72
True
73
74
sage: K = KirillovReshetikhinCrystalFromLSPaths(['E',6,1],1)
75
sage: KR = KirillovReshetikhinCrystal(['E',6,1],1,1)
76
sage: G = K.digraph()
77
sage: GR = KR.digraph()
78
sage: G.is_isomorphic(GR, edge_labels = True)
79
True
80
sage: K.cardinality()
81
27
82
83
sage: K = KirillovReshetikhinCrystalFromLSPaths(['G',2,1],1)
84
sage: K.cardinality()
85
7
86
87
sage: K = KirillovReshetikhinCrystalFromLSPaths(['B',3,1],2)
88
sage: KR = KirillovReshetikhinCrystal(['B',3,1],2,1)
89
sage: KR.cardinality()
90
22
91
sage: K.cardinality()
92
22
93
sage: G = K.digraph()
94
sage: GR = KR.digraph()
95
sage: G.is_isomorphic(GR, edge_labels = True)
96
True
97
98
99
TESTS::
100
101
sage: K = KirillovReshetikhinCrystalFromLSPaths(['G',2,1],2)
102
sage: K.cardinality()
103
15
104
105
For `s>1` these crystals yield `s`-fold tensor products of Kirillov-Reshetikhin crystals::
106
107
sage: K = KirillovReshetikhinCrystalFromLSPaths(['A',1,1],1,3)
108
sage: B = KirillovReshetikhinCrystal(['A',1,1],1,1)
109
sage: T = TensorProductOfCrystals(B,B,B)
110
sage: G = K.digraph()
111
sage: GT = T.digraph()
112
sage: G.is_isomorphic(GT, edge_labels = True)
113
True
114
115
sage: K = KirillovReshetikhinCrystalFromLSPaths(['B',2,1],1,2)
116
sage: B = KirillovReshetikhinCrystal(['B',2,1],1,1)
117
sage: T = TensorProductOfCrystals(B,B)
118
sage: G = K.digraph()
119
sage: GT = T.digraph()
120
sage: G.is_isomorphic(GT, edge_labels = True)
121
True
122
123
sage: K = KirillovReshetikhinCrystalFromLSPaths(['B',2,1],2,3)
124
sage: B = KirillovReshetikhinCrystal(['B',2,1],2,1)
125
sage: T = TensorProductOfCrystals(B,B,B)
126
sage: GT = T.digraph()
127
sage: G = K.digraph()
128
sage: G.is_isomorphic(GT, edge_labels = True)
129
True
130
"""
131
R = RootSystem(cartan_type)
132
La = R.weight_space().basis()
133
weight = s*La[r]
134
return CrystalOfProjectedLevelZeroLSPaths(weight)
135
136
137
def KirillovReshetikhinCrystal(cartan_type, r, s):
138
r"""
139
Return the Kirillov-Reshetikhin crystal `B^{r,s}` of the given type.
140
141
For more information about general crystals see :mod:`sage.combinat.crystals`.
142
143
Many Kirillov-Reshetikhin crystals are constructed from a
144
classical crystal together with an automorphism `p` on the level of crystals which
145
corresponds to a Dynkin diagram automorphism mapping node 0 to some other node `i`.
146
The action of `f_0` and `e_0` is then constructed using
147
`f_0 = p^{-1} \circ f_i \circ p`.
148
149
For example, for type `A_n^{(1)}` the Kirillov-Reshetikhin crystal `B^{r,s}`
150
is obtained from the classical crystal `B(s \omega_r)` using the
151
promotion operator. For other types, see [Shimozono02]_, [Schilling08]_,
152
and [JS2010]_.
153
154
Other Kirillov-Reshetikhin crystals are constructed using similarity methods.
155
See Section 4 of [FOS09]_.
156
157
For an implementation of Kirillov-Reshetikhin crystals for `s = 1` from
158
crystals of LS paths, see :meth:`KirillovReshetikhinCrystalFromLSPaths`.
159
160
INPUT:
161
162
- ``cartan_type`` -- Affine type and rank
163
164
- ``r`` -- Label of finite Dynkin diagram
165
166
- ``s`` -- Positive integer
167
168
EXAMPLES::
169
170
sage: K = KirillovReshetikhinCrystal(['A',3,1], 2, 1)
171
sage: K.index_set()
172
(0, 1, 2, 3)
173
sage: K.list()
174
[[[1], [2]], [[1], [3]], [[2], [3]], [[1], [4]], [[2], [4]], [[3], [4]]]
175
sage: b=K(rows=[[1],[2]])
176
sage: b.weight()
177
-Lambda[0] + Lambda[2]
178
179
sage: K = KirillovReshetikhinCrystal(['A',3,1], 2,2)
180
sage: K.automorphism(K.module_generators[0])
181
[[2, 2], [3, 3]]
182
sage: K.module_generators[0].e(0)
183
[[1, 2], [2, 4]]
184
sage: K.module_generators[0].f(2)
185
[[1, 1], [2, 3]]
186
sage: K.module_generators[0].f(1)
187
sage: K.module_generators[0].phi(0)
188
0
189
sage: K.module_generators[0].phi(1)
190
0
191
sage: K.module_generators[0].phi(2)
192
2
193
sage: K.module_generators[0].epsilon(0)
194
2
195
sage: K.module_generators[0].epsilon(1)
196
0
197
sage: K.module_generators[0].epsilon(2)
198
0
199
sage: b = K(rows=[[1,2],[2,3]])
200
sage: b
201
[[1, 2], [2, 3]]
202
sage: b.f(2)
203
[[1, 2], [3, 3]]
204
205
sage: K = KirillovReshetikhinCrystal(['D',4,1], 2, 1)
206
sage: K.cartan_type()
207
['D', 4, 1]
208
sage: type(K.module_generators[0])
209
<class 'sage.combinat.crystals.kirillov_reshetikhin.KR_type_vertical_with_category.element_class'>
210
211
The following gives some tests with regards to Lemma 3.11 in [LOS12]_.
212
213
TESTS::
214
215
sage: K = KirillovReshetikhinCrystal(['A',4,2],2,1)
216
sage: Lambda = K.weight_lattice_realization().fundamental_weights()
217
sage: [b for b in K if b.Epsilon() == Lambda[0]]
218
[[]]
219
220
sage: K = KirillovReshetikhinCrystal(['D',4,2],1,2)
221
sage: Lambda = K.weight_lattice_realization().fundamental_weights()
222
sage: [b for b in K if b.Epsilon() == 2*Lambda[0]]
223
[[]]
224
sage: [b for b in K if b.Epsilon() == 2*Lambda[3]]
225
[[[3, -3]]]
226
sage: K = KirillovReshetikhinCrystal(['D',4,2],1,1)
227
sage: [b for b in K if b.Epsilon() == Lambda[3]]
228
[[[0]]]
229
230
sage: K = KirillovReshetikhinCrystal(['B',3,1],2,1)
231
sage: Lambda = K.weight_lattice_realization().fundamental_weights()
232
sage: [b for b in K if b.Epsilon() == Lambda[0]]
233
[[]]
234
sage: [b for b in K if b.Epsilon() == Lambda[1]]
235
[[[2], [-2]]]
236
sage: K = KirillovReshetikhinCrystal(['B',3,1],2,2)
237
sage: [b for b in K if b.Epsilon() == 2*Lambda[0]]
238
[[]]
239
sage: [b for b in K if b.Epsilon() == 2*Lambda[1]]
240
[[[1, 2], [-2, -1]]]
241
sage: K = KirillovReshetikhinCrystal(['B',3,1],2,3)
242
sage: [b for b in K if b.Epsilon() == 3*Lambda[1]] # long time
243
[[[1, 2, 2], [-2, -2, -1]]]
244
245
sage: K = KirillovReshetikhinCrystal(['D',4,1],2,2)
246
sage: Lambda = K.weight_lattice_realization().fundamental_weights()
247
sage: [b for b in K if b.Epsilon() == 2*Lambda[0]] # long time
248
[[]]
249
sage: [b for b in K if b.Epsilon() == 2*Lambda[4]] # long time
250
[[[3, -4], [4, -3]]]
251
252
sage: K = KirillovReshetikhinCrystal(['B',3,1],3,1)
253
sage: Lambda = K.weight_lattice_realization().fundamental_weights()
254
sage: [b for b in K if b.Epsilon() == Lambda[0]]
255
[[+++, []]]
256
sage: [b for b in K if b.Epsilon() == Lambda[1]]
257
[[-++, []]]
258
sage: K = KirillovReshetikhinCrystal(['B',3,1],3,3)
259
sage: [b for b in K if b.Epsilon() == 2*Lambda[0]] # long time
260
[[+++, [[1]]]]
261
sage: [b for b in K if b.Epsilon() == 2*Lambda[1]] # long time
262
[[-++, [[-1]]]]
263
264
sage: K = KirillovReshetikhinCrystal(['B',4,1],4,1)
265
sage: Lambda = K.weight_lattice_realization().fundamental_weights()
266
sage: [b for b in K if b.Epsilon() == Lambda[0]]
267
[[++++, []]]
268
sage: [b for b in K if b.Epsilon() == Lambda[1]]
269
[[-+++, []]]
270
271
sage: K = KirillovReshetikhinCrystal(['C',3,1],1,1)
272
sage: Lambda = K.weight_lattice_realization().fundamental_weights()
273
sage: [b for b in K if b.Epsilon() == Lambda[0]]
274
[[[1]]]
275
sage: [b for b in K if b.Epsilon() == Lambda[3]]
276
[[[-3]]]
277
sage: K = KirillovReshetikhinCrystal(['C',3,1],1,3)
278
sage: [b for b in K if b.Epsilon() == 2*Lambda[3]] # long time
279
[[[3, -3, -3]]]
280
sage: [b for b in K if b.Epsilon() == 2*Lambda[0]] # long time
281
[[[1]]]
282
283
REFERENCES:
284
285
.. [Shimozono02] M. Shimozono
286
*Affine type A crystal structure on tensor products of rectangles,
287
Demazure characters, and nilpotent varieties*,
288
J. Algebraic Combin. **15** (2002). no. 2. 151-187.
289
:arxiv:`math.QA/9804039`.
290
291
.. [Schilling08] A. Schilling. "Combinatorial structure of
292
Kirillov-Reshetikhin crystals of type `D_n(1)`, `B_n(1)`, `A_{2n-1}(2)`".
293
J. Algebra. **319** (2008). 2938-2962. :arxiv:`0704.2046`.
294
295
.. [JS2010] B. Jones, A. Schilling.
296
"Affine structures and a tableau model for `E_6` crystals",
297
J. Algebra. **324** (2010). 2512-2542.
298
:doi:`10.1016/j.bbr.2011.03.031`, :arxiv:`0909.2442`.
299
300
.. [FOS09] G. Fourier, M. Okado, A. Schilling.
301
*Kirillov-Reshetikhin crystals for nonexceptional types*.
302
Advances in Mathematics. **222** (2009). Issue 3. 1080-1116.
303
:arxiv:`0810.5067`.
304
305
.. [LOS12] C. Lecouvey, M. Okado, M. Shimozono.
306
"Affine crystals, one-dimensional sums and parabolic Lusztig
307
`q`-analogues". Mathematische Zeitschrift. **271** (2012). Issue 3-4.
308
819-865. :doi:`10.1007/s00209-011-0892-9`, :arxiv:`1002.3715`.
309
"""
310
ct = CartanType(cartan_type)
311
assert ct.is_affine()
312
if ct.is_untwisted_affine():
313
if ct.type() == 'A':
314
return KR_type_A(ct, r, s)
315
elif ct.type() == 'D':
316
if r<ct.rank()-2:
317
return KR_type_vertical(ct, r, s)
318
elif r in {ct.rank()-2,ct.rank()-1}:
319
return KR_type_spin(ct, r, s)
320
else:
321
raise ValueError("wrong range of parameters")
322
elif ct.type() == 'B':
323
if r<ct.rank()-1:
324
return KR_type_vertical(ct, r, s)
325
elif r == ct.rank()-1:
326
return KR_type_Bn(ct, r, s)
327
else:
328
raise ValueError("wrong range of parameters")
329
elif ct.type() == 'C':
330
if r<ct.rank()-1:
331
return KR_type_C(ct, r, s)
332
elif r == ct.rank()-1:
333
return KR_type_Cn(ct, r, s)
334
else:
335
raise ValueError("wrong range of parameters")
336
elif ct == CartanType(['E',6,1]) and r in [1,6,2]:
337
return KR_type_E6(ct, r, s)
338
else:
339
raise NotImplementedError
340
else:
341
if ct.dual().type() == 'B':
342
return KR_type_vertical(ct, r, s)
343
elif ct.type() == 'BC':
344
return KR_type_box(ct, r, s)
345
elif ct.dual().type() == 'BC':
346
return KR_type_A2(ct, r, s)
347
elif ct.dual().type() == 'C':
348
if r<ct.rank()-1:
349
return KR_type_box(ct, r, s)
350
elif r == ct.rank()-1:
351
return KR_type_Dn_twisted(ct, r, s)
352
else:
353
raise ValueError("wrong range of parameters")
354
else:
355
raise NotImplementedError
356
357
358
class KirillovReshetikhinGenericCrystal(AffineCrystalFromClassical):
359
r"""
360
Generic class for Kirillov-Reshetikhin crystal `B^{r,s}` of the given type.
361
362
Input is a Dynkin node ``r``, a positive integer ``s``, and a Cartan type
363
``cartan_type``.
364
"""
365
366
def __init__(self, cartan_type, r, s, dual = None):
367
r"""
368
Initializes a generic Kirillov-Reshetikhin crystal.
369
370
TESTS::
371
372
sage: K = KirillovReshetikhinCrystal(CartanType(['A',2,1]), 1, 1)
373
sage: K
374
Kirillov-Reshetikhin crystal of type ['A', 2, 1] with (r,s)=(1,1)
375
sage: K.r()
376
1
377
sage: K.s()
378
1
379
"""
380
# We need this here for the classical_decomposition() call
381
Parent.__init__(self, category = (RegularCrystals(), FiniteCrystals()))
382
if dual is None:
383
self._cartan_type = cartan_type
384
else:
385
self._cartan_type = CartanType(cartan_type).dual()
386
self._r = r
387
self._s = s
388
self._dual = dual
389
AffineCrystalFromClassical.__init__(self, cartan_type, self.classical_decomposition())
390
391
def _repr_(self):
392
"""
393
EXAMPLES::
394
395
sage: KirillovReshetikhinCrystal(CartanType(['A',2,1]), 1, 1) # indirect doctest
396
Kirillov-Reshetikhin crystal of type ['A', 2, 1] with (r,s)=(1,1)
397
"""
398
return "Kirillov-Reshetikhin crystal of type %s with (r,s)=(%d,%d)" % (self.cartan_type(), self.r(), self.s())
399
400
def _element_constructor_(self, *args, **options):
401
"""
402
Construct an element of ``self`` from the input.
403
404
EXAMPLES::
405
406
sage: K = KirillovReshetikhinCrystal(['A', 4, 1], 2, 1)
407
sage: K(columns=[[2,1]]) # indirect doctest
408
[[1], [2]]
409
"""
410
from sage.combinat.rigged_configurations.kr_tableaux import KirillovReshetikhinTableauxElement
411
if isinstance(args[0], KirillovReshetikhinTableauxElement):
412
elt = args[0]
413
# Check to make sure it can be converted
414
if elt.cartan_type() != self.cartan_type() \
415
or elt.parent().r() != self._r or elt.parent().s() != self._s:
416
raise ValueError("The Kirillov-Reshetikhin tableau must have the same Cartan type and shape")
417
418
to_hw = elt.to_classical_highest_weight()
419
rows = []
420
letters = elt.parent().letters
421
for val in to_hw[0].classical_weight():
422
# val in classical weight is a pair (i, mult)
423
rows.append([letters(val[0]+1)]*int(val[1]))
424
hw_elt = self(rows=rows)
425
f_str = reversed(to_hw[1])
426
return hw_elt.f_string(f_str)
427
return AffineCrystalFromClassical._element_constructor_(self, *args, **options)
428
429
@abstract_method
430
def classical_decomposition(self):
431
"""
432
Return the classical decomposition of ``self``.
433
434
EXAMPLES::
435
436
sage: K = KirillovReshetikhinCrystal(['A',3,1], 2,2)
437
sage: K.classical_decomposition()
438
The crystal of tableaux of type ['A', 3] and shape(s) [[2, 2]]
439
"""
440
441
def module_generator(self):
442
r"""
443
Returns the unique module generator of classical weight `s \Lambda_r` of a Kirillov-Reshetikhin crystal `B^{r,s}`
444
445
EXAMPLES::
446
447
sage: K = KirillovReshetikhinCrystal(['C',2,1],1,2)
448
sage: K.module_generator()
449
[[1, 1]]
450
sage: K = KirillovReshetikhinCrystal(['E',6,1],1,1)
451
sage: K.module_generator()
452
[(1,)]
453
454
sage: K = KirillovReshetikhinCrystal(['D',4,1],2,1)
455
sage: K.module_generator()
456
[[1], [2]]
457
"""
458
R = self.weight_lattice_realization()
459
Lambda = R.fundamental_weights()
460
r = self.r()
461
s = self.s()
462
weight = s*Lambda[r] - s*Lambda[0] * Lambda[r].level() / Lambda[0].level()
463
return [ b for b in self.module_generators if b.weight() == weight][0]
464
465
def r(self):
466
"""
467
Returns r of the underlying Kirillov-Reshetikhin crystal `B^{r,s}`
468
469
EXAMPLES::
470
471
sage: K = KirillovReshetikhinCrystal(['D',4,1], 2, 1)
472
sage: K.r()
473
2
474
"""
475
return self._r
476
477
def s(self):
478
"""
479
Returns s of the underlying Kirillov-Reshetikhin crystal `B^{r,s}`
480
481
EXAMPLES::
482
483
sage: K = KirillovReshetikhinCrystal(['D',4,1], 2, 1)
484
sage: K.s()
485
1
486
"""
487
return self._s
488
489
def is_perfect(self):
490
r"""
491
Returns True or False depending on whether ``self`` is a perfect crystal or not, respectively.
492
493
If ``self`` is the Kirillov-Reshetikhin crystal `B^{r,s}`, then it was proven in [FOS2010]_
494
that it is perfect if and only if `s/c_r` is an integer (where `c_r` is a constant related to the
495
type of the crystal).
496
497
REFERENCES:
498
499
.. [FOS2010] G. Fourier, M. Okado, A. Schilling.
500
Perfectness of Kirillov-Reshetikhin crystals for nonexceptional types
501
Contemp. Math. 506 (2010) 127-143 ( arXiv:0811.1604 [math.RT] )
502
503
EXAMPLES::
504
505
sage: K = KirillovReshetikhinCrystal(['A',2,1], 1, 1)
506
sage: K.is_perfect()
507
True
508
509
sage: K = KirillovReshetikhinCrystal(['C',2,1], 1, 1)
510
sage: K.is_perfect()
511
False
512
513
sage: K = KirillovReshetikhinCrystal(['C',2,1], 1, 2)
514
sage: K.is_perfect()
515
True
516
"""
517
x = self.s()/self.cartan_type().c()[self.r()]
518
return x - ceil(x) == 0
519
520
def level(self):
521
r"""
522
Returns the level of ``self`` assuming that it is a perfect crystal.
523
524
If ``self`` is the Kirillov-Reshetikhin crystal `B^{r,s}`, then it was proven in [FOS2010]_
525
that its level is `s/c_r` which is an integer if ``self`` is perfect
526
(here `c_r` is a constant related to the type of the crystal).
527
528
EXAMPLES::
529
530
sage: K = KirillovReshetikhinCrystal(['A',2,1], 1, 1)
531
sage: K.level()
532
1
533
sage: K = KirillovReshetikhinCrystal(['C',2,1], 1, 2)
534
sage: K.level()
535
1
536
sage: K = KirillovReshetikhinCrystal(['D',4,1], 1, 3)
537
sage: K.level()
538
3
539
540
sage: K = KirillovReshetikhinCrystal(['C',2,1], 1, 1)
541
sage: K.level()
542
Traceback (most recent call last):
543
...
544
AssertionError: This crystal is not perfect!
545
"""
546
assert self.is_perfect(), "This crystal is not perfect!"
547
return self.s()/self.cartan_type().c()[self.r()]
548
549
@cached_method
550
def R_matrix(self, K):
551
r"""
552
INPUT:
553
554
- ``self`` -- a crystal `L`
555
- ``K`` -- a Kirillov-Reshetikhin crystal of the same type as `L`.
556
557
Returns the *combinatorial `R`-matrix* from `L \otimes K \to K
558
\otimes L`, where the combinatorial `R`-matrix is the affine
559
crystal isomorphism which maps `u_{L} \otimes u_K` to `u_K
560
\otimes u_{L}`, where `u_K` is the unique element in `K =
561
B^{r,s}` of weight `s\Lambda_r - s c \Lambda_0` (see
562
module_generator).
563
564
EXAMPLES::
565
566
sage: K = KirillovReshetikhinCrystal(['A',2,1],1,1)
567
sage: L = KirillovReshetikhinCrystal(['A',2,1],1,2)
568
sage: f = K.R_matrix(L)
569
sage: [[b,f(b)] for b in TensorProductOfCrystals(K,L)]
570
[[[[[1]], [[1, 1]]], [[[1, 1]], [[1]]]],
571
[[[[1]], [[1, 2]]], [[[1, 1]], [[2]]]],
572
[[[[1]], [[2, 2]]], [[[1, 2]], [[2]]]],
573
[[[[1]], [[1, 3]]], [[[1, 1]], [[3]]]],
574
[[[[1]], [[2, 3]]], [[[1, 2]], [[3]]]],
575
[[[[1]], [[3, 3]]], [[[1, 3]], [[3]]]],
576
[[[[2]], [[1, 1]]], [[[1, 2]], [[1]]]],
577
[[[[2]], [[1, 2]]], [[[2, 2]], [[1]]]],
578
[[[[2]], [[2, 2]]], [[[2, 2]], [[2]]]],
579
[[[[2]], [[1, 3]]], [[[2, 3]], [[1]]]],
580
[[[[2]], [[2, 3]]], [[[2, 2]], [[3]]]],
581
[[[[2]], [[3, 3]]], [[[2, 3]], [[3]]]],
582
[[[[3]], [[1, 1]]], [[[1, 3]], [[1]]]],
583
[[[[3]], [[1, 2]]], [[[1, 3]], [[2]]]],
584
[[[[3]], [[2, 2]]], [[[2, 3]], [[2]]]],
585
[[[[3]], [[1, 3]]], [[[3, 3]], [[1]]]],
586
[[[[3]], [[2, 3]]], [[[3, 3]], [[2]]]],
587
[[[[3]], [[3, 3]]], [[[3, 3]], [[3]]]]]
588
589
sage: K = KirillovReshetikhinCrystal(['D',4,1],1,1)
590
sage: L = KirillovReshetikhinCrystal(['D',4,1],2,1)
591
sage: f = K.R_matrix(L)
592
sage: T = TensorProductOfCrystals(K,L)
593
sage: b = T( K(rows=[[1]]), L(rows=[]) )
594
sage: f(b)
595
[[[2], [-2]], [[1]]]
596
597
Alternatively, one can compute the combinatorial `R`-matrix using the isomorphism method
598
of digraphs::
599
600
sage: K1 = KirillovReshetikhinCrystal(['A',2,1],1,1)
601
sage: K2 = KirillovReshetikhinCrystal(['A',2,1],2,1)
602
sage: T1 = TensorProductOfCrystals(K1,K2)
603
sage: T2 = TensorProductOfCrystals(K2,K1)
604
sage: T1.digraph().is_isomorphic(T2.digraph(), edge_labels = True, certify = True) #todo: not implemented (see #10904 and #10549)
605
(True, {[[[1]], [[2], [3]]]: [[[1], [3]], [[2]]], [[[3]], [[2], [3]]]: [[[2], [3]], [[3]]],
606
[[[3]], [[1], [3]]]: [[[1], [3]], [[3]]], [[[1]], [[1], [3]]]: [[[1], [3]], [[1]]], [[[1]],
607
[[1], [2]]]: [[[1], [2]], [[1]]], [[[2]], [[1], [2]]]: [[[1], [2]], [[2]]], [[[3]],
608
[[1], [2]]]: [[[2], [3]], [[1]]], [[[2]], [[1], [3]]]: [[[1], [2]], [[3]]], [[[2]], [[2], [3]]]: [[[2], [3]], [[2]]]})
609
"""
610
T1 = TensorProductOfCrystals(self, K)
611
T2 = TensorProductOfCrystals(K, self)
612
gen1 = T1( self.module_generator(), K.module_generator() )
613
gen2 = T2( K.module_generator(), self.module_generator() )
614
g = { gen1 : gen2 }
615
return T1.crystal_morphism(g, acyclic = False)
616
617
@cached_method
618
def kirillov_reshetikhin_tableaux(self):
619
"""
620
Return the corresponding set of :class:`KirillovReshetikhinTableaux`.
621
622
EXAMPLES::
623
624
sage: KRC = KirillovReshetikhinCrystal(['D', 4, 1], 2, 2)
625
sage: KRC.kirillov_reshetikhin_tableaux()
626
Kirillov-Reshetikhin tableaux of type ['D', 4, 1] and shape (2, 2)
627
"""
628
from sage.combinat.rigged_configurations.kr_tableaux import KirillovReshetikhinTableaux
629
return KirillovReshetikhinTableaux(self.cartan_type(), self._r, self._s)
630
631
class KirillovReshetikhinGenericCrystalElement(AffineCrystalFromClassicalElement):
632
"""
633
Abstract class for all Kirillov-Reshetikhin crystal elements.
634
"""
635
@cached_method
636
def to_kirillov_reshetikhin_tableau(self):
637
r"""
638
Construct the corresponding
639
:class:`KirillovReshetikhinTableauxElement` from ``self``.
640
641
We construct the Kirillov-Reshetikhin tableau element as follows:
642
643
1. Let `\lambda` be the shape of ``self``.
644
2. Determine a path `e_{i_1} e_{i_2} \cdots e_{i_k}` to the highest
645
weight.
646
3. Apply `f_{i_k} \cdots f_{i_2} f_{i_1}` to a highest weight KR
647
tableau from filling the shape `\lambda`.
648
649
EXAMPLES::
650
651
sage: KRC = KirillovReshetikhinCrystal(['A', 4, 1], 2, 1)
652
sage: KRC(columns=[[2,1]]).to_kirillov_reshetikhin_tableau()
653
[[1], [2]]
654
sage: KRC = KirillovReshetikhinCrystal(['D', 4, 1], 2, 1)
655
sage: KRC(rows=[]).to_kirillov_reshetikhin_tableau()
656
[[1], [-1]]
657
"""
658
return self.parent().kirillov_reshetikhin_tableaux()(self)
659
660
KirillovReshetikhinGenericCrystal.Element = KirillovReshetikhinGenericCrystalElement
661
662
class KirillovReshetikhinCrystalFromPromotion(KirillovReshetikhinGenericCrystal,
663
AffineCrystalFromClassicalAndPromotion):
664
r"""
665
This generic class assumes that the Kirillov-Reshetikhin crystal is constructed
666
from a classical crystal 'classical_decomposition' and an automorphism 'promotion' and its inverse
667
which corresponds to a Dynkin diagram automorphism 'dynkin_diagram_automorphism'.
668
669
Each instance using this class needs to implement the methods:
670
671
- classical_decomposition
672
- promotion
673
- promotion_inverse
674
- dynkin_diagram_automorphism
675
"""
676
def __init__(self, cartan_type, r, s):
677
r"""
678
TESTS::
679
680
sage: K = KirillovReshetikhinCrystal(['B',2,1], 1, 1)
681
sage: K
682
Kirillov-Reshetikhin crystal of type ['B', 2, 1] with (r,s)=(1,1)
683
sage: TestSuite(K).run()
684
"""
685
KirillovReshetikhinGenericCrystal.__init__(self, cartan_type, r, s)
686
AffineCrystalFromClassicalAndPromotion.__init__(self, cartan_type, self.classical_decomposition(),
687
self.promotion(), self.promotion_inverse(),
688
self.dynkin_diagram_automorphism(0))
689
690
class KirillovReshetikhinCrystalFromPromotionElement(AffineCrystalFromClassicalAndPromotionElement,
691
KirillovReshetikhinGenericCrystalElement):
692
"""
693
Element for a Kirillov-Reshetikhin crystal from promotion.
694
"""
695
pass
696
697
KirillovReshetikhinCrystalFromPromotion.Element = KirillovReshetikhinCrystalFromPromotionElement
698
699
class KR_type_A(KirillovReshetikhinCrystalFromPromotion):
700
r"""
701
Class of Kirillov-Reshetikhin crystals of type `A_n^{(1)}`.
702
703
EXAMPLES::
704
705
sage: K = KirillovReshetikhinCrystal(['A',3,1], 2,2)
706
sage: b = K(rows=[[1,2],[2,4]])
707
sage: b.f(0)
708
[[1, 1], [2, 2]]
709
"""
710
711
def classical_decomposition(self):
712
"""
713
Specifies the classical crystal underlying the KR crystal of type A.
714
715
EXAMPLES::
716
717
sage: K = KirillovReshetikhinCrystal(['A',3,1], 2,2)
718
sage: K.classical_decomposition()
719
The crystal of tableaux of type ['A', 3] and shape(s) [[2, 2]]
720
"""
721
return CrystalOfTableaux(self.cartan_type().classical(), shape = [self.s() for i in range(1,self.r()+1)])
722
723
@cached_method
724
def promotion(self):
725
"""
726
Specifies the promotion operator used to construct the affine type A crystal.
727
For type A this corresponds to the Dynkin diagram automorphism which maps i to i+1 mod n+1,
728
where n is the rank.
729
730
EXAMPLES::
731
732
sage: K = KirillovReshetikhinCrystal(['A',3,1], 2,2)
733
sage: b = K.classical_decomposition()(rows=[[1,2],[3,4]])
734
sage: K.promotion()(b)
735
[[1, 3], [2, 4]]
736
"""
737
return lambda x : self.classical_crystal(x.to_tableau().promotion(self._cartan_type[1]))
738
739
@cached_method
740
def promotion_inverse(self):
741
"""
742
Specifies the inverse promotion operator used to construct the affine type A crystal.
743
For type A this corresponds to the Dynkin diagram automorphism which maps i to i-1 mod n+1,
744
where n is the rank.
745
746
EXAMPLES::
747
748
sage: K = KirillovReshetikhinCrystal(['A',3,1], 2,2)
749
sage: b = K.classical_decomposition()(rows=[[1,3],[2,4]])
750
sage: K.promotion_inverse()(b)
751
[[1, 2], [3, 4]]
752
sage: b = K.classical_decomposition()(rows=[[1,2],[3,3]])
753
sage: K.promotion_inverse()(K.promotion()(b))
754
[[1, 2], [3, 3]]
755
"""
756
return lambda x : self.classical_crystal(x.to_tableau().promotion_inverse(self._cartan_type[1]))
757
758
def dynkin_diagram_automorphism(self, i):
759
"""
760
Specifies the Dynkin diagram automorphism underlying the promotion action on the crystal
761
elements. The automorphism needs to map node 0 to some other Dynkin node.
762
763
For type A we use the Dynkin diagram automorphism which maps i to i+1 mod n+1, where n is the rank.
764
765
EXAMPLES::
766
767
sage: K = KirillovReshetikhinCrystal(['A',3,1], 2,2)
768
sage: K.dynkin_diagram_automorphism(0)
769
1
770
sage: K.dynkin_diagram_automorphism(3)
771
0
772
"""
773
aut = range(1,self.cartan_type().rank())+[0]
774
return aut[i]
775
776
class KR_type_vertical(KirillovReshetikhinCrystalFromPromotion):
777
r"""
778
Class of Kirillov-Reshetikhin crystals `B^{r,s}` of type `D_n^{(1)}` for `r\le n-2`,
779
`B_n^{(1)}` for `r<n`, and `A_{2n-1}^{(2)}` for `r\le n`.
780
781
EXAMPLES::
782
783
sage: K = KirillovReshetikhinCrystal(['D',4,1], 2,2)
784
sage: b = K(rows=[])
785
sage: b.f(0)
786
[[1], [2]]
787
sage: b.f(0).f(0)
788
[[1, 1], [2, 2]]
789
sage: b.e(0)
790
[[-2], [-1]]
791
sage: b.e(0).e(0)
792
[[-2, -2], [-1, -1]]
793
794
sage: K = KirillovReshetikhinCrystal(['D',5,1], 3,1)
795
sage: b = K(rows=[[1]])
796
sage: b.e(0)
797
[[3], [-3], [-2]]
798
799
sage: K = KirillovReshetikhinCrystal(['B',3,1], 1,1)
800
sage: [[b,b.f(0)] for b in K]
801
[[[[1]], None], [[[2]], None], [[[3]], None], [[[0]], None], [[[-3]], None], [[[-2]], [[1]]], [[[-1]], [[2]]]]
802
803
sage: K = KirillovReshetikhinCrystal(['A',5,2], 1,1)
804
sage: [[b,b.f(0)] for b in K]
805
[[[[1]], None], [[[2]], None], [[[3]], None], [[[-3]], None], [[[-2]], [[1]]], [[[-1]], [[2]]]]
806
"""
807
808
def classical_decomposition(self):
809
r"""
810
Specifies the classical crystal underlying the Kirillov-Reshetikhin crystal of type `D_n^{(1)}`,
811
`B_n^{(1)}`, and `A_{2n-1}^{(2)}`.
812
813
It is given by `B^{r,s} \cong \bigoplus_\Lambda B(\Lambda)` where `\Lambda` are weights obtained from
814
a rectangle of width `s` and height `r` by removing verticle dominoes. Here we identify the fundamental
815
weight `\Lambda_i` with a column of height `i`.
816
817
EXAMPLES::
818
819
sage: K = KirillovReshetikhinCrystal(['D',4,1], 2,2)
820
sage: K.classical_decomposition()
821
The crystal of tableaux of type ['D', 4] and shape(s) [[], [1, 1], [2, 2]]
822
"""
823
return CrystalOfTableaux(self.cartan_type().classical(),
824
shapes = vertical_dominoes_removed(self.r(),self.s()))
825
826
@cached_method
827
def promotion(self):
828
"""
829
Specifies the promotion operator used to construct the affine type `D_n^{(1)}` etc. crystal.
830
This corresponds to the Dynkin diagram automorphism which interchanges nodes 0 and 1,
831
and leaves all other nodes unchanged. On the level of crystals it is constructed using
832
`\pm` diagrams.
833
834
EXAMPLES::
835
836
sage: K = KirillovReshetikhinCrystal(['D',4,1], 2,2)
837
sage: promotion = K.promotion()
838
sage: b = K.classical_decomposition()(rows=[])
839
sage: promotion(b)
840
[[1, 2], [-2, -1]]
841
sage: b = K.classical_decomposition()(rows=[[1,3],[2,-1]])
842
sage: promotion(b)
843
[[1, 3], [2, -1]]
844
sage: b = K.classical_decomposition()(rows=[[1],[-3]])
845
sage: promotion(b)
846
[[2, -3], [-2, -1]]
847
"""
848
T = self.classical_decomposition()
849
ind = list(T.index_set())
850
ind.remove(1)
851
return T.crystal_morphism( self.promotion_on_highest_weight_vectors(), index_set = ind)
852
853
def promotion_inverse(self):
854
"""
855
Return inverse of promotion.
856
857
In this case promotion is an involution, so promotion inverse equals promotion.
858
859
EXAMPLES::
860
861
sage: K = KirillovReshetikhinCrystal(['D',4,1], 2,2)
862
sage: promotion = K.promotion()
863
sage: promotion_inverse = K.promotion_inverse()
864
sage: all( promotion_inverse(promotion(b.lift())) == b.lift() for b in K )
865
True
866
"""
867
return self.promotion()
868
869
def dynkin_diagram_automorphism(self, i):
870
"""
871
Specifies the Dynkin diagram automorphism underlying the promotion action on the crystal
872
elements. The automorphism needs to map node 0 to some other Dynkin node.
873
874
Here we use the Dynkin diagram automorphism which interchanges nodes 0 and 1 and leaves
875
all other nodes unchanged.
876
877
EXAMPLES::
878
879
sage: K = KirillovReshetikhinCrystal(['D',4,1],1,1)
880
sage: K.dynkin_diagram_automorphism(0)
881
1
882
sage: K.dynkin_diagram_automorphism(1)
883
0
884
sage: K.dynkin_diagram_automorphism(4)
885
4
886
"""
887
aut = [1,0]+range(2,self.cartan_type().rank())
888
return aut[i]
889
890
@cached_method
891
def promotion_on_highest_weight_vectors(self):
892
"""
893
Calculates promotion on `{2,3,...,n}` highest weight vectors.
894
895
EXAMPLES::
896
897
sage: K = KirillovReshetikhinCrystal(['D',4,1], 2,2)
898
sage: T = K.classical_decomposition()
899
sage: hw = [ b for b in T if all(b.epsilon(i)==0 for i in [2,3,4]) ]
900
sage: [K.promotion_on_highest_weight_vectors()(b) for b in hw]
901
[[[1, 2], [-2, -1]], [[2, 2], [-2, -1]], [[1, 2], [3, -1]], [[2], [-2]],
902
[[1, 2], [2, -2]], [[2, 2], [-1, -1]], [[2, 2], [3, -1]], [[2, 2], [3, 3]],
903
[], [[1], [2]], [[1, 1], [2, 2]], [[2], [-1]], [[1, 2], [2, -1]], [[2], [3]],
904
[[1, 2], [2, 3]]]
905
"""
906
return lambda b: self.from_pm_diagram_to_highest_weight_vector(self.from_highest_weight_vector_to_pm_diagram(b).sigma())
907
908
def from_highest_weight_vector_to_pm_diagram(self, b):
909
"""
910
This gives the bijection between an element b in the classical decomposition
911
of the KR crystal that is `{2,3,..,n}`-highest weight and `\pm` diagrams.
912
913
EXAMPLES::
914
915
sage: K = KirillovReshetikhinCrystal(['D',4,1], 2,2)
916
sage: T = K.classical_decomposition()
917
sage: b = T(rows=[[2],[-2]])
918
sage: pm = K.from_highest_weight_vector_to_pm_diagram(b); pm
919
[[1, 1], [0, 0], [0]]
920
sage: pm.__repr__(pretty_printing=True)
921
+
922
-
923
sage: b = T(rows=[])
924
sage: pm=K.from_highest_weight_vector_to_pm_diagram(b); pm
925
[[0, 2], [0, 0], [0]]
926
sage: pm.__repr__(pretty_printing=True)
927
928
sage: hw = [ b for b in T if all(b.epsilon(i)==0 for i in [2,3,4]) ]
929
sage: all(K.from_pm_diagram_to_highest_weight_vector(K.from_highest_weight_vector_to_pm_diagram(b)) == b for b in hw)
930
True
931
"""
932
n = self.cartan_type().rank()-1
933
inner = Partition([Integer(b.weight()[i]) for i in range(1,n+1)])
934
inter = Partition([len([i for i in r if i>0]) for r in b.to_tableau()])
935
outer = b.to_tableau().shape()
936
return PMDiagram([self.r(), self.s(), outer, inter, inner], from_shapes=True)
937
938
def from_pm_diagram_to_highest_weight_vector(self, pm):
939
"""
940
This gives the bijection between a `\pm` diagram and an element b in the classical
941
decomposition of the KR crystal that is {2,3,..,n}-highest weight.
942
943
EXAMPLES::
944
945
sage: K = KirillovReshetikhinCrystal(['D',4,1], 2,2)
946
sage: pm = sage.combinat.crystals.kirillov_reshetikhin.PMDiagram([[1, 1], [0, 0], [0]])
947
sage: K.from_pm_diagram_to_highest_weight_vector(pm)
948
[[2], [-2]]
949
"""
950
u = [b for b in self.classical_decomposition().module_generators if b.to_tableau().shape() == pm.outer_shape()][0]
951
ct = self.cartan_type()
952
rank = ct.rank()-1
953
ct_type = ct.classical().type()
954
assert ct_type in ['B', 'C', 'D']
955
list = []
956
for h in pm.heights_of_addable_plus():
957
list += range(1,h+1)
958
for h in pm.heights_of_minus():
959
if ct_type == 'D':
960
list += range(1,rank+1)+[rank-2-k for k in range(rank-1-h)]
961
elif ct_type == 'B':
962
list += range(1,rank+1)+[rank-k for k in range(rank+1-h)]
963
else:
964
list += range(1,rank+1)+[rank-1-k for k in range(rank-h)]
965
for i in reversed(list):
966
u = u.f(i)
967
return u
968
969
class KR_type_E6(KirillovReshetikhinCrystalFromPromotion):
970
r"""
971
Class of Kirillov-Reshetikhin crystals of type `E_6^{(1)}` for `r=1,2,6`.
972
973
EXAMPLES::
974
975
sage: K = KirillovReshetikhinCrystal(['E',6,1],2,1)
976
sage: K.module_generator().e(0)
977
[]
978
sage: K.module_generator().e(0).f(0)
979
[[(2, -1), (1,)]]
980
sage: K = KirillovReshetikhinCrystal(['E',6,1], 1,1)
981
sage: b = K.module_generator()
982
sage: b
983
[(1,)]
984
sage: b.e(0)
985
[(-2, 1)]
986
sage: b = [t for t in K if t.epsilon(1) == 1 and t.phi(3) == 1 and t.phi(2) == 0 and t.epsilon(2) == 0][0]
987
sage: b
988
[(-1, 3)]
989
sage: b.e(0)
990
[(-1, -2, 3)]
991
992
The elements of the Kirillov-Reshetikhin crystals can be constructed from a classical
993
crystal element using :meth:`retract`.
994
995
EXAMPLES::
996
997
sage: K = KirillovReshetikhinCrystal(['E',6,1],2,1)
998
sage: La = K.cartan_type().classical().root_system().weight_lattice().fundamental_weights()
999
sage: H = HighestWeightCrystal(La[2])
1000
sage: t = H.module_generator()
1001
sage: t
1002
[[(2, -1), (1,)]]
1003
sage: type(K.retract(t))
1004
<class 'sage.combinat.crystals.kirillov_reshetikhin.KR_type_E6_with_category.element_class'>
1005
sage: K.retract(t).e(0)
1006
[]
1007
1008
TESTS::
1009
1010
sage: K = KirillovReshetikhinCrystal(['E',6,1], 2,1)
1011
sage: La = K.weight_lattice_realization().fundamental_weights()
1012
sage: all(b.weight() == sum( (K.affine_weight(b.lift())[i] * La[i] for i in K.index_set()), 0*La[0]) for b in K) # long time (26s on sage.math, 2011)
1013
True
1014
"""
1015
1016
def classical_decomposition(self):
1017
"""
1018
Specifies the classical crystal underlying the KR crystal of type `E_6^{(1)}`.
1019
1020
EXAMPLES::
1021
1022
sage: K = KirillovReshetikhinCrystal(['E',6,1], 2,2)
1023
sage: K.classical_decomposition()
1024
Direct sum of the crystals Family (Finite dimensional highest weight crystal of type ['E', 6] and highest weight 0, Finite dimensional highest weight crystal of type ['E', 6] and highest weight Lambda[2], Finite dimensional highest weight crystal of type ['E', 6] and highest weight 2*Lambda[2])
1025
sage: K = KirillovReshetikhinCrystal(['E',6,1], 1,2)
1026
sage: K.classical_decomposition()
1027
Direct sum of the crystals Family (Finite dimensional highest weight crystal of type ['E', 6] and highest weight 2*Lambda[1],)
1028
"""
1029
La = self.cartan_type().classical().root_system().weight_lattice().fundamental_weights()
1030
if self.r() in [1,6]:
1031
dw = [self.s()*La[self.r()]]
1032
elif self.r() == 2:
1033
dw = sum( ([k*La[2]] for k in range(self.s()+1)), [])
1034
else:
1035
raise ValueError
1036
return DirectSumOfCrystals([HighestWeightCrystal(dominant_weight) for dominant_weight in dw], keepkey = False)
1037
1038
def dynkin_diagram_automorphism(self, i):
1039
r"""
1040
Specifies the Dynkin diagram automorphism underlying the promotion action on the crystal
1041
elements. The automorphism needs to map node 0 to some other Dynkin node.
1042
1043
Here we use the Dynkin diagram automorphism of order 3 which maps node 0 to node 1.
1044
1045
EXAMPLES::
1046
1047
sage: K = KirillovReshetikhinCrystal(['E',6,1],2,1)
1048
sage: [K.dynkin_diagram_automorphism(i) for i in K.index_set()]
1049
[1, 6, 3, 5, 4, 2, 0]
1050
"""
1051
aut = [1,6,3,5,4,2,0]
1052
return aut[i]
1053
1054
def affine_weight(self, b):
1055
r"""
1056
Returns the affine level zero weight corresponding to the element b of the classical
1057
crystal underlying self. For the coefficients to calculate the level, see Kac pg. 48.
1058
1059
EXAMPLES::
1060
1061
sage: K = KirillovReshetikhinCrystal(['E',6,1],2,1)
1062
sage: [K.affine_weight(x.lift()) for x in K if all(x.epsilon(i) == 0 for i in [2,3,4,5])]
1063
[(0, 0, 0, 0, 0, 0, 0),
1064
(-2, 0, 1, 0, 0, 0, 0),
1065
(-1, -1, 0, 0, 0, 1, 0),
1066
(0, 0, 0, 0, 0, 0, 0),
1067
(0, 0, 0, 0, 0, 1, -2),
1068
(0, -1, 1, 0, 0, 0, -1),
1069
(-1, 0, 0, 1, 0, 0, -1),
1070
(-1, -1, 0, 0, 1, 0, -1),
1071
(0, 0, 0, 0, 0, 0, 0),
1072
(0, -2, 0, 1, 0, 0, 0)]
1073
"""
1074
simple_roots = self.cartan_type().classical().root_system().ambient_space().simple_roots()
1075
index_set = b.parent().index_set()
1076
weight = [ Integer(b.weight().scalar( simple_roots[i] )) for i in index_set ]
1077
E6_coeffs = [ 1, 2, 2, 3, 2, 1 ]
1078
return tuple( [-sum([ weight[i-1] * E6_coeffs[i-1] for i in index_set ])] + weight )
1079
1080
1081
@cached_method
1082
def hw_auxiliary(self):
1083
r"""
1084
Returns the `{2,3,4,5}` highest weight elements of self.
1085
1086
EXAMPLES::
1087
1088
sage: K = KirillovReshetikhinCrystal(['E',6,1],2,1)
1089
sage: K.hw_auxiliary()
1090
[[], [[(2, -1), (1,)]],
1091
[[(5, -3), (-1, 3)]],
1092
[[(6, -2), (-6, 2)]],
1093
[[(5, -2, -6), (-6, 2)]],
1094
[[(-1,), (-6, 2)]],
1095
[[(3, -1, -6), (1,)]],
1096
[[(4, -3, -6), (-1, 3)]],
1097
[[(1, -3), (-1, 3)]],
1098
[[(-1,), (-1, 3)]]]
1099
"""
1100
return [x for x in self.classical_decomposition() if all(x.epsilon(i) == 0 for i in [2,3,4,5])]
1101
1102
@cached_method
1103
def highest_weight_dict(self):
1104
r"""
1105
Returns a dictionary between `{1,2,3,4,5}` highest weight elements, and a tuple of affine weights and its classical component.
1106
1107
EXAMPLES::
1108
1109
sage: K = KirillovReshetikhinCrystal(['E',6,1],2,1)
1110
sage: K.highest_weight_dict()
1111
{[[(5, -2, -6), (-6, 2)]]: ((0, 0, 0, 0, 0, 1, -2), 1),
1112
[[(3, -1, -6), (1,)]]: ((-1, 0, 0, 1, 0, 0, -1), 1),
1113
[[(6, -2), (-6, 2)]]: ((0, 0, 0, 0, 0, 0, 0), 1),
1114
[[(2, -1), (1,)]]: ((-2, 0, 1, 0, 0, 0, 0), 1),
1115
[]: ((0, 0, 0, 0, 0, 0, 0), 0)}
1116
"""
1117
hw = [x for x in self.hw_auxiliary() if x.epsilon(1) == 0]
1118
dic = dict( ( x, tuple( [self.affine_weight(x), len(x)] ) ) for x in hw )
1119
assert len(hw) == len(dic)
1120
return dic
1121
1122
@cached_method
1123
def highest_weight_dict_inv(self):
1124
r"""
1125
Returns a dictionary between a tuple of affine weights and a classical component, and
1126
`{2,3,4,5,6}` highest weight elements.
1127
1128
EXAMPLES::
1129
1130
sage: K = KirillovReshetikhinCrystal(['E',6,1],2,1)
1131
sage: K.highest_weight_dict_inv()
1132
{((0, 0, 0, 0, 0, 0, 0), 0): [],
1133
((-1, -1, 0, 0, 0, 1, 0), 1): [[(5, -3), (-1, 3)]],
1134
((0, 0, 0, 0, 0, 0, 0), 1): [[(1, -3), (-1, 3)]],
1135
((0, -2, 0, 1, 0, 0, 0), 1): [[(-1,), (-1, 3)]],
1136
((-2, 0, 1, 0, 0, 0, 0), 1): [[(2, -1), (1,)]]}
1137
"""
1138
hw = [x for x in self.hw_auxiliary() if x.epsilon(6) == 0]
1139
dic = dict( ( tuple( [self.affine_weight(x), len(x)] ), x ) for x in hw )
1140
assert len(hw) == len(dic)
1141
return dic
1142
1143
def automorphism_on_affine_weight(self, weight):
1144
r"""
1145
Acts with the Dynkin diagram automorphism on affine weights as outputted by the affine_weight method.
1146
1147
EXAMPLES::
1148
1149
sage: K = KirillovReshetikhinCrystal(['E',6,1],2,1)
1150
sage: [[x[0], K.automorphism_on_affine_weight(x[0])] for x in K.highest_weight_dict().values()]
1151
[[(0, 0, 0, 0, 0, 1, -2), (-2, 0, 1, 0, 0, 0, 0)],
1152
[(-1, 0, 0, 1, 0, 0, -1), (-1, -1, 0, 0, 0, 1, 0)],
1153
[(0, 0, 0, 0, 0, 0, 0), (0, 0, 0, 0, 0, 0, 0)],
1154
[(-2, 0, 1, 0, 0, 0, 0), (0, -2, 0, 1, 0, 0, 0)],
1155
[(0, 0, 0, 0, 0, 0, 0), (0, 0, 0, 0, 0, 0, 0)]]
1156
"""
1157
f = self.dynkin_diagram_automorphism
1158
return tuple( [weight[f(f(i))] for i in self.index_set()] )
1159
1160
@cached_method
1161
def promotion_on_highest_weight_vectors(self):
1162
r"""
1163
Gives a dictionary of the promotion map on `{1,2,3,4,5}` highest weight elements to
1164
`{2,3,4,5,6}` elements in self.
1165
1166
EXAMPLES::
1167
1168
sage: K = KirillovReshetikhinCrystal(['E',6,1],2,1)
1169
sage: dic = K.promotion_on_highest_weight_vectors()
1170
sage: dic
1171
{[[(5, -2, -6), (-6, 2)]]: [[(2, -1), (1,)]],
1172
[[(3, -1, -6), (1,)]]: [[(5, -3), (-1, 3)]],
1173
[[(6, -2), (-6, 2)]]: [],
1174
[[(2, -1), (1,)]]: [[(-1,), (-1, 3)]],
1175
[]: [[(1, -3), (-1, 3)]]}
1176
"""
1177
dic = self.highest_weight_dict()
1178
dic_inv = self.highest_weight_dict_inv()
1179
dic_weight = {}
1180
for (weight, i) in dic.values():
1181
dic_weight[weight] = dic_weight.get(weight, []) + [i]
1182
map_index = lambda (i, list) : max(list)+min(list)-i
1183
map_element = lambda x : tuple([self.automorphism_on_affine_weight(dic[x][0]), map_index((dic[x][1],dic_weight[dic[x][0]]))])
1184
return dict( (x, dic_inv[map_element(x)]) for x in dic.keys() )
1185
1186
@cached_method
1187
def promotion_on_highest_weight_vectors_function(self):
1188
"""
1189
Return a lambda function on ``x`` defined by
1190
``self.promotion_on_highest_weight_vectors()[x]``.
1191
1192
EXAMPLES::
1193
1194
sage: K = KirillovReshetikhinCrystal(['E',6,1], 2,1)
1195
sage: f = K.promotion_on_highest_weight_vectors_function()
1196
sage: f(K.module_generator().lift())
1197
[[(-1,), (-1, 3)]]
1198
"""
1199
return lambda x : self.promotion_on_highest_weight_vectors()[x]
1200
1201
@cached_method
1202
def promotion(self):
1203
"""
1204
Specifies the promotion operator used to construct the affine type `E_6^{(1)}` crystal.
1205
1206
EXAMPLES::
1207
1208
sage: K = KirillovReshetikhinCrystal(['E',6,1], 2,1)
1209
sage: promotion = K.promotion()
1210
sage: all(promotion(promotion(promotion(b))) == b for b in K.classical_decomposition())
1211
True
1212
sage: K = KirillovReshetikhinCrystal(['E',6,1],1,1)
1213
sage: promotion = K.promotion()
1214
sage: all(promotion(promotion(promotion(b))) == b for b in K.classical_decomposition())
1215
True
1216
"""
1217
T = self.classical_decomposition()
1218
ind = [1,2,3,4,5]
1219
return T.crystal_morphism( self.promotion_on_highest_weight_vectors_function(), automorphism = lambda i : self.dynkin_diagram_automorphism(i), index_set = ind)
1220
1221
@cached_method
1222
def promotion_inverse(self):
1223
r"""
1224
Returns the inverse promotion. Since promotion is of order 3, the inverse promotion is the same
1225
as promotion applied twice.
1226
1227
EXAMPLES::
1228
1229
sage: K = KirillovReshetikhinCrystal(['E',6,1], 2,1)
1230
sage: p = K.promotion()
1231
sage: p_inv = K.promotion_inverse()
1232
sage: all(p_inv(p(b)) == b for b in K.classical_decomposition())
1233
True
1234
"""
1235
p = self.promotion()
1236
return lambda x : p(p(x))
1237
1238
1239
class KR_type_C(KirillovReshetikhinGenericCrystal):
1240
r"""
1241
Class of Kirillov-Reshetikhin crystals `B^{r,s}` of type `C_n^{(1)}` for `r<n`.
1242
1243
EXAMPLES::
1244
1245
sage: K = KirillovReshetikhinCrystal(['C',2,1], 1,2)
1246
sage: K
1247
Kirillov-Reshetikhin crystal of type ['C', 2, 1] with (r,s)=(1,2)
1248
sage: b = K(rows=[])
1249
sage: b.f(0)
1250
[[1, 1]]
1251
sage: b.e(0)
1252
[[-1, -1]]
1253
"""
1254
1255
def classical_decomposition(self):
1256
r"""
1257
Specifies the classical crystal underlying the Kirillov-Reshetikhin crystal of type `C_n^{(1)}`.
1258
1259
It is given by `B^{r,s} \cong \bigoplus_\Lambda B(\Lambda)` where `\Lambda` are weights obtained from
1260
a rectangle of width `s` and height `r` by removing horizontal dominoes. Here we identify the fundamental
1261
weight `\Lambda_i` with a column of height `i`.
1262
1263
EXAMPLES::
1264
1265
sage: K = KirillovReshetikhinCrystal(['C',3,1], 2,2)
1266
sage: K.classical_decomposition()
1267
The crystal of tableaux of type ['C', 3] and shape(s) [[], [2], [2, 2]]
1268
"""
1269
return CrystalOfTableaux(self.cartan_type().classical(),
1270
shapes = horizontal_dominoes_removed(self.r(),self.s()))
1271
1272
def ambient_crystal(self):
1273
r"""
1274
Returns the ambient crystal `B^{r,s}` of type `A_{2n+1}^{(2)}` associated to the Kirillov-Reshetikhin
1275
crystal of type `C_n^{(1)}`. This ambient crystal is used to construct the zero arrows.
1276
1277
EXAMPLES::
1278
1279
sage: K = KirillovReshetikhinCrystal(['C',3,1], 2,3)
1280
sage: K.ambient_crystal()
1281
Kirillov-Reshetikhin crystal of type ['B', 4, 1]^* with (r,s)=(2,3)
1282
"""
1283
return KirillovReshetikhinCrystal(['A',2*self.cartan_type().classical().rank()+1,2], self.r(), self.s())
1284
1285
@cached_method
1286
def ambient_dict_pm_diagrams(self):
1287
r"""
1288
Gives a dictionary of all self-dual `\pm` diagrams for the ambient crystal.
1289
Their key is their inner shape.
1290
1291
EXAMPLES::
1292
1293
sage: K = KirillovReshetikhinCrystal(['C',2,1], 1,2)
1294
sage: K.ambient_dict_pm_diagrams()
1295
{[]: [[1, 1], [0]], [2]: [[0, 0], [2]]}
1296
sage: K = KirillovReshetikhinCrystal(['C',3,1], 2,2)
1297
sage: K.ambient_dict_pm_diagrams()
1298
{[2, 2]: [[0, 0], [0, 0], [2]], []: [[1, 1], [0, 0], [0]], [2]: [[0, 0], [1, 1], [0]]}
1299
sage: K = KirillovReshetikhinCrystal(['C',3,1], 2,3)
1300
sage: K.ambient_dict_pm_diagrams()
1301
{[3, 3]: [[0, 0], [0, 0], [3]], [3, 1]: [[0, 0], [1, 1], [1]], [1, 1]: [[1, 1], [0, 0], [1]]}
1302
"""
1303
list = []
1304
s = self.s()
1305
r = self.r()
1306
m = int(s/2)
1307
for i in range(m+1):
1308
for la in IntegerVectors(m-i, min_length=r, max_length=r):
1309
list.append(PMDiagram([[j,j] for j in la]+[[s-2*m+2*i]]))
1310
return dict( (x.inner_shape(), x) for x in list )
1311
1312
@cached_method
1313
def ambient_highest_weight_dict(self):
1314
r"""
1315
Gives a dictionary of all `{2,...,n+1}`-highest weight vectors in the ambient crystal.
1316
Their key is the inner shape of their corresponding `\pm` diagram, or equivalently, their
1317
`{2,...,n+1}` weight.
1318
1319
EXAMPLES::
1320
1321
sage: K = KirillovReshetikhinCrystal(['C',3,1], 2,2)
1322
sage: K.ambient_highest_weight_dict()
1323
{[]: [[2], [-2]], [2, 2]: [[2, 2], [3, 3]], [2]: [[1, 2], [2, -1]]}
1324
"""
1325
A = self.ambient_dict_pm_diagrams()
1326
ambient = self.ambient_crystal()
1327
return dict( (key, ambient.retract(ambient.from_pm_diagram_to_highest_weight_vector(A[key]))) for key in A )
1328
1329
@cached_method
1330
def highest_weight_dict(self):
1331
r"""
1332
Gives a dictionary of the classical highest weight vectors of self.
1333
Their key is their shape.
1334
1335
EXAMPLES::
1336
1337
sage: K = KirillovReshetikhinCrystal(['C',3,1], 2,2)
1338
sage: K.highest_weight_dict()
1339
{[2, 2]: [[1, 1], [2, 2]], []: [], [2]: [[1, 1]]}
1340
"""
1341
return dict( (x.lift().to_tableau().shape(),x) for x in self.module_generators )
1342
1343
@cached_method
1344
def to_ambient_crystal(self):
1345
r"""
1346
Provides a map from the Kirillov-Reshetikhin crystal of type `C_n^{(1)}` to the
1347
ambient crystal of type `A_{2n+1}^{(2)}`.
1348
1349
EXAMPLES::
1350
1351
sage: K = KirillovReshetikhinCrystal(['C',3,1], 2,2)
1352
sage: b=K(rows=[[1,1]])
1353
sage: K.to_ambient_crystal()(b)
1354
[[1, 2], [2, -1]]
1355
sage: b=K(rows=[])
1356
sage: K.to_ambient_crystal()(b)
1357
[[2], [-2]]
1358
sage: K.to_ambient_crystal()(b).parent()
1359
Kirillov-Reshetikhin crystal of type ['B', 4, 1]^* with (r,s)=(2,2)
1360
"""
1361
keys = self.highest_weight_dict().keys()
1362
pdict = dict( (self.highest_weight_dict()[key], self.ambient_highest_weight_dict()[key]) for key in keys )
1363
return self.crystal_morphism( pdict, index_set = self.cartan_type().classical().index_set(),
1364
automorphism = lambda i : i+1 )
1365
1366
@cached_method
1367
def from_ambient_crystal(self):
1368
r"""
1369
Provides a map from the ambient crystal of type `A_{2n+1}^{(2)}` to
1370
the Kirillov-Reshetikhin crystal of type `C_n^{(1)}`.
1371
1372
Note that this map is only well-defined on type `C_n^{(1)}` elements
1373
that are in the image under :meth:`to_ambient_crystal`.
1374
1375
EXAMPLES::
1376
1377
sage: K = KirillovReshetikhinCrystal(['C',3,1], 2,2)
1378
sage: b=K.ambient_crystal()(rows=[[2,2],[3,3]])
1379
sage: K.from_ambient_crystal()(b)
1380
[[1, 1], [2, 2]]
1381
"""
1382
keys = self.highest_weight_dict().keys()
1383
pdict_inv = dict( (self.ambient_highest_weight_dict()[key], self.highest_weight_dict()[key]) for key in keys )
1384
return self.crystal_morphism( pdict_inv, index_set = [j+1 for j in self.cartan_type().classical().index_set()],
1385
automorphism = lambda i : i-1 )
1386
1387
class KR_type_CElement(KirillovReshetikhinGenericCrystalElement):
1388
r"""
1389
Class for the elements in the Kirillov-Reshetikhin crystals `B^{r,s}` of type `C_n^{(1)}` for `r<n`.
1390
1391
EXAMPLES::
1392
1393
sage: K=KirillovReshetikhinCrystal(['C',3,1],1,2)
1394
sage: type(K.module_generators[0])
1395
<class 'sage.combinat.crystals.kirillov_reshetikhin.KR_type_C_with_category.element_class'>
1396
"""
1397
1398
def e0(self):
1399
r"""
1400
Gives `e_0` on self by mapping self to the ambient crystal, calculating `e_1 e_0` there and
1401
pulling the element back.
1402
1403
EXAMPLES::
1404
1405
sage: K=KirillovReshetikhinCrystal(['C',3,1],1,2)
1406
sage: b = K(rows=[])
1407
sage: b.e(0) # indirect doctest
1408
[[-1, -1]]
1409
"""
1410
b = self.parent().to_ambient_crystal()(self).e(1)
1411
if b is None:
1412
return None
1413
b = b.e(0)
1414
return self.parent().from_ambient_crystal()(b)
1415
1416
def f0(self):
1417
r"""
1418
Gives `f_0` on self by mapping self to the ambient crystal, calculating `f_1 f_0` there and
1419
pulling the element back.
1420
1421
EXAMPLES::
1422
1423
sage: K=KirillovReshetikhinCrystal(['C',3,1],1,2)
1424
sage: b = K(rows=[])
1425
sage: b.f(0) # indirect doctest
1426
[[1, 1]]
1427
"""
1428
b = self.parent().to_ambient_crystal()(self).f(1)
1429
if b is None:
1430
return None
1431
b = b.f(0)
1432
return self.parent().from_ambient_crystal()(b)
1433
1434
def epsilon0(self):
1435
r"""
1436
Calculates `\epsilon_0` of self by mapping the element to the ambient crystal
1437
and calculating `\epsilon_1` there.
1438
1439
EXAMPLES::
1440
1441
sage: K = KirillovReshetikhinCrystal(['C',2,1], 1,2)
1442
sage: b=K(rows=[[1,1]])
1443
sage: b.epsilon(0) # indirect doctest
1444
2
1445
"""
1446
b = self.parent().to_ambient_crystal()(self)
1447
return b.epsilon(1)
1448
1449
def phi0(self):
1450
r"""
1451
Calculates `\phi_0` of self by mapping the element to the ambient crystal
1452
and calculating `\phi_1` there.
1453
1454
EXAMPLES::
1455
1456
sage: K = KirillovReshetikhinCrystal(['C',2,1], 1,2)
1457
sage: b=K(rows=[[-1,-1]])
1458
sage: b.phi(0) # indirect doctest
1459
2
1460
"""
1461
b = self.parent().to_ambient_crystal()(self)
1462
return b.phi(1)
1463
1464
KR_type_C.Element = KR_type_CElement
1465
1466
1467
class KR_type_A2(KirillovReshetikhinGenericCrystal):
1468
r"""
1469
Class of Kirillov-Reshetikhin crystals `B^{r,s}` of type `A_{2n}^{(2)}` for `1\le r \le n`
1470
in the realization with classical subalgebra `B_n`. The cartan type in this case is inputted as
1471
the dual of `A_{2n}^{(2)}`.
1472
1473
This is an alternative implementation to :class:`KR_type_box` which uses
1474
the classical decomposition into type `C_n` crystals.
1475
1476
EXAMPLES::
1477
1478
sage: C = CartanType(['A',4,2]).dual()
1479
sage: K = sage.combinat.crystals.kirillov_reshetikhin.KR_type_A2(C, 1, 1)
1480
sage: K
1481
Kirillov-Reshetikhin crystal of type ['BC', 2, 2]^* with (r,s)=(1,1)
1482
sage: b = K(rows=[[-1]])
1483
sage: b.f(0)
1484
[[1]]
1485
sage: b.e(0)
1486
1487
We can now check whether the two KR crystals of type `A_4^{(2)}` (namely the KR crystal and its dual
1488
construction) are isomorphic up to relabelling of the edges::
1489
1490
sage: C = CartanType(['A',4,2])
1491
sage: K = KirillovReshetikhinCrystal(C,1,1)
1492
sage: Kdual = KirillovReshetikhinCrystal(C.dual(),1,1)
1493
sage: G = K.digraph()
1494
sage: Gdual = Kdual.digraph()
1495
sage: f = {0:2, 1:1, 2:0}
1496
sage: Gnew = DiGraph(); Gnew.add_vertices(Gdual.vertices()); Gnew.add_edges([(u,v,f[i]) for (u,v,i) in Gdual.edges()])
1497
sage: G.is_isomorphic(Gnew, edge_labels = True)
1498
True
1499
"""
1500
1501
def classical_decomposition(self):
1502
r"""
1503
Specifies the classical crystal underlying the Kirillov-Reshetikhin crystal of type `A_{2n}^{(2)}`
1504
with `B_n` as classical subdiagram.
1505
1506
It is given by `B^{r,s} \cong \bigoplus_\Lambda B(\Lambda)` where `B(\Lambda)` is a highest weight crystal of type
1507
`B_n` of highest weight `\Lambda`. The sum is over all weights `\Lambda` obtained from
1508
a rectangle of width `s` and height `r` by removing horizontal dominoes. Here we identify the fundamental
1509
weight `\Lambda_i` with a column of height `i`.
1510
1511
EXAMPLES::
1512
1513
sage: C = CartanType(['A',4,2]).dual()
1514
sage: K = sage.combinat.crystals.kirillov_reshetikhin.KR_type_A2(C, 2, 2)
1515
sage: K.classical_decomposition()
1516
The crystal of tableaux of type ['B', 2] and shape(s) [[], [2], [2, 2]]
1517
"""
1518
return CrystalOfTableaux(['B', self.cartan_type().rank()-1],
1519
shapes = horizontal_dominoes_removed(self.r(),self.s()))
1520
1521
def ambient_crystal(self):
1522
r"""
1523
Returns the ambient crystal `B^{r,s}` of type `B_{n+1}^{(1)}` associated to the Kirillov-Reshetikhin
1524
crystal of type `A_{2n}^{(2)}` dual. This ambient crystal is used to construct the zero arrows.
1525
1526
EXAMPLES::
1527
1528
sage: C = CartanType(['A',4,2]).dual()
1529
sage: K = sage.combinat.crystals.kirillov_reshetikhin.KR_type_A2(C, 2, 3)
1530
sage: K.ambient_crystal()
1531
Kirillov-Reshetikhin crystal of type ['B', 3, 1] with (r,s)=(2,3)
1532
"""
1533
return KR_type_vertical(['B', self.cartan_type().rank(), 1], self.r(), self.s())
1534
1535
@cached_method
1536
def ambient_dict_pm_diagrams(self):
1537
r"""
1538
Gives a dictionary of all self-dual `\pm` diagrams for the ambient crystal.
1539
Their key is their inner shape.
1540
1541
EXAMPLES::
1542
1543
sage: C = CartanType(['A',4,2]).dual()
1544
sage: K = sage.combinat.crystals.kirillov_reshetikhin.KR_type_A2(C, 1, 1)
1545
sage: K.ambient_dict_pm_diagrams()
1546
{[1]: [[0, 0], [1]]}
1547
sage: K = sage.combinat.crystals.kirillov_reshetikhin.KR_type_A2(C, 1, 2)
1548
sage: K.ambient_dict_pm_diagrams()
1549
{[]: [[1, 1], [0]], [2]: [[0, 0], [2]]}
1550
sage: K = sage.combinat.crystals.kirillov_reshetikhin.KR_type_A2(C, 2, 2)
1551
sage: K.ambient_dict_pm_diagrams()
1552
{[2, 2]: [[0, 0], [0, 0], [2]], []: [[1, 1], [0, 0], [0]], [2]: [[0, 0], [1, 1], [0]]}
1553
"""
1554
list = []
1555
s = self.s()
1556
r = self.r()
1557
m = int(s/2)
1558
for i in range(m+1):
1559
for la in IntegerVectors(m-i, min_length=r, max_length=r):
1560
list.append(PMDiagram([[j,j] for j in la]+[[s-2*m+2*i]]))
1561
return dict( (x.inner_shape(), x) for x in list )
1562
1563
@cached_method
1564
def ambient_highest_weight_dict(self):
1565
r"""
1566
Gives a dictionary of all `{2,...,n+1}`-highest weight vectors in the ambient crystal.
1567
Their key is the inner shape of their corresponding `\pm` diagram, or equivalently, their
1568
`{2,...,n+1}` weight.
1569
1570
EXAMPLES::
1571
1572
sage: C = CartanType(['A',4,2]).dual()
1573
sage: K = sage.combinat.crystals.kirillov_reshetikhin.KR_type_A2(C, 1, 2)
1574
sage: K.ambient_highest_weight_dict()
1575
{[]: [[1, -1]], [2]: [[2, 2]]}
1576
"""
1577
A = self.ambient_dict_pm_diagrams()
1578
ambient = self.ambient_crystal()
1579
return dict( (key, ambient.retract(ambient.from_pm_diagram_to_highest_weight_vector(A[key]))) for key in A )
1580
1581
@cached_method
1582
def highest_weight_dict(self):
1583
r"""
1584
Gives a dictionary of the classical highest weight vectors of self.
1585
Their key is their shape.
1586
1587
EXAMPLES::
1588
1589
sage: C = CartanType(['A',4,2]).dual()
1590
sage: K = sage.combinat.crystals.kirillov_reshetikhin.KR_type_A2(C, 1, 2)
1591
sage: K.highest_weight_dict()
1592
{[]: [], [2]: [[1, 1]]}
1593
"""
1594
return dict( (x.lift().to_tableau().shape(),x) for x in self.module_generators )
1595
1596
@cached_method
1597
def to_ambient_crystal(self):
1598
r"""
1599
Provides a map from the Kirillov-Reshetikhin crystal of type `A_{2n}^{(2)}` to the
1600
ambient crystal of type `B_{n+1}^{(1)}`.
1601
1602
EXAMPLES::
1603
1604
sage: C = CartanType(['A',4,2]).dual()
1605
sage: K = sage.combinat.crystals.kirillov_reshetikhin.KR_type_A2(C, 1, 2)
1606
sage: b=K(rows=[[1,1]])
1607
sage: K.to_ambient_crystal()(b)
1608
[[2, 2]]
1609
sage: K = sage.combinat.crystals.kirillov_reshetikhin.KR_type_A2(C, 2, 2)
1610
sage: b=K(rows=[[1,1]])
1611
sage: K.to_ambient_crystal()(b)
1612
[[1, 2], [2, -1]]
1613
sage: K.to_ambient_crystal()(b).parent()
1614
Kirillov-Reshetikhin crystal of type ['B', 3, 1] with (r,s)=(2,2)
1615
"""
1616
keys = self.highest_weight_dict().keys()
1617
pdict = dict( (self.highest_weight_dict()[key], self.ambient_highest_weight_dict()[key]) for key in keys )
1618
return self.crystal_morphism( pdict, index_set = self.cartan_type().classical().index_set(),
1619
automorphism = lambda i : i+1 )
1620
1621
@cached_method
1622
def from_ambient_crystal(self):
1623
r"""
1624
Provides a map from the ambient crystal of type `B_{n+1}^{(1)}` to
1625
the Kirillov-Reshetikhin crystal of type `A_{2n}^{(2)}`.
1626
1627
Note that this map is only well-defined on type `A_{2n}^{(2)}`
1628
elements that are in the image under :meth:`to_ambient_crystal`.
1629
1630
EXAMPLES::
1631
1632
sage: C = CartanType(['A',4,2]).dual()
1633
sage: K = sage.combinat.crystals.kirillov_reshetikhin.KR_type_A2(C, 1, 2)
1634
sage: b = K.ambient_crystal()(rows=[[2,2]])
1635
sage: K.from_ambient_crystal()(b)
1636
[[1, 1]]
1637
"""
1638
keys = self.highest_weight_dict().keys()
1639
pdict_inv = dict( (self.ambient_highest_weight_dict()[key], self.highest_weight_dict()[key]) for key in keys )
1640
return self.crystal_morphism( pdict_inv, index_set = [j+1 for j in self.cartan_type().classical().index_set()],
1641
automorphism = lambda i : i-1 )
1642
1643
class KR_type_A2Element(KirillovReshetikhinGenericCrystalElement):
1644
r"""
1645
Class for the elements in the Kirillov-Reshetikhin crystals `B^{r,s}` of type `A_{2n}^{(2)}` for `r<n`
1646
with underlying classcial algebra `B_n`.
1647
1648
EXAMPLES::
1649
1650
sage: C = CartanType(['A',4,2]).dual()
1651
sage: K = sage.combinat.crystals.kirillov_reshetikhin.KR_type_A2(C, 1, 2)
1652
sage: type(K.module_generators[0])
1653
<class 'sage.combinat.crystals.kirillov_reshetikhin.KR_type_A2_with_category.element_class'>
1654
"""
1655
1656
def e0(self):
1657
r"""
1658
Gives `e_0` on self by mapping self to the ambient crystal, calculating `e_1 e_0` there and
1659
pulling the element back.
1660
1661
EXAMPLES::
1662
1663
sage: C = CartanType(['A',4,2]).dual()
1664
sage: K = sage.combinat.crystals.kirillov_reshetikhin.KR_type_A2(C, 1, 1)
1665
sage: b = K(rows=[[1]])
1666
sage: b.e(0) # indirect doctest
1667
[[-1]]
1668
"""
1669
b = self.parent().to_ambient_crystal()(self).e(1)
1670
if b is None:
1671
return None
1672
b = b.e(0)
1673
return self.parent().from_ambient_crystal()(b)
1674
1675
def f0(self):
1676
r"""
1677
Gives `f_0` on self by mapping self to the ambient crystal, calculating `f_1 f_0` there and
1678
pulling the element back.
1679
1680
EXAMPLES::
1681
1682
sage: C = CartanType(['A',4,2]).dual()
1683
sage: K = sage.combinat.crystals.kirillov_reshetikhin.KR_type_A2(C, 1, 1)
1684
sage: b = K(rows=[[-1]])
1685
sage: b.f(0) # indirect doctest
1686
[[1]]
1687
"""
1688
b = self.parent().to_ambient_crystal()(self).f(1)
1689
if b is None:
1690
return None
1691
b = b.f(0)
1692
return self.parent().from_ambient_crystal()(b)
1693
1694
def epsilon0(self):
1695
r"""
1696
Calculates `\epsilon_0` of self by mapping the element to the ambient crystal
1697
and calculating `\epsilon_1` there.
1698
1699
EXAMPLES::
1700
1701
sage: C = CartanType(['A',4,2]).dual()
1702
sage: K = sage.combinat.crystals.kirillov_reshetikhin.KR_type_A2(C, 1, 1)
1703
sage: b=K(rows=[[1]])
1704
sage: b.epsilon(0) # indirect doctest
1705
1
1706
"""
1707
b = self.parent().to_ambient_crystal()(self)
1708
return b.epsilon(1)
1709
1710
def phi0(self):
1711
r"""
1712
Calculates `\phi_0` of self by mapping the element to the ambient crystal
1713
and calculating `\phi_1` there.
1714
1715
EXAMPLES::
1716
1717
sage: C = CartanType(['A',4,2]).dual()
1718
sage: K = sage.combinat.crystals.kirillov_reshetikhin.KR_type_A2(C, 1, 1)
1719
sage: b=K(rows=[[-1]])
1720
sage: b.phi(0) # indirect doctest
1721
1
1722
"""
1723
b = self.parent().to_ambient_crystal()(self)
1724
return b.phi(1)
1725
1726
KR_type_A2.Element = KR_type_A2Element
1727
1728
1729
class KR_type_box(KirillovReshetikhinGenericCrystal, AffineCrystalFromClassical):
1730
r"""
1731
Class of Kirillov-Reshetikhin crystals `B^{r,s}` of type `A_{2n}^{(2)}` for `r\le n`
1732
and type `D_{n+1}^{(2)}` for `r<n`.
1733
1734
EXAMPLES::
1735
1736
sage: K = KirillovReshetikhinCrystal(['A',4,2], 1,1)
1737
sage: K
1738
Kirillov-Reshetikhin crystal of type ['BC', 2, 2] with (r,s)=(1,1)
1739
sage: b = K(rows=[])
1740
sage: b.f(0)
1741
[[1]]
1742
sage: b.e(0)
1743
[[-1]]
1744
"""
1745
def __init__(self, cartan_type, r, s):
1746
r"""
1747
Initializes a Kirillov-Reshetikhin crystal ``self``.
1748
1749
TESTS::
1750
1751
sage: K = sage.combinat.crystals.kirillov_reshetikhin.KR_type_box(['A',4,2], 1, 1)
1752
sage: K
1753
Kirillov-Reshetikhin crystal of type ['BC', 2, 2] with (r,s)=(1,1)
1754
sage: K = sage.combinat.crystals.kirillov_reshetikhin.KR_type_box(['D',4,2], 1, 1)
1755
sage: K
1756
Kirillov-Reshetikhin crystal of type ['C', 3, 1]^* with (r,s)=(1,1)
1757
sage: TestSuite(K).run()
1758
"""
1759
KirillovReshetikhinGenericCrystal.__init__(self, cartan_type, r ,s)
1760
AffineCrystalFromClassical.__init__(self, cartan_type, self.classical_decomposition())
1761
1762
def classical_decomposition(self):
1763
r"""
1764
Specifies the classical crystal underlying the Kirillov-Reshetikhin crystal of type `A_{2n}^{(2)}`
1765
and `D_{n+1}^{(2)}`.
1766
1767
It is given by `B^{r,s} \cong \bigoplus_\Lambda B(\Lambda)` where `\Lambda` are weights obtained from
1768
a rectangle of width `s` and height `r` by removing boxes. Here we identify the fundamental
1769
weight `\Lambda_i` with a column of height `i`.
1770
1771
EXAMPLES::
1772
1773
sage: K = KirillovReshetikhinCrystal(['A',4,2], 2,2)
1774
sage: K.classical_decomposition()
1775
The crystal of tableaux of type ['C', 2] and shape(s) [[], [1], [2], [1, 1], [2, 1], [2, 2]]
1776
sage: K = KirillovReshetikhinCrystal(['D',4,2], 2,3)
1777
sage: K.classical_decomposition()
1778
The crystal of tableaux of type ['B', 3] and shape(s) [[], [1], [2], [1, 1], [3], [2, 1], [3, 1], [2, 2], [3, 2], [3, 3]]
1779
"""
1780
return CrystalOfTableaux(self.cartan_type().classical(),
1781
shapes = partitions_in_box(self.r(),self.s()))
1782
1783
def ambient_crystal(self):
1784
r"""
1785
Returns the ambient crystal `B^{r,2s}` of type `C_n^{(1)}` associated to the Kirillov-Reshetikhin crystal.
1786
This ambient crystal is used to construct the zero arrows.
1787
1788
EXAMPLES::
1789
1790
sage: K = KirillovReshetikhinCrystal(['A',4,2], 2,2)
1791
sage: K.ambient_crystal()
1792
Kirillov-Reshetikhin crystal of type ['C', 2, 1] with (r,s)=(2,4)
1793
"""
1794
# calling KR_type_C instead of KirillovReshetikhin(['C',n,1],r,s) has the advantage that
1795
# that this also works for r=n for A_{2n}^{(2)}.
1796
return KR_type_C(['C', self.cartan_type().classical().rank(),1], self.r(), 2*self.s())
1797
1798
@cached_method
1799
def highest_weight_dict(self):
1800
r"""
1801
Gives a dictionary of the classical highest weight vectors of self.
1802
Their key is 2 times their shape.
1803
1804
EXAMPLES::
1805
1806
sage: K = KirillovReshetikhinCrystal(['A',6,2], 2,2)
1807
sage: K.highest_weight_dict()
1808
{[4, 2]: [[1, 1], [2]], [2, 2]: [[1], [2]], []: [], [4]: [[1, 1]], [4, 4]: [[1, 1], [2, 2]], [2]: [[1]]}
1809
"""
1810
return dict( (Partition([2*i for i in x.lift().to_tableau().shape()]),x) for x in self.module_generators )
1811
1812
@cached_method
1813
def ambient_highest_weight_dict(self):
1814
r"""
1815
Gives a dictionary of the classical highest weight vectors of the ambient crystal of self.
1816
Their key is their shape.
1817
1818
EXAMPLES::
1819
1820
sage: K = KirillovReshetikhinCrystal(['A',6,2], 2,2)
1821
sage: K.ambient_highest_weight_dict()
1822
{[4, 2]: [[1, 1, 1, 1], [2, 2]], [2, 2]: [[1, 1], [2, 2]], []: [], [4]: [[1, 1, 1, 1]], [4, 4]: [[1, 1, 1, 1], [2, 2, 2, 2]],
1823
[2]: [[1, 1]]}
1824
"""
1825
return dict( (x.lift().to_tableau().shape(),x) for x in self.ambient_crystal().module_generators )
1826
1827
def similarity_factor(self):
1828
r"""
1829
Sets the similarity factor used to map to the ambient crystal.
1830
1831
EXAMPLES::
1832
1833
sage: K = KirillovReshetikhinCrystal(['A',6,2], 2,2)
1834
sage: K.similarity_factor()
1835
{1: 2, 2: 2, 3: 2}
1836
sage: K = KirillovReshetikhinCrystal(['D',5,2], 1,1)
1837
sage: K.similarity_factor()
1838
{1: 2, 2: 2, 3: 2, 4: 1}
1839
"""
1840
C = self.cartan_type().classical()
1841
p = dict( (i,2) for i in C.index_set() )
1842
if C.type() == 'B':
1843
p[C.rank()] = 1
1844
return p
1845
1846
@cached_method
1847
def to_ambient_crystal(self):
1848
r"""
1849
Provides a map from self to the ambient crystal of type `C_n^{(1)}`.
1850
1851
EXAMPLES::
1852
1853
sage: K = KirillovReshetikhinCrystal(['D',4,2], 1,1)
1854
sage: [K.to_ambient_crystal()(b) for b in K]
1855
[[], [[1, 1]], [[2, 2]], [[3, 3]], [[3, -3]], [[-3, -3]], [[-2, -2]], [[-1, -1]]]
1856
sage: K = KirillovReshetikhinCrystal(['A',4,2], 1,1)
1857
sage: [K.to_ambient_crystal()(b) for b in K]
1858
[[], [[1, 1]], [[2, 2]], [[-2, -2]], [[-1, -1]]]
1859
"""
1860
keys = self.highest_weight_dict().keys()
1861
pdict = dict( (self.highest_weight_dict()[key], self.ambient_highest_weight_dict()[key]) for key in keys )
1862
return self.crystal_morphism( pdict, index_set = self.cartan_type().classical().index_set(),
1863
similarity_factor = self.similarity_factor() )
1864
1865
@cached_method
1866
def from_ambient_crystal(self):
1867
r"""
1868
Provides a map from the ambient crystal of type `C_n^{(1)}` to the
1869
Kirillov-Reshetikhin crystal ``self``.
1870
1871
Note that this map is only well-defined on elements that are in the
1872
image under :meth:`to_ambient_crystal`.
1873
1874
EXAMPLES::
1875
1876
sage: K = KirillovReshetikhinCrystal(['D',4,2], 1,1)
1877
sage: b = K.ambient_crystal()(rows=[[3,-3]])
1878
sage: K.from_ambient_crystal()(b)
1879
[[0]]
1880
sage: K = KirillovReshetikhinCrystal(['A',4,2], 1,1)
1881
sage: b = K.ambient_crystal()(rows=[])
1882
sage: K.from_ambient_crystal()(b)
1883
[]
1884
"""
1885
keys = self.highest_weight_dict().keys()
1886
pdict_inv = dict( (self.ambient_highest_weight_dict()[key], self.highest_weight_dict()[key]) for key in keys )
1887
return self.crystal_morphism( pdict_inv, index_set = self.cartan_type().classical().index_set(),
1888
similarity_factor_domain = self.similarity_factor() )
1889
1890
1891
class KR_type_boxElement(KirillovReshetikhinGenericCrystalElement):
1892
r"""
1893
Class for the elements in the Kirillov-Reshetikhin crystals `B^{r,s}` of type `A_{2n}^{(2)}` for `r\le n`
1894
and type `D_{n+1}^{(2)}` for `r<n`.
1895
1896
EXAMPLES::
1897
1898
sage: K=KirillovReshetikhinCrystal(['A',4,2],1,2)
1899
sage: type(K.module_generators[0])
1900
<class 'sage.combinat.crystals.kirillov_reshetikhin.KR_type_box_with_category.element_class'>
1901
"""
1902
1903
def e0(self):
1904
r"""
1905
Gives `e_0` on self by mapping self to the ambient crystal, calculating `e_0` there and
1906
pulling the element back.
1907
1908
EXAMPLES::
1909
1910
sage: K=KirillovReshetikhinCrystal(['A',4,2],1,1)
1911
sage: b = K(rows=[])
1912
sage: b.e(0) # indirect doctest
1913
[[-1]]
1914
"""
1915
b = self.parent().to_ambient_crystal()(self).e(0)
1916
if b is None:
1917
return None
1918
return self.parent().from_ambient_crystal()(b)
1919
1920
def f0(self):
1921
r"""
1922
Gives `f_0` on self by mapping self to the ambient crystal, calculating `f_0` there and
1923
pulling the element back.
1924
1925
EXAMPLES::
1926
1927
sage: K=KirillovReshetikhinCrystal(['A',4,2],1,1)
1928
sage: b = K(rows=[])
1929
sage: b.f(0) # indirect doctest
1930
[[1]]
1931
"""
1932
b = self.parent().to_ambient_crystal()(self).f(0)
1933
if b is None:
1934
return None
1935
return self.parent().from_ambient_crystal()(b)
1936
1937
def epsilon0(self):
1938
r"""
1939
Calculates `\epsilon_0` of self by mapping the element to the ambient crystal
1940
and calculating `\epsilon_0` there.
1941
1942
EXAMPLES::
1943
1944
sage: K = KirillovReshetikhinCrystal(['A',4,2], 1,1)
1945
sage: b=K(rows=[[1]])
1946
sage: b.epsilon(0) # indirect doctest
1947
2
1948
"""
1949
b = self.parent().to_ambient_crystal()(self)
1950
return b.epsilon(0)
1951
1952
def phi0(self):
1953
r"""
1954
Calculates `\phi_0` of self by mapping the element to the ambient crystal
1955
and calculating `\phi_0` there.
1956
1957
EXAMPLES::
1958
1959
sage: K = KirillovReshetikhinCrystal(['D',3,2], 1,1)
1960
sage: b=K(rows=[[-1]])
1961
sage: b.phi(0) # indirect doctest
1962
2
1963
"""
1964
b = self.parent().to_ambient_crystal()(self)
1965
return b.phi(0)
1966
1967
KR_type_box.Element = KR_type_boxElement
1968
1969
1970
class KR_type_Bn(KirillovReshetikhinGenericCrystal):
1971
r"""
1972
Class of Kirillov-Reshetikhin crystals `B^{n,s}` of type `B_{n}^{(1)}`.
1973
1974
EXAMPLES::
1975
1976
sage: K = KirillovReshetikhinCrystal(['B',3,1],3,2)
1977
sage: K
1978
Kirillov-Reshetikhin crystal of type ['B', 3, 1] with (r,s)=(3,2)
1979
sage: b = K(rows=[[1],[2],[3]])
1980
sage: b.f(0)
1981
sage: b.e(0)
1982
[[3]]
1983
1984
sage: K = KirillovReshetikhinCrystal(['B',3,1],3,2)
1985
sage: [b.weight() for b in K if b.is_highest_weight([1,2,3])]
1986
[-Lambda[0] + Lambda[1], -2*Lambda[0] + 2*Lambda[3]]
1987
sage: [b.weight() for b in K if b.is_highest_weight([0,2,3])]
1988
[Lambda[0] - Lambda[1], -2*Lambda[1] + 2*Lambda[3]]
1989
"""
1990
def _element_constructor_(self, *args, **options):
1991
"""
1992
Construct an element of ``self``.
1993
1994
TESTS::
1995
1996
sage: KRC = KirillovReshetikhinCrystal(['B',3,1], 3, 3)
1997
sage: KRT = KirillovReshetikhinTableaux(['B',3,1], 3, 3)
1998
sage: elt = KRC.module_generators[1].f_string([3,2,3,1,3,3]); elt
1999
[++-, [[2], [0], [-3]]]
2000
sage: ret = KRT(elt); ret
2001
[[1, 1, 2], [2, 2, -3], [-3, -3, -1]]
2002
sage: test = KRC(ret); test
2003
[++-, [[2], [0], [-3]]]
2004
sage: test == elt
2005
True
2006
"""
2007
from sage.combinat.rigged_configurations.kr_tableaux import KirillovReshetikhinTableauxElement
2008
if isinstance(args[0], KirillovReshetikhinTableauxElement):
2009
elt = args[0]
2010
# Check to make sure it can be converted
2011
if elt.cartan_type() != self.cartan_type() \
2012
or elt.parent().r() != self._r or elt.parent().s() != self._s:
2013
raise ValueError("The Kirillov-Reshetikhin tableau must have the same Cartan type and shape")
2014
2015
to_hw = elt.to_classical_highest_weight()
2016
wt = to_hw[0].classical_weight() / 2
2017
f_str = reversed(to_hw[1])
2018
for x in self.module_generators:
2019
if x.classical_weight() == wt:
2020
return x.f_string(f_str)
2021
raise ValueError("No matching highest weight element found")
2022
return KirillovReshetikhinGenericCrystal._element_constructor_(self, *args, **options)
2023
2024
def classical_decomposition(self):
2025
r"""
2026
Specifies the classical crystal underlying the Kirillov-Reshetikhin crystal `B^{n,s}` of type `B_n^{(1)}`.
2027
2028
It is the same as for `r<n`, given by `B^{n,s} \cong \bigoplus_\Lambda B(\Lambda)` where `\Lambda` are
2029
weights obtained from a rectangle of width `s/2` and height `n` by removing horizontal dominoes.
2030
Here we identify the fundamental weight `\Lambda_i` with a column of height `i` for `i<n` and
2031
a column of width `1/2` for `i=n`.
2032
2033
EXAMPLES::
2034
2035
sage: K = KirillovReshetikhinCrystal(['B',3,1], 3, 2)
2036
sage: K.classical_decomposition()
2037
The crystal of tableaux of type ['B', 3] and shape(s) [[1], [1, 1, 1]]
2038
sage: K = KirillovReshetikhinCrystal(['B',3,1], 3, 3)
2039
sage: K.classical_decomposition()
2040
The crystal of tableaux of type ['B', 3] and shape(s) [[3/2, 1/2, 1/2], [3/2, 3/2, 3/2]]
2041
"""
2042
s = self.s()
2043
r = self.r()
2044
shapes = vertical_dominoes_removed(r,floor(s/2))
2045
if is_odd(s):
2046
shapes = [ [i+QQ(1)/QQ(2) for i in sh]+[QQ(1)/QQ(2)]*(r-len(sh)) for sh in shapes ]
2047
return CrystalOfTableaux(self.cartan_type().classical(), shapes = shapes)
2048
2049
def ambient_crystal(self):
2050
r"""
2051
Returns the ambient crystal `B^{n,s}` of type `A_{2n-1}^{(2)}` associated to the Kirillov-Reshetikhin crystal;
2052
see Lemma 4.2 of reference [4].
2053
This ambient crystal is used to construct the zero arrows.
2054
2055
EXAMPLES::
2056
2057
sage: K = KirillovReshetikhinCrystal(['B',3,1],3,2)
2058
sage: K.ambient_crystal()
2059
Kirillov-Reshetikhin crystal of type ['B', 3, 1]^* with (r,s)=(3,2)
2060
"""
2061
return KirillovReshetikhinCrystal(['A', 2*self.cartan_type().classical().rank()-1,2], self.r(), self.s())
2062
2063
@cached_method
2064
def highest_weight_dict(self):
2065
r"""
2066
Gives a dictionary of the classical highest weight vectors of self.
2067
Their key is 2 times their shape.
2068
2069
EXAMPLES::
2070
2071
sage: K = KirillovReshetikhinCrystal(['B',3,1],3,2)
2072
sage: K.highest_weight_dict()
2073
{(2,): [[1]], (2, 2, 2): [[1], [2], [3]]}
2074
sage: K = KirillovReshetikhinCrystal(['B',3,1],3,3)
2075
sage: K.highest_weight_dict()
2076
{(3, 3, 3): [+++, [[1], [2], [3]]], (3, 1, 1): [+++, [[1]]]}
2077
"""
2078
return dict( (tuple([2*i[1] for i in x.classical_weight()]),x) for x in self.module_generators )
2079
2080
@cached_method
2081
def ambient_highest_weight_dict(self):
2082
r"""
2083
Gives a dictionary of the classical highest weight vectors of the ambient crystal of self.
2084
Their key is their shape.
2085
2086
EXAMPLES::
2087
2088
sage: K = KirillovReshetikhinCrystal(['B',3,1],3,2)
2089
sage: K.ambient_highest_weight_dict()
2090
{(2,): [[1, 1]], (2, 1, 1): [[1, 1], [2], [3]], (2, 2, 2): [[1, 1], [2, 2], [3, 3]]}
2091
2092
sage: K = KirillovReshetikhinCrystal(['B',3,1],3,3)
2093
sage: K.ambient_highest_weight_dict()
2094
{(3, 3, 3): [[1, 1, 1], [2, 2, 2], [3, 3, 3]], (3, 1, 1): [[1, 1, 1], [2], [3]],
2095
(3, 2, 2): [[1, 1, 1], [2, 2], [3, 3]], (3,): [[1, 1, 1]]}
2096
"""
2097
return dict( (tuple([i[1] for i in x.classical_weight()]),x) for x in self.ambient_crystal().module_generators )
2098
2099
def similarity_factor(self):
2100
r"""
2101
Sets the similarity factor used to map to the ambient crystal.
2102
2103
EXAMPLES::
2104
2105
sage: K = KirillovReshetikhinCrystal(['B',3,1],3,2)
2106
sage: K.similarity_factor()
2107
{1: 2, 2: 2, 3: 1}
2108
"""
2109
C = self.cartan_type().classical()
2110
p = dict( (i,2) for i in C.index_set() )
2111
p[C.rank()] = 1
2112
return p
2113
2114
@cached_method
2115
def to_ambient_crystal(self):
2116
r"""
2117
Provides a map from self to the ambient crystal of type `A_{2n-1}^{(2)}`.
2118
2119
EXAMPLES::
2120
2121
sage: K = KirillovReshetikhinCrystal(['B',3,1],3,1)
2122
sage: [K.to_ambient_crystal()(b) for b in K]
2123
[[[1], [2], [3]], [[1], [2], [-3]], [[1], [3], [-2]], [[2], [3], [-1]], [[1], [-3], [-2]],
2124
[[2], [-3], [-1]], [[3], [-2], [-1]], [[-3], [-2], [-1]]]
2125
"""
2126
keys = self.highest_weight_dict().keys()
2127
pdict = dict( (self.highest_weight_dict()[key], self.ambient_highest_weight_dict()[key]) for key in keys )
2128
return self.crystal_morphism( pdict, index_set = self.cartan_type().classical().index_set(),
2129
similarity_factor = self.similarity_factor() )
2130
2131
@cached_method
2132
def from_ambient_crystal(self):
2133
r"""
2134
Provides a map from the ambient crystal of type `A_{2n-1}^{(2)}` to
2135
the Kirillov-Reshetikhin crystal ``self``.
2136
2137
Note that this map is only well-defined on elements that are in the
2138
image under :meth:`to_ambient_crystal`.
2139
2140
EXAMPLES::
2141
2142
sage: K = KirillovReshetikhinCrystal(['B',3,1],3,1)
2143
sage: [b == K.from_ambient_crystal()(K.to_ambient_crystal()(b)) for b in K]
2144
[True, True, True, True, True, True, True, True]
2145
sage: b = K.ambient_crystal()(rows=[[1],[2],[-3]])
2146
sage: K.from_ambient_crystal()(b)
2147
[++-, []]
2148
"""
2149
keys = self.highest_weight_dict().keys()
2150
pdict_inv = dict( (self.ambient_highest_weight_dict()[key], self.highest_weight_dict()[key]) for key in keys )
2151
return self.crystal_morphism( pdict_inv, index_set = self.cartan_type().classical().index_set(),
2152
similarity_factor_domain = self.similarity_factor() )
2153
2154
2155
class KR_type_BnElement(KirillovReshetikhinGenericCrystalElement):
2156
r"""
2157
Class for the elements in the Kirillov-Reshetikhin crystals `B^{n,s}` of type `B_n^{(1)}`.
2158
2159
EXAMPLES::
2160
2161
sage: K=KirillovReshetikhinCrystal(['B',3,1],3,2)
2162
sage: type(K.module_generators[0])
2163
<class 'sage.combinat.crystals.kirillov_reshetikhin.KR_type_Bn_with_category.element_class'>
2164
"""
2165
2166
def e0(self):
2167
r"""
2168
Gives `e_0` on self by mapping self to the ambient crystal, calculating `e_0` there and
2169
pulling the element back.
2170
2171
EXAMPLES::
2172
2173
sage: K=KirillovReshetikhinCrystal(['B',3,1],3,1)
2174
sage: b = K.module_generators[0]
2175
sage: b.e(0) # indirect doctest
2176
[--+, []]
2177
"""
2178
b = self.parent().to_ambient_crystal()(self).e_string([0,0])
2179
if b is None:
2180
return None
2181
return self.parent().from_ambient_crystal()(b)
2182
2183
def f0(self):
2184
r"""
2185
Gives `f_0` on self by mapping self to the ambient crystal, calculating `f_0` there and
2186
pulling the element back.
2187
2188
EXAMPLES::
2189
2190
sage: K=KirillovReshetikhinCrystal(['B',3,1],3,1)
2191
sage: b = K.module_generators[0]
2192
sage: b.f(0) # indirect doctest
2193
2194
"""
2195
b = self.parent().to_ambient_crystal()(self).f_string([0,0])
2196
if b is None:
2197
return None
2198
return self.parent().from_ambient_crystal()(b)
2199
2200
def epsilon0(self):
2201
r"""
2202
Calculates `\epsilon_0` of self by mapping the element to the ambient crystal
2203
and calculating `\epsilon_0` there.
2204
2205
EXAMPLES::
2206
2207
sage: K=KirillovReshetikhinCrystal(['B',3,1],3,1)
2208
sage: b = K.module_generators[0]
2209
sage: b.epsilon(0) # indirect doctest
2210
1
2211
"""
2212
b = self.parent().to_ambient_crystal()(self)
2213
return b.epsilon(0)/2
2214
2215
def phi0(self):
2216
r"""
2217
Calculates `\phi_0` of self by mapping the element to the ambient crystal
2218
and calculating `\phi_0` there.
2219
2220
EXAMPLES::
2221
2222
sage: K=KirillovReshetikhinCrystal(['B',3,1],3,1)
2223
sage: b = K.module_generators[0]
2224
sage: b.phi(0) # indirect doctest
2225
0
2226
"""
2227
b = self.parent().to_ambient_crystal()(self)
2228
return b.phi(0)/2
2229
2230
KR_type_Bn.Element = KR_type_BnElement
2231
2232
2233
class KR_type_Cn(KirillovReshetikhinGenericCrystal):
2234
r"""
2235
Class of Kirillov-Reshetikhin crystals `B^{n,s}` of type `C_n^{(1)}`.
2236
2237
EXAMPLES::
2238
2239
sage: K = KirillovReshetikhinCrystal(['C',3,1],3,1)
2240
sage: [[b,b.f(0)] for b in K]
2241
[[[[1], [2], [3]], None], [[[1], [2], [-3]], None], [[[1], [3], [-3]], None],
2242
[[[2], [3], [-3]], None], [[[1], [3], [-2]], None], [[[2], [3], [-2]], None],
2243
[[[2], [3], [-1]], [[1], [2], [3]]], [[[1], [-3], [-2]], None], [[[2], [-3], [-2]], None],
2244
[[[2], [-3], [-1]], [[1], [2], [-3]]], [[[3], [-3], [-2]], None], [[[3], [-3], [-1]],
2245
[[1], [3], [-3]]], [[[3], [-2], [-1]], [[1], [3], [-2]]], [[[-3], [-2], [-1]], [[1], [-3], [-2]]]]
2246
"""
2247
2248
def classical_decomposition(self):
2249
r"""
2250
Specifies the classical crystal underlying the Kirillov-Reshetikhin crystal `B^{n,s}`
2251
of type `C_n^{(1)}`. It is given by `B^{n,s} \cong B(s \Lambda_n)`.
2252
2253
EXAMPLES::
2254
2255
sage: K = KirillovReshetikhinCrystal(['C',3,1],3,2)
2256
sage: K.classical_decomposition()
2257
The crystal of tableaux of type ['C', 3] and shape(s) [[2, 2, 2]]
2258
"""
2259
return CrystalOfTableaux(self.cartan_type().classical(), shape = [self.s()]*self.r() )
2260
2261
def from_highest_weight_vector_to_pm_diagram(self, b):
2262
"""
2263
This gives the bijection between an element b in the classical decomposition
2264
of the KR crystal that is `{2,3,..,n}`-highest weight and `\pm` diagrams.
2265
2266
EXAMPLES::
2267
2268
sage: K = KirillovReshetikhinCrystal(['C',3,1],3,2)
2269
sage: T = K.classical_decomposition()
2270
sage: b = T(rows=[[2, 2], [3, 3], [-3, -1]])
2271
sage: pm = K.from_highest_weight_vector_to_pm_diagram(b); pm
2272
[[0, 0], [1, 0], [0, 1], [0]]
2273
sage: pm.__repr__(pretty_printing=True)
2274
. .
2275
. +
2276
- -
2277
2278
sage: hw = [ b for b in T if all(b.epsilon(i)==0 for i in [2,3]) ]
2279
sage: all(K.from_pm_diagram_to_highest_weight_vector(K.from_highest_weight_vector_to_pm_diagram(b)) == b for b in hw)
2280
True
2281
"""
2282
n = self.cartan_type().rank()-1
2283
inner = Partition([Integer(b.weight()[i]) for i in range(1,n+1)])
2284
inter = Partition([len([i for i in r if i>0]) for r in b.to_tableau()])
2285
outer = b.to_tableau().shape()
2286
return PMDiagram([self.r(), self.s(), outer, inter, inner], from_shapes=True)
2287
2288
def from_pm_diagram_to_highest_weight_vector(self, pm):
2289
"""
2290
This gives the bijection between a `\pm` diagram and an element b in the classical
2291
decomposition of the KR crystal that is {2,3,..,n}-highest weight.
2292
2293
EXAMPLES::
2294
2295
sage: K = KirillovReshetikhinCrystal(['C',3,1],3,2)
2296
sage: pm = sage.combinat.crystals.kirillov_reshetikhin.PMDiagram([[0, 0], [1, 0], [0, 1], [0]])
2297
sage: K.from_pm_diagram_to_highest_weight_vector(pm)
2298
[[2, 2], [3, 3], [-3, -1]]
2299
"""
2300
u = [b for b in self.classical_decomposition().module_generators if b.to_tableau().shape() == pm.outer_shape()][0]
2301
ct = self.cartan_type()
2302
rank = ct.rank()-1
2303
ct_type = ct.classical().type()
2304
assert ct_type in ['C']
2305
list = []
2306
for h in pm.heights_of_addable_plus():
2307
list += range(1,h+1)
2308
for h in pm.heights_of_minus():
2309
list += range(1,rank+1)+[rank-1-k for k in range(rank-h)]
2310
for i in reversed(list):
2311
u = u.f(i)
2312
return u
2313
2314
class KR_type_CnElement(KirillovReshetikhinGenericCrystalElement):
2315
r"""
2316
Class for the elements in the Kirillov-Reshetikhin crystals `B^{n,s}` of type `C_n^{(1)}`.
2317
2318
EXAMPLES::
2319
2320
sage: K=KirillovReshetikhinCrystal(['C',3,1],3,2)
2321
sage: type(K.module_generators[0])
2322
<class 'sage.combinat.crystals.kirillov_reshetikhin.KR_type_Cn_with_category.element_class'>
2323
"""
2324
2325
def e0(self):
2326
r"""
2327
Gives `e_0` on self by going to the `\pm`-diagram corresponding to the `{2,...,n}`-highest weight
2328
vector in the component of `self`, then applying [Definition 6.1, 4], and pulling back from
2329
`\pm`-diagrams.
2330
2331
EXAMPLES::
2332
2333
sage: K=KirillovReshetikhinCrystal(['C',3,1],3,2)
2334
sage: b = K.module_generators[0]
2335
sage: b.e(0) # indirect doctest
2336
[[1, 2], [2, 3], [3, -1]]
2337
sage: b = K(rows=[[1,2],[2,3],[3,-1]])
2338
sage: b.e(0)
2339
[[2, 2], [3, 3], [-1, -1]]
2340
sage: b=K(rows=[[1, -3], [3, -2], [-3, -1]])
2341
sage: b.e(0)
2342
[[3, -3], [-3, -2], [-1, -1]]
2343
"""
2344
n = self.parent().cartan_type().n
2345
[b,l] = self.lift().to_highest_weight(index_set=range(2,n+1))
2346
pm = self.parent().from_highest_weight_vector_to_pm_diagram(b)
2347
[l1,l2] = pm.pm_diagram[n-1]
2348
if l1 == 0:
2349
return None
2350
pm.pm_diagram[n-1] = [l1-1,l2+1]
2351
pm = PMDiagram(pm.pm_diagram)
2352
b = self.parent().from_pm_diagram_to_highest_weight_vector(pm)
2353
b = b.f_string(reversed(l))
2354
return self.parent().retract(b)
2355
2356
def f0(self):
2357
r"""
2358
Gives `e_0` on self by going to the `\pm`-diagram corresponding to the `{2,...,n}`-highest weight
2359
vector in the component of `self`, then applying [Definition 6.1, 4], and pulling back from
2360
`\pm`-diagrams.
2361
2362
EXAMPLES::
2363
2364
sage: K=KirillovReshetikhinCrystal(['C',3,1],3,1)
2365
sage: b = K.module_generators[0]
2366
sage: b.f(0) # indirect doctest
2367
"""
2368
n = self.parent().cartan_type().n
2369
[b,l] = self.lift().to_highest_weight(index_set=range(2,n+1))
2370
pm = self.parent().from_highest_weight_vector_to_pm_diagram(b)
2371
[l1,l2] = pm.pm_diagram[n-1]
2372
if l2 == 0:
2373
return None
2374
pm.pm_diagram[n-1] = [l1+1,l2-1]
2375
pm = PMDiagram(pm.pm_diagram)
2376
b = self.parent().from_pm_diagram_to_highest_weight_vector(pm)
2377
b = b.f_string(reversed(l))
2378
return self.parent().retract(b)
2379
2380
def epsilon0(self):
2381
r"""
2382
Calculates `\epsilon_0` of self using Lemma 6.1 of [4].
2383
2384
EXAMPLES::
2385
2386
sage: K=KirillovReshetikhinCrystal(['C',3,1],3,1)
2387
sage: b = K.module_generators[0]
2388
sage: b.epsilon(0) # indirect doctest
2389
1
2390
"""
2391
n = self.parent().cartan_type().n
2392
b = self.lift().to_highest_weight(index_set=range(2,n+1))[0]
2393
pm = self.parent().from_highest_weight_vector_to_pm_diagram(b)
2394
[l1,l2] = pm.pm_diagram[n-1]
2395
return l1
2396
2397
def phi0(self):
2398
r"""
2399
Calculates `\phi_0` of self.
2400
2401
EXAMPLES::
2402
2403
sage: K=KirillovReshetikhinCrystal(['C',3,1],3,1)
2404
sage: b = K.module_generators[0]
2405
sage: b.phi(0) # indirect doctest
2406
0
2407
"""
2408
n = self.parent().cartan_type().n
2409
b = self.lift().to_highest_weight(index_set=range(2,n+1))[0]
2410
pm = self.parent().from_highest_weight_vector_to_pm_diagram(b)
2411
[l1,l2] = pm.pm_diagram[n-1]
2412
return l2
2413
2414
KR_type_Cn.Element = KR_type_CnElement
2415
2416
2417
class KR_type_Dn_twisted(KirillovReshetikhinGenericCrystal):
2418
r"""
2419
Class of Kirillov-Reshetikhin crystals `B^{n,s}` of type `D_{n+1}^{(2)}`.
2420
2421
EXAMPLES::
2422
2423
sage: K = KirillovReshetikhinCrystal(['D',4,2],3,1)
2424
sage: [[b,b.f(0)] for b in K]
2425
[[[+++, []], None], [[++-, []], None], [[+-+, []], None], [[-++, []],
2426
[+++, []]], [[+--, []], None], [[-+-, []], [++-, []]], [[--+, []], [+-+, []]],
2427
[[---, []], [+--, []]]]
2428
"""
2429
2430
def classical_decomposition(self):
2431
r"""
2432
Specifies the classical crystal underlying the Kirillov-Reshetikhin crystal `B^{n,s}`
2433
of type `D_{n+1}^{(2)}`. It is given by `B^{n,s} \cong B(s \Lambda_n)`.
2434
2435
EXAMPLES::
2436
2437
sage: K = KirillovReshetikhinCrystal(['D',4,2],3,1)
2438
sage: K.classical_decomposition()
2439
The crystal of tableaux of type ['B', 3] and shape(s) [[1/2, 1/2, 1/2]]
2440
sage: K = KirillovReshetikhinCrystal(['D',4,2],3,2)
2441
sage: K.classical_decomposition()
2442
The crystal of tableaux of type ['B', 3] and shape(s) [[1, 1, 1]]
2443
"""
2444
s = self.s()
2445
if is_even(s):
2446
s = int(s/2)
2447
else:
2448
s = s/2
2449
return CrystalOfTableaux(self.cartan_type().classical(), shape = [s]*self.r() )
2450
2451
def from_highest_weight_vector_to_pm_diagram(self, b):
2452
"""
2453
This gives the bijection between an element b in the classical decomposition
2454
of the KR crystal that is `{2,3,..,n}`-highest weight and `\pm` diagrams.
2455
2456
EXAMPLES::
2457
2458
sage: K = KirillovReshetikhinCrystal(['D',4,2],3,1)
2459
sage: T = K.classical_decomposition()
2460
sage: hw = [ b for b in T if all(b.epsilon(i)==0 for i in [2,3]) ]
2461
sage: [K.from_highest_weight_vector_to_pm_diagram(b) for b in hw]
2462
[[[0, 0], [0, 0], [1, 0], [0]], [[0, 0], [0, 0], [0, 1], [0]]]
2463
2464
sage: K = KirillovReshetikhinCrystal(['D',4,2],3,2)
2465
sage: T = K.classical_decomposition()
2466
sage: hw = [ b for b in T if all(b.epsilon(i)==0 for i in [2,3]) ]
2467
sage: [K.from_highest_weight_vector_to_pm_diagram(b) for b in hw]
2468
[[[0, 0], [0, 0], [2, 0], [0]], [[0, 0], [0, 0], [0, 0], [2]], [[0, 0], [2, 0], [0, 0], [0]],
2469
[[0, 0], [0, 0], [0, 2], [0]]]
2470
2471
Note that, since the classical decomposition of this crystal is of type `B_n`, there can
2472
be (at most one) entry `0` in the `{2,3,...,n}`-highest weight elements at height `n`.
2473
In the following implementation this is realized as an empty column of height `n` since
2474
this uniquely specifies the existence of the `0`:
2475
2476
EXAMPLES::
2477
2478
sage: b = hw[1]
2479
sage: pm = K.from_highest_weight_vector_to_pm_diagram(b)
2480
sage: pm.__repr__(pretty_printing=True)
2481
. .
2482
. .
2483
. .
2484
2485
TESTS::
2486
2487
sage: all(K.from_pm_diagram_to_highest_weight_vector(K.from_highest_weight_vector_to_pm_diagram(b)) == b for b in hw)
2488
True
2489
sage: K = KirillovReshetikhinCrystal(['D',4,2],3,2)
2490
sage: T = K.classical_decomposition()
2491
sage: hw = [ b for b in T if all(b.epsilon(i)==0 for i in [2,3]) ]
2492
sage: all(K.from_pm_diagram_to_highest_weight_vector(K.from_highest_weight_vector_to_pm_diagram(b)) == b for b in hw)
2493
True
2494
sage: K = KirillovReshetikhinCrystal(['D',4,2],3,3)
2495
sage: T = K.classical_decomposition()
2496
sage: hw = [ b for b in T if all(b.epsilon(i)==0 for i in [2,3]) ]
2497
sage: all(K.from_pm_diagram_to_highest_weight_vector(K.from_highest_weight_vector_to_pm_diagram(b)) == b for b in hw)
2498
True
2499
2500
"""
2501
n = self.cartan_type().rank()-1
2502
s = self.s()
2503
if is_odd(s):
2504
t = b[0]
2505
b = b[1]
2506
else:
2507
t = b.parent()(rows=[])
2508
inner = [Integer(2*b.weight()[i]+2*t.weight()[i]) for i in range(1,n+1)]
2509
inter1 = Partition([len([i for i in r if i>0]) for r in b.to_tableau()])
2510
inter = Partition([len([i for i in r if i>=0]) for r in b.to_tableau()])
2511
if inter != inter1:
2512
inner[n-1] += 2
2513
inner = Partition(inner)
2514
inter = [2*i for i in inter]+[0]*(n-len(inter))
2515
w = t.weight()
2516
if w[0]==0 and w[n-1]==0:
2517
v = [0]*n
2518
else:
2519
v = [1]*n
2520
if w[0]<0 and w[n-1]>0:
2521
v[n-1]=0
2522
elif w[0]>0 and w[n-1]<0:
2523
v[n-1]=0
2524
v[n-2]=-1
2525
inter = Partition([inter[i] + v[i] for i in range(n)])
2526
outer = Partition([s]*n)
2527
return PMDiagram([n, s, outer, inter, inner], from_shapes=True)
2528
2529
def from_pm_diagram_to_highest_weight_vector(self, pm):
2530
"""
2531
This gives the bijection between a `\pm` diagram and an element b in the classical
2532
decomposition of the KR crystal that is {2,3,..,n}-highest weight.
2533
2534
EXAMPLES::
2535
2536
sage: K = KirillovReshetikhinCrystal(['D',4,2],3,2)
2537
sage: pm = sage.combinat.crystals.kirillov_reshetikhin.PMDiagram([[0, 0], [0, 0], [0, 0], [2]])
2538
sage: K.from_pm_diagram_to_highest_weight_vector(pm)
2539
[[2], [3], [0]]
2540
"""
2541
u = self.classical_decomposition().module_generators[0]
2542
ct = self.cartan_type()
2543
rank = ct.rank()-1
2544
assert ct.classical().type() in ['B']
2545
list = []
2546
plus = pm.heights_of_addable_plus()
2547
minus = pm.heights_of_minus()
2548
l = len([i for i in plus if i==rank-1])
2549
a = (len(plus) + l)/2
2550
list += sum(([i]*a for i in range(1,rank+1)),[])
2551
a = (len(minus)-l)/2
2552
list += (range(1,rank+1)+[rank])*a
2553
for i in reversed(list):
2554
u = u.f(i)
2555
return u
2556
2557
class KR_type_Dn_twistedElement(KirillovReshetikhinGenericCrystalElement):
2558
r"""
2559
Class for the elements in the Kirillov-Reshetikhin crystals `B^{n,s}` of type `D_{n+1}^{(2)}`.
2560
2561
EXAMPLES::
2562
2563
sage: K=KirillovReshetikhinCrystal(['D',4,2],3,2)
2564
sage: type(K.module_generators[0])
2565
<class 'sage.combinat.crystals.kirillov_reshetikhin.KR_type_Dn_twisted_with_category.element_class'>
2566
"""
2567
2568
def e0(self):
2569
r"""
2570
Gives `e_0` on self by going to the `\pm`-diagram corresponding to the `{2,...,n}`-highest weight
2571
vector in the component of `self`, then applying [Definition 6.2, 4], and pulling back from
2572
`\pm`-diagrams.
2573
2574
EXAMPLES::
2575
2576
sage: K=KirillovReshetikhinCrystal(['D',4,2],3,3)
2577
sage: b = K.module_generators[0]
2578
sage: b.e(0) # indirect doctest
2579
[+++, [[2], [3], [0]]]
2580
"""
2581
n = self.parent().cartan_type().rank()-1
2582
s = self.parent().s()
2583
[b,l] = self.lift().to_highest_weight(index_set=range(2,n+1))
2584
pm = self.parent().from_highest_weight_vector_to_pm_diagram(b)
2585
[l1,l2] = pm.pm_diagram[n-1]
2586
l3 = pm.pm_diagram[n-2][0]
2587
if l1+l2+l3==s and l1==0:
2588
return None
2589
if l1+l2+l3<s:
2590
pm.pm_diagram[n-1][1] = l2+2
2591
pm.pm_diagram[n][0] -= 2
2592
elif l1>1:
2593
pm.pm_diagram[n-1][0] = l1-2
2594
pm.pm_diagram[n][0] += 2
2595
elif l1 ==1:
2596
pm.pm_diagram[n-1][0] = 0
2597
pm.pm_diagram[n-1][1] = l2+1
2598
pm = PMDiagram(pm.pm_diagram)
2599
b = self.parent().from_pm_diagram_to_highest_weight_vector(pm)
2600
b = b.f_string(reversed(l))
2601
return self.parent().retract(b)
2602
2603
def f0(self):
2604
r"""
2605
Gives `e_0` on self by going to the `\pm`-diagram corresponding to the `{2,...,n}`-highest weight
2606
vector in the component of `self`, then applying [Definition 6.2, 4], and pulling back from
2607
`\pm`-diagrams.
2608
2609
EXAMPLES::
2610
2611
sage: K=KirillovReshetikhinCrystal(['D',4,2],3,2)
2612
sage: b = K.module_generators[0]
2613
sage: b.f(0) # indirect doctest
2614
"""
2615
n = self.parent().cartan_type().rank()-1
2616
s = self.parent().s()
2617
[b,l] = self.lift().to_highest_weight(index_set=range(2,n+1))
2618
pm = self.parent().from_highest_weight_vector_to_pm_diagram(b)
2619
[l1,l2] = pm.pm_diagram[n-1]
2620
l3 = pm.pm_diagram[n-2][0]
2621
if l1+l2+l3==s and l2==0:
2622
return None
2623
if l1+l2+l3<s:
2624
pm.pm_diagram[n-1][0] = l1+2
2625
pm.pm_diagram[n][0] -= 2
2626
elif l2>1:
2627
pm.pm_diagram[n-1][1] = l2-2
2628
pm.pm_diagram[n][0] += 2
2629
elif l2 ==1:
2630
pm.pm_diagram[n-1][1] = 0
2631
pm.pm_diagram[n-1][0] = l1+1
2632
pm = PMDiagram(pm.pm_diagram)
2633
b = self.parent().from_pm_diagram_to_highest_weight_vector(pm)
2634
b = b.f_string(reversed(l))
2635
return self.parent().retract(b)
2636
2637
def epsilon0(self):
2638
r"""
2639
Calculates `\epsilon_0` of self using Lemma 6.2 of [4].
2640
2641
EXAMPLES::
2642
2643
sage: K=KirillovReshetikhinCrystal(['D',4,2],3,1)
2644
sage: b = K.module_generators[0]
2645
sage: b.epsilon(0) # indirect doctest
2646
1
2647
"""
2648
n = self.parent().cartan_type().rank()-1
2649
s = self.parent().s()
2650
[b,l] = self.lift().to_highest_weight(index_set=range(2,n+1))
2651
pm = self.parent().from_highest_weight_vector_to_pm_diagram(b)
2652
l1 = pm.pm_diagram[n-1][0]
2653
l4 = pm.pm_diagram[n][0]
2654
return l1+l4
2655
2656
def phi0(self):
2657
r"""
2658
Calculates `\phi_0` of self.
2659
2660
EXAMPLES::
2661
2662
sage: K=KirillovReshetikhinCrystal(['D',4,2],3,1)
2663
sage: b = K.module_generators[0]
2664
sage: b.phi(0) # indirect doctest
2665
0
2666
"""
2667
n = self.parent().cartan_type().rank()-1
2668
s = self.parent().s()
2669
[b,l] = self.lift().to_highest_weight(index_set=range(2,n+1))
2670
pm = self.parent().from_highest_weight_vector_to_pm_diagram(b)
2671
l2 = pm.pm_diagram[n-1][1]
2672
l4 = pm.pm_diagram[n][0]
2673
return l2+l4
2674
2675
KR_type_Dn_twisted.Element = KR_type_Dn_twistedElement
2676
2677
class KR_type_spin(KirillovReshetikhinCrystalFromPromotion):
2678
r"""
2679
Class of Kirillov-Reshetikhin crystals `B^{n,s}` of type `D_n^{(1)}`.
2680
2681
EXAMPLES::
2682
2683
sage: K = KirillovReshetikhinCrystal(['D',4,1],4,1); K
2684
Kirillov-Reshetikhin crystal of type ['D', 4, 1] with (r,s)=(4,1)
2685
sage: [[b,b.f(0)] for b in K]
2686
[[[++++, []], None], [[++--, []], None], [[+-+-, []], None], [[-++-, []], None],
2687
[[+--+, []], None], [[-+-+, []], None], [[--++, []], [++++, []]], [[----, []], [++--, []]]]
2688
2689
sage: K = KirillovReshetikhinCrystal(['D',4,1],4,2); K
2690
Kirillov-Reshetikhin crystal of type ['D', 4, 1] with (r,s)=(4,2)
2691
sage: [[b,b.f(0)] for b in K]
2692
[[[[1], [2], [3], [4]], None], [[[1], [2], [-4], [4]], None], [[[1], [3], [-4], [4]], None],
2693
[[[2], [3], [-4], [4]], None], [[[1], [4], [-4], [4]], None], [[[2], [4], [-4], [4]], None],
2694
[[[3], [4], [-4], [4]], [[1], [2], [3], [4]]], [[[-4], [4], [-4], [4]], [[1], [2], [-4], [4]]],
2695
[[[-4], [4], [-4], [-3]], [[1], [2], [-4], [-3]]], [[[-4], [4], [-4], [-2]], [[1], [3], [-4], [-3]]],
2696
[[[-4], [4], [-4], [-1]], [[2], [3], [-4], [-3]]], [[[-4], [4], [-3], [-2]], [[1], [4], [-4], [-3]]],
2697
[[[-4], [4], [-3], [-1]], [[2], [4], [-4], [-3]]], [[[-4], [4], [-2], [-1]], [[-4], [4], [-4], [4]]],
2698
[[[-4], [-3], [-2], [-1]], [[-4], [4], [-4], [-3]]], [[[1], [2], [-4], [-3]], None], [[[1], [3], [-4], [-3]], None],
2699
[[[2], [3], [-4], [-3]], None], [[[1], [3], [-4], [-2]], None], [[[2], [3], [-4], [-2]], None],
2700
[[[2], [3], [-4], [-1]], None], [[[1], [4], [-4], [-3]], None], [[[2], [4], [-4], [-3]], None],
2701
[[[3], [4], [-4], [-3]], None], [[[3], [4], [-4], [-2]], [[1], [3], [-4], [4]]],
2702
[[[3], [4], [-4], [-1]], [[2], [3], [-4], [4]]], [[[1], [4], [-4], [-2]], None], [[[2], [4], [-4], [-2]], None],
2703
[[[2], [4], [-4], [-1]], None], [[[1], [4], [-3], [-2]], None], [[[2], [4], [-3], [-2]], None],
2704
[[[2], [4], [-3], [-1]], None], [[[3], [4], [-3], [-2]], [[1], [4], [-4], [4]]],
2705
[[[3], [4], [-3], [-1]], [[2], [4], [-4], [4]]], [[[3], [4], [-2], [-1]], [[3], [4], [-4], [4]]]]
2706
2707
TESTS::
2708
2709
sage: K = KirillovReshetikhinCrystal(['D',4,1],3,1)
2710
sage: all(b.e(0).f(0) == b for b in K if b.epsilon(0)>0)
2711
True
2712
2713
sage: K = KirillovReshetikhinCrystal(['D',5,1],5,2)
2714
sage: all(b.f(0).e(0) == b for b in K if b.phi(0)>0)
2715
True
2716
"""
2717
def _element_constructor_(self, *args, **options):
2718
"""
2719
Construct an element of ``self`` from the input.
2720
2721
EXAMPLES::
2722
2723
sage: KRT = KirillovReshetikhinTableaux(['D',4,1], 4, 3)
2724
sage: KRC = KirillovReshetikhinCrystal(['D',4,1], 4, 3)
2725
sage: elt = KRT(-3,-4,2,1,-3,-4,2,1,-2,-4,3,1); elt
2726
[[1, 1, 1], [2, 2, 3], [-4, -4, -4], [-3, -3, -2]]
2727
sage: KRC(elt) # indirect doctest
2728
[++--, [[1], [3], [-4], [-3]]]
2729
2730
TESTS:
2731
2732
Spinor test::
2733
2734
sage: KRC = KirillovReshetikhinCrystal(['D',4,1], 4, 3)
2735
sage: KRT = KirillovReshetikhinTableaux(['D',4,1], 4, 3)
2736
sage: elt = KRC.module_generator().f_string([4,2,4,3,4,1]); elt
2737
[++--, [[2], [4], [-4], [-3]]]
2738
sage: ret = KRT(elt); ret
2739
[[1, 1, 2], [2, 2, 4], [-4, -4, -3], [-3, -3, -1]]
2740
sage: test = KRC(ret); test
2741
[++--, [[2], [4], [-4], [-3]]]
2742
sage: test == elt
2743
True
2744
"""
2745
from sage.combinat.rigged_configurations.kr_tableaux import KirillovReshetikhinTableauxElement
2746
if isinstance(args[0], KirillovReshetikhinTableauxElement):
2747
elt = args[0]
2748
# Check to make sure it can be converted
2749
if elt.cartan_type() != self.cartan_type() \
2750
or elt.parent().r() != self._r or elt.parent().s() != self._s:
2751
raise ValueError("The Kirillov-Reshetikhin tableau must have the same Cartan type and shape")
2752
2753
to_hw = elt.to_classical_highest_weight()
2754
f_str = reversed(to_hw[1])
2755
return self.module_generator().f_string(f_str)
2756
return KirillovReshetikhinCrystalFromPromotion._element_constructor_(self, *args, **options)
2757
2758
def classical_decomposition(self):
2759
r"""
2760
Returns the classical crystal underlying the Kirillov-Reshetikhin crystal `B^{r,s}`
2761
of type `D_n^{(1)}` for `r=n-1,n`. It is given by `B^{n,s} \cong B(s \Lambda_r)`.
2762
2763
EXAMPLES::
2764
2765
sage: K = KirillovReshetikhinCrystal(['D',4,1],4,1)
2766
sage: K.classical_decomposition()
2767
The crystal of tableaux of type ['D', 4] and shape(s) [[1/2, 1/2, 1/2, 1/2]]
2768
sage: K = KirillovReshetikhinCrystal(['D',4,1],3,1)
2769
sage: K.classical_decomposition()
2770
The crystal of tableaux of type ['D', 4] and shape(s) [[1/2, 1/2, 1/2, -1/2]]
2771
sage: K = KirillovReshetikhinCrystal(['D',4,1],3,2)
2772
sage: K.classical_decomposition()
2773
The crystal of tableaux of type ['D', 4] and shape(s) [[1, 1, 1, -1]]
2774
"""
2775
C = self.cartan_type().classical()
2776
s = self.s()
2777
if self.r() == C.n:
2778
c = [s/2]*C.n
2779
else:
2780
c = [s/2]*(C.n-1)+[-s/2]
2781
return CrystalOfTableaux(C, shape = c)
2782
2783
def dynkin_diagram_automorphism(self, i):
2784
"""
2785
Specifies the Dynkin diagram automorphism underlying the promotion action on the crystal
2786
elements. The automorphism needs to map node 0 to some other Dynkin node.
2787
2788
Here we use the Dynkin diagram automorphism which interchanges nodes 0 and 1 and leaves
2789
all other nodes unchanged.
2790
2791
EXAMPLES::
2792
2793
sage: K = KirillovReshetikhinCrystal(['D',4,1],4,1)
2794
sage: K.dynkin_diagram_automorphism(0)
2795
1
2796
sage: K.dynkin_diagram_automorphism(1)
2797
0
2798
sage: K.dynkin_diagram_automorphism(4)
2799
4
2800
"""
2801
aut = [1,0]+range(2,self.cartan_type().rank())
2802
return aut[i]
2803
2804
@cached_method
2805
def promotion_on_highest_weight_vectors(self):
2806
r"""
2807
Returns the promotion operator on `\{2,3,\ldots,n\}`-highest weight vectors.
2808
2809
A `\{2,3,\ldots,n\}`-highest weight vector in `B(s\Lambda_n)` of weight
2810
`w=(w_1,\ldots,w_n)` is mapped to a `\{2,3,\ldots,n\}`-highest weight vector in `B(s\Lambda_{n-1})`
2811
of weight `(-w_1,w_2,\ldots,w_n)` and vice versa.
2812
2813
See also :meth:`promotion_on_highest_weight_vectors_inverse` and :meth:`promotion`.
2814
2815
EXAMPLES::
2816
2817
sage: KR = KirillovReshetikhinCrystal(['D',4,1],4,2)
2818
sage: prom = KR.promotion_on_highest_weight_vectors()
2819
sage: T = KR.classical_decomposition()
2820
sage: HW = [t for t in T if t.is_highest_weight([2,3,4])]
2821
sage: for t in HW:
2822
... print t, prom[t]
2823
...
2824
[4, 3, 2, 1] [-1, 4, 3, 2]
2825
[4, -4, 3, 2] [-4, 4, 3, 2]
2826
[-1, -4, 3, 2] [-4, 3, 2, 1]
2827
2828
sage: KR = KirillovReshetikhinCrystal(['D',4,1],4,1)
2829
sage: prom = KR.promotion_on_highest_weight_vectors()
2830
sage: T = KR.classical_decomposition()
2831
sage: HW = [t for t in T if t.is_highest_weight([2,3,4])]
2832
sage: for t in HW:
2833
... print t, prom[t]
2834
...
2835
[++++, []] [-+++, []]
2836
[-++-, []] [+++-, []]
2837
"""
2838
T = self.classical_decomposition()
2839
ind = list(T.index_set())
2840
ind.remove(1)
2841
C = T.cartan_type()
2842
n = C.n
2843
sh = [ i for i in T.shapes[0] ]
2844
sh[n-1] = -sh[n-1]
2845
T_dual = CrystalOfTableaux(C, shape = sh)
2846
hw = [ t for t in T if t.is_highest_weight(index_set = ind) ]
2847
hw_dual = [ t for t in T_dual if t.is_highest_weight(index_set = ind) ]
2848
dic_weight = {tuple(t.weight().to_vector()) : t for t in hw}
2849
dic_weight_dual = {tuple(t.weight().to_vector()) : t for t in hw_dual}
2850
def neg(x):
2851
y = [i for i in x]
2852
y[0] = -y[0]
2853
return tuple(y)
2854
return dict( (dic_weight[w], dic_weight_dual[neg(w)]) for w in dic_weight.keys() )
2855
2856
@cached_method
2857
def promotion_on_highest_weight_vectors_inverse(self):
2858
r"""
2859
Returns the inverse promotion operator on `\{2,3,\ldots,n\}`-highest weight vectors.
2860
2861
See also :meth:`promotion_on_highest_weight_vectors` and :meth:`promotion_inverse`.
2862
2863
EXAMPLES::
2864
2865
sage: KR = KirillovReshetikhinCrystal(['D',4,1],3,2)
2866
sage: prom = KR.promotion_on_highest_weight_vectors()
2867
sage: prom_inv = KR.promotion_on_highest_weight_vectors_inverse()
2868
sage: T = KR.classical_decomposition()
2869
sage: HW = [t for t in T if t.is_highest_weight([2,3,4])]
2870
sage: all(prom_inv[prom[t]] == t for t in HW)
2871
True
2872
"""
2873
D = self.promotion_on_highest_weight_vectors()
2874
return dict( (D[t],t) for t in D.keys())
2875
2876
@cached_method
2877
def promotion(self):
2878
"""
2879
Returns the promotion operator on `B^{r,s}` of type `D_n^{(1)}` for `r=n-1,n`.
2880
2881
EXAMPLES::
2882
2883
sage: K = KirillovReshetikhinCrystal(['D',4,1],3,1)
2884
sage: T = K.classical_decomposition()
2885
sage: promotion = K.promotion()
2886
sage: for t in T:
2887
... print t, promotion(t)
2888
...
2889
[+++-, []] [-++-, []]
2890
[++-+, []] [-+-+, []]
2891
[+-++, []] [--++, []]
2892
[-+++, []] [++++, []]
2893
[+---, []] [----, []]
2894
[-+--, []] [++--, []]
2895
[--+-, []] [+-+-, []]
2896
[---+, []] [+--+, []]
2897
"""
2898
T = self.classical_decomposition()
2899
ind = list(T.index_set())
2900
ind.remove(1)
2901
C = T.cartan_type()
2902
n = C.n
2903
def aut(i):
2904
if i==n:
2905
return n-1
2906
elif i==n-1:
2907
return n
2908
return i
2909
return T.crystal_morphism( self.promotion_on_highest_weight_vectors(), index_set = ind)
2910
2911
@cached_method
2912
def promotion_inverse(self):
2913
r"""
2914
Returns the inverse promotion operator on `B^{r,s}` of type `D_n^{(1)}` for `r=n-1,n`.
2915
2916
EXAMPLES::
2917
2918
sage: K = KirillovReshetikhinCrystal(['D',4,1],3,1)
2919
sage: T = K.classical_decomposition()
2920
sage: promotion = K.promotion()
2921
sage: promotion_inverse = K.promotion_inverse()
2922
sage: all(promotion_inverse(promotion(t)) == t for t in T)
2923
True
2924
"""
2925
D = self.promotion_on_highest_weight_vectors_inverse()
2926
T = D.keys()[0].parent()
2927
ind = list(T.index_set())
2928
ind.remove(1)
2929
C = T.cartan_type()
2930
n = C.n
2931
def aut(i):
2932
if i==n:
2933
return n-1
2934
elif i==n-1:
2935
return n
2936
return i
2937
return T.crystal_morphism( self.promotion_on_highest_weight_vectors_inverse(), index_set = ind)
2938
2939
#####################################################################
2940
2941
class PMDiagram(CombinatorialObject):
2942
"""
2943
Class of `\pm` diagrams. These diagrams are in one-to-one bijection with `X_{n-1}` highest weight vectors
2944
in an `X_n` highest weight crystal `X=B,C,D`. See Section 4.1 of A. Schilling, "Combinatorial structure of
2945
Kirillov-Reshetikhin crystals of type `D_n(1)`, `B_n(1)`, `A_{2n-1}(2)`", J. Algebra 319 (2008) 2938-2962
2946
(arXiv:0704.2046[math.QA]).
2947
2948
The input is a list `pm = [[a_0,b_0],[a_1,b_1],...,[a_{n-1},b_{n-1}],[b_n]]` of 2-tuples and a last 1-tuple.
2949
The tuple `[a_i,b_i]` specifies the number of `a_i` + and `b_i` - in the i-th row of the pm diagram
2950
if `n-i` is odd and the number of `a_i` +- pairs above row `i` and `b_i` columns of height `i` not containing
2951
any + or - if `n-i` is even.
2952
2953
Setting the option 'from_shapes = True' one can also input a `\pm` diagram in terms of its
2954
outer, intermediate and inner shape by specifying a tuple [n, s, outer, intermediate, inner]
2955
where `s` is the width of the `\pm` diagram, and 'outer' , 'intermediate',
2956
and 'inner' are the outer, intermediate and inner shape, respectively.
2957
2958
EXAMPLES::
2959
2960
sage: pm=sage.combinat.crystals.kirillov_reshetikhin.PMDiagram([[0,1],[1,2],[1]])
2961
sage: pm.pm_diagram
2962
[[0, 1], [1, 2], [1]]
2963
sage: pm._list
2964
[1, 1, 2, 0, 1]
2965
sage: pm.n
2966
2
2967
sage: pm.width
2968
5
2969
sage: pm.__repr__(pretty_printing=True)
2970
. . . .
2971
. + - -
2972
sage: sage.combinat.crystals.kirillov_reshetikhin.PMDiagram([2,5,[4,4],[4,2],[4,1]], from_shapes=True)
2973
[[0, 1], [1, 2], [1]]
2974
2975
TESTS::
2976
2977
sage: pm=sage.combinat.crystals.kirillov_reshetikhin.PMDiagram([[1,2],[1,1],[1,1],[1,1],[1]])
2978
sage: sage.combinat.crystals.kirillov_reshetikhin.PMDiagram([pm.n, pm.width, pm.outer_shape(), pm.intermediate_shape(), pm.inner_shape()], from_shapes=True) == pm
2979
True
2980
sage: pm=sage.combinat.crystals.kirillov_reshetikhin.PMDiagram([[1,2],[1,2],[1,1],[1,1],[1,1],[1]])
2981
sage: sage.combinat.crystals.kirillov_reshetikhin.PMDiagram([pm.n, pm.width, pm.outer_shape(), pm.intermediate_shape(), pm.inner_shape()], from_shapes=True) == pm
2982
True
2983
"""
2984
2985
def __init__(self, pm_diagram, from_shapes = None):
2986
r"""
2987
Initializes `\pm` diagrams.
2988
2989
TESTS::
2990
2991
sage: sage.combinat.crystals.kirillov_reshetikhin.PMDiagram([[0,1],[1,2],[1]])
2992
[[0, 1], [1, 2], [1]]
2993
sage: sage.combinat.crystals.kirillov_reshetikhin.PMDiagram([2,5,[4,4],[4,2],[4,1]], from_shapes=True)
2994
[[0, 1], [1, 2], [1]]
2995
"""
2996
if from_shapes:
2997
n = pm_diagram[0]
2998
s = pm_diagram[1]
2999
outer = [s]+list(pm_diagram[2])+[0 for i in range(n)]
3000
intermediate = [s]+list(pm_diagram[3])+[0 for i in range(n)]
3001
inner = [s]+list(pm_diagram[4])+[0 for i in range(n)]
3002
pm = [[inner[n]]]
3003
for i in range(int((n+1)/2)):
3004
pm.append([intermediate[n-2*i]-inner[n-2*i], inner[n-2*i-1]-intermediate[n-2*i]])
3005
pm.append([outer[n-2*i]-inner[n-2*i-1], inner[n-2*i-2]-outer[n-2*i]])
3006
if is_odd(n):
3007
pm.pop(n+1)
3008
pm_diagram = list(reversed(pm))
3009
self.pm_diagram = pm_diagram
3010
self.n = len(pm_diagram)-1
3011
self._list = [i for a in reversed(pm_diagram) for i in a]
3012
self.width = sum(i for i in self._list)
3013
3014
def __repr__(self, pretty_printing = None):
3015
"""
3016
Turning on pretty printing allows to display the pm diagram as a
3017
tableau with the + and - displayed
3018
3019
EXAMPLES::
3020
3021
sage: pm=sage.combinat.crystals.kirillov_reshetikhin.PMDiagram([[1,0],[0,1],[2,0],[0,0],[0]])
3022
sage: pm.__repr__(pretty_printing=True)
3023
. . . +
3024
. . - -
3025
+ +
3026
- -
3027
sage: pm=sage.combinat.crystals.kirillov_reshetikhin.PMDiagram([[0,2], [0,0], [0]])
3028
sage: pm.__repr__(pretty_printing=True)
3029
3030
"""
3031
if pretty_printing is None:
3032
return repr(self.pm_diagram)
3033
t = []
3034
ish = self.inner_shape() + [0]*self.n
3035
msh = self.intermediate_shape() + [0]*self.n
3036
osh = self.outer_shape() + [0]*self.n
3037
for i in range(self.n):
3038
t.append(['.']*ish[i]+['+']*(msh[i]-ish[i])+['-']*(osh[i]-msh[i]))
3039
t=[i for i in t if i!= []]
3040
return Tableau(t).pp()
3041
3042
def inner_shape(self):
3043
"""
3044
Returns the inner shape of the pm diagram
3045
3046
EXAMPLES::
3047
3048
sage: pm=sage.combinat.crystals.kirillov_reshetikhin.PMDiagram([[0,1],[1,2],[1]])
3049
sage: pm.inner_shape()
3050
[4, 1]
3051
sage: pm=sage.combinat.crystals.kirillov_reshetikhin.PMDiagram([[1,2],[1,1],[1,1],[1,1],[1]])
3052
sage: pm.inner_shape()
3053
[7, 5, 3, 1]
3054
sage: pm=sage.combinat.crystals.kirillov_reshetikhin.PMDiagram([[1,2],[1,2],[1,1],[1,1],[1,1],[1]])
3055
sage: pm.inner_shape()
3056
[10, 7, 5, 3, 1]
3057
"""
3058
t = []
3059
ll = self._list
3060
for i in range(self.n):
3061
t.append(sum(ll[0:2*i+1]))
3062
return Partition(list(reversed(t)))
3063
3064
def outer_shape(self):
3065
"""
3066
Returns the outer shape of the pm diagram
3067
3068
EXAMPLES::
3069
3070
sage: pm=sage.combinat.crystals.kirillov_reshetikhin.PMDiagram([[0,1],[1,2],[1]])
3071
sage: pm.outer_shape()
3072
[4, 4]
3073
sage: pm=sage.combinat.crystals.kirillov_reshetikhin.PMDiagram([[1,2],[1,1],[1,1],[1,1],[1]])
3074
sage: pm.outer_shape()
3075
[8, 8, 4, 4]
3076
sage: pm=sage.combinat.crystals.kirillov_reshetikhin.PMDiagram([[1,2],[1,2],[1,1],[1,1],[1,1],[1]])
3077
sage: pm.outer_shape()
3078
[13, 8, 8, 4, 4]
3079
"""
3080
t = []
3081
ll = self._list
3082
for i in range((self.n)/2):
3083
t.append(sum(ll[0:4*i+4]))
3084
t.append(sum(ll[0:4*i+4]))
3085
if is_even(self.n+1):
3086
t.append(sum(ll[0:2*self.n+2]))
3087
return Partition(list(reversed(t)))
3088
3089
def intermediate_shape(self):
3090
"""
3091
Returns the intermediate shape of the pm diagram (inner shape plus positions of plusses)
3092
3093
EXAMPLES::
3094
3095
sage: pm=sage.combinat.crystals.kirillov_reshetikhin.PMDiagram([[0,1],[1,2],[1]])
3096
sage: pm.intermediate_shape()
3097
[4, 2]
3098
sage: pm=sage.combinat.crystals.kirillov_reshetikhin.PMDiagram([[1,2],[1,1],[1,1],[1,1],[1]])
3099
sage: pm.intermediate_shape()
3100
[8, 6, 4, 2]
3101
sage: pm=sage.combinat.crystals.kirillov_reshetikhin.PMDiagram([[1,2],[1,2],[1,1],[1,1],[1,1],[1]])
3102
sage: pm.intermediate_shape()
3103
[11, 8, 6, 4, 2]
3104
sage: pm=sage.combinat.crystals.kirillov_reshetikhin.PMDiagram([[1,0],[0,1],[2,0],[0,0],[0]])
3105
sage: pm.intermediate_shape()
3106
[4, 2, 2]
3107
sage: pm=sage.combinat.crystals.kirillov_reshetikhin.PMDiagram([[1, 0], [0, 0], [0, 0], [0, 0], [0]])
3108
sage: pm.intermediate_shape()
3109
[1]
3110
"""
3111
p = self.inner_shape()
3112
p = p + [0 for i in range(self.n)]
3113
ll = list(reversed(self._list))
3114
p = [ p[i]+ll[2*i+1] for i in range(self.n) ]
3115
return Partition(p)
3116
3117
def heights_of_minus(self):
3118
"""
3119
Returns a list with the heights of all minus in the `\pm` diagram.
3120
3121
EXAMPLES::
3122
3123
sage: pm=sage.combinat.crystals.kirillov_reshetikhin.PMDiagram([[1,2],[1,2],[1,1],[1,1],[1,1],[1]])
3124
sage: pm.heights_of_minus()
3125
[5, 5, 3, 3, 1, 1]
3126
sage: pm=sage.combinat.crystals.kirillov_reshetikhin.PMDiagram([[1,2],[1,1],[1,1],[1,1],[1]])
3127
sage: pm.heights_of_minus()
3128
[4, 4, 2, 2]
3129
"""
3130
n = self.n
3131
heights = []
3132
for i in range(int((n+1)/2)):
3133
heights += [n-2*i]*((self.outer_shape()+[0]*n)[n-2*i-1]-(self.intermediate_shape()+[0]*n)[n-2*i-1])
3134
return heights
3135
3136
def heights_of_addable_plus(self):
3137
"""
3138
Returns a list with the heights of all addable plus in the `\pm` diagram.
3139
3140
EXAMPLES::
3141
3142
sage: pm=sage.combinat.crystals.kirillov_reshetikhin.PMDiagram([[1,2],[1,2],[1,1],[1,1],[1,1],[1]])
3143
sage: pm.heights_of_addable_plus()
3144
[1, 1, 2, 3, 4, 5]
3145
sage: pm=sage.combinat.crystals.kirillov_reshetikhin.PMDiagram([[1,2],[1,1],[1,1],[1,1],[1]])
3146
sage: pm.heights_of_addable_plus()
3147
[1, 2, 3, 4]
3148
"""
3149
heights = []
3150
for i in range(1,self.n+1):
3151
heights += [i]*self.sigma().pm_diagram[i][0]
3152
return heights
3153
3154
def sigma(self):
3155
"""
3156
Returns sigma on pm diagrams as needed for the analogue of the Dynkin diagram automorphism
3157
that interchanges nodes `0` and `1` for type `D_n(1)`, `B_n(1)`, `A_{2n-1}(2)` for
3158
Kirillov-Reshetikhin crystals.
3159
3160
EXAMPLES::
3161
3162
sage: pm=sage.combinat.crystals.kirillov_reshetikhin.PMDiagram([[0,1],[1,2],[1]])
3163
sage: pm.sigma().pm_diagram
3164
[[1, 0], [2, 1], [1]]
3165
"""
3166
pm = self.pm_diagram
3167
return PMDiagram([list(reversed(a)) for a in pm])
3168
3169
3170
#####################################################################################
3171
3172
def partitions_in_box(r, s):
3173
"""
3174
Returns all partitions in a box of width s and height r.
3175
3176
EXAMPLES::
3177
3178
sage: sage.combinat.crystals.kirillov_reshetikhin.partitions_in_box(3,2)
3179
[[], [1], [2], [1, 1], [2, 1], [1, 1, 1], [2, 2], [2, 1, 1],
3180
[2, 2, 1], [2, 2, 2]]
3181
"""
3182
return [x for n in range(r*s+1) for x in Partitions(n,max_part=s,max_length=r)]
3183
3184
def vertical_dominoes_removed(r, s):
3185
"""
3186
Returns all partitions obtained from a rectangle of width s and height r by removing
3187
vertical dominoes.
3188
3189
EXAMPLES::
3190
3191
sage: sage.combinat.crystals.kirillov_reshetikhin.vertical_dominoes_removed(2,2)
3192
[[], [1, 1], [2, 2]]
3193
sage: sage.combinat.crystals.kirillov_reshetikhin.vertical_dominoes_removed(3,2)
3194
[[2], [2, 1, 1], [2, 2, 2]]
3195
sage: sage.combinat.crystals.kirillov_reshetikhin.vertical_dominoes_removed(4,2)
3196
[[], [1, 1], [1, 1, 1, 1], [2, 2], [2, 2, 1, 1], [2, 2, 2, 2]]
3197
"""
3198
return [x.conjugate() for x in horizontal_dominoes_removed(s,r)]
3199
3200
def horizontal_dominoes_removed(r, s):
3201
"""
3202
Returns all partitions obtained from a rectangle of width s and height r by removing
3203
horizontal dominoes.
3204
3205
EXAMPLES::
3206
3207
sage: sage.combinat.crystals.kirillov_reshetikhin.horizontal_dominoes_removed(2,2)
3208
[[], [2], [2, 2]]
3209
sage: sage.combinat.crystals.kirillov_reshetikhin.horizontal_dominoes_removed(3,2)
3210
[[], [2], [2, 2], [2, 2, 2]]
3211
"""
3212
list = [ [y for y in x] + [0 for i in range(r-x.length())] for x in partitions_in_box(r, int(s/2)) ]
3213
two = lambda x : 2*(x-int(s/2)) + s
3214
return [Partition([two(y) for y in x]) for x in list]
3215
3216