{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Demo black hole spacetime"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"%display latex"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We introduce the **Schwarzschild spacetime** (which represents a **static black hole** in general relativity) as a **4-dimensional Lorentzian manifold** $M$ and we endow it with the chart $X$\n",
"of standard Schwarzschild coordinates $(t,r,\\theta,\\phi)$:"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/plain": [
"[Chart (M, (t, r, th, ph))]"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"M = Manifold(4, 'M', structure='Lorentzian')\n",
"X. = M.chart(r\"t r:(0,+oo) th:(0,pi):\\theta ph:(0,2*pi):\\phi\")\n",
"M.atlas()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We define next the **metric tensor** $g$ from its non-vanishing components. It depends on the parameter $m$, which is the black hole mass:"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
""
],
"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": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"m = var('m')\n",
"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^2*sin(th)^2\n",
"g.display()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The **volume form** (also called **Levi-Civita tensor**) associated with $g$ can then be evaluated:"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"4-form eps_g on the 4-dimensional Lorentzian manifold M\n"
]
},
{
"data": {
"text/html": [
""
],
"text/plain": [
"eps_g = r^2*sin(th) dt/\\dr/\\dth/\\dph"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"print(g.volume_form())\n",
"g.volume_form().display()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The **Riemann curvature tensor** is computed as"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Tensor field Riem(g) of type (1,3) on the 4-dimensional Lorentzian manifold M\n"
]
},
{
"data": {
"text/html": [
""
],
"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": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"Riem = g.riemann()\n",
"print(Riem)\n",
"Riem.display_comp(only_nonredundant=True)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The component $\\mathrm{Riem}(g)^t_{\\ \\, rtr} = \\mathrm{Riem}(g)^0_{\\ \\, 101}$ is returned by "
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/plain": [
"-2*m/(2*m*r^2 - r^3)"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"Riem[0,1,0,1]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The **Kretschmann scalar** is defined as the following contraction of the Riemann tensor with itself:\n",
"\n",
"$$K = \\mathrm{Riem}(g)_{abcd} \\; \\mathrm{Riem}(g)^{abcd},$$\n",
"\n",
"where the Einstein summation convention on repeated indices is assumed. We evaluate it by using LaTeX notations for the indices:"
]
},
{
"cell_type": "code",
"execution_count": 7,
"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*m^2/r^6"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"K = Riem.down(g)['_{abcd}'] * Riem.up(g)['^{abcd}']\n",
"print(K)\n",
"K.display()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The **Ricci tensor** of $g$ is identically zero, reflecting the fact that the Schwarzschild metric is a solution of the **Einstein equation** in vacuum:"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Field of symmetric bilinear forms Ric(g) on the 4-dimensional Lorentzian manifold M\n"
]
},
{
"data": {
"text/html": [
""
],
"text/plain": [
"Ric(g) = 0"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"print(g.ricci())\n",
"g.ricci().display()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "SageMath 8.7.beta3",
"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.15"
}
},
"nbformat": 4,
"nbformat_minor": 2
}