0% found this document useful (0 votes)
194 views

GR Basis

The document discusses how to perform calculations in general relativity using specific coordinate bases in Mathematica. It covers how to establish a manifold and coordinate chart, define a metric tensor, and compute quantities like the Christoffel symbols, Riemann tensor, and Einstein tensor.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
194 views

GR Basis

The document discusses how to perform calculations in general relativity using specific coordinate bases in Mathematica. It covers how to establish a manifold and coordinate chart, define a metric tensor, and compute quantities like the Christoffel symbols, Riemann tensor, and Einstein tensor.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

GR Calculations in Specific Bases Using

Mathematica
George E. Hrabovsky
MAST

Midwest Relativity Meeting, 2015


CIERA, Norwestern University
2 GR Calculations in Specific Bases Using Mathematica.nb

What I Will Cover


◼ Introduction
◼ How to Establish a Manifold
◼ How to Establish a Coordinate Chart
◼ How to Define a Metric
◼ How to Define a Tensor
◼ Computing the Christoffel Symbols
◼ The Riemann Tensor, The Ricci Tensor, The Ricci Scalar, and The Einstein Tensor
◼ The Stress-Energy Tensor
◼ Einstein’s Field Equations
GR Calculations in Specific Bases Using Mathematica.nb 3

Introduction
This is the third of an apparently endless series of talks on how to use Mathematica in general relativity.
Two years ago I talked about the built-in capabilities for handling tensors.
Last year I talked about the xAct package in general and how to apply it to perturbative general relativ-
ity, deriving the scalar and tensor field equations for a gravitational perturbation given a Lagrangian.
This year I am talking about performing calculations in specific coordinate bases.
Past talks can be found at the website:

http : // www.madscitech.org/tensors.html
This talk will appear there also.
4 GR Calculations in Specific Bases Using Mathematica.nb

Establishing Your Manifold


The first thing too do is activate xAct.

<< xAct`xTensor`
------------------------------------------------------------

Package xAct`xPerm` version 1.2.2, {2014, 9, 28}

CopyRight (C) 2003-2014, Jose M. Martin-Garcia, under the General Public License.

Connecting to external MinGW executable...

Connection established.

------------------------------------------------------------

Package xAct`xTensor` version 1.1.1, {2014, 9, 28}

CopyRight (C) 2002-2014, Jose M. Martin-Garcia, under the General Public License.

------------------------------------------------------------

These packages come with ABSOLUTELY NO WARRANTY; for details type Disclaimer[]. This is free software, and you
are welcome to redistribute it under certain conditions. See the General Public License for details.

------------------------------------------------------------

Then you define your manifold.


GR Calculations in Specific Bases Using Mathematica.nb 5

DefManifold[M4, 4, {α, β, γ, μ, ν, λ, σ, η}]


** DefManifold: Defining manifold M4.

** DefVBundle: Defining vbundle TangentM4.


6 GR Calculations in Specific Bases Using Mathematica.nb

DefMetric[- 1, metric[- α, - β], CD, {";", "∇"}, PrintAs → "g"]


** DefTensor: Defining symmetric metric tensor metric[- α, - β].

** DefTensor: Defining antisymmetric tensor epsilonmetric[- α, - β, - γ, - η].

** DefTensor: Defining tetrametric Tetrametric[- α, - β, - γ, - η].

** DefTensor: Defining tetrametric Tetrametric†[- α, - β, - γ, - η].

** DefCovD: Defining covariant derivative CD[- α].

** DefTensor: Defining vanishing torsion tensor TorsionCD[α, - β, - γ].

** DefTensor: Defining symmetric Christoffel tensor ChristoffelCD[α, - β, - γ].

** DefTensor: Defining Riemann tensor RiemannCD[- α, - β, - γ, - η].

** DefTensor: Defining symmetric Ricci tensor RicciCD[- α, - β].

** DefCovD: Contractions of Riemann automatically replaced by Ricci.

** DefTensor: Defining Ricci scalar RicciScalarCD[].

** DefCovD: Contractions of Ricci automatically replaced by RicciScalar.

** DefTensor: Defining symmetric Einstein tensor EinsteinCD[- α, - β].

