tensor(deprecated)/indexing - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : tensor(deprecated)/indexing

The tensor Package Indexing Functions

 

Description

Examples

Description

Important: The tensor package has been deprecated. Use the superseding packages DifferentialGeometry and Physics instead.

• 

The tensor package provides routines which calculate quantities that are specific to the Theory of Relativity.  Many of these quantities possess certain symmetries in the indices of their components.  For this reason, the tensor package provides and uses some specific indexing functions to implement these symmetries.  In some cases, the package also makes use of Maple symmetric and antisymmetric indexing functions.

• 

The following indexing functions are implemented in the tensor package:

cf1

- implements symmetry in the first and second indices of a quantity  with three indices

 

- used for: Christoffel symbols of the first kind, first partials of the covariant metric tensor components

cf2

- implements symmetry in the second and third indices of a quantity with three indices

 

- used for: Christoffel symbols of the second kind

cov_riemann

-implements the symmetric / skew-symmetric properties of the covariant Riemann (and Weyl) tensor components -- that is,

 

R[compts][c,d,a,b] =   R[compts][a,b,c,d]

 

R[compts][b,a,c,d] = - R[compts][a,b,c,d]

 

R[compts][a,b,d,c] = - R[compts][a,b,c,d]

 

- used for: components of the covariant Riemann and Weyl tensors

d2met

- implements symmetry in the first and second indices and in the third and fourth indices of a quantity with 4 indices

 

- used for: second partials of the covariant metric tensor components

skew23

- implements skew-symmetry in the second and third indices of a 3-index quantity

 

- used for: structural coefficients in the tensor[connexF] routine

Examples

Important: The tensor package has been deprecated. Use the superseding packages DifferentialGeometry and Physics instead.

withtensor:

Store the Christoffel symbols of the first kind in the array C1.  Use the cf1 indexing function to implement the symmetry in the last two indices.

c1arraycf1,1..4,1..4,1..4

c1arraycf1,1..4,1..4,1..4,1,1,1=`?`1,1,1,1,1,2=`?`1,1,2,1,1,3=`?`1,1,3,1,1,4=`?`1,1,4,1,2,1=`?`1,2,1,1,2,2=`?`1,2,2,1,2,3=`?`1,2,3,1,2,4=`?`1,2,4,1,3,1=`?`1,3,1,1,3,2=`?`1,3,2,1,3,3=`?`1,3,3,1,3,4=`?`1,3,4,1,4,1=`?`1,4,1,1,4,2=`?`1,4,2,1,4,3=`?`1,4,3,1,4,4=`?`1,4,4,2,1,1=`?`1,2,1,2,1,2=`?`1,2,2,2,1,3=`?`1,2,3,2,1,4=`?`1,2,4,2,2,1=`?`2,2,1,2,2,2=`?`2,2,2,2,2,3=`?`2,2,3,2,2,4=`?`2,2,4,2,3,1=`?`2,3,1,2,3,2=`?`2,3,2,2,3,3=`?`2,3,3,2,3,4=`?`2,3,4,2,4,1=`?`2,4,1,2,4,2=`?`2,4,2,2,4,3=`?`2,4,3,2,4,4=`?`2,4,4,3,1,1=`?`1,3,1,3,1,2=`?`1,3,2,3,1,3=`?`1,3,3,3,1,4=`?`1,3,4,3,2,1=`?`2,3,1,3,2,2=`?`2,3,2,3,2,3=`?`2,3,3,3,2,4=`?`2,3,4,3,3,1=`?`3,3,1,3,3,2=`?`3,3,2,3,3,3=`?`3,3,3,3,3,4=`?`3,3,4,3,4,1=`?`3,4,1,3,4,2=`?`3,4,2,3,4,3=`?`3,4,3,3,4,4=`?`3,4,4,4,1,1=`?`1,4,1,4,1,2=`?`1,4,2,4,1,3=`?`1,4,3,4,1,4=`?`1,4,4,4,2,1=`?`2,4,1,4,2,2=`?`2,4,2,4,2,3=`?`2,4,3,4,2,4=`?`2,4,4,4,3,1=`?`3,4,1,4,3,2=`?`3,4,2,4,3,3=`?`3,4,3,4,3,4=`?`3,4,4,4,4,1=`?`4,4,1,4,4,2=`?`4,4,2,4,4,3=`?`4,4,3,4,4,4=`?`4,4,4

(1)

c11,2,1mr2

c11,2,1mr2

(2)

c12,1,1

mr2

(3)

Store the Christoffel symbols of the second kind in the array c2.  Use the cf2 indexing function to implement the symmetry in the first two indices.

c2arraycf2,1..4,1..4,1..4

