% $Date: 2004/10/04 17:25:12 $ $Author: nthiery $ $Revision: 1.1.1.3 $

\begin{Mhelppage}{Toh}%
  {V. Prosper}%
  \begin{MInfo}
    \eng{converts any symmetric function into a \Mex{h}-polynomial}
  \end{MInfo}
  
  \MDeclareOption{\Collect}{Collect}
  \MDeclareOption{\NoExpand}{NoExpand}
  
  \begin{MCalls}
    \Mcall{sf\Mopt{,b}\Mopt{,\Collect}\Mopt{,\NoExpand}}
  \end{MCalls}

  \begin{MParameters}
    \param{sf}
    \eng{any symmetric function}
    \param{b}
    \eng{converts only \Mex{b}-polynomials appearing in \Mex{sf}}
  \end{MParameters}
  \begin{MOptions}
    \option{\NoExpand}
    \eng{keeps the recursive structure of \Mex{sf}}
    \option{\Collect}
    \eng{expresses the result on the \Mex{h}-basis}
  \end{MOptions}
  
  \begin{MIntro}
    \eng{The {\Mthis} function converts any symmetric function into a
      \Mex{h}-polynomial.
      
      The symmetric function sf is expanded and the result is not
      collected.
      
      One may convert only \Mex{b}-polynomials of \Mex{sf} by adding
      the base \Mex{b} in the arguments.
      
      One may preserve the recursive structure of \Mex{sf} by adding
      the argument \Mex{NoExpand}.
      
      One may collect the result by adding the argument \Mex{Collect}.
      The result will be collected in all \Mex{h}-polynomials
      appearing in \Mex{sf}.  }
  \end{MIntro}

\begin{MExample}{ex1}
\begin{Mexin}
muEC::SYMF::Toh( (s[2,1] - k*e[2,1])^2 * q - p[1]^3 );
\end{Mexin}
\begin{Mexout}
q h[3, 3] - 2 q h[3, 2, 1] + q h[2, 2, 1, 1] -

   2 k q h[3, 2, 1] + 2 k q h[2, 2, 1, 1] +

   2 k q h[3, 1, 1, 1] - 2 k q h[2, 1, 1, 1, 1] +

    2                      2
   k  q h[2, 2, 1, 1] - 2 k  q h[2, 1, 1, 1, 1] +

    2
   k  q h[1, 1, 1, 1, 1, 1] - h[1, 1, 1]
\end{Mexout}
% \begin{Mexout}[hide]
% q*h[3, 3] + h[1, 1, 1]*(-1) + q*h[3, 2, 1]*(-2) + k*q*h[3, 2, 1]*(-2) +
% q*h[2, 2, 1, 1] + k*q*h[2, 2, 1, 1]*2 + k*q*h[3, 1, 1, 1]* 2 +
% k*q*h[2, 1, 1, 1, 1]*(-2) + k^2*q*h[2, 2, 1, 1] +
% k^2*q*h[2, 1, 1, 1, 1]*(-2) + k^2*q*h[1, 1, 1, 1, 1, 1]
% \end{Mexout}
\begin{Mexin}
muEC::SYMF::Toh( (s[2,1] - k*e[2,1])^2 * q - p[1]^3, Collect );
\end{Mexin}
\begin{Mexout}
  2
(k  q) h[1, 1, 1, 1, 1, 1] - h[1, 1, 1] +

           2
   (- 2 q k  - 2 q k) h[2, 1, 1, 1, 1] +

       2
   (q k  + 2 q k + q) h[2, 2, 1, 1] + (2 k q) h[3, 1, 1, 1] +

   (- 2 q - 2 k q) h[3, 2, 1] + q h[3, 3]
\end{Mexout}
% \begin{Mexout}[hide]
% q*h[3, 3] + h[1, 1, 1]*(-1) + k*q*h[3, 1, 1, 1]*2 + (q*(-2) +
% k*q*(-2))*h[3, 2, 1] + (q + k*q*2 + k^2*q)*h[2, 2, 1, 1] +
% k^2*q*h[1, 1, 1, 1, 1, 1] + (k*q*(-2) + k^2*q*(-2))*h[2, 1, 1, 1, 1]
% \end{Mexout}
\begin{Mexin}
muEC::SYMF::Toh( (s[2,1] - k*e[2,1])^2 * q - p[1]^3, Collect,
     NoExpand );
\end{Mexin}
\begin{Mexout}
                                               2       3
      q (k h[1, 1, 1] - (k + 1) h[2, 1] + h[3])  - h[1]
\end{Mexout}
% \begin{Mexout}[hide]
% h[1]^3*(-1) + q*(h[3]*(-1) + k*h[1, 1, 1]*(-1) + (k + 1)*h[2, 1])^2
% \end{Mexout}
\begin{Mexin}
muEC::SYMF::Toh( (s[2,1] - k*e[2,1])^2 * q - p[1]^3, NoExpand, s );
\end{Mexin}
\begin{Mexout}
                                          2       3
            q (k e[2, 1] + h[3] - h[2, 1])  - p[1]
\end{Mexout}
% \begin{Mexout}[hide]
% hold(p[1]^3*(-1) + q*(h[3]*(-1) + h[2, 1] + k*e[2, 1]*(-1))^2
% \end{Mexout}
\end{MExample}

\MRelatedFunctions{Toe,Tom,Top,Tos,SfAddBasis,Sf}
\end{Mhelppage}
