# # extract_jacks - extract Jack functions from a remember table in SF # restore_jacks - install a list of Jack functions into a remember table # # Calling sequence: # extract_jacks(n) # restore_jacks(n,Jlist) # # Parameters: # n - a positive integer # Jlist - a list of Jack functions of degree n (as given by extract_jacks) # # Assume that the Jack symmetric function basis has been defined during an # SF session, using 'J' as the basis name and 'a' as the Jack parameter. # In addition, suppose that the e-function expansions for all Jack functions # J[mu] of degree n have been computed--either directly, or using the # accelerated code in SF/examples/jacks. # # Given the above conditions, extract_jacks(n) will extract a list (in a # highly compressed format) of the e-function expansions of Jack functions # of degree n from their remember table. The resulting list can then be # saved to a file. # # Given that Jlist is the list produced by extract_jacks(n), then # restore_jacks(n,Jlist) will reverse the procedure, storing the data from # the list into the remember table (and if necessary, using add_basis to # define the Jack function basis in the current SF session). # # Examples: # with(SF); # Define the Jack functions: # add_basis(J,mu->zee(mu,a),mu->hooks(mu,a)); # This builds the remember table for degree 4: # for mu in Par(4) do toe(J[op(mu)]) od; # Now extract the table in compressed form: # Jack4:=extract_jacks(4); # For faster building of the table, use SF/examples/jacks: # read cat(HomeLib,`/SF/examples/jacks`); #assumes the Unix Edition # jacks(9,verbose); # Jack9:=extract_jacks(9): # Now save the results to a file: # save Jack4,Jack9,`filename.m`; # # To restore the data in a new Maple session: # with(SF); # read `filename.m`; # remember also to read in 'jacktools' # restore_jacks(4,Jack4); # restore_jacks(9,Jack9); # toe(J[4,3,2]); extract_jacks:=proc(n) local sp,N,i,monid,vars; sp:=SF['Par'](n); N:=nops(sp); monid:=table([seq(convert(map(x->cat('e',x),sp[i]),`*`)=i,i=1..N)]); vars:=[seq(cat('e',i),i=1..n)]; monid:=[seq(`jacks/compr`(sp[i],i,vars,monid),i=1..N)]; end; restore_jacks:=proc(n,Jlist) local par2e,sp,i,f; if not member('J[]',`SF/Bases`) then SF['add_basis'](J,mu->SF['zee'](mu,a),mu->SF['hooks'](mu,a)) fi; `SF/added`(J,[]); # prevent clobbering of the remember table sp:=SF['Par'](n); par2e:=map(convert,subs({seq(i=cat('e',i),i=1..n)},sp),`*`); for i to nops(sp) do f:=convert(zip((x,y)->`jacks/unwrap`(x)*y,Jlist[i],par2e),`+`); `SF/added/gs`(J,sp[i]):=[0,f] od; NULL end; # compress a single J[mu] `jacks/compr`:=proc(mu,i,vars,Mid) local v,co,tm; co:=[coeffs(`SF/added`(J,mu),vars,'tm')]; tm:=[seq(Mid[v],v=[tm])]; co:=map(`jacks/compr/poly`,co); subsop(op(zip((x,y)->x=y,tm,co)),[0$i]); end: # compress a (nonzero) univariate polynomial `jacks/compr/poly`:=proc(f) local c,k,g,i; g:=expand(f); c:=igcd(coeffs(g,a)); k:=ldegree(g,a); g:=g/c; [k,c,seq(coeff(g,a,i),i=k..degree(g,a))]; end: `jacks/unwrap`:=proc(v) local j; if v=0 then 0 else v[2]*convert([seq(v[j]*a^(j+v[1]-3),j=3..nops(v))],`+`) fi end: