Tensor Notation (Basics)
Introduction
Tensor (or index, or indicial, or Einstein) notation has been introduced in the previous pages during the discussions of vectors and matrices. This page reviews the fundamentals introduced on those pages, while the next page goes into more depth on the usefulness and power of tensor notation.
This page repeats the tensor notation segments of earlier pages nearly verbatim. If you have already read them, then there is nothing new here. You can continue to the next page, which addresses more advanced tensor notation topics.
Summation Convention
Tensor notation introduces one simple operational rule. It is to automatically sum any index appearing twice from 1 to 3.
As such, is simply the product of two vector components, the ith component of the vector with the jth component of the vector. However, is a completely different animal because the subscript appears twice in the term. Therefore, automatically expands to, and is shorthand for...
which is just the dot product of vectors and . Note that any letter could be used as the index (as was in this case), in order to invoke the automatic summation, however, it is critical that the same letter be used in both subscripts in order to do so.
Kronecker Delta
Tensor notation introduces two new symbols into the mix, the Kronecker Delta, , and the alternating or permutation tensor, . The Kronecker Delta, , serves as the identity matrix, , because it equals 1 when and 0 otherwise. So in a matrix indexed by and , the diagonal components equal 1 and the off-diagonal components equal 0.
Is It a Matrix or Not?
A note from the purests... The identity matrix is a matrix, but the Kronecker delta technically is not. is a single scalar value that is either 1 or 0 depending on the values of and . Or think of it as an individual component of the identity matrix, . This is also why tensor notation is not in bold, because it always refers to individual components of tensors, but never to a vector, matrix, or tensor as a whole.
Follow this link for an entertaining discussion between someone who gets it, and someone else who doesn't.
Kronecker Delta verses Dirac Delta
Don't confuse the Kronecker delta, , with the Dirac delta, . The Dirac delta is something totally different. It is often used in signal processing and equals 0 for all except . At , it approaches such that
Alternating Tensor
The alternating tensor, , is used in cross products as follows.
( c_i = \epsilon_{ijk} a_j b_k \qquad ) corresponds to ( \qquad {\bf c} = {\bf a} \times {\bf b} )
where , while , and all other combinations equal zero. Summation of the and indices from 1 to 3 is implied because they are repeated as subscripts. In other words, it is shorthand for
The equation is still general until a particular component is chosen for to be evaluated.
Cross Products Using Tensor Notation
Set to obtain the zth component of a cross product.
All subscripts are now specified, and this permits evaluation of all alternating tensors. All of them will equal zero except two. This leaves
which is consistent with the determinant result (as it had better be). Results for the xth and yth components are obtained by setting equal to 1 and 2, respectively.
Vector and Tensor Addition
Vector and tensor addition is written in tensor notation simply as
Vector Dot Products
A dot product of vectors and is written in tensor notation simply as . The summation from 1 to 3 is implied because the subscript ( in this case ) appears twice ( on and ). In other words:
Note that any letter could be used as the index (as was in this case), however, it is critical that the same letter be used on both subscripts in order to invoke the automatic summation.
Vector Cross Products
The alternating tensor, , is used in cross products as follows. (Yes, this does repeat the alternating tensor section above.)
where , while , and all other combinations equal zero. Summation of the and indices from 1 to 3 is implied because they are repeated as subscripts in the above equation. In other words, it is shorthand for
The equation is still general until a particular component is chosen for to be evaluated.
Cross Products Using Tensor Notation
Set to obtain the zth component of a cross product.
All subscripts are now specified, and this permits evaluation of all alternating tensors. All of them will equal zero except two. This leaves
which is consistent with the determinant result (as it had better be). Results for the xth and yth components are obtained by setting equal to 1 and 2, respectively.
The following example of area calculation of a triangle illustrates an important property of tensor notation, namely that the indices dictate the summation and order of multiplication, not the order in which the terms are written.
The area of a triangle bounded on two sides by vectors and is
In tensor notation, this is written in two steps as
or in a single equation as
Note that each index appears twice in the above equation because, by convention, it is not permitted to appear more than 2 times.
Order of Factors in Tensor Notation
Tensor notation allows for increased flexibility of the order in which factors are written than is permitted in vector notation. For example, is not equal to , although they are closely related. In contrast equals equals because the order of operation is dictated by the indices rather than the order the factors are written in. So in the above discussion, could also be written as . It is simply a matter of personal preference.
Vector Dyadic Products
Tensor notation of a dyadic product could not be simpler.
Dyadic Product Example
If , and , then the dyadic product of the two is
Tensor notation dictates that the value of any component is simply . For example, selecting and gives
Matrix Transpose
The transpose of is .
Determinant
The calculation of a determinant can be written in tensor notation in a couple different ways
Matrix Inverse
The inverse of is written as . Note that this is probably not rigorously correct since, as discussed earlier, neither nor are technically matrices themselves. They are only components of a matrix. Oh well...
The inverse can be calculated using
Matrix Multiplication
The dot product of two matrices multiplies each row of the first by each column of the second. Products are often written with a dot in matrix notation as , but sometimes written without the dot as . Multiplication rules are in fact best explained through tensor notation.
(Note that no dot is used in tensor notation.) The in both factors automatically implies
which is the ith row of the first matrix multiplied by the jth column of the second matrix. If, for example, you want to compute , then and , and
Matrix Multiplication Example
If ( \quad {\bf A} = \left[ \matrix { 1 & 2 & 3 \ 4 & 2 & 2 \ 2 & 3 & 4 } \right] \quad ) and ( \quad {\bf B} = \left[ \matrix { 1 & 4 & 7 \ 2 & 5 & 8 \ 3 & 6 & 9 } \right] \quad ) then implies
Tensor Notation and Computer Programming
Another advantage of tensor notation is that it spells for you how to write the computer code to do it. Note how the subscripts in the FORTRAN example below exactly match the tensor notation for . This is true for all tensor notation operations, not just this matrix dot product.
subroutine aa_dot_bb(n,a,b,c)
dimension a(n,n), b(n,n), c(n,n)
do i = 1,n
do j = 1,n
c(i,j) = 0
do k = 1,n
c(i,j) = c(i,j) + a(i,k) * b(k,j)
end do
end do
end do
return
endDouble Dot Products
The double dot product of two matrices produces a scalar result. It is written in matrix notation as . Once again, its calculation is best explained with tensor notation.
Since the and subscripts appear in both factors, they are both summed to give
Double Dot Product Example
If ( \quad {\bf A} = \left[ \matrix { 1 & 2 & 3 \ 4 & 2 & 2 \ 2 & 3 & 4 } \right] \quad ) and ( \quad {\bf B} = \left[ \matrix { 1 & 4 & 7 \ 2 & 5 & 8 \ 3 & 6 & 9 } \right] \quad ) then
Differentiation With Respect To Time
Differentiation with respect to time can be written in several forms.
One can use the derivative with respect to , or the dot, which is probably the most popular, or the comma notation, which is a popular subset of tensor notation. Note that the notation somewhat violates the tensor notation rule of double-indices automatically summing from 1 to 3. This is because time does not have 3 dimensions as space does, so it is understood that no summation is performed.
Differentiation With Respect To Spatial Coordinates
Differentiation of a scalar function with respect to is
Differentiation of a vector, , is
Differentiation of a tensor, , is
As with vectors, every component of a tensor is differentiated.
Divergence
The divergence of a vector is a scalar result. It is written as and computed as
As stated above, the divergence is written in tensor notation as . It is very important that both subscripts are the same because this dictates that they are automatically summed from 1 to 3. They can in fact be any letter one desires, so long as they are both the same letter.
Divergence Example
If , then the dot product is
Curl
The curl of a vector is written in tensor notation as . It is critical to recognize that the vector is written as here, not . This is because the curl is , not .
As with cross products, the fact that and both occur twice in dictates that both are automatically summed from 1 to 3. The term expands to
Curls Using Tensor Notation
To obtain the yth component of a curl, set equal to 2 in the above equation.
All subscripts are now specified, and this permits evaluation of all alternating tensors. All of them will equal zero except two, leaving
which is again consistent with the determinant result (as it must be). Results for the xth and zth components are obtained by setting equal to 1 and 3, respectively.
Laplacian
The Laplacian is the divergence of the gradient of a function. It often arises in 2nd order partial differential equations and is written in matrix notation as and in tensor notation as . Its definition is
Laplacian Example
Determine the Laplacian of .
Start by calculating the gradient of .
And the divergence of the gradient (which is the Laplacian after all) is
Derivatives of Products
The product rule applies to the derivatives of vector (and tensor) products just as it does for scalar products. Examples include the gradient of a dot product
the derivative of a cross product
and the derivative of a dyadic product.