Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

This is the underlying code supplying the needed functions. Load this into a worksheet to do actual calculations.

38 views
ubuntu2004
1
def weight_space_basis(al,n, multicharge):
2
r"""
3
Return the multipartitions in the weight space `Lambda - \alpha`.
4
5
INPUT:
6
7
- ``al`` -- a list of the coefficients of `\alpha` expressed as
8
a dictionary
9
- ``n`` -- the quantum characteristic
10
- ``multicharge`` -- the multicharge, expressing the content of the bottom boxes of the components
11
12
EXAMPLES::
13
14
sage: list(weight_space_basis([1,0,0]))
15
[[1]]
16
sage: list(weight_space_basis([1,1,0]))
17
[[2]]
18
sage: list(weight_space_basis([1,1,1]))
19
[[3], [2, 1], [1, 1, 1]]
20
sage: list(weight_space_basis([1,2,1]))
21
[[2, 1, 1]]
22
sage: list(weight_space_basis([1,4,3]))
23
[]
24
"""
25
k = sum(al.values())
26
m = len(multicharge)
27
for la in PartitionTuples(level=m,size=k):
28
beta=la.block(n, multicharge)
29
if beta == al:
30
yield la
31
32
def Kleshchev_basis(al,n, multicharge):
33
r"""
34
Return the Kleshchev multipartitions in the weight space `\Lambda - \alpha`.
35
36
INPUT:
37
38
- ``al`` -- a list of the coefficients of `\alpha` expressed as
39
a dictionary
40
- ``n`` -- the quantum characteristic
41
- ``multicharge`` -- the multicharge, expressing the content of the bottom boxes of the components
42
43
EXAMPLES::
44
45
46
"""
47
k = sum(al.values())
48
for la in KleshchevPartitions(n,multicharge, size=k, convention='left regular'):
49
beta=la.block(n, multicharge)
50
if beta == al:
51
yield la
52
53
def transition_matrix(al,n,multicharge):
54
r"""
55
Compute the transition matrix of the Fock space ``F`` for the
56
`\Lambda_0 - \alpha` weight space.
57
58
EXAMPLES::
59
60
sage: F = FockSpace(3)
61
sage: transition_matrix(F, [1,1,1])
62
[1 q 0]
63
[0 1 q]
64
sage: G = F.G()
65
sage: N = F.natural()
66
sage: F(G[3])
67
G[3]
68
sage: N(G[3])
69
|3> + q*|2, 1>
70
sage: N(G[2,1])
71
|2, 1> + q*|1, 1, 1>
72
"""
73
F = FockSpace(n,multicharge)
74
N = F.natural()
75
G = F.G()
76
basis = [la for la in weight_space_basis(al,n,multicharge)]
77
G_basis = [la for la in Kleshchev_basis(al,n, multicharge)]
78
M = matrix.zero(F.base_ring(), len(G_basis), len(basis))
79
for i,la in enumerate(G_basis):
80
ret = N(G[la])
81
for j,mu in enumerate(basis):
82
M[i,j] = ret[mu]
83
return M
84
85
def Cartan_matrix(al,n,multicharge):
86
r"""
87
Return the Cartan matrix of the block of the Ariki-Koike algebra of the block corresponding to al
88
89
INPUT:
90
91
- ``al`` -- a list of the coefficients of `\alpha` expressed as
92
a dictionary
93
- ``n`` -- the quantum characteristic
94
- ``multicharge`` -- the multicharge, expressing the content of the bottom boxes of the components
95
96
EXAMPLES::
97
98
99
"""
100
M = transition_matrix(al,n,multicharge)
101
C = M * M.transpose()
102
return C
103
104
def find_Lambda(n,multicharge):
105
r"""
106
Finds the highest weight in usual coordinates based on multicharge
107
108
INPUT:
109
110
a dictionary
111
- ``n`` -- the quantum characteristic
112
- ``multicharge`` -- the multicharge, expressing the content of the bottom boxes of the components
113
114
EXAMPLES::
115
116
117
"""
118
m=len(multicharge)
119
r=min([*multicharge,0])
120
s=max([*multicharge,n-1])
121
Lambda = [ 0 for i in range(r,s+1)]
122
for i in range(m):
123
Lambda[multicharge[i]]+=1
124
return Lambda
125
126
def alcheck(i,al,n,Lambda):
127
r"""
128
Returns the inner product of `\alpha_i^{\vee}` with `\Lambda - \alpha`.
129
130
INPUT:
131
132
133
- ``i`` -- an index between 1 and n
134
- ``al`` -- a list of the coefficients of `\alpha` expressed as
135
a dictionary
136
- ``n`` -- the quantum characteristic
137
- ``Lambda`` -- the highest weight in usual coordinates
138
139
EXAMPLES::
140
141
"""
142
j=(i+1)%n
143
k=(i-1)%n
144
if j not in al.keys(): al[j]=0
145
if i not in al.keys(): al[i]=0
146
if k not in al.keys(): al[k]=0
147
return Lambda[i]-2*al[i]+ al[j]+al[k]
148
149
def weight_reflect(al,n,Lambda,r,s):
150
r"""
151
Reflects the weight `\Lambda-\alpha` with one simple reflection that brings it closer to the highest weight; returns an error if it finds you are outside the weight polytope. Returns [true, al] if al is dominant, and [false, newal, i] if it reflected by s_i to get newal.
152
INPUT:
153
154
155
- ``al`` -- a list of the coefficients of `\alpha` expressed as
156
a dictionary
157
- ``n`` -- the quantum characteristic
158
- ``Lambda`` -- the highest weight in usual coordinates
159
- r,s the limits of the roots it should try to reflect by; if n!=0, these should be r=0 and s=n-1.
160
161
EXAMPLES::
162
163
"""
164
alch = [alcheck(i,al,n,Lambda) for i in range(r,s+1)]
165
#print(alch)
166
neg = [i for i in range(r,s+1) if alch[i]<0]
167
if neg == []:
168
return [true,al]
169
else:
170
h=min([al[i] for i in neg])
171
j=min([i for i in neg if al[i]==h])
172
if j not in al.keys():
173
k=0
174
else:
175
k=al[j]
176
#if k+alch[j] < 0:
177
#print("al=",al,"j=",j,"k=",k,"alch[j]=",alch[j])
178
# raise ValueError("This block is empty.")
179
al.update({j:k+alch[j]})
180
return [false,al,j]
181
182
def act_on_roots(al,n,Lambda,j):
183
newal=al.copy()
184
if j not in newal.keys():
185
k=0
186
else:
187
k=newal[j]
188
newal.update({j:k+alcheck(j,al,n,Lambda)})
189
return newal
190
191
def find_dominant(al,n,multicharge):
192
r"""
193
Reflects `\Lambda-\alpha` to be a dominant weight; will return an error if \Lambda-\alpha is not in the weight diagram. Returns a reduced expression for the Weyl group element sending the dominant weight to the original one, and the dominant weight.
194
INPUT:
195
196
- ``al`` -- a list of the coefficients of `\alpha` expressed as
197
a dictionary
198
- ``n`` -- the quantum characteristic
199
- ``multicharge`` -- the multicharge, expressing the content of the bottom boxes of the components
200
201
EXAMPLES::
202
203
204
"""
205
if n==0:
206
r = min([*al.keys(),*multicharge])
207
s = max([*al.keys(),*multicharge])
208
else:
209
r=0
210
s=n-1
211
word = []
212
Lambda=find_Lambda(n,multicharge)
213
dominant = false
214
newal=al
215
while dominant==false:
216
refl=weight_reflect(newal,n,Lambda,r,s)
217
dominant=refl[0]
218
newal=refl[1]
219
if dominant==false:
220
word.append(refl[2])
221
return [word,newal]
222
223
224
def findN(al,n,multicharge):
225
r"""
226
Finds the set N of simple roots that are an obstruction to RoCKness (whose zero sets bound the Scopes chambers)
227
INPUT:
228
229
- ``al`` -- a list of the coefficients of `\alpha` expressed as
230
a dictionary
231
- ``n`` -- the quantum characteristic
232
- ``multicharge`` -- the multicharge, expressing the content of the bottom boxes of the components
233
234
EXAMPLES::
235
236
237
"""
238
if n==0:
239
r = min([*al.keys(),*multicharge])
240
s = max([*al.keys(),*multicharge])
241
else:
242
r=0
243
s=n-1
244
for i in range(r,s+1):
245
if i not in al.keys(): al[i]=0
246
Lambda=find_Lambda(n,multicharge)
247
refl=weight_reflect(al,n,Lambda,r,s)
248
if refl[0]==false:
249
raise ValueError("Weight should be dominant")
250
bounds={}
251
if n==0:
252
for j in range(r,s+2):
253
for i in range(r,j):
254
checkal=al.copy()
255
for a in al.keys():
256
if a in range(i,j):
257
checkal.update({a:al[a]-1})
258
dom=find_dominant(checkal,n,multicharge)
259
delt=min(dom[1].values())
260
if delta<0:
261
bounds[(i,j)]=-1
262
else: bounds[(i,j)]=0
263
264
if n!=0:
265
for j in range(r+1,s+2):
266
for i in range(r+1,s+2):
267
#print(i,j)
268
checkal=al.copy()
269
if i<j:
270
for a in al.keys():
271
if a in range(i,j):
272
checkal.update({a:al[a]-1})
273
#print([i,j])
274
#print(checkal)
275
dom=find_dominant(checkal,n,multicharge)
276
delt=min(dom[1].values())
277
if delt<0:
278
bounds[(i,j)]=-1
279
else: bounds[(i,j)]=delt
280
elif j<i:
281
for a in al.keys():
282
if a in range(j,i):
283
checkal.update({a:al[a]+1})
284
#print([i,j])
285
#print(checkal)
286
dom=find_dominant(checkal,n,multicharge)
287
delt=min(dom[1].values())
288
if delt<1:
289
bounds[(i,j)]=-1
290
else: bounds[(i,j)]=delt
291
return bounds
292
293
def weight_from_block(al,n,multicharge,shift):
294
r"""
295
Expresses a weight in the usual coordinates.
296
INPUT:
297
298
- ``al`` -- a list of the coefficients of `\alpha` expressed as
299
a dictionary
300
- ``n`` -- the quantum characteristic
301
- ``multicharge`` -- the multicharge, expressing the content of the bottom boxes of the components
302
- ``shift'' -- shift away from the default sum for these coordinates.
303
EXAMPLES::
304
305
306
"""
307
if n==0: raise ValueError("This isn't set up to work for n=0")
308
Lambda=find_Lambda(n,multicharge)
309
hwt=[sum(Lambda[i:n])+shift for i in range(1,n+1)]
310
wt=hwt.copy()
311
for j in al.keys():
312
# print(wt)
313
k=(j-1)%n
314
wt[k]=wt[k]-al[j]
315
wt[j]=wt[j]+al[j]
316
return [wt,hwt]
317
318
def act_on_wt(ell, wt, i):
319
r"""
320
Acts on a weight in the usual coordinates with s_i, in level ell
321
INPUT:
322
323
- ``ell`` -- the level
324
- ``wt`` -- the weight in usual coordinates
325
- ``i`` -- the the index of the reflection I'm acting by.
326
327
EXAMPLES::
328
329
330
"""
331
n=len(wt)
332
newwt=wt.copy()
333
if i!=0:
334
newwt[i]=wt[i-1]
335
newwt[i-1]=wt[i]
336
if i==0:
337
newwt[0]=wt[n-1]+ell
338
newwt[n-1]=wt[0]-ell
339
return newwt
340
341
def find_dom_w_chamber(al,n,multicharge):
342
r"""
343
Reflects `\Lambda-\alpha` to be a dominant weight; will return an error if \Lambda-\alpha is not in the weight diagram. Returns an element of the alcove `wA`, and the dominant weight `\Lambda-\alpha=w(\Lambda-\alpha)'.
344
INPUT:
345
346
- ``al`` -- a list of the coefficients of `\alpha` expressed as
347
a dictionary
348
- ``n`` -- the quantum characteristic
349
- ``multicharge`` -- the multicharge, expressing the content of the bottom boxes of the components
350
351
EXAMPLES::
352
353
354
"""
355
if n==0: raise ValueError("This isn't set up to work for n=0")
356
Lambda=find_Lambda(n,multicharge)
357
ell=len(multicharge)
358
dominant = false
359
newal=al.copy()
360
vector=[(n-1-i)/n for i in range(n)]
361
while dominant==false:
362
#print(vector,newal, weight_from_block(newal,n,multicharge,9))
363
refl=weight_reflect(newal,n,Lambda,0,n-1)
364
dominant=refl[0]
365
newal=refl[1]
366
if dominant==false:
367
vector=act_on_wt(1, vector, refl[2])
368
return [vector,newal]
369
370
def test_RoCK(al,n,multicharge):
371
r"""
372
Tests whether the block for the corresponding data is RoCK.
373
INPUT:
374
375
- ``al`` -- a list of the coefficients of `\alpha` expressed as
376
a dictionary
377
- ``n`` -- the quantum characteristic
378
- ``multicharge`` -- the multicharge, expressing the content of the bottom boxes of the components
379
380
EXAMPLES::
381
382
383
"""
384
if n==0: raise ValueError("This isn't set up to work for n=0")
385
ell=len(multicharge)
386
dom=find_dom_w_chamber(al,n,multicharge)
387
bounds=findN(dom[1],n,multicharge)
388
vect=dom[0]
389
#print(vect)
390
RoCK=true
391
for j in range(1,n+1):
392
for i in range(1,j):
393
#print [i,j]
394
if vect[i-1]-vect[j-1]+bounds[(i,j)] >0 and vect[j-1]-vect[i-1]+bounds[(j,i)]>0:
395
RoCK=false
396
return RoCK
397
398
def test_RoCK_verbose(al,n,multicharge):
399
r"""
400
Tests whether the block for the corresponding data is RoCK.
401
INPUT:
402
403
- ``al`` -- a list of the coefficients of `\alpha` expressed as
404
a dictionary
405
- ``n`` -- the quantum characteristic
406
- ``multicharge`` -- the multicharge, expressing the content of the bottom boxes of the components
407
408
EXAMPLES::
409
410
411
"""
412
if n==0: raise ValueError("This isn't set up to work for n=0")
413
ell=len(multicharge)
414
dom=find_dom_w_chamber(al,n,multicharge)
415
bounds=findN(dom[1],n,multicharge)
416
vect=dom[0]
417
#print(vect)
418
RoCK=true
419
for j in range(1,n+1):
420
for i in range(1,j):
421
#print ([i,j], vect[i-1],vect[j-1],bounds[(i,j)],bounds[(j,i)])
422
#print (vect[i-1]-vect[j-1]+bounds[(i,j)], vect[j-1]-vect[i-1]+bounds[(j,i)])
423
if vect[i-1]-vect[j-1]+bounds[(i,j)] >0 and vect[j-1]-vect[i-1]+bounds[(j,i)]>0:
424
print("There's a problem with ",[i,j]," since ",bounds[(j,i)],">",vect[i-1]-vect[j-1],">",-bounds[(i,j)],".")
425
RoCK=false
426
else: print("The pair",[i,j]," is OK since ",vect[i-1]-vect[j-1]," is not between ",bounds[(j,i)],"and",-bounds[(i,j)],".")
427
return RoCK
428
429
def partition_from_abacus(abacus):
430
gaps=[i for i in range(len(abacus)-1) if abacus[i]-abacus[i+1]>1 ]
431
part=[]
432
while gaps !=[]:
433
j=max(gaps)
434
part.append(abacus[j]-abacus[j+1]-1)
435
abacus[j]=abacus[j+1]+1
436
gaps=[i for i in range(len(abacus)-1) if abacus[i]-abacus[i+1]>1 ]
437
return list(reversed(part))
438
439
def alcheck_wt(ell,wt,i):
440
r"""
441
Returns the inner product of `\alpha_i^{\vee}` with `\Lambda - \alpha`.
442
443
INPUT:
444
445
446
- ``i`` -- an index between 1 and n
447
- ``ell`` -- the level
448
- ``wt`` -- the weight in the usual coordinates
449
450
EXAMPLES::
451
452
"""
453
n=len(wt)
454
if i!=0:
455
return wt[i-1]-wt[i]
456
if i==0:
457
return wt[n-1]+ell-wt[0]
458
459
def block_from_weight(wt,al,n,multicharge):
460
r"""
461
Starting with a dominant weight and an element of the alcove wA, finds `w^{-1}(\Lambda - \alpha)`.
462
463
INPUT:
464
465
466
- ``wt`` -- a weight in usual coordinates
467
- ``al`` -- a list of the coefficients of `\alpha` expressed as
468
a dictionary
469
- ``n`` -- the quantum characteristic
470
- ``multicharge`` -- the multicharge, expressing the content of the bottom boxes of the components
471
472
EXAMPLES::
473
474
"""
475
if n==0: raise ValueError("This isn't set up to work for n=0")
476
for i in range(n):
477
if i not in al.keys(): al[i]=0
478
Lambda=find_Lambda(n,multicharge)
479
ell=len(multicharge)
480
refl=weight_reflect(al,n,Lambda,0,n-1)
481
if refl[0]==false:
482
raise ValueError("Weight should be dominant")
483
alc=false
484
while alc==false:
485
neg=[i for i in range (n) if alcheck_wt(1,wt,i)<0]
486
if neg ==[]: alc=true
487
else:
488
j=min(neg)
489
wt=act_on_wt(1, wt, j)
490
al.update({j:al[j]+alcheck(j,al,n,Lambda)})
491
# print(wt,al)
492
return al
493
494
def RoCK_weight(wt,al,n,multicharge):
495
r"""
496
Starting with a weight and an element of a given Weyl chamber, finds a RoCK block for that Weyl chamber. Note: not guaranteed to the give same result for all Weyl chambers (but should for all small elements of the chamber).
497
498
INPUT:
499
500
501
- ``wt`` -- a weight in usual coordinates
502
- ``al`` -- a list of the coefficients of `\alpha` expressed as
503
a dictionary
504
- ``n`` -- the quantum characteristic
505
- ``multicharge`` -- the multicharge, expressing the content of the bottom boxes of the components
506
507
EXAMPLES::
508
509
"""
510
if n==0: raise ValueError("This isn't set up to work for n=0")
511
for i in range(n):
512
if i not in al.keys(): al[i]=0
513
Lambda=find_Lambda(n,multicharge)
514
ell=len(multicharge)
515
dom=find_dom_w_chamber(al,n,multicharge)
516
bounds=findN(dom[1],n,multicharge)
517
RoCK=false
518
newwt=wt.copy()
519
z=5
520
while RoCK==false and z>0:
521
restart=false
522
z-=1
523
badness={}
524
reference=newwt.copy()
525
for j in range(1,n+1):
526
for i in range(1,j):
527
if restart==false:
528
bad=newwt[i-1]-newwt[j-1]+bounds[(i,j)]
529
badder=newwt[j-1]-newwt[i-1]+bounds[(j,i)]
530
#print("[i,j]=",[i,j],"newwt=",newwt,"[bad,badder]=",[bad,badder])
531
if bad >0 and badder>0:
532
#print("Changing the vector. Starting with newwt=",newwt,"reference=",[bad,badder])
533
for k in range(n):
534
#print("Now comparing with k=",k," I'm comparing", newwt[k],reference[i-1],reference[j-1])
535
if newwt[k]>=reference[i-1] and newwt[k]>=reference[j-1]:
536
newwt[k]=newwt[k]+bad+badder+.1
537
#print("Now I have", newwt[k],reference[i-1],reference[j-1],". Is that different?")
538
restart=true
539
if restart==false: RoCK=true
540
newal=block_from_weight(newwt,dom[1],n,multicharge)
541
RoCKq=test_RoCK(newal,n,multicharge)
542
if RoCKq==false: raise ValueError("This block isn't RoCK; the program must have a bug.")
543
minimal=false
544
while minimal==false:
545
reference=newal.copy()
546
#print(newal,"Going to test")
547
for i in range(n):
548
if alcheck(i,newal,n,Lambda)<0:
549
testal= act_on_roots(newal,n,Lambda,i)
550
RoCKq=test_RoCK(testal,n,multicharge)
551
#print(RoCKq,testal,newal)
552
if RoCKq:
553
newal = testal
554
#print(reference,newal)
555
if reference == newal: minimal=true
556
#print("That's minimal!")
557
return newal
558
559
from itertools import permutations
560
561
def all_RoCKs(al,n,multicharge):
562
r"""
563
Starts with a weight `\Lambda -\alpha` and finds a RoCK block for each Weyl chamber
564
565
INPUT:
566
567
- ``al`` -- a list of the coefficients of `\alpha` expressed as
568
a dictionary
569
- ``n`` -- the quantum characteristic
570
- ``multicharge`` -- the multicharge, expressing the content of the bottom boxes of the components
571
572
EXAMPLES::
573
574
"""
575
vector=[(n-1-i)/n for i in range(n)]
576
perm = list(permutations(vector))
577
newal=al.copy()
578
RoCKs={p:RoCK_weight(list(p),newal,n,multicharge) for p in perm}
579
return RoCKs
580
581