 RearrangeIndices - Maple Help

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

 • We describe, by example, the conventions used to define a permutation. The list $P=\left[2,3,1,5,4\right]$ 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 to the first slot and so on. Thus, if we apply $P$ to $A=\left[a,b,c,d,e\right]$ the result is $\left[c,a,b,e,d\right]$. The same permutation can be written in cycle notation as $C=\left[\left[1,2,3\right],\left[4,5\right]\right]$. As another example the permutation which interchanges $b$ with $c$ in the list $A$ is defined in permutation notation by or in cycle notation as $C=\left[2,3\right]$.
 • 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 $S\left(X,Y,Z\right)=T\left(Z,Y,X\right)$.
 • 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

 > $\mathrm{with}\left(\mathrm{DifferentialGeometry}\right):$$\mathrm{with}\left(\mathrm{Tensor}\right):$

Example 1.

First create a 3 dimensional manifold $M$ and define two tensors $\mathrm{T1}$ and $\mathrm{T2}$ on $M$.

 > $\mathrm{DGsetup}\left(\left[x,y,z\right],M\right):$
 M > $\mathrm{T1}≔\mathrm{evalDG}\left(\mathrm{dx}&t\mathrm{D_y}\right)$
 ${\mathrm{T1}}{≔}{\mathrm{dx}}{}{\mathrm{D_y}}$ (2.1)
 M > $\mathrm{T2}≔\mathrm{evalDG}\left(\left(\left(\mathrm{dx}&t\mathrm{D_y}\right)&t\mathrm{dz}\right)&t\mathrm{D_z}\right)$
 ${\mathrm{T2}}{≔}{\mathrm{dx}}{}{\mathrm{D_y}}{}{\mathrm{dz}}{}{\mathrm{D_z}}$ (2.2)

Interchange the arguments for the tensor $\mathrm{T1}$.

 M > $\mathrm{RearrangeIndices}\left(\mathrm{T1},\left[2,1\right]\right)$
 ${\mathrm{D_y}}{}{\mathrm{dx}}$ (2.3)

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

 M > $\mathrm{RearrangeIndices}\left(\mathrm{T2},\left[2,1,4,3\right]\right)$
 ${\mathrm{D_y}}{}{\mathrm{dx}}{}{\mathrm{D_z}}{}{\mathrm{dz}}$ (2.4)
 M > $\mathrm{RearrangeIndices}\left(\mathrm{T2},\left[\left[1,2\right],\left[3,4\right]\right]\right)$
 ${\mathrm{D_y}}{}{\mathrm{dx}}{}{\mathrm{D_z}}{}{\mathrm{dz}}$ (2.5)

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

 M > $\mathrm{RearrangeIndices}\left(\mathrm{T2},\left[1,3,4,2\right]\right)$
 ${\mathrm{dx}}{}{\mathrm{D_z}}{}{\mathrm{D_y}}{}{\mathrm{dz}}$ (2.6)
 M > $\mathrm{RearrangeIndices}\left(\mathrm{T2},\left[\left[2,3,4\right]\right]\right)$
 ${\mathrm{dx}}{}{\mathrm{D_z}}{}{\mathrm{D_y}}{}{\mathrm{dz}}$ (2.7)

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

 M > $\mathrm{RearrangeIndices}\left(\mathrm{T2},\left[2,3,4,1\right]\right)$
 ${\mathrm{D_z}}{}{\mathrm{dx}}{}{\mathrm{D_y}}{}{\mathrm{dz}}$ (2.8)
 M > $\mathrm{RearrangeIndices}\left(\mathrm{T2},\left[\left[1,2,3,4\right]\right]\right)$
 ${\mathrm{D_z}}{}{\mathrm{dx}}{}{\mathrm{D_y}}{}{\mathrm{dz}}$ (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 > $\mathrm{DGsetup}\left(\left[x,y\right],\left[u,v\right],E\right):$
 E > $T≔\mathrm{evalDG}\left(\left(\left(\mathrm{dx}&t\mathrm{dy}\right)&t\mathrm{du}\right)&t\mathrm{dv}\right)$
 ${T}{≔}{\mathrm{dx}}{}{\mathrm{dy}}{}{\mathrm{du}}{}{\mathrm{dv}}$ (2.10)
 E > $\mathrm{RearrangeIndices}\left(T,\left[3,4,1,2\right]\right)$
 ${\mathrm{du}}{}{\mathrm{dv}}{}{\mathrm{dx}}{}{\mathrm{dy}}$ (2.11)