{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Kerr spacetime\n", "\n", "This notebook demonstrates a few capabilities of SageMath in computations regarding Kerr spacetime. The corresponding tools have been developed within the [SageManifolds](https://sagemanifolds.obspm.fr) project.\n", "\n", "Click [here](https://raw.githubusercontent.com/sagemanifolds/SageManifolds/master/Notebooks/SM_Kerr.ipynb) to download the notebook file (ipynb format). To run it, you must start SageMath within the Jupyter notebook, via the command `sage -n jupyter`" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "*NB:* a version of SageMath at least equal to 8.2 is required to run this notebook:" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'SageMath version 9.0.beta3, Release Date: 2019-10-26'" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "version()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "First we set up the notebook to display mathematical objects using LaTeX rendering:" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "%display latex" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We also define a viewer for 3D plots (use `'threejs'` or `'jmol'` for interactive 3D graphics) and initialize a time counter for benchmarking:" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "viewer3D = 'threejs' # must be 'threejs', jmol', 'tachyon' or None (default)\n", "import time\n", "comput_time0 = time.perf_counter()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Since some computations are quite heavy, we ask for running them in parallel on 8 threads:" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "Parallelism().set(nproc=8)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Spacetime manifold\n", "\n", "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}$:" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "4-dimensional Lorentzian manifold M\n" ] } ], "source": [ "M = Manifold(4, 'M', latex_name=r'\\mathcal{M}', structure='Lorentzian')\n", "print(M)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "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\n", "(delimited by `r\"...\"` because of the backslash symbols) expressing the coordinates names, their ranges (the default is $(-\\infty,+\\infty)$) and their LaTeX symbols:" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Chart (M, (t, r, th, ph))\n" ] }, { "data": { "text/html": [ "" ], "text/plain": [ "Chart (M, (t, r, th, ph))" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "BL. = M.chart(r\"t r:(0,+oo) th:(0,pi):\\theta ph:(0,2*pi):\\phi\") \n", "print(BL); BL" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "(t, r)" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "BL[0], BL[1]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "

Metric tensor

\n", "\n", "

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

" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "(m, a)" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "var('m, a', domain='real')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We get the (yet undefined) spacetime metric:" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [], "source": [ "g = M.metric()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "

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

" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "g = (2*m*r/(a^2*cos(th)^2 + r^2) - 1) dt*dt - 2*a*m*r*sin(th)^2/(a^2*cos(th)^2 + r^2) dt*dph + (a^2*cos(th)^2 + r^2)/(a^2 - 2*m*r + r^2) dr*dr + (a^2*cos(th)^2 + r^2) dth*dth - 2*a*m*r*sin(th)^2/(a^2*cos(th)^2 + r^2) dph*dt + (2*a^2*m*r*sin(th)^2/(a^2*cos(th)^2 + r^2) + a^2 + r^2)*sin(th)^2 dph*dph" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "rho2 = r^2 + (a*cos(th))^2\n", "Delta = r^2 -2*m*r + a^2\n", "g[0,0] = -(1-2*m*r/rho2)\n", "g[0,3] = -2*a*m*r*sin(th)^2/rho2\n", "g[1,1], g[2,2] = rho2/Delta, rho2\n", "g[3,3] = (r^2+a^2+2*m*r*(a*sin(th))^2/rho2)*sin(th)^2\n", "g.display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "

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

" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "[ 2*m*r/(a^2*cos(th)^2 + r^2) - 1 0 0 -2*a*m*r*sin(th)^2/(a^2*cos(th)^2 + r^2)]\n", "[ 0 (a^2*cos(th)^2 + r^2)/(a^2 - 2*m*r + r^2) 0 0]\n", "[ 0 0 a^2*cos(th)^2 + r^2 0]\n", "[ -2*a*m*r*sin(th)^2/(a^2*cos(th)^2 + r^2) 0 0 (2*a^2*m*r*sin(th)^2/(a^2*cos(th)^2 + r^2) + a^2 + r^2)*sin(th)^2]" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "g[:]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "

The list of the non-vanishing components:

" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "g_t,t = 2*m*r/(a^2*cos(th)^2 + r^2) - 1 \n", "g_t,ph = -2*a*m*r*sin(th)^2/(a^2*cos(th)^2 + r^2) \n", "g_r,r = (a^2*cos(th)^2 + r^2)/(a^2 - 2*m*r + r^2) \n", "g_th,th = a^2*cos(th)^2 + r^2 \n", "g_ph,t = -2*a*m*r*sin(th)^2/(a^2*cos(th)^2 + r^2) \n", "g_ph,ph = (2*a^2*m*r*sin(th)^2/(a^2*cos(th)^2 + r^2) + a^2 + r^2)*sin(th)^2 " ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "g.display_comp()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "

Levi-Civita Connection

\n", "\n", "

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

" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Levi-Civita connection nabla_g associated with the Lorentzian metric g on the 4-dimensional Lorentzian manifold M\n" ] } ], "source": [ "nabla = g.connection()\n", "print(nabla)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "

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

" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "True" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "nabla(g) == 0" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "

Another view of the above property:

" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "nabla_g(g) = 0" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "nabla(g).display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "

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

" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "Gam^t_t,r = -(a^4*m - m*r^4 - (a^4*m + a^2*m*r^2)*sin(th)^2)/(a^2*r^4 - 2*m*r^5 + r^6 + (a^6 - 2*a^4*m*r + a^4*r^2)*cos(th)^4 + 2*(a^4*r^2 - 2*a^2*m*r^3 + a^2*r^4)*cos(th)^2) \n", "Gam^t_t,th = -2*a^2*m*r*cos(th)*sin(th)/(a^4*cos(th)^4 + 2*a^2*r^2*cos(th)^2 + r^4) \n", "Gam^t_r,ph = -(a^3*m*r^2 + 3*a*m*r^4 - (a^5*m - a^3*m*r^2)*cos(th)^2)*sin(th)^2/(a^2*r^4 - 2*m*r^5 + r^6 + (a^6 - 2*a^4*m*r + a^4*r^2)*cos(th)^4 + 2*(a^4*r^2 - 2*a^2*m*r^3 + a^2*r^4)*cos(th)^2) \n", "Gam^t_th,ph = -2*(a^5*m*r*cos(th)*sin(th)^5 - (a^5*m*r + a^3*m*r^3)*cos(th)*sin(th)^3)/(a^6*cos(th)^6 + 3*a^4*r^2*cos(th)^4 + 3*a^2*r^4*cos(th)^2 + r^6) \n", "Gam^r_t,t = (a^2*m*r^2 - 2*m^2*r^3 + m*r^4 - (a^4*m - 2*a^2*m^2*r + a^2*m*r^2)*cos(th)^2)/(a^6*cos(th)^6 + 3*a^4*r^2*cos(th)^4 + 3*a^2*r^4*cos(th)^2 + r^6) \n", "Gam^r_t,ph = -(a^3*m*r^2 - 2*a*m^2*r^3 + a*m*r^4 - (a^5*m - 2*a^3*m^2*r + a^3*m*r^2)*cos(th)^2)*sin(th)^2/(a^6*cos(th)^6 + 3*a^4*r^2*cos(th)^4 + 3*a^2*r^4*cos(th)^2 + r^6) \n", "Gam^r_r,r = (a^2*r - m*r^2 + (a^2*m - a^2*r)*cos(th)^2)/(a^2*r^2 - 2*m*r^3 + r^4 + (a^4 - 2*a^2*m*r + a^2*r^2)*cos(th)^2) \n", "Gam^r_r,th = -a^2*cos(th)*sin(th)/(a^2*cos(th)^2 + r^2) \n", "Gam^r_th,th = -(a^2*r - 2*m*r^2 + r^3)/(a^2*cos(th)^2 + r^2) \n", "Gam^r_ph,ph = ((a^4*m*r^2 - 2*a^2*m^2*r^3 + a^2*m*r^4 - (a^6*m - 2*a^4*m^2*r + a^4*m*r^2)*cos(th)^2)*sin(th)^4 - (a^2*r^5 - 2*m*r^6 + r^7 + (a^6*r - 2*a^4*m*r^2 + a^4*r^3)*cos(th)^4 + 2*(a^4*r^3 - 2*a^2*m*r^4 + a^2*r^5)*cos(th)^2)*sin(th)^2)/(a^6*cos(th)^6 + 3*a^4*r^2*cos(th)^4 + 3*a^2*r^4*cos(th)^2 + r^6) \n", "Gam^th_t,t = -2*a^2*m*r*cos(th)*sin(th)/(a^6*cos(th)^6 + 3*a^4*r^2*cos(th)^4 + 3*a^2*r^4*cos(th)^2 + r^6) \n", "Gam^th_t,ph = 2*(a^3*m*r + a*m*r^3)*cos(th)*sin(th)/(a^6*cos(th)^6 + 3*a^4*r^2*cos(th)^4 + 3*a^2*r^4*cos(th)^2 + r^6) \n", "Gam^th_r,r = a^2*cos(th)*sin(th)/(a^2*r^2 - 2*m*r^3 + r^4 + (a^4 - 2*a^2*m*r + a^2*r^2)*cos(th)^2) \n", "Gam^th_r,th = r/(a^2*cos(th)^2 + r^2) \n", "Gam^th_th,th = -a^2*cos(th)*sin(th)/(a^2*cos(th)^2 + r^2) \n", "Gam^th_ph,ph = -((a^6 - 2*a^4*m*r + a^4*r^2)*cos(th)^5 + 2*(a^4*r^2 - 2*a^2*m*r^3 + a^2*r^4)*cos(th)^3 + (2*a^4*m*r + 4*a^2*m*r^3 + a^2*r^4 + r^6)*cos(th))*sin(th)/(a^6*cos(th)^6 + 3*a^4*r^2*cos(th)^4 + 3*a^2*r^4*cos(th)^2 + r^6) \n", "Gam^ph_t,r = -(a^3*m*cos(th)^2 - a*m*r^2)/(a^2*r^4 - 2*m*r^5 + r^6 + (a^6 - 2*a^4*m*r + a^4*r^2)*cos(th)^4 + 2*(a^4*r^2 - 2*a^2*m*r^3 + a^2*r^4)*cos(th)^2) \n", "Gam^ph_t,th = -2*a*m*r*cos(th)/((a^4*cos(th)^4 + 2*a^2*r^2*cos(th)^2 + r^4)*sin(th)) \n", "Gam^ph_r,ph = -(a^2*m*r^2 + 2*m*r^4 - r^5 + (a^4*m - a^4*r)*cos(th)^4 - (a^4*m - a^2*m*r^2 + 2*a^2*r^3)*cos(th)^2)/(a^2*r^4 - 2*m*r^5 + r^6 + (a^6 - 2*a^4*m*r + a^4*r^2)*cos(th)^4 + 2*(a^4*r^2 - 2*a^2*m*r^3 + a^2*r^4)*cos(th)^2) \n", "Gam^ph_th,ph = (a^4*cos(th)*sin(th)^4 - 2*(a^4 - a^2*m*r + a^2*r^2)*cos(th)*sin(th)^2 + (a^4 + 2*a^2*r^2 + r^4)*cos(th))/((a^4*cos(th)^4 + 2*a^2*r^2*cos(th)^2 + r^4)*sin(th)) " ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "g.christoffel_symbols_display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "

Killing vectors

\n", "

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

" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "True" ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "M.default_frame() is BL.frame()" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "Coordinate frame (M, (d/dt,d/dr,d/dth,d/dph))" ] }, "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ], "source": [ "BL.frame()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "

Let us consider the first vector field of this frame:

" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "Vector field d/dt on the 4-dimensional Lorentzian manifold M" ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "xi = BL.frame()[0]; xi" ] }, { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Vector field d/dt on the 4-dimensional Lorentzian manifold M\n" ] } ], "source": [ "print(xi)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "

The 1-form associated to it by metric duality is

" ] }, { "cell_type": "code", "execution_count": 21, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "-(a^2*cos(th)^2 - 2*m*r + r^2)/(a^2*cos(th)^2 + r^2) dt - 2*a*m*r*sin(th)^2/(a^2*cos(th)^2 + r^2) dph" ] }, "execution_count": 21, "metadata": {}, "output_type": "execute_result" } ], "source": [ "xi_form = xi.down(g)\n", "xi_form.display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "

Its covariant derivative is

" ] }, { "cell_type": "code", "execution_count": 22, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Tensor field of type (0,2) on the 4-dimensional Lorentzian manifold M\n" ] }, { "data": { "text/html": [ "" ], "text/plain": [ "(a^2*m*cos(th)^2 - m*r^2)/(a^4*cos(th)^4 + 2*a^2*r^2*cos(th)^2 + r^4) dt*dr + 2*a^2*m*r*cos(th)*sin(th)/(a^4*cos(th)^4 + 2*a^2*r^2*cos(th)^2 + r^4) dt*dth - (a^2*m*cos(th)^2 - m*r^2)/(a^4*cos(th)^4 + 2*a^2*r^2*cos(th)^2 + r^4) dr*dt + (a^3*m*cos(th)^2 - a*m*r^2)*sin(th)^2/(a^4*cos(th)^4 + 2*a^2*r^2*cos(th)^2 + r^4) dr*dph - 2*a^2*m*r*cos(th)*sin(th)/(a^4*cos(th)^4 + 2*a^2*r^2*cos(th)^2 + r^4) dth*dt + 2*(a^3*m*r + a*m*r^3)*cos(th)*sin(th)/(a^4*cos(th)^4 + 2*a^2*r^2*cos(th)^2 + r^4) dth*dph - (a^3*m*cos(th)^2 - a*m*r^2)*sin(th)^2/(a^4*cos(th)^4 + 2*a^2*r^2*cos(th)^2 + r^4) dph*dr - 2*(a^3*m*r + a*m*r^3)*cos(th)*sin(th)/(a^4*cos(th)^4 + 2*a^2*r^2*cos(th)^2 + r^4) dph*dth" ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "nab_xi = nabla(xi_form)\n", "print(nab_xi)\n", "nab_xi.display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "

Let us check that the Killing equation is satisfied:

" ] }, { "cell_type": "code", "execution_count": 23, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "True" ] }, "execution_count": 23, "metadata": {}, "output_type": "execute_result" } ], "source": [ "nab_xi.symmetrize() == 0" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "

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

" ] }, { "cell_type": "code", "execution_count": 24, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "Vector field d/dph on the 4-dimensional Lorentzian manifold M" ] }, "execution_count": 24, "metadata": {}, "output_type": "execute_result" } ], "source": [ "chi = BL.frame()[3] ; chi" ] }, { "cell_type": "code", "execution_count": 25, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "True" ] }, "execution_count": 25, "metadata": {}, "output_type": "execute_result" } ], "source": [ "nabla(chi.down(g)).symmetrize() == 0" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "

Curvature

\n", "\n", "

The Ricci tensor associated with $g$:

" ] }, { "cell_type": "code", "execution_count": 26, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Field of symmetric bilinear forms Ric(g) on the 4-dimensional Lorentzian manifold M\n" ] } ], "source": [ "Ric = g.ricci()\n", "print(Ric)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "

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

" ] }, { "cell_type": "code", "execution_count": 27, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "True" ] }, "execution_count": 27, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Ric == 0" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "

Another view of the above property:

" ] }, { "cell_type": "code", "execution_count": 28, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "Ric(g) = 0" ] }, "execution_count": 28, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Ric.display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "

The Riemann curvature tensor associated with $g$:

" ] }, { "cell_type": "code", "execution_count": 29, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Tensor field Riem(g) of type (1,3) on the 4-dimensional Lorentzian manifold M\n" ] } ], "source": [ "R = g.riemann()\n", "print(R)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "

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

" ] }, { "cell_type": "code", "execution_count": 30, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "-((a^7*m - 2*a^5*m^2*r + a^5*m*r^2)*cos(th)^5 - (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)*cos(th)^3 + 3*(3*a^5*m*r^2 - 2*a^3*m^2*r^3 + 5*a^3*m*r^4 + 2*a*m*r^6)*cos(th))*sin(th)/(a^2*r^6 - 2*m*r^7 + r^8 + (a^8 - 2*a^6*m*r + a^6*r^2)*cos(th)^6 + 3*(a^6*r^2 - 2*a^4*m*r^3 + a^4*r^4)*cos(th)^4 + 3*(a^4*r^4 - 2*a^2*m*r^5 + a^2*r^6)*cos(th)^2)" ] }, "execution_count": 30, "metadata": {}, "output_type": "execute_result" } ], "source": [ "R[0,1,2,3]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "

Bianchi identity

\n", "\n", "

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

" ] }, { "cell_type": "code", "execution_count": 31, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Tensor field nabla_g(Riem(g)) of type (1,4) on the 4-dimensional Lorentzian manifold M\n" ] } ], "source": [ "DR = nabla(R) #long (takes a while)\n", "print(DR)" ] }, { "cell_type": "code", "execution_count": 32, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 " ] } ], "source": [ "from __future__ import print_function # because the print below is valid only in Python3\n", "for i in M.irange():\n", " for j in M.irange():\n", " for k in M.irange():\n", " for l in M.irange():\n", " for p in M.irange():\n", " print(DR[i,j,k,l,p] + DR[i,j,l,p,k] + DR[i,j,p,k,l], end=' ')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "

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

" ] }, { "cell_type": "code", "execution_count": 33, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "0" ] }, "execution_count": 33, "metadata": {}, "output_type": "execute_result" } ], "source": [ "DR[0,1,2,3,1] + DR[0,1,3,1,2] + DR[0,1,1,2,3] # should be zero (Bianchi identity)" ] }, { "cell_type": "code", "execution_count": 34, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "24*((a^5*m*r + a^3*m*r^3)*cos(th)*sin(th)^3 - (a^5*m*r - a*m*r^5)*cos(th)*sin(th))/(a^2*r^6 - 2*m*r^7 + r^8 + (a^8 - 2*a^6*m*r + a^6*r^2)*cos(th)^6 + 3*(a^6*r^2 - 2*a^4*m*r^3 + a^4*r^4)*cos(th)^4 + 3*(a^4*r^4 - 2*a^2*m*r^5 + a^2*r^6)*cos(th)^2)" ] }, "execution_count": 34, "metadata": {}, "output_type": "execute_result" } ], "source": [ "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 -" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Kretschmann scalar\n", "\n", "The tensor $R^\\flat$, of components $R_{abcd} = g_{am} R^m_{\\ \\, bcd}$:" ] }, { "cell_type": "code", "execution_count": 35, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Tensor field of type (0,4) on the 4-dimensional Lorentzian manifold M\n" ] } ], "source": [ "dR = R.down(g)\n", "print(dR)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The tensor $R^\\sharp$, of components $R^{abcd} = g^{bp} g^{cq} g^{dr} R^a_{\\ \\, pqr}$:" ] }, { "cell_type": "code", "execution_count": 36, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Tensor field of type (4,0) on the 4-dimensional Lorentzian manifold M\n" ] } ], "source": [ "uR = R.up(g)\n", "print(uR)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The Kretschmann scalar $K := R^{abcd} R_{abcd}$:" ] }, { "cell_type": "code", "execution_count": 37, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "M --> R\n", "(t, r, th, ph) |--> -48*(a^6*m^2*cos(th)^6 - 15*a^4*m^2*r^2*cos(th)^4 + 15*a^2*m^2*r^4*cos(th)^2 - m^2*r^6)/(a^12*cos(th)^12 + 6*a^10*r^2*cos(th)^10 + 15*a^8*r^4*cos(th)^8 + 20*a^6*r^6*cos(th)^6 + 15*a^4*r^8*cos(th)^4 + 6*a^2*r^10*cos(th)^2 + r^12)" ] }, "execution_count": 37, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Kr_scalar = uR['^{abcd}']*dR['_{abcd}']\n", "Kr_scalar.display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "

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:

" ] }, { "cell_type": "code", "execution_count": 38, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "-48*(a^2*cos(th)^2 + 4*a*r*cos(th) + r^2)*(a^2*cos(th)^2 - 4*a*r*cos(th) + r^2)*(a*cos(th) + r)*(a*cos(th) - r)*m^2/(a^2*cos(th)^2 + r^2)^6" ] }, "execution_count": 38, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Kr = Kr_scalar.coord_function()\n", "Kr.factor()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "

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

" ] }, { "cell_type": "code", "execution_count": 39, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "True" ] }, "execution_count": 39, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Kr == 48*m^2*(r^6 - 15*r^4*(a*cos(th))^2 + 15*r^2*(a*cos(th))^4 \n", " - (a*cos(th))^6) / (r^2+(a*cos(th))^2)^6" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "

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

" ] }, { "cell_type": "code", "execution_count": 40, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "48*m^2/r^6" ] }, "execution_count": 40, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Kr.expr().subs(a=0)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "

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

" ] }, { "cell_type": "code", "execution_count": 41, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n" ], "text/plain": [ "Graphics3d Object" ] }, "execution_count": 41, "metadata": {}, "output_type": "execute_result" } ], "source": [ "K1 = Kr.expr().subs(m=1, a=0.9)\n", "plot3d(K1, (r, 1, 3), (th, 0, pi), viewer=viewer3D,\n", " axes_labels=['r', 'theta', 'Kr'])" ] }, { "cell_type": "code", "execution_count": 42, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Total elapsed time: 397.4667473820009 s\n" ] } ], "source": [ "print(\"Total elapsed time: {} s\".format(time.perf_counter() - comput_time0))" ] } ], "metadata": { "kernelspec": { "display_name": "SageMath 9.0.beta3", "language": "sage", "name": "sagemath" }, "language": "python", "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.3" } }, "nbformat": 4, "nbformat_minor": 1 }