** DefTensor: Defining Weyl tensor WeylCD[- α, - β, - γ, - η].

** DefTensor: Defining symmetric TFRicci tensor TFRicciCD[- α, - β].

** DefTensor: Defining Kretschmann scalar KretschmannCD[].

** DefCovD: Computing RiemannToWeylRules for dim 4

** DefCovD: Computing RicciToTFRicci for dim 4

** DefCovD: Computing RicciToEinsteinRules for dim 4

** DefTensor: Defining weight +2 density Detmetric[]. Determinant.


GR Calculations in Specific Bases Using Mathematica.nb 7

Establishing Your Chart


<< xAct`xCoba`
------------------------------------------------------------

Package xAct`xCoba` version 0.8.2, {2014, 9, 28}

CopyRight (C) 2005-2014, David Yllanes


and Jose M. Martin-Garcia, under the General Public License.

------------------------------------------------------------

These packages come with ABSOLUTELY NO WARRANTY; for details type


Disclaimer[]. This is free software, and you are welcome to redistribute
it under certain conditions. See the General Public License for details.

------------------------------------------------------------
8 GR Calculations in Specific Bases Using Mathematica.nb

$DefInfoQ = False;
$PrePrint = ScreenDollarIndices;
$CVSimplify = Simplify;
GR Calculations in Specific Bases Using Mathematica.nb 9

DefChart[cb, M4, {0, 1, 2, 3}, {t[], r[], θ[], ϕ[]}]

cb /: CIndexForm[0, cb] := "t";

cb /: CIndexForm[1, cb] := "r";

cb /: CIndexForm[2, cb] := "θ";

cb /: CIndexForm[3, cb] := "ϕ";

You should then define any scalar functions and constants you will need for your metric.

DefConstantSymbol[M]

DefConstantSymbol[G]
10 GR Calculations in Specific Bases Using Mathematica.nb

Two Ways to Define Your Metric


2M 2M -1
MatrixFormmet = DiagonalMatrix1 - , 1- , - r[]2 , 2 r[] Sin[θ[]]2 
r[] r[]
2M
1- r
0 0 0
1
0 2M 0 0
1- r
0 0 - r2 0
0 0 0 2 r Sin[θ]2
GR Calculations in Specific Bases Using Mathematica.nb 11

MetricInBasis[metric, - cb, met] // TableForm


2M
Added independent rule g → 1- for tensor metric
tt r
Added independent rule g → 0 for tensor metric
tr
Added independent rule g → 0 for tensor metric

Added independent rule g → 0 for tensor metric

Added dependent rule g → g for tensor metric
rt tr
1
Added independent rule g → for tensor metric
rr 1- 2M
r

Added independent rule g → 0 for tensor metric



Added independent rule g → 0 for tensor metric

Added dependent rule g → g for tensor metric
θt tθ
Added dependent rule g → g for tensor metric
θr rθ
Added independent rule g → - r2 for tensor metric
θθ
Added independent rule g → 0 for tensor metric
θϕ
Added dependent rule g → g for tensor metric
ϕt tϕ
Added dependent rule g → g for tensor metric
ϕr rϕ
Added dependent rule g → g for tensor metric
ϕθ θϕ
Added independent rule g → 2 r Sin[θ]2 for tensor metric
ϕϕ
2M
g tt → 1 - r
g tr → 0 g tθ → 0 g tϕ → 0
1
g rt → 0 g rr → 2M g rθ → 0 g rϕ → 0
1- r

g θt → 0 g θr → 0 g θθ → - r2 g θϕ → 0

g ϕt → 0 g ϕr → 0 g ϕθ → 0 g ϕϕ → 2 r Sin[θ]2
12 GR Calculations in Specific Bases Using Mathematica.nb

TensorValues @ metric
FoldedRule
 g rt → g tr , g θt → g tθ , g θr → g rθ , g ϕt → g tϕ , g ϕr → g rϕ , g ϕθ → g θϕ ,
2M 1
 g tt → 1 - , g tr → 0, g tθ → 0, g tϕ → 0, g rr → ,
r 1- 2M r

g rθ → 0, g rϕ → 0, g θθ → - r2 , g θϕ → 0, g ϕϕ → 2 r Sin[θ]2 

MetricCompute[metric, cb, "Weyl"[- 1, - 1, - 1, - 1]]


GR Calculations in Specific Bases Using Mathematica.nb 13

Now we can explore the second method of defining the metric.

g = CTensor[met, {- cb, - cb}];

SetCMetric[g, - cb];

Here was can specify the gtt component,

g[{0, - cb}, {0, - cb}]


2M
1-
r

MetricCompute[g, cb, "Weyl"[- 1, - 1, - 1, - 1]];


14 GR Calculations in Specific Bases Using Mathematica.nb

Here we define the covariant derivative,

cd = CovDOfMetric[g]
CCovDPDcb,
M M
CTensor0, - , 0, 0, - , 0, 0, 0, {0, 0, 0, 0}, {0, 0, 0, 0},
2 M r - r2 2 M r - r2
M (2 M - r) M
 , 0, 0, 0, 0, , 0, 0,
r3 2 M r - r2
(2 M - r) Sin[θ]2
{0, 0, - 2 M + r, 0}, 0, 0, 0, ,
r
1 1 Sin[2 θ]
{0, 0, 0, 0}, 0, 0, , 0, 0, , 0, 0, 0, 0, 0, ,
r r r
1 1
{0, 0, 0, 0}, 0, 0, 0, , {0, 0, 0, Cot[θ]}, 0, , Cot[θ], 0,
2r 2r
2M 1
{cb, - cb, - cb}, 0, CTensor1 - , 0, 0, 0, 0, , 0, 0,
r 1 - 2rM
0, 0, - r2 , 0, 0, 0, 0, 2 r Sin[θ]2 , {- cb, - cb}, 0
GR Calculations in Specific Bases Using Mathematica.nb 15

Christoffel Symbols in a Coordinate Basis


In general we can write the Christoffel symbols

Christoffel[CD, PDcb][α, - β, - γ]

Γ[∇,] α βγ

We can make a table of these in our coordinate basis.

Part[TensorValues @ ChristoffelCDPDcb, 2] // TableForm

Γ[∇,] t tt → 0

Γ[∇,] t tr → - 2 M r-r2
M

Γ[∇,] t tθ → 0

Γ[∇,] t tϕ → 0

Γ[∇,] t rr → 0

Γ[∇,] t rθ → 0

Γ[∇,] t rϕ → 0

Γ[∇,] t θθ → 0

Γ[∇,] t θϕ → 0

Γ[∇,] t ϕϕ → 0

Γ[∇,] r tt →
M (2 M-r)
r3

Γ[∇,] r tr → 0

Γ[∇,] r tθ → 0

Γ[∇,] r tϕ → 0

Γ[∇,] r rr →
M
2 M r-r2

Γ[∇,] r rθ → 0

Γ[∇,] r rϕ → 0

Γ[∇,] r θθ → - 2 M + r

Γ[∇,] r θϕ → 0

Γ[∇,] r ϕϕ →
(2 M-r) Sin[θ]2
r

Γ[∇,] θ tt → 0

Γ[∇,] θ tr → 0

Γ[∇,] θ tθ → 0

Γ[∇,] θ tϕ → 0
16 GR Calculations in Specific Bases Using Mathematica.nb

Γ[∇,] θ rr → 0

Γ[∇,] θ rθ →
1
r

Γ[∇,] θ rϕ → 0

Γ[∇,] θ θθ → 0

Γ[∇,] θ θϕ → 0

Γ[∇,] θ ϕϕ →
Sin[2 θ]
r

Γ[∇,] ϕ tt → 0

Γ[∇,] ϕ tr → 0

Γ[∇,] ϕ tθ → 0

Γ[∇,] ϕ tϕ → 0

Γ[∇,] ϕ rr → 0

Γ[∇,] ϕ rθ → 0

Γ[∇,] ϕ rϕ →
1
2r

Γ[∇,] ϕ θθ → 0

Γ[∇,] ϕ θϕ → Cot[θ]

Γ[∇,] ϕ ϕϕ → 0
GR Calculations in Specific Bases Using Mathematica.nb 17

