tensor
tensorsGR
compute General Relativity curvature tensors in a coordinate basis
Calling Sequence
Parameters
Description
Examples
tensorsGR(coord, cov_metric, 'contra_metric', 'det_met', 'C1', 'C2', 'Rm', 'Rc', 'R', 'G', 'C', print_flag)
coord
-
list of coordinate variable names, for example, [t,x,y,z]
cov_metric
rank-2 symmetric tensor_type of the covariant metric
print_flag
(optional) print directive to print results after computation
contra_metric
rank-2 symmetric tensor_type of contravariant metric
det_met
determinant of the covariant metric component matrix
C1
Christoffel symbols of the first kind
C2
Christoffel symbols of the second kind
Rm
covariant Riemann tensor
Rc
covariant Ricci tensor
R
Ricci scalar
G
covariant Einstein tensor
C
covariant Weyl tensor
Important: The tensor package has been deprecated. Use the superseding packages DifferentialGeometry and Physics instead.
The function tensorsGR(coord, cov_metric, 'contra_metric', 'det_met', 'C1', 'C2', 'Rm', 'Rc', 'R', 'G', 'C') calculates the following objects given the coordinates, coord, and covariant metric tensor, cov_metric:
contravariant metric tensor, returned through contra_metric
determinant of the metric tensor components, returned through det_met
Christoffel symbols of the first kind, returned through C1
Christoffel symbols of the second kind, returned through C2
covariant Riemann tensor, returned through Rm
covariant Ricci tensor, returned through Rc
Ricci scalar, returned through R
covariant Einstein tensor, returned through G
covariant Weyl tensor, returned through C
The calculated quantities are returned via the third through eleventh parameters. Since these are output parameters, they must be passed as unassigned names. The return value is NULL.
The last parameter, print_flag, is optional directive to display the calculated results (using tensor[display_allGR]) after they have been calculated. If used, it must be passed with the value print. Other values will result in an error.
The calculations are made simply by making the appropriate calls to the following procedures: tensor[invert], tensor[partial_diff], tensor[Christoffel1], tensor[Christoffel2], tensor[Riemann], tensor[Ricci], tensor[Ricciscalar], tensor[Einstein], and tensor[Weyl].
Note that this procedure is not strictly necessary. However, it provides a convenient way to calculate all of the important general relativity curvature quantities in the natural basis. The print_flag option provides the further convenience of displaying the results automatically once they are computed.
Simplification: Since this routine computes all of the quantities by calling the appropriate routines from the package, simplification is done according to the simplification methods of each individual routine.
This function is part of the tensor package, and so can be used in the form tensorsGR(..) only after performing the command with(tensor), or with(tensor, tensorsGR). This function can always be accessed in the long form tensor[tensorsGR](..).
with⁡tensor:
Define the coordinates and covariant metric for the Schwarzschild metric:
coords≔t,r,th,ph:
g≔array⁡symmetric,sparse,1..4,1..4:
g1,1≔1−2⁢mr:g2,2≔−1g1,1:g3,3≔−r2:g4,4≔−r2⁢sin⁡th2:
metric≔create⁡−1,−1,eval⁡g
metric≔table⁡compts=1−2⁢mr0000−11−2⁢mr0000−r20000−r2⁢sin⁡th2,index_char=−1,−1
Compute the curvature (without the print option)
tensorsGR⁡coords,metric,contra_metric,det_met,C1,C2,Rm,Rc,R,G,C
Show it is a vacuum solution of the Einstein field equations
displayGR⁡Einstein,G
The Einstein Tensor
non-zero components :
None
character : [-1, -1]
Show that it is not flat.
displayGR⁡Weyl,C
The Weyl Tensor
C1212=2⁢mr3
C1313=−r+2⁢m⁢mr2
C1414=−r+2⁢m⁢m⁢sin⁡th2r2
C2323=−m−r+2⁢m
C2424=−m⁢sin⁡th2−r+2⁢m
C3434=−2⁢sin⁡th2⁢m⁢r
character : [-1, -1, -1, -1]
See Also
Physics[Christoffel]
Physics[D_]
Physics[d_]
Physics[Einstein]
Physics[g_]
Physics[LeviCivita]
Physics[Ricci]
Physics[Riemann]
Physics[Weyl]
tensor(deprecated)
tensor(deprecated)/display_allGR
tensor(deprecated)[Christoffel1]
tensor(deprecated)[Christoffel2]
tensor(deprecated)[d1metric]
tensor(deprecated)[d2metric]
tensor(deprecated)[displayGR]
tensor(deprecated)[Einstein]
tensor(deprecated)[indexing]
tensor(deprecated)[invert]
tensor(deprecated)[Ricci]
tensor(deprecated)[Ricciscalar]
tensor(deprecated)[Riemann]
tensor(deprecated)[simp]
tensor(deprecated)[Weyl]
Download Help Document