c2arraycf2,1..4,1..4,1..4,1,1,1=`?`1,1,1,1,1,2=`?`1,1,2,1,1,3=`?`1,1,3,1,1,4=`?`1,1,4,1,2,1=`?`1,1,2,1,2,2=`?`1,2,2,1,2,3=`?`1,2,3,1,2,4=`?`1,2,4,1,3,1=`?`1,1,3,1,3,2=`?`1,2,3,1,3,3=`?`1,3,3,1,3,4=`?`1,3,4,1,4,1=`?`1,1,4,1,4,2=`?`1,2,4,1,4,3=`?`1,3,4,1,4,4=`?`1,4,4,2,1,1=`?`2,1,1,2,1,2=`?`2,1,2,2,1,3=`?`2,1,3,2,1,4=`?`2,1,4,2,2,1=`?`2,1,2,2,2,2=`?`2,2,2,2,2,3=`?`2,2,3,2,2,4=`?`2,2,4,2,3,1=`?`2,1,3,2,3,2=`?`2,2,3,2,3,3=`?`2,3,3,2,3,4=`?`2,3,4,2,4,1=`?`2,1,4,2,4,2=`?`2,2,4,2,4,3=`?`2,3,4,2,4,4=`?`2,4,4,3,1,1=`?`3,1,1,3,1,2=`?`3,1,2,3,1,3=`?`3,1,3,3,1,4=`?`3,1,4,3,2,1=`?`3,1,2,3,2,2=`?`3,2,2,3,2,3=`?`3,2,3,3,2,4=`?`3,2,4,3,3,1=`?`3,1,3,3,3,2=`?`3,2,3,3,3,3=`?`3,3,3,3,3,4=`?`3,3,4,3,4,1=`?`3,1,4,3,4,2=`?`3,2,4,3,4,3=`?`3,3,4,3,4,4=`?`3,4,4,4,1,1=`?`4,1,1,4,1,2=`?`4,1,2,4,1,3=`?`4,1,3,4,1,4=`?`4,1,4,4,2,1=`?`4,1,2,4,2,2=`?`4,2,2,4,2,3=`?`4,2,3,4,2,4=`?`4,2,4,4,3,1=`?`4,1,3,4,3,2=`?`4,2,3,4,3,3=`?`4,3,3,4,3,4=`?`4,3,4,4,4,1=`?`4,1,4,4,4,2=`?`4,2,4,4,4,3=`?`4,3,4,4,4,4=`?`4,4,4

(4)

c24,3,4cosθsinθ

c24,3,4cosθsinθ

(5)

c24,4,3

cosθsinθ

(6)

Store the covariant Riemann tensor components in the array R.  Use the cov_riemann indexing function the implement the symmetries of the covariant Riemann tensor.

Rarraycov_riemann,1..4,1..4,1..4,1..4

Rarraycov_riemann,1..4,1..4,1..4,1..4,1,1,1,1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,4=`?`1,4,3,4,4,1,4,1=`?`1,4,1,4,4,1,4,2=`?`1,4,2,4,4,1,4,3=`?`1,4,3,4,4,1,4,4=0,4,2,1,1=0,4,2,1,2=`?`1,2,2,4,4,2,1,3=`?`1,3,2,4,4,2,1,4=`?`1,4,2,4,4,2,2,1=`?`1,2,2,4,4,2,2,2=0,4,2,2,3=`?`2,3,2,4,4,2,2,4=`?`2,4,2,4,4,2,3,1=`?`1,3,2,4,4,2,3,2=`?`2,3,2,4,4,2,3,3=0,4,2,3,4=`?`2,4,3,4,4,2,4,1=`?`1,4,2,4,4,2,4,2=`?`2,4,2,4,4,2,4,3=`?`2,4,3,4,4,2,4,4=0,4,3,1,1=0,4,3,1,2=`?`1,2,3,4,4,3,1,3=`?`1,3,3,4,4,3,1,4=`?`1,4,3,4,4,3,2,1=`?`1,2,3,4,4,3,2,2=0,4,3,2,3=`?`2,3,3,4,4,3,2,4=`?`2,4,3,4,4,3,3,1=`?`1,3,3,4,4,3,3,2=`?`2,3,3,4,4,3,3,3=0,4,3,3,4=`?`3,4,3,4,4,3,4,1=`?`1,4,3,4,4,3,4,2=`?`2,4,3,4,4,3,4,3=`?`3,4,3,4,4,3,4,4=0,4,4,1,1=0,4,4,1,2=0,4,4,1,3=0,4,4,1,4=0,4,4,2,1=0,4,4,2,2=0,4,4,2,3=0,4,4,2,4=0,4,4,3,1=0,4,4,3,2=0,4,4,3,3=0,4,4,3,4=0,4,4,4,1=0,4,4,4,2=0,4,4,4,3=0,4,4,4,4=0

(7)

R1,2,3,4cosθr

R1,2,3,4cosθr

(8)

R3,4,1,2

cosθr

(9)

R2,1,3,4

cosθr

(10)

R1,2,4,3

cosθr

(11)

R4,3,1,2

cosθr

(12)

R3,4,2,1

cosθr

(13)

R4,3,2,1

cosθr

(14)

R2,1,4,3

cosθr

(15)

Store the second partials of the covariant metric tensor components in the array d2g. Use the d2met indexing function to implement the symmetries in the first and second pairs of indices:

d2garrayd2met,1..4,1..4,1..4,1..4

d2garrayd2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