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

Checking that Kerr metric is a solution of Einstein equation

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 7.5, Release Date: 2017-01-11'

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

In [2]:
%display latex

To speed up computations, we ask for running them in parallel on 8 threads:

In [3]:
Parallelism().set(nproc=8)

Spacetime

We declare the spacetime manifold MM:

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

and the Boyer-Lindquist coordinates (t,r,θ,ϕ)(t,r,\theta,\phi) as a chart on MM:

In [5]:
XBL.<t,r,th,ph> = M.chart(r't r th:(0,pi):\theta ph:(0,2*pi):\phi') XBL
(M,(t,r,θ,ϕ))\left(M,(t, r, {\theta}, {\phi})\right)
In [6]:
XBL.coord_range()
t: (,+);r: (,+);θ: (0,π);ϕ: (0,2π)t :\ \left( -\infty, +\infty \right) ;\quad r :\ \left( -\infty, +\infty \right) ;\quad {\theta} :\ \left( 0 , \pi \right) ;\quad {\phi} :\ \left( 0 , 2 \, \pi \right)

Kerr metric

We define the metric gg by its components w.r.t. the Boyer-Lindquist coordinates:

In [7]:
g = M.lorentzian_metric('g') m, a = var('m a') rho2 = r^2 + (a*cos(th))^2 Delta = r^2 - 2*m*r + a^2 g[0,0] = -(1 - 2*m*r/rho2) g[0,3] = -2*a*m*r*sin(th)^2/rho2 g[1,1] = rho2/Delta g[2,2] = rho2 g[3,3] = (r^2 + a^2 + 2*m*r*(a*sin(th))^2/rho2)*sin(th)^2 g.display()
g=(2mra2cos(θ)2+r21)dtdt+(2amrsin(θ)2a2cos(θ)2+r2)dtdϕ+(a2cos(θ)2+r2a22mr+r2)drdr+(a2cos(θ)2+r2)dθdθ+(2amrsin(θ)2a2cos(θ)2+r2)dϕdt+(2a2mrsin(θ)2a2cos(θ)2+r2+a2+r2)sin(θ)2dϕdϕg = \left( \frac{2 \, m r}{a^{2} \cos\left({\theta}\right)^{2} + r^{2}} - 1 \right) \mathrm{d} t\otimes \mathrm{d} t + \left( -\frac{2 \, a m r \sin\left({\theta}\right)^{2}}{a^{2} \cos\left({\theta}\right)^{2} + r^{2}} \right) \mathrm{d} t\otimes \mathrm{d} {\phi} + \left( \frac{a^{2} \cos\left({\theta}\right)^{2} + r^{2}}{a^{2} - 2 \, m r + r^{2}} \right) \mathrm{d} r\otimes \mathrm{d} r + \left( a^{2} \cos\left({\theta}\right)^{2} + r^{2} \right) \mathrm{d} {\theta}\otimes \mathrm{d} {\theta} + \left( -\frac{2 \, a m r \sin\left({\theta}\right)^{2}}{a^{2} \cos\left({\theta}\right)^{2} + r^{2}} \right) \mathrm{d} {\phi}\otimes \mathrm{d} t + {\left(\frac{2 \, a^{2} m r \sin\left({\theta}\right)^{2}}{a^{2} \cos\left({\theta}\right)^{2} + r^{2}} + a^{2} + r^{2}\right)} \sin\left({\theta}\right)^{2} \mathrm{d} {\phi}\otimes \mathrm{d} {\phi}
In [8]:
g.display_comp()
gtttt=2mra2cos(θ)2+r21gtϕtϕ=2amrsin(θ)2a2cos(θ)2+r2grrrr=a2cos(θ)2+r2a22mr+r2gθθθθ=a2cos(θ)2+r2gϕtϕt=2amrsin(θ)2a2cos(θ)2+r2gϕϕϕϕ=(2a2mrsin(θ)2a2cos(θ)2+r2+a2+r2)sin(θ)2\begin{array}{lcl} g_{ \, t \, t }^{ \phantom{\, t}\phantom{\, t} } & = & \frac{2 \, m r}{a^{2} \cos\left({\theta}\right)^{2} + r^{2}} - 1 \\ g_{ \, t \, {\phi} }^{ \phantom{\, t}\phantom{\, {\phi}} } & = & -\frac{2 \, a m r \sin\left({\theta}\right)^{2}}{a^{2} \cos\left({\theta}\right)^{2} + r^{2}} \\ g_{ \, r \, r }^{ \phantom{\, r}\phantom{\, r} } & = & \frac{a^{2} \cos\left({\theta}\right)^{2} + r^{2}}{a^{2} - 2 \, m r + r^{2}} \\ g_{ \, {\theta} \, {\theta} }^{ \phantom{\, {\theta}}\phantom{\, {\theta}} } & = & a^{2} \cos\left({\theta}\right)^{2} + r^{2} \\ g_{ \, {\phi} \, t }^{ \phantom{\, {\phi}}\phantom{\, t} } & = & -\frac{2 \, a m r \sin\left({\theta}\right)^{2}}{a^{2} \cos\left({\theta}\right)^{2} + r^{2}} \\ g_{ \, {\phi} \, {\phi} }^{ \phantom{\, {\phi}}\phantom{\, {\phi}} } & = & {\left(\frac{2 \, a^{2} m r \sin\left({\theta}\right)^{2}}{a^{2} \cos\left({\theta}\right)^{2} + r^{2}} + a^{2} + r^{2}\right)} \sin\left({\theta}\right)^{2} \end{array}

