25
25
J. Algebraic Combinatorics, **37** (2013). 571-599. :arxiv:`1109.3523`.
26
26
"""
27
27
28
- #** ***************************************************************************
28
+ # ***************************************************************************
29
29
# Copyright (C) 2012 Travis Scrimshaw <[email protected] >
30
30
#
31
31
# Distributed under the terms of the GNU General Public License (GPL)
37
37
#
38
38
# The full text of the GPL is available at:
39
39
#
40
- # http ://www.gnu.org/licenses/
41
- #** ***************************************************************************
40
+ # https ://www.gnu.org/licenses/
41
+ # ***************************************************************************
42
42
43
43
# This contains both the parent and element classes. These should be split if
44
44
# the classes grow larger.
56
56
from sage .combinat .root_system .cartan_type import CartanType
57
57
from sage .combinat .crystals .tensor_product import CrystalOfWords
58
58
from sage .combinat .crystals .tensor_product import TensorProductOfRegularCrystalsElement
59
- from sage .combinat .crystals .kirillov_reshetikhin import horizontal_dominoes_removed , \
60
- KashiwaraNakashimaTableaux , KirillovReshetikhinGenericCrystalElement , \
61
- partitions_in_box , vertical_dominoes_removed
59
+ from sage .combinat .crystals .kirillov_reshetikhin import (
60
+ horizontal_dominoes_removed ,
61
+ KashiwaraNakashimaTableaux , KirillovReshetikhinGenericCrystalElement ,
62
+ partitions_in_box , vertical_dominoes_removed
63
+ )
62
64
from sage .combinat .partition import Partition
63
65
from sage .combinat .tableau import Tableau
64
66
@@ -256,25 +258,25 @@ def __classcall_private__(cls, cartan_type, r, s):
256
258
if typ == 'E' :
257
259
return KRTableauxTypeFromRC (ct , r , s )
258
260
else :
259
- if typ == 'BC' : # A_{2n}^{(2)}
261
+ if typ == 'BC' : # A_{2n}^{(2)}
260
262
return KRTableauxTypeBox (ct , r , s )
261
263
typ = ct .dual ().type ()
262
- if typ == 'BC' : # A_{2n}^{(2)\dagger}
264
+ if typ == 'BC' : # A_{2n}^{(2)\dagger}
263
265
return KRTableauxTypeHorizonal (ct , r , s )
264
- if typ == 'B' : # A_{2n-1}^{(2)}
266
+ if typ == 'B' : # A_{2n-1}^{(2)}
265
267
return KRTableauxTypeVertical (ct , r , s )
266
- if typ == 'C' : # D_{n+1}^{(2)}
268
+ if typ == 'C' : # D_{n+1}^{(2)}
267
269
if r == ct .dual ().classical ().rank ():
268
270
return KRTableauxDTwistedSpin (ct , r , s )
269
271
return KRTableauxTypeBox (ct , r , s )
270
- #if typ == 'F': # E_6^{(2)}
271
- if typ == 'G' : # D_4^{(3)}
272
+ # if typ == 'F': # E_6^{(2)}
273
+ if typ == 'G' : # D_4^{(3)}
272
274
if r == 1 :
273
275
return KRTableauxTypeBox (ct , r , s )
274
276
return KRTableauxTypeFromRC (ct , r , s )
275
277
276
278
raise NotImplementedError
277
- #return super(KirillovReshetikhinTableaux, cls).__classcall__(cls, ct, r, s)
279
+ # return super(KirillovReshetikhinTableaux, cls).__classcall__(cls, ct, r, s)
278
280
279
281
def __init__ (self , cartan_type , r , s ):
280
282
r"""
@@ -309,7 +311,7 @@ def _repr_(self):
309
311
Kirillov-Reshetikhin tableaux of type ['A', 4, 1] and shape (2, 3)
310
312
"""
311
313
return "Kirillov-Reshetikhin tableaux of type {} and shape ({}, {})" .format (
312
- self ._cartan_type , self ._r , self ._s )
314
+ self ._cartan_type , self ._r , self ._s )
313
315
314
316
def __iter__ (self ):
315
317
"""
@@ -324,9 +326,10 @@ def __iter__(self):
324
326
"""
325
327
index_set = self ._cartan_type .classical ().index_set ()
326
328
from sage .sets .recursively_enumerated_set import RecursivelyEnumeratedSet
327
- return RecursivelyEnumeratedSet (self .module_generators ,
328
- lambda x : [x .f (i ) for i in index_set ],
329
- structure = 'graded' ).breadth_first_search_iterator ()
329
+ rset = RecursivelyEnumeratedSet (self .module_generators ,
330
+ lambda x : [x .f (i ) for i in index_set ],
331
+ structure = 'graded' )
332
+ return rset .breadth_first_search_iterator ()
330
333
331
334
def module_generator (self , i = None , ** options ):
332
335
r"""
@@ -378,7 +381,7 @@ def module_generator(self, i=None, **options):
378
381
shape = list (options ["shape" ])
379
382
# Make sure the shape is the correct length
380
383
if len (shape ) < n :
381
- shape .extend ( [0 ]* (n - len (shape )) )
384
+ shape .extend ([0 ] * (n - len (shape )))
382
385
for mg in self .module_generators :
383
386
if list (mg .classical_weight ().to_vector ()) == shape :
384
387
return mg
@@ -387,7 +390,7 @@ def module_generator(self, i=None, **options):
387
390
if "column_shape" in options :
388
391
shape = list (Partition (options ["column_shape" ]).conjugate ())
389
392
if len (shape ) < n :
390
- shape .extend ( [0 ]* (n - len (shape )) )
393
+ shape .extend ([0 ] * (n - len (shape )))
391
394
for mg in self .module_generators :
392
395
if list (mg .classical_weight ().to_vector ()) == shape :
393
396
return mg
@@ -412,7 +415,7 @@ def module_generator(self, i=None, **options):
412
415
Lambda = R .fundamental_weights ()
413
416
r = self .r ()
414
417
s = self .s ()
415
- weight = s * Lambda [r ] - s * Lambda [0 ] * Lambda [r ].level () / Lambda [0 ].level ()
418
+ weight = s * Lambda [r ] - s * Lambda [0 ] * Lambda [r ].level () / Lambda [0 ].level ()
416
419
for b in self .module_generators :
417
420
if b .weight () == weight :
418
421
return b
@@ -462,7 +465,7 @@ def _element_constructor_(self, *lst, **options):
462
465
if isinstance (lst [0 ], KirillovReshetikhinGenericCrystalElement ):
463
466
# Check to make sure it can be converted
464
467
if lst [0 ].cartan_type () != self .cartan_type () \
465
- or lst [0 ].parent ().r () != self ._r or lst [0 ].parent ().s () != self ._s :
468
+ or lst [0 ].parent ().r () != self ._r or lst [0 ].parent ().s () != self ._s :
466
469
raise ValueError ("the Kirillov-Reshetikhin crystal must have the same Cartan type and (r,s)" )
467
470
return self .from_kirillov_reshetikhin_crystal (lst [0 ])
468
471
@@ -544,7 +547,7 @@ def tensor(self, *crystals, **options):
544
547
"""
545
548
ct = self ._cartan_type
546
549
from sage .combinat .rigged_configurations .tensor_product_kr_tableaux \
547
- import TensorProductOfKirillovReshetikhinTableaux
550
+ import TensorProductOfKirillovReshetikhinTableaux
548
551
if all (isinstance (B , (KirillovReshetikhinTableaux , TensorProductOfKirillovReshetikhinTableaux ))
549
552
and B .cartan_type () == ct for B in crystals ):
550
553
dims = [[self ._r , self ._s ]]
@@ -601,9 +604,8 @@ def _build_module_generators(self):
601
604
sage: KRT._build_module_generators()
602
605
([[1, 1, 1], [2, 2, 2]],)
603
606
"""
604
- tableau = []
605
- for i in range (self ._s ):
606
- tableau .append ( [self ._r - j for j in range (self ._r )] )
607
+ tableau = [[self ._r - j for j in range (self ._r )]
608
+ for i in range (self ._s )]
607
609
608
610
return (self .element_class (self , [self .letters (x ) for x in flatten (tableau )]),)
609
611
@@ -670,39 +672,39 @@ def _fill(self, weight):
670
672
[[1, 1, 1, 1, 1, 5, 1], [2, 2, 2, 2, 2, 6, 2], [3, 3, 9, 7, 9, 7, 3], [4, 4, 10, 8, 10, 8, 4], [5, 5, 11, 9, 11, 9, 5], [6, 6, 12, 10, 12, 10, 6], [7, 7, -12, 11, -12, 11, 7], [8, 8, -11, 12, -11, 12, 8], [9, 9, -10, -12, -10, -12, -8], [10, 10, -9, -11, -9, -11, -7], [-12, 11, -8, -10, -8, -10, -6], [-11, 12, -7, -9, -7, -9, -5]]
671
673
"""
672
674
# Add zeros until the shape has length s
673
- weight_list = list (weight ) # Make sure we have a list
675
+ weight_list = list (weight ) # Make sure we have a list
674
676
while len (weight_list ) != self ._s :
675
677
weight_list .append (0 )
676
678
677
679
tableau = []
678
680
i = 0
679
681
# Step 0 - Fill first columns of height r
680
682
while i < self ._s and weight_list [i ] == self ._r :
681
- tableau .append ( [self ._r - j for j in range (self ._r )] )
683
+ tableau .append ([self ._r - j for j in range (self ._r )])
682
684
i += 1
683
685
684
686
# Step 1 - Add the alternating columns until we hit an odd number of columns
685
687
c = - 1
686
688
while i < self ._s :
687
689
# If it is an odd number of columns
688
- if i == self ._s - 1 or weight_list [i ] != weight_list [i + 1 ]:
690
+ if i == self ._s - 1 or weight_list [i ] != weight_list [i + 1 ]:
689
691
c = weight_list [i ]
690
692
i += 1
691
693
break
692
694
temp_list = [- (weight_list [i ] + j + 1 ) for j in range (self ._r - weight_list [i ])]
693
695
for j in range (weight_list [i ]):
694
696
temp_list .append (weight_list [i ] - j )
695
697
tableau .append (temp_list )
696
- tableau .append ( [self ._r - j for j in range (self ._r )] )
698
+ tableau .append ([self ._r - j for j in range (self ._r )])
697
699
i += 2
698
700
699
701
# Step 2 - Add the x dependent columns
700
702
x = c + 1
701
703
while i < self ._s :
702
- temp_list = [- x - j for j in range (self ._r - x + 1 )] # +1 for indexing
703
- for j in range (x - weight_list [i ] - 1 ): # +1 for indexing
704
+ temp_list = [- x - j for j in range (self ._r - x + 1 )] # +1 for indexing
705
+ for j in range (x - weight_list [i ] - 1 ): # +1 for indexing
704
706
temp_list .append (self ._r - j )
705
- x = temp_list [- 1 ] # This is the h+1 entry of the column
707
+ x = temp_list [- 1 ] # This is the h+1 entry of the column
706
708
for j in range (weight_list [i ]):
707
709
temp_list .append (weight_list [i ] - j )
708
710
@@ -795,7 +797,7 @@ def _fill(self, shape):
795
797
[[1, 1, 1, 1, 1, 1], [2, 2, 2, 2, -5, 2], [-5, 3, -5, 3, -4, 3], [-4, 4, -4, 4, -3, 4], [-3, 5, -3, 5, -2, 5]]
796
798
"""
797
799
# Add zeros until the shape has length s
798
- shape_list = list (shape ) # Make sure we have a list
800
+ shape_list = list (shape ) # Make sure we have a list
799
801
while len (shape_list ) != self ._r :
800
802
shape_list .append (0 )
801
803
@@ -892,39 +894,39 @@ def _fill(self, weight):
892
894
[[1, 1, 1, 1, 1, 5, 1], [2, 2, 2, 2, 2, 6, 2], [3, 3, 9, 7, 9, 7, 3], [4, 4, 10, 8, 10, 8, 4], [5, 5, 11, 9, 11, 9, 5], [6, 6, 12, 10, 12, 10, 6], [7, 7, -12, 11, -12, 11, 7], [8, 8, -11, 12, -11, 12, 8], [9, 9, -10, -12, -10, -12, -8], [10, 10, -9, -11, -9, -11, -7], [-12, 11, -8, -10, -8, -10, -6], [-11, 12, -7, -9, -7, -9, -5]]
893
895
"""
894
896
# Add zeros until the shape has length s
895
- weight_list = list (weight ) # Make sure we have a list
897
+ weight_list = list (weight ) # Make sure we have a list
896
898
while len (weight_list ) != self ._s :
897
899
weight_list .append (0 )
898
900
899
901
tableau = []
900
902
i = 0
901
903
# Step 0 - Fill first columns of height r
902
904
while i < self ._s and weight_list [i ] == self ._r :
903
- tableau .append ( [self ._r - j for j in range (self ._r )] )
905
+ tableau .append ([self ._r - j for j in range (self ._r )])
904
906
i += 1
905
907
906
908
# Step 1 - Add the alternating columns until we hit an odd number of columns
907
909
c = - 1
908
910
while i < self ._s :
909
911
# If it is an odd number of columns
910
- if i == self ._s - 1 or weight_list [i ] != weight_list [i + 1 ]:
912
+ if i == self ._s - 1 or weight_list [i ] != weight_list [i + 1 ]:
911
913
c = weight_list [i ]
912
914
i += 1
913
915
break
914
916
temp_list = [- (weight_list [i ] + j + 1 ) for j in range (self ._r - weight_list [i ])]
915
917
for j in range (weight_list [i ]):
916
918
temp_list .append (weight_list [i ] - j )
917
919
tableau .append (temp_list )
918
- tableau .append ( [self ._r - j for j in range (self ._r )] )
920
+ tableau .append ([self ._r - j for j in range (self ._r )])
919
921
i += 2
920
922
921
923
# Step 2 - Add the x dependent columns
922
924
x = c + 1
923
925
while i < self ._s :
924
- temp_list = [- x - j for j in range (self ._r - x + 1 )] # +1 for indexing
925
- for j in range (x - weight_list [i ] - 1 ): # +1 for indexing
926
+ temp_list = [- x - j for j in range (self ._r - x + 1 )] # +1 for indexing
927
+ for j in range (x - weight_list [i ] - 1 ): # +1 for indexing
926
928
temp_list .append (self ._r - j )
927
- x = temp_list [- 1 ] # This is the h+1 entry of the column
929
+ x = temp_list [- 1 ] # This is the h+1 entry of the column
928
930
for j in range (weight_list [i ]):
929
931
temp_list .append (weight_list [i ] - j )
930
932
@@ -990,7 +992,7 @@ def _build_module_generators(self):
990
992
991
993
tableau = []
992
994
for i in range (self ._s ):
993
- tableau .append ( [- n ] + [self ._r - j for j in range (self ._r )] )
995
+ tableau .append ([- n ] + [self ._r - j for j in range (self ._r )])
994
996
995
997
return (self .element_class (self , [self .letters (x ) for x in flatten (tableau )]),)
996
998
@@ -1016,8 +1018,8 @@ def _build_module_generators(self):
1016
1018
([[-2, 1], [-1, 2]], [[1, 1], [2, 2]])
1017
1019
"""
1018
1020
odd = int (self ._s % 2 )
1019
- shapes = [[ int (x * 2 + odd ) for x in sh ] for sh
1020
- in vertical_dominoes_removed (self ._r , self ._s // 2 )]
1021
+ shapes = ([ int (x * 2 + odd ) for x in sh ]
1022
+ for sh in vertical_dominoes_removed (self ._r , self ._s // 2 ))
1021
1023
return tuple (self ._fill (sh ) for sh in shapes )
1022
1024
1023
1025
def from_kirillov_reshetikhin_crystal (self , krc ):
@@ -1438,9 +1440,9 @@ def left_split(self):
1438
1440
if P ._s == 1 :
1439
1441
raise ValueError ("cannot split a single column" )
1440
1442
from sage .combinat .rigged_configurations .tensor_product_kr_tableaux import \
1441
- TensorProductOfKirillovReshetikhinTableaux
1443
+ TensorProductOfKirillovReshetikhinTableaux
1442
1444
r = P ._r
1443
- TP = TensorProductOfKirillovReshetikhinTableaux (P ._cartan_type , [[r , 1 ], [r , P ._s - 1 ]])
1445
+ TP = TensorProductOfKirillovReshetikhinTableaux (P ._cartan_type , [[r , 1 ], [r , P ._s - 1 ]])
1444
1446
lf = TP .crystals [0 ](* (self [:r ]))
1445
1447
rf = TP .crystals [1 ](* (self [r :]))
1446
1448
return TP (lf , rf )
@@ -1635,9 +1637,9 @@ def left_split(self):
1635
1637
if P ._s == 1 :
1636
1638
raise ValueError ("cannot split a single column" )
1637
1639
from sage .combinat .rigged_configurations .tensor_product_kr_tableaux import \
1638
- TensorProductOfKirillovReshetikhinTableaux
1640
+ TensorProductOfKirillovReshetikhinTableaux
1639
1641
h = P ._cartan_type .classical ().rank ()
1640
- TP = TensorProductOfKirillovReshetikhinTableaux (P ._cartan_type , [[P ._r , 1 ], [P ._r , P ._s - 1 ]])
1642
+ TP = TensorProductOfKirillovReshetikhinTableaux (P ._cartan_type , [[P ._r , 1 ], [P ._r , P ._s - 1 ]])
1641
1643
lf = TP .crystals [0 ](* (self [:h ]))
1642
1644
rf = TP .crystals [1 ](* (self [h :]))
1643
1645
return TP (lf , rf )
0 commit comments