tensor
displayGR
display the nonzero components of a specific general relativity tensor
display_allGR
display the nonzero components of all of the general relativity tensors and quantities calculated by tensor[tensorsGR]
Calling Sequence
Parameters
Description
Examples
displayGR(GR_name, object)
display_allGR(coord, cov_metric, con_metric, det_met, C1, C2, Rm, Rc, R, G, C)
GR_name
-
name of a specific GR-related object where the name is one of coordinates, cov_metric, contra_metric, detmetric, Christoffel1, Christoffel2, Riemann, Ricci, Ricciscalar, Einstein, or Weyl
object
object to display
coord
list of coordinate variable names (for example, [t, x, y, z])
cov_metric
covariant metric tensor (index_char=[-1,-1])
con_metric
contravariant metric tensor (index_char=[1,1])
det_met
determinant of metric tensor components
C1, C2
Christoffel symbols of first and second kind
Rm, Rc, R
Riemann tensor, Ricci tensor, Ricci scalar
G, C
Einstein and Weyl tensors
Important: The tensor package has been deprecated. Use the superseding packages DifferentialGeometry and Physics instead.
The function displayGR(Einstein, G) displays the nonzero components and the index character of the tensor_type G using the symmetries of the Einstein tensor to reduce the number of components shown. G is expected to be a tensor of rank 2 with the proper symmetries. It can be calculated using tensor[Einstein].
The function display_allGR(coord, cov_met, cont_met, det_met, C1, C2, Rm, Rc, R, G, C) displays all of the GR-related objects passed in the parameter list. They must be passed in the following order: the coordinates list, the covariant metric tensor ([-1,-1]), the contravariant metric tensor ([1,1]), the determinant of the metric tensor components (algebraic type), the Christoffel symbols of the 1st kind ([-1,-1,-1]), the Christoffel symbols of the 2nd kind ([1,-1,-1]), the Riemann tensor, the Ricci tensor, the Ricciscalar ([]), the Einstein tensor, the Weyl tensor. Each of the quantities is displayed by making the appropriate call to tensor[displayGR]. See tensor[tensorsGR] for the calculation of these quantities.
For displaying general tensor_type objects not listed above, use the 'display' option of tensor[act].
These functions are part of the tensor package, and so can be used in the form displayGR(..) / display_allGR(..) only after performing the command with(tensor), or with(tensor, displayGR) / with(tensor, display_allGR).
Define the coordinates and covariant metric for the Schwarzschild metric:
with⁡tensor:
coords≔t,r,θ,φ:
g≔array⁡symmetric,sparse,1..4,1..4:
g1,1≔1−2⁢mr:g2,2≔−1g1,1:g3,3≔−r2:g4,4≔−r2⁢sin⁡θ2:
metric≔create⁡−1,−1,eval⁡g
metric≔table⁡compts=1−2⁢mr0000−11−2⁢mr0000−r20000−r2⁢sin⁡θ2,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:
Use displayGR to show that it is a vacuum solution of the Einstein field equations:
displayGR⁡Einstein,G
The Einstein Tensor
non-zero components :
None
character : [-1, -1]
Use displayGR to show the nonzero Christoffel symbols of the first kind:
displayGR⁡Christoffel1,C1
The Christoffel Symbols of the First Kind
[11,2]=−mr2
[12,1]=mr2
[22,2]=m−r+2⁢m2
[23,3]=−r
[24,4]=−r⁢sin⁡θ2
[33,2]=r
[34,4]=−sin⁡2⁢θ⁢r22
[44,2]=r⁢sin⁡θ2
[44,3]=sin⁡2⁢θ⁢r22
Display everything using display_allGR:
display_allGR⁡coords,metric,contra_metric,det_met,C1,C2,Rm,Rc,R,G,C
_____________
The coordinates variables are :
x1=t
x2=r
x3=θ
x4=φ
The Covariant Metric
cov_g11=1−2⁢mr
cov_g22=−11−2⁢mr
cov_g33=−r2
cov_g44=−r2⁢sin⁡θ2
Determinant of the covariant metric tensor :
detg=−r4⁢sin⁡θ2
The Contravariant Metric
contra_g11=−r−r+2⁢m
contra_g22=−r+2⁢mr
contra_g33=−1r2
contra_g44=−csc⁡θ2r2
The Christoffel Symbols of the Second Kind
{1,12}=−mr⁢−r+2⁢m
{2,11}=−−r+2⁢m⁢mr3
{2,22}=mr⁢−r+2⁢m
{2,33}=−r+2⁢m
{2,44}=−r+2⁢m⁢sin⁡θ2
{3,23}=1r
{3,44}=−sin⁡2⁢θ2
{4,24}=1r
{4,34}=cot⁡θ
The Riemann Tensor
R1212=2⁢mr3
R1313=−r+2⁢m⁢mr2
R1414=−r+2⁢m⁢m⁢sin⁡θ2r2
R2323=−m−r+2⁢m
R2424=−m⁢sin⁡θ2−r+2⁢m
R3434=−2⁢sin⁡θ2⁢m⁢r
character : [-1, -1, -1, -1]
The Ricci tensor
The Ricci Scalar
R=0
The Weyl Tensor
C1212=2⁢mr3
C1313=−r+2⁢m⁢mr2
C1414=−r+2⁢m⁢m⁢sin⁡θ2r2
C2323=−m−r+2⁢m
C2424=−m⁢sin⁡θ2−r+2⁢m
C3434=−2⁢sin⁡θ2⁢m⁢r
See Also
Physics
tensor(deprecated)
tensor(deprecated)[act]
tensor(deprecated)[tensorsGR]
Download Help Document