########## # File @(#) ToXfix (FM PACKAGE) Fri Mar 8 11:47:04 MET 1996 ########## interface(verboseproc=0); # # ToXfix(pol,b) expresses pol on the X basis assuming that pol is expressed solely in # terms of the base b (x, X, Y). # Whenever the second argument is forgotten # no suppositions are made on the bases appearing in pol. # pol is expanded before any computation except when the argument # noexpand specifies that no expansion should be done. # The result is NOT collected with respect to X[...], ... # # exprime pol sur la base X en considerant pol comme exprime uniquement # sur la base b (x, X, Y). Si le deuxieme argument manque, # aucune supposition n'est faite quant aux bases apparaissant dans # l'expression de pol. # pol est etendu sauf si l'argument noexpand specifie le contraire. # Le resultat n'est PAS collecte par rapport a X[...], ... # # SV080396 SV290797 SV311098 `FM/ToXfix/heart`:=proc(pol) local i, # indices of a table... j, # variable for loop... k, # variable for sequence... ind, # indices... r, # the result... u, # temporary result... t; # a table representing a monomial... global _FMn, # cardinal of the alphabet... FMBases; # known bases... if (nargs=1) then if (type(pol,`+`)) then # we convert each monomial... RETURN(map(`FM/ToXfix/heart`,pol)) fi; # this is a monomial... t:=`FM/Monomial`(pol,FMBases); if ({indices(t)} minus {['coeff']} = {['X']}) then # we have only some X... r:=t['coeff']; t['coeff']:='t[coeff]'; r:=r*`FM/Xmonom2Xfix`(t['X']); RETURN(`FM/Collect`(r)) elif (not assigned(t['Y'])) then # we treat the table... ind:=indices(t); for i in ind do if (op(i)='coeff') then next elif (op(i)='x') then t['x']:=`FM/x2Xfix`(t['x']) elif (op(i)='X') then t['X']:=`FM/Xmonom2Xfix`(t['X']) fi od; r:=t['coeff']; t['coeff']:='t[coeff]'; if (ind=['coeff']) then RETURN(r) else r:=r*`FM/ToXfix/heart`(expand(convert(map(op,[entries(t)]),`*`))); RETURN(`FM/Collect`(r)) fi elif (type(t['Y'],indexed)) then # we treat the table... for i in indices(t) do if (op(i)='coeff') then next elif (op(i)='x') then t['x']:=`FM/x2Xfix`(t['x']) elif (op(i)='X') then t['X']:=`FM/Xmonom2Xfix`(t['X']) elif (op(i)='Y') then t['Y']:=`FM/X2Xfix`(`SP/Y2X`(t['Y'],noexpand)) fi od; r:=t['coeff']; t['coeff']:='t[coeff]'; r:=r*`FM/ToXfix/heart`(expand(convert(map(op,[entries(t)]),`*`))); RETURN(`FM/Collect`(r)) elif (type(t['Y'],`^`)) then # we treat the table... for i in indices(t) do if (op(i)='coeff') then next elif (op(i)='x') then t['x']:=`FM/x2Xfix`(t['x']) elif (op(i)='X') then t['X']:=`FM/Xmonom2Xfix`(t['X']) elif (op(i)='Y') then t['Y']:=`FM/Xmonom2Xfix`(`SP/Y2X`(op(1,t['Y']),noexpand)^(op(2,t['Y']))) fi od; r:=t['coeff']; t['coeff']:='t[coeff]'; r:=r*`FM/ToXfix/heart`(expand(convert(map(op,[entries(t)]),`*`))); RETURN(`FM/Collect`(r)) else # t['Y'] is a product of Y Schubert polynomials... for i in indices(t) do if (op(i)='coeff') then next elif (op(i)='x') then t['x']:=`FM/x2Xfix`(t['x']) elif (op(i)='X') then t['X']:=`FM/Xmonom2Xfix`(t['X']) elif (op(i)='Y') then t['Y']:=`FM/Xmonom2Xfix`(map(`SP/Y2X`,t['Y'],noexpand)) fi od; r:=t['coeff']; t['coeff']:='t[coeff]'; r:=r*`FM/ToXfix/heart`(expand(convert(map(op,[entries(t)]),`*`))); RETURN(`FM/Collect`(r)) fi else if (not member(args[2],FMBases)) then ERR['FMPerror'](11,procname) fi; if (args[2]='X') then if (nargs >= 3 and args[3]='collect') then # we collect the result... RETURN(`FM/Collect`(pol)) fi; RETURN(pol) fi; if (type(pol,`+`)) then # we convert each monomial... RETURN(map(`FM/ToXfix/heart`,args[1..nargs])) fi; # this is a monomial... t:=`FM/Monomial`(pol,args[2]); # pol is solely expressed on args[2] basis... if (args[2]='x') then if (assigned(t[args[2]])) then r:=t['coeff']*`FM/x2Xfix`(t[args[2]]) else r:=convert(map(op,[entries(t)]),`*`) fi; if (nargs >= 3 and args[3]='collect') then # we collect the result... RETURN(`FM/Collect`(r)) fi; RETURN(r) elif (args[2]='Y') then if (assigned(t[args[2]])) then if (type(t[args[2]], 'indexed')) then r:=t['coeff']*`FM/X2Xfix`(`SP/Y2X`(t[args[2]])) else r:=t['coeff']*`FM/Xmonom2Xfix`(map(`SP/Y2X`, t[args[2]])) fi else r:=convert(map(op,[entries(t)]),`*`) fi; if (nargs >= 3 and args[3]='collect') then # we collect the result... RETURN(`FM/Collect`(r)) fi; RETURN(r) fi fi end; # # Xmonom2Xfix(sp) from a product of Schubert polynomials of Sn to the X basis. # # d'un produit de polynomes de Schubert de Sn a la base X. # # SV290496 SV060398 `FM/Xmonom2Xfix`:=proc(sp) local save_CLGn, # _CLGn... save_Sn, # _Sn... i, # variable for loop... t, # a table... ta, # a table... flag, # a flag... r; # the result... global _FMn, # cardinal of the alphabet... _CLGn, # degree of the linear group... _Sn; # fixed degree of the symmetric group... t:=cat(`FM/data/XmXfix`, _FMn); if (type(t, table)) then # this is the case where the table of pre-computed data is loaded... if (type(sp, indexed)) then RETURN(sp) elif (type(sp, `^`)) then save_Sn:=_Sn; `SP/Flag`(-1, 'dontforget'); r:=op(1, sp); for i from 2 to op(2, sp) do if (type(r, indexed)) then if (assigned(t[ [op(r)], [op(op(1, sp))] ])) then r:=t[ [op(r)], [op(op(1, sp))] ] else r:=t[ [op(op(1, sp))], [op(r)] ] fi elif (type(r, `*`)) then r:=map(proc(mono, perm, t) if (type(mono, `indexed`)) then if (op(0, mono)=`X`) then if (assigned(t[ [op(mono)], perm ])) then RETURN(t[ [op(mono)], perm ]) else RETURN(t[ perm, [op(mono)] ]) fi fi; RETURN(mono) fi; RETURN(mono) end, r, [op(op(1, sp))], t); r:=`CLG/Tos_n`(r) else # r is a sum...because it can't be a `^`... r:=map(proc(mono, perm, t) map(proc(mono, perm, t) if (type(mono, `indexed`)) then if (op(0, mono)=`X`) then if (assigned(t[ [op(mono)], perm ])) then RETURN(t[ [op(mono)], perm ]) else RETURN(t[ perm, [op(mono)] ]) fi fi; RETURN(mono) fi; RETURN(mono) end, mono, perm, t) end, r, [op(op(1, sp))], t); r:=`CLG/Tos_n`(r) fi od; `SP/Flag`(save_Sn, 'dontforget'); RETURN(r) else save_Sn:=_Sn; `SP/Flag`(-1, 'dontforget'); flag:=false; for i from 1 to nops(sp) do if (type(op(i, sp), `^`)) then flag:=true; break fi od; if (flag) then RETURN(`FM/ToXfix/heart`( expand(map(`FM/Xmonom2Xfix`, sp)) )) fi; r:=op(1, sp); for i from 2 to nops(sp) do if (type(r, indexed)) then if (assigned(t[ [op(r)], [op(op(i, sp))] ])) then r:=t[ [op(r)], [op(op(i, sp))] ] else r:=t[ [op(op(i, sp))], [op(r)] ] fi elif (type(r, `*`)) then r:=map(proc(mono, perm, t) if (type(mono, `indexed`)) then if (op(0, mono)=`X`) then if (assigned(t[ [op(mono)], perm ])) then RETURN(t[ [op(mono)], perm ]) else RETURN(t[ perm, [op(mono)] ]) fi fi; RETURN(mono) fi; RETURN(mono) end, r, [op(op(i, sp))], t); r:=`CLG/Tos_n`(r) else # r is a sum...because it can't be a `^`... r:=map(proc(mono, perm, t) map(proc(mono, perm, t) if (type(mono, `indexed`)) then if (op(0, mono)=`X`) then if (assigned(t[ [op(mono)], perm ])) then RETURN(t[ [op(mono)], perm ]) else RETURN(t[ perm, [op(mono)] ]) fi fi; RETURN(mono) fi; RETURN(mono) end, r, perm, t) end, r, [op(op(i, sp))], t); r:=`CLG/Tos_n`(r) fi od; `SP/Flag`(save_Sn, 'dontforget'); RETURN(r) fi else # this is the case where the table of pre-computed data is not loaded... save_Sn:=_Sn; `SP/Flag`(-1, 'dontforget'); r:=`SP/ToX/heart`(sp); `SP/Flag`(save_Sn, 'dontforget'); RETURN(`FM/X2Xfix`(r)) fi end; # # SV290496 `FM/ToXfix`:=proc(pol) if (nargs=1) then RETURN(`FM/ToXfix/heart`(expand(pol))) elif (nargs=2) then if (args[2]='noexpand') then RETURN(`FM/ToXfix/heart`(pol)) elif (args[2]='collect') then RETURN(`FM/ToXfix/heart`(`FM/ToXfix/heart`(expand(pol)),'X',collect)) fi; RETURN(`FM/ToXfix/heart`(expand(pol),args[2])) elif (nargs=3) then if (args[2]='noexpand') then if (args[3]='collect') then RETURN(`FM/ToXfix/heart`(`FM/ToXfix/heart`(pol),'X',collect)) fi; RETURN(`FM/ToXfix/heart`(pol,args[3])) elif (args[3]='collect') then RETURN(`FM/ToXfix/heart`(expand(pol),args[2..nargs])) else ERR['FMPerror'](9,procname) fi; fi; if (args[2]<>'noexpand') then ERR['FMPerror'](4,procname) elif (args[4]<>'collect') then ERR['FMPerror'](6,procname) fi; RETURN(`FM/ToXfix/heart`(`FM/ToXfix/heart`(pol,args[3]),'X',args[4])) end; # # SV240497 `FM/ToXfix/interface`:=proc(pol) `FM/ToXfix`(args); end; # # SV230497 `FM/ToXfix/check`:=proc(pol) end; # # SV240497 `FM_PACK/ToXfix`:=proc(pol) `FM/ToXfix/check`(args); `FM/ToXfix/interface`(args); end; # savelib(`FM/ToXfix/heart`, `FM/ToXfix/heart.m`); savelib(`FM/Xmonom2Xfix`, `FM/Xmonom2Xfix.m`); savelib(`FM/ToXfix`, `FM/ToXfix.m`); savelib(`FM/ToXfix/interface`, `FM/ToXfix/interface.m`); savelib(`FM/ToXfix/check`, `FM/ToXfix/check.m`); savelib(`FM_PACK/ToXfix`, `FM_PACK/ToXfix.m`); if (not assigned(_NOQUIT)) then quit; fi;