Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sagesmc
Path: blob/master/src/sage/combinat/crystals/generalized_young_walls.py
8817 views
1
r"""
2
Crystals of Generalized Young Walls
3
4
AUTHORS:
5
6
- Lucas David-Roesler: Initial version
7
8
- Ben Salisbury: Initial version
9
10
- Travis Scrimshaw: Initial version
11
12
Generalized Young walls are certain generalizations of Young tableaux
13
introduced in [KS10]_ and designed to be a realization of the crystals
14
`\mathcal{B}(\infty)` and `\mathcal{B}(\lambda)` in type `A_n^{(1)}`.
15
16
REFERENCES:
17
18
.. [KS10] J.-A. Kim and D.-U. Shin.
19
Generalized Young walls and crystal bases for quantum affine algebra
20
of type `A`.
21
Proc. Amer. Math. Soc. 138(11), pp. 3877--3889, 2010.
22
23
.. [KLRS] S.-J. Kang, K.-H. Lee, H. Ryu, and B. Salisbury.
24
A combinatorial description of the affine Gindikin-Karpelevich formula of
25
type `A_n^{(1)}`.
26
:arXiv:`1203.1640`.
27
"""
28
29
#******************************************************************************
30
# Copyright (C) 2013
31
#
32
# Lucas David-Roesler (roesler at lvc dot edu)
33
# Ben Salisbury (bsalisbury at ccny dot cuny dot edu)
34
# Travis Scrimshaw (tscrim at ucdavis dot edu)
35
#
36
# Distributed under the terms of the GNU General Public License (GPL)
37
# http://www.gnu.org/licenses/
38
#******************************************************************************
39
40
import re
41
from copy import deepcopy
42
from sage.combinat.root_system.cartan_type import CartanType
43
from sage.structure.element import Element
44
from sage.structure.parent import Parent
45
from sage.structure.unique_representation import UniqueRepresentation
46
from sage.combinat.combinat import CombinatorialObject
47
from sage.categories.regular_crystals import RegularCrystals
48
from sage.categories.highest_weight_crystals import HighestWeightCrystals
49
from sage.categories.infinite_enumerated_sets import InfiniteEnumeratedSets
50
from sage.combinat.root_system.root_system import RootSystem
51
from sage.rings.infinity import Infinity
52
53
class GeneralizedYoungWall(CombinatorialObject, Element):
54
r"""
55
A generalized Young wall.
56
57
For more information, see :class:`InfinityCrystalOfGeneralizedYoungWalls`.
58
59
EXAMPLES::
60
61
sage: Y = InfinityCrystalOfGeneralizedYoungWalls(4)
62
sage: mg = Y.module_generators[0]; mg.pp()
63
0
64
sage: mg.f_string([1,2,0,1]).pp()
65
1|2|
66
0|1|
67
|
68
"""
69
def __init__(self,parent,data):
70
r"""
71
EXAMPLES::
72
73
sage: Y = InfinityCrystalOfGeneralizedYoungWalls(2)
74
sage: mg = Y.module_generators[0]
75
sage: TestSuite(mg).run()
76
"""
77
i = len(data)-1
78
while i >= 0 and len(data[i]) == 0:
79
data.pop()
80
i -= 1
81
self.rows = len(data)
82
if data == []:
83
self.cols = 0
84
else:
85
self.cols = max([len(r) for r in data])
86
self.data = data
87
CombinatorialObject.__init__(self, data)
88
Element.__init__(self, parent)
89
90
def __repr__(self):
91
r"""
92
EXAMPLES::
93
94
sage: y = InfinityCrystalOfGeneralizedYoungWalls(3)([[0],[1,0,3,2],[2,1],[3,2,1,0,3,2],[0],[],[2]])
95
sage: y
96
[[0], [1, 0, 3, 2], [2, 1], [3, 2, 1, 0, 3, 2], [0], [], [2]]
97
"""
98
return self.data.__repr__()
99
100
def __eq__(self,other):
101
r"""
102
EXAMPLES::
103
104
sage: GYW = InfinityCrystalOfGeneralizedYoungWalls(2)
105
sage: y = GYW([[],[1,0],[2,1]])
106
sage: x = GYW([[],[1,0],[2,1]])
107
sage: z = GYW([[],[1],[2]])
108
sage: x == y
109
True
110
sage: x == z
111
False
112
"""
113
if isinstance(other, GeneralizedYoungWall):
114
return self.data == other.data
115
return self.data == other
116
117
def raw_signature(self, i):
118
r"""
119
Return the sequence from `\{+,-\}` obtained from all `i`-admissible
120
slots and removable `i`-boxes without canceling any `(+,-)`-pairs.
121
The result also notes the row and column of the sign.
122
123
EXAMPLES::
124
125
sage: x = InfinityCrystalOfGeneralizedYoungWalls(3)([[],[1,0,3,2],[2,1],[3,2,1,0,3,2],[],[],[2]])
126
sage: x.raw_signature(2)
127
[['-', 3, 6], ['-', 1, 4], ['-', 6, 1]]
128
"""
129
sig = []
130
rank = self.parent().cartan_type().rank() # n+1
131
for row in range(self.rows):
132
if self.data[row] == [] and i == ( row % rank ):
133
sig.append(['+', row, 0])
134
elif self.data[row] == []:
135
continue
136
elif self.data[row][-1] == ( (i+1) % rank ):
137
sig.append(['+', row, len(self.data[row])+1])
138
elif self.data[row][-1] == i:
139
sig.append(['-', row, len(self.data[row])])
140
return sorted(sig, key=self._sig_sort)
141
142
def _sig_sort(self,a):
143
r"""
144
Internal command used to appropriately sort the output
145
from :meth:`raw_signature()`.
146
147
INPUT:
148
149
- `a` -- list of the form ``['s',j,k]`` where `s` is a string, `j` is an integer
150
and `k` is an integer
151
152
EXAMPLES::
153
154
sage: hw = InfinityCrystalOfGeneralizedYoungWalls(5)([])
155
sage: hw._sig_sort(['+',1,0])
156
(0, 1)
157
"""
158
return (-a[2],a[1])
159
160
def generate_signature(self, i):
161
r"""
162
The `i`-signature of ``self`` (with whitespace where cancellation
163
occurs) together with the unreduced sequence from `\{+,-\}`. The
164
result also records to the row and column position of the sign.
165
166
EXAMPLES::
167
168
sage: y = InfinityCrystalOfGeneralizedYoungWalls(2)([[0],[1,0],[2,1,0,2],[],[1]])
169
sage: y.generate_signature(1)
170
([['+', 2, 5], ['-', 4, 1]], ' ')
171
"""
172
sig = []
173
rank = self.parent().cartan_type().classical().rank()
174
for row in range(self.rows):
175
if self.data[row] == [] and i == ( row % (rank+1) ):
176
sig.append(['+', row, 0])
177
elif self.data[row] == []:
178
continue
179
elif self.data[row][-1] == ( (i+1) % (rank+1) ):
180
sig.append(['+', row, len(self.data[row])+1])
181
elif self.data[row][-1] == i:
182
sig.append(['-', row, len(self.data[row])])
183
sig = sorted(sig, key=self._sig_sort)
184
strsig = ''.join( x[0] for x in sig)
185
reducedsig = strsig
186
while re.search(r"\+\s*-",reducedsig):
187
reducedsig = re.sub(r"\+\s*-", lambda match : str().ljust(len(match.group(int(0)))) , reducedsig)
188
return (sig,reducedsig)
189
190
def signature(self, i):
191
r"""
192
Return the `i`-signature of ``self``.
193
194
The signature is obtained by reading ``self`` in columns bottom to top starting from the left.
195
Then add a `-` at every `i`-box which may be removed from ``self`` and still obtain a legal
196
generalized Young wall, and add a `+` at each site for which an `i`-box may be added and still
197
obtain a valid generalized Young wall. Then successively cancel any `(+,-)`-pair to obtain a
198
sequence of the form `- \cdots -+ \cdots +`. This resulting sequence is the output.
199
200
EXAMPLES::
201
202
sage: y = InfinityCrystalOfGeneralizedYoungWalls(2)([[0],[1,0],[2,1,0,2],[],[1]])
203
sage: y.signature(1)
204
''
205
206
sage: x = InfinityCrystalOfGeneralizedYoungWalls(3)([[],[1,0,3,2],[2,1],[3,2,1,0,3,2],[],[],[2]])
207
sage: x.signature(2)
208
'---'
209
"""
210
return self.generate_signature(i)[1].strip()
211
212
def pp(self):
213
r"""
214
Return an ASCII drawing of ``self``.
215
216
EXAMPLES::
217
218
sage: y = InfinityCrystalOfGeneralizedYoungWalls(2)([[0,2,1],[1,0,2,1,0],[],[0],[1,0,2],[],[],[1]])
219
sage: y.pp()
220
1|
221
|
222
|
223
2|0|1|
224
0|
225
|
226
0|1|2|0|1|
227
1|2|0|
228
"""
229
for row in reversed(self.data):
230
wall = ''
231
for elem in reversed(row):
232
wall += str(elem)
233
wall += '|'
234
if row == []:
235
wall += '|'
236
print(wall.rjust(2*self.cols+1))
237
if self.data==[]:
238
print '0'
239
240
def content(self):
241
r"""
242
Return total number of blocks in ``self``.
243
244
EXAMPLES::
245
246
sage: y = InfinityCrystalOfGeneralizedYoungWalls(2)([[0],[1,0],[2,1,0,2],[],[1]])
247
sage: y.content()
248
8
249
250
sage: x = InfinityCrystalOfGeneralizedYoungWalls(3)([[],[1,0,3,2],[2,1],[3,2,1,0,3,2],[],[],[2]])
251
sage: x.content()
252
13
253
"""
254
return sum(len(r) for r in self.data)
255
256
def number_of_parts(self):
257
r"""
258
Return the value of `\mathscr{N}` on ``self``.
259
260
In [KLRS]_, the statistic `\mathscr{N}` was defined on elements in
261
`\mathcal{Y}(\infty)` which counts how many parts are in the
262
corresponding Kostant partition. Specifically, the computation of
263
`\mathscr{N}(Y)` is done using the following algorithm:
264
265
- If `Y` has no rows whose right-most box is colored `n` and such that
266
the length of this row is a multiple of `n+1`, then `\mathscr{N}(Y)`
267
is the total number of distinct rows in `Y`, not counting multiplicity.
268
269
- Otherwise, search `Y` for the longest row such that the right-most box
270
is colored `n` and such that the total number of boxes in the row is
271
`k(n+1)` for some `k\ge 1`. Replace this row by `n+1` distinct rows
272
of length `k`, reordering all rows, if necessary, so that the result
273
is a proper wall. (Note that the resulting wall may no longer be
274
reduced.) Repeat the search and replace process for all other rows of
275
the above form for each `k' < k`. Then `\mathscr{N}(Y)` is the number
276
of distinct rows, not counting multipicity, in the wall resulting from
277
this process.
278
279
EXAMPLES::
280
281
sage: Y = InfinityCrystalOfGeneralizedYoungWalls(3)
282
sage: y = Y([[0],[],[],[],[0],[],[],[],[0]])
283
sage: y.number_of_parts()
284
1
285
286
sage: Y = InfinityCrystalOfGeneralizedYoungWalls(3)
287
sage: y = Y([[0,3,2],[1,0],[],[],[0,3],[1,0],[],[],[0]])
288
sage: y.number_of_parts()
289
4
290
291
sage: Y = InfinityCrystalOfGeneralizedYoungWalls(2)
292
sage: y = Y([[0,2,1],[1,0],[2,1,0,2,1,0,2,1,0],[],[2,1,0,2,1,0]])
293
sage: y.number_of_parts()
294
8
295
"""
296
n = self.parent().cartan_type().rank()-1
297
new = self.data[:]
298
i = 0
299
while i < len(new):
300
r = new[i]
301
if r == [] or r in new[i+1:]:
302
new.pop(i)
303
elif r[0] == n and len(r)%(n+1) == 0:
304
for j in range(n+1):
305
temp = [k%(n+1) for k in range(j+len(r)/(n+1)-1,j-1,-1)]
306
if temp not in new:
307
new.insert(i+1, temp)
308
new.pop(i)
309
else:
310
i += 1
311
return len(new)
312
313
def sum_of_weighted_row_lengths(self):
314
r"""
315
Return the value of `\mathscr{M}` on ``self``.
316
317
Let `\mathcal{Y}_0 \subset \mathcal{Y}(\infty)` be the set of
318
generalized Young walls which have no rows whose right-most box is
319
colored `n`. For `Y \in \mathcal{Y}_0`,
320
321
.. MATH::
322
323
\mathscr{M}(Y) = \sum_{i=1}^n (i+1)M_i(Y),
324
325
where `M_i(Y)` is the number of nonempty rows in `Y` whose right-most
326
box is colored `i-1`.
327
328
EXAMPLES::
329
330
sage: Y = InfinityCrystalOfGeneralizedYoungWalls(2)
331
sage: y = Y([[0,2,1,0,2],[1,0,2],[],[0,2],[1,0],[],[0],[1,0]])
332
sage: y.sum_of_weighted_row_lengths()
333
15
334
"""
335
n = self.parent().cartan_type().rank()-1
336
m = lambda i : len([r for r in self.data if r!=[] if r[0]==(i-1)%(n+1)])
337
for r in self.data:
338
if r != [] and r[0] == n:
339
raise ValueError('Statistic only valid for generalized Young walls in Y_0')
340
return sum((i+1)*m(i) for i in range(1,n+1))
341
342
def e(self,i):
343
r"""
344
Return the application of the Kashiwara raising operator
345
`\widetilde{e}_i` on ``self``.
346
347
This will remove the `i`-colored box corresponding to the
348
rightmost `+` in ``self.signature(i)``.
349
350
EXAMPLES::
351
352
sage: x=InfinityCrystalOfGeneralizedYoungWalls(3)([[],[1,0,3,2],[2,1],[3,2,1,0,3,2],[],[],[2]])
353
sage: x.e(2)
354
[[], [1, 0, 3, 2], [2, 1], [3, 2, 1, 0, 3, 2]]
355
sage: _.e(2)
356
[[], [1, 0, 3], [2, 1], [3, 2, 1, 0, 3, 2]]
357
sage: _.e(2)
358
[[], [1, 0, 3], [2, 1], [3, 2, 1, 0, 3]]
359
sage: _.e(2)
360
"""
361
signature = self.generate_signature(i)
362
raw_signature = signature[0]
363
lastminus = signature[1].rfind('-')
364
newdata = []
365
if lastminus > -1:
366
deletionrow = raw_signature[lastminus][1]
367
for r in range(self.rows):
368
if r == deletionrow:
369
newdata.append(list(self.data[r][:-1]))
370
else:
371
newdata.append(list(self.data[r]))
372
return self.__class__(self.parent(),newdata)
373
else:
374
return None
375
376
def f(self,i):
377
r"""
378
Return the application of the Kashiwara lowering operator
379
`\widetilde{f}_i` on ``self``.
380
381
This will add an `i`-colored colored box to the site corresponding
382
to the leftmost plus in ``self.signature(i)``.
383
384
EXAMPLES::
385
386
sage: hw = InfinityCrystalOfGeneralizedYoungWalls(2)([])
387
sage: hw.f(1)
388
[[], [1]]
389
sage: _.f(2)
390
[[], [1], [2]]
391
sage: _.f(0)
392
[[], [1, 0], [2]]
393
sage: _.f(0)
394
[[0], [1, 0], [2]]
395
"""
396
signature = self.generate_signature(i)
397
raw_signature = signature[0]
398
firstplus = signature[1].find('+')
399
newdata = deepcopy(self.data)
400
if firstplus > -1:
401
additionrow = raw_signature[firstplus][1]
402
newdata[additionrow].append(i)
403
else:
404
while len(newdata) % self.cartan_type().rank() != i:
405
newdata.append([])
406
newdata.append([i])
407
return self.__class__(self.parent(), newdata)
408
409
def latex_large(self):
410
r"""
411
Generate LaTeX code for ``self`` but the output is larger.
412
Requires TikZ.
413
414
EXAMPLES::
415
416
sage: x = InfinityCrystalOfGeneralizedYoungWalls(3)([[],[1,0,3,2],[2,1],[3,2,1,0,3,2],[],[],[2]])
417
sage: x.latex_large()
418
'\\begin{tikzpicture}[baseline=5,scale=.45] \n \\foreach \\x [count=\\s from 0] in \n{{},{1,0,3,2},{2,1},{3,2,1,0,3,2},{},{},{2}} \n{\\foreach \\y [count=\\t from 0] in \\x { \\node[font=\\scriptsize] at (-\\t,\\s) {$\\y$}; \n \\draw (-\\t+.5,\\s+.5) to (-\\t-.5,\\s+.5); \n \\draw (-\\t+.5,\\s-.5) to (-\\t-.5,\\s-.5); \n \\draw (-\\t-.5,\\s-.5) to (-\\t-.5,\\s+.5); } \n \\draw[-,thick] (.5,\\s+1) to (.5,-.5) to (-\\t-1,-.5); } \n \\end{tikzpicture} \n'
419
"""
420
s = ""
421
if self.data == []:
422
s += "\\emptyset"
423
else:
424
s += "\\begin{tikzpicture}[baseline=5,scale=.45] \n \\foreach \\x [count=\\s from 0] in \n"
425
s += "{" + ','.join("{" + ','.join( str(i) for i in r ) + "}" for r in self.data ) + "} \n"
426
s += "{\\foreach \\y [count=\\t from 0] in \\x { \\node[font=\\scriptsize] at (-\\t,\\s) {$\\y$}; \n \draw (-\\t+.5,\\s+.5) to (-\\t-.5,\\s+.5); \n \draw (-\\t+.5,\\s-.5) to (-\\t-.5,\\s-.5); \n \draw (-\\t-.5,\\s-.5) to (-\\t-.5,\\s+.5); } \n \draw[-,thick] (.5,\\s+1) to (.5,-.5) to (-\\t-1,-.5); } \n \\end{tikzpicture} \n"
427
return s
428
429
def _latex_(self):
430
r"""
431
Generate LaTeX code for ``self``. Requires TikZ.
432
433
EXAMPLES::
434
435
sage: x = InfinityCrystalOfGeneralizedYoungWalls(3)([[],[1,0,3,2],[2,1],[3,2,1,0,3,2],[],[],[2]])
436
sage: x._latex_()
437
'\\begin{tikzpicture}[baseline=5,scale=.25] \\foreach \\x [count=\\s from 0] in \n{{},{1,0,3,2},{2,1},{3,2,1,0,3,2},{},{},{2}} \n{\\foreach \\y [count=\\t from 0] in \\x { \\node[font=\\tiny] at (-\\t,\\s) {$\\y$}; \n \\draw (-\\t+.5,\\s+.5) to (-\\t-.5,\\s+.5); \n \\draw (-\\t+.5,\\s-.5) to (-\\t-.5,\\s-.5); \n \\draw (-\\t-.5,\\s-.5) to (-\\t-.5,\\s+.5); } \n \\draw[-] (.5,\\s+1) to (.5,-.5) to (-\\t-1,-.5); } \n \\end{tikzpicture} \n'
438
"""
439
s = ""
440
if self.data == []:
441
s += "\\emptyset"
442
else:
443
s += "\\begin{tikzpicture}[baseline=5,scale=.25] \\foreach \\x [count=\\s from 0] in \n"
444
s += "{" + ','.join("{" + ','.join( str(i) for i in r ) + "}" for r in self.data ) + "} \n"
445
s += "{\\foreach \\y [count=\\t from 0] in \\x { \\node[font=\\tiny] at (-\\t,\\s) {$\\y$}; \n \draw (-\\t+.5,\\s+.5) to (-\\t-.5,\\s+.5); \n \draw (-\\t+.5,\\s-.5) to (-\\t-.5,\\s-.5); \n \draw (-\\t-.5,\\s-.5) to (-\\t-.5,\\s+.5); } \n \draw[-] (.5,\\s+1) to (.5,-.5) to (-\\t-1,-.5); } \n \\end{tikzpicture} \n"
446
return s
447
448
def weight(self):
449
r"""
450
Returns the weight of ``self`` as an element of the root lattice
451
`\bigoplus_{i=0}^n \ZZ \alpha_i`.
452
453
EXAMPLES::
454
455
sage: x=InfinityCrystalOfGeneralizedYoungWalls(3)([[],[1,0,3,2],[2,1],[3,2,1,0,3,2],[],[],[2]])
456
sage: x.weight()
457
-2*alpha[0] - 3*alpha[1] - 5*alpha[2] - 3*alpha[3]
458
"""
459
W = []
460
L = self.cartan_type().root_system().root_lattice()
461
alpha = L.simple_roots()
462
for r in self.data:
463
for i in r:
464
W.append(-1*alpha[i])
465
return L(sum(w for w in W))
466
467
def epsilon(self, i):
468
r"""
469
Return the number of `i`-colored arrows in the `i`-string above
470
``self`` in the crystal graph.
471
472
EXAMPLES::
473
474
sage: y=InfinityCrystalOfGeneralizedYoungWalls(3)([[],[1,0,3,2],[2,1],[3,2,1,0,3,2],[],[],[2]])
475
sage: y.epsilon(1)
476
0
477
sage: y.epsilon(2)
478
3
479
sage: y.epsilon(0)
480
0
481
"""
482
if i not in self.index_set():
483
raise ValueError("i must in in the index set")
484
eps = 0
485
while True:
486
self = self.e(i)
487
if self is None:
488
break
489
eps = eps+1
490
return eps
491
492
def Epsilon(self):
493
r"""
494
Return `\sum_{i=0}^n \varepsilon_i(Y) \Lambda_i` where `Y` is ``self``.
495
496
EXAMPLES::
497
498
sage: y = InfinityCrystalOfGeneralizedYoungWalls(3)([[0],[1,0,3,2],[2,1],[3,2,1,0,3,2],[0],[],[2]])
499
sage: y.Epsilon()
500
Lambda[0] + 3*Lambda[2]
501
"""
502
La = self.cartan_type().root_system().weight_lattice().fundamental_weights()
503
return sum(self.epsilon(i)*La[i] for i in self.index_set())
504
505
def phi(self,i):
506
r"""
507
Return the value `\varepsilon_i(Y) + \langle h_i,
508
\mathrm{wt}(Y)\rangle`, where `h_i` is the `i`-th simple
509
coroot and `Y` is ``self``.
510
511
EXAMPLES::
512
513
sage: y = InfinityCrystalOfGeneralizedYoungWalls(3)([[0],[1,0,3,2],[2,1],[3,2,1,0,3,2],[0],[],[2]])
514
sage: y.phi(1)
515
3
516
sage: y.phi(2)
517
-1
518
"""
519
h = self.parent().weight_lattice_realization().simple_coroots()
520
return self.epsilon(i) + self.weight().scalar(h[i])
521
522
def Phi(self):
523
r"""
524
Return `\sum_{i=0}^n \varphi_i(Y) \Lambda_i` where `Y` is ``self``.
525
526
EXAMPLES::
527
528
sage: y = InfinityCrystalOfGeneralizedYoungWalls(3)([[0],[1,0,3,2],[2,1],[3,2,1,0,3,2],[0],[],[2]])
529
sage: y.Phi()
530
-Lambda[0] + 3*Lambda[1] - Lambda[2] + 3*Lambda[3]
531
532
sage: x=InfinityCrystalOfGeneralizedYoungWalls(3)([[],[1,0,3,2],[2,1],[3,2,1,0,3,2],[],[],[2]])
533
sage: x.Phi()
534
2*Lambda[0] + Lambda[1] - Lambda[2] + Lambda[3]
535
"""
536
La = self.cartan_type().root_system().weight_lattice().fundamental_weights()
537
return sum(self.phi(i)*La[i] for i in self.index_set())
538
539
def column(self, k):
540
r"""
541
Return the list of boxes from the ``k``-th column of ``self``.
542
543
EXAMPLES::
544
545
sage: y = InfinityCrystalOfGeneralizedYoungWalls(3)([[0],[1,0,3,2],[2,1],[3,2,1,0,3,2],[0],[],[2]])
546
sage: y.column(2)
547
[None, 0, 1, 2, None, None, None]
548
549
sage: hw = InfinityCrystalOfGeneralizedYoungWalls(5)([])
550
sage: hw.column(1)
551
[]
552
"""
553
C = []
554
for row in self.data:
555
if k-1 < len(row):
556
C.append(row[k-1])
557
else:
558
C.append(None)
559
return C
560
561
def a(self,i,k):
562
r"""
563
Return the number `a_i(k)` of `i`-colored boxes in the ``k``-th
564
column of ``self``.
565
566
EXAMPLES::
567
568
sage: y = InfinityCrystalOfGeneralizedYoungWalls(3)([[0],[1,0,3,2],[2,1],[3,2,1,0,3,2],[0],[],[2]])
569
sage: y.a(1,2)
570
1
571
sage: y.a(0,2)
572
1
573
sage: y.a(3,2)
574
0
575
"""
576
A = []
577
for c in range(len(self.column(k))):
578
if self.column(k)[c] == i:
579
A.append(self.column(k)[c])
580
return len(A)
581
582
def in_highest_weight_crystal(self,La):
583
r"""
584
Return a boolean indicating if the generalized Young wall element
585
is in the highest weight crystal cut out by the given highest weight
586
``La``.
587
588
By Theorem 4.1 of [KS10]_, a generalized Young wall `Y` represents a
589
vertex in the highest weight crystal `Y(\lambda)`, with
590
`\lambda = \Lambda_{i_1} + \Lambda_{i_2} + \cdots + \Lambda_{i_\ell}`
591
a dominant integral weight of level `\ell > 0`, if it satisfies the
592
following condition. For each positive integer `k`, if there exists
593
`j \in I` such that `a_j(k) - a_{j-1}(k) > 0`, then for some
594
`p = 1, \ldots, \ell`,
595
596
.. MATH::
597
598
j + k \equiv i_p + 1 \bmod n+1 \text{ and } a_j(k) - a_{j-1}(k)
599
\le \lambda(h_{i_p}),
600
601
where `\{h_0, h_1, \ldots, h_n\}` is the set of simple coroots attached
602
to `A_n^{(1)}`.
603
604
EXAMPLES::
605
606
sage: La = RootSystem(['A',2,1]).weight_lattice().fundamental_weights()[1]
607
sage: GYW = InfinityCrystalOfGeneralizedYoungWalls(2)
608
sage: y = GYW([[],[1,0],[2,1]])
609
sage: y.in_highest_weight_crystal(La)
610
True
611
sage: x = GYW([[],[1],[2],[],[],[2],[],[],[2]])
612
sage: x.in_highest_weight_crystal(La)
613
False
614
"""
615
if not La in self.parent().weight_lattice_realization():
616
raise TypeError("Must be an element in the weight lattice realization")
617
ac = self.parent().weight_lattice_realization().simple_coroots()
618
n = self.cartan_type().classical().rank()
619
for k in range(1,self.cols+1):
620
for j in self.index_set():
621
if self.a(j,k) - self.a( (j-1) % (n+1) ,k) <= 0:
622
continue
623
else:
624
p_not_found = True
625
for p in self.index_set():
626
if (j+k) % (n+1) == (p+1) % (n+1) and self.a(j,k) - self.a( (j-1) % (n+1) ,k) <= La.scalar(ac[p]):
627
p_not_found = False
628
continue
629
else:
630
continue
631
if p_not_found:
632
return False
633
return True
634
635
636
class InfinityCrystalOfGeneralizedYoungWalls(Parent,UniqueRepresentation):
637
r"""
638
The crystal `\mathcal{Y}(\infty)` of generalized Young walls of
639
type `A_n^{(1)}` as defined in [KS10]_.
640
641
A generalized Young wall is a collection of boxes stacked on a fixed board,
642
such that color of the box at the site located in the `j`-th row from the
643
bottom and the `i`-th column from the right is `j-1 \bmod n+1`. There are
644
several growth conditions on elements in `Y \in \mathcal{Y}(\infty)`:
645
646
- Walls grow in rows from right to left. That is, for every box `y\in Y`
647
that is not in the rightmost column, there must be a box immediately to
648
the right of `y`.
649
650
- For all `p>q` such that `p-q \equiv 0 \bmod n+1`, the `p`-th row has
651
most as many boxes as the `q`-th row.
652
653
- There does not exist a column in the wall such that if one `i`-colored
654
box, for every `i = 0,1,\ldots,n`, is removed from that column, then the
655
result satisfies the above conditions.
656
657
There is a crystal structure on `\mathcal{Y}(\infty)` defined as follows.
658
Define maps
659
660
.. MATH::
661
662
\widetilde{e}_i,\ \widetilde{f}_i \colon \mathcal{Y}(\infty)
663
\longrightarrow \mathcal{Y}(\infty) \sqcup \{0\}, \qquad
664
\varepsilon_i,\ \varphi_i \colon \mathcal{Y}(\infty)
665
\longrightarrow \ZZ, \qquad
666
\mathrm{wt}\colon \mathcal{Y}(\infty) \longrightarrow
667
\bigoplus_{i=0}^n \ZZ \Lambda_i,
668
669
by
670
671
.. MATH::
672
673
\mathrm{wt}(Y) = -\sum_{i=0}^n m_i(Y) \alpha_i,
674
675
where `m_i(Y)` is the number of `i`-boxes in `Y`, `\varepsilon_i(Y)`
676
is the number of `-` in the `i`-signature of `Y`, and
677
678
.. MATH::
679
680
\varphi_i(Y) = \varepsilon_i(Y) + \langle h_i, \mathrm{wt}(Y) \rangle.
681
682
See :meth:`GeneralizedYoungWall.e()`, :meth:`GeneralizedYoungWall.f()`,
683
and :meth:`GeneralizedYoungWall.signature()` for more about
684
`\widetilde{e}_i`, `\widetilde{f}_i`, and `i`-signatures.
685
686
687
INPUT:
688
689
- ``n`` -- type `A_n^{(1)}`
690
691
EXAMPLES::
692
693
sage: Yinf = InfinityCrystalOfGeneralizedYoungWalls(3)
694
sage: y = Yinf([[0],[1,0,3,2],[],[3,2,1],[0],[1,0]])
695
sage: y.pp()
696
0|1|
697
0|
698
1|2|3|
699
|
700
2|3|0|1|
701
0|
702
sage: y.weight()
703
-4*alpha[0] - 3*alpha[1] - 2*alpha[2] - 2*alpha[3]
704
sage: y.f(0)
705
[[0], [1, 0, 3, 2], [], [3, 2, 1], [0], [1, 0], [], [], [0]]
706
sage: y.e(0).pp()
707
0|1|
708
|
709
1|2|3|
710
|
711
2|3|0|1|
712
0|
713
714
To display the crystal down to depth 3::
715
716
sage: S = Yinf.subcrystal(max_depth=3)
717
sage: G = Yinf.digraph(subset=S) # long time
718
sage: view(G, tightpage=True) # not tested
719
"""
720
721
@staticmethod
722
def __classcall_private__(cls, n, category=None):
723
r"""
724
Normalize input to ensure a unique representation.
725
726
INPUT:
727
728
- ``n`` -- type `A_n^{(1)}`
729
730
EXAMPLES::
731
732
sage: Yinf = InfinityCrystalOfGeneralizedYoungWalls(3)
733
sage: Yinf2 = InfinityCrystalOfGeneralizedYoungWalls(int(3))
734
sage: Yinf is Yinf2
735
True
736
"""
737
return super(InfinityCrystalOfGeneralizedYoungWalls,cls).__classcall__(cls,n,category)
738
739
def __init__(self, n, category):
740
r"""
741
EXAMPLES::
742
743
sage: Yinf = InfinityCrystalOfGeneralizedYoungWalls(3)
744
sage: TestSuite(Yinf).run()
745
"""
746
self._cartan_type = CartanType(['A',n,1])
747
if category is None:
748
category = (HighestWeightCrystals(), InfiniteEnumeratedSets())
749
Parent.__init__(self, category=category)
750
self.module_generators = (self.element_class(self,[]),)
751
752
Element = GeneralizedYoungWall
753
754
def _element_constructor_(self,data):
755
r"""
756
Construct an element of ``self`` from ``data``.
757
758
INPUT:
759
760
- ``data`` -- a multilist
761
762
EXAMPLES::
763
764
sage: GYW = InfinityCrystalOfGeneralizedYoungWalls(2)
765
sage: y = GYW([[],[1,0],[2,1]]) # indirect doctest
766
sage: y
767
[[], [1, 0], [2, 1]]
768
"""
769
return self.element_class(self,data)
770
771
def _repr_(self):
772
r"""
773
EXAMPLES::
774
775
sage: Y = InfinityCrystalOfGeneralizedYoungWalls(4)
776
sage: Y
777
Crystal of generalized Young walls of type ['A', 4, 1]
778
"""
779
return "Crystal of generalized Young walls of type %s" % self._cartan_type
780
781
def subset(self, max_depth=4):
782
r"""
783
Construct the subcrystal of ``self`` trucated at depth ``max_depth``.
784
785
EXAMPLES::
786
787
sage: Y = InfinityCrystalOfGeneralizedYoungWalls(2)
788
sage: S = Y.subset(max_depth=2)
789
sage: S
790
[[], [[], [1]], [[], [], [2]], [[0]], [[0, 2]], [[0], [1]], [[], [], [2], [], [], [2]],
791
[[], [1], [2]], [[0], [], [], [0]], [[0], [], [2]], [[], [], [2, 1]], [[], [1], [], [], [1]], [[], [1, 0]]]
792
"""
793
return [c for c in self.subcrystal(max_depth=max_depth, direction='lower')]
794
795
796
########################
797
## Highest weight GYW ##
798
########################
799
800
class CrystalOfGeneralizedYoungWallsElement(GeneralizedYoungWall):
801
r"""
802
Element of the highest weight crystal of generalized Young walls.
803
"""
804
805
def e(self,i):
806
r"""
807
Compute the action of `\widetilde{e}_i` restricted to the highest weight crystal.
808
809
EXAMPLES::
810
811
sage: La = RootSystem(['A',2,1]).weight_lattice().fundamental_weights()[1]
812
sage: hwy = CrystalOfGeneralizedYoungWalls(2,La)([[],[1,0],[2,1]])
813
sage: hwy.e(1)
814
[[], [1, 0], [2]]
815
sage: hwy.e(2)
816
sage: hwy.e(3)
817
"""
818
ret = GeneralizedYoungWall.e(self, i)
819
if ret is None:
820
return None
821
if ret.in_highest_weight_crystal(self.parent().hw):
822
return self.__class__(self.parent(),ret.data)
823
return None
824
825
def f(self,i):
826
r"""
827
Compute the action of `\widetilde{f}_i` restricted to the highest weight crystal.
828
829
EXAMPLES::
830
831
sage: La = RootSystem(['A',2,1]).weight_lattice().fundamental_weights()[1]
832
sage: GYW = InfinityCrystalOfGeneralizedYoungWalls(2)
833
sage: y = GYW([[],[1,0],[2,1]])
834
sage: y.f(1)
835
[[], [1, 0], [2, 1], [], [1]]
836
sage: hwy = CrystalOfGeneralizedYoungWalls(2,La)([[],[1,0],[2,1]])
837
sage: hwy.f(1)
838
"""
839
ret = GeneralizedYoungWall.f(self, i)
840
if ret.in_highest_weight_crystal(self.parent().hw):
841
return self.__class__(self.parent(),ret.data)
842
return None
843
844
def weight(self):
845
r"""
846
Return the weight of ``self`` in the highest weight crystal as an
847
element of the weight lattice `\bigoplus_{i=0}^n \ZZ \Lambda_i`.
848
849
EXAMPLES::
850
851
sage: La = RootSystem(['A',2,1]).weight_lattice().fundamental_weights()[1]
852
sage: hwy = CrystalOfGeneralizedYoungWalls(2,La)([[],[1,0],[2,1]])
853
sage: hwy.weight()
854
Lambda[0] - Lambda[1] + Lambda[2]
855
"""
856
return self.parent().weight_lattice_realization()(self.parent().hw + GeneralizedYoungWall.weight(self))
857
858
859
class CrystalOfGeneralizedYoungWalls(InfinityCrystalOfGeneralizedYoungWalls):
860
r"""
861
The crystal `\mathcal{Y}(\lambda)` of generalized Young walls of the given
862
type with highest weight `\lambda`.
863
864
These were characterized in Theorem 4.1 of [KS10]_.
865
See :meth:`GeneralizedYoungWall.in_highest_weight_crystal()`.
866
867
INPUT:
868
869
- ``n`` -- type `A_n^{(1)}`
870
871
- ``weight`` -- dominant integral weight
872
873
EXAMPLES::
874
875
sage: La = RootSystem(['A',3,1]).weight_lattice().fundamental_weights()[1]
876
sage: YLa = CrystalOfGeneralizedYoungWalls(3,La)
877
sage: y = YLa([[0],[1,0,3,2,1],[2,1,0],[3]])
878
sage: y.pp()
879
3|
880
0|1|2|
881
1|2|3|0|1|
882
0|
883
sage: y.weight()
884
-Lambda[0] + Lambda[2] + Lambda[3]
885
sage: y.in_highest_weight_crystal(La)
886
True
887
sage: y.f(1)
888
[[0], [1, 0, 3, 2, 1], [2, 1, 0], [3], [], [1]]
889
sage: y.f(1).f(1)
890
sage: yy = InfinityCrystalOfGeneralizedYoungWalls(3)([[0], [1, 0, 3, 2, 1], [2, 1, 0], [3], [], [1]])
891
sage: yy.f(1)
892
[[0], [1, 0, 3, 2, 1], [2, 1, 0], [3], [], [1], [], [], [], [1]]
893
sage: yyy = yy.f(1)
894
sage: yyy.in_highest_weight_crystal(La)
895
False
896
897
sage: LS = CrystalOfLSPaths(['A',3,1],[1,0,0,0])
898
sage: C = LS.subcrystal(max_depth=4)
899
sage: G = LS.digraph(subset=C)
900
sage: P = LS.weight_lattice_realization()
901
sage: La = P.fundamental_weights()
902
sage: YW = CrystalOfGeneralizedYoungWalls(3,La[0])
903
sage: CW = YW.subcrystal(max_depth=4)
904
sage: GW = YW.digraph(subset=CW)
905
sage: GW.is_isomorphic(G,edge_labels=True)
906
True
907
908
To display the crystal down to a specified depth::
909
910
sage: S = YLa.subset(max_depth=4)
911
sage: sorted(list(S))
912
[[], [[], [1]], [[], [1], [2]], [[], [1], [2], [3]], [[], [1, 0]], [[], [1, 0], [2]], [[], [1, 0], [2], [3]], [[], [1, 0], [2, 1]], [[], [1, 0, 3]], [[], [1, 0, 3], [2]], [[], [1, 0, 3, 2]]]
913
sage: G = YLa.digraph(subset=S)
914
sage: view(G, tightpage=True) # not tested
915
"""
916
@staticmethod
917
def __classcall_private__(cls, n, La):
918
r"""
919
EXAMPLES::
920
921
sage: La = RootSystem(['A',2,1]).weight_lattice().fundamental_weights()[2]
922
sage: Al = RootSystem(['A',2,1]).weight_lattice().monomial(2)
923
sage: Y = CrystalOfGeneralizedYoungWalls(2,La)
924
sage: Y1 = CrystalOfGeneralizedYoungWalls(int(2),Al)
925
sage: Y is Y1
926
True
927
"""
928
La = RootSystem(['A',n,1]).weight_lattice()(La)
929
return super(CrystalOfGeneralizedYoungWalls, cls).__classcall__(cls, n, La)
930
931
def __init__(self, n, La):
932
r"""
933
EXAMPLES::
934
935
sage: La = RootSystem(['A',2,1]).weight_lattice().fundamental_weights()[1]
936
sage: YLa = CrystalOfGeneralizedYoungWalls(2,La)
937
938
We skip the two tests because they take a very long time::
939
940
sage: TestSuite(YLa).run(skip=["_test_enumerated_set_contains","_test_stembridge_local_axioms"]) # long time
941
"""
942
InfinityCrystalOfGeneralizedYoungWalls.__init__( self, n,
943
category=(RegularCrystals(), HighestWeightCrystals(), InfiniteEnumeratedSets()) )
944
self.hw = La
945
946
Element = CrystalOfGeneralizedYoungWallsElement
947
948
def __repr__(self):
949
r"""
950
EXAMPLES::
951
952
sage: La = RootSystem(['A',5,1]).weight_lattice().fundamental_weights()[2]
953
sage: Y = CrystalOfGeneralizedYoungWalls(5,La)
954
sage: Y
955
Highest weight crystal of generalized Young walls of Cartan type ['A', 5, 1] and highest weight Lambda[2].
956
"""
957
return "Highest weight crystal of generalized Young walls of Cartan type {1!s} and highest weight {0!s}.".format(self.hw, self._cartan_type)
958
959
def __iter__(self):
960
r"""
961
EXAMPLES::
962
963
sage: y = InfinityCrystalOfGeneralizedYoungWalls(3)([[0],[1,0,3,2],[2,1],[3,2,1,0,3,2],[0],[],[2]])
964
sage: x = y.__iter__()
965
sage: x.next()
966
[0]
967
"""
968
for c in self.subcrystal(direction='lower'):
969
if c.in_highest_weight_crystal(self.hw) :
970
yield c
971
972
def subset(self, max_depth=4):
973
r"""
974
Return a subset of ``self`` up to ``max_depth``.
975
976
EXAMPLES::
977
978
sage: Y = CrystalOfGeneralizedYoungWalls(2,RootSystem(['A',2,1]).weight_lattice().fundamental_weights()[0])
979
sage: S = Y.subset(max_depth=3)
980
sage: S
981
[[], [[0]], [[0, 2]], [[0], [1]], [[0, 2, 1]], [[0, 2], [1]]]
982
"""
983
return [c for c in self.subcrystal(max_depth=max_depth, direction='lower')
984
if c.in_highest_weight_crystal(self.hw)]
985
986
987