FUNCTION: LieTools/DiagC2onUgPolys
USAGE: DiagC2onUgPolys(ulist);
SYNOPSIS: DiagC2onUgPolys(ulist) finds the eigenvalues and eigenvectors
  of the 2nd order Casimir operator on a list ulist of elements of U(g).
  The output is of the form 
     [[[evalue1,mult1,[evector11,....,evector1k]],[ubasis1,....,ubasisN]]
  where evalue1 is the first eigenvalue; ubasis1,...,ubasisN as a 
  (Poincare-Birchoff-Witt) monomomial basis for the span of the elements in
  in plist, and evector11,...,evector1k are arrays of N numbers corresponding
  to the components of the eigenvectors of the first eigenvalue with respect
  to the monomial basis ubasis1,... ubasisN.
CAVEATS: requires a previously initialized global Lie algebra environment.
  (See LieTools[gSetup].)
EXAMPLE: 
> LieTools[gSetup](A,2):
Setting up Gtype = A   rnk = 2
> ZW := [1/2*u(g[1],g[8])+1/2*u(g[8],g[1]), 1/2*u(g[2],g[7])+1/2*u(g[7],g[2]), 1/2*u(g[3],\
        g[6])+1/2*u(g[6],g[3]), u(g[4],g[4]), 1/2*u(g[5],g[4])+1/2*u(g[4],g[5]), u(g[5],g[5])];

  ZW := [1/2 u(g[1], g[8]) + 1/2 u(g[8], g[1]),

        1/2 u(g[2], g[7]) + 1/2 u(g[7], g[2]),

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

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

> LieTools[DiagC2onUgPolys](ZW);

  [[[8/3, 3, {

        [0, -2, 0, 0, 0, 1], [-1, 1, 1, 0, 1, 0], [0, 0, -2, 1, 0, 0]

        }], [1, 2, {[3, -3, 0, 1, 2, 0], [3, 0, -3, 0, 2, 1]}],

        [0, 1, {[3, 3, 3, 1, 1, 1]}]], [u(g[4]), u(g[5]),

        u(g[1], g[8]), u(g[2], g[7]), u(g[3], g[6]), u(g[4], g[4]),

        u(g[4], g[5]), u(g[5], g[5])]]

SEE ALSO: 
