# Sum slowing down computations

I am trying to compute higher order Casimir invariants for some representations of certain groups. I can get the quadratic, cubic and quartic but beyond that things are taking too long to the point I don't know if anything is really happening.

For example, I have an oscillator representation of $SO(4,2)$ where the generators $G_{AB}, (A,B=1,\ldots,6)$ are bilinears in oscillators. I have already defined a function for normal ordering of noncommuting oscillators which works reasonably well.

Now I am trying to compute Casimirs in this representation for example quadratic Casimir is as follows:

Cas2 =Sum[g[[ind1, ind3]]G[ind3, ind2]g[[ind2,ind4]].G[ind4, ind1], {ind1, 1, 6}, {ind2,
1, 6}, {ind3, 1, 6}, {ind4, 1, 6}];


where $g_{AB}$ is the metric to raise and lower the indices and $G_{AB}$ are the generators. Note that I have defined $.$ as the noncommutative product with certain properties. After summing this up, I use my custom simplification function to simplify it. The problem is that for 6th order Casimir the sum which looks like this

cas6 = Sum[g[[ind1, ind7]] g[[ind2, ind8]] g[[ind3, ind9]] g[[ind4,ind10]]g[[ind5,ind11]]
g[[ind6,ind12]] G[ind7,ind2].G[ind8,ind3].G[ind9,ind4].G[ind10,ind5].G[ind11,
ind6].G[ind12,  ind1], {ind1, 1, dim}, {ind2, 1,dim}, {ind3, 1, dim}, {ind4, 1,
dim}, {ind5, 1,dim}, {ind6, 1,dim}, {ind7, 1, dim}, {ind8, 1, dim}, {ind9, 1,
dim}, {ind10, 1,dim}, {ind11, 1, dim}, {ind12, 1, dim}];


where $dim=6$, takes far too long. I am not even doing any simplification at this step which will cause so much time. I was wondering if there is any alternative to sum or anything else I can do to speed it up. I tried ParallelSum which reduced the time a little bit for other invariants but that hasn't worked too well on this either. I have waited for over 4 hours without any completion. I need to do the same thing for $SO(6,2)$ which has indices $A,B=1,\ldots, 8$ and has been a nightmare too.

-
Would you please include a generic sample of the data in g and G? Also please include your modified definition of Dot. Without looking deeper I think you may want to look at Outer. – Mr.Wizard Dec 22 '13 at 12:19
It will take me a long time to post the entire explanation of code but I have posted another question which explains things better. – Bilentor Dec 25 '13 at 0:22