TensorInnerProduct - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Tensor[TensorInnerProduct] - compute the inner product of two vectors, forms or tensors with respect to a given metric tensor

Calling Sequences

     TensorInnerProduct(g, T, S, keywords)

Parameters

   g        - a covariant metric tensor on a manifold M

   T, S     - two vector fields, forms or tensors (with the same index type) on M, or lists of such

   keywords   -  (optional) inversemetric = h, where h is the inverse metric to g; tensorindices = indx, where indx is a list of positive integers.

 

Description

Examples

Description

• 

Let P = TensorInnerProduct(g, T, S). Let g = gij dxi dxj and h = hij ij be the inverse metric. If  T = ti i and S = sj j are vectors, then P= gij ti sj. If T = ti dxi and S = sj dxj are 1-forms, then P= hij ti sj. If T = tijdxi dxj and S = sijdxi dxj are 2-forms, then P= hikhjltijskl. If T= tjkii dxjdxk and S = sjkiidxjdxk, then P = giahjbhkct ijksbca and so on.

• 

When repeated calls are to be made to TensorInnerProduct, the keyword argument inversemetric be be used to avoid repeated computations of the metric inverse.

• 

With the keyword argument tensorindices = [n1, n2, ... ], the contraction of indices used to construct the tensor inner product is restricted to the indices n1, n2, ... .

• 

This command is part of the DifferentialGeometry:-Tensor package, and so can be used in the form TensorInnerProduct(...) only after executing the command with(DifferentialGeometry) and with(Tensor) in that order.  It can always be used in the long form DifferentialGeometry:-Tensor:-TensorInnerProduct.

Examples

withDifferentialGeometry:withTensor:

 

First define a manifold M with local coordinates x,y,z and define a (covariant) metric on M.

DGsetupx,y,z,M:

M > 

gevalDGxdx&tdx+ydy&tdy+zdz&tdz

g:=xdxdx+ydydy+zdzdz

(2.1)

 

Example 1.

Compute the inner product of two vectors.

M > 

XevalDGa1D_x+a2D_y+a3D_z

X:=a1D_x+a2D_y+a3D_z

(2.2)
M > 

YevalDGb1D_x+b2D_y+b3D_z

Y:=b1D_x+b2D_y+b3D_z

(2.3)
M > 

TensorInnerProductg,X,Y

a1b1x+a2b2y+a3b3z

(2.4)

 

Example 2.

Compute the inner product of two 1-forms.

M > 

αevalDGa1dx+a2dy+a3dz

α:=a1dx+a2dy+a3dz

(2.5)
M > 

βevalDGb1dx+b2dy+b3dz

β:=b1dx+b2dy+b3dz

(2.6)
M > 

expandTensorInnerProductg,α,β

a3b3z+a2b2y+a1b1x

(2.7)

 

Example 3.

Compute the inner product of two 2-forms.

M > 

αevalDGa1dx&wdy+a2dx&wdz+a3dy&wdz

α:=a1dxdy+a2dxdz+a3dydz

(2.8)
M > 

βevalDGb1dx&wdy+b2dx&wdz+b3dy&wdz

β:=b1dxdy+b2dxdz+b3dydz

(2.9)
M > 

expandTensorInnerProductg,α,β

2a3b3zy+2a2b2zx+2a1b1yx

(2.10)

 

Example 4.

Compute the inner product of two rank-3 tensors.

M > 

TevalDG2dx&tD_y&tdz+3dx&tD_z&tdy+8dy&tD_z&tdx

T:=2dxD_ydz+3dxD_zdy+8dyD_zdx

(2.11)
M > 

SevalDG5dx&tD_y&tdz+7dx&tD_z&tdz+3dx&tD_z&tdx

S:=5dxD_ydz+3dxD_zdx+7dxD_zdz

(2.12)
M > 

TensorInnerProductg,T,S

10yzx

(2.13)

 

Partial contractions of T and S can be computed.

M > 

TensorInnerProductg,T,S,tensorindices=1,3

10D_yD_yzx+14D_yD_zzx

(2.14)
M > 

TensorInnerProductg,T,S,tensorindices=2,3

10ydxdxz+24zdydxx

(2.15)

 

Example 5.

Compute the inner product of two lists of rank-1 tensors (1-forms). In this case the efficiency of the command is improved if the keyword argument inversemetric is given.

M > 

gevalDGadx&tdx+bdy&tdy+cdy&tdz+cdz&tdy

g:=adxdx+bdydy+cdydz+cdzdy

(2.16)
M > 

hInverseMetricg

h:=D_xD_xa+D_yD_zc+D_zD_ycbD_zD_zc2

(2.17)
M > 

Ωdx,dy,dz

Ω:=dx,dy,dz

(2.18)
M > 

TensorInnerProductg,Ω,Ω,inversemetric=h

See Also

DifferentialGeometry

Tensor

ContractIndices

InverseMetric

RaiseLowerIndices

SpinorInnerProduct