CoCalc Shared FilesBHLectures / sage / Kottler_solution.ipynbOpen in CoCalc with one click!
Author: Eric Gourgoulhon
Views : 13

Solving Einstein equation to get Kottler solution

This Jupyter/SageMath worksheet is relative to the lectures Geometry and physics of black holes

These computations are based on SageManifolds (version 1.0, as included in SageMath 7.5 and higher versions)

Click here to download the worksheet file (ipynb format). To run it, you must start SageMath with the Jupyter notebook, with the command sage -n jupyter

NB: a version of SageMath at least equal to 7.5 is required to run this worksheet:

In [1]:
version()
'SageMath version 8.0.beta6, Release Date: 2017-05-12'

First we set up the notebook to display mathematical objects using LaTeX formatting:

In [2]:
%display latex

Spacetime

We declare the spacetime manifold MM:

In [3]:
M = Manifold(4, 'M') print(M)
4-dimensional differentiable manifold M

We declare the chart of spherical coordinates (t,r,θ,ϕ)(t,r,\theta,\phi):

In [4]:
X.<t,r,th,ph> = M.chart(r't r:(0,+oo) th:(0,pi):\theta ph:(0,2*pi):\phi') X
(M,(t,r,θ,ϕ))\left(M,(t, r, {\theta}, {\phi})\right)

The static and spherically symmetric metric ansatz, with the unknown functions A(r)A(r) and B(r)B(r):

In [5]:
g = M.lorentzian_metric('g') A = function('A') B = function('B') g[0,0] = -A(r) g[1,1] = B(r) g[2,2] = r^2 g[3,3] = (r*sin(th))^2 g.display()
g=A(r)dtdt+B(r)drdr+r2dθdθ+r2sin(θ)2dϕdϕg = -A\left(r\right) \mathrm{d} t\otimes \mathrm{d} t + B\left(r\right) \mathrm{d} r\otimes \mathrm{d} r + r^{2} \mathrm{d} {\theta}\otimes \mathrm{d} {\theta} + r^{2} \sin\left({\theta}\right)^{2} \mathrm{d} {\phi}\otimes \mathrm{d} {\phi}

The Christoffel symbols of gg, with respect to the default chart:

In [6]:
g.christoffel_symbols_display()
Γttrttr=Ar2A(r)Γrttrtt=Ar2B(r)Γrrrrrr=Br2B(r)Γrθθrθθ=rB(r)Γrϕϕrϕϕ=rsin(θ)2B(r)Γθrθθrθ=1rΓθϕϕθϕϕ=cos(θ)sin(θ)Γϕrϕϕrϕ=1rΓϕθϕϕθϕ=cos(θ)sin(θ)\begin{array}{lcl} \Gamma_{ \phantom{\, t} \, t \, r }^{ \, t \phantom{\, t} \phantom{\, r} } & = & \frac{\frac{\partial\,A}{\partial r}}{2 \, A\left(r\right)} \\ \Gamma_{ \phantom{\, r} \, t \, t }^{ \, r \phantom{\, t} \phantom{\, t} } & = & \frac{\frac{\partial\,A}{\partial r}}{2 \, B\left(r\right)} \\ \Gamma_{ \phantom{\, r} \, r \, r }^{ \, r \phantom{\, r} \phantom{\, r} } & = & \frac{\frac{\partial\,B}{\partial r}}{2 \, B\left(r\right)} \\ \Gamma_{ \phantom{\, r} \, {\theta} \, {\theta} }^{ \, r \phantom{\, {\theta}} \phantom{\, {\theta}} } & = & -\frac{r}{B\left(r\right)} \\ \Gamma_{ \phantom{\, r} \, {\phi} \, {\phi} }^{ \, r \phantom{\, {\phi}} \phantom{\, {\phi}} } & = & -\frac{r \sin\left({\theta}\right)^{2}}{B\left(r\right)} \\ \Gamma_{ \phantom{\, {\theta}} \, r \, {\theta} }^{ \, {\theta} \phantom{\, r} \phantom{\, {\theta}} } & = & \frac{1}{r} \\ \Gamma_{ \phantom{\, {\theta}} \, {\phi} \, {\phi} }^{ \, {\theta} \phantom{\, {\phi}} \phantom{\, {\phi}} } & = & -\cos\left({\theta}\right) \sin\left({\theta}\right) \\ \Gamma_{ \phantom{\, {\phi}} \, r \, {\phi} }^{ \, {\phi} \phantom{\, r} \phantom{\, {\phi}} } & = & \frac{1}{r} \\ \Gamma_{ \phantom{\, {\phi}} \, {\theta} \, {\phi} }^{ \, {\phi} \phantom{\, {\theta}} \phantom{\, {\phi}} } & = & \frac{\cos\left({\theta}\right)}{\sin\left({\theta}\right)} \end{array}

Einstein equation

The cosmological constant:

In [7]:
var('Lamb', latex_name='\Lambda')
Λ{\Lambda}

The Einstein equation:

In [8]:
EE = g.ricci() - 1/2*g.ricci_scalar()*g + Lamb*g EE.set_name('E') print(EE)
Field of symmetric bilinear forms E on the 4-dimensional differentiable manifold M
In [9]:
EE.display_comp()
Etttt=(Λr21)A(r)B(r)2rA(r)Br+A(r)B(r)r2B(r)2Errrr=(Λr21)A(r)B(r)+rAr+A(r)r2A(r)Eθθθθ=4Λr2A(r)2B(r)2r2B(r)(Ar)2+2r2A(r)B(r)2Ar2+2rA(r)B(r)Ar(r2A(r)Ar+2rA(r)2)Br4A(r)2B(r)2Eϕϕϕϕ=(4Λr2A(r)2B(r)2r2B(r)(Ar)2+2r2A(r)B(r)2Ar2+2rA(r)B(r)Ar(r2A(r)Ar+2rA(r)2)Br)sin(θ)24A(r)2B(r)2\begin{array}{lcl} E_{ \, t \, t }^{ \phantom{\, t}\phantom{\, t} } & = & -\frac{{\left({\Lambda} r^{2} - 1\right)} A\left(r\right) B\left(r\right)^{2} - r A\left(r\right) \frac{\partial\,B}{\partial r} + A\left(r\right) B\left(r\right)}{r^{2} B\left(r\right)^{2}} \\ E_{ \, r \, r }^{ \phantom{\, r}\phantom{\, r} } & = & \frac{{\left({\Lambda} r^{2} - 1\right)} A\left(r\right) B\left(r\right) + r \frac{\partial\,A}{\partial r} + A\left(r\right)}{r^{2} A\left(r\right)} \\ E_{ \, {\theta} \, {\theta} }^{ \phantom{\, {\theta}}\phantom{\, {\theta}} } & = & \frac{4 \, {\Lambda} r^{2} A\left(r\right)^{2} B\left(r\right)^{2} - r^{2} B\left(r\right) \left(\frac{\partial\,A}{\partial r}\right)^{2} + 2 \, r^{2} A\left(r\right) B\left(r\right) \frac{\partial^2\,A}{\partial r ^ 2} + 2 \, r A\left(r\right) B\left(r\right) \frac{\partial\,A}{\partial r} - {\left(r^{2} A\left(r\right) \frac{\partial\,A}{\partial r} + 2 \, r A\left(r\right)^{2}\right)} \frac{\partial\,B}{\partial r}}{4 \, A\left(r\right)^{2} B\left(r\right)^{2}} \\ E_{ \, {\phi} \, {\phi} }^{ \phantom{\, {\phi}}\phantom{\, {\phi}} } & = & \frac{{\left(4 \, {\Lambda} r^{2} A\left(r\right)^{2} B\left(r\right)^{2} - r^{2} B\left(r\right) \left(\frac{\partial\,A}{\partial r}\right)^{2} + 2 \, r^{2} A\left(r\right) B\left(r\right) \frac{\partial^2\,A}{\partial r ^ 2} + 2 \, r A\left(r\right) B\left(r\right) \frac{\partial\,A}{\partial r} - {\left(r^{2} A\left(r\right) \frac{\partial\,A}{\partial r} + 2 \, r A\left(r\right)^{2}\right)} \frac{\partial\,B}{\partial r}\right)} \sin\left({\theta}\right)^{2}}{4 \, A\left(r\right)^{2} B\left(r\right)^{2}} \end{array}

Simplifying and rearranging the equations

In [10]:
eq0 = EE[0,0]*r^2*B(r)^2/A(r); eq0
(Λr21)A(r)B(r)2rA(r)Br+A(r)B(r)A(r)-\frac{{\left({\Lambda} r^{2} - 1\right)} A\left(r\right) B\left(r\right)^{2} - r A\left(r\right) \frac{\partial\,B}{\partial r} + A\left(r\right) B\left(r\right)}{A\left(r\right)}
In [11]:
eq1 = EE[1,1]*r^2*A(r); eq1
(Λr21)A(r)B(r)+rAr+A(r){\left({\Lambda} r^{2} - 1\right)} A\left(r\right) B\left(r\right) + r \frac{\partial\,A}{\partial r} + A\left(r\right)
In [12]:
eq2 = EE[2,2]*4*A(r)^2*B(r)^2; eq2
4Λr2A(r)2B(r)2r2B(r)(Ar)2+2r2A(r)B(r)2Ar2+2rA(r)B(r)Ar(r2A(r)Ar+2rA(r)2)Br4 \, {\Lambda} r^{2} A\left(r\right)^{2} B\left(r\right)^{2} - r^{2} B\left(r\right) \left(\frac{\partial\,A}{\partial r}\right)^{2} + 2 \, r^{2} A\left(r\right) B\left(r\right) \frac{\partial^2\,A}{\partial r ^ 2} + 2 \, r A\left(r\right) B\left(r\right) \frac{\partial\,A}{\partial r} - {\left(r^{2} A\left(r\right) \frac{\partial\,A}{\partial r} + 2 \, r A\left(r\right)^{2}\right)} \frac{\partial\,B}{\partial r}
In [13]:
eq3 = EE[3,3]*4*A(r)^2*B(r)^2/sin(th)^2; eq3
4Λr2A(r)2B(r)2r2B(r)(Ar)2+2r2A(r)B(r)2Ar2+2rA(r)B(r)Ar(r2A(r)Ar+2rA(r)2)Br4 \, {\Lambda} r^{2} A\left(r\right)^{2} B\left(r\right)^{2} - r^{2} B\left(r\right) \left(\frac{\partial\,A}{\partial r}\right)^{2} + 2 \, r^{2} A\left(r\right) B\left(r\right) \frac{\partial^2\,A}{\partial r ^ 2} + 2 \, r A\left(r\right) B\left(r\right) \frac{\partial\,A}{\partial r} - {\left(r^{2} A\left(r\right) \frac{\partial\,A}{\partial r} + 2 \, r A\left(r\right)^{2}\right)} \frac{\partial\,B}{\partial r}
In [14]:
eq3 == eq2
True\mathrm{True}

Solving Einstein equation

The following combination of eq0 and eq1 is particularly simple:

In [15]:
eq4 = (eq0*A(r) + eq1*B(r))/r; eq4
rB(r)Ar+rA(r)Brr\frac{r B\left(r\right) \frac{\partial\,A}{\partial r} + r A\left(r\right) \frac{\partial\,B}{\partial r}}{r}

The solution is A(r)B(r)=CA(r)B(r)=C, where CC is a constant:

In [16]:
s = desolve(eq4.expr() == 0, B(r), ivar=r) s
CA(r)\frac{C}{A\left(r\right)}

Let us rename the constant to α\alpha:

In [17]:
var('alpha', latex_name=r'\alpha') B_sol(r) = s.subs(_C=alpha); B_sol
r  αA(r)r \ {\mapsto}\ \frac{{\alpha}}{A\left(r\right)}