The inverse metric:

In [9]:
g.inverse()[:]
(2a2mrsin(θ)2+a2r2+r4+(a4+a2r2)cos(θ)2a2r22mr3+r4+(a42a2mr+a2r2)cos(θ)2002amra2r22mr3+r4+(a42a2mr+a2r2)cos(θ)20a22mr+r2a2cos(θ)2+r200001a2cos(θ)2+r202amra2r22mr3+r4+(a42a2mr+a2r2)cos(θ)200a2cos(θ)22mr+r22a2mrsin(θ)4(2a2mra2r2+2mr3r4(a4+a2r2)cos(θ)2)sin(θ)2)\left(\begin{array}{rrrr} -\frac{2 \, a^{2} m r \sin\left({\theta}\right)^{2} + a^{2} r^{2} + r^{4} + {\left(a^{4} + a^{2} r^{2}\right)} \cos\left({\theta}\right)^{2}}{a^{2} r^{2} - 2 \, m r^{3} + r^{4} + {\left(a^{4} - 2 \, a^{2} m r + a^{2} r^{2}\right)} \cos\left({\theta}\right)^{2}} & 0 & 0 & -\frac{2 \, a m r}{a^{2} r^{2} - 2 \, m r^{3} + r^{4} + {\left(a^{4} - 2 \, a^{2} m r + a^{2} r^{2}\right)} \cos\left({\theta}\right)^{2}} \\ 0 & \frac{a^{2} - 2 \, m r + r^{2}}{a^{2} \cos\left({\theta}\right)^{2} + r^{2}} & 0 & 0 \\ 0 & 0 & \frac{1}{a^{2} \cos\left({\theta}\right)^{2} + r^{2}} & 0 \\ -\frac{2 \, a m r}{a^{2} r^{2} - 2 \, m r^{3} + r^{4} + {\left(a^{4} - 2 \, a^{2} m r + a^{2} r^{2}\right)} \cos\left({\theta}\right)^{2}} & 0 & 0 & \frac{a^{2} \cos\left({\theta}\right)^{2} - 2 \, m r + r^{2}}{2 \, a^{2} m r \sin\left({\theta}\right)^{4} - {\left(2 \, a^{2} m r - a^{2} r^{2} + 2 \, m r^{3} - r^{4} - {\left(a^{4} + a^{2} r^{2}\right)} \cos\left({\theta}\right)^{2}\right)} \sin\left({\theta}\right)^{2}} \end{array}\right)

The Christoffel symbols:

In [10]:
g.christoffel_symbols_display()
Γttrttr=a2mr2+mr4(a4m+a2mr2)cos(θ)2a2r42mr5+r6+(a62a4mr+a4r2)cos(θ)4+2(a4r22a2mr3+a2r4)cos(θ)2Γttθttθ=2a2mrcos(θ)sin(θ)a4cos(θ)4+2a2r2cos(θ)2+r4Γtrϕtrϕ=(a3mr2+3amr4(a5ma3mr2)cos(θ)2)sin(θ)2a2r42mr5+r6+(a62a4mr+a4r2)cos(θ)4+2(a4r22a2mr3+a2r4)cos(θ)2Γtθϕtθϕ=2(a5mrcos(θ)sin(θ)5(a5mr+a3mr3)cos(θ)sin(θ)3)a6cos(θ)6+3a4r2cos(θ)4+3a2r4cos(θ)2+r6Γrttrtt=a2mr22m2r3+mr4(a4m2a2m2r+a2mr2)cos(θ)2a6cos(θ)6+3a4r2cos(θ)4+3a2r4cos(θ)2+r6Γrtϕrtϕ=(a3mr22am2r3+amr4(a5m2a3m2r+a3mr2)cos(θ)2)sin(θ)2a6cos(θ)6+3a4r2cos(θ)4+3a2r4cos(θ)2+r6Γrrrrrr=a2rmr2+(a2ma2r)cos(θ)2a2r22mr3+r4+(a42a2mr+a2r2)cos(θ)2Γrrθrrθ=a2cos(θ)sin(θ)a2cos(θ)2+r2Γrθθrθθ=a2r2mr2+r3a2cos(θ)2+r2Γrϕϕrϕϕ=(a4mr22a2m2r3+a2mr4(a6m2a4m2r+a4mr2)cos(θ)2)sin(θ)4(a2r52mr6+r7+(a6r2a4mr2+a4r3)cos(θ)4+2(a4r32a2mr4+a2r5)cos(θ)2)sin(θ)2a6cos(θ)6+3a4r2cos(θ)4+3a2r4cos(θ)2+r6Γθttθtt=2a2mrcos(θ)sin(θ)a6cos(θ)6+3a4r2cos(θ)4+3a2r4cos(θ)2+r6Γθtϕθtϕ=2(a3mr+amr3)cos(θ)sin(θ)a6cos(θ)6+3a4r2cos(θ)4+3a2r4cos(θ)2+r6Γθrrθrr=a2cos(θ)sin(θ)a2r22mr3+r4+(a42a2mr+a2r2)cos(θ)2Γθrθθrθ=ra2cos(θ)2+r2Γθθθθθθ=a2cos(θ)sin(θ)a2cos(θ)2+r2Γθϕϕθϕϕ=((a62a4mr+a4r2)cos(θ)5+2(a4r22a2mr3+a2r4)cos(θ)3+(2a4mr+4a2mr3+a2r4+r6)cos(θ))sin(θ)a6cos(θ)6+3a4r2cos(θ)4+3a2r4cos(θ)2+r6Γϕtrϕtr=a3mcos(θ)2amr2a2r42mr5+r6+(a62a4mr+a4r2)cos(θ)4+2(a4r22a2mr3+a2r4)cos(θ)2Γϕtθϕtθ=2amrcos(θ)(a4cos(θ)4+2a2r2cos(θ)2+r4)sin(θ)Γϕrϕϕrϕ=a2mr2+2mr4r5+(a4ma4r)cos(θ)4(a4ma2mr2+2a2r3)cos(θ)2a2r42mr5+r6+(a62a4mr+a4r2)cos(θ)4+2(a4r22a2mr3+a2r4)cos(θ)2Γϕθϕϕθϕ=a4cos(θ)sin(θ)42(a4a2mr+a2r2)cos(θ)sin(θ)2+(a4+2a2r2+r4)cos(θ)(a4cos(θ)4+2a2r2cos(θ)2+r4)sin(θ)\begin{array}{lcl} \Gamma_{ \phantom{\, t} \, t \, r }^{ \, t \phantom{\, t} \phantom{\, r} } & = & \frac{a^{2} m r^{2} + m r^{4} - {\left(a^{4} m + a^{2} m r^{2}\right)} \cos\left({\theta}\right)^{2}}{a^{2} r^{4} - 2 \, m r^{5} + r^{6} + {\left(a^{6} - 2 \, a^{4} m r + a^{4} r^{2}\right)} \cos\left({\theta}\right)^{4} + 2 \, {\left(a^{4} r^{2} - 2 \, a^{2} m r^{3} + a^{2} r^{4}\right)} \cos\left({\theta}\right)^{2}} \\ \Gamma_{ \phantom{\, t} \, t \, {\theta} }^{ \, t \phantom{\, t} \phantom{\, {\theta}} } & = & -\frac{2 \, a^{2} m r \cos\left({\theta}\right) \sin\left({\theta}\right)}{a^{4} \cos\left({\theta}\right)^{4} + 2 \, a^{2} r^{2} \cos\left({\theta}\right)^{2} + r^{4}} \\ \Gamma_{ \phantom{\, t} \, r \, {\phi} }^{ \, t \phantom{\, r} \phantom{\, {\phi}} } & = & -\frac{{\left(a^{3} m r^{2} + 3 \, a m r^{4} - {\left(a^{5} m - a^{3} m r^{2}\right)} \cos\left({\theta}\right)^{2}\right)} \sin\left({\theta}\right)^{2}}{a^{2} r^{4} - 2 \, m r^{5} + r^{6} + {\left(a^{6} - 2 \, a^{4} m r + a^{4} r^{2}\right)} \cos\left({\theta}\right)^{4} + 2 \, {\left(a^{4} r^{2} - 2 \, a^{2} m r^{3} + a^{2} r^{4}\right)} \cos\left({\theta}\right)^{2}} \\ \Gamma_{ \phantom{\, t} \, {\theta} \, {\phi} }^{ \, t \phantom{\, {\theta}} \phantom{\, {\phi}} } & = & -\frac{2 \, {\left(a^{5} m r \cos\left({\theta}\right) \sin\left({\theta}\right)^{5} - {\left(a^{5} m r + a^{3} m r^{3}\right)} \cos\left({\theta}\right) \sin\left({\theta}\right)^{3}\right)}}{a^{6} \cos\left({\theta}\right)^{6} + 3 \, a^{4} r^{2} \cos\left({\theta}\right)^{4} + 3 \, a^{2} r^{4} \cos\left({\theta}\right)^{2} + r^{6}} \\ \Gamma_{ \phantom{\, r} \, t \, t }^{ \, r \phantom{\, t} \phantom{\, t} } & = & \frac{a^{2} m r^{2} - 2 \, m^{2} r^{3} + m r^{4} - {\left(a^{4} m - 2 \, a^{2} m^{2} r + a^{2} m r^{2}\right)} \cos\left({\theta}\right)^{2}}{a^{6} \cos\left({\theta}\right)^{6} + 3 \, a^{4} r^{2} \cos\left({\theta}\right)^{4} + 3 \, a^{2} r^{4} \cos\left({\theta}\right)^{2} + r^{6}} \\ \Gamma_{ \phantom{\, r} \, t \, {\phi} }^{ \, r \phantom{\, t} \phantom{\, {\phi}} } & = & -\frac{{\left(a^{3} m r^{2} - 2 \, a m^{2} r^{3} + a m r^{4} - {\left(a^{5} m - 2 \, a^{3} m^{2} r + a^{3} m r^{2}\right)} \cos\left({\theta}\right)^{2}\right)} \sin\left({\theta}\right)^{2}}{a^{6} \cos\left({\theta}\right)^{6} + 3 \, a^{4} r^{2} \cos\left({\theta}\right)^{4} + 3 \, a^{2} r^{4} \cos\left({\theta}\right)^{2} + r^{6}} \\ \Gamma_{ \phantom{\, r} \, r \, r }^{ \, r \phantom{\, r} \phantom{\, r} } & = & \frac{a^{2} r - m r^{2} + {\left(a^{2} m - a^{2} r\right)} \cos\left({\theta}\right)^{2}}{a^{2} r^{2} - 2 \, m r^{3} + r^{4} + {\left(a^{4} - 2 \, a^{2} m r + a^{2} r^{2}\right)} \cos\left({\theta}\right)^{2}} \\ \Gamma_{ \phantom{\, r} \, r \, {\theta} }^{ \, r \phantom{\, r} \phantom{\, {\theta}} } & = & -\frac{a^{2} \cos\left({\theta}\right) \sin\left({\theta}\right)}{a^{2} \cos\left({\theta}\right)^{2} + r^{2}} \\ \Gamma_{ \phantom{\, r} \, {\theta} \, {\theta} }^{ \, r \phantom{\, {\theta}} \phantom{\, {\theta}} } & = & -\frac{a^{2} r - 2 \, m r^{2} + r^{3}}{a^{2} \cos\left({\theta}\right)^{2} + r^{2}} \\ \Gamma_{ \phantom{\, r} \, {\phi} \, {\phi} }^{ \, r \phantom{\, {\phi}} \phantom{\, {\phi}} } & = & \frac{{\left(a^{4} m r^{2} - 2 \, a^{2} m^{2} r^{3} + a^{2} m r^{4} - {\left(a^{6} m - 2 \, a^{4} m^{2} r + a^{4} m r^{2}\right)} \cos\left({\theta}\right)^{2}\right)} \sin\left({\theta}\right)^{4} - {\left(a^{2} r^{5} - 2 \, m r^{6} + r^{7} + {\left(a^{6} r - 2 \, a^{4} m r^{2} + a^{4} r^{3}\right)} \cos\left({\theta}\right)^{4} + 2 \, {\left(a^{4} r^{3} - 2 \, a^{2} m r^{4} + a^{2} r^{5}\right)} \cos\left({\theta}\right)^{2}\right)} \sin\left({\theta}\right)^{2}}{a^{6} \cos\left({\theta}\right)^{6} + 3 \, a^{4} r^{2} \cos\left({\theta}\right)^{4} + 3 \, a^{2} r^{4} \cos\left({\theta}\right)^{2} + r^{6}} \\ \Gamma_{ \phantom{\, {\theta}} \, t \, t }^{ \, {\theta} \phantom{\, t} \phantom{\, t} } & = & -\frac{2 \, a^{2} m r \cos\left({\theta}\right) \sin\left({\theta}\right)}{a^{6} \cos\left({\theta}\right)^{6} + 3 \, a^{4} r^{2} \cos\left({\theta}\right)^{4} + 3 \, a^{2} r^{4} \cos\left({\theta}\right)^{2} + r^{6}} \\ \Gamma_{ \phantom{\, {\theta}} \, t \, {\phi} }^{ \, {\theta} \phantom{\, t} \phantom{\, {\phi}} } & = & \frac{2 \, {\left(a^{3} m r + a m r^{3}\right)} \cos\left({\theta}\right) \sin\left({\theta}\right)}{a^{6} \cos\left({\theta}\right)^{6} + 3 \, a^{4} r^{2} \cos\left({\theta}\right)^{4} + 3 \, a^{2} r^{4} \cos\left({\theta}\right)^{2} + r^{6}} \\ \Gamma_{ \phantom{\, {\theta}} \, r \, r }^{ \, {\theta} \phantom{\, r} \phantom{\, r} } & = & \frac{a^{2} \cos\left({\theta}\right) \sin\left({\theta}\right)}{a^{2} r^{2} - 2 \, m r^{3} + r^{4} + {\left(a^{4} - 2 \, a^{2} m r + a^{2} r^{2}\right)} \cos\left({\theta}\right)^{2}} \\ \Gamma_{ \phantom{\, {\theta}} \, r \, {\theta} }^{ \, {\theta} \phantom{\, r} \phantom{\, {\theta}} } & = & \frac{r}{a^{2} \cos\left({\theta}\right)^{2} + r^{2}} \\ \Gamma_{ \phantom{\, {\theta}} \, {\theta} \, {\theta} }^{ \, {\theta} \phantom{\, {\theta}} \phantom{\, {\theta}} } & = & -\frac{a^{2} \cos\left({\theta}\right) \sin\left({\theta}\right)}{a^{2} \cos\left({\theta}\right)^{2} + r^{2}} \\ \Gamma_{ \phantom{\, {\theta}} \, {\phi} \, {\phi} }^{ \, {\theta} \phantom{\, {\phi}} \phantom{\, {\phi}} } & = & -\frac{{\left({\left(a^{6} - 2 \, a^{4} m r + a^{4} r^{2}\right)} \cos\left({\theta}\right)^{5} + 2 \, {\left(a^{4} r^{2} - 2 \, a^{2} m r^{3} + a^{2} r^{4}\right)} \cos\left({\theta}\right)^{3} + {\left(2 \, a^{4} m r + 4 \, a^{2} m r^{3} + a^{2} r^{4} + r^{6}\right)} \cos\left({\theta}\right)\right)} \sin\left({\theta}\right)}{a^{6} \cos\left({\theta}\right)^{6} + 3 \, a^{4} r^{2} \cos\left({\theta}\right)^{4} + 3 \, a^{2} r^{4} \cos\left({\theta}\right)^{2} + r^{6}} \\ \Gamma_{ \phantom{\, {\phi}} \, t \, r }^{ \, {\phi} \phantom{\, t} \phantom{\, r} } & = & -\frac{a^{3} m \cos\left({\theta}\right)^{2} - a m r^{2}}{a^{2} r^{4} - 2 \, m r^{5} + r^{6} + {\left(a^{6} - 2 \, a^{4} m r + a^{4} r^{2}\right)} \cos\left({\theta}\right)^{4} + 2 \, {\left(a^{4} r^{2} - 2 \, a^{2} m r^{3} + a^{2} r^{4}\right)} \cos\left({\theta}\right)^{2}} \\ \Gamma_{ \phantom{\, {\phi}} \, t \, {\theta} }^{ \, {\phi} \phantom{\, t} \phantom{\, {\theta}} } & = & -\frac{2 \, a m r \cos\left({\theta}\right)}{{\left(a^{4} \cos\left({\theta}\right)^{4} + 2 \, a^{2} r^{2} \cos\left({\theta}\right)^{2} + r^{4}\right)} \sin\left({\theta}\right)} \\ \Gamma_{ \phantom{\, {\phi}} \, r \, {\phi} }^{ \, {\phi} \phantom{\, r} \phantom{\, {\phi}} } & = & -\frac{a^{2} m r^{2} + 2 \, m r^{4} - r^{5} + {\left(a^{4} m - a^{4} r\right)} \cos\left({\theta}\right)^{4} - {\left(a^{4} m - a^{2} m r^{2} + 2 \, a^{2} r^{3}\right)} \cos\left({\theta}\right)^{2}}{a^{2} r^{4} - 2 \, m r^{5} + r^{6} + {\left(a^{6} - 2 \, a^{4} m r + a^{4} r^{2}\right)} \cos\left({\theta}\right)^{4} + 2 \, {\left(a^{4} r^{2} - 2 \, a^{2} m r^{3} + a^{2} r^{4}\right)} \cos\left({\theta}\right)^{2}} \\ \Gamma_{ \phantom{\, {\phi}} \, {\theta} \, {\phi} }^{ \, {\phi} \phantom{\, {\theta}} \phantom{\, {\phi}} } & = & \frac{a^{4} \cos\left({\theta}\right) \sin\left({\theta}\right)^{4} - 2 \, {\left(a^{4} - a^{2} m r + a^{2} r^{2}\right)} \cos\left({\theta}\right) \sin\left({\theta}\right)^{2} + {\left(a^{4} + 2 \, a^{2} r^{2} + r^{4}\right)} \cos\left({\theta}\right)}{{\left(a^{4} \cos\left({\theta}\right)^{4} + 2 \, a^{2} r^{2} \cos\left({\theta}\right)^{2} + r^{4}\right)} \sin\left({\theta}\right)} \end{array}

