Professional Documents
Culture Documents
1
GΛ ΜΝ = gΛΣ I¶ Μ gΣΝ + ¶Ν gΣΜ - ¶Σ g ΜΝ M,
2
H ¶Α stands for the partial derivative ¶ ¶ xΑ L, the Riemann tensor,
RΛ ΜΝΣ = ¶Ν GΛ ΜΣ - ¶Σ GΛ ΜΝ + GΗ ΜΣ GΛ ΗΝ - GΗ ΜΝ GΛ ΗΣ ,
R ΜΝ = RΛ ΜΛΝ ,
R = g ΜΝ R ΜΝ ,
1
GΜΝ = RΜΝ - gΜΝ R.
2
You must input the covariant components of the metric tensor g ΜΝ by editing the relevant input line in this Mathematica
notebook. You may also wish to change the names of the coordinates. Only the nonzero components of the above quantities
are displayed as the output. All the components computed are in the coordinate basis in which the metric was specified.
First clear any values that may already have been assigned to the names of the various objects to be calculated. The names of the
coordinates that you will use are also cleared.
Clear@coord, metric, inversemetric, affine, riemann, ricci, scalar, einstein, r, Θ, Φ, tD
n = 4
The example given here is the Schwarzschild metric. The coordinates choice of Schwarzschild is appropriate for this spherically
symmetric spacetime.
8r, Θ, Φ, t<
You can change the names of the coordinates by simply editing the definition of coord, for example,
to coord = 8x, y, z, t<, when another set of coordinates names is more appropriate. In this program
indices ranges over 1 to n. Thus for spacetime they range from 1 to 4 and x4 is the same as x0 used in the text.
Input the metric as a list of list, i.e., as a matrix. You can input the components of any metric here, but you must specify them as
explicit functions of the coordinates.
wormhole = 981, 0, 0, 0<, 90, b2 + r2 , 0, 0=, 90, 0, Ib2 + r2 M Sin@ΘD2 , 0=, 80, 0, 0, - 1<=;
schwarzschild =
88H1 - 2 m rL ^ - 1, 0, 0, 0<, 80, r ^ 2, 0, 0<, 80, 0, r ^ 2 Sin@ΘD, 0<, 80, 0, 0, - H1 - 2 m rL<<;
metric = wormhole
981, 0, 0, 0<, 90, b2 + r2 , 0, 0=, 90, 0, Ib2 + r2 M Sin@ΘD2 , 0=, 80, 0, 0, - 1<=
metric MatrixForm
1 0 0 0
0 b2 + r 2 0 0
0 0 Ib2 + r2 M Sin@ΘD2 0
0 0 0 -1
Note :
It is important not to use the symbols, i, j, k, l, s, or n as constants or coordinates in the metric that you specify above. The reason
is that the first five of those symbols are used as summation or table indices in the calculations done below, and n is the dimen-
sion of space. For example, if m were used as a summation or table index below, then you would get the wrong answer for the
present metric because m in the metric would be treated as an index, rather than as the mass.
inversemetric = Simplify@Inverse@metricDD
1 Csc@ΘD2
:81, 0, 0, 0<, :0, , 0, 0>, :0, 0, , 0>, 80, 0, 0, - 1<>
b2 + r2 b2 + r2
inversemetric MatrixForm
1 0 0 0
1
0 0 0
b2 +r2
Csc@ΘD2
0 0 0
b2 +r2
0 0 0 -1
The calculation of the components of the Christoffel symbols is done by transcribing the definition given earlier into the notation
of Mathematica and using the Mathematica functions for taking partial derivatives, Sum for summing over repeated indices,
Table for forming a list of components, and Simplify for simplifying the result.
affine :=
affine = Simplify@Table@H1 2L * Sum@Hinversemetric@@i, sDDL * HD@metric@@s, jDD, coord@@kDDD +
D@metric@@s, kDD, coord@@jDDD - D@metric@@j, kDD, coord@@sDDDL,
8s, 1, n<D, 8i, 1, n<, 8j, 1, n<, 8k, 1, n<DD
The nonzero Christoffel symbols are displayed below. You need not follow the details of constructing the functions that we use
for that purpose. In the output the symbol G[1, 2, 3] stands for G1 23 . Because the Christoffel symbols are symmetric under
interchange of the last two indices, only the independent components are displayed.
listaffine := Table@If@UnsameQ@affine@@i, j, kDD, 0D,
8ToString@G@i, j, kDD, affine@@i, j, kDD<D, 8i, 1, n<, 8j, 1, n<, 8k, 1, j<D
G@1, 2, 2D -r
G@1, 3, 3D - r Sin@ΘD2
r
G@2, 2, 1D
b2 +r2
G@3, 3, 2D Cot@ΘD
The components of the Riemann tensor, RΛ ΜΝΣ , are calculated using the definition given above.
riemann :=
riemann = Simplify@Table@D@affine@@i, j, lDD, coord@@kDDD - D@affine@@i, j, kDD, coord@@lDDD +
Sum@affine@@s, j, lDD affine@@i, k, sDD - affine@@s, j, kDD affine@@i, l, sDD, 8s, 1, n<D,
8i, 1, n<, 8j, 1, n<, 8k, 1, n<, 8l, 1, n<DD
The nonzero components are displayed by the following functions. In the output, the symbol R[1, 2, 1, 3] stands for R1 213 , and
similarly for the other components. You can obtain R[1, 2, 3, 1] from R[1, 2, 1, 3] using the antisymmetry of the Riemann tensor
under exchange of the last two indices. The antisymmetry under exchange of the first two indices of RΛΜΝΣ is not evident in the
output because the components of RΛ ΜΝΣ are the displayed.
listriemann :=
Table@If@UnsameQ@riemann@@i, j, k, lDD, 0D, 8ToString@R@i, j, k, lDD, riemann@@i, j, k, lDD<D,
8i, 1, n<, 8j, 1, n<, 8k, 1, n<, 8l, 1, k - 1<D
m Sin@ΘD2
R@1, 3, 3, 1D
r
2 m H-2 m+rL
R@1, 4, 4, 1D
r4
m
R@2, 1, 2, 1D
H2 m-rL r2
2 m Sin@ΘD2
R@2, 3, 3, 2D -
r
m H2 m-rL
R@2, 4, 4, 2D
r4
m
R@3, 1, 3, 1D
H2 m-rL r2
2m
R@3, 2, 3, 2D
r
m H2 m-rL
R@3, 4, 4, 3D
r4
2m
R@4, 1, 4, 1D -
H2 m-rL r2
m
R@4, 2, 4, 2D -
r
m Sin@ΘD2
R@4, 3, 4, 3D -
r
The Ricci tensor R ΜΝ was defined by summing the first and third indices of the Riemann tensor (which has the first index already
raised).
ricci := ricci = Simplify@Table@Sum@riemann@@i, j, i, lDD, 8i, 1, n<D, 8j, 1, n<, 8l, 1, n<DD
Next we display the nonzero components. In the output R@1, 2D denotes R12 , and similarly for the other components.
listricci :=
Table@If@UnsameQ@ricci@@j, lDD, 0D, 8ToString@R@j, lDD, ricci@@j, lDD<D, 8j, 1, n<, 8l, 1, n<D
8<
A vanishing table (as with the Schwarzschild metric example) means that the vacuum Einstein equation is satisfied.
The scalar curvature R is calculated using the inverse mtric and the Ricci tensor. The result is displayed in the output line.
1
The Einstein tensor, G ΜΝ = R ΜΝ - 2
g ΜΝ R, is found from the tensors already calculated.
listeinstein := Table@
If@UnsameQ@einstein@@j, lDD, 0D, 8ToString@G@j, lDD, einstein@@j, lDD<D, 8j, 1, n<, 8l, 1, j<D
8<