I want to use n variables $$alpha[[i]]$$ (i goes from 1 to n).
I use these variable inside of a function :
SixJ1[j1_, j2_, j3_, j4_, j5_, j6_] := Module[{j},
j = {j1, j2, j3, j4, j5, j6};
Sum[alpha[[k]]*j[[k]]*(j[[k]] + 1)*
SixJSymbol[{j1, j2, j3}, {j4, j5, j6}] +
beta*opVolume[j1, j2, j3, j4, j5, j6], {k, 1, 6}]
]
The problem is that when I call this function, mathematica answers me :
"Part specification alpha[[1]] is longer than depth of object."
I think it is because I never initialised thoose variables but I want to keep them symbolic.
How to avoid these errors ?
alpha[k]
? $\endgroup$alphalist = Array[k, 6]; alphalist[[k]]
? (You have to name your variables somehow first.) $\endgroup$