Index notation

Using the so-called index notation allows us to express complicated sums and products in a compact form. This compact form is useful for performing derivations involving tensor expressions and can also be used in other situations. However, it can take a bit of practice to become comfortable with the notation before using it efficiently. Still, you probably have already used index notation without thinking about it: Consider the vector v\underline{\boldsymbol{ v}}, if you want to write out its components, you might write

v=[v1,v2,v3]T\begin{aligned} \underline{\boldsymbol{ v}} = \left[v_1, v_2, v_3\right]^{\mathrm{T}} \end{aligned}

Each component is then vjv_j, where jj can be 1, 2, or 3. Normally when working with tensors, we will only consider up to the 3 spatial dimensions. For index notation in general we can consider an aribtrary number of dimensions, e.g. j{1,2, ,N}j\in\lbrace 1, 2, \cdots, N\rbrace. In addition to increasing the number of dimensions, NN, we can also consider objects of higher order. For example, if we have a matrix M\boldsymbol{ M} with dimension 3, we can write this

M=[M11M12M13M21M22M23M31M32M33]\begin{aligned} \boldsymbol{ M} = \begin{bmatrix} M_{11} & M_{12} & M_{13} \\ M_{21} & M_{22} & M_{23} \\ M_{31} & M_{32} & M_{33} \end{bmatrix} \end{aligned}

Each component is then MijM_{ij}, where each row is given by i{1,2,3}i\in\lbrace1,2,3\rbrace and each column by j{1,2,3}j\in\lbrace1,2,3\rbrace. As for the dimension, we can also consider an arbitrary order, e.g. a 4th order object, aijkla_{ijkl}.

Definition:
The dimension NN of an index ii is how many integers it represents, i.e. i1,2, ,Ni\in{1,2,\cdots,N}
Definition:
The order of a symbol, expressed in index notation, is the number of indices, MM, i.e. ai1 i2 iMa_{i_1\,i_2\,\cdots\,i_M}.

Einstein's summation convention

The compactness of the index notation comes from the "Einstein summation convention", Einstein (1916). If we would like to represent the matrix-vector multiplication u=Mv\underline{\boldsymbol{ u}}=\underline{\boldsymbol{ M}}\underline{\boldsymbol{ v}} above using our index notation, this becomes

ui=j=13Mijvj=Mi1v1+Mi2v2+Mi3v3\begin{aligned} u_i = \sum_{j=1}^3 M_{ij} v_j = M_{i1} v_1 + M_{i2} v_2 + M_{i3} v_3 \end{aligned}

With the Einstein summation convention, we do not have to write the summation symbol and can write

ui=Mijvj\begin{aligned} u_i = M_{ij}v_j \end{aligned}

How do we know that this implies the sum?
We see that the index j\textcolor{blue}{ j} is repeated in MijM_{i\textcolor{blue}{ j}} and vjv_{\textcolor{blue}{ j}}. This repeated index in the same term implies a summation over each j\textcolor{blue}{ j}.

Now you might ask, why not with i\textcolor{green}{ i}, it is repeated in uiu_{\textcolor{green}{ i}} and MijM_{\textcolor{green}{ i}\textcolor{blue}{ j}}?
The difference is that uiu_{\textcolor{green}{ i}} and MijM_{\textcolor{green}{ i}\textcolor{blue}{ j}} are not in the same term. We call i\textcolor{green}{ i} a "free index", while j\textcolor{blue}{ j} is called a "dummy index".

What if I don't want to sum over a repeated index?
Yes, there are cases when we want to do this. For example, if we need to express the diagonal terms of a second-order index object. Then we can write, e.g.

ci=aii(No sum on i)\begin{aligned} c_i = a_{ii} \quad \text{(No sum on $i$)} \end{aligned}

but it is seldom needed to write something like this, but we use it later for the spectral decomposition

Index juggling

Consider that we have a few index objects representing vectors and matrices, e.g. AijA_{ij} for A\boldsymbol{ A}, BijB_{ij} for B\boldsymbol{ B}, cic_i for c\underline{\boldsymbol{ c}}, did_i for d\underline{\boldsymbol{ d}}, and eie_i for e\underline{\boldsymbol{ e}}. If we want to write the expression e=ABc+dTB\underline{\boldsymbol{ e}}=\boldsymbol{ A}\boldsymbol{ B}\underline{\boldsymbol{ c}} + \underline{\boldsymbol{ d}}^T\boldsymbol{ B} we have to change the indices to match the expression, and write e.g.

ei=AijBjkck+djBji\begin{aligned} e_{\textcolor{green}{ i}} = A_{\textcolor{green}{ i}\textcolor{blue}{ j}} B_{\textcolor{blue}{ jk}} c_{\textcolor{blue}{ k}} + d_{\textcolor{blue}{ j}} B_{\textcolor{blue}{ j}\textcolor{green}{ i}} \end{aligned}

We are free to change indices in this expression if we adhere to the following rules

  1. If we change a free index, we must change that index in all terms, and we cannot use an index that already exists in any of the terms

  2. If we change a dummy index, we must change that dummy index for both objects in that term

For example, we can change the free index i\textcolor{green}{ i} to n\textcolor{green}{ n} in eie_{\textcolor{green}{ i}}, if we also change it in the other terms, i.e.

en=AnjBjkck+djBjn\begin{aligned} e_{\textcolor{green}{ n}} = A_{\textcolor{green}{ n}\textcolor{blue}{ j}} B_{\textcolor{blue}{ jk}} c_{\textcolor{blue}{ k}} + d_{\textcolor{blue}{ j}} B_{\textcolor{blue}{ j}\textcolor{green}{ n}} \end{aligned}

Or we can change the dummy index j\textcolor{blue}{ j} to m\textcolor{blue}{ m} in the last term, even if we don't change it in the first term (on the right hand side),

ei=AijBjkck+dmBmi\begin{aligned} e_{\textcolor{green}{ i}} = A_{\textcolor{green}{ i}\textcolor{blue}{ j}} B_{\textcolor{blue}{ jk}} c_{\textcolor{blue}{ k}} + d_{\textcolor{blue}{ m}} B_{\textcolor{blue}{ m}\textcolor{green}{ i}} \end{aligned}

Kronecker delta

One common special symbol for index notation is the "Kronecker delta", δij\delta_{ij}. It is defined by

δij={1i=j0ij\begin{aligned} \delta_{ij} = \left\lbrace \begin{matrix} 1 & i=j \\ 0 & i\neq j \end{matrix} \right. \end{aligned}

This can be though of as an identity operator, because Aijδjk=AikA_{ij} \delta_{jk} = A_{ik}, as can be seen if we expand the expression (assume dimension 2 for brevity)

k=1:Aijδj1=Ai1δ11+Ai2δ21=Ai1,δ11=1,δ12=0k=2:Aijδj2=Ai1δ12+Ai2δ22=Ai2,δ21=0,δ22=1\begin{aligned} k=1: \quad A_{ij} \delta_{j1} &= A_{i1}\delta_{11} + A_{i2}\delta_{21} = A_{i1}, \quad \delta_{11}=1, \delta_{12}=0\\ k=2: \quad A_{ij} \delta_{j2} &= A_{i1}\delta_{12} + A_{i2}\delta_{22} = A_{i2}, \quad \delta_{21}=0, \delta_{22}=1 \end{aligned}

Levi-Civita symbol

The "Levi-Civita symbol" may also be denoted the "permutation symbol". While it can be defined in arbitrary order, we will only consider the definitions for 2nd and 3rd orders,

εij={1if(i,j)=(1,2)1if(i,j)=(2,1)0ifi=jεijk={1if (i,j,k)is (1,2,3), (2,3,1), or (3,1,2)1if (i,j,k)is (3,2,1), (2,1,3), or (1,3,2)0else (if any two indices are equal)\begin{aligned} \varepsilon_{ij} &= \left\lbrace \begin{matrix} \phantom{-}1 & \text{if} & (i,j) = (1,2)\\ -1 & \text{if} & (i,j) = (2,1) \\ \phantom{-}0 & \text{if} & i = j \end{matrix}\right.\\ \varepsilon_{ijk} &= \left\lbrace \begin{matrix} \phantom{-}1 & \text{if }(i,j,k) \text{is (1,2,3), (2,3,1), or (3,1,2)} \\ -1 & \text{if }(i,j,k) \text{is (3,2,1), (2,1,3), or (1,3,2)} \\ \phantom{-}0 & \text{else (if any two indices are equal)} \end{matrix}\right. \end{aligned}

The following illustration from Wikipedia illustrates the sign convention for 3rd order,

Permutation indices 3d numerical