{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from sympy import *\n", "from galgebra.printer import Format, latex, Fmt, GaLatexPrinter\n", "Format()\n", "from galgebra.ga import Ga\n", "from galgebra.mv import ONE, ZERO, HALF" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "def dot_basis_r_basis(ga):\n", " return [ga.dot(ga.basis[i], ga.r_basis[i]) for i in ga.n_range]" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "def gg(ga):\n", " return simplify(ga.g * ga.g_inv)" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "def conv_christoffel_symbols(cf):\n", " return permutedims(Array(cf), (2, 0, 1))" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "def show_christoffel_symbols(ga):\n", " if ga.connect_flg:\n", " display(conv_christoffel_symbols(ga.Christoffel_symbols(mode=1)))\n", " display(conv_christoffel_symbols(ga.Christoffel_symbols(mode=2)))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Minkowski Spacetime Metric" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "coord = symbols('t x y z')\n", "metric = Matrix([\n", " [ 1, 0, 0, 0 ], \n", " [ 0, -1, 0, 0 ], \n", " [ 0, 0, -1, 0 ], \n", " [ 0, 0, 0, -1 ]\n", " ])\n", "minkowski = Ga('e', g=metric, coords=coord, norm=False)" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "\\begin{equation*}\\left[ \\boldsymbol{e}_{t}, \\ \\boldsymbol{e}_{x}, \\ \\boldsymbol{e}_{y}, \\ \\boldsymbol{e}_{z}\\right]\\end{equation*}" ], "text/plain": [ "[eₜ, eₓ, e_y, e_z]" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# NBVAL_IGNORE_OUTPUT\n", "minkowski.basis" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "\\begin{equation*}\\left[\\begin{array}{cccc}1 & 0 & 0 & 0\\\\0 & -1 & 0 & 0\\\\0 & 0 & -1 & 0\\\\0 & 0 & 0 & -1\\end{array}\\right]\\end{equation*}" ], "text/plain": [ "⎡1 0 0 0 ⎤\n", "⎢ ⎥\n", "⎢0 -1 0 0 ⎥\n", "⎢ ⎥\n", "⎢0 0 -1 0 ⎥\n", "⎢ ⎥\n", "⎣0 0 0 -1⎦" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "minkowski.g" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "\\begin{equation*}\\left[ 1, \\ 1, \\ 1, \\ 1\\right]\\end{equation*}" ], "text/plain": [ "[1, 1, 1, 1]" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dot_basis_r_basis(minkowski)" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "\\begin{equation*}\\left[\\begin{array}{cccc}1 & 0 & 0 & 0\\\\0 & 1 & 0 & 0\\\\0 & 0 & 1 & 0\\\\0 & 0 & 0 & 1\\end{array}\\right]\\end{equation*}" ], "text/plain": [ "⎡1 0 0 0⎤\n", "⎢ ⎥\n", "⎢0 1 0 0⎥\n", "⎢ ⎥\n", "⎢0 0 1 0⎥\n", "⎢ ⎥\n", "⎣0 0 0 1⎦" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "gg(minkowski)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Kerr-Debney Metric" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [], "source": [ "g4coords = (u, x, y, z) = symbols(\"u x y z\")\n", "g = Matrix([\n", " [0, 0, -exp(-z), 0],\n", " [0, HALF * u ** 2 * exp(4 * z), 0, 0],\n", " [-exp(-z), 0, 12 * exp(-2 * z), u * exp(-z)],\n", " [0, 0, u * exp(-z), HALF * u ** 2],\n", "])\n", "g4 = Ga('e', g=g, coords=g4coords, norm=False)" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "\\begin{equation*}\\left[ \\boldsymbol{e}_{u}, \\ \\boldsymbol{e}_{x}, \\ \\boldsymbol{e}_{y}, \\ \\boldsymbol{e}_{z}\\right]\\end{equation*}" ], "text/plain": [ "[eᵤ, eₓ, e_y, e_z]" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "g4.basis" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "\\begin{equation*}\\left[\\begin{array}{cccc}0 & 0 & - e^{- z} & 0\\\\0 & \\frac{u^{2} e^{4 z}}{2} & 0 & 0\\\\- e^{- z} & 0 & 12 e^{- 2 z} & u e^{- z}\\\\0 & 0 & u e^{- z} & \\frac{u^{2}}{2}\\end{array}\\right]\\end{equation*}" ], "text/plain": [ "⎡ -z ⎤\n", "⎢ 0 0 -ℯ 0 ⎥\n", "⎢ ⎥\n", "⎢ 2 4⋅z ⎥\n", "⎢ u ⋅ℯ ⎥\n", "⎢ 0 ─────── 0 0 ⎥\n", "⎢ 2 ⎥\n", "⎢ ⎥\n", "⎢ -z -2⋅z -z⎥\n", "⎢-ℯ 0 12⋅ℯ u⋅ℯ ⎥\n", "⎢ ⎥\n", "⎢ 2 ⎥\n", "⎢ -z u ⎥\n", "⎢ 0 0 u⋅ℯ ── ⎥\n", "⎣ 2 ⎦" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "g4.g" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "\\begin{equation*}- \\frac{u^{4} e^{2 z}}{4}\\end{equation*}" ], "text/plain": [ " 4 2⋅z \n", "-u ⋅ℯ \n", "─────────\n", " 4 " ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "g4.e_sq" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "\\begin{equation*}\\left[ - \\frac{u^{4} e^{2 z}}{4}, \\ - \\frac{u^{4} e^{2 z}}{4}, \\ - \\frac{u^{4} e^{2 z}}{4}, \\ - \\frac{u^{4} e^{2 z}}{4}\\right]\\end{equation*}" ], "text/plain": [ "⎡ 4 2⋅z 4 2⋅z 4 2⋅z 4 2⋅z ⎤\n", "⎢-u ⋅ℯ -u ⋅ℯ -u ⋅ℯ -u ⋅ℯ ⎥\n", "⎢─────────, ─────────, ─────────, ─────────⎥\n", "⎣ 4 4 4 4 ⎦" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dot_basis_r_basis(g4)" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "\\begin{equation*}\\left[\\begin{array}{cccc}1 & 0 & 0 & 0\\\\0 & 1 & 0 & 0\\\\0 & 0 & 1 & 0\\\\0 & 0 & 0 & 1\\end{array}\\right]\\end{equation*}" ], "text/plain": [ "⎡1 0 0 0⎤\n", "⎢ ⎥\n", "⎢0 1 0 0⎥\n", "⎢ ⎥\n", "⎢0 0 1 0⎥\n", "⎢ ⎥\n", "⎣0 0 0 1⎦" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "gg(g4)" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "\\begin{equation*}\\left[\\begin{array}{}\\left[\\begin{array}{}0 & 0 & 0 & 0\\\\0 & - \\frac{u e^{4 z}}{2} & 0 & 0\\\\0 & 0 & 0 & 0\\\\0 & 0 & 0 & - \\frac{u}{2}\\end{array}\\right] & \\left[\\begin{array}{}0 & \\frac{u e^{4 z}}{2} & 0 & 0\\\\\\frac{u e^{4 z}}{2} & 0 & 0 & u^{2} e^{4 z}\\\\0 & 0 & 0 & 0\\\\0 & u^{2} e^{4 z} & 0 & 0\\end{array}\\right] & \\left[\\begin{array}{}0 & 0 & 0 & e^{- z}\\\\0 & 0 & 0 & 0\\\\0 & 0 & 0 & - 12 e^{- 2 z}\\\\e^{- z} & 0 & - 12 e^{- 2 z} & - u e^{- z}\\end{array}\\right] & \\left[\\begin{array}{}0 & 0 & 0 & \\frac{u}{2}\\\\0 & - u^{2} e^{4 z} & 0 & 0\\\\0 & 0 & 12 e^{- 2 z} & 0\\\\\\frac{u}{2} & 0 & 0 & 0\\end{array}\\right]\\end{array}\\right]\\end{equation*}" ], "text/plain": [ "⎡ ⎡ 4⋅z ⎤ ⎤\n", "⎢⎡0 0 0 0 ⎤ ⎢ u⋅ℯ ⎥ ⎡ u⎤⎥\n", "⎢⎢ ⎥ ⎢ 0 ────── 0 0 ⎥ ⎡ -z ⎤ ⎢0 0 0 ─⎥⎥\n", "⎢⎢ 4⋅z ⎥ ⎢ 2 ⎥ ⎢ 0 0 0 ℯ ⎥ ⎢ 2⎥⎥\n", "⎢⎢ -u⋅ℯ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎥\n", "⎢⎢0 ──────── 0 0 ⎥ ⎢ 4⋅z ⎥ ⎢ 0 0 0 0 ⎥ ⎢ 2 4⋅z ⎥⎥\n", "⎢⎢ 2 ⎥ ⎢u⋅ℯ 2 4⋅z⎥ ⎢ ⎥ ⎢0 -u ⋅ℯ 0 0⎥⎥\n", "⎢⎢ ⎥ ⎢────── 0 0 u ⋅ℯ ⎥ ⎢ -2⋅z⎥ ⎢ ⎥⎥\n", "⎢⎢0 0 0 0 ⎥ ⎢ 2 ⎥ ⎢ 0 0 0 -12⋅ℯ ⎥ ⎢ -2⋅z ⎥⎥\n", "⎢⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢0 0 12⋅ℯ 0⎥⎥\n", "⎢⎢ -u ⎥ ⎢ 0 0 0 0 ⎥ ⎢ -z -2⋅z -z ⎥ ⎢ ⎥⎥\n", "⎢⎢0 0 0 ───⎥ ⎢ ⎥ ⎣ℯ 0 -12⋅ℯ -u⋅ℯ ⎦ ⎢u ⎥⎥\n", "⎢⎣ 2 ⎦ ⎢ 2 4⋅z ⎥ ⎢─ 0 0 0⎥⎥\n", "⎣ ⎣ 0 u ⋅ℯ 0 0 ⎦ ⎣2 ⎦⎦" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/latex": [ "\\begin{equation*}\\left[\\begin{array}{}\\left[\\begin{array}{}0 & 0 & 0 & 0\\\\0 & 3 u e^{4 z} & 0 & 0\\\\0 & 0 & \\frac{24 e^{- 2 z}}{u} & 12 e^{- z}\\\\0 & 0 & 12 e^{- z} & 6 u\\end{array}\\right] & \\left[\\begin{array}{}0 & \\frac{1}{u} & 0 & 0\\\\\\frac{1}{u} & 0 & 0 & 2\\\\0 & 0 & 0 & 0\\\\0 & 2 & 0 & 0\\end{array}\\right] & \\left[\\begin{array}{}0 & 0 & 0 & 0\\\\0 & \\frac{u e^{5 z}}{2} & 0 & 0\\\\0 & 0 & 0 & 0\\\\0 & 0 & 0 & \\frac{u e^{z}}{2}\\end{array}\\right] & \\left[\\begin{array}{}0 & 0 & 0 & \\frac{1}{u}\\\\0 & - 3 e^{4 z} & 0 & 0\\\\0 & 0 & \\frac{24 e^{- 2 z}}{u^{2}} & 0\\\\\\frac{1}{u} & 0 & 0 & -1\\end{array}\\right]\\end{array}\\right]\\end{equation*}" ], "text/plain": [ "⎡ ⎡ 1 ⎤⎤\n", "⎢ ⎢0 0 0 ─ ⎥⎥\n", "⎢⎡0 0 0 0 ⎤ ⎡0 0 0 0 ⎤ ⎢ u ⎥⎥\n", "⎢⎢ ⎥ ⎡ 1 ⎤ ⎢ ⎥ ⎢ ⎥⎥\n", "⎢⎢ 4⋅z ⎥ ⎢0 ─ 0 0⎥ ⎢ 5⋅z ⎥ ⎢ 4⋅z ⎥⎥\n", "⎢⎢0 3⋅u⋅ℯ 0 0 ⎥ ⎢ u ⎥ ⎢ u⋅ℯ ⎥ ⎢0 -3⋅ℯ 0 0 ⎥⎥\n", "⎢⎢ ⎥ ⎢ ⎥ ⎢0 ────── 0 0 ⎥ ⎢ ⎥⎥\n", "⎢⎢ -2⋅z ⎥ ⎢1 ⎥ ⎢ 2 ⎥ ⎢ -2⋅z ⎥⎥\n", "⎢⎢ 24⋅ℯ -z⎥ ⎢─ 0 0 2⎥ ⎢ ⎥ ⎢ 24⋅ℯ ⎥⎥\n", "⎢⎢0 0 ──────── 12⋅ℯ ⎥ ⎢u ⎥ ⎢0 0 0 0 ⎥ ⎢0 0 ──────── 0 ⎥⎥\n", "⎢⎢ u ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ 2 ⎥⎥\n", "⎢⎢ ⎥ ⎢0 0 0 0⎥ ⎢ z⎥ ⎢ u ⎥⎥\n", "⎢⎢ -z ⎥ ⎢ ⎥ ⎢ u⋅ℯ ⎥ ⎢ ⎥⎥\n", "⎢⎣0 0 12⋅ℯ 6⋅u ⎦ ⎣0 2 0 0⎦ ⎢0 0 0 ────⎥ ⎢1 ⎥⎥\n", "⎢ ⎣ 2 ⎦ ⎢─ 0 0 -1⎥⎥\n", "⎣ ⎣u ⎦⎦" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "show_christoffel_symbols(g4)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Schwarzschild Metric" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [], "source": [ "G, M, c = symbols('G M c')\n", "coords = (x0, x1, x2, x3) = symbols(\"t r theta phi\")\n", "g = Matrix([ \n", " [ (1-(2*G*M)/(x1*c**2)), 0, 0, 0 ], \n", " [ 0, - (1-(2*G*M)/(x1*c**2))**(-1), 0, 0 ], \n", " [ 0, 0, - x1**2, 0 ], \n", " [ 0, 0, 0, - x1**2*sin(x2)**2 ]\n", " ])\n", "schwarzschild = Ga('e', g=g, coords=coords, norm=False)" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "\\begin{equation*}\\left[ \\boldsymbol{e}_{t}, \\ \\boldsymbol{e}_{r}, \\ \\boldsymbol{e}_{\\theta }, \\ \\boldsymbol{e}_{\\phi }\\right]\\end{equation*}" ], "text/plain": [ "[eₜ, eᵣ, eₜₕₑₜₐ, eᵩ]" ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# NBVAL_IGNORE_OUTPUT\n", "schwarzschild.basis" ] }, { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "\\begin{equation*}\\left[\\begin{array}{cccc}- \\frac{2 G M}{c^{2} r} + 1 & 0 & 0 & 0\\\\0 & - \\frac{1}{- \\frac{2 G M}{c^{2} r} + 1} & 0 & 0\\\\0 & 0 & - r^{2} & 0\\\\0 & 0 & 0 & - r^{2} {\\sin{\\left (\\theta \\right )}}^{2}\\end{array}\\right]\\end{equation*}" ], "text/plain": [ "⎡ 2⋅G⋅M ⎤\n", "⎢- ───── + 1 0 0 0 ⎥\n", "⎢ 2 ⎥\n", "⎢ c ⋅r ⎥\n", "⎢ ⎥\n", "⎢ -1 ⎥\n", "⎢ 0 ─────────── 0 0 ⎥\n", "⎢ 2⋅G⋅M ⎥\n", "⎢ - ───── + 1 ⎥\n", "⎢ 2 ⎥\n", "⎢ c ⋅r ⎥\n", "⎢ ⎥\n", "⎢ 2 ⎥\n", "⎢ 0 0 -r 0 ⎥\n", "⎢ ⎥\n", "⎢ 2 2 ⎥\n", "⎣ 0 0 0 -r ⋅sin (θ)⎦" ] }, "execution_count": 20, "metadata": {}, "output_type": "execute_result" } ], "source": [ "schwarzschild.g" ] }, { "cell_type": "code", "execution_count": 21, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "\\begin{equation*}- r^{4} {\\sin{\\left (\\theta \\right )}}^{2}\\end{equation*}" ], "text/plain": [ " 4 2 \n", "-r ⋅sin (θ)" ] }, "execution_count": 21, "metadata": {}, "output_type": "execute_result" } ], "source": [ "schwarzschild.e_sq" ] }, { "cell_type": "code", "execution_count": 22, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "\\begin{equation*}\\left[ 1, \\ - \\frac{\\frac{2 G M}{c^{2} r} - 1}{- \\frac{2 G M}{c^{2} r} + 1}, \\ 1, \\ 1\\right]\\end{equation*}" ], "text/plain": [ "⎡ ⎛2⋅G⋅M ⎞ ⎤\n", "⎢ -⎜───── - 1⎟ ⎥\n", "⎢ ⎜ 2 ⎟ ⎥\n", "⎢ ⎝ c ⋅r ⎠ ⎥\n", "⎢1, ─────────────, 1, 1⎥\n", "⎢ 2⋅G⋅M ⎥\n", "⎢ - ───── + 1 ⎥\n", "⎢ 2 ⎥\n", "⎣ c ⋅r ⎦" ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dot_basis_r_basis(schwarzschild)" ] }, { "cell_type": "code", "execution_count": 23, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "\\begin{equation*}\\left[\\begin{array}{cccc}1 & 0 & 0 & 0\\\\0 & 1 & 0 & 0\\\\0 & 0 & 1 & 0\\\\0 & 0 & 0 & 1\\end{array}\\right]\\end{equation*}" ], "text/plain": [ "⎡1 0 0 0⎤\n", "⎢ ⎥\n", "⎢0 1 0 0⎥\n", "⎢ ⎥\n", "⎢0 0 1 0⎥\n", "⎢ ⎥\n", "⎣0 0 0 1⎦" ] }, "execution_count": 23, "metadata": {}, "output_type": "execute_result" } ], "source": [ "gg(schwarzschild)" ] }, { "cell_type": "code", "execution_count": 24, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "\\begin{equation*}\\left[\\begin{array}{}\\left[\\begin{array}{}0 & \\frac{G M}{c^{2} r^{2}} & 0 & 0\\\\\\frac{G M}{c^{2} r^{2}} & 0 & 0 & 0\\\\0 & 0 & 0 & 0\\\\0 & 0 & 0 & 0\\end{array}\\right] & \\left[\\begin{array}{}- \\frac{G M}{c^{2} r^{2}} & 0 & 0 & 0\\\\0 & \\frac{G M c^{2}}{4 G^{2} M^{2} + c^{2} r \\left(- 4 G M + c^{2} r\\right)} & 0 & 0\\\\0 & 0 & r & 0\\\\0 & 0 & 0 & r {\\sin{\\left (\\theta \\right )}}^{2}\\end{array}\\right] & \\left[\\begin{array}{}0 & 0 & 0 & 0\\\\0 & 0 & - r & 0\\\\0 & - r & 0 & 0\\\\0 & 0 & 0 & \\frac{r^{2} \\sin{\\left (2 \\theta \\right )}}{2}\\end{array}\\right] & \\left[\\begin{array}{}0 & 0 & 0 & 0\\\\0 & 0 & 0 & - r {\\sin{\\left (\\theta \\right )}}^{2}\\\\0 & 0 & 0 & - \\frac{r^{2} \\sin{\\left (2 \\theta \\right )}}{2}\\\\0 & - r {\\sin{\\left (\\theta \\right )}}^{2} & - \\frac{r^{2} \\sin{\\left (2 \\theta \\right )}}{2} & 0\\end{array}\\right]\\end{array}\\right]\\end{equation*}" ], "text/plain": [ "⎡ ⎡-G⋅M ⎤ ⎡0 0 0 0 ⎤⎤\n", "⎢⎡ G⋅M ⎤ ⎢───── 0 0 0 ⎥ ⎢ ⎥⎥\n", "⎢⎢ 0 ───── 0 0⎥ ⎢ 2 2 ⎥ ⎡0 0 0 0 ⎤ ⎢ 2 ⎥⎥\n", "⎢⎢ 2 2 ⎥ ⎢c ⋅r ⎥ ⎢ ⎥ ⎢0 0 0 -r⋅sin (θ) ⎥⎥\n", "⎢⎢ c ⋅r ⎥ ⎢ ⎥ ⎢0 0 -r 0 ⎥ ⎢ ⎥⎥\n", "⎢⎢ ⎥ ⎢ 2 ⎥ ⎢ ⎥ ⎢ 2 ⎥⎥\n", "⎢⎢ G⋅M ⎥ ⎢ G⋅M⋅c ⎥ ⎢0 -r 0 0 ⎥ ⎢ -r ⋅sin(2⋅θ) ⎥⎥\n", "⎢⎢───── 0 0 0⎥ ⎢ 0 ────────────────────────────── 0 0 ⎥ ⎢ ⎥ ⎢0 0 0 ─────────────⎥⎥\n", "⎢⎢ 2 2 ⎥ ⎢ 2 2 2 ⎛ 2 ⎞ ⎥ ⎢ 2 ⎥ ⎢ 2 ⎥⎥\n", "⎢⎢c ⋅r ⎥ ⎢ 4⋅G ⋅M + c ⋅r⋅⎝-4⋅G⋅M + c ⋅r⎠ ⎥ ⎢ r ⋅sin(2⋅θ)⎥ ⎢ ⎥⎥\n", "⎢⎢ ⎥ ⎢ ⎥ ⎢0 0 0 ───────────⎥ ⎢ 2 ⎥⎥\n", "⎢⎢ 0 0 0 0⎥ ⎢ 0 0 r 0 ⎥ ⎣ 2 ⎦ ⎢ 2 -r ⋅sin(2⋅θ) ⎥⎥\n", "⎢⎢ ⎥ ⎢ ⎥ ⎢0 -r⋅sin (θ) ───────────── 0 ⎥⎥\n", "⎢⎣ 0 0 0 0⎦ ⎢ 2 ⎥ ⎣ 2 ⎦⎥\n", "⎣ ⎣ 0 0 0 r⋅sin (θ)⎦ ⎦" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/latex": [ "\\begin{equation*}\\left[\\begin{array}{}\\left[\\begin{array}{}0 & \\frac{G M}{r \\left(- 2 G M + c^{2} r\\right)} & 0 & 0\\\\\\frac{G M}{r \\left(- 2 G M + c^{2} r\\right)} & 0 & 0 & 0\\\\0 & 0 & 0 & 0\\\\0 & 0 & 0 & 0\\end{array}\\right] & \\left[\\begin{array}{}\\frac{G M \\left(- 2 G M + c^{2} r\\right)}{c^{4} r^{3}} & 0 & 0 & 0\\\\0 & \\frac{G M}{r \\left(2 G M - c^{2} r\\right)} & 0 & 0\\\\0 & 0 & \\frac{2 G M}{c^{2}} - r & 0\\\\0 & 0 & 0 & \\frac{\\left(2 G M - c^{2} r\\right) {\\sin{\\left (\\theta \\right )}}^{2}}{c^{2}}\\end{array}\\right] & \\left[\\begin{array}{}0 & 0 & 0 & 0\\\\0 & 0 & \\frac{1}{r} & 0\\\\0 & \\frac{1}{r} & 0 & 0\\\\0 & 0 & 0 & - \\frac{\\sin{\\left (2 \\theta \\right )}}{2}\\end{array}\\right] & \\left[\\begin{array}{}0 & 0 & 0 & 0\\\\0 & 0 & 0 & \\frac{1}{r}\\\\0 & 0 & 0 & \\frac{1}{\\tan{\\left (\\theta \\right )}}\\\\0 & \\frac{1}{r} & \\frac{1}{\\tan{\\left (\\theta \\right )}} & 0\\end{array}\\right]\\end{array}\\right]\\end{equation*}" ], "text/plain": [ "⎡ ⎡ ⎛ 2 ⎞ ⎤ ⎤\n", "⎢ ⎢G⋅M⋅⎝-2⋅G⋅M + c ⋅r⎠ ⎥ ⎥\n", "⎢ ⎢─────────────────── 0 0 0 ⎥ ⎥\n", "⎢ ⎢ 4 3 ⎥ ⎥\n", "⎢⎡ G⋅M ⎤ ⎢ c ⋅r ⎥ ⎡0 0 0 0 ⎤ ⎡0 0 0 0 ⎤⎥\n", "⎢⎢ 0 ───────────────── 0 0⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎥\n", "⎢⎢ ⎛ 2 ⎞ ⎥ ⎢ G⋅M ⎥ ⎢ 1 ⎥ ⎢ 1 ⎥⎥\n", "⎢⎢ r⋅⎝-2⋅G⋅M + c ⋅r⎠ ⎥ ⎢ 0 ──────────────── 0 0 ⎥ ⎢0 0 ─ 0 ⎥ ⎢0 0 0 ─ ⎥⎥\n", "⎢⎢ ⎥ ⎢ ⎛ 2 ⎞ ⎥ ⎢ r ⎥ ⎢ r ⎥⎥\n", "⎢⎢ G⋅M ⎥ ⎢ r⋅⎝2⋅G⋅M - c ⋅r⎠ ⎥ ⎢ ⎥ ⎢ ⎥⎥\n", "⎢⎢───────────────── 0 0 0⎥ ⎢ ⎥ ⎢ 1 ⎥ ⎢ 1 ⎥⎥\n", "⎢⎢ ⎛ 2 ⎞ ⎥ ⎢ 2⋅G⋅M ⎥ ⎢0 ─ 0 0 ⎥ ⎢0 0 0 ──────⎥⎥\n", "⎢⎢r⋅⎝-2⋅G⋅M + c ⋅r⎠ ⎥ ⎢ 0 0 ───── - r 0 ⎥ ⎢ r ⎥ ⎢ tan(θ)⎥⎥\n", "⎢⎢ ⎥ ⎢ 2 ⎥ ⎢ ⎥ ⎢ ⎥⎥\n", "⎢⎢ 0 0 0 0⎥ ⎢ c ⎥ ⎢ -sin(2⋅θ) ⎥ ⎢ 1 1 ⎥⎥\n", "⎢⎢ ⎥ ⎢ ⎥ ⎢0 0 0 ──────────⎥ ⎢0 ─ ────── 0 ⎥⎥\n", "⎢⎣ 0 0 0 0⎦ ⎢ ⎛ 2 ⎞ 2 ⎥ ⎣ 2 ⎦ ⎣ r tan(θ) ⎦⎥\n", "⎢ ⎢ ⎝2⋅G⋅M - c ⋅r⎠⋅sin (θ)⎥ ⎥\n", "⎢ ⎢ 0 0 0 ──────────────────────⎥ ⎥\n", "⎢ ⎢ 2 ⎥ ⎥\n", "⎣ ⎣ c ⎦ ⎦" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "show_christoffel_symbols(schwarzschild)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "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.11.8" } }, "nbformat": 4, "nbformat_minor": 4 }