Tensors/Calculations with index notation




 * This article presumes that the reader has read Tensors/Bases, components, and dual spaces.


 * In this article, all vector spaces are real and finite-dimensional.

Tensors allow a certain level of abstraction to help apply what mathematicians have learned about linear algebra. Tensors afford a cleaner notation to represent complex linear relationships at a more abstract level. This article explains the index notation, thereby giving the reader a feeling for the power of using tensors.

Definition of the components
We begin with the observation, from the preceding article in this series, that, once a basis $$\hat{x}$$, $$\hat{y}$$, $$\hat{z}$$ for the vector space has been chosen (giving rise to the natural basis $$\hat{e}$$, $$\hat{f}$$, $$\hat{g}$$ for the form space), the components of a vector of form are just the results of operating on the appropriate basis items. For vectors:
 * $$V^1 = \hat{e}(V)$$
 * $$V^2 = \hat{f}(V)$$
 * $$V^3 = \hat{g}(V)$$

For forms:
 * $$\Phi_1 = \Phi(\hat{x})$$
 * $$\Phi_2 = \Phi(\hat{y})$$
 * $$\Phi_3 = \Phi(\hat{z})$$

This covers all 1st rank tensors, covariant or contravariant. We can extend this to higher-rank tensors. If $$\Omega\,$$ is a 2nd rank covariant tensor (that is, a bilinear form), it is completely determined by the results of applying it to all combinations of basis vectors. (Why? Because it is determined by the result of its application to pairs of vectors, those vectors can be broken down into combinations of basis vectors, and $$\Omega\,$$ is linear.)

So we can call those results the components of the tensor:
 * $$\Omega_{11} = \Omega(\hat{x}, \hat{x})\qquad\Omega_{12} = \Omega(\hat{x}, \hat{y})\qquad\Omega_{13} = \Omega(\hat{x}, \hat{z})$$
 * $$\Omega_{21} = \Omega(\hat{y}, \hat{x})\qquad\Omega_{22} = \Omega(\hat{y}, \hat{y})\qquad\Omega_{23} = \Omega(\hat{y}, \hat{z})$$
 * $$\Omega_{31} = \Omega(\hat{z}, \hat{x})\qquad\Omega_{32} = \Omega(\hat{z}, \hat{y})\qquad\Omega_{33} = \Omega(\hat{z}, \hat{z})$$

The numbers $$\Omega_{11} \dots \Omega_{33}\,$$ are the components of $$\Omega\,$$. It follows that the space of 2nd rank tensors is 9-dimensional. In the general case, the space of Kth rank tensors on an underlying N-dimensional space is of dimension NK.

We can work out the formula for evaluating tensor operations in terms of the components. We already have, from the preceding article, that, if $$\Phi\,$$ is a form and V is a vector:
 * $$\Phi(V) = \sum_{i=1}^3\Phi_i\ V^i$$

In the case of a bilinear form $$\Omega\,$$,
 * $$\Omega(V, W) = \Omega(V^1\ \hat{x} + V^2\ \hat{y} + V^3\ \hat{z}, W^1\ \hat{x} + W^2\ \hat{y} + W^3\ \hat{z})$$


 * $$= V^1W^1\ \Omega(\hat{x}, \hat{x}) + V^1W^2\ \Omega(\hat{x}, \hat{y}) + V^1W^3\ \Omega(\hat{x}, \hat{z})$$
 * $$+\ V^2W^1\ \Omega(\hat{y}, \hat{x}) + V^2W^2\ \Omega(\hat{y}, \hat{y}) + V^2W^3\ \Omega(\hat{y}, \hat{z})$$
 * $$+\ V^3W^1\ \Omega(\hat{z}, \hat{x}) + V^3W^2\ \Omega(\hat{z}, \hat{y}) + V^3W^3\ \Omega(\hat{z}, \hat{z})$$


 * $$= V^1W^1\ \Omega_{11} + V^1W^2\ \Omega_{12} + V^1W^3\ \Omega_{13}$$
 * $$+\ V^2W^1\ \Omega_{21} + V^2W^2\ \Omega_{22} + V^2W^3\ \Omega_{23}$$
 * $$+\ V^3W^1\ \Omega_{31} + V^3W^2\ \Omega_{32} + V^3W^3\ \Omega_{33}$$


 * $$= \sum_{i, j=1}^3\Omega_{ij}\ V^iW^j$$

