#
# char2qf(<classfn>) will apply the spin characteristic to <classfn>,
# producing symmetric function in the omega-algebra as the output. The
# <classfn> must be expressed as a linear combination of split 
# characteristic functions cl[<mu>] for partitions <mu> with odd parts.
# (All other terms are in the kernel.) The output, by default, is in base p.
# Use char2qf(<classfn>,b) to specify another output base.
#
`QF/char2qf`:=proc(char) local f,sp,i,mu;
  sp:=SF['varset'](char,'cl[]');
  sp:=map(proc(x) if modp({1,op(x)},2)={1} then x fi end,sp);
  f:=convert([seq(coeff(char,cl[op(mu)])*convert(map(x->cat('p',x),mu),`*`)
    *2^(nops(mu)/2)/SF['zee'](mu),mu=sp)],`+`);
  if nargs=1 then f 
    elif args[2]='q' then QF['toddq'](f,'p')
    elif args[2]='P' or args[2]=P[] then QF['toP'](f,'p')
    elif args[2]='Q' or args[2]=Q[] then QF['toQ'](f,'p')
    else `SF/apply`(args[2],f,'p')
  fi 
end:
#
save `QF/char2qf`, cat(HomeLib,`/QF/char2qf.m`);
read cat(HomeLib,`/help/QF/char2qf`);
quit;

