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

\begin{Mhelppage}{SfACollect}%
  {V. Prosper}%
  \begin{MInfo}
    \eng{collects products that are on algebraic bases (\Mex{e, h, p})
      and expands products on linear bases (\Mex{m, s})}
  \end{MInfo}
  
  \begin{MCalls}
    \Mcall{sfa\Mopt{,b}\Mopt{,blist}}
  \end{MCalls}

  \begin{MParameters}
    \param{sfa}
    \eng{a linear combination of products of symmetric functions}
    \param{b}
    \eng{a basis} 
    \param{blist}
    \eng{a list of bases} 
  \end{MParameters}

  \begin{MIntro}
    \eng{The {\Mthis} function transforms products of power sums,
      elementary and complete functions into a valid \Mex{SFA}
      expression.
      
      Special algorithms are used for products of monomial symmetric
      functions and products of Schur functions.
      
      The {\Mthis} function also normalizes indexing vectors of each
      symmetric function.
      
      Valid bases are \Mex{SFA::SFABases}. They all are considered by
      default.
 
      One may specify to collect products (and / or normalize indexing
      vectors) expressed only on specified bases by adding a second
      argument which is either a single basis or a list of bases.  }
  \end{MIntro}

\begin{MExample}{ex1}
\begin{Mexin}
muEC::SFA::SfACollect( p[3](A1)^4 * e[2](A2) * e[1](A2)
          - q*s[2](A3)^2 );
\end{Mexin}
\begin{Mexout}
e[2, 1](A2) p[3, 3, 3, 3](A1) -

   q (s[4](A3) + s[2, 2](A3) + s[3, 1](A3))
\end{Mexout}
% \begin{Mexout}[hide]
% q*(s[4](A3) + s[2, 2](A3) + s[3, 1](A3))*(-1) + e[2, 1](A2)*p[3, 3, 3, 3](A1)
% \end{Mexout}
\begin{Mexin}
muEC::SFA::SfACollect( p[1,2](A1)^2 - q*m[1,0,0](A2)^2*s[1,3](A3)^2,
            [ s, m ] );
\end{Mexin}
\begin{Mexout}
           2
p[1, 2](A1)  - q (m[2](A2) + 2 m[1, 1](A2))

   (s[4, 4](A3) + s[4, 2, 2](A3) + s[4, 3, 1](A3) +

   s[2, 2, 2, 2](A3) + s[3, 2, 2, 1](A3) + s[3, 3, 1, 1](A3))
\end{Mexout}
% \begin{Mexout}[hide]
% p[1, 2](A1)^2 + q*(m[2](A2) + m[1, 1](A2)*2)*(s[4, 4](A3) + s[4, 2, 2](A3) +
% s[4, 3, 1](A3) + s[2, 2, 2, 2](A3) + s[3, 2, 2, 1](A3) +
% s[3, 3, 1, 1](A3))*(-1)
% \end{Mexout}
\begin{Mvin}{test=false}
muEC::SFA::SfACollect( p[1,2](A1)^2 - q*m[1,0,0](A2)^2*s[1,3](A3)^2,
            p ); // BROKEN EXAMPLE
\end{Mvin}
\begin{Mvout}{test=false}
                                       2               2
       p[2, 2, 1, 1](A1) - q s[1, 3](A3)  m[1, 0, 0](A2)
\end{Mvout}
% \begin{Mexout}[hide]
  % p[2, 2, 1, 1](A1) + q*s[1, 3](A3)^2*m[1, 0, 0](A2)^2*(-1)
% \end{Mexout}
\end{MExample}

\MRelatedFunctions{SYMF::SfCollect,SfAExpand,ToeA,TohA,TopA,TomA,TosA}
\end{Mhelppage}