We can similarly work out the formula for the operation of a 2nd rank mixed tensor $$T\,$$ on a form and a vector. The components of $$T\,$$ are, as always, defined by the action on basis forms and basis vectors:
 * $$T^1_{\ \ 1} = T(\hat{e}, \hat{x})\qquad{}T^1_{\ \ 2} = T(\hat{e}, \hat{y})\qquad{}T^1_{\ \ 3} = T(\hat{e}, \hat{z})$$
 * $$T^2_{\ \ 1} = T(\hat{f}, \hat{x})\qquad{}T^2_{\ \ 2} = T(\hat{f}, \hat{y})\qquad{}T^2_{\ \ 3} = T(\hat{f}, \hat{z})$$
 * $$T^3_{\ \ 1} = T(\hat{g}, \hat{x})\qquad{}T^3_{\ \ 2} = T(\hat{g}, \hat{y})\qquad{}T^3_{\ \ 3} = T(\hat{g}, \hat{z})$$

The numbers $$T^1_{\ \ 1} \dots T^3_{\ \ 3}\,$$ are the components of $$T\,$$.

As before:
 * $$T(\Phi, V) = T(\Phi_1\ \hat{e} + \Phi_2\ \hat{f} + \Phi_3\ \hat{g}, V^1\ \hat{x} + V^2\ \hat{y} + V^3\ \hat{z})$$


 * $$= \Phi_1V^1\ T(\hat{e}, \hat{x}) + \Phi_1V^2\ T(\hat{e}, \hat{y}) + \Phi_1V^3\ T(\hat{e}, \hat{z})$$
 * $$+\ \Phi_2V^1\ T(\hat{f}, \hat{x}) + \Phi_2V^2\ T(\hat{f}, \hat{y}) + \Phi_2V^3\ T(\hat{f}, \hat{z})$$
 * $$+\ \Phi_3V^1\ T(\hat{g}, \hat{x}) + \Phi_3V^2\ T(\hat{g}, \hat{y}) + \Phi_3V^3\ T(\hat{g}, \hat{z})$$


 * $$= \Phi_1V^1\ T^1_{\ \ 1} + \Phi_1V^2\ T^1_{\ \ 2} + \Phi_1V^3\ T^1_{\ \ 3}$$
 * $$+\ \Phi_2V^1\ T^2_{\ \ 1} + \Phi_2V^2\ T^2_{\ \ 2} + \Phi_2V^3\ T^2_{\ \ 3}$$
 * $$+\ \Phi_3V^1\ T^3_{\ \ 1} + \Phi_3V^2\ T^3_{\ \ 2} + \Phi_3V^3\ T^3_{\ \ 3}$$


 * $$= \sum_{i, j=1}^3T^i_{\ j}\ \Phi_iV^j$$

Linear transformations (mixed tensors)
A linear transformation A, that is, a linear function that maps vectors into vectors, is essentially the same as a 2nd rank mixed tensor. A is the same as the tensor T that was analyzed above, so
 * $$\Phi(A(V)) = T(\Phi, V) = \sum_{i, j=1}^3T^i_{\ j}\ \Phi_iV^j = \sum_{i, j=1}^3\Phi_i\ A^i_{\ j}\ V^j$$

The converse is also true&mdash;If T is a mixed tensor, then there is a linear transformation A, having the same components, such that
 * $$\Phi(A(V)) = T(\Phi, V)\,$$   for all linear forms $$\Phi\,$$.

The proof is just like the proof of the "double dual" theorem of the preceding article.

Now since
 * $$\Phi(A(V)) = \sum_{i=1}^3\Phi_i\left(A(V)\right)^i = \sum_{i=1}^3\Phi_i\left(\sum_{j=1}^3A^i_{\ j}\ V^j\right)$$   for all values of $$\Phi_i\,$$

it must be true that
 * $$\left(A(V)\right)^i = \sum_{j=1}^3A^i_{\ j}\ V^j$$   for all i.

This tells us how to calculate the result of a linear transformation A on a vector V, using the components of the equivalent tensor T.

Generalization to arbitrary rank
In the general case, if we have, say, a 4th rank tensor (1 covariant, 3 contravariant), we define the components (all 81 of them in 3 dimensions) as
 * $$\Theta_2^{\ \ 2 3 1} = \Theta(\hat{y}, \hat{f}, \hat{g}, \hat{e})$$   etc., 81 equations in all.

