#C20.txt Help:=proc(): print( `TabsBE(L,k), Wt(L,x), sLc(L,x), Coe(f,x,v) , sL(L,x) , TabsBEw(L,k,x) `): print(`sLcF(L,x) `): end: with(combinat): #ApplyPi(f,x,n,pi): inputs f, x, n, pi, where f is an expression in x[1],...,x[n] #pos. integer n, letter x, and a permutation pi of {1, ...,n}, applies x[i]->x[pi[i]] #to f ApplyPi:=proc(f,x,n,pi) local i: if nops(pi)<>n then RETURN(FAIL): fi: subs({seq(x[i]=x[pi[i]],i=1..n)},f): end: Rev:=proc(v) local i: [seq(v[nops(v)-i],i=0..nops(v)-1)]:end: #P(n): the list of (integer) partitons of n in non-increasing order P:=proc(n) local S,i: S:=partition(n): Rev([seq(Rev(S[i]),i=1..nops(S))]): end: #inv1(pi): the number of inversions of the permutation pi inv1:=proc(pi) local i,j,n,co: n:=nops(pi): co:=0: for i from 1 to n do for j from i+1 to n do if pi[i]>pi[j] then co:=co+1: fi: od: od: co: end: with(combinat): #AS(f,x,n): the anti-symmstrizer of the function f of x[1], ..., x[n] AS:=proc(f,x,n) local S: S:=permute(n): add((-1)^inv1(pi)* ApplyPi(f,x,n,pi),pi in S): end: #sL(L,x): Inputs an integer partition L (of n, say) and a letter x #outputs the Schur symmetric polynomial s_L(x1, ..., xn) sL:=proc(L,x) local n,L1, rich,i: n:=convert(L,`+`): L1:=[op(L),0$(n-nops(L))]: rich:=[seq(n-i,i=1..n)]: L1:=L1+rich: normal(AS(mul(x[i]^L1[i],i=1..n),x,n)/mul(mul(x[i]-x[j],j=i+1..n),i=1..n-1)): end: #sLm(L,M): s_L(x) in terms of the Monomial Symmetric Functions sLm:=proc(L,M) local n,x: n:=convert(L,`+`): ToM(sL(L,x),x,n,M): end: #sLe(L,E): s_L(x) in terms of the e-basis sLe:=proc(L,E) local n,x: n:=convert(L,`+`): ToE(sL(L,x),x,n,E): end: #################################################Start stuff from Brian## #written by Bryan Ek (who won a dollar in the contest for the fastest program) #Tabs1BE(L,k,maxLine): Inputs partition L, positive integer k>=nops(L) and maxLine. #Outputs the set of all (column-strict) tableaux of shape L using {1,..,k}. #k is guaranteed to be in the tableaux but must appear at or "below" the maxLine. Tabs1BE:=proc(L,k,maxLine) local n,S,i,L1: option remember: n:=nops(L): if kL[i+1] then L1:=[op(1..i-1,L),L[i]-1,op(i+1..n,L)]: S:=S union {seq([op(1..i-1,s1),[op(s1[i]),k],op(i+1..n,s1)],s1 in {seq(op(Tabs1BE(L1,j,1)),j=n..(k-1)),op(Tabs1BE(L1,k,i))})}: fi: od: if L[n]=1 then#i=n at this point. L1:=L[1..n-1]: S union {seq([op(s1),[k]],s1 in {seq(op(Tabs1BE(L1,j,1)),j=n-1..(k-1))})}: else L1:=[op(1..n-1,L),L[n]-1]: S union {seq([op(1..n-1,s1),[op(s1[n]),k]],s1 in {seq(op(Tabs1BE(L1,j,1)),j=n..(k-1)),op(Tabs1BE(L1,k,n))})}: fi: end: ############################## #TabsBE(L,k): Inputs partition L and positive integer k. k>=nops(L) otherwise you receive the emptyset. #Outputs the set of all (column-strict) tableaux of shape L using {1,..,k}. TabsBE:=proc(L,k): {seq(op(Tabs1BE(L,j,1)),j=nops(L)..k)}: end: ###end stuff from Brian Ek #Wt(L,x): the weight of a tableau L (the product of x[entry] over all entries) Wt:=proc(L,x) local i,j:mul(mul(x[L[i][j]],j=1..nops(L[i])),i=1..nops(L)): end: #sLc(L,x): the Schur polynomial s_L(x[1], ..., x[n]) (where n=size of L) using the #combinatorial definition sLc:=proc(L,x) local n, Bryan,b: n:=convert(L,`+`): Bryan:=TabsBE(L,n): add(Wt(b,x), b in Bryan): end: #Coe(f,x,v): inputs a polynomial f, in x[1], ..., x[n] (n=nops(v))and a vector v of length n #outputs the coeff. of x[1]^v[1]*... x[n]^v[n] Coe:=proc(f,x,v) local i,f1,n: n:=nops(v): f1:=f: for i from 1 to n do f1:=coeff(f1,x[i],v[i]): od: f1: end: ###weighted analog of TabsBE #################################################Start stuff from Brian## #Modifying Bryan Ek's code to do weighted version (who won a dollar in the contest for the fastest program) #Tabs1BEw(L,k,maxLine): Inputs partition L, positive integer k>=nops(L) and maxLine. #Outputs the set of all (column-strict) tableaux of shape L using {1,..,k}. #k is guaranteed to be in the tableaux but must appear at or "below" the maxLine. Tabs1BEw:=proc(L,k,maxLine,x) local n,S,i,L1: option remember: n:=nops(L): if kL[i+1] then L1:=[op(1..i-1,L),L[i]-1,op(i+1..n,L)]: #S:=S union {seq([op(1..i-1,s1),[op(s1[i]),k],op(i+1..n,s1)], # s1 in {seq(op(Tabs1BE(L1,j,1,x)),j=n..(k-1)),op(Tabs1BE(L1,k,i))})}: S:=S+x[k]*(add(Tabs1BEw(L1,j,1,x),j=n..k-1)+Tabs1BEw(L1,k,i,x)): fi: od: if L[n]=1 then #i=n at this point. L1:=L[1..n-1]: #S union {seq([op(s1),[k]],s1 in {seq(op(Tabs1BE(L1,j,1)),j=n-1..(k-1))})}: S+x[k]*add(Tabs1BEw(L1,j,1,x),j=n-1..k-1): else L1:=[op(1..n-1,L),L[n]-1]: #S union {seq([op(1..n-1,s1),[op(s1[n]),k]],s1 in {seq(op(Tabs1BE(L1,j,1)),j=n..(k-1)), #op(Tabs1BE(L1,k,n))})}: S+ x[k]*(add(Tabs1BEw(L1,j,1,x),j=n..k-1)+ Tabs1BEw(L1,k,n,x)): fi: end: ############################## #TabsBEw(L,k,x): Inputs partition L and positive integer k. k>=nops(L) otherwise you receive the emptyset. #Outputs the Schur polynomial s_L(x[1], ..., x[k]) TabsBEw:=proc(L,k,x): #{seq(op(Tabs1BE(L,j,1)),j=nops(L)..k)}: expand(add(Tabs1BEw(L,j,1,x),j=nops(L)..k)): end: ###end stuff from Brian Ek weighted sLcF:=proc(L,x) : TabsBEw(L,convert(L,`+`),x):end: