Question: Problem in execution of summation symbol

Dear Users!

Hope you would be fine. I have some problem in execution the last loops (highlighted as red) where sumation is present. When NN>3 it takes alot of time more than 12 hours. Is there any alternative command to reduce the query. I am waiting for your response. Thanks in advance. 

restart; with(LinearAlgebra); Digits := 30; NN := 2; nu := 1; M1 := NN; M2 := NN; M3 := NN;

for k1 from 0 while k1 <= M1-1 do for k2 from 0 while k2 <= M2-1 do for k3 from 0 while k3 <= M3-1 do

SGP[M3*(M2*k1+k2)+k3+1] := simplify(sum((-1)^(k1-i1)*GAMMA(k1+i1+2*nu)*x^i1*(sum((-1)^(k2-i2)*GAMMA(k2+i2+2*nu)*y^i2*(sum((-1)^(k3-i3)*GAMMA(k3+i3+2*nu)*z^i3/(GAMMA(i3+nu+1/2)*factorial(k3-i3)*factorial(i3)), i3 = 0 .. k3))/(GAMMA(i2+nu+1/2)*factorial(k2-i2)*factorial(i2)), i2 = 0 .. k2))/(GAMMA(i1+nu+1/2)*factorial(k1-i1)*factorial(i1)), i1 = 0 .. k1)) end do end do end do;

SGPxyz := `<,>`(seq(seq(seq(SGP[M3*(M2*(i-1)+j-1)+k], k = 1 .. M3), j = 1 .. M2), i = 1 .. M1));

Lambda := `<,>`(seq(seq(seq(chi[M3*(M2*(i-1)+j-1)+k], k = 1 .. M3), j = 1 .. M2), i = 1 .. M1));

for i while i <= NN^3 do for j while j <= NN^3 do for k while k <= NN^3 do

q[i, j, k] := int(int(int(SGP[i]*SGP[j]*SGP[k]*(-x^2+x)^(nu-1/2)*(-y^2+y)^(nu-1/2)*(-z^2+z)^(nu-1/2), z = 0 .. 1), y = 0 .. 1), x = 0 .. 1) end do end do end do;

U := Matrix(NN^3, NN^3, 0);

for j while j <= NN^3 do for k while k <= NN^3 do U[j, k] := simplify(sum(chi[i1]*q[i1, j, k], i1 = 1 .. NN^3)) end do end do;

F := simplify(evalm(U));

Special request to @acer @Carl Love @Kitonum @Preben Alsholm

Please Wait...