And we can evaluate the tensor on 4 arguments by
 * $$\Theta(V, \Phi, \Psi, \Lambda) = \sum_{i, j, k, l=1}^3\Theta_i^{\ j k l}\ V^i\Phi_j\Psi_k\Lambda_l$$

The reader has no doubt noticed that we are following the convention that indices are written as subscripts for covariant and superscripts for contravariant.

Pure index notation
At this point, we can stop dealing with with the basis vectors and forms. We used them to define the components, but we now do all calculations directly from the components. This means that we can do everything with numerical indices, without worrying about running out of letters. We can also let the dimensionality of the space be anything, not just 3. (In relativity, it is 4.)

The formulas we have gathered so far look like these:
 * $$\Phi(V) = \sum_{i=1}^N\Phi_i\ V^i$$


 * $$\Omega(V, W) = \sum_{i, j=1}^N\Omega_{ij}\ V^iW^j$$


 * $$T(\Phi, V) = \sum_{i, j=1}^NT^i_{\ j}\ \Phi_iV^j$$


 * $$\left(A(V)\right)^i = \sum_{j=1}^NA^i_{\ j}\ V^j$$


 * $$\Theta(V, \Phi, \Psi, \Lambda) = \sum_{i, j, k, l=1}^N\Theta_i^{\ j k l}\ V^i\Phi_j\Psi_k\Lambda_l$$

These formulas are examples of the famous index notation for tensors.

Einstein summation
Summations such as these, with a summation index appearing once in a superscript and once in a subscript, are extremely common in tensor calculations. The Einstein summation convention, named after Albert Einstein, who struggled with tensors when he was developing General Relativity, says that one can leave out the summation; it is implicit.
 * $$\Phi(V) = \Phi_i\ V^i$$


 * $$\Omega(V, W) = \Omega_{ij}\ V^iW^j$$


 * $$T(\Phi, V) = T^i_{\ j}\ \Phi_iV^j$$


 * $$\left(A(V)\right)^i = A^i_{\ j}\ V^j$$


 * $$\Theta(V, \Phi, \Psi, \Lambda) = \Theta_i^{\ j k l}\ V^i\Phi_j\Psi_k\Lambda_l$$

People doing serious tensor work make one other simplification&mdash;they don't bother with the left-hand-sides of the above equations. They treat the right-hand-sides as though they are the actual operations. That is,
 * $$\Phi_i\ V^i$$

literally means the application of the form $$\Phi\,$$ to the vector $$V\,$$. It's not just a shorthand formula telling how to calculate $$\Phi(V)\,$$, it actually denotes the operation.


 * $$\Omega_{ij}\ V^iW^j$$

literally means the application of the bilinear form $$\Omega\,$$ to the vector $$V\,$$ and $$W\,$$.

How can we tell that $$\Omega_{ij}\,$$ is a 2nd rank covariant tensor? Because it has two subscripts. Similarly, $$V^i\,$$ is a vector because it has one superscript. The number and position of superscripts and subscripts on a symbol indicate its rank and covariance. By being careful with the positions of superscripts and subscripts, the notation is expressive and unambiguous.

The rules for tensor equations are that indices in any term that appear once in a superscript and once in a subscript use the Einstein summation convention. When terms are added, or terms appear on both sides of an equation, the unsummed indices must match, and there is an implicit "for all" applying to them.

Another example of a tensor equation would be
 * $$V^i = 3\ W^i + X^i\,$$

meaning that $$V = 3\ W + X\,$$ as vectors.

Conventional notation for linear transformations
There is one more thing to notice about linear transformations. There is a conventional notation for describing them, in terms of matrices. The standard formula in conventional notation is that if
 * $$W = A(V)\,$$

then
 * $$W_i = \sum_{j=1}^NA_{i, j}\ V_j$$

where $$A_{i, j}\,$$ is the matrix of the transformation A. In the tensor formalism,
 * $$W^i = A^i_{\ j}\ V^j= \sum_{j=1}^NA^i_{\ j}\ V^j$$

so, aside from the fact that the superscript/subscript issue only applies in tensor notation,
 * $$A_{i, j}\,$$ (conventional notation)  $$ = A^i_{\ j}\,$$  (tensor notation)

The next article in this series is Tensors/Transformation rule under a change of basis.