The tensor Package Indexing Functions
Description
Examples
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
with⁡tensor:
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.
c1≔array⁡cf1,1..4,1..4,1..4
c1≔array⁡cf1,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
c11,2,1≔mr2
c12,1,1
mr2
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.
c2≔array⁡cf2,1..4,1..4,1..4
c2≔array⁡cf2,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
c24,3,4≔cos⁡θsin⁡θ
c24,4,3
cos⁡θsin⁡θ
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.
R≔array⁡cov_riemann,1..4,1..4,1..4,1..4
R≔array⁡cov_riemann,1..4,1..4,1..4,1..4,1,1,1,1=0,1,1,1,2=0,1,1,1,3=0,1,1,1,4=0,1,1,2,1=0,1,1,2,2=0,1,1,2,3=0,1,1,2,4=0,1,1,3,1=0,1,1,3,2=0,1,1,3,3=0,1,1,3,4=0,1,1,4,1=0,1,1,4,2=0,1,1,4,3=0,1,1,4,4=0,1,2,1,1=0,1,2,1,2=`?`1,2,1,2,1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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
R1,2,3,4≔cos⁡θr
R3,4,1,2
cos⁡θr
R2,1,3,4
−cos⁡θr
R1,2,4,3
R4,3,1,2
R3,4,2,1
R4,3,2,1
R2,1,4,3
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:
d2g≔array⁡d2met,1..4,1..4,1..4,1..4
d2g≔array⁡d2met,1..4,1..4,1..4,1..4,1,1,1,1=`?`1,1,1,1,1,1,1,2=`?`1,1,1,2,1,1,1,3=`?`1,1,1,3,1,1,1,4=`?`1,1,1,4,1,1,2,1=`?`1,1,1,2,1,1,2,2=`?`1,1,2,2,1,1,2,3=`?`1,1,2,3,1,1,2,4=`?`1,1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