We replace B(r)B(r) by the above value in the remaining equations:

In [18]:
eq5 = X.function(eq1.expr().substitute_function(B, B_sol)); eq5
(Λr21)α+rAr+A(r){\left({\Lambda} r^{2} - 1\right)} {\alpha} + r \frac{\partial\,A}{\partial r} + A\left(r\right)
In [19]:
eq6 = X.function(eq2.expr().substitute_function(B, B_sol)); eq6
4Λα2r2αr2(Ar)2A(r)+2αr22Ar2+2αrAr+(r2A(r)Ar+2rA(r)2)αArA(r)24 \, {\Lambda} {\alpha}^{2} r^{2} - \frac{{\alpha} r^{2} \left(\frac{\partial\,A}{\partial r}\right)^{2}}{A\left(r\right)} + 2 \, {\alpha} r^{2} \frac{\partial^2\,A}{\partial r ^ 2} + 2 \, {\alpha} r \frac{\partial\,A}{\partial r} + \frac{{\left(r^{2} A\left(r\right) \frac{\partial\,A}{\partial r} + 2 \, r A\left(r\right)^{2}\right)} {\alpha} \frac{\partial\,A}{\partial r}}{A\left(r\right)^{2}}

Let us solve eq5 for A(r)A(r). Note that we are using eq5.expr() to get a symbolic expression, as expected by the function desolve, while eq5 is a coordinate function.

In [20]:
s = desolve(eq5.expr() == 0, A(r), ivar=r) s.expand()
13Λαr2+α+Cr-\frac{1}{3} \, {\Lambda} {\alpha} r^{2} + {\alpha} + \frac{C}{r}

We rename the constant CC to 2m-2m and set the value of constant α\alpha to 11:

In [21]:
var('m') A_sol(r) = s.subs(_C=-2*m, alpha=1).expand() A_sol
r  13Λr22mr+1r \ {\mapsto}\ -\frac{1}{3} \, {\Lambda} r^{2} - \frac{2 \, m}{r} + 1

Let us check that eq6 is fulfilled by the found value of A(r)A(r):

In [22]:
eq6.expr().substitute_function(A, A_sol).subs(alpha=1).simplify_full()
00

Final expression of the metric

We have got the Kottler metric:

In [23]:
g[0,0] = -A_sol(r) g[1,1] = 1/A_sol(r) g.display()
g=(13Λr2+2mr1)dtdt+(3Λr2+6mr3)drdr+r2dθdθ+r2sin(θ)2dϕdϕg = \left( \frac{1}{3} \, {\Lambda} r^{2} + \frac{2 \, m}{r} - 1 \right) \mathrm{d} t\otimes \mathrm{d} t + \left( -\frac{3}{{\Lambda} r^{2} + \frac{6 \, m}{r} - 3} \right) \mathrm{d} r\otimes \mathrm{d} r + r^{2} \mathrm{d} {\theta}\otimes \mathrm{d} {\theta} + r^{2} \sin\left({\theta}\right)^{2} \mathrm{d} {\phi}\otimes \mathrm{d} {\phi}

which reduces to Schwarzschild metric as soons as the cosmological constant vanishes.

