FUNCTION: LieTools/FlattenUgPoly
USAGE: FlattenUgPoly(upoly);
SYNOPSIS: FlattenUgPoly(upoly) expands a polynomial in U(g) and then,
  for each term, pulls constant factors within the U(g)-products out front
  as coefficients.
EXAMPLE: 
upoly := u(3,g[1],g[6]) + u(g[1],2*(g[3]+g[4]),g[5]);
  upoly := 3 u(1, g[1], g[6]) + 2 u(g[1], g[3], g[5])

         + 2 u(g[1], g[4], g[5])

> LieTools[FlattenUgPoly](upoly);

   3 u(g[1], g[6]) + 2 u(g[1], g[3], g[5]) + 2 u(g[1], g[4], g[5])

SEE ALSO: 