The Riemann Tensor


riemann = Riemann[cd]
CTensor{{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}},
2 M (- 2 M + r) 2M
0, , 0, 0,  , 0, 0, 0, {0, 0, 0, 0}, {0, 0, 0, 0},
r4 (2 M - r) r2
M (2 M - r) M
0, 0, , 0, {0, 0, 0, 0}, - , 0, 0, 0, {0, 0, 0, 0},
r 4 r
M (2 M - r) M Sin[θ]2
0, 0, 0, , {0, 0, 0, 0}, {0, 0, 0, 0},  , 0, 0, 0,
2 r4 r2
2 M (- 2 M + r) 2M
0, - , 0, 0, - , 0, 0, 0, {0, 0, 0, 0}, {0, 0, 0, 0},
r4 (2 M - r) r2
{{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}},
M M
{0, 0, 0, 0}, 0, 0, , 0, 0, - , 0, 0, {0, 0, 0, 0},
(2 M - r) r 2 r
-4 M + r Cot[θ]
{0, 0, 0, 0}, 0, 0, 0, , 0, 0, 0, ,
4 r2 (- 2 M + r) 2r
(4 M - r) Sin[θ]2 Cos[θ] Sin[θ]
0, , , 0,
2 r2 r2
M (2 M - r) M
0, 0, - , 0, {0, 0, 0, 0},  , 0, 0, 0, {0, 0, 0, 0},
r 4 r
M M
{0, 0, 0, 0}, 0, 0, - , 0, 0, , 0, 0, {0, 0, 0, 0},
(2 M - r) r2 r
{{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}},
Cot[θ] 3 M
{0, 0, 0, 0}, 0, 0, 0, , 0, 0, 0, - ,
2r 2 r
Cos[θ] (2 M - r) Sin[θ] (- 2 M + 3 r) Sin[θ]2
0, , , 0,
r r2
M (2 M - r) M Sin[θ]2
0, 0, 0, - , {0, 0, 0, 0}, {0, 0, 0, 0}, - , 0, 0, 0,
2r 4 r2
-4 M + r Cot[θ]
{0, 0, 0, 0}, 0, 0, 0, - , 0, 0, 0, - ,
4 r2 (- 2 M + r) 2r
(4 M - r) Sin[θ]2 Cos[θ] Sin[θ] Cot[θ]
0, - ,- , 0, {0, 0, 0, 0}, 0, 0, 0, - ,
2 r2 r2 2r
3 M Cos[θ] (2 M - r) Sin[θ] (- 2 M + 3 r) Sin[θ]2
0, 0, 0, - + , 0, - ,- , 0,
2 r r r2
{{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}, {- cb, - cb, - cb, cb}, 0

riemann[{0, - cb}, {1, - cb}, {0, - cb}, {1, cb}]


2 M (- 2 M + r)
r4

riemann[{3, - cb}, {2, - cb}, {3, - cb}, {2, cb}]


(- 2 M + 3 r) Sin[θ]2
-
r2
18 GR Calculations in Specific Bases Using Mathematica.nb

The Ricci Tensor and Ricci Scalar


Ricci[cd][- α, - β]
M (-2 M+r)
0 0 0
2 r4
1 Cot[θ]
0 - 0
8 M r-4 r2 2 r
Cot[θ] 3 M
0
2 r 2
+
r
0 αβ
(2 M+5 r) Sin[θ]2
0 0 0 -
2 r2

Ricci[cd][{0, - cb}, {0, - cb}]


M (- 2 M + r)
2 r4

rs = RicciScalar[cd][[1]]
2M+5r
-
2 r3
GR Calculations in Specific Bases Using Mathematica.nb 19

The Einstein Tensor


Einstein[cd][- α, - β]
(2 M-r) (4 M+5 r)
- 0 0 0
4 r4
M+3 r Cot[θ]
0 - 0
4 M r2 -2 r3 2 r
0
Cot[θ] 2 M+r
0
αβ
2 r 4 r
0 0 0 0

Einstein[cd][{0, - cb}, {0, - cb}]


(2 M - r) (4 M + 5 r)
-
4 r4
20 GR Calculations in Specific Bases Using Mathematica.nb

The Stress Energy Tensor


We next need to calculate the stress-energy tensor. we begin by defining the density field.

DefTensor[ρ, M4]
DefTensor[ρ, M4, GenSet[]]

Here we define the 4-velocity.

U = CTensor[{1, 0, 0, 0}, {- cb}]


CTensor[{1, 0, 0, 0}, {- cb}, 0]
GR Calculations in Specific Bases Using Mathematica.nb 21

Here is the stress-energy tensor for a pressure-less dust

Td[α_, β_] := ρ[] U[- α] U[- β]

Td[α, β]

ρ[] 0 0 0
0 0 0 0
0 0 0 0 βα
0 0 0 0

Here we have the Ttt component.

Td[{0, cb}, {0, cb}]


ρ[]
22 GR Calculations in Specific Bases Using Mathematica.nb

The pressure-less dust is very simple. A little more complicated is the perfect fluid. This requires us to
define a pressure field.

DefTensor[p, M4]
DefTensor[p, M4, GenSet[]]

The stress-energy tensor for this situation is,

Tf[α_, β_] := (ρ[] + p[]) U[- α] U[- β] + p[] g[- α, - β]

Tf[α, β]
2 M
p[]+p[] 1- +ρ[] 0 0 0
r
p[]
0 2 M
0 0
1-
r αβ
0 0 -p[] r2 0
0 0 0 2 p[] r Sin[θ]2

Tf[{- 0, cb}, {- 0, cb}]


2M
p[] + p[] 1 - + ρ[]
r

Tf[{- 1, cb}, {- 1, cb}]


p[]
2M
1- r
GR Calculations in Specific Bases Using Mathematica.nb 23

Einstein’s Field Equations


We will now try to write Einstein’s equation for the tt components of the Einstein and stress-energy
tensors. We begin with this formulation,
1
Rtt - R gtt = 8 π G Ttt
2
24 GR Calculations in Specific Bases Using Mathematica.nb

1
tteq = Ricci[cd][{0, - cb}, {0, - cb}] - rs g[{0, - cb}, {0, - cb}] ⩵
2
8 π G Tf[{- 0, cb}, {- 0, cb}]
2M
M (- 2 M + r) 1 - r
 (2 M + 5 r) 2M
+ ⩵ 8 G π p[] + p[] 1 - + ρ[]
2 r4 4 r3 r

tteq // FullSimplify
(2 M - r) (4 M + 5 r) 2M
- ⩵ 8 G π p[] 2 - + ρ[]
4 r4 r

We can also write the equation,


Gtt = 8 π G Ttt

tteq2 = Einstein[cd][{0, - cb}, {0, - cb}] ⩵ 8 π G Tf[{- 0, cb}, {- 0, cb}] // FullSimplify


(2 M - r) (4 M + 5 r) 2M
- ⩵ 8 G π p[] 2 - + ρ[]
4 r4 r
GR Calculations in Specific Bases Using Mathematica.nb 25

We can genralize this

eineq[a_, b_] :=
Einstein[cd][{a, - cb}, {b, - cb}] - 8 π G Tf[{- a, cb}, {- b, cb}] // FullSimplify

eineq[0, 0]
(2 M - r) (4 M + 5 r) 2M
- - 8 G π p[] 2 - + ρ[]
4 r4 r

eineq[1, 1]
M + 3 r - 16 G π p[] r3
2 r2 (- 2 M + r)

eineq[0, 1]
0
26 GR Calculations in Specific Bases Using Mathematica.nb

Table[eineq[a, b], {a, 0, 3}, {b, 0, 3}] // TableForm


(2 M-r) (4 M+5 r) 2M
- - 8 G π p[] 2 -  + ρ[] 0 0 0
4 r4 r
M+3 r-16 G π p[] r3 Cot[θ]
0 0
2 r2 (-2 M+r) 2r
Cot[θ] 1 M
0 + + 8 G π p[] r2 0
2r 4 2r
0 0 0 -16 G π p[] r Sin[θ]2
GR Calculations in Specific Bases Using Mathematica.nb 27

Thank You!

You might also like