% $Date: 2003/10/28 21:59:21 $ $Author: nthiery $ $Revision: 1.1.1.2 $

\begin{Mhelppage}{SfAExpand}%
  {V. Prosper}%
  \begin{MInfo}
    \eng{expands a SFA expression}
  \end{MInfo}
  

\begin{MCalls}
  \Mcall{sfa}
\end{MCalls}

\begin{MParameters}
  \param{sfa}
  \eng{any valid expression in \Mex{vlist}} 
\end{MParameters}

\begin{MIntro}
  \eng{
The {\Mthis} function expands, whenever possible, any expression in \Mex{SFA}.
It  is  a  direct  implementation  of the  \Mmath{Lambda}{\Lambda}-ring
structure, i.e. symmetric functions are considered as operators over the ring
of polynomials.
 
Expansion is  inductively  propagated, thus enabling chains of plethysms.
 
Alphabets are either formal alphabets  (\Mex{A1, A2}, ...),  or real constants
(any float object or any formal variable  \Mmath{<>  Ai}{\neq\mathtt{A}_i},
or variables (when explicitely so declared), or symmetric functions of
\Mex{SFA}, or any linear combination of alphabets.
For instance,  \Mex{3/2*A1 + k*(A2 - s[3](-A1))} is a valid alphabet.
 
One may declare variables by setting e.g.
\Mex{SfAVars(\{\{x\}, \{y\}, z1, z2\})}.
Here, \Mex{z1}, \Mex{z2}, all \Mex{x}i's, and all \Mex{y}i's will be held as
variables within alphabets.
 
Rules used for e.g. power sums symmetric functions are:
\Mdmath{%
\begin{itemize}
\item
{\Mex{p[i](-A)       = -p[i](A)}}
\item
{\Mex{p[i](A B)      = p[i](A) p[i](B)}}
\item
{\Mex{p[i](A+B)      = p[i](A)+p[i](B)}}
\item
{\Mex{p[i](k)        = k,  k} real constant (<> Ai)}
\item
{\Mex{p[i](x)        = x^i,  x} explicitely declared variable}
\item
{\Mex{p[i](Aj)       = p[i](Aj), Aj} formal alphabet}
\item
{\Mex{p[i](p[j](A))  = p[ij](A)} (plethysm, from previous equations)}
\end{itemize}
}{%
\begin{array}{ccl}
\mathtt{p}[i](-A)
& = &
	-\mathtt{p}[i](A)\\
\mathtt{p}[i](A\times B)
& = &
	\mathtt{p}[i](A)\times\mathtt{p}[i](B)\\
\mathtt{p}[i](A+B)
& = &
	\mathtt{p}[i](A)+\mathtt{p}[i](B)\\
\mathtt{p}[i](k)
& = &
	k,  k \mathrm{~real~constant} (\neq\mathtt{A}_i)\\
\mathtt{p}[i](x)
& = &
	x^i,  x \mathrm{~explicitely~declared~variable}\\
\mathtt{p}[i](\mathtt{A}_j)
& = &
	\mathtt{p}[i](\mathtt{A}_j), \mathtt{A}_j \mathrm{~formal~alphabet}\\
\mathtt{p}[i](\mathtt{p}[j](A))
& = &
	\mathtt{p}[i\times j](A) \mathrm{~(plethysm,~from~previous~equations)}
\end{array}
}
where \Mmath{i}{i} and \Mmath{j}{j} are positive integers.
Equivalent rules for the other bases are also implemented.
}
\end{MIntro}

\begin{MExample}{ex1}
\begin{Mexin}
muEC::SFA::SfAExpand( p[4,2](7+A1) );
\end{Mexin}
\begin{Mexout}
          7 p[2](A1) + 7 p[4](A1) + p[4, 2](A1) + 49
\end{Mexout}
% \begin{Mexout}[hide]
         % p[2](A1)*7 + p[4](A1)*7 + p[4, 2](A1) + 49
% \end{Mexout}
\begin{Mexin}
muEC::SFA::SfAExpand( s[2](A1 - 3/2*A2 + k) );
\end{Mexin}
\begin{Mexout}
k              3 s[2](A2)   15 s[1, 1](A2)
- + s[2](A1) + ---------- + -------------- + k s[1](A1) -
2                   8              8

                                         2
   3 k s[1](A2)   3 s[1](A1) s[1](A2)   k
   ------------ - ------------------- + --
         2                 2             2
\end{Mexout}
% \begin{Mexout}[hide]
% k*1/2 + k^2*1/2 + s[2](A1) + s[2](A2)*3/8 + k*s[1](A1) + k*s[1](A2)*(-3/2) +
% s[1, 1](A2)*15/8 + s[1](A1)*s[1](A2)*(-3/2)
% \end{Mexout}
\begin{Mexin}
muEC::SFA::SfAVars( { {x}, {y}, z1 } );
\end{Mexin}
\begin{Mexout}
                        {{x}, {y}, z1}
\end{Mexout}
\begin{Mexin}
muEC::SFA::SfAExpand( p[3]( q*m[2,1]( x1-k+A2 ) - z1^2+C ) );
\end{Mexin}
\begin{Mexout}
                                  2             6
C - q p[9](A2) + q p[6, 3](A2) + k  q + k q - z1  -

                                       3         6
   k q p[3](A2) - k q p[6](A2) - k q x1  - k q x1  +

       3                6
   q x1  p[6](A2) + q x1  p[3](A2)
\end{Mexout}
% \begin{Mexout}[hide]
% C + k*q + z1^6*(-1) + k^2*q + q*p[9](A2)*(-1) + k*q*x1^3*(-1) +
% k*q*x1^6*(-1) + k*q*p[3](A2)*(-1) + k*q*p[6](A2)*(-1) + q*p[6, 3](A2) +
% q*x1^3*p[6](A2) + q*x1^6*p[3](A2)
% \end{Mexout}
\end{MExample}

\MRelatedFunctions{SfAVars,SYMF::SfEval,SYMF::SfPlethysm,SfACollect}
\end{Mhelppage}
