`SF/text/add_basis` := TEXT(
`   `,
`FUNCTION:  add_basis - add an orthogonal basis to the set of known bases`,
`   `,
`CALLING SEQUENCE:  add_basis(b,scp);       add_basis(b,scp,lterm);   `,
`                   add_basis(b,scp,flag);  add_basis(b,scp,lterm,flag);`,
`   `,
`PARAMETERS:     b     = name of a new basis `,
`            scp,lterm = procedures that accepts partitions as input`,
`              flag    = (optional) an unassigned name or string`,
`   `,
`SYNOPSIS:`,
`  Let < , > be a scalar product of symmetric functions in which the power`,
`  sums are orthogonal, and let 'scp' be a procedure such that scp(mu)`,
`  computes the squared norm of the power sum indexed by mu. The standard`,
`  scalar product is obtained by choosing scp=zee. See 'scalar' and 'zee'.`,
`   `,
`  By the Gram-Schmidt algorithm, there is a unique basis b[.] of the space`,
`  of symmetric functions that is orthogonal w.r.t. < , > and satisfies`,
`   `,
`    b[lambda] = m[lambda] + a linear combination of previous m[mu]'s,  (*)`,
`   `,
`  where m[.] denotes the basis of monomial symmetric functions, and the`,
`  mu's that appear in the above sum precede lambda in the conjugate of`,
`  the lexicographic ordering used by 'Par'; i.e., if mu appears, then`,
`  for some i, mu has more parts >=i than lambda, and the same number of`,
`  parts >=j for j=1,...,i-1. This total ordering is a refinement of the`,
`  dominance order, and has the property that the b[lambda]'s for lambda`,
`  with <=n rows form a basis for the quotient of the ring of symmetric`,
`  functions corresponding to symmetric polynomials in n variables.`,
`   `,
`  For example, the Schur functions s[lambda] are the orthogonal basis one`,
`  obtains by this method for the standard scalar product.`,
`   `,
`  More generally, one may modify (*) so that the leading term of b[lambda]`,
`  is any chosen (nonzero) scalar multiple of m[lambda], not necessarily 1.`,
`  Such a choice is specified by a procedure 'lterm' designed so that`,
`  lterm(lambda) returns the desired leading coefficient for b[lambda].`,
`   `,
`  If 'scp' and 'lterm' are as described, and 'b' is a name that has not`,
`  been previously defined to be a symmetric function basis, then the`,
`  procedure call  add_basis(b,scp,lterm)  will add 'b[]' to the list of`,
`  known bases, and define it to be the orthogonal basis as above.`,
`   `,
`  If the 'lterm' argument is omitted, it defaults to 1.`,
`   `,
`  If the last argument (the third or fourth) is not of type 'procedure',`,
`  this is interpreted as a flag indicating that the basis b is triangular`,
`  with respect to all refinements of the dominance order (see 'dominate').`,
`  This reduces the amount of computation that the Gram-Schmidt algorithm`,
`  needs to perform in high degrees. All orthogonal bases likely to occur`,
`  in applications have this feature.`,
`   `,
`  The effects of a call to add_basis are:`,
`   `,
`  (1) All predefined conversion procedures for symmetric functions, such`,
`  as 'toe', 'top',... as well as procedures defined by previous calls to`,
`  'add_basis' and 'dual_basis', will now be able to process symmetric`,
`  function expressions that involve the new basis 'b'.`,
`   `,
`  (2) A new procedure, named to.b (i.e., the concatenation of "to" and b)`,
`  is defined. Its purpose is to convert symmetric functions into the newly`,
`  created b-basis. The possible calling sequences for this procedure are:`,
`   `,
`                      to.b(f);    or    to.b(f,<options>);`,
`   `,
`  where f is a symmetric function, and the optional arguments include`,
`  (1) a basis name B indicating that f is expressed solely in terms of`,
`  the elements of B, and (2) an equation of the form 'nrows'=n for some`,
`  positive integer n, indicating that the calculation should be performed`,
`  in the quotient of the ring of symmetric functions in which b[lambda]`,
`  vanishes for all lambda with > n parts (or equivalently, e.m vanishes`,
`  for all m>n). Also, to maintain backward compatibility with previous`,
`  versions of SF, a list of partitions containing the support of f may be`,
`  supplied as an optional argument. However, the new implementation obtains`,
`  no advantage from this information and ignores it.`,
`   `,
`  The output is collected with respect to the elements of the basis 'b' and`,
`  'normal' is applied to the coefficients.`,
`   `,
`  On the first occasion that an SF procedure does a computation involving`,
`  b[lambda], it uses the Gram-Schmidt algorithm to expand b[lambda] as a`,
`  polynomial in the elementary symmetric functions and caches the result`,
`  in a remember table. This recursively involves computing (or retrieving`,
`  from the cache) the expansions of b[mu] for all mu preceding lambda.`,
`  Consequently (especially for scalar products defined over rational`,
`  function fields), the first computation involving a given b[lambda] may`,
`  be expensive, but subsequent computations will be cheap.`,
`   `,
`  An error condition is generated if 'b' is the name of a previously`,
`  defined basis. Otherwise, a call to 'add_basis' returns 'Okay'.`,
`   `,
`EXAMPLES:`,
`   `,
`#Define the Hall-Littlewood symmetric functions`,
`  Zee:= mu -> zee(mu,0,t);`,
`  add_basis(HL,Zee,``this basis is triangular in dominance order``);`,
`  toHL(s[2,2],s);               yields`,
`                               HL[2,2] + t*HL[2,1,1] + (t^4+t^2)*HL[1,1,1,1]`,
`  c:=scalar(HL[2,2],HL[2,2],Zee);`,
`  factor(c);                    yields              1/(1+t)/(1-t)^2`,
`   `,
`#Define zonal polynomials`,
`  Zee2:=mu -> zee(mu,2);`,
`  add_basis(Z, Zee2, mu -> hooks(mu,2));`,
`  toZ(p1^4,nrows=2);            yields    2/15*Z[2,2]+4/21*Z[3,1]+1/105*Z[4]`,
`  top(Z[3]);                    yields             p1^3+6*p1*p2+8*p3`,
`   `,
`SEE ALSO:  dominate, dual_basis, scalar, zee`,
NULL):

if `+`(0)=0 then # Maple V.4 or later
  print(INTERFACE_HELP(insert, topic=`SF/add_basis`,
  helpfile=HomeLib, text=`SF/text/add_basis`))
elif ceil(0)=0 then # Maple V.2 or V.3
  `help/SF/text/add_basis`:=`SF/text/add_basis`:
  save `help/SF/text/add_basis`, cat(HomeLib,`/help/SF/text/add_basis.m`);
fi:
