Tensor operations

The previous section introduced operations between tensors. In this section, we will focus on operations on single tensors. We will use aa for a scalar (0th order tensor), u\underline{\boldsymbol{ u}} for a vector (1st order tensor), a\boldsymbol{ a} for a 2nd order tensor, and A\textbf{\textsf{ A}} for a 4th order tensor. The following operations are discussed:

Transposition, "T\bullet^{\mathrm{T}}"

For zero and first order tensors, transposition is not defined or has no effect (depending on your point of view). I.e. aT=aa^{\mathrm{T}}=a and uT=u\underline{\boldsymbol{ u}}^{\mathrm{T}}=\underline{\boldsymbol{ u}}. Note that, in contrary to linear algebra, we do not distinguish between row and column vectors. A vector is just a 1st order tensor.

Second-order tensors

Definition:
The transpose, aT\boldsymbol{ a}^{\mathrm{T}}, of a 2nd order tensor, a=aijeiej\boldsymbol{ a}=a_{\textcolor{blue}{ i}\textcolor{red}{ j}}\textcolor{blue}{ \underline{\boldsymbol{ e}}_i}\otimes\textcolor{red}{ \underline{\boldsymbol{ e}}_j}, is defined as
aT=aijejei=ajieiej\boldsymbol{ a}^{\mathrm{T}}=a_{\textcolor{blue}{ i}\textcolor{red}{ j}}\textcolor{red}{ \underline{\boldsymbol{ e}}_j}\otimes\textcolor{blue}{ \underline{\boldsymbol{ e}}_i}=a_{\textcolor{red}{ j}\textcolor{blue}{ i}}\textcolor{blue}{ \underline{\boldsymbol{ e}}_i}\otimes\textcolor{red}{ \underline{\boldsymbol{ e}}_j}
When we take the transpose of a 2nd order tensor, the basis change order, but the indices remain the same. If both basis systems, ei\underline{\boldsymbol{ e}}_{ i} and ej\underline{\boldsymbol{ e}}_{ j} are the same, transposition is equivalent to to switching the indices on aija_{ij} to ajia_{ji}. When doing this in index notation, we implicitly assume that the basis vector order remains unchanged.

[a+b]T=[aijeiej+bijeiej]T=[[aij+bij]eiej]T=(aij+bij)ejei=aijejei+bijejei=aT+bT\begin{aligned} \left[\boldsymbol{ a}+\boldsymbol{ b}\right]^{\mathrm{T}} &= \left[a_{ij}\underline{\boldsymbol{ e}}_{ i}\otimes\underline{\boldsymbol{ e}}_{ j} + b_{ij}\underline{\boldsymbol{ e}}_{ i}\otimes\underline{\boldsymbol{ e}}_{ j}\right]^{\mathrm{T}} = \left[[a_{ij}+b_{ij}]\underline{\boldsymbol{ e}}_{ i}\otimes\underline{\boldsymbol{ e}}_{ j}\right]^{\mathrm{T}} \\ &= (a_{ij}+b_{ij}) \underline{\boldsymbol{ e}}_{ j}\otimes\underline{\boldsymbol{ e}}_{ i} = a_{ij} \underline{\boldsymbol{ e}}_{ j}\otimes\underline{\boldsymbol{ e}}_{ i} + b_{ij} \underline{\boldsymbol{ e}}_{ j}\otimes\underline{\boldsymbol{ e}}_{ i} \\ &= \boldsymbol{ a}^{\mathrm{T}} + \boldsymbol{ b}^{\mathrm{T}} \end{aligned}
[ab]T=[aijeiejbklekel]T=aijbkl[ejek][eiel]T,ejek=δjk=ekej=aijbkl[ejek]elei=bklelekaijejei=bTaT\begin{aligned} \left[\boldsymbol{ a}\boldsymbol{ b}\right]^{\mathrm{T}} &= \left[a_{ij}\underline{\boldsymbol{ e}}_{ i}\otimes\underline{\boldsymbol{ e}}_{ j} \cdot b_{kl}\underline{\boldsymbol{ e}}_{ k}\otimes\underline{\boldsymbol{ e}}_{ l}\right]^{\mathrm{T}} \\ &= a_{ij} b_{kl} \left[\underline{\boldsymbol{ e}}_j\cdot\underline{\boldsymbol{ e}}_k\right] [\underline{\boldsymbol{ e}}_{ i}\otimes\underline{\boldsymbol{ e}}_{ l}]^{\mathrm{T}}, \quad \underline{\boldsymbol{ e}}_j\cdot\underline{\boldsymbol{ e}}_k=\delta_{jk}=\underline{\boldsymbol{ e}}_k\cdot\underline{\boldsymbol{ e}}_j \\ &= a_{ij} b_{kl} \left[\underline{\boldsymbol{ e}}_j\cdot\underline{\boldsymbol{ e}}_k\right] \underline{\boldsymbol{ e}}_{ l}\otimes\underline{\boldsymbol{ e}}_{ i} = b_{kl} \underline{\boldsymbol{ e}}_{ l}\otimes\underline{\boldsymbol{ e}}_{ k} \cdot a_{ij} \underline{\boldsymbol{ e}}_{ j}\otimes\underline{\boldsymbol{ e}}_{ i} \\ &= \boldsymbol{ b}^{\mathrm{T}}\boldsymbol{ a}^{\mathrm{T}} \end{aligned}

We can also write the transposition directly on the index symbol, aijTa^{\mathrm{T}}_{ij}. For a tensor with equal basis this is the same as transposition of the tensor. However, it might also be used in expressions when the indices are not contracted with basis vectors. Consider the expression aijbi=ajiTbia_{ij} b_i = a^{\mathrm{T}}_{ji} b_i, where in the first we contract bb with aa's first index, and in the second we contract with aTa^{\mathrm{T}}'s second index (the same as aa's first index). Hence, we have that aij=ajiTa_{ij} = a^{\mathrm{T}}_{ji}

Fourth order tensors

Definition:
The major transpose, AT\textbf{\textsf{ A}}^{\mathrm{T}}, of a 2nd order tensor, A= Aijkleiejekel\textbf{\textsf{ A}}=\textsf{ A}_{ \textcolor{blue}{ ij}\textcolor{red}{ kl}}\textcolor{blue}{ \underline{\boldsymbol{ e}}_{ i}\otimes\underline{\boldsymbol{ e}}_{ j}}\otimes\textcolor{red}{ \underline{\boldsymbol{ e}}_{ k}\otimes\underline{\boldsymbol{ e}}_{ l}}, is defined as
AT= Aijklekeleiej= Aklijeiejekel\textbf{\textsf{ A}}^{\mathrm{T}}=\textsf{ A}_{ \textcolor{blue}{ ij}\textcolor{red}{ kl}}\textcolor{red}{ \underline{\boldsymbol{ e}}_{ k}\otimes\underline{\boldsymbol{ e}}_{ l}}\otimes\textcolor{blue}{ \underline{\boldsymbol{ e}}_{ i}\otimes\underline{\boldsymbol{ e}}_{ j}}=\textsf{ A}_{ \textcolor{red}{ kl}\textcolor{blue}{ ij}}\textcolor{blue}{ \underline{\boldsymbol{ e}}_{ i}\otimes\underline{\boldsymbol{ e}}_{ j}}\otimes\textcolor{red}{ \underline{\boldsymbol{ e}}_{ k}\otimes\underline{\boldsymbol{ e}}_{ l}}
When taking the major transpose of a 4th order tensor, the basis change order. The first two bases exchange places with the two last while maintaining their internal order. For equal base vectors, transposition is equivalent to switching the indices Aijkl\textsf{ A}_{ \textcolor{blue}{ ij}\textcolor{red}{ kl}} to Aklij\textsf{ A}_{ \textcolor{red}{ kl}\textcolor{blue}{ ij}}. In this case, we implicitly assume the same basis vector order.

Usually, the transpose of a 4th order tensor implies the major transpose. However, we could also consider minor transposition, i.e. going from Aijkl\textsf{ A}_{ ijkl} to Ajikl\textsf{ A}_{ jikl}, Aijlk\textsf{ A}_{ ijlk}, or Ajilk\textsf{ A}_{ jilk}. These would all be minor transpositions but have no clear symbol such as T\bullet^{\mathrm{T}}.

Trace, tr()\mathrm{tr}(\bullet)

The trace is an operation normally associated with second order tensors, and is the sum of the diagonal entries

Definition:
The trace of a second order tensor, a=aijeiej\boldsymbol{ a}=a_{ij}\underline{\boldsymbol{ e}}_{ i}\otimes\underline{\boldsymbol{ e}}_{ j}, is defined as tr(a)=a:I=aii\mathrm{tr}(\boldsymbol{ a})=\boldsymbol{ a}:\boldsymbol{ I}=a_{ii}

The trace measures the spherical (volumetric) part of a tensor. For example, the pressure, pp, is defined as p=tr(σ)/3p=-\mathrm{tr}(\boldsymbol{ \sigma})/3 where σ\boldsymbol{ \sigma} is the stress tensor.

Norm, "\left\vert\left\vert \bullet\right\vert\right\vert"

The norm of a tensor gives a scalar measure of its magnitude.

Definition:
The norm of a tensor, b=bi1i2iNei1ei2eiN\bm{b}=b_{i_1 i_2 \cdots i_N}\underline{\boldsymbol{ e}}_{ i_1}\otimes\underline{\boldsymbol{ e}}_{ i_2}\otimes\cdots\otimes\underline{\boldsymbol{ e}}_{ i_N}, of arbitrary order NN, is
b=bi1i2iNbi1i2iN\left\vert\left\vert \bm{b}\right\vert\right\vert=\sqrt{b_{i_1 i_2 \cdots i_N} b_{i_1 i_2 \cdots i_N}}
in an orthonormal basis system
If we break this down to common orders, we have

  • Scalar (0th order): a=a2=a\left\vert\left\vert a\right\vert\right\vert=\sqrt{a^2}=\left\vert a\right\vert (absolute value)

  • Vector (1st order): u=uu=uiui\left\vert\left\vert \underline{\boldsymbol{ u}}\right\vert\right\vert=\sqrt{\underline{\boldsymbol{ u}}\cdot\underline{\boldsymbol{ u}}}=\sqrt{u_i u_i} (eucledian length of vector)

  • 2nd order tensor: a=a:a=aijaij\left\vert\left\vert \boldsymbol{ a}\right\vert\right\vert=\sqrt{\boldsymbol{ a}:\boldsymbol{ a}}=\sqrt{a_{ij} a_{ij}}

  • 4th order tensor: A= A:: A= Aijkl Aijkl\left\vert\left\vert \textbf{\textsf{ A}}\right\vert\right\vert=\sqrt{\textbf{\textsf{ A}}::\textbf{\textsf{ A}}}=\sqrt{\textsf{ A}_{ ijkl}\textsf{ A}_{ ijkl}}

Inverse, "1\bullet^{-1}"

The inverse is only defined for even order tensors. Instead of defining it generally, we will here only consider 0th, 2nd and 4th order tensors

Scalars

The inverse, a1a^{-1}, of a scalar, aa, is such that aa1=1a a^{-1} = 1. In this case, we can solve it directly as a1=1/aa^{-1} = 1/a.

2nd order tensors

Definition:
The inverse, a1\boldsymbol{ a}^{-1}, of a 2nd order tensor, a=aijeiej\boldsymbol{ a}=a_{ij}\underline{\boldsymbol{ e}}_{ i}\otimes\underline{\boldsymbol{ e}}_{ j}, is defined by
aa1=I=δijeiej\boldsymbol{ a}\boldsymbol{ a}^{-1}=\boldsymbol{ I}=\delta_{ij}\underline{\boldsymbol{ e}}_{ i}\otimes\underline{\boldsymbol{ e}}_{ j}

Here the 2nd order identity tensor, I\boldsymbol{ I} was used, see Special Tensors.

If we have the tensor c=ab\boldsymbol{ c}=\boldsymbol{ a}\boldsymbol{ b}, then we check if c1=b1a1\boldsymbol{ c}^{-1}=\boldsymbol{ b}^{-1}\boldsymbol{ a}^{-1} is a solution
I=cc1=abb1a1=aIa1=aa1=I\begin{aligned} \boldsymbol{ I}=\boldsymbol{ c}\boldsymbol{ c}^{-1}=\boldsymbol{ a}\boldsymbol{ b}\boldsymbol{ b}^{-1}\boldsymbol{ a}^{-1}=\boldsymbol{ a}\boldsymbol{ I}\boldsymbol{ a}^{-1}=\boldsymbol{ a}\boldsymbol{ a}^{-1}=\boldsymbol{ I} \end{aligned}
So yes! We see that c1=b1a1\boldsymbol{ c}^{-1}=\boldsymbol{ b}^{-1}\boldsymbol{ a}^{-1} is actually true. Note the similarity to the transposition.

However, there is no easy relation for c1\boldsymbol{ c}^{-1} if c=a+b\boldsymbol{ c}=\boldsymbol{ a}+\boldsymbol{ b}!

4th order tensors

Definition:
The inverse, A1\textbf{\textsf{ A}}^{-1}, of a 4th order tensor, A= Aijkleiejekel\textbf{\textsf{ A}}=\textsf{ A}_{ ijkl}\underline{\boldsymbol{ e}}_{ i}\otimes\underline{\boldsymbol{ e}}_{ j}\otimes\underline{\boldsymbol{ e}}_{ k}\otimes\underline{\boldsymbol{ e}}_{ l}, is defined by
A: A1= I=δikδjleiejekel\textbf{\textsf{ A}}:\textbf{\textsf{ A}}^{-1}=\textbf{\textsf{ I}}=\delta_{ik}\delta_{jl}\underline{\boldsymbol{ e}}_{ i}\otimes\underline{\boldsymbol{ e}}_{ j}\otimes\underline{\boldsymbol{ e}}_{ k}\otimes\underline{\boldsymbol{ e}}_{ l}

Algorithms for determining the inverse of 4th order tensors are virtually non-existent. However, we may represent the entities in a 4th order tensor as a matrix using the Voigt representation, A\underline{\underline{\mathsf{ A}}}. In this notation, the double contraction reduces to a regular matrix-matrix product: A: A\textbf{\textsf{ A}}:\textbf{\textsf{ A}} is equivalent to AA\underline{\underline{\mathsf{ A}}}\cdot\underline{\underline{\mathsf{ A}}}. Hence, to calculate the inverse of a 4th order tensor, it is usually necessary to convert to the Voigt representation, calculate the inverse, and then convert back.

Determinant, "det()\mathrm{det}(\bullet)"

The standard determinant is only defined for 2nd order tensors. However, it is possible to generalize to higher dimensions. For a 2nd order tensor, it is straight-forward to calculate as the determinant of a matrix by filling the matrix by the tensor coefficients, e.g. in 2d:

a=aijeiej,[aij]=[a11a12a21a22]det(a)=a11a22a21a12\begin{aligned} \boldsymbol{ a}=a_{ij} \underline{\boldsymbol{ e}}_{ i}\otimes\underline{\boldsymbol{ e}}_{ j}, \quad \left[a_{ij}\right] = \begin{bmatrix} a_{11} & a_{12} \\ a_{21} & a_{22} \end{bmatrix} \\ \mathrm{det}(\boldsymbol{ a}) = a_{11} a_{22} - a_{21} a_{12} \end{aligned}

We can also define this by using the Levi-Civita symbol,

2d: det(a)=12!εi1j1εi2j2ai1i2aj1j2=εijai1aj23d: det(a)=13!εi1j1k1εi2j2k2ai1i2aj1j2ak1k2=εijkai1aj2ak3\begin{aligned} \text{2d: }\mathrm{det}(\boldsymbol{ a}) &= \frac{1}{2!} \varepsilon_{i_1 j_1} \varepsilon_{i_2 j_2} a_{i_1 i_2} a_{j_1 j_2} = \varepsilon_{ij} a_{i1} a_{j2} \\ \text{3d: }\mathrm{det}(\boldsymbol{ a}) &= \frac{1}{3!} \varepsilon_{i_1 j_1 k_1} \varepsilon_{i_2 j_2 k_2} a_{i_1 i_2} a_{j_1 j_2} a_{k_1 k_2} = \varepsilon_{ijk} a_{i1} a_{j2} a_{k3} \end{aligned}

which allows us to generalize to higher tensor orders, such as for a 4th order tensor in 3d:

det(A)=13!εi1j1k1εi2j2k2εi3j3k3εi4j4k4Ai1i2i3i4Aj1j2j3j3Ak1k2k3k4\begin{aligned} \mathrm{det}(\boldsymbol{ A}) &= \frac{1}{3!} \varepsilon_{i_1 j_1 k_1} \varepsilon_{i_2 j_2 k_2} \varepsilon_{i_3 j_3 k_3} \varepsilon_{i_4 j_4 k_4} A_{i_1 i_2 i_3 i_4} A_{j_1 j_2 j_3 j_3} A_{k_1 k_2 k_3 k_4} \end{aligned}

Exponentiation, "n\bullet^n"

Sometimes, it is convenient to write a series of dot products between the same tensor. We can do this as we would for scalars, by using exponentiation:

Definition:
A 2nd order tensor, a\boldsymbol{ a}, to the power of nn, is defined as
an=a1a2a3an\boldsymbol{ a}^n = \underset{1}{\boldsymbol{ a}}\cdot\underset{2}{\boldsymbol{ a}}\cdot\underset{3}{\boldsymbol{ a}}\cdots\underset{n}{\boldsymbol{ a}}
where the numbers just number the tensors.

Similarly, we can define this for a fourth order tensor.

Definition:
A 4th order tensor, A\textbf{\textsf{ A}}, to the power of nn, is defined as
An= A1: A2: A3:: An\textbf{\textsf{ A}}^n = \underset{1}{\textbf{\textsf{ A}}}:\underset{2}{\textbf{\textsf{ A}}}:\underset{3}{\textbf{\textsf{ A}}}:\cdots:\underset{n}{\textbf{\textsf{ A}}}
where the numbers just number the tensors.

Exponential, "exp()\exp(\bullet)"

The exponential function have some very nice properties for differentiation. It also occurs frequently as a solution to differential equations. It is therefore interesting to define the exponential of a tensor. For a 2nd order tensor, we can define the exponential as

Definition:
The exponential, exp\exp, of a 2nd order tensor, a\boldsymbol{ a}, is defined by
exp(a)=n=0ann!,a0=I\exp(\boldsymbol{ a}) = \sum_{n=0}^{\infty}\frac{\boldsymbol{ a}^n}{n!}, \quad \boldsymbol{ a}^0 = \boldsymbol{ I}