Tensors in Physics

Doing black holes and cosmology with Mathematica

Harald H. Soleng

Tensors in Physics is a tensor component package published by the Scandinavian University Press. It comes with a book containing a brief course in differential geometry, a user's guide and reference manual for the Mathematica package CARTAN. CARTAN is an easy-to-use program for tensor component calculations. A large number of tensor expressions commonly used in gravitation theory and theoretical physics are predefined. The user-friendly high-level commands of CARTAN makes it an ideal tool for interactive tensor calculations. 

In the demonstration it is first shown how CARTAN can be used as a tool in three-dimensional vector calculus in general coordinates. Then the package is used to verify the Schwarzschild solution of Einstein's field equations describing the gravitational field outside a static, spherical symmetric mass distribution. This is also the solution describing a static black hole. 

Then I solve Einstein's field equations for a homogeneous, isotropic and spatially flat matter-dominated Universe. It is shown that the Kretschmann curvature invariant diverges at the origin of time. This is the Big Bang. Finally we check that the Kerr metric really solves Einstein's gravitational field equations in vacuum. This solution describes a rotating black hole. It took almost fifty years from the field equations were published until this solution was published. One can only guess how fast the solution had been found had Einstein had access to Mathematica.

Background

The metric tensor and the vielbein

(ds^2)==(∑_(μ = 1)^n)(∑_(ν = 1)^n)(Subscript[g, μ])νd(x^μ)d(x^ν)=(∑_(i = 1)^n)(∑_(j = 1)^n)(∑_(μ = 1)^n)(∑_(ν = 1)^n)(Subscript[η, ij])(Subscript[((e^i)), μ])(Subscript[((e^j)), ν])d(x^μ)d(x^ν)

CARTAN makes all its computations using the vielbein instead of the metric tensor. In a rigid frame the spacetime connection has 24 components instead of the 40 components of the Christoffel symbols. This obviously reduces the computational costs a great deal.

Loading and initialization

<< CARTAN.m

Defining short hand notation

\(\(∇x_ := CDerivative[x]; 
Div[x_] := CDivergence[x, 1]; 

    Curl[x_] := \ Expand[\ Dual[tTimes[2, \ ∇x], {1, 2}]]; 
\)\)

Warming up with vector analysis

Choosing a coordinate system

NewSession["polar.lib"]

SMetric

Gradient of a scalar field

GradF = ∇F[r, ϕ, θ]

GradFInCoordinateBasis = ToCoordinateBasis[GradF]

Laplacian of scalar field

LaplaceF = Expand[Div[GradF]]

Double covariant derivative of scalar field

DDF = ∇GradF

Curl[GradF]

Divergence and curl of vector field

Vector = {{(V^r)[r, ϕ, θ], 
          (V^ϕ)[r, ϕ, θ], 
          (V^θ)[r, ϕ, θ]}, {-1}}

DivVector = Expand[Div[Vector]]

DerivativeOfVector = ∇Vector

CurlVector = Curl[Vector]

DivCurlVector = Div[CurlVector]

Veryfying Schwarzschild's solution of Einstein's field equations

Let us first study Schwarzschild solution of Einstein's field equations. This is the geometry of a static black hole. The program comes with a library of geometries, and for simplicity we load the coordinate system and tetrad components from a file:

Loading the tetrad frame

NewSession["Schwarzs.lib"]

Computing the Riemann tensor

The system can now readily compute and show the non-zero components of the Riemann tensor. The results are shown in the user-defined rigid frame.

SRiemann

Internally, the tensor is represented as a two-component list:

Riemann

The first part is a list of tensor components, and the second part tells if the indices are covariant (marked by 1) or contravariant (marked by -1):

Riemann[[2]]

Raise[Riemann, {1}][[2]]

Computing the Ricci and Einstein tensors

When we ask for the Ricci tensor, we are told that the geometry is Ricci flat:

SRicci

SEinstein

Curvature invariants

Computing invariants is very easy:

SKretschmann

Taking the divergence of a rank-four tensor

Computing the covariant derivative or the divergence of a higher-rank tensor is usually a very time-consuming and boring task to do by hand. With CARTAN and Mathematica it is simple:

CDivergence[Riemann, 1]

Exercise in relativistic cosmology

Loading the geometry

NewSession["FLRW.lib"]

SMetric

For simplicity, we assume that the Universe is spatially flat. Then

k = 0;

Checking the contracted Bianchi identity  (conservation of energy)

According to Einstein's field equations, the Einstein tensor is proportional to the energy-momentum tensor. Since the Einstein tensor is devergence free:

Div[Einstein]

the Energy-momentum tensor must also be covariantly conserved.

Finding Einstein's equations

SEinstein

The fourth component, corresponds to the time-time component of the energy-momentum tensor, i.e., the mass density. Assuming that ordinary galaxies dominate the mass of the Universe, the total mass scale as 1/R^3, or

Equation = 
      Einstein[[1]][[4, 4]] ==  8 Pi G K/R[t]^3

Solving with DSolve

solution = DSolve[Equation, R[t], t]

solution = Simplify[solution[[2]] /. t -> t + C[1]]

Identifying the Big Bang singularity

\(solution = {R[t] -> t^\((2/3)\)}; 

    Plot[\(solution[\([1]\)]\)[\([2]\)], {t, 0, 1}]; \)

We subsitute the solution back into the Riemann tensor and compute the Kretschmann invariant.

\(Riemann = Riemann /. DifferentialRules[solution]; \ 
SKretschmann\)

Clearly, there is a curvature singularityat t=0:

Plot[Kretschmann, {t, 0.1,  1}];

Veryfying Kerr's solution

Loading the geometry

NewSession["Kerr.lib"]

Inspecting properties of the spacetime geometry

SRiemann

SKretschmann

Verifying that Einstein's vacuum equation is satisfied

SRicci

Implementational issues

Controlling swelling

A main problem when computing curvature tensors symbolically, is the swelling of the expressions.  When manipulating tensors by differentiation and contraction, the intermediate expressions typically become very large and complicated. Usually, one can reduce the complexity significantly by a careful choice of simplification functsions for the  intermediate results. In CARTAN the swelling effect has been kept under control by automatically invoking Factoror Expand.

How to get CARTAN?

http://store.wolfram.com/view/cartan/
http://www.scup.no/books/en/cartan/