The Einstein equation

Let us check that the Ricci tensor of gg vanishes identically, which is equivalent to the Einstein equation in vacuum:

In [11]:
g.ricci().display()
Ric(g)=0\mathrm{Ric}\left(g\right) = 0

On the contrary, the Riemann tensor is not zero:

In [12]:
R = g.riemann() print(R)
Tensor field Riem(g) of type (1,3) on the 4-dimensional differentiable manifold M
In [13]:
R[0,1,2,3]
(a7m2a5m2r+a5mr2)cos(θ)sin(θ)5+(a7m+2a5m2r+6a5mr26a3m2r3+5a3mr4)cos(θ)sin(θ)32(a7ma5mr25a3mr43amr6)cos(θ)sin(θ)a2r62mr7+r8+(a82a6mr+a6r2)cos(θ)6+3(a6r22a4mr3+a4r4)cos(θ)4+3(a4r42a2mr5+a2r6)cos(θ)2-\frac{{\left(a^{7} m - 2 \, a^{5} m^{2} r + a^{5} m r^{2}\right)} \cos\left({\theta}\right) \sin\left({\theta}\right)^{5} + {\left(a^{7} m + 2 \, a^{5} m^{2} r + 6 \, a^{5} m r^{2} - 6 \, a^{3} m^{2} r^{3} + 5 \, a^{3} m r^{4}\right)} \cos\left({\theta}\right) \sin\left({\theta}\right)^{3} - 2 \, {\left(a^{7} m - a^{5} m r^{2} - 5 \, a^{3} m r^{4} - 3 \, a m r^{6}\right)} \cos\left({\theta}\right) \sin\left({\theta}\right)}{a^{2} r^{6} - 2 \, m r^{7} + r^{8} + {\left(a^{8} - 2 \, a^{6} m r + a^{6} r^{2}\right)} \cos\left({\theta}\right)^{6} + 3 \, {\left(a^{6} r^{2} - 2 \, a^{4} m r^{3} + a^{4} r^{4}\right)} \cos\left({\theta}\right)^{4} + 3 \, {\left(a^{4} r^{4} - 2 \, a^{2} m r^{5} + a^{2} r^{6}\right)} \cos\left({\theta}\right)^{2}}

