Kerr spacetime

This notebook demonstrates a few capabilities of SageMath in computations regarding Kerr spacetime. The corresponding tools have been developed within the SageManifolds project.

NB: a version of SageMath at least equal to 8.2 is required to run this notebook:

In [1]:
version()
Out[1]:
'SageMath version 9.5.beta2, Release Date: 2021-09-26'

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

In [2]:
%display latex

and we initialize a time counter for benchmarking:

In [3]:
import time
comput_time0 = time.perf_counter()

Since some computations are quite heavy, we ask for running them in parallel on 8 threads:

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

Spacetime manifold

We declare the Kerr spacetime (or more precisely the part of it covered by Boyer-Lindquist coordinates) as a 4-dimensional Lorentzian manifold $\mathcal{M}$:

In [5]:
M = Manifold(4, 'M', latex_name=r'\mathcal{M}', structure='Lorentzian')
print(M)
4-dimensional Lorentzian manifold M

We then introduce the standard Boyer-Lindquist coordinates as a chart BL (for Boyer-Lindquist) on $\mathcal{M}$, via the method chart(), the argument of which is a string (delimited by r"..." because of the backslash symbols) expressing the coordinates names, their ranges (the default is $(-\infty,+\infty)$) and their LaTeX symbols:

In [6]:
BL.<t,r,th,ph> = M.chart(r"t r th:(0,pi):\theta ph:(0,2*pi):\phi") 
print(BL); BL
Chart (M, (t, r, th, ph))
Out[6]:
\[\newcommand{\Bold}[1]{\mathbf{#1}}\left(\mathcal{M},(t, r, {\theta}, {\phi})\right)\]
In [7]:
BL[0], BL[1]
Out[7]:
\[\newcommand{\Bold}[1]{\mathbf{#1}}\left(t, r\right)\]

Metric tensor

The 2 parameters $m$ and $a$ of the Kerr spacetime are declared as symbolic variables:

In [8]:
var('m, a', domain='real')
Out[8]:
\[\newcommand{\Bold}[1]{\mathbf{#1}}\left(m, a\right)\]

We get the (yet undefined) spacetime metric:

In [9]:
g = M.metric()

The metric is set by its components in the coordinate frame associated with Boyer-Lindquist coordinates, which is the current manifold's default frame:

In [10]:
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], g[2,2] = rho2/Delta, rho2
g[3,3] = (r^2+a^2+2*m*r*(a*sin(th))^2/rho2)*sin(th)^2
g.display()
Out[10]:
\[\newcommand{\Bold}[1]{\mathbf{#1}}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}\]

A matrix view of the components with respect to the manifold's default vector frame:

In [11]:
g[:]
Out[11]:
\[\newcommand{\Bold}[1]{\mathbf{#1}}\left(\begin{array}{rrrr} \frac{2 \, m r}{a^{2} \cos\left({\theta}\right)^{2} + r^{2}} - 1 & 0 & 0 & -\frac{2 \, a m r \sin\left({\theta}\right)^{2}}{a^{2} \cos\left({\theta}\right)^{2} + r^{2}} \\ 0 & \frac{a^{2} \cos\left({\theta}\right)^{2} + r^{2}}{a^{2} - 2 \, m r + r^{2}} & 0 & 0 \\ 0 & 0 & a^{2} \cos\left({\theta}\right)^{2} + r^{2} & 0 \\ -\frac{2 \, a m r \sin\left({\theta}\right)^{2}}{a^{2} \cos\left({\theta}\right)^{2} + r^{2}} & 0 & 0 & {\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}\right)\]

The list of the non-vanishing components:

In [12]:
g.display_comp()
Out[12]:
\[\newcommand{\Bold}[1]{\mathbf{#1}}\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}\]

Levi-Civita Connection

The Levi-Civita connection $\nabla$ associated with $g$:

In [13]:
nabla = g.connection()
print(nabla)
Levi-Civita connection nabla_g associated with the Lorentzian metric g on the 4-dimensional Lorentzian manifold M

Let us verify that the covariant derivative of $g$ with respect to $\nabla$ vanishes identically:

In [14]:
nabla(g) == 0
Out[14]:
\[\newcommand{\Bold}[1]{\mathbf{#1}}\mathrm{True}\]

Another view of the above property:

In [15]:
nabla(g).display()
Out[15]:
\[\newcommand{\Bold}[1]{\mathbf{#1}}\nabla_{g} g = 0\]

The nonzero Christoffel symbols (skipping those that can be deduced by symmetry of the last two indices):

In [16]:
g.christoffel_symbols_display()
Out[16]:
\[\newcommand{\Bold}[1]{\mathbf{#1}}\begin{array}{lcl} \Gamma_{ \phantom{\, t} \, t \, r }^{ \, t \phantom{\, t} \phantom{\, r} } & = & -\frac{a^{4} m - m r^{4} - {\left(a^{4} m + a^{2} m r^{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} \, 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}\]

Killing vectors

The default vector frame on the spacetime manifold is the coordinate basis associated with Boyer-Lindquist coordinates:

In [17]:
M.default_frame() is BL.frame()
Out[17]:
\[\newcommand{\Bold}[1]{\mathbf{#1}}\mathrm{True}\]
In [18]:
BL.frame()
Out[18]:
\[\newcommand{\Bold}[1]{\mathbf{#1}}\left(\mathcal{M}, \left(\frac{\partial}{\partial t },\frac{\partial}{\partial r },\frac{\partial}{\partial {\theta} },\frac{\partial}{\partial {\phi} }\right)\right)\]

Let us consider the first vector field of this frame:

In [19]:
xi = BL.frame()[0]
xi
Out[19]:
\[\newcommand{\Bold}[1]{\mathbf{#1}}\frac{\partial}{\partial t }\]
In [20]:
print(xi)
Vector field ∂/∂t on the 4-dimensional Lorentzian manifold M

The 1-form associated to it by metric duality is

In [21]:
xi_form = xi.down(g)
xi_form.display()
Out[21]:
\[\newcommand{\Bold}[1]{\mathbf{#1}}\left( \frac{2 \, m r}{a^{2} \cos\left({\theta}\right)^{2} + r^{2}} - 1 \right) \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} {\phi}\]

Its covariant derivative is

In [22]:
nab_xi = nabla(xi_form)
print(nab_xi)
nab_xi.display()
Tensor field of type (0,2) on the 4-dimensional Lorentzian manifold M
Out[22]:
\[\newcommand{\Bold}[1]{\mathbf{#1}}\left( \frac{a^{2} m \cos\left({\theta}\right)^{2} - m r^{2}}{a^{4} \cos\left({\theta}\right)^{4} + 2 \, a^{2} r^{2} \cos\left({\theta}\right)^{2} + r^{4}} \right) \mathrm{d} t\otimes \mathrm{d} r + \left( \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}} \right) \mathrm{d} t\otimes \mathrm{d} {\theta} + \left( -\frac{a^{2} m \cos\left({\theta}\right)^{2} - m r^{2}}{a^{4} \cos\left({\theta}\right)^{4} + 2 \, a^{2} r^{2} \cos\left({\theta}\right)^{2} + r^{4}} \right) \mathrm{d} r\otimes \mathrm{d} t + \left( \frac{{\left(a^{3} m \cos\left({\theta}\right)^{2} - a m r^{2}\right)} \sin\left({\theta}\right)^{2}}{a^{4} \cos\left({\theta}\right)^{4} + 2 \, a^{2} r^{2} \cos\left({\theta}\right)^{2} + r^{4}} \right) \mathrm{d} r\otimes \mathrm{d} {\phi} + \left( -\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}} \right) \mathrm{d} {\theta}\otimes \mathrm{d} t + \left( \frac{2 \, {\left(a^{3} m r + a m r^{3}\right)} \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}} \right) \mathrm{d} {\theta}\otimes \mathrm{d} {\phi} + \left( -\frac{{\left(a^{3} m \cos\left({\theta}\right)^{2} - a m r^{2}\right)} \sin\left({\theta}\right)^{2}}{a^{4} \cos\left({\theta}\right)^{4} + 2 \, a^{2} r^{2} \cos\left({\theta}\right)^{2} + r^{4}} \right) \mathrm{d} {\phi}\otimes \mathrm{d} r + \left( -\frac{2 \, {\left(a^{3} m r + a m r^{3}\right)} \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}} \right) \mathrm{d} {\phi}\otimes \mathrm{d} {\theta}\]

Let us check that the Killing equation is satisfied:

In [23]:
nab_xi.symmetrize() == 0
Out[23]:
\[\newcommand{\Bold}[1]{\mathbf{#1}}\mathrm{True}\]

Similarly, let us check that $\frac{\partial}{\partial\phi}$ is a Killing vector:

In [24]:
chi = BL.frame()[3]
chi
Out[24]:
\[\newcommand{\Bold}[1]{\mathbf{#1}}\frac{\partial}{\partial {\phi} }\]
In [25]:
nabla(chi.down(g)).symmetrize() == 0
Out[25]:
\[\newcommand{\Bold}[1]{\mathbf{#1}}\mathrm{True}\]

Curvature

The Ricci tensor associated with $g$:

In [26]:
Ric = g.ricci()
print(Ric)
Field of symmetric bilinear forms Ric(g) on the 4-dimensional Lorentzian manifold M

Let us check that the Kerr metric is a solution of the vacuum Einstein equation:

In [27]:
Ric == 0
Out[27]:
\[\newcommand{\Bold}[1]{\mathbf{#1}}\mathrm{True}\]

Another view of the above property:

In [28]:
Ric.display()
Out[28]:
\[\newcommand{\Bold}[1]{\mathbf{#1}}\mathrm{Ric}\left(g\right) = 0\]

The Riemann curvature tensor associated with $g$:

In [29]:
R = g.riemann()
print(R)
Tensor field Riem(g) of type (1,3) on the 4-dimensional Lorentzian manifold M

Contrary to the Ricci tensor, the Riemann tensor does not vanish; for instance, the component $R^0_{\ \, 123}$ is

In [30]:
R[0,1,2,3]
Out[30]:
\[\newcommand{\Bold}[1]{\mathbf{#1}}-\frac{{\left({\left(a^{7} m - 2 \, a^{5} m^{2} r + a^{5} m r^{2}\right)} \cos\left({\theta}\right)^{5} - {\left(3 \, a^{7} m - 2 \, a^{5} m^{2} r + 8 \, a^{5} m r^{2} - 6 \, a^{3} m^{2} r^{3} + 5 \, a^{3} m r^{4}\right)} \cos\left({\theta}\right)^{3} + 3 \, {\left(3 \, a^{5} m r^{2} - 2 \, a^{3} m^{2} r^{3} + 5 \, a^{3} m r^{4} + 2 \, a m r^{6}\right)} \cos\left({\theta}\right)\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}}\]

Bianchi identity

Let us check the Bianchi identity $\nabla_p R^i_{\ \, j kl} + \nabla_k R^i_{\ \, jlp} + \nabla_l R^i_{\ \, jpk} = 0$:

In [31]:
DR = nabla(R)   # long (takes a while)
print(DR)
Tensor field nabla_g(Riem(g)) of type (1,4) on the 4-dimensional Lorentzian manifold M
In [32]:
# from __future__ import print_function  # uncomment for SageMath version < 9.0 (Python 2 based)
for i in M.irange():
    for j in M.irange():
        for k in M.irange():
            for l in M.irange():
                for p in M.irange():
                    print(DR[i,j,k,l,p] + DR[i,j,l,p,k] + DR[i,j,p,k,l], end=' ')
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

If the last sign in the Bianchi identity is changed to minus, the identity does no longer hold:

In [33]:
DR[0,1,2,3,1] + DR[0,1,3,1,2] + DR[0,1,1,2,3] # should be zero (Bianchi identity)
Out[33]:
\[\newcommand{\Bold}[1]{\mathbf{#1}}0\]
In [34]:
DR[0,1,2,3,1] + DR[0,1,3,1,2] - DR[0,1,1,2,3] # note the change of the second + to -
Out[34]:
\[\newcommand{\Bold}[1]{\mathbf{#1}}\frac{24 \, {\left({\left(a^{5} m r + a^{3} m r^{3}\right)} \cos\left({\theta}\right) \sin\left({\theta}\right)^{3} - {\left(a^{5} m r - a m r^{5}\right)} \cos\left({\theta}\right) \sin\left({\theta}\right)\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}}\]

Kretschmann scalar

The tensor $R^\flat$, of components $R_{abcd} = g_{am} R^m_{\ \, bcd}$:

In [35]:
dR = R.down(g)
print(dR)
Tensor field of type (0,4) on the 4-dimensional Lorentzian manifold M

The tensor $R^\sharp$, of components $R^{abcd} = g^{bp} g^{cq} g^{dr} R^a_{\ \, pqr}$:

In [36]:
uR = R.up(g)
print(uR)
Tensor field of type (4,0) on the 4-dimensional Lorentzian manifold M

The Kretschmann scalar $K := R^{abcd} R_{abcd}$:

In [37]:
Kr_scalar = uR['^{abcd}']*dR['_{abcd}']
Kr_scalar.display()
Out[37]:
\[\newcommand{\Bold}[1]{\mathbf{#1}}\begin{array}{llcl} & \mathcal{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 [38]:
Kr = Kr_scalar.coord_function()
Kr.factor()
Out[38]:
\[\newcommand{\Bold}[1]{\mathbf{#1}}-\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}}\]

As a check, we can compare Kr to the formula given by R. Conn Henry, Astrophys. J. 535, 350 (2000):

In [39]:
Kr == 48*m^2*(r^6 - 15*r^4*(a*cos(th))^2 + 15*r^2*(a*cos(th))^4 
              - (a*cos(th))^6) / (r^2+(a*cos(th))^2)^6
Out[39]:
\[\newcommand{\Bold}[1]{\mathbf{#1}}\mathrm{True}\]

The Schwarzschild value of the Kretschmann scalar is recovered by setting $a=0$:

In [40]:
Kr.expr().subs(a=0)
Out[40]:
\[\newcommand{\Bold}[1]{\mathbf{#1}}\frac{48 \, m^{2}}{r^{6}}\]

Let us plot the Kretschmann scalar for $m=1$ and  $a=0.9$:

In [41]:
K1 = Kr.expr().subs(m=1, a=0.9)
plot3d(K1, (r, 1, 3), (th, 0, pi), axes_labels=['r', 'theta', 'Kr'])
Out[41]:
In [42]:
print("Total elapsed time: {} s".format(time.perf_counter() - comput_time0))
Total elapsed time: 449.14473272299983 s