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

Online Help

All Products    Maple    MapleSim


Tensor[RearrangeIndices] - rearrange the argument/indices of a tensor

Calling Sequences

     RearrangeIndices(T, P)

     RearrangeIndices(T, C)

Parameters

   T    - a tensor of rank r

   P    - list of integers, giving a permutation of the integers 1...r

   C    - a list of lists of integers, describing a permutation as the composition of cycles

 

Description

Examples

Description

• 

We describe, by example, the conventions used to define a permutation. The list P=2,3,1,5,4 denotes a permutation acting on a 5 element list A by sending the first element of A to the second slot, the second element of A to the third slot, the third element of A to the first slot and so on. Thus, if we apply P to A=a,b,c,d,e the result is c,a,b,e,d. The same permutation can be written in cycle notation as C=1,2,3,4,5. As another example the permutation which interchanges b with c in the list A is defined in permutation notation by P=1,3,2,4,5 or in cycle notation as C=2,3.

• 

A tensor T is a multi-linear map whose arguments are vectors or forms. The command RearrangeIndices defines a new tensor by rearranging the arguments of T according to the permutation P. For example, if T is a rank 3 covariant tensor and S = RearrangeIndices(T, [3, 2, 1]) then SX,Y,Z=TZ,Y,X.

• 

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

Examples

withDifferentialGeometry:withTensor:

 

Example 1.

First create a 3 dimensional manifold M and define two tensors T1 and T2 on M.

DGsetupx,y,z,M:

M > 

T1evalDGdx&tD_y

T1dxD_y

(2.1)
M > 

T2evalDGdx&tD_y&tdz&tD_z

T2dxD_ydzD_z

(2.2)

 

Interchange the arguments for the tensor T1.

M > 

RearrangeIndicesT1,2,1

D_ydx

(2.3)

 

Interchange argument 1 with 2 and argument 3 with 4 in the tensor T2. This can be done in two ways, by specifying a permutation or a list of cycles.

M > 

RearrangeIndicesT2,2,1,4,3

D_ydxD_zdz

(2.4)
M > 

RearrangeIndicesT2,1,2,3,4

D_ydxD_zdz

(2.5)

 

Cyclicly permute the last 3 arguments of T2. This can be done in two ways, by specifying a permutation or a list of cycles.

M > 

RearrangeIndicesT2,1,3,4,2

dxD_zD_ydz

(2.6)
M > 

RearrangeIndicesT2,2,3,4

dxD_zD_ydz

(2.7)

 

Cyclicly permute all 4 arguments of T2.  This can be done in two ways, by specifying a permutation or a list of cycles.

M > 

RearrangeIndicesT2,2,3,4,1

D_zdxD_ydz

(2.8)
M > 

RearrangeIndicesT2,1,2,3,4

D_zdxD_ydz

(2.9)

 

Example 2.

Arguments of different spatial types can also be rearranged. Define a rank 2 vector bundle E over a 2 dimensional base.

M > 

DGsetupx,y,u,v,E:

E > 

TevalDGdx&tdy&tdu&tdv

Tdxdydudv

(2.10)
E > 

RearrangeIndicesT,3,4,1,2

dudvdxdy

(2.11)

See Also

DifferentialGeometry

Tensor

SymmetrizeIndices