#########Version of Sept. 7, 2004 ###################################################################### ##QuantumMACMAHON: Save this file as QuantumMACMAHON: . # #To use it, stay in the # ##same directory, get into Maple (by typing: maple ) # ##and then type: read QuantumMACMAHON : # ##Then follow the instructions given there # ## # ##Written by Doron Zeilberger, Rutgers University , # #zeilberg@math.rutgers.edu. # ###################################################################### #Created: March 11, 2003 #This version: Sept. 7 , 2004 #qMM: A Maple package to study Stavros Garoufalidis's #conjectured Quantum-analog of MacMahon's Master Theorem #Please report bugs to zeilberg@math.rutgers.edu with(combinat): print(`Created: Sept. 4, 2004.`): print(`This version: Sept. 4, 2004 )`): print(``): print(`QuantumMACMAHON: A Maple package to study the `): print(`conjectured Quantum-analog of MacMahon's Master Theorem`): print(``): print(`Written by Doron Zeilberger, zeilberg@math.rutgers.edu`): print(``): print(`Please report bugs to zeilberg@math.rutgers.edu`): print(``): print(`The most current version of this package and paper`): print(` are available from`): print(`http://www.math.rutgers.edu/~zeilberg/`): print(`For a list of the procedures type ezra();, for help with`): print(`a specific procedure, type ezra(procedure_name);`): print(``): ezra:=proc() if args=NULL then print(` AddCycle, ApplyOperOld, Begin1, ConjLHS, ConjOperOld,`): print(` F, Flows, GuessLHS, GaussP, GenLHS,`): print(` Mishkal, Mult, MultT, OSS, Simplify1 , Stavros, ProveqMM`): fi: if nops([args])=1 and op(1,[args])=ProveqMM then print(`ProveqMM(r): Rigorously proves the Quantum MacMahon Master Theorem`): print(`for dimension r. If the output is the empty list, then it is proved`): print(`For example, try: ProveqMM(2); `): fi: if nops([args])=1 and op(1,[args])=AddCycle then print(`AddCycle(M,cyc1): Given a flow-matrix M, and a cycle cyc1`): print(`adds unit flow from cyc1 to M`): fi: if nops([args])=1 and op(1,[args])=ApplyOperOld then print(`ApplyOperOld(m0,q,x): Applies the conj. LHS operator to`): print(`F(m,x) at m=m0. For example, try: ApplyOperOld([1,1],q,x)`); fi: if nops([args])=1 and op(1,[args])=Begin1 then print(`Begin1(r,N,q): All the terms of the RHS for the r-dim case`): print(`of degree<=N`): fi: if nops([args])=1 and op(1,[args])=ConjLHS then print(`ConjLHS(r,q): The conjectured LHS of Starvros Garoufalidis's`): print(`conj. for dimension r,`): print(`For example, try: ConjLHS(3,q)`): fi: if nops([args])=1 and op(1,[args])=ConjOperOld then print(`ConjOperOld(r,q,t):`): prit(` The conjectured Operator (t[i]: neg. shift in m_i)`): print(`that annihilates the RHS (conj. by Stavros Garoufalidis)`): fi: if nops([args])=1 and op(1,[args])=F then print(`F(m,q,x): Given a list of non-negative integers m (of length r, say)`): print(`forms (x[1]*b[1,1]+ x[2]*b[1,2]+...)^m1*`): print(`(x[1]*b[1,1]+ x[2]*b[1,2]+...)^m[1]*`): print(`(x[1]*b[2,1]+ x[2]*b[2,2]+...)^m[2]* ...`): print(`(x[1]*b[r,1]+ x[2]*b[r,2]+...)^m[r] in the`): fi: if nops([args])=1 and op(1,[args])=Flows then print(`Flows(r,N): All the r by r flow-matrices that add up to N `): fi: if nops([args])=1 and op(1,[args])=GaussP then print(`GaussP(List1,q): [List[1]+...+List1[r]]/[List[1]]!...`): print(`For example, try GaussP([1,1,1],q)`); fi: if nops([args])=1 and op(1,[args])=GaussP2 then print(`GaussP2(a,b,q): The q-analog of binomial(a+b,b) `): fi: if nops([args])=1 and op(1,[args])=GenLHS then print(`GenLHS(r,c): The generic LHS for dimension r, with coeffs.`): print(`c[i]'s followed by the set of coeffs.`): fi: if nops([args])=1 and op(1,[args])=GuessLHS then print(`GuessLHS(r,N,q): Finds empricially the LHS of Starvros Garoufalidis's`): print(`conj. for dimension r, and checks it up to degree N`): print(`For example, try: GuessLHS(2,3,q)`): fi: if nops([args])=1 and op(1,[args])=Mishkal then print(`Mishkal(M,q): The weight of the flow-matrix M in terms of`): print(`[i,j] and q (in canonical form)`): fi: if nops([args])=1 and op(1,[args])=Mult then print(`Mult(List1,List2,q): The product of two expressions`): fi: if nops([args])=1 and op(1,[args])=MultT then print(`MultT(List1,List2,N,q): The product of two expressions`): print(`truncated up to degree <=N `): fi: if nops([args])=1 and op(1,[args])=OSS then print(`OSS(Resh,q): The simplification of a Quantum expression,`): print(`in r dimensions given as a list of`): print(`[coe,Li] using the quantum commutation relations`): fi: if nops([args])=1 and op(1,[args])=OSS1 then print(`OSS1(term1,q): The simplification of one term,`): print(`[coe,Li] using the quantum commutation relations`): print(`returns a list of length 2`): fi: if nops([args])=1 and op(1,[args])=Simplify1 then print(`Simplify1(Resh,q): Simplifies an expression Resh`): print(`In the r-dim Quantum Alg. `): fi: if nops([args])=1 and op(1,[args])=Stavros then print(`Stavros(r,N): Checks Stavros Garofualidis's conjectured q-analog`): print(`of MacMahon's Master Theorem for dimension r up to degree N`): fi: end: GaussP2:=proc(a,b,q) local gu,i: gu:=1: for i from 1 to b do gu:=gu*(1-q^(a+b-i+1))/(1-q^i): od: expand(normal(gu)): end: #GaussP(Resh,q): Multi-Gaussian GaussP:=proc(Resh,q) local gu,Resh1,n: n:=nops(Resh): if n=0 or n=1 then RETURN(1): fi: if n=2 then RETURN(GaussP2(op(Resh),q)): fi: Resh1:=[op(1..n-1,Resh)]: gu:=GaussP(Resh1,q): expand(gu*GaussP2(convert(Resh1,`+`),Resh[n],q)): end: #AddCycle(M,cyc1): Given a flow-matrix M, and a cycle cyc1 #adds unit flow from cyc1 to M AddCycle:=proc(M,cyc1) local M1,i1,j1,n: n:=nops(M): for i1 from 1 to n do for j1 from 1 to n do M1[i1,j1]:=M[i1][j1]: od: od: for i1 from 1 to nops(cyc1)-1 do M1[cyc1[i1],cyc1[i1+1]]:=M1[cyc1[i1],cyc1[i1+1]]+1: od: M1[cyc1[nops(cyc1)],cyc1[1]]:=M1[cyc1[nops(cyc1)],cyc1[1]]+1: [seq([ seq(M1[i1,j1],j1=1..n)],i1=1..n)]: end: #AllCycles(n): All the cycles in {1,2, ..., n} that contain n in them AllCycles:=proc(n) local gu,i,i1: gu:=[]: for i from 0 to n-1 do gu:=[op(gu), op(permute([seq(i1,i1=1..n-1)],i))]: od: [seq([op(gu[i1]),n],i1=1..nops(gu))]: end: #Flows(r,N): All r by r flow matrices that add up to N Flows:=proc(r,N) local gu,mu,mu1,i1,i2,ku: if N<0 then RETURN({}): fi: if r=1 then RETURN({[[N]]}): fi: mu:=Flows(r-1,N): gu:={}: for i1 from 1 to nops(mu) do mu1:=mu[i1]: mu1:=[seq([op(mu1[i2]),0],i2=1..r-1),[0$r]]: gu:=gu union {mu1}: od: ku:=AllCycles(r): for i1 from 1 to nops(ku) do mu:=Flows(r,N-nops(ku[i1])): gu:=gu union {seq(AddCycle(mu[i2],ku[i1]),i2=1..nops(mu))}: od: gu: end: #Mishkal(M,q): The weight of the flow-matrix M in terms of #[i,j] and q (in canonical form) Mishkal:=proc(M,q) local gu,i1,j1,r,mu,lu,i2,j2: r:=nops(M): gu:=[]: for i1 from 1 to r do for j1 from 1 to r do gu:=[op(gu),[i1,j1]$M[i1][j1]]: od: od: gu: mu:=expand(convert([seq(GaussP(M[i1],q^2),i1=1..r)],`*`)): lu:=0: for i1 from 1 to r do for i2 from i1+1 to r do for j1 from 1 to r do for j2 from j1+1 to r do lu:=lu+M[i1][j2]*M[i2][j1]: od: od: od: od: mu:=expand(mu*q^lu): [mu,gu]: end: #Begin1(r,N,q): All the terms of the RHS for the r-dim case #of degree<=N Begin1:=proc(r,N,q) local gu,mu,n,i1: mu:=[]: for n from 0 to N do gu:=Flows(r,n): for i1 from 1 to nops(gu) do mu:=[op(mu),Mishkal(gu[i1],q)]: od: od: mu: end: #OSS1(term1,q): The simplification of one term, #[coe,Li] using the quantum commutation relations #returns a list of length 2 OSS1:=proc(term1,q) local a1,coe1,Resh,i1,j1,i2,j2: coe1:=term1[1]: Resh:=term1[2]: for a1 from 1 to nops(Resh)-1 do i1:=Resh[a1][1]: j1:=Resh[a1][2]: i2:=Resh[a1+1][1]: j2:=Resh[a1+1][2]: if (i1=i2 and j1>j2) or (j1=j2 and i1>i2) then RETURN([[coe1*q,[op(1..a1-1,Resh),Resh[a1+1],Resh[a1], op(a1+2..nops(Resh),Resh)]]]): elif (i1>i2 and j1i2 and j1>j2) then RETURN([ [coe1,[op(1..a1-1,Resh),Resh[a1+1],Resh[a1],op(a1+2..nops(Resh),Resh)]], [(q-1/q)*coe1, [op(1..a1-1,Resh),[i2,j1],[i1,j2],op(a1+2..nops(Resh),Resh)]] ]): fi: od: [term1]: end: #OSS(Resh,q): Given an expression Resh performs one step in #the simplification to each term OSS:=proc(Resh,q) local gu,i1: gu:=[]: for i1 from 1 to nops(Resh) do gu:=[op(gu),op(OSS1(Resh[i1],q))]: od: FSimp(gu): end: #FSimp(SetTerms): The final simplification of an expression FSimp:=proc(SetTerms) local kv,i1,T,term1,gu: kv:={seq(SetTerms[i1][2],i1=1..nops(SetTerms))}: for i1 from 1 to nops(kv) do T[kv[i1]]:=0: od: for i1 from 1 to nops(SetTerms) do term1:=SetTerms[i1]: T[term1[2]]:=expand(T[term1[2]]+term1[1]): od: gu:=[]: for i1 from 1 to nops(kv) do if T[kv[i1]]<>0 then gu:=[op(gu),[T[kv[i1]],kv[i1]]]: fi: od: gu: end: Simplify1:=proc(Resh,q) local Resh1,Resh2: Resh1:=Resh: Resh2:=OSS(Resh1,q): while Resh2<>Resh1 do Resh1:=Resh2: Resh2:=OSS(Resh2,q): od: Resh2: end: #Mult(List1,List2,a,b,c,d,q): The product of two expressions Mult:=proc(Set1,Set2,q) local gu,i1,i2,term1,term2: gu:=[]: for i1 from 1 to nops(Set1) do term1:=Set1[i1]: for i2 from 1 to nops(Set2) do term2:=Set2[i2]: gu:=[op(gu), [term1[1]*term2[1],[op(term1[2]),op(term2[2])]]]: od: od: FSimp(Simplify1(gu,q)): end: #PartPermss(n): All the part-perms in standard notation PartPerms:=proc(n) local gu,i,mu,mu1,lu,j,k: mu:=powerset([seq(i,i=1..n)]): gu:=[]: for i from 1 to nops(mu) do mu1:=mu[i]: lu:=permute(mu1): for k from 1 to nops(lu) do gu:=[op(gu),[seq([mu1[j],lu[k][j]],j=1..nops(mu1))]]: od: od: gu: end: #GenLHS(r,c): The generic LHS for dimension r, with coeffs. #c[i]'s followed by the set of coeffs. GenLHS:=proc(r,c) local gu,lu,i,var: lu:=PartPerms(r): gu:=[]: var:={}: for i from 1 to nops(lu) do gu:=[op(gu),[c[i],lu[i]]]: var:=var union {c[i]}: od: gu,var: end: #MultT(List1,List2,N,q): The product of two expressions #but truncated for degree<=N MultT:=proc(Set1,Set2,N,q) local gu,i1,i2,term1,term2: gu:=[]: for i1 from 1 to nops(Set1) do term1:=Set1[i1]: for i2 from 1 to nops(Set2) do term2:=Set2[i2]: if nops(term1[2])+nops(term2[2])<=N then gu:=[op(gu), [term1[1]*term2[1],[op(term1[2]),op(term2[2])]]]: fi: od: od: FSimp(Simplify1(gu,q)): end: #GuessLHS(r,N,q): Finds empricially the LHS of Starvros Garoufalidis's #conj. for dimension r and checks it up to degree N GuessLHS:=proc(r,N,q) local lu,var,mu,c,var1,i,gu,eq: lu:=GenLHS(r,c): var:=lu[2]: lu:=lu[1]: mu:=Begin1(r,r+1,q): gu:=MultT(lu,mu,r+1,q): eq:={}: for i from 1 to nops(gu) do if gu[i][2]<>[] then eq:=eq union {expand(gu[i][1])}: else eq:=eq union {expand(gu[i][1]-1)}: fi: od: var1:=solve(eq,var): lu:=subs(var1,lu): mu:=Begin1(r,N,q): gu:=MultT(lu,mu,N,q): if gu<>[[1,[]]] then print(`Does not work`,gu): fi: lu: end: Inv1:=proc(per) local i,j,lu,per1: per1:=[seq(per[i][2],i=1..nops(per))]: lu:=0: for i from 1 to nops(per1) do for j from i+1 to nops(per1) do if per1[i]>per1[j] then lu:=lu+1: fi: od: od: lu: end: Inv2:=proc(per1) local i,j,lu: lu:=0: for i from 1 to nops(per1) do for j from i+1 to nops(per1) do if per1[i]>per1[j] then lu:=lu+1: fi: od: od: lu: end: #ConjLHS(r,q): The conjectured LHS of quantum MacMahon's Master #conj. by Stavros Garoufalidis ConjLHS:=proc(r,q) local gu,i,mu,coe: mu:=PartPerms(r): gu:=[]: for i from 1 to nops(mu) do coe:=(-1/q)^Inv1(mu[i])*(-1)^nops(mu[i]): gu:=[op(gu),[coe,mu[i]]]: od: gu: end: #Stavros(r,N): Checks Stavros Garofualidis's conjectured q-analog #of MacMahon's Master Theorem for dimension r up to degree N Stavros:=proc(r,N) local q: evalb(MultT(ConjLHS(r,q),Begin1(r,N,q),N,q)=[[1,[]]]): end: #ConjOperOld(r,q,t): The conjectured Operator (t[i]: neg. shift in m_i) #that annihilates the RHS (conj. by Stavros Garoufalidis) ConjOperOld:=proc(r,q,t) local gu,i,mu,coe,j1: mu:=PartPerms(r): gu:=[]: for i from 1 to nops(mu) do coe:=(-1/q)^Inv1(mu[i])*(-1)^nops(mu[i]): coe:=coe*convert( [seq(t[mu[i][j1][1]],j1=1..nops(mu[i]))],`*`): gu:=[op(gu),[coe,mu[i]]]: od: gu: end: #F(m,q,x): Given a list of non-negative integers m (of length r, say) #forms (x[1]*b[1,1]+ x[2]*b[1,2]+...)^m1* #(x[1]*b[1,1]+ x[2]*b[1,2]+...)^m[1]* #(x[1]*b[2,1]+ x[2]*b[2,2]+...)^m[2]* ... #(x[1]*b[r,1]+ x[2]*b[r,2]+...)^m[r] in the #Quantum Algebra (the x's compute with everything) F:=proc(m,q,x) local r,lu,m1,mu,i1,j1: r:=nops(m): for i1 from 1 to r while m[i1]<>0 do od: i1:=i1-1: if i1=0 then RETURN([[1,[]]]): fi: m1:=[op(1..i1-1,m),m[i1]-1,0$(r-i1)]: lu:=F(m1,q,x): mu:= [seq([x[j1]/x[i1],[[i1,j1]]],j1=1..r)]: Simplify1(Mult(lu,mu,q),q): end: ApplyOperOld:=proc(m,q,x) local t,mu,gu,i1,coe,r,m1,i2,ku,coe1,lu: r:=nops(m): mu:=ConjOperOld(r,q,t): gu:=[]: for i1 from 1 to nops(mu) do coe:=mu[i1][1]: lu:=[seq(degree(coe,t[i2]),i2=1..r)]: coe1:=normal(coe/convert([seq(t[i2]^lu[i2],i2=1..r)],`*`)): m1:=[seq(m[i2]-lu[i2],i2=1..r)]: ku:=F(m1,q,x): ku:=Mult([[coe1, mu[i1][2]]],ku,q): gu:=[op(gu),op(ku)]: gu:=FSimp(gu): od: gu: end: ###New stuff ez:=proc():print(`qdet(r,q),qdet1(r,q),qdetIJ(I,J,q),qdet1IJ(I,J,q)`): print(`Fact1(r), Fact3(r), Multx(Set1,Set2,q)`): print(`Multx1(Resh1,Resh2,q), Xir(i,r), Yafe(Resh,a,x) `): print(`Fact1ijr(i,j,r), Hm(m,q)`): print(`CtHm(m,q), Comp1(N,r), Begin1slow(r,N,q) `): print(`Add1(Resh1,Resh2,q), Add1x(Resh1,Resh2,q) `): print(`ApplyOperMono1(Mono,M,m0,q,L)`): print(`ApplyOperMono(Mono,M,m0,q,L)`): print(`ApplyOper(Resh,M,m0,q,L)`): print(`ConjOper(r,q,t), ApplyStavros(m0,L), CoeHm(m,q,L) `): print(`ConjOperM(r,q,M)`): print(`ApplyOperMono1x(Mono,M,m0,q)`): print(`ApplyOperMonox(Mono,M,m0,q)`): print(`ApplyOperx(Resh,M,m0,q)`): print(`ConjOperx(r,q,t), ApplyStavrosx(m0) `): print(`Pir(i,r,m,M,q)`): print(`MiH(i,r,q,m)`): print(`MiHlist(L1,r,q,m)`): end: qdet:=proc(r,q) local gu,mu,i,i1: with(combinat): mu:=permute(r): gu:=[]: for i from 1 to nops(mu) do gu:=[op(gu),[(-1/q)^Inv2(mu[i]),[seq([i1,mu[i][i1]],i1=1..r)]]]: od: gu: end: qdetIJ:=proc(I1,J1,q) local gu,mu,i,r,i1: with(combinat): r:=nops(I1): if nops(J1)<>r then ERROR(`Bad input`): fi: mu:=permute(r): gu:=[]: for i from 1 to nops(mu) do gu:=[op(gu),[(-1/q)^Inv2(mu[i]),[seq([I1[i1],J1[mu[i][i1]]],i1=1..r)]]]: od: gu: end: qdet1:=proc(r,q) local gu,mu,i,i1: with(combinat): mu:=permute(r): gu:=[]: for i from 1 to nops(mu) do gu:=[op(gu),[(-1/q)^Inv2(mu[i]),[seq([mu[i][i1],i1],i1=1..r)]]]: od: gu: end: qdet1IJ:=proc(I1,J1,q) local gu,mu,i,r,i1: with(combinat): r:=nops(I1): if nops(J1)<>r then ERROR(`Bad input`): fi: mu:=permute(r): gu:=[]: for i from 1 to nops(mu) do gu:=[op(gu),[(-1/q)^Inv2(mu[i]),[seq([I1[mu[i][i1]],J1[i1]],i1=1..r)]]]: od: gu: end: AreEq:=proc(Resh1,Resh2) evalb({op(Resh1)}={op(Resh2)}): end: #Fact3(r): checks Fact 4 Fact3:=proc(r) local gu,i,I1,J1,i1,mu1,q,mu: gu:=[]: for i from 1 to r do I1:=[seq(i1,i1=1..i-1),seq(i1,i1=i+1..r)]: J1:=[seq(i1,i1=1..r-1)]: mu:=qdet1IJ(I1,J1,q): mu1:=[ [(-q)^(i-r),[[i,r]]] ]: gu:=[op(gu), op(Mult(mu,mu1,q))]: gu:=FSimp(Simplify1(gu,q)): od: AreEq(gu,FSimp(Simplify1(qdet1(r,q),q))): end: #Multx(List1,List2,a,b,c,d,q): The product of two expressions with x's Multx:=proc(Set1,Set2,q) local gu,i1,i2,term1,term2,ku: gu:=[]: for i1 from 1 to nops(Set1) do term1:=Set1[i1]: for i2 from 1 to nops(Set2) do term2:=Set2[i2]: ku:=Multx1(term1[3],term2[3],q) : gu:=[op(gu), [ku[1]*term1[1]*term2[1],[op(term1[2]),op(term2[2])], ku[2]]] : od: od: FSimpx(Simplify1x(gu,q)) end: #Multx1(Resh1,Resh2,q) product of x[1]^Resh1[1]...x[r]^Resh1[r] #and x[1]^Resh2[1]...x[r]^Resh2[r] in terms of the coeff. followed #by the sum-list Multx1:=proc(Resh1,Resh2,q) local mu,i1,j1,r: r:=nops(Resh1); if nops(Resh2)<>r then ERROR(`Bad input`): fi: mu:=0: for i1 from 1 to r do for j1 from 1 to i1-1 do mu:=mu+Resh1[i1]*Resh2[j1]: od: od: q^mu,[seq(Resh1[i1]+Resh2[i1],i1=1..r)]: end: #FSimpx(SetTerms): The final simplification of an expression FSimpx:=proc(SetTerms) local kv1,i1,T,term1,gu,kv2,i2: kv1:={seq(SetTerms[i1][2],i1=1..nops(SetTerms))}: kv2:={seq(SetTerms[i1][3],i1=1..nops(SetTerms))}: for i1 from 1 to nops(kv1) do for i2 from 1 to nops(kv2) do T[kv1[i1],kv2[i2]]:=0: od: od: for i1 from 1 to nops(SetTerms) do term1:=SetTerms[i1]: T[term1[2],term1[3]]:=expand(T[term1[2],term1[3]]+term1[1]): od: gu:=[]: for i1 from 1 to nops(kv1) do for i2 from 1 to nops(kv2) do if T[kv1[i1],kv2[i2]]<>0 then gu:=[op(gu),[T[kv1[i1],kv2[i2]],kv1[i1],kv2[i2]]]: fi: od: od: gu: end: Simplify1x:=proc(Resh,q) local Resh1,Resh2: Resh1:=Resh: Resh2:=OSSx(Resh1,q): while Resh2<>Resh1 do Resh1:=Resh2: Resh2:=OSSx(Resh2,q): od: Resh2: end: #OSSx(Resh,q): Given an expression Resh performs one step in #the simplification to each term with x OSSx:=proc(Resh,q) local gu,i1: gu:=[]: for i1 from 1 to nops(Resh) do gu:=[op(gu),op(OSS1x(Resh[i1],q))]: od: FSimpx(gu): end: #OSS1x(term1,q): The simplification of one term, #[coe,Li] using the quantum commutation relations #returns a list of length 2, in terms of x OSS1x:=proc(term1,q) local a1,coe1,Resh,i1,j1,i2,j2,Reshx: coe1:=term1[1]: Resh:=term1[2]: Reshx:=term1[3]: for a1 from 1 to nops(Resh)-1 do i1:=Resh[a1][1]: j1:=Resh[a1][2]: i2:=Resh[a1+1][1]: j2:=Resh[a1+1][2]: if (i1=i2 and j1>j2) or (j1=j2 and i1>i2) then RETURN([[coe1*q,[op(1..a1-1,Resh),Resh[a1+1],Resh[a1], op(a1+2..nops(Resh),Resh)],Reshx]]): elif (i1>i2 and j1i2 and j1>j2) then RETURN([ [coe1,[op(1..a1-1,Resh),Resh[a1+1],Resh[a1],op(a1+2..nops(Resh),Resh)], Reshx], [(q-1/q)*coe1, [op(1..a1-1,Resh),[i2,j1],[i1,j2],op(a1+2..nops(Resh),Resh)] ,Reshx]]): fi: od: [term1]: end: Xir:=proc(i,r) local gu,mu,j: gu:=[]: for j from 1 to r do mu:=[1,[[i,j]],[0$(j-1),1,0$(r-j)]]: gu:=[op(gu),mu]: od: gu: end: #Yafe(Resh,a,x): Resh in a human way Yafe:=proc(Resh,a,x) local gu,mu,i,i1: gu:=0: for i from 1 to nops(Resh) do mu:=Resh[i]: gu:=gu+mu[1]*convert([seq(a[op(mu[2][i1])],i1=1..nops(mu[2]))],`*`) *convert([seq(x[i1]^mu[3][i1],i1=1..nops(mu[3]))],`*`): od: gu: end: Fact1ijr:=proc(i,j,r) local gu1,gu2,mu1,mu2,q: if not (1<=i and i3 then ERROR(`Bad input`): fi: if not type(Mono[3],list) then ERROR(`Bad input`): fi: r:=nops(Mono[3]): coe:=Mono[1]: if type(coe,`+`) then ERROR(`Coefficients can't be sums`): fi: Resh:=[]: for i from 1 to r do if degree(coe,M[i])=1 then Resh:=[op(Resh),i]: elif degree(coe,M[i])<>0 then ERROR(`Something is wrong`): fi: od: gu:=MiHlist(Resh,r,q,m): coe:=normal(coe/convert([seq(M[i]^degree(coe,M[i]),i=1..r)],`*`)): Mono1:=[coe,Mono[2],Mono[3]]: Multx([Mono1],gu,q): end: ApplyOperS:=proc(Resh,q,m,M) local gu,i: gu:=[]: for i from 1 to nops(Resh) do gu:=Add1x(ApplyOperSm(Resh[i],q,m,M),gu,q): od: gu: end: #ProveqMM(r): applies the Stavros operator, symbolically #toH(m,x) #For example, try: ProveqMM(2): ProveqMM:=proc(r) local q,M,m: evalb([]=ApplyOperS(ConjOperM(r,q,M),q,m,M)): end: