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

\begin{Mhelppage}{ToXX}{S. Veigneau}

  \begin{MInfo}
    \eng{converts any expression to the XX Schubert basis}
  \end{MInfo}
      
\begin{MCalls}
 \Mcall{expr}
\end{MCalls}
%
\begin{MParameters}
  \param{expr}
  \eng{any expression}
  \param{b}
  \eng{any name of a known basis} 
\end{MParameters}
%
\begin{MIntro}
  \eng{
The {\Mthis} function converts any  expression expr to the XX Schubert basis.
expr  may  involve  some  \Mex{x}i's,  simple  Schubert  polynomials
(\Mex{X[perm]}, \Mex{Y[code]}), double Schubert polynomials
(\Mex{XX[perm]}, \Mex{YY[code]}, the second alphabet being the \Mex{y}i's),
other terms being considered as coefficients.

The expression \Mex{expr} is expanded and the result is not collected.

One may specify by a second argument, say \Mpar{b}, that expr is solely
expressed in terms of the known basis \Mpar{b} (\Mex{x}, \Mex{X}, \Mex{Y},
\Mex{XX}, \Mex{YY}, \Mex{Pe} and even \Mex{y} that is seen as a basis in the
package).

The call \Mex{{\Mthis}(expr, XX)} does not affect the argument \Mex{expr}, but
it simplifies Schubert polynomials indices.

One may add \Mex{NoExpand} just after the argument \Mex{expr} to choose not to
expand the expression expr before treating it.

One may collect the result by adding a third argument: this is done by
\Mex{ToXX(expr, b, Collect)}.
For  instance,  \Mex{{\Mthis}(expr, XX, Collect)} may be used to collect the
argument \Mex{expr}.
}
\end{MIntro}
%
\begin{MExample}{ex1}
%
\begin{Mexin}
muEC::SP::ToXX((1+q)^5*x3*x4, NoExpand);
\end{Mexin}
\begin{Mexout}
       5
(q + 1)  (y3 XX[1, 2, 4, 3] - y4 XX[1, 3, 2] +

   y3 (y4 XX[1] - XX[1, 2, 4, 3] + XX[1, 2, 3, 5, 4]) +

   XX[1, 4, 2, 3] + XX[1, 2, 4, 5, 3] - XX[1, 3, 2, 5, 4])
\end{Mexout}
% \begin{Mexout}[hide]
% (q + 1)^5*(y4*XX[1, 3, 2]*(-1) + XX[1, 4, 2, 3] + y3*XX[1, 2, 4, 3] +
% XX[1, 2, 4, 5, 3] + XX[1, 3, 2, 5, 4]*(-1) +
% y3*(y4*XX[1] + XX[1, 2, 4, 3]*(-1) + XX[1, 2, 3, 5, 4]))
% \end{Mexout}
\begin{Mvin}{test=false}
muEC::SP::ToXX(q^2*x3*X[3,1,2], Collect); // BROKEN EXAMPLE
\end{Mvin}
\begin{Mvout}{test=false}
  2       2                        2       2
(q  y1 + q  y2) XX[2, 1, 4, 3] - (q  y1 + q  y2) XX[2, 3, 1] +

     2          2                    2
   (q  y1 y3 + q  y2 y3) XX[2, 1] - q  XX[3, 2, 1] +

    2                   2   2
   q  XX[3, 1, 4, 2] - q  y1  XX[1, 3, 2] +

    2   2                   2                   2   2
   q  y1  XX[1, 2, 4, 3] - q  y1 XX[3, 1, 2] + q  y1  y3 XX[1]
\end{Mvout}
% \begin{Mexout}[hide]
% q^2*y1^2*y3*XX[1] + q^2*XX[3, 2, 1]*(-1) + q^2*y1*XX[3, 1, 2]*(-1) +
% XX[2, 1]*(q^2*y1*y3 + q^2*y2*y3) + q^2*XX[3, 1, 4, 2] +
% q^2*y1^2*XX[1, 3, 2]*(-1) + q^2*y1^2*XX[1, 2, 4, 3] +
% (q^2*y1 + q^2*y2)*XX[2, 1, 4, 3] + XX[2, 3, 1]*(q^2*y1*(-1) + q^2*y2*(-1))
% \end{Mexout}
\end{MExample}

%
\MRelatedFunctions{ToYY}
\end{Mhelppage}