The Kretschmann scalar

The Kretschmann scalar is the following square of the Riemann tensor: K=RabcdRabcd K = R_{abcd} R^{abcd} We compute first the tensors RabcdR_{abcd} and RabcdR^{abcd} by respectively lowering and raising the indices of RR with the metric gg:

In [14]:
dR = R.down(g) print(dR)
Tensor field of type (0,4) on the 4-dimensional differentiable manifold M
In [15]:
uR = R.up(g) print(uR)
Tensor field of type (4,0) on the 4-dimensional differentiable manifold M

Then we perform the contraction:

In [16]:
K = dR['_{abcd}']*uR['^{abcd}'] print(K) K.display()
Scalar field on the 4-dimensional differentiable manifold M
MR(t,r,θ,ϕ)48(a6m2cos(θ)615a4m2r2cos(θ)4+15a2m2r4cos(θ)2m2r6)a12cos(θ)12+6a10r2cos(θ)10+15a8r4cos(θ)8+20a6r6cos(θ)6+15a4r8cos(θ)4+6a2r10cos(θ)2+r12\begin{array}{llcl} & M & \longrightarrow & \mathbb{R} \\ & \left(t, r, {\theta}, {\phi}\right) & \longmapsto & -\frac{48 \, {\left(a^{6} m^{2} \cos\left({\theta}\right)^{6} - 15 \, a^{4} m^{2} r^{2} \cos\left({\theta}\right)^{4} + 15 \, a^{2} m^{2} r^{4} \cos\left({\theta}\right)^{2} - m^{2} r^{6}\right)}}{a^{12} \cos\left({\theta}\right)^{12} + 6 \, a^{10} r^{2} \cos\left({\theta}\right)^{10} + 15 \, a^{8} r^{4} \cos\left({\theta}\right)^{8} + 20 \, a^{6} r^{6} \cos\left({\theta}\right)^{6} + 15 \, a^{4} r^{8} \cos\left({\theta}\right)^{4} + 6 \, a^{2} r^{10} \cos\left({\theta}\right)^{2} + r^{12}} \end{array}

A variant of this expression can be obtained by invoking the factor() method on the coordinate function representing the scalar field in the manifold's default chart:

In [17]:
Kr = K.expr().factor() Kr
48(a2cos(θ)2+4arcos(θ)+r2)(a2cos(θ)24arcos(θ)+r2)(acos(θ)+r)(acos(θ)r)m2(a2cos(θ)2+r2)6-\frac{48 \, {\left(a^{2} \cos\left({\theta}\right)^{2} + 4 \, a r \cos\left({\theta}\right) + r^{2}\right)} {\left(a^{2} \cos\left({\theta}\right)^{2} - 4 \, a r \cos\left({\theta}\right) + r^{2}\right)} {\left(a \cos\left({\theta}\right) + r\right)} {\left(a \cos\left({\theta}\right) - r\right)} m^{2}}{{\left(a^{2} \cos\left({\theta}\right)^{2} + r^{2}\right)}^{6}}

The Schwarzschild value of the Kretschmann scalar is recovered for a=0a=0

In [18]:
Kr.subs(a=0)
48m2r6\frac{48 \, m^{2}}{r^{6}}

For a more detailed Kerr worksheet (Killing vectors, Bianchi identity, etc.) see here.