You are on page 1of 9

12/30/13

Tensor Notation (Basics)

Tensor Notation (Basics)


home > basic math > tensor notation (basic)

Search Continuum Mechanics Website


Search

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, ai bj is simply the product of two vector components, the ith component of the a vector with the jth component of the b vector. However, ai bi is a completely different animal because the subscript i appears twice in the term. Therefore, ai bi automatically expands to, and is shorthand for...

ai bi a1 b 1 + a2 b2 + a3 b3

which is just the dot product of vectors a and b. Note that any letter could be used as the index (as i 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, ij , and the alternating or permutation tensor, ijk . The Kronecker Delta, ij , serves as the identity matrix, I, because it equals 1 when i = j and 0 otherwise. So in a matrix indexed by i and j , 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. ij is a single scalar value that is either 1 or 0 depending on the values of i and j . Or think of it as an individual component of the identity matrix, I. 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, ij , with the Dirac delta, (t) . The Dirac delta is something totally different. It is often used in signal processing and equals 0 for all t except t = 0. At t = 0 , it approaches such that

www.continuummechanics.org/cm/tensornotationbasic.html

f (x)

(t)

dx = f (0)

1/9

12/30/13

Tensor Notation (Basics)


f (x) (t) dx = f (0)

Alternating Tensor
The alternating tensor, ijk , is used in cross products as follows. corresponds to

ci = ijk aj bk

c = a b

where 123 = 231 = 312 = 1 , while 321 = 213 = 132 = 1 , and all other combinations equal zero. Summation of the j and k indices from 1 to 3 is implied because they are repeated as subscripts. In other words, it is shorthand for

ci

ijk aj bk

i11 a1 b1 i21 a2 b1 i31 a3 b1

+ + +

i12 a1 b2 i22 a2 b2 i32 a3 b2

+ + +

i13 a1 b3 i23 a2 b3 i33 a3 b3

+ +

The equation is still general until a particular component is chosen for i to be evaluated.

Cross Products Using Tensor Notation


Set i
= 3

to obtain the zth component of a cross product.

c3

3 jk aj bk

311 a1 b1 321 a2 b1 331 a3 b1

+ + +

312 a1 b2 322 a2 b2 332 a3 b2

+ + +

313 a1 b3 323 a2 b3 333 a3 b3

+ +

All subscripts are now specified, and this permits evaluation of all alternating tensors. All of them will equal zero except two. This leaves

c3

3 jk aj bk

a1 b2 a2 b1

which is consistent with the determinant result (as it had better be). Results for the xth and yth components are obtained by setting i equal to 1 and 2, respectively.

Vector and Tensor Addition


Vector and tensor addition is written in tensor notation simply as

ci = ai + bi

and

cij = aij + bij

Vector Dot Products


b www.continuummechanics.org/cm/tensornotationbasic.html
i bi

2/9

12/30/13

Tensor Notation (Basics)

A dot product of vectors a and b is written in tensor notation simply as ai bi . The summation from 1 to 3 is implied because the subscript ( i in this case ) appears twice ( on a and b ). In other words:

ai bi a1 b 1 + a2 b2 + a3 b3

Note that any letter could be used as the index (as i 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, ijk , is used in cross products as follows. (Yes, this does repeat the alternating tensor section above.)

ci = ijk aj bk

where 123 = 231 = 312 = 1 , while 321 = 213 = 132 = 1 , and all other combinations equal zero. Summation of the j and k indices from 1 to 3 is implied because they are repeated as subscripts in the above equation. In other words, it is shorthand for

ci

ijk aj bk

i11 a1 b1 i21 a2 b1 i31 a3 b1

+ + +

i12 a1 b2 i22 a2 b2 i32 a3 b2

+ + +

i13 a1 b3 i23 a2 b3 i33 a3 b3

+ +

The equation is still general until a particular component is chosen for i to be evaluated.

Cross Products Using Tensor Notation


Set i
= 3

to obtain the zth component of a cross product.

c3

3 jk aj bk

311 a1 b1 321 a2 b1 331 a3 b1

+ + +

312 a1 b2 322 a2 b2 332 a3 b2

+ + +

313 a1 b3 323 a2 b3 333 a3 b3

+ +

All subscripts are now specified, and this permits evaluation of all alternating tensors. All of them will equal zero except two. This leaves

c3

3 jk aj bk

a1 b2 a2 b1

which is consistent with the determinant result (as it had better be). Results for the xth and yth components are obtained by setting i 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 a and b is

1 Area = 2 | a b|

In tensor notation, this is written in two steps as


www.continuummechanics.org/cm/tensornotationbasic.html 3/9

12/30/13

Tensor Notation (Basics)

1 ci = ijk aj bk and Area = 2

ci ci

or in a single equation as
ijk aj bk imn am bn

1 Area = 2

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, a b is not equal to b a, although they are closely related. In contrast ijk aj bk equals ijk bk aj equals aj bk ijk because the order of operation is dictated by the indices rather than the order the factors are written in. So in the above discussion, ijk aj bk imn am bn could also be written as ijk imn aj bk am bn . It is simply a matter of personal preference.

Vector Diadic Products


Tensor notation of a diadic product could not be simpler.

cij = ai bj

Diadic Product Example


If a
= (3, 7, 2),

and b

= (1, 2, 3),

then the diadic product of the two is

a b =

3 1 7 1 2 1

3 2 7 2 2 2

3 3 7 3 2 3

3 7 2

6 14 4

9 21 6

Tensor notation dictates that the value of any cij component is simply ai bj . For example, selecting i

= 2

and j

= 3

gives

c23

a2 b3

7 3

21

Matrix Transpose
The transpose of Aij is Aj i .
www.continuummechanics.org/cm/tensornotationbasic.html 4/9

12/30/13

Tensor Notation (Basics)

Determinant
The calculation of a determinant can be written in tensor notation as

det(A) = ijk A i1 Aj2 Ak3

Matrix Inverse
The inverse of Aij is written as Aij . Note that this is probably not rigorously correct since, as discussed earlier, neither Aij nor Aij are technically matrices themselves. They are only components of a matrix. Oh well...
1 1

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 A B, but sometimes written without the dot as AB. Multiplication rules are in fact best explained through tensor notation.

C ij = Aik Bkj

(Note that no dot is used in tensor notation.) The k in both factors automatically implies

C ij = A i1 B1 j + Ai2 B2 j + Ai3 B3 j

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 C 23 , then i = 2 and j = 3 , and

C 23 = A 21 B13 + A22 B23 + A23 B33

Matrix Multiplication Example


If
A = 1 4 2 2 2 3 3 2 4

and

B =

1 2 3

4 5 6

7 8 9

then Aik Bkj implies

1 4 2

2 2 3

3 2 4

1 2 3

4 5 6

7 8 9

14 14 20

32 38 47

50 62 74

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 C ij = Aik Bkj . This is true for all tensor notation operations, not just this matrix dot product.
s u b r o u t i n ea a _ d o t _ b b ( n , a , b , c ) d i m e n s i o na ( n , n ) ,b ( n , n ) ,c ( n , n ) d oi=1 , n

www.continuummechanics.org/cm/tensornotationbasic.html

5/9

12/30/13

Tensor Notation (Basics)


d oj=1 , n c ( i , j )=0 d ok=1 , n c ( i , j )=c ( i , j )+a ( i , k )*b ( k , j ) e n dd o e n dd o e n dd o r e t u r n e n d

Double Dot Products


The double dot product of two matrices produces a scalar result. It is written in matrix notation as A best explained with tensor notation.
: B.

Once again, its calculation is

A : B = Aij Bij

Since the i and j subscripts appear in both factors, they are both summed to give

A : B

Aij Bij

A11 B11 A21 B21 A31 B31

+ + +

A12 B12 A22 B22 A32 B32

+ + +

A13 B13 A23 B23 A33 B33

+ +

Double Dot Product Example


If
A = 1 4 2 2 2 3 3 2 4

and

B =

1 2 3

4 5 6

7 8 9

then

Aij Bij

1 1 4 2 2 3

+ + +

2 4 2 5 3 6

+ + +

3 7 2 8 4 9

+ +

124

Differentiation With Respect To Time


Differentiation with respect to time can be written in several forms.

dx velocity = dt = (

d x1 dt

dx2 dt

dx3 dt

x i

xi,t

dv acceleration = dt = (

dv1 dt

dv2 dt

dv3 dt

i v

vi,t

Use of the dot to indicate time differentiation is popular even in the midst of conventional tensor notation. Otherwise, the comma notation
www.continuummechanics.org/cm/tensornotationbasic.html 6/9

12/30/13

Tensor Notation (Basics)

is also popular, especially when the derivatives are with respect to a spatial coordinate.

Differentiation With Respect To Spatial Coordinates


Differentiation of a scalar function f (x) with respect to xj is

f or x j f, j

Differentiation of a vector, v, is

v or x j (

vx x j

vy , x j ,

vz x j

or

vi, j

Differentiation of a tensor, , is

or x k ij,k

As with vectors, every component of a tensor is differentiated.

Divergence
The divergence of a vector is a scalar result. It is written as vi,i and computed as

vi,i =

v1 x1 vx x

v2 x2 vy

v3 x3 vz z

+ y

As stated above, the divergence is written in tensor notation as vi,i . 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 v
= (3 x
2

2 y, z

+ x, y

z) ,

then the dot product is

vi,i = x

(3 x

2 y) + y (z

+ x) + z (y

z)

6x 1

Curl
www.continuummechanics.org/cm/tensornotationbasic.html 7/9

12/30/13

Tensor Notation (Basics)

The curl of a vector is written in tensor notation as ijk vk,j . It is critical to recognize that the vector is written as vk,j here, not vj,k . This is because the curl is v, not v . As with cross products, the fact that j and k both occur twice in ijk vk,j dictates that both are automatically summed from 1 to 3. The term expands to

ijk vk,j

i11 v1,1 i21 v1,2 i31 v1,3

+ + +

i12 v2,1 i22 v2,2 i32 v2,3

+ + +

i13 v3,1 i23 v3,2 i33 v3,3

+ +

Curls Using Tensor Notation


To obtain the yth component of a curl, set i equal to 2 in the above equation.

2 jk vk,j

211 v1,1 221 v1,2 231 v1,3

+ + +

212 v2,1 222 v2,2 232 v2,3

+ + +

213 v3,1 223 v3,2 233 v3,3

+ +

All subscripts are now specified, and this permits evaluation of all alternating tensors. All of them will equal zero except two, leaving

2 jk vk,j

v1,3 v3,1

vx z

vz x

which is again consistent with the determinant result (as it must be). Results for the xth and zth components are obtained by setting i 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 2 matrix notation as f (x) and in tensor notation as f ,ii . Its definition is
2 2 2

f ,ii

f (x)
2

f (x)
2

f (x)
2

Laplacian Example
Determine the Laplacian of f (x)
= 2 x y z sin(y) .
3

Start by calculating the gradient of f (x) .

f ,i = ( 6 x y, 2 x

z cos(y), sin(y))

And the divergence of the gradient (which is the Laplacian after all) is

f ,ii = f (x) = 12 xy + z sin(y)

www.continuummechanics.org/cm/tensornotationbasic.html

8/9

12/30/13

Tensor Notation (Basics)

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

(ai bi ),j = ai,j bi + ai bi,j

the derivative of a cross product

( ijk aj bk ),m = ijk aj,m bk + ijk aj bk ,m

and the derivative of a diadic product.

( ai bj ) ,k = ai,k bj + ai bj,k

Table of Contents Vector Calculus Tensor Notation (Advanced)

www.continuummechanics.org/cm/tensornotationbasic.html

9/9

You might also like