In [24]:
g.christoffel_symbols_display()
Γttrttr=Λr33mΛr4+6mr3r2Γrttrtt=Λ2r6+3Λmr33Λr418m2+9mr9r3Γrrrrrr=Λr33mΛr4+6mr3r2Γrθθrθθ=13Λr3+2mrΓrϕϕrϕϕ=13(Λr3+6m3r)sin(θ)2Γθrθθrθ=1rΓθϕϕθϕϕ=cos(θ)sin(θ)Γϕrϕϕrϕ=1rΓϕθϕϕθϕ=cos(θ)sin(θ)\begin{array}{lcl} \Gamma_{ \phantom{\, t} \, t \, r }^{ \, t \phantom{\, t} \phantom{\, r} } & = & \frac{{\Lambda} r^{3} - 3 \, m}{{\Lambda} r^{4} + 6 \, m r - 3 \, r^{2}} \\ \Gamma_{ \phantom{\, r} \, t \, t }^{ \, r \phantom{\, t} \phantom{\, t} } & = & \frac{{\Lambda}^{2} r^{6} + 3 \, {\Lambda} m r^{3} - 3 \, {\Lambda} r^{4} - 18 \, m^{2} + 9 \, m r}{9 \, r^{3}} \\ \Gamma_{ \phantom{\, r} \, r \, r }^{ \, r \phantom{\, r} \phantom{\, r} } & = & -\frac{{\Lambda} r^{3} - 3 \, m}{{\Lambda} r^{4} + 6 \, m r - 3 \, r^{2}} \\ \Gamma_{ \phantom{\, r} \, {\theta} \, {\theta} }^{ \, r \phantom{\, {\theta}} \phantom{\, {\theta}} } & = & \frac{1}{3} \, {\Lambda} r^{3} + 2 \, m - r \\ \Gamma_{ \phantom{\, r} \, {\phi} \, {\phi} }^{ \, r \phantom{\, {\phi}} \phantom{\, {\phi}} } & = & \frac{1}{3} \, {\left({\Lambda} r^{3} + 6 \, m - 3 \, r\right)} \sin\left({\theta}\right)^{2} \\ \Gamma_{ \phantom{\, {\theta}} \, r \, {\theta} }^{ \, {\theta} \phantom{\, r} \phantom{\, {\theta}} } & = & \frac{1}{r} \\ \Gamma_{ \phantom{\, {\theta}} \, {\phi} \, {\phi} }^{ \, {\theta} \phantom{\, {\phi}} \phantom{\, {\phi}} } & = & -\cos\left({\theta}\right) \sin\left({\theta}\right) \\ \Gamma_{ \phantom{\, {\phi}} \, r \, {\phi} }^{ \, {\phi} \phantom{\, r} \phantom{\, {\phi}} } & = & \frac{1}{r} \\ \Gamma_{ \phantom{\, {\phi}} \, {\theta} \, {\phi} }^{ \, {\phi} \phantom{\, {\theta}} \phantom{\, {\phi}} } & = & \frac{\cos\left({\theta}\right)}{\sin\left({\theta}\right)} \end{array}

Let us check that Einstein equation is satisfied by the above metric:

In [25]:
EE = g.ricci() - 1/2*g.ricci_scalar()*g + Lamb*g EE.set_name('E') EE.display()
E=0E = 0

The Ricci scalar is constant for this solution:

In [26]:
g.ricci_scalar().display()
r(g):MR(t,r,θ,ϕ)4Λ\begin{array}{llcl} \mathrm{r}\left(g\right):& M & \longrightarrow & \mathbb{R} \\ & \left(t, r, {\theta}, {\phi}\right) & \longmapsto & 4 \, {\Lambda} \end{array}

The Ricci tensor is proportional to the metric tensor:

In [27]:
g.ricci().display()
Ric(g)=(Λ2r3+6Λm3Λr3r)dtdt+(3ΛrΛr3+6m3r)drdr+Λr2dθdθ+Λr2sin(θ)2dϕdϕ\mathrm{Ric}\left(g\right) = \left( \frac{{\Lambda}^{2} r^{3} + 6 \, {\Lambda} m - 3 \, {\Lambda} r}{3 \, r} \right) \mathrm{d} t\otimes \mathrm{d} t + \left( -\frac{3 \, {\Lambda} r}{{\Lambda} r^{3} + 6 \, m - 3 \, r} \right) \mathrm{d} r\otimes \mathrm{d} r + {\Lambda} r^{2} \mathrm{d} {\theta}\otimes \mathrm{d} {\theta} + {\Lambda} r^{2} \sin\left({\theta}\right)^{2} \mathrm{d} {\phi}\otimes \mathrm{d} {\phi}
In [28]:
g.ricci() == Lamb * g
True\mathrm{True}