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