Q&A : Problem with tensor notation

Vision List Digest: Article 2, Volume 21, Issue 14
From: venu@gdit.iiit.net (Venugopal)
Post-Followup: submission@VISLIST.com


Given a 3x3x3 tensor T_i^{jk}, where 1<=i,j,k<=3, and three 3x3
matrices H1, H2 and H3, how would I code the following expression?
(Tnew)_i^{jk} = H1_i^r H2_s^j H3_t^k T_r^{st} ? The notation is
all tenor notation. I understand that the covariant and contravariant
indices in the superscript and subscript represent summation, but I am
unable to understand the order. I tried the following method :

\begin{pseudocode}
Tnew[i*3*3 + j*3 + k] = \Sigma_{r} H1[r][i]*outerval
outerval = \Sigma_{s} H2[j][s]*innerval
innerval = \Sigma_{t} H3[k][t]*T[r*3*3 + s*3 + t]
\end{pseudocode}

What is the error in the above?
Thanks


http://www.vislist.com