{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Checking that Kerr metric is a solution of Einstein equation\n", "\n", "This Jupyter/SageMath notebook is relative to the lectures\n", "[Physics of black holes](http://luth.obspm.fr/~luthier/gourgoulhon/leshouches18/)\n", "\n", "These computations are based on [SageManifolds](http://sagemanifolds.obspm.fr) (version 1.2, as included in SageMath 8.2 and higher versions)\n", "\n", "Click [here](https://raw.githubusercontent.com/egourgoulhon/BHLectures/master/sage/Kerr_solution.ipynb) to download the worksheet file (ipynb format). To run it, you must start SageMath with the Jupyter notebook, with the command `sage -n jupyter`\n", "\n", "*NB:* a version of SageMath at least equal to 8.2 is required to run this worksheet: " ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'SageMath version 8.2, Release Date: 2018-05-05'" ] }, "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 formatting:" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "%display latex" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "To speed up computations, we ask for running them in parallel on 8 threads:" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "Parallelism().set(nproc=8)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Spacetime\n", "\n", "We declare the spacetime manifold $M$:" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "4-dimensional Lorentzian manifold M\n" ] } ], "source": [ "M = Manifold(4, 'M', structure='Lorentzian')\n", "print(M)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "and the Boyer-Lindquist coordinates $(t,r,\\theta,\\phi)$ as a chart on $M$:" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "Chart (M, (t, r, th, ph))" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "XBL. = M.chart(r't r th:(0,pi):\\theta ph:(0,2*pi):\\phi')\n", "XBL" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "t: (-oo, +oo); r: (-oo, +oo); th: (0, pi); ph: (0, 2*pi)" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "XBL.coord_range()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Kerr metric" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We define the metric $g$ by its components w.r.t. the Boyer-Lindquist coordinates:" ] }, { "cell_type": "code", "execution_count": 7, "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": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "g = M.metric()\n", "m, a = var('m a')\n", "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] = rho2/Delta\n", "g[2,2] = 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": "code", "execution_count": 8, "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": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "g.display_comp()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The inverse metric:" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "[-(2*a^2*m*r*sin(th)^2 + a^2*r^2 + r^4 + (a^4 + a^2*r^2)*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) 0 0 -2*a*m*r/(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", "[ 0 (a^2 - 2*m*r + r^2)/(a^2*cos(th)^2 + r^2) 0 0]\n", "[ 0 0 1/(a^2*cos(th)^2 + r^2) 0]\n", "[ -2*a*m*r/(a^2*r^2 - 2*m*r^3 + r^4 + (a^4 - 2*a^2*m*r + a^2*r^2)*cos(th)^2) 0 0 (a^2*cos(th)^2 - 2*m*r + r^2)/(2*a^2*m*r*sin(th)^4 - (2*a^2*m*r - a^2*r^2 + 2*m*r^3 - r^4 - (a^4 + a^2*r^2)*cos(th)^2)*sin(th)^2)]" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "g.inverse()[:]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The Christoffel symbols:" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "Gam^t_t,r = (a^2*m*r^2 + m*r^4 - (a^4*m + a^2*m*r^2)*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^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": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "g.christoffel_symbols_display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## The Einstein equation\n", "\n", "Let us check that the Ricci tensor of $g$ vanishes identically, which is equivalent to the Einstein equation in vacuum:" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "Ric(g) = 0" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "g.ricci().display()" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "On the contrary, the Riemann tensor is not zero:" ] }, { "cell_type": "code", "execution_count": 12, "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": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "-((a^7*m - 2*a^5*m^2*r + a^5*m*r^2)*cos(th)*sin(th)^5 + (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)*cos(th)*sin(th)^3 - 2*(a^7*m - a^5*m*r^2 - 5*a^3*m*r^4 - 3*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": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "R[0,1,2,3]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## The Kretschmann scalar\n", "\n", "The Kretschmann scalar is the following square of the Riemann tensor:\n", "$$ K = R_{abcd} R^{abcd} $$\n", "We compute first the tensors $R_{abcd}$ and $R^{abcd}$ by respectively lowering and raising the indices of $R$ with the metric $g$:" ] }, { "cell_type": "code", "execution_count": 14, "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": "code", "execution_count": 15, "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": [ "Then we perform the contraction:" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Scalar field on the 4-dimensional Lorentzian manifold M\n" ] }, { "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": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "K = dR['_{abcd}']*uR['^{abcd}']\n", "print(K)\n", "K.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": 17, "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": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Kr = K.expr().factor()\n", "Kr" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The Schwarzschild value of the Kretschmann scalar is recovered for $a=0$" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "48*m^2/r^6" ] }, "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Kr.subs(a=0)" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "For a more detailed Kerr notebook (Killing vectors, Bianchi identity, etc.) see [here](http://nbviewer.jupyter.org/github/sagemanifolds/SageManifolds/blob/master/Worksheets/v1.0/SM_Kerr.ipynb)." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "SageMath 8.2", "language": "", "name": "sagemath" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.14" } }, "nbformat": 4, "nbformat_minor": 1 }