{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Schwarzschild spacetime: basic computations\n", "\n", "This notebook shows how to use SageMath to compute the Christoffel symbols of the Schwarzschild metric with respect to standard coordinates, as well as the Riemann curvature tensor and the Kretschmann scalar. The corresponding tools have been developed within the [SageManifolds](https://sagemanifolds.obspm.fr) project.\n", "\n", "A more advanced notebook about Schwarzschild spacetime, involving many coordinate charts, more tensor calculus and graphical outputs, is available [here](http://nbviewer.jupyter.org/github/sagemanifolds/SageManifolds/blob/master/Worksheets/v1.3/SM_Schwarzschild.ipynb).\n", "\n", "Click [here](https://raw.githubusercontent.com/sagemanifolds/SageManifolds/master/Notebooks/SM_basic_Schwarzschild.ipynb) to download the notebook file (ipynb format). " ] }, { "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.5.rc2, Release Date: 2022-01-16'" ] }, "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 via LaTeX rendering:" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "%display latex" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Spacetime manifold\n", "\n", "We declare the spacetime manifold as a 4-dimensional Lorentzian manifold:" ] }, { "cell_type": "code", "execution_count": 3, "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": [ "## Standard coordinates\n", "\n", "The standard **Schwarzschild-Droste coordinates** are introduced via the method chart() applied to the manifold object M. Note that the argument of chart() is a raw string (hence the prefix r in front of it), which \n", "defines the range of each coordinate, if different from $(-\\infty, +\\infty)$, as well as its LaTeX symbol, if different from the Python symbol to denote the coordinate. The Python variables for each coordinate are declared within the <...> operator on the left-hand side, X denoting the Python variable chosen for the coordinate chart." ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(M,(t, r, {\\theta}, {\\phi})\\right)\$" ], "text/latex": [ "$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(M,(t, r, {\\theta}, {\\phi})\\right)$$" ], "text/plain": [ "Chart (M, (t, r, th, ph))" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "X. = M.chart(r\"t r:(0,+oo) th:(0,pi):\\theta ph:(0,2*pi):\\phi\")\n", "X" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(t, r, {\\theta}, {\\phi}\\right)\$" ], "text/latex": [ "$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(t, r, {\\theta}, {\\phi}\\right)$$" ], "text/plain": [ "(t, r, th, ph)" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "X[:]" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(t, {\\phi}\\right)\$" ], "text/latex": [ "$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(t, {\\phi}\\right)$$" ], "text/plain": [ "(t, ph)" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "X[0], X[3]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Metric tensor\n", "\n", "We introduce first the mass parameter $m$ as a symbolic variable, via the function var():" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "m = var('m')\n", "assume(m>=0)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The metric tensor of the Lorentzian manifold M is returned by the method metric(); we initialize its components in the chart X, which is the default chart on M (the only one defined up to now):" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\$\\newcommand{\\Bold}[1]{\\mathbf{#1}}g = \\left( \\frac{2 \\, m}{r} - 1 \\right) \\mathrm{d} t\\otimes \\mathrm{d} t + \\left( -\\frac{1}{\\frac{2 \\, m}{r} - 1} \\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}\$" ], "text/latex": [ "$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}g = \\left( \\frac{2 \\, m}{r} - 1 \\right) \\mathrm{d} t\\otimes \\mathrm{d} t + \\left( -\\frac{1}{\\frac{2 \\, m}{r} - 1} \\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}$$" ], "text/plain": [ "g = (2*m/r - 1) dt⊗dt - 1/(2*m/r - 1) dr⊗dr + r^2 dth⊗dth + r^2*sin(th)^2 dph⊗dph" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "g = M.metric()\n", "g[0,0] = -(1-2*m/r)\n", "g[1,1] = 1/(1-2*m/r)\n", "g[2,2] = r^2\n", "g[3,3] = (r*sin(th))^2\n", "g.display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Viewing the metric components as a matrix:" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\begin{array}{rrrr}\n", "\\frac{2 \\, m}{r} - 1 & 0 & 0 & 0 \\\\\n", "0 & -\\frac{1}{\\frac{2 \\, m}{r} - 1} & 0 & 0 \\\\\n", "0 & 0 & r^{2} & 0 \\\\\n", "0 & 0 & 0 & r^{2} \\sin\\left({\\theta}\\right)^{2}\n", "\\end{array}\\right)\$" ], "text/latex": [ "$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\begin{array}{rrrr}\n", "\\frac{2 \\, m}{r} - 1 & 0 & 0 & 0 \\\\\n", "0 & -\\frac{1}{\\frac{2 \\, m}{r} - 1} & 0 & 0 \\\\\n", "0 & 0 & r^{2} & 0 \\\\\n", "0 & 0 & 0 & r^{2} \\sin\\left({\\theta}\\right)^{2}\n", "\\end{array}\\right)$$" ], "text/plain": [ "[ 2*m/r - 1 0 0 0]\n", "[ 0 -1/(2*m/r - 1) 0 0]\n", "[ 0 0 r^2 0]\n", "[ 0 0 0 r^2*sin(th)^2]" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "g[:]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Accessing to a specific component:" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\frac{2 \\, m}{r} - 1\$" ], "text/latex": [ "$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\frac{2 \\, m}{r} - 1$$" ], "text/plain": [ "2*m/r - 1" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "g[0,0]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Christoffel symbols\n", "\n", "The Christoffel symbols of $g$ with respect to the Schwarzschild-Droste coordinates are\n", "printed by the method christoffel_symbols_display() applied to the metric object g. By \n", "default, only the nonzero symbols and the nonredundant ones (taking into account the symmetry of the last two indices) are displayed. Type g.christoffel_symbols_display? to see all possible options." ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\begin{array}{lcl} \\Gamma_{ \\phantom{\\, t} \\, t \\, r }^{ \\, t \\phantom{\\, t} \\phantom{\\, r} } & = & -\\frac{m}{2 \\, m r - r^{2}} \\\\ \\Gamma_{ \\phantom{\\, r} \\, t \\, t }^{ \\, r \\phantom{\\, t} \\phantom{\\, t} } & = & -\\frac{2 \\, m^{2} - m r}{r^{3}} \\\\ \\Gamma_{ \\phantom{\\, r} \\, r \\, r }^{ \\, r \\phantom{\\, r} \\phantom{\\, r} } & = & \\frac{m}{2 \\, m r - r^{2}} \\\\ \\Gamma_{ \\phantom{\\, r} \\, {\\theta} \\, {\\theta} }^{ \\, r \\phantom{\\, {\\theta}} \\phantom{\\, {\\theta}} } & = & 2 \\, m - r \\\\ \\Gamma_{ \\phantom{\\, r} \\, {\\phi} \\, {\\phi} }^{ \\, r \\phantom{\\, {\\phi}} \\phantom{\\, {\\phi}} } & = & {\\left(2 \\, m - 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}\$" ], "text/latex": [ "$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\begin{array}{lcl} \\Gamma_{ \\phantom{\\, t} \\, t \\, r }^{ \\, t \\phantom{\\, t} \\phantom{\\, r} } & = & -\\frac{m}{2 \\, m r - r^{2}} \\\\ \\Gamma_{ \\phantom{\\, r} \\, t \\, t }^{ \\, r \\phantom{\\, t} \\phantom{\\, t} } & = & -\\frac{2 \\, m^{2} - m r}{r^{3}} \\\\ \\Gamma_{ \\phantom{\\, r} \\, r \\, r }^{ \\, r \\phantom{\\, r} \\phantom{\\, r} } & = & \\frac{m}{2 \\, m r - r^{2}} \\\\ \\Gamma_{ \\phantom{\\, r} \\, {\\theta} \\, {\\theta} }^{ \\, r \\phantom{\\, {\\theta}} \\phantom{\\, {\\theta}} } & = & 2 \\, m - r \\\\ \\Gamma_{ \\phantom{\\, r} \\, {\\phi} \\, {\\phi} }^{ \\, r \\phantom{\\, {\\phi}} \\phantom{\\, {\\phi}} } & = & {\\left(2 \\, m - 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}$$" ], "text/plain": [ "Gam^t_t,r = -m/(2*m*r - r^2) \n", "Gam^r_t,t = -(2*m^2 - m*r)/r^3 \n", "Gam^r_r,r = m/(2*m*r - r^2) \n", "Gam^r_th,th = 2*m - r \n", "Gam^r_ph,ph = (2*m - r)*sin(th)^2 \n", "Gam^th_r,th = 1/r \n", "Gam^th_ph,ph = -cos(th)*sin(th) \n", "Gam^ph_r,ph = 1/r \n", "Gam^ph_th,ph = cos(th)/sin(th) " ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "g.christoffel_symbols_display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Accessing to a Christoffel symbol specified by its indices:" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\$\\newcommand{\\Bold}[1]{\\mathbf{#1}}-\\frac{m}{2 \\, m r - r^{2}}\$" ], "text/latex": [ "$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}-\\frac{m}{2 \\, m r - r^{2}}$$" ], "text/plain": [ "-m/(2*m*r - r^2)" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "g.christoffel_symbols()[0,0,1]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Checking the symmetry on the last two indices:" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\mathrm{True}\$" ], "text/latex": [ "$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\mathrm{True}$$" ], "text/plain": [ "True" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "g.christoffel_symbols()[0,0,1] == g.christoffel_symbols()[0,1,0]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Einstein equation\n", "\n", "Let us check that $g$ is a solution of the vacuum Einstein equation, i.e. that its **Ricci tensor** vanishes identically:" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\mathrm{Ric}\\left(g\\right)\$" ], "text/latex": [ "$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\mathrm{Ric}\\left(g\\right)$$" ], "text/plain": [ "Field of symmetric bilinear forms Ric(g) on the 4-dimensional Lorentzian manifold M" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "g.ricci()" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\mathrm{Ric}\\left(g\\right) = 0\$" ], "text/latex": [ "$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\mathrm{Ric}\\left(g\\right) = 0$$" ], "text/plain": [ "Ric(g) = 0" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "g.ricci().display()" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\begin{array}{rrrr}\n", "0 & 0 & 0 & 0 \\\\\n", "0 & 0 & 0 & 0 \\\\\n", "0 & 0 & 0 & 0 \\\\\n", "0 & 0 & 0 & 0\n", "\\end{array}\\right)\$" ], "text/latex": [ "$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\begin{array}{rrrr}\n", "0 & 0 & 0 & 0 \\\\\n", "0 & 0 & 0 & 0 \\\\\n", "0 & 0 & 0 & 0 \\\\\n", "0 & 0 & 0 & 0\n", "\\end{array}\\right)$$" ], "text/plain": [ "[0 0 0 0]\n", "[0 0 0 0]\n", "[0 0 0 0]\n", "[0 0 0 0]" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "g.ricci()[:]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Curvature tensor\n", "\n", "The **Riemann curvature tensor** is obtained by the method riemann():" ] }, { "cell_type": "code", "execution_count": 17, "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, it is not identically zero:" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\mathrm{Riem}\\left(g\\right) = \\left( -\\frac{2 \\, m}{2 \\, m r^{2} - r^{3}} \\right) \\frac{\\partial}{\\partial t }\\otimes \\mathrm{d} r\\otimes \\mathrm{d} t\\otimes \\mathrm{d} r + \\left( \\frac{2 \\, m}{2 \\, m r^{2} - r^{3}} \\right) \\frac{\\partial}{\\partial t }\\otimes \\mathrm{d} r\\otimes \\mathrm{d} r\\otimes \\mathrm{d} t -\\frac{m}{r} \\frac{\\partial}{\\partial t }\\otimes \\mathrm{d} {\\theta}\\otimes \\mathrm{d} t\\otimes \\mathrm{d} {\\theta} + \\frac{m}{r} \\frac{\\partial}{\\partial t }\\otimes \\mathrm{d} {\\theta}\\otimes \\mathrm{d} {\\theta}\\otimes \\mathrm{d} t -\\frac{m \\sin\\left({\\theta}\\right)^{2}}{r} \\frac{\\partial}{\\partial t }\\otimes \\mathrm{d} {\\phi}\\otimes \\mathrm{d} t\\otimes \\mathrm{d} {\\phi} + \\frac{m \\sin\\left({\\theta}\\right)^{2}}{r} \\frac{\\partial}{\\partial t }\\otimes \\mathrm{d} {\\phi}\\otimes \\mathrm{d} {\\phi}\\otimes \\mathrm{d} t -\\frac{2 \\, {\\left(2 \\, m^{2} - m r\\right)}}{r^{4}} \\frac{\\partial}{\\partial r }\\otimes \\mathrm{d} t\\otimes \\mathrm{d} t\\otimes \\mathrm{d} r + \\frac{2 \\, {\\left(2 \\, m^{2} - m r\\right)}}{r^{4}} \\frac{\\partial}{\\partial r }\\otimes \\mathrm{d} t\\otimes \\mathrm{d} r\\otimes \\mathrm{d} t -\\frac{m}{r} \\frac{\\partial}{\\partial r }\\otimes \\mathrm{d} {\\theta}\\otimes \\mathrm{d} r\\otimes \\mathrm{d} {\\theta} + \\frac{m}{r} \\frac{\\partial}{\\partial r }\\otimes \\mathrm{d} {\\theta}\\otimes \\mathrm{d} {\\theta}\\otimes \\mathrm{d} r -\\frac{m \\sin\\left({\\theta}\\right)^{2}}{r} \\frac{\\partial}{\\partial r }\\otimes \\mathrm{d} {\\phi}\\otimes \\mathrm{d} r\\otimes \\mathrm{d} {\\phi} + \\frac{m \\sin\\left({\\theta}\\right)^{2}}{r} \\frac{\\partial}{\\partial r }\\otimes \\mathrm{d} {\\phi}\\otimes \\mathrm{d} {\\phi}\\otimes \\mathrm{d} r + \\left( \\frac{2 \\, m^{2} - m r}{r^{4}} \\right) \\frac{\\partial}{\\partial {\\theta} }\\otimes \\mathrm{d} t\\otimes \\mathrm{d} t\\otimes \\mathrm{d} {\\theta} + \\left( -\\frac{2 \\, m^{2} - m r}{r^{4}} \\right) \\frac{\\partial}{\\partial {\\theta} }\\otimes \\mathrm{d} t\\otimes \\mathrm{d} {\\theta}\\otimes \\mathrm{d} t + \\left( -\\frac{m}{2 \\, m r^{2} - r^{3}} \\right) \\frac{\\partial}{\\partial {\\theta} }\\otimes \\mathrm{d} r\\otimes \\mathrm{d} r\\otimes \\mathrm{d} {\\theta} + \\left( \\frac{m}{2 \\, m r^{2} - r^{3}} \\right) \\frac{\\partial}{\\partial {\\theta} }\\otimes \\mathrm{d} r\\otimes \\mathrm{d} {\\theta}\\otimes \\mathrm{d} r + \\frac{2 \\, m \\sin\\left({\\theta}\\right)^{2}}{r} \\frac{\\partial}{\\partial {\\theta} }\\otimes \\mathrm{d} {\\phi}\\otimes \\mathrm{d} {\\theta}\\otimes \\mathrm{d} {\\phi} -\\frac{2 \\, m \\sin\\left({\\theta}\\right)^{2}}{r} \\frac{\\partial}{\\partial {\\theta} }\\otimes \\mathrm{d} {\\phi}\\otimes \\mathrm{d} {\\phi}\\otimes \\mathrm{d} {\\theta} + \\left( \\frac{2 \\, m^{2} - m r}{r^{4}} \\right) \\frac{\\partial}{\\partial {\\phi} }\\otimes \\mathrm{d} t\\otimes \\mathrm{d} t\\otimes \\mathrm{d} {\\phi} + \\left( -\\frac{2 \\, m^{2} - m r}{r^{4}} \\right) \\frac{\\partial}{\\partial {\\phi} }\\otimes \\mathrm{d} t\\otimes \\mathrm{d} {\\phi}\\otimes \\mathrm{d} t + \\left( -\\frac{m}{2 \\, m r^{2} - r^{3}} \\right) \\frac{\\partial}{\\partial {\\phi} }\\otimes \\mathrm{d} r\\otimes \\mathrm{d} r\\otimes \\mathrm{d} {\\phi} + \\left( \\frac{m}{2 \\, m r^{2} - r^{3}} \\right) \\frac{\\partial}{\\partial {\\phi} }\\otimes \\mathrm{d} r\\otimes \\mathrm{d} {\\phi}\\otimes \\mathrm{d} r -\\frac{2 \\, m}{r} \\frac{\\partial}{\\partial {\\phi} }\\otimes \\mathrm{d} {\\theta}\\otimes \\mathrm{d} {\\theta}\\otimes \\mathrm{d} {\\phi} + \\frac{2 \\, m}{r} \\frac{\\partial}{\\partial {\\phi} }\\otimes \\mathrm{d} {\\theta}\\otimes \\mathrm{d} {\\phi}\\otimes \\mathrm{d} {\\theta}\$" ], "text/latex": [ "$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\mathrm{Riem}\\left(g\\right) = \\left( -\\frac{2 \\, m}{2 \\, m r^{2} - r^{3}} \\right) \\frac{\\partial}{\\partial t }\\otimes \\mathrm{d} r\\otimes \\mathrm{d} t\\otimes \\mathrm{d} r + \\left( \\frac{2 \\, m}{2 \\, m r^{2} - r^{3}} \\right) \\frac{\\partial}{\\partial t }\\otimes \\mathrm{d} r\\otimes \\mathrm{d} r\\otimes \\mathrm{d} t -\\frac{m}{r} \\frac{\\partial}{\\partial t }\\otimes \\mathrm{d} {\\theta}\\otimes \\mathrm{d} t\\otimes \\mathrm{d} {\\theta} + \\frac{m}{r} \\frac{\\partial}{\\partial t }\\otimes \\mathrm{d} {\\theta}\\otimes \\mathrm{d} {\\theta}\\otimes \\mathrm{d} t -\\frac{m \\sin\\left({\\theta}\\right)^{2}}{r} \\frac{\\partial}{\\partial t }\\otimes \\mathrm{d} {\\phi}\\otimes \\mathrm{d} t\\otimes \\mathrm{d} {\\phi} + \\frac{m \\sin\\left({\\theta}\\right)^{2}}{r} \\frac{\\partial}{\\partial t }\\otimes \\mathrm{d} {\\phi}\\otimes \\mathrm{d} {\\phi}\\otimes \\mathrm{d} t -\\frac{2 \\, {\\left(2 \\, m^{2} - m r\\right)}}{r^{4}} \\frac{\\partial}{\\partial r }\\otimes \\mathrm{d} t\\otimes \\mathrm{d} t\\otimes \\mathrm{d} r + \\frac{2 \\, {\\left(2 \\, m^{2} - m r\\right)}}{r^{4}} \\frac{\\partial}{\\partial r }\\otimes \\mathrm{d} t\\otimes \\mathrm{d} r\\otimes \\mathrm{d} t -\\frac{m}{r} \\frac{\\partial}{\\partial r }\\otimes \\mathrm{d} {\\theta}\\otimes \\mathrm{d} r\\otimes \\mathrm{d} {\\theta} + \\frac{m}{r} \\frac{\\partial}{\\partial r }\\otimes \\mathrm{d} {\\theta}\\otimes \\mathrm{d} {\\theta}\\otimes \\mathrm{d} r -\\frac{m \\sin\\left({\\theta}\\right)^{2}}{r} \\frac{\\partial}{\\partial r }\\otimes \\mathrm{d} {\\phi}\\otimes \\mathrm{d} r\\otimes \\mathrm{d} {\\phi} + \\frac{m \\sin\\left({\\theta}\\right)^{2}}{r} \\frac{\\partial}{\\partial r }\\otimes \\mathrm{d} {\\phi}\\otimes \\mathrm{d} {\\phi}\\otimes \\mathrm{d} r + \\left( \\frac{2 \\, m^{2} - m r}{r^{4}} \\right) \\frac{\\partial}{\\partial {\\theta} }\\otimes \\mathrm{d} t\\otimes \\mathrm{d} t\\otimes \\mathrm{d} {\\theta} + \\left( -\\frac{2 \\, m^{2} - m r}{r^{4}} \\right) \\frac{\\partial}{\\partial {\\theta} }\\otimes \\mathrm{d} t\\otimes \\mathrm{d} {\\theta}\\otimes \\mathrm{d} t + \\left( -\\frac{m}{2 \\, m r^{2} - r^{3}} \\right) \\frac{\\partial}{\\partial {\\theta} }\\otimes \\mathrm{d} r\\otimes \\mathrm{d} r\\otimes \\mathrm{d} {\\theta} + \\left( \\frac{m}{2 \\, m r^{2} - r^{3}} \\right) \\frac{\\partial}{\\partial {\\theta} }\\otimes \\mathrm{d} r\\otimes \\mathrm{d} {\\theta}\\otimes \\mathrm{d} r + \\frac{2 \\, m \\sin\\left({\\theta}\\right)^{2}}{r} \\frac{\\partial}{\\partial {\\theta} }\\otimes \\mathrm{d} {\\phi}\\otimes \\mathrm{d} {\\theta}\\otimes \\mathrm{d} {\\phi} -\\frac{2 \\, m \\sin\\left({\\theta}\\right)^{2}}{r} \\frac{\\partial}{\\partial {\\theta} }\\otimes \\mathrm{d} {\\phi}\\otimes \\mathrm{d} {\\phi}\\otimes \\mathrm{d} {\\theta} + \\left( \\frac{2 \\, m^{2} - m r}{r^{4}} \\right) \\frac{\\partial}{\\partial {\\phi} }\\otimes \\mathrm{d} t\\otimes \\mathrm{d} t\\otimes \\mathrm{d} {\\phi} + \\left( -\\frac{2 \\, m^{2} - m r}{r^{4}} \\right) \\frac{\\partial}{\\partial {\\phi} }\\otimes \\mathrm{d} t\\otimes \\mathrm{d} {\\phi}\\otimes \\mathrm{d} t + \\left( -\\frac{m}{2 \\, m r^{2} - r^{3}} \\right) \\frac{\\partial}{\\partial {\\phi} }\\otimes \\mathrm{d} r\\otimes \\mathrm{d} r\\otimes \\mathrm{d} {\\phi} + \\left( \\frac{m}{2 \\, m r^{2} - r^{3}} \\right) \\frac{\\partial}{\\partial {\\phi} }\\otimes \\mathrm{d} r\\otimes \\mathrm{d} {\\phi}\\otimes \\mathrm{d} r -\\frac{2 \\, m}{r} \\frac{\\partial}{\\partial {\\phi} }\\otimes \\mathrm{d} {\\theta}\\otimes \\mathrm{d} {\\theta}\\otimes \\mathrm{d} {\\phi} + \\frac{2 \\, m}{r} \\frac{\\partial}{\\partial {\\phi} }\\otimes \\mathrm{d} {\\theta}\\otimes \\mathrm{d} {\\phi}\\otimes \\mathrm{d} {\\theta}$$" ], "text/plain": [ "Riem(g) = -2*m/(2*m*r^2 - r^3) ∂/∂t⊗dr⊗dt⊗dr + 2*m/(2*m*r^2 - r^3) ∂/∂t⊗dr⊗dr⊗dt - m/r ∂/∂t⊗dth⊗dt⊗dth + m/r ∂/∂t⊗dth⊗dth⊗dt - m*sin(th)^2/r ∂/∂t⊗dph⊗dt⊗dph + m*sin(th)^2/r ∂/∂t⊗dph⊗dph⊗dt - 2*(2*m^2 - m*r)/r^4 ∂/∂r⊗dt⊗dt⊗dr + 2*(2*m^2 - m*r)/r^4 ∂/∂r⊗dt⊗dr⊗dt - m/r ∂/∂r⊗dth⊗dr⊗dth + m/r ∂/∂r⊗dth⊗dth⊗dr - m*sin(th)^2/r ∂/∂r⊗dph⊗dr⊗dph + m*sin(th)^2/r ∂/∂r⊗dph⊗dph⊗dr + (2*m^2 - m*r)/r^4 ∂/∂th⊗dt⊗dt⊗dth - (2*m^2 - m*r)/r^4 ∂/∂th⊗dt⊗dth⊗dt - m/(2*m*r^2 - r^3) ∂/∂th⊗dr⊗dr⊗dth + m/(2*m*r^2 - r^3) ∂/∂th⊗dr⊗dth⊗dr + 2*m*sin(th)^2/r ∂/∂th⊗dph⊗dth⊗dph - 2*m*sin(th)^2/r ∂/∂th⊗dph⊗dph⊗dth + (2*m^2 - m*r)/r^4 ∂/∂ph⊗dt⊗dt⊗dph - (2*m^2 - m*r)/r^4 ∂/∂ph⊗dt⊗dph⊗dt - m/(2*m*r^2 - r^3) ∂/∂ph⊗dr⊗dr⊗dph + m/(2*m*r^2 - r^3) ∂/∂ph⊗dr⊗dph⊗dr - 2*m/r ∂/∂ph⊗dth⊗dth⊗dph + 2*m/r ∂/∂ph⊗dth⊗dph⊗dth" ] }, "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ], "source": [ "R.display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The component $R^0_{\\ \\,101} = R^t_{\\ \\,rtr}$ of the Riemann tensor:" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\$\\newcommand{\\Bold}[1]{\\mathbf{#1}}-\\frac{2 \\, m}{2 \\, m r^{2} - r^{3}}\$" ], "text/latex": [ "$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}-\\frac{2 \\, m}{2 \\, m r^{2} - r^{3}}$$" ], "text/plain": [ "-2*m/(2*m*r^2 - r^3)" ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "R[0,1,0,1]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "All the nonvanishing components of the Riemann tensor, skipping the redundant ones \n", "(i.e. those that can be deduced by antisymmetry of the last two indices):" ] }, { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\begin{array}{lcl} \\mathrm{Riem}\\left(g\\right)_{ \\phantom{\\, t} \\, r \\, t \\, r }^{ \\, t \\phantom{\\, r} \\phantom{\\, t} \\phantom{\\, r} } & = & -\\frac{2 \\, m}{2 \\, m r^{2} - r^{3}} \\\\ \\mathrm{Riem}\\left(g\\right)_{ \\phantom{\\, t} \\, {\\theta} \\, t \\, {\\theta} }^{ \\, t \\phantom{\\, {\\theta}} \\phantom{\\, t} \\phantom{\\, {\\theta}} } & = & -\\frac{m}{r} \\\\ \\mathrm{Riem}\\left(g\\right)_{ \\phantom{\\, t} \\, {\\phi} \\, t \\, {\\phi} }^{ \\, t \\phantom{\\, {\\phi}} \\phantom{\\, t} \\phantom{\\, {\\phi}} } & = & -\\frac{m \\sin\\left({\\theta}\\right)^{2}}{r} \\\\ \\mathrm{Riem}\\left(g\\right)_{ \\phantom{\\, r} \\, t \\, t \\, r }^{ \\, r \\phantom{\\, t} \\phantom{\\, t} \\phantom{\\, r} } & = & -\\frac{2 \\, {\\left(2 \\, m^{2} - m r\\right)}}{r^{4}} \\\\ \\mathrm{Riem}\\left(g\\right)_{ \\phantom{\\, r} \\, {\\theta} \\, r \\, {\\theta} }^{ \\, r \\phantom{\\, {\\theta}} \\phantom{\\, r} \\phantom{\\, {\\theta}} } & = & -\\frac{m}{r} \\\\ \\mathrm{Riem}\\left(g\\right)_{ \\phantom{\\, r} \\, {\\phi} \\, r \\, {\\phi} }^{ \\, r \\phantom{\\, {\\phi}} \\phantom{\\, r} \\phantom{\\, {\\phi}} } & = & -\\frac{m \\sin\\left({\\theta}\\right)^{2}}{r} \\\\ \\mathrm{Riem}\\left(g\\right)_{ \\phantom{\\, {\\theta}} \\, t \\, t \\, {\\theta} }^{ \\, {\\theta} \\phantom{\\, t} \\phantom{\\, t} \\phantom{\\, {\\theta}} } & = & \\frac{2 \\, m^{2} - m r}{r^{4}} \\\\ \\mathrm{Riem}\\left(g\\right)_{ \\phantom{\\, {\\theta}} \\, r \\, r \\, {\\theta} }^{ \\, {\\theta} \\phantom{\\, r} \\phantom{\\, r} \\phantom{\\, {\\theta}} } & = & -\\frac{m}{2 \\, m r^{2} - r^{3}} \\\\ \\mathrm{Riem}\\left(g\\right)_{ \\phantom{\\, {\\theta}} \\, {\\phi} \\, {\\theta} \\, {\\phi} }^{ \\, {\\theta} \\phantom{\\, {\\phi}} \\phantom{\\, {\\theta}} \\phantom{\\, {\\phi}} } & = & \\frac{2 \\, m \\sin\\left({\\theta}\\right)^{2}}{r} \\\\ \\mathrm{Riem}\\left(g\\right)_{ \\phantom{\\, {\\phi}} \\, t \\, t \\, {\\phi} }^{ \\, {\\phi} \\phantom{\\, t} \\phantom{\\, t} \\phantom{\\, {\\phi}} } & = & \\frac{2 \\, m^{2} - m r}{r^{4}} \\\\ \\mathrm{Riem}\\left(g\\right)_{ \\phantom{\\, {\\phi}} \\, r \\, r \\, {\\phi} }^{ \\, {\\phi} \\phantom{\\, r} \\phantom{\\, r} \\phantom{\\, {\\phi}} } & = & -\\frac{m}{2 \\, m r^{2} - r^{3}} \\\\ \\mathrm{Riem}\\left(g\\right)_{ \\phantom{\\, {\\phi}} \\, {\\theta} \\, {\\theta} \\, {\\phi} }^{ \\, {\\phi} \\phantom{\\, {\\theta}} \\phantom{\\, {\\theta}} \\phantom{\\, {\\phi}} } & = & -\\frac{2 \\, m}{r} \\end{array}\$" ], "text/latex": [ "$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\begin{array}{lcl} \\mathrm{Riem}\\left(g\\right)_{ \\phantom{\\, t} \\, r \\, t \\, r }^{ \\, t \\phantom{\\, r} \\phantom{\\, t} \\phantom{\\, r} } & = & -\\frac{2 \\, m}{2 \\, m r^{2} - r^{3}} \\\\ \\mathrm{Riem}\\left(g\\right)_{ \\phantom{\\, t} \\, {\\theta} \\, t \\, {\\theta} }^{ \\, t \\phantom{\\, {\\theta}} \\phantom{\\, t} \\phantom{\\, {\\theta}} } & = & -\\frac{m}{r} \\\\ \\mathrm{Riem}\\left(g\\right)_{ \\phantom{\\, t} \\, {\\phi} \\, t \\, {\\phi} }^{ \\, t \\phantom{\\, {\\phi}} \\phantom{\\, t} \\phantom{\\, {\\phi}} } & = & -\\frac{m \\sin\\left({\\theta}\\right)^{2}}{r} \\\\ \\mathrm{Riem}\\left(g\\right)_{ \\phantom{\\, r} \\, t \\, t \\, r }^{ \\, r \\phantom{\\, t} \\phantom{\\, t} \\phantom{\\, r} } & = & -\\frac{2 \\, {\\left(2 \\, m^{2} - m r\\right)}}{r^{4}} \\\\ \\mathrm{Riem}\\left(g\\right)_{ \\phantom{\\, r} \\, {\\theta} \\, r \\, {\\theta} }^{ \\, r \\phantom{\\, {\\theta}} \\phantom{\\, r} \\phantom{\\, {\\theta}} } & = & -\\frac{m}{r} \\\\ \\mathrm{Riem}\\left(g\\right)_{ \\phantom{\\, r} \\, {\\phi} \\, r \\, {\\phi} }^{ \\, r \\phantom{\\, {\\phi}} \\phantom{\\, r} \\phantom{\\, {\\phi}} } & = & -\\frac{m \\sin\\left({\\theta}\\right)^{2}}{r} \\\\ \\mathrm{Riem}\\left(g\\right)_{ \\phantom{\\, {\\theta}} \\, t \\, t \\, {\\theta} }^{ \\, {\\theta} \\phantom{\\, t} \\phantom{\\, t} \\phantom{\\, {\\theta}} } & = & \\frac{2 \\, m^{2} - m r}{r^{4}} \\\\ \\mathrm{Riem}\\left(g\\right)_{ \\phantom{\\, {\\theta}} \\, r \\, r \\, {\\theta} }^{ \\, {\\theta} \\phantom{\\, r} \\phantom{\\, r} \\phantom{\\, {\\theta}} } & = & -\\frac{m}{2 \\, m r^{2} - r^{3}} \\\\ \\mathrm{Riem}\\left(g\\right)_{ \\phantom{\\, {\\theta}} \\, {\\phi} \\, {\\theta} \\, {\\phi} }^{ \\, {\\theta} \\phantom{\\, {\\phi}} \\phantom{\\, {\\theta}} \\phantom{\\, {\\phi}} } & = & \\frac{2 \\, m \\sin\\left({\\theta}\\right)^{2}}{r} \\\\ \\mathrm{Riem}\\left(g\\right)_{ \\phantom{\\, {\\phi}} \\, t \\, t \\, {\\phi} }^{ \\, {\\phi} \\phantom{\\, t} \\phantom{\\, t} \\phantom{\\, {\\phi}} } & = & \\frac{2 \\, m^{2} - m r}{r^{4}} \\\\ \\mathrm{Riem}\\left(g\\right)_{ \\phantom{\\, {\\phi}} \\, r \\, r \\, {\\phi} }^{ \\, {\\phi} \\phantom{\\, r} \\phantom{\\, r} \\phantom{\\, {\\phi}} } & = & -\\frac{m}{2 \\, m r^{2} - r^{3}} \\\\ \\mathrm{Riem}\\left(g\\right)_{ \\phantom{\\, {\\phi}} \\, {\\theta} \\, {\\theta} \\, {\\phi} }^{ \\, {\\phi} \\phantom{\\, {\\theta}} \\phantom{\\, {\\theta}} \\phantom{\\, {\\phi}} } & = & -\\frac{2 \\, m}{r} \\end{array}$$" ], "text/plain": [ "Riem(g)^t_r,t,r = -2*m/(2*m*r^2 - r^3) \n", "Riem(g)^t_th,t,th = -m/r \n", "Riem(g)^t_ph,t,ph = -m*sin(th)^2/r \n", "Riem(g)^r_t,t,r = -2*(2*m^2 - m*r)/r^4 \n", "Riem(g)^r_th,r,th = -m/r \n", "Riem(g)^r_ph,r,ph = -m*sin(th)^2/r \n", "Riem(g)^th_t,t,th = (2*m^2 - m*r)/r^4 \n", "Riem(g)^th_r,r,th = -m/(2*m*r^2 - r^3) \n", "Riem(g)^th_ph,th,ph = 2*m*sin(th)^2/r \n", "Riem(g)^ph_t,t,ph = (2*m^2 - m*r)/r^4 \n", "Riem(g)^ph_r,r,ph = -m/(2*m*r^2 - r^3) \n", "Riem(g)^ph_th,th,ph = -2*m/r " ] }, "execution_count": 20, "metadata": {}, "output_type": "execute_result" } ], "source": [ "R.display_comp(only_nonredundant=True)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Kretschmann scalar\n", "\n", "The Kretschmann scalar is the \"square\" of the Riemann tensor defined by \n", "$$K = R_{abcd} R^{abcd}$$\n", "To compute it, we must first form the tensor fields whose components are $R_{abcd}$ and \n", "$R^{abcd}$. They are obtained by respectively lowering and raising the indices of the components $R^a_{\\ \\, bcd}$ of the Riemann tensor, via the metric $g$. These two operations are performed by the methods down() and up(). The contraction is performed by summation on repeated indices, using LaTeX notations:" ] }, { "cell_type": "code", "execution_count": 21, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\mbox{Scalar field on the 4-dimensional Lorentzian manifold M}\$" ], "text/latex": [ "$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\mbox{Scalar field on the 4-dimensional Lorentzian manifold M}$$" ], "text/plain": [ "Scalar field on the 4-dimensional Lorentzian manifold M" ] }, "execution_count": 21, "metadata": {}, "output_type": "execute_result" } ], "source": [ "K = R.down(g)['_{abcd}'] * R.up(g)['^{abcd}']\n", "K" ] }, { "cell_type": "code", "execution_count": 22, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\begin{array}{llcl} & M & \\longrightarrow & \\mathbb{R} \\\\ & \\left(t, r, {\\theta}, {\\phi}\\right) & \\longmapsto & \\frac{48 \\, m^{2}}{r^{6}} \\end{array}\$" ], "text/latex": [ "$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\begin{array}{llcl} & M & \\longrightarrow & \\mathbb{R} \\\\ & \\left(t, r, {\\theta}, {\\phi}\\right) & \\longmapsto & \\frac{48 \\, m^{2}}{r^{6}} \\end{array}$$" ], "text/plain": [ "M → ℝ\n", "(t, r, th, ph) ↦ 48*m^2/r^6" ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "K.display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The symbolic expression representing the scalar field $K$ is returned by the method expr():" ] }, { "cell_type": "code", "execution_count": 23, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\frac{48 \\, m^{2}}{r^{6}}\$" ], "text/latex": [ "$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\frac{48 \\, m^{2}}{r^{6}}$$" ], "text/plain": [ "48*m^2/r^6" ] }, "execution_count": 23, "metadata": {}, "output_type": "execute_result" } ], "source": [ "K.expr()" ] } ], "metadata": { "kernelspec": { "display_name": "SageMath 9.5.rc2", "language": "sage", "name": "sagemath" }, "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.8.10" } }, "nbformat": 4, "nbformat_minor": 2 }