This is the underlying code supplying the needed functions. Load this into a worksheet to do actual calculations.
ubuntu2004
def weight_space_basis(al,n, multicharge):1r"""2Return the multipartitions in the weight space `Lambda - \alpha`.34INPUT:56- ``al`` -- a list of the coefficients of `\alpha` expressed as7a dictionary8- ``n`` -- the quantum characteristic9- ``multicharge`` -- the multicharge, expressing the content of the bottom boxes of the components1011EXAMPLES::1213sage: list(weight_space_basis([1,0,0]))14[[1]]15sage: list(weight_space_basis([1,1,0]))16[[2]]17sage: list(weight_space_basis([1,1,1]))18[[3], [2, 1], [1, 1, 1]]19sage: list(weight_space_basis([1,2,1]))20[[2, 1, 1]]21sage: list(weight_space_basis([1,4,3]))22[]23"""24k = sum(al.values())25m = len(multicharge)26for la in PartitionTuples(level=m,size=k):27beta=la.block(n, multicharge)28if beta == al:29yield la3031def Kleshchev_basis(al,n, multicharge):32r"""33Return the Kleshchev multipartitions in the weight space `\Lambda - \alpha`.3435INPUT:3637- ``al`` -- a list of the coefficients of `\alpha` expressed as38a dictionary39- ``n`` -- the quantum characteristic40- ``multicharge`` -- the multicharge, expressing the content of the bottom boxes of the components4142EXAMPLES::434445"""46k = sum(al.values())47for la in KleshchevPartitions(n,multicharge, size=k, convention='left regular'):48beta=la.block(n, multicharge)49if beta == al:50yield la5152def transition_matrix(al,n,multicharge):53r"""54Compute the transition matrix of the Fock space ``F`` for the55`\Lambda_0 - \alpha` weight space.5657EXAMPLES::5859sage: F = FockSpace(3)60sage: transition_matrix(F, [1,1,1])61[1 q 0]62[0 1 q]63sage: G = F.G()64sage: N = F.natural()65sage: F(G[3])66G[3]67sage: N(G[3])68|3> + q*|2, 1>69sage: N(G[2,1])70|2, 1> + q*|1, 1, 1>71"""72F = FockSpace(n,multicharge)73N = F.natural()74G = F.G()75basis = [la for la in weight_space_basis(al,n,multicharge)]76G_basis = [la for la in Kleshchev_basis(al,n, multicharge)]77M = matrix.zero(F.base_ring(), len(G_basis), len(basis))78for i,la in enumerate(G_basis):79ret = N(G[la])80for j,mu in enumerate(basis):81M[i,j] = ret[mu]82return M8384def Cartan_matrix(al,n,multicharge):85r"""86Return the Cartan matrix of the block of the Ariki-Koike algebra of the block corresponding to al8788INPUT:8990- ``al`` -- a list of the coefficients of `\alpha` expressed as91a dictionary92- ``n`` -- the quantum characteristic93- ``multicharge`` -- the multicharge, expressing the content of the bottom boxes of the components9495EXAMPLES::969798"""99M = transition_matrix(al,n,multicharge)100C = M * M.transpose()101return C102103def find_Lambda(n,multicharge):104r"""105Finds the highest weight in usual coordinates based on multicharge106107INPUT:108109a dictionary110- ``n`` -- the quantum characteristic111- ``multicharge`` -- the multicharge, expressing the content of the bottom boxes of the components112113EXAMPLES::114115116"""117m=len(multicharge)118r=min([*multicharge,0])119s=max([*multicharge,n-1])120Lambda = [ 0 for i in range(r,s+1)]121for i in range(m):122Lambda[multicharge[i]]+=1123return Lambda124125def alcheck(i,al,n,Lambda):126r"""127Returns the inner product of `\alpha_i^{\vee}` with `\Lambda - \alpha`.128129INPUT:130131132- ``i`` -- an index between 1 and n133- ``al`` -- a list of the coefficients of `\alpha` expressed as134a dictionary135- ``n`` -- the quantum characteristic136- ``Lambda`` -- the highest weight in usual coordinates137138EXAMPLES::139140"""141j=(i+1)%n142k=(i-1)%n143if j not in al.keys(): al[j]=0144if i not in al.keys(): al[i]=0145if k not in al.keys(): al[k]=0146return Lambda[i]-2*al[i]+ al[j]+al[k]147148def weight_reflect(al,n,Lambda,r,s):149r"""150Reflects 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.151INPUT:152153154- ``al`` -- a list of the coefficients of `\alpha` expressed as155a dictionary156- ``n`` -- the quantum characteristic157- ``Lambda`` -- the highest weight in usual coordinates158- 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.159160EXAMPLES::161162"""163alch = [alcheck(i,al,n,Lambda) for i in range(r,s+1)]164#print(alch)165neg = [i for i in range(r,s+1) if alch[i]<0]166if neg == []:167return [true,al]168else:169h=min([al[i] for i in neg])170j=min([i for i in neg if al[i]==h])171if j not in al.keys():172k=0173else:174k=al[j]175#if k+alch[j] < 0:176#print("al=",al,"j=",j,"k=",k,"alch[j]=",alch[j])177# raise ValueError("This block is empty.")178al.update({j:k+alch[j]})179return [false,al,j]180181def act_on_roots(al,n,Lambda,j):182newal=al.copy()183if j not in newal.keys():184k=0185else:186k=newal[j]187newal.update({j:k+alcheck(j,al,n,Lambda)})188return newal189190def find_dominant(al,n,multicharge):191r"""192Reflects `\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.193INPUT:194195- ``al`` -- a list of the coefficients of `\alpha` expressed as196a dictionary197- ``n`` -- the quantum characteristic198- ``multicharge`` -- the multicharge, expressing the content of the bottom boxes of the components199200EXAMPLES::201202203"""204if n==0:205r = min([*al.keys(),*multicharge])206s = max([*al.keys(),*multicharge])207else:208r=0209s=n-1210word = []211Lambda=find_Lambda(n,multicharge)212dominant = false213newal=al214while dominant==false:215refl=weight_reflect(newal,n,Lambda,r,s)216dominant=refl[0]217newal=refl[1]218if dominant==false:219word.append(refl[2])220return [word,newal]221222223def findN(al,n,multicharge):224r"""225Finds the set N of simple roots that are an obstruction to RoCKness (whose zero sets bound the Scopes chambers)226INPUT:227228- ``al`` -- a list of the coefficients of `\alpha` expressed as229a dictionary230- ``n`` -- the quantum characteristic231- ``multicharge`` -- the multicharge, expressing the content of the bottom boxes of the components232233EXAMPLES::234235236"""237if n==0:238r = min([*al.keys(),*multicharge])239s = max([*al.keys(),*multicharge])240else:241r=0242s=n-1243for i in range(r,s+1):244if i not in al.keys(): al[i]=0245Lambda=find_Lambda(n,multicharge)246refl=weight_reflect(al,n,Lambda,r,s)247if refl[0]==false:248raise ValueError("Weight should be dominant")249bounds={}250if n==0:251for j in range(r,s+2):252for i in range(r,j):253checkal=al.copy()254for a in al.keys():255if a in range(i,j):256checkal.update({a:al[a]-1})257dom=find_dominant(checkal,n,multicharge)258delt=min(dom[1].values())259if delta<0:260bounds[(i,j)]=-1261else: bounds[(i,j)]=0262263if n!=0:264for j in range(r+1,s+2):265for i in range(r+1,s+2):266#print(i,j)267checkal=al.copy()268if i<j:269for a in al.keys():270if a in range(i,j):271checkal.update({a:al[a]-1})272#print([i,j])273#print(checkal)274dom=find_dominant(checkal,n,multicharge)275delt=min(dom[1].values())276if delt<0:277bounds[(i,j)]=-1278else: bounds[(i,j)]=delt279elif j<i:280for a in al.keys():281if a in range(j,i):282checkal.update({a:al[a]+1})283#print([i,j])284#print(checkal)285dom=find_dominant(checkal,n,multicharge)286delt=min(dom[1].values())287if delt<1:288bounds[(i,j)]=-1289else: bounds[(i,j)]=delt290return bounds291292def weight_from_block(al,n,multicharge,shift):293r"""294Expresses a weight in the usual coordinates.295INPUT:296297- ``al`` -- a list of the coefficients of `\alpha` expressed as298a dictionary299- ``n`` -- the quantum characteristic300- ``multicharge`` -- the multicharge, expressing the content of the bottom boxes of the components301- ``shift'' -- shift away from the default sum for these coordinates.302EXAMPLES::303304305"""306if n==0: raise ValueError("This isn't set up to work for n=0")307Lambda=find_Lambda(n,multicharge)308hwt=[sum(Lambda[i:n])+shift for i in range(1,n+1)]309wt=hwt.copy()310for j in al.keys():311# print(wt)312k=(j-1)%n313wt[k]=wt[k]-al[j]314wt[j]=wt[j]+al[j]315return [wt,hwt]316317def act_on_wt(ell, wt, i):318r"""319Acts on a weight in the usual coordinates with s_i, in level ell320INPUT:321322- ``ell`` -- the level323- ``wt`` -- the weight in usual coordinates324- ``i`` -- the the index of the reflection I'm acting by.325326EXAMPLES::327328329"""330n=len(wt)331newwt=wt.copy()332if i!=0:333newwt[i]=wt[i-1]334newwt[i-1]=wt[i]335if i==0:336newwt[0]=wt[n-1]+ell337newwt[n-1]=wt[0]-ell338return newwt339340def find_dom_w_chamber(al,n,multicharge):341r"""342Reflects `\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)'.343INPUT:344345- ``al`` -- a list of the coefficients of `\alpha` expressed as346a dictionary347- ``n`` -- the quantum characteristic348- ``multicharge`` -- the multicharge, expressing the content of the bottom boxes of the components349350EXAMPLES::351352353"""354if n==0: raise ValueError("This isn't set up to work for n=0")355Lambda=find_Lambda(n,multicharge)356ell=len(multicharge)357dominant = false358newal=al.copy()359vector=[(n-1-i)/n for i in range(n)]360while dominant==false:361#print(vector,newal, weight_from_block(newal,n,multicharge,9))362refl=weight_reflect(newal,n,Lambda,0,n-1)363dominant=refl[0]364newal=refl[1]365if dominant==false:366vector=act_on_wt(1, vector, refl[2])367return [vector,newal]368369def test_RoCK(al,n,multicharge):370r"""371Tests whether the block for the corresponding data is RoCK.372INPUT:373374- ``al`` -- a list of the coefficients of `\alpha` expressed as375a dictionary376- ``n`` -- the quantum characteristic377- ``multicharge`` -- the multicharge, expressing the content of the bottom boxes of the components378379EXAMPLES::380381382"""383if n==0: raise ValueError("This isn't set up to work for n=0")384ell=len(multicharge)385dom=find_dom_w_chamber(al,n,multicharge)386bounds=findN(dom[1],n,multicharge)387vect=dom[0]388#print(vect)389RoCK=true390for j in range(1,n+1):391for i in range(1,j):392#print [i,j]393if vect[i-1]-vect[j-1]+bounds[(i,j)] >0 and vect[j-1]-vect[i-1]+bounds[(j,i)]>0:394RoCK=false395return RoCK396397def test_RoCK_verbose(al,n,multicharge):398r"""399Tests whether the block for the corresponding data is RoCK.400INPUT:401402- ``al`` -- a list of the coefficients of `\alpha` expressed as403a dictionary404- ``n`` -- the quantum characteristic405- ``multicharge`` -- the multicharge, expressing the content of the bottom boxes of the components406407EXAMPLES::408409410"""411if n==0: raise ValueError("This isn't set up to work for n=0")412ell=len(multicharge)413dom=find_dom_w_chamber(al,n,multicharge)414bounds=findN(dom[1],n,multicharge)415vect=dom[0]416#print(vect)417RoCK=true418for j in range(1,n+1):419for i in range(1,j):420#print ([i,j], vect[i-1],vect[j-1],bounds[(i,j)],bounds[(j,i)])421#print (vect[i-1]-vect[j-1]+bounds[(i,j)], vect[j-1]-vect[i-1]+bounds[(j,i)])422if vect[i-1]-vect[j-1]+bounds[(i,j)] >0 and vect[j-1]-vect[i-1]+bounds[(j,i)]>0:423print("There's a problem with ",[i,j]," since ",bounds[(j,i)],">",vect[i-1]-vect[j-1],">",-bounds[(i,j)],".")424RoCK=false425else: print("The pair",[i,j]," is OK since ",vect[i-1]-vect[j-1]," is not between ",bounds[(j,i)],"and",-bounds[(i,j)],".")426return RoCK427428def partition_from_abacus(abacus):429gaps=[i for i in range(len(abacus)-1) if abacus[i]-abacus[i+1]>1 ]430part=[]431while gaps !=[]:432j=max(gaps)433part.append(abacus[j]-abacus[j+1]-1)434abacus[j]=abacus[j+1]+1435gaps=[i for i in range(len(abacus)-1) if abacus[i]-abacus[i+1]>1 ]436return list(reversed(part))437438def alcheck_wt(ell,wt,i):439r"""440Returns the inner product of `\alpha_i^{\vee}` with `\Lambda - \alpha`.441442INPUT:443444445- ``i`` -- an index between 1 and n446- ``ell`` -- the level447- ``wt`` -- the weight in the usual coordinates448449EXAMPLES::450451"""452n=len(wt)453if i!=0:454return wt[i-1]-wt[i]455if i==0:456return wt[n-1]+ell-wt[0]457458def block_from_weight(wt,al,n,multicharge):459r"""460Starting with a dominant weight and an element of the alcove wA, finds `w^{-1}(\Lambda - \alpha)`.461462INPUT:463464465- ``wt`` -- a weight in usual coordinates466- ``al`` -- a list of the coefficients of `\alpha` expressed as467a dictionary468- ``n`` -- the quantum characteristic469- ``multicharge`` -- the multicharge, expressing the content of the bottom boxes of the components470471EXAMPLES::472473"""474if n==0: raise ValueError("This isn't set up to work for n=0")475for i in range(n):476if i not in al.keys(): al[i]=0477Lambda=find_Lambda(n,multicharge)478ell=len(multicharge)479refl=weight_reflect(al,n,Lambda,0,n-1)480if refl[0]==false:481raise ValueError("Weight should be dominant")482alc=false483while alc==false:484neg=[i for i in range (n) if alcheck_wt(1,wt,i)<0]485if neg ==[]: alc=true486else:487j=min(neg)488wt=act_on_wt(1, wt, j)489al.update({j:al[j]+alcheck(j,al,n,Lambda)})490# print(wt,al)491return al492493def RoCK_weight(wt,al,n,multicharge):494r"""495Starting 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).496497INPUT:498499500- ``wt`` -- a weight in usual coordinates501- ``al`` -- a list of the coefficients of `\alpha` expressed as502a dictionary503- ``n`` -- the quantum characteristic504- ``multicharge`` -- the multicharge, expressing the content of the bottom boxes of the components505506EXAMPLES::507508"""509if n==0: raise ValueError("This isn't set up to work for n=0")510for i in range(n):511if i not in al.keys(): al[i]=0512Lambda=find_Lambda(n,multicharge)513ell=len(multicharge)514dom=find_dom_w_chamber(al,n,multicharge)515bounds=findN(dom[1],n,multicharge)516RoCK=false517newwt=wt.copy()518z=5519while RoCK==false and z>0:520restart=false521z-=1522badness={}523reference=newwt.copy()524for j in range(1,n+1):525for i in range(1,j):526if restart==false:527bad=newwt[i-1]-newwt[j-1]+bounds[(i,j)]528badder=newwt[j-1]-newwt[i-1]+bounds[(j,i)]529#print("[i,j]=",[i,j],"newwt=",newwt,"[bad,badder]=",[bad,badder])530if bad >0 and badder>0:531#print("Changing the vector. Starting with newwt=",newwt,"reference=",[bad,badder])532for k in range(n):533#print("Now comparing with k=",k," I'm comparing", newwt[k],reference[i-1],reference[j-1])534if newwt[k]>=reference[i-1] and newwt[k]>=reference[j-1]:535newwt[k]=newwt[k]+bad+badder+.1536#print("Now I have", newwt[k],reference[i-1],reference[j-1],". Is that different?")537restart=true538if restart==false: RoCK=true539newal=block_from_weight(newwt,dom[1],n,multicharge)540RoCKq=test_RoCK(newal,n,multicharge)541if RoCKq==false: raise ValueError("This block isn't RoCK; the program must have a bug.")542minimal=false543while minimal==false:544reference=newal.copy()545#print(newal,"Going to test")546for i in range(n):547if alcheck(i,newal,n,Lambda)<0:548testal= act_on_roots(newal,n,Lambda,i)549RoCKq=test_RoCK(testal,n,multicharge)550#print(RoCKq,testal,newal)551if RoCKq:552newal = testal553#print(reference,newal)554if reference == newal: minimal=true555#print("That's minimal!")556return newal557558from itertools import permutations559560def all_RoCKs(al,n,multicharge):561r"""562Starts with a weight `\Lambda -\alpha` and finds a RoCK block for each Weyl chamber563564INPUT:565566- ``al`` -- a list of the coefficients of `\alpha` expressed as567a dictionary568- ``n`` -- the quantum characteristic569- ``multicharge`` -- the multicharge, expressing the content of the bottom boxes of the components570571EXAMPLES::572573"""574vector=[(n-1-i)/n for i in range(n)]575perm = list(permutations(vector))576newal=al.copy()577RoCKs={p:RoCK_weight(list(p),newal,n,multicharge) for p in perm}578return RoCKs579580581