This probably has a one line answer, but I'm totally stuck.
I have two tensors, i.e. two objects that depend on NN abstract indices which i've labelled i[m] (m=1,...,NN)
. I want to keep NN general for now. Each index i[m]
ranges over the values {1,2}
. I want to sum over all the i[m]
s, i.e.
Sum[a[i[1],...,i[NN]] * b[i[1],...,i[NN]], {i[1],1,2},{i[2],1,2},...,{i[NN],1,2}]
The only problem I have is finding a general expression that generates the "array" {i[1],1,2},{i[2],1,2},...,{i[NN],1,2} in the summation. I tried Table but that gives me an array of the form
{{i[1],1,2},{i[2],1,2},...,{i[NN],1,2}}
and I can't get rid of the outer brackets.