#
# spin(lambda) will return the class function corresponding to the
# irreducible spin representation of the symmetric group indexed by
# lambda (in DPar). In some cases (n - nops(lambda) odd) there are 
# two representations;
#
`QF/spin`:=proc(mu) local f,n,l;
  n:=convert(mu,`+`); l:=modp(n-nops(mu),2);
  f:=QF['qf2char'](Q[op(mu)]/2^((nops(mu)+l)/2));
  if l=0 then f else
    n:=(-1)^((n-nops(mu)+1)/2)*convert(mu,`*`)/2;
    f+sqrt(n)*cl[op(mu)]
  fi
end:
#
save `QF/spin`, cat(HomeLib,`/QF/spin.m`);
read cat(HomeLib,`/help/QF/spin`);
quit;

