{ "metadata": { "name": "schwarzschild" }, "nbformat": 3, "worksheets": [ { "cells": [ { "cell_type": "markdown", "source": [ "# Schwarzschild Solution to the Einstein's equation" ] }, { "cell_type": "markdown", "source": [ "We will rederive the equations from *General Theory of Relativity*, chapter 18, by Dirac. They describe a spherically symetric solution to the Einstein's equation in vacuum.", "", "We will not try to solve the resulting equations.", "", "This verion of the notebook uses funtions that explicitly calculate the Christoffel symbols, hence the work is coordinate-system-dependent." ] }, { "cell_type": "markdown", "source": [ "Import the necessary modules." ] }, { "cell_type": "code", "input": [ "from sympy.diffgeom import *", "TP = TensorProduct" ], "language": "python", "outputs": [], "prompt_number": 1 }, { "cell_type": "markdown", "source": [ "Define a 4D manifold with a patch and a coordinate chart on which we will work." ] }, { "cell_type": "code", "input": [ "m = Manifold('Schwarzschild', 4)", "p = Patch('origin', m)", "cs = CoordSystem('spherical', p, ['t', 'r', 'theta', 'phi'])" ], "language": "python", "outputs": [], "prompt_number": 2 }, { "cell_type": "code", "input": [ "m, p, cs" ], "language": "python", "outputs": [ { "latex": [ "$$\\begin{pmatrix}\\mathbb{Schwarzschild}, & \\mathrm{origin}_{\\mathbb{Schwarzschild}}, & \\mathrm{spherical}^{\\mathrm{origin}}_{\\mathbb{Schwarzschild}}\\end{pmatrix}$$" ], "output_type": "pyout", "prompt_number": 3, "text": [ "(Manifold(Schwarzschild, 4),", " Patch(origin, Manifold(Schwarzschild, 4)),", " CoordSystem(spherical, Patch(origin, Manifold(Schwarzschild, 4))))" ] } ], "prompt_number": 3 }, { "cell_type": "markdown", "source": [ "Prepare the variables containing the scalar fields and the 1-form fields." ] }, { "cell_type": "code", "input": [ "t, r, theta, phi = cs.coord_functions()", "t, r, theta, phi" ], "language": "python", "outputs": [ { "latex": [ "$$\\begin{pmatrix}\\boldsymbol{\\mathrm{t}}, & \\boldsymbol{\\mathrm{r}}, & \\boldsymbol{\\mathrm{\\theta}}, & \\boldsymbol{\\mathrm{\\phi}}\\end{pmatrix}$$" ], "output_type": "pyout", "prompt_number": 4, "text": [ "(t, r, \u03b8, \u03c6)" ] } ], "prompt_number": 4 }, { "cell_type": "code", "input": [ "dt, dr, dtheta, dphi = cs.base_oneforms()", "dt, dr, dtheta, dphi" ], "language": "python", "outputs": [ { "latex": [ "$$\\begin{pmatrix}\\mathbb{d}t, & \\mathbb{d}r, & \\mathbb{d}\\theta, & \\mathbb{d}\\phi\\end{pmatrix}$$" ], "output_type": "pyout", "prompt_number": 5, "text": [ "(\u2146 t, \u2146 r, \u2146 \u03b8, \u2146 \u03c6)" ] } ], "prompt_number": 5 }, { "cell_type": "markdown", "source": [ "The most general spherically-symmetric metric has the following form." ] }, { "cell_type": "code", "input": [ "metric = exp(2*f(r))*TP(dt, dt) - exp(2*g(r))*TP(dr, dr) - r**2*TP(dtheta, dtheta) - r**2*sin(theta)**2*TP(dphi, dphi)", "metric" ], "language": "python", "outputs": [ { "latex": [ "$$e^{2 \\operatorname{f}{\\left (\\boldsymbol{\\mathrm{r}} \\right )}} \\mathbb{d}t\\otimes\\mathbb{d}t - e^{2 \\operatorname{g}{\\left (\\boldsymbol{\\mathrm{r}} \\right )}} \\mathbb{d}r\\otimes\\mathbb{d}r - \\left(\\boldsymbol{\\mathrm{r}}\\right)^{2} \\sin^{2}{\\left (\\boldsymbol{\\mathrm{\\theta}} \\right )} \\mathbb{d}\\phi\\otimes\\mathbb{d}\\phi - \\left(\\boldsymbol{\\mathrm{r}}\\right)^{2} \\mathbb{d}\\theta\\otimes\\mathbb{d}\\theta$$" ], "output_type": "pyout", "prompt_number": 6, "text": [ "", " 2\u22c5f(r) 2\u22c5g(r) 2 2 ", "\u212f \u22c5TensorProduct(dt, dt) - \u212f \u22c5TensorProduct(dr, dr) - r \u22c5sin (\u03b8)\u22c5Ten", "", " 2 ", "sorProduct(dphi, dphi) - r \u22c5TensorProduct(dtheta, dtheta)" ] } ], "prompt_number": 6 }, { "cell_type": "markdown", "source": [ "The matrix $M$ representing the two-form as a bilinear map $V,U\\to V^tMU$ over the column vectors $V$ and $U$ in the canonical basis of the choosen coordinate system is:" ] }, { "cell_type": "code", "input": [ "twoform_to_matrix(metric)" ], "language": "python", "outputs": [ { "latex": [ "$$\\left[\\begin{smallmatrix}e^{2 \\operatorname{f}{\\left (\\boldsymbol{\\mathrm{r}} \\right )}} & 0 & 0 & 0\\\\0 & - e^{2 \\operatorname{g}{\\left (\\boldsymbol{\\mathrm{r}} \\right )}} & 0 & 0\\\\0 & 0 & - \\left(\\boldsymbol{\\mathrm{r}}\\right)^{2} & 0\\\\0 & 0 & 0 & - \\left(\\boldsymbol{\\mathrm{r}}\\right)^{2} \\sin^{2}{\\left (\\boldsymbol{\\mathrm{\\theta}} \\right )}\\end{smallmatrix}\\right]$$" ], "output_type": "pyout", "prompt_number": 7, "text": [ "", "\u23a1 2\u22c5f(r) \u23a4", "\u23a2\u212f 0 0 0 \u23a5", "\u23a2 \u23a5", "\u23a2 2\u22c5g(r) \u23a5", "\u23a2 0 -\u212f 0 0 \u23a5", "\u23a2 \u23a5", "\u23a2 2 \u23a5", "\u23a2 0 0 -r 0 \u23a5", "\u23a2 \u23a5", "\u23a2 2 2 \u23a5", "\u23a3 0 0 0 -r \u22c5sin (\u03b8)\u23a6" ] } ], "prompt_number": 7 }, { "cell_type": "markdown", "source": [ "Now we will calculate the components in the same basis of the Ricci tensor." ] }, { "cell_type": "code", "input": [ "ricci = metric_to_Ricci_components(metric)" ], "language": "python", "outputs": [], "prompt_number": 8 }, { "cell_type": "code", "input": [ "# TODO: Fix the issue requiring this workaround (simplify unhappy about the fields)", "diffgeom_simplify = lambda a: a.subs(zip(cs.coord_functions(), cs._dummies)).simplify().subs(zip(cs._dummies, cs.coord_functions()))", "ricci = [[diffgeom_simplify(ricci[i][j])", " for j in range(4)] for i in range(4)]", "" ], "language": "python", "outputs": [], "prompt_number": 9 }, { "cell_type": "markdown", "source": [ "The diagonal components give the equations we are interested in." ] }, { "cell_type": "code", "input": [ "ricci[0][0]" ], "language": "python", "outputs": [ { "latex": [ "$$\\left(\\boldsymbol{\\mathrm{r}}\\right)^{-1} \\left(\\left(\\left. \\frac{\\partial}{\\partial \\xi_{1}} \\operatorname{f}{\\left (\\xi_{1} \\right )} \\right|_{\\substack{ \\xi_{1}=\\boldsymbol{\\mathrm{r}} }}\\right)^{2} \\boldsymbol{\\mathrm{r}} - \\left. \\frac{\\partial}{\\partial \\xi_{1}} \\operatorname{f}{\\left (\\xi_{1} \\right )} \\right|_{\\substack{ \\xi_{1}=\\boldsymbol{\\mathrm{r}} }} \\left. \\frac{\\partial}{\\partial \\xi_{1}} \\operatorname{g}{\\left (\\xi_{1} \\right )} \\right|_{\\substack{ \\xi_{1}=\\boldsymbol{\\mathrm{r}} }} \\boldsymbol{\\mathrm{r}} + 2 \\left. \\frac{\\partial}{\\partial \\xi_{1}} \\operatorname{f}{\\left (\\xi_{1} \\right )} \\right|_{\\substack{ \\xi_{1}=\\boldsymbol{\\mathrm{r}} }} + \\left. \\frac{\\partial^{2}}{\\partial^{2} \\xi_{1}} \\operatorname{f}{\\left (\\xi_{1} \\right )} \\right|_{\\substack{ \\xi_{1}=\\boldsymbol{\\mathrm{r}} }} \\boldsymbol{\\mathrm{r}}\\right) e^{2 \\operatorname{f}{\\left (\\boldsymbol{\\mathrm{r}} \\right )} - 2 \\operatorname{g}{\\left (\\boldsymbol{\\mathrm{r}} \\right )}}$$" ], "output_type": "pyout", "prompt_number": 10, "text": [ "", " \u239b 2 ", " -1 \u239c\u239b d \u239e\u2502 \u239b d \u239e\u2502 \u239b d \u239e\u2502 \u239b d ", "r \u22c5\u239c\u239c\u2500\u2500\u2500(f(\u03be\u2081))\u239f\u2502 \u22c5r - \u239c\u2500\u2500\u2500(f(\u03be\u2081))\u239f\u2502 \u22c5\u239c\u2500\u2500\u2500(g(\u03be\u2081))\u239f\u2502 \u22c5r + 2\u22c5\u239c\u2500\u2500\u2500(f(\u03be", " \u239c\u239dd\u03be\u2081 \u23a0\u2502\u03be\u2081=r \u239dd\u03be\u2081 \u23a0\u2502\u03be\u2081=r \u239dd\u03be\u2081 \u23a0\u2502\u03be\u2081=r \u239dd\u03be\u2081 ", " \u239d ", "", " \u239b 2 \u239e\u2502 \u239e ", " \u239e\u2502 \u239c d \u239f\u2502 \u239f 2\u22c5f(r) - 2\u22c5g(r)", "\u2081))\u239f\u2502 + \u239c\u2500\u2500\u2500\u2500(f(\u03be\u2081))\u239f\u2502 \u22c5r\u239f\u22c5\u212f ", " \u23a0\u2502\u03be\u2081=r \u239c 2 \u239f\u2502 \u239f ", " \u239dd\u03be\u2081 \u23a0\u2502\u03be\u2081=r \u23a0 " ] } ], "prompt_number": 10 }, { "cell_type": "code", "input": [ "ricci[1][1]" ], "language": "python", "outputs": [ { "latex": [ "$$- \\left(\\boldsymbol{\\mathrm{r}}\\right)^{-1} \\left(\\left(\\left(\\left. \\frac{\\partial}{\\partial \\xi_{1}} \\operatorname{f}{\\left (\\xi_{1} \\right )} \\right|_{\\substack{ \\xi_{1}=\\boldsymbol{\\mathrm{r}} }}\\right)^{2} - \\left. \\frac{\\partial}{\\partial \\xi_{1}} \\operatorname{f}{\\left (\\xi_{1} \\right )} \\right|_{\\substack{ \\xi_{1}=\\boldsymbol{\\mathrm{r}} }} \\left. \\frac{\\partial}{\\partial \\xi_{1}} \\operatorname{g}{\\left (\\xi_{1} \\right )} \\right|_{\\substack{ \\xi_{1}=\\boldsymbol{\\mathrm{r}} }} + \\left. \\frac{\\partial^{2}}{\\partial^{2} \\xi_{1}} \\operatorname{f}{\\left (\\xi_{1} \\right )} \\right|_{\\substack{ \\xi_{1}=\\boldsymbol{\\mathrm{r}} }}\\right) \\boldsymbol{\\mathrm{r}} - 2 \\left. \\frac{\\partial}{\\partial \\xi_{1}} \\operatorname{g}{\\left (\\xi_{1} \\right )} \\right|_{\\substack{ \\xi_{1}=\\boldsymbol{\\mathrm{r}} }}\\right)$$" ], "output_type": "pyout", "prompt_number": 11, "text": [ "", " \u239b\u239b 2 \u239b 2 ", " -1 \u239c\u239c\u239b d \u239e\u2502 \u239b d \u239e\u2502 \u239b d \u239e\u2502 \u239c d ", "-r \u22c5\u239c\u239c\u239c\u2500\u2500\u2500(f(\u03be\u2081))\u239f\u2502 - \u239c\u2500\u2500\u2500(f(\u03be\u2081))\u239f\u2502 \u22c5\u239c\u2500\u2500\u2500(g(\u03be\u2081))\u239f\u2502 + \u239c\u2500\u2500\u2500\u2500(f(\u03be\u2081))", " \u239c\u239c\u239dd\u03be\u2081 \u23a0\u2502\u03be\u2081=r \u239dd\u03be\u2081 \u23a0\u2502\u03be\u2081=r \u239dd\u03be\u2081 \u23a0\u2502\u03be\u2081=r \u239c 2 ", " \u239d\u239d \u239dd\u03be\u2081 ", "", "\u239e\u2502 \u239e \u239e", "\u239f\u2502 \u239f \u239b d \u239e\u2502 \u239f", "\u239f\u2502 \u239f\u22c5r - 2\u22c5\u239c\u2500\u2500\u2500(g(\u03be\u2081))\u239f\u2502 \u239f", "\u239f\u2502 \u239f \u239dd\u03be\u2081 \u23a0\u2502\u03be\u2081=r\u239f", "\u23a0\u2502\u03be\u2081=r\u23a0 \u23a0" ] } ], "prompt_number": 11 }, { "cell_type": "code", "input": [ "ricci[2][2]" ], "language": "python", "outputs": [ { "latex": [ "$$\\left(- \\left. \\frac{\\partial}{\\partial \\xi_{1}} \\operatorname{f}{\\left (\\xi_{1} \\right )} \\right|_{\\substack{ \\xi_{1}=\\boldsymbol{\\mathrm{r}} }} \\boldsymbol{\\mathrm{r}} + \\left. \\frac{\\partial}{\\partial \\xi_{1}} \\operatorname{g}{\\left (\\xi_{1} \\right )} \\right|_{\\substack{ \\xi_{1}=\\boldsymbol{\\mathrm{r}} }} \\boldsymbol{\\mathrm{r}} -1 + e^{2 \\operatorname{g}{\\left (\\boldsymbol{\\mathrm{r}} \\right )}}\\right) e^{- 2 \\operatorname{g}{\\left (\\boldsymbol{\\mathrm{r}} \\right )}}$$" ], "output_type": "pyout", "prompt_number": 12, "text": [ "", "\u239b \u239b d \u239e\u2502 \u239b d \u239e\u2502 2\u22c5g(r)\u239e -2\u22c5g(r)", "\u239c- \u239c\u2500\u2500\u2500(f(\u03be\u2081))\u239f\u2502 \u22c5r + \u239c\u2500\u2500\u2500(g(\u03be\u2081))\u239f\u2502 \u22c5r - 1 + \u212f \u239f\u22c5\u212f ", "\u239d \u239dd\u03be\u2081 \u23a0\u2502\u03be\u2081=r \u239dd\u03be\u2081 \u23a0\u2502\u03be\u2081=r \u23a0 " ] } ], "prompt_number": 12 }, { "cell_type": "code", "input": [ "ricci[3][3]" ], "language": "python", "outputs": [ { "latex": [ "$$\\sin^{2}{\\left (\\boldsymbol{\\mathrm{\\theta}} \\right )} \\left(- \\left. \\frac{\\partial}{\\partial \\xi_{1}} \\operatorname{f}{\\left (\\xi_{1} \\right )} \\right|_{\\substack{ \\xi_{1}=\\boldsymbol{\\mathrm{r}} }} \\boldsymbol{\\mathrm{r}} + \\left. \\frac{\\partial}{\\partial \\xi_{1}} \\operatorname{g}{\\left (\\xi_{1} \\right )} \\right|_{\\substack{ \\xi_{1}=\\boldsymbol{\\mathrm{r}} }} \\boldsymbol{\\mathrm{r}} -1 + e^{2 \\operatorname{g}{\\left (\\boldsymbol{\\mathrm{r}} \\right )}}\\right) e^{- 2 \\operatorname{g}{\\left (\\boldsymbol{\\mathrm{r}} \\right )}}$$" ], "output_type": "pyout", "prompt_number": 13, "text": [ "", " 2 \u239b \u239b d \u239e\u2502 \u239b d \u239e\u2502 2\u22c5g(r)\u239e -2\u22c5g(r)", "sin (\u03b8)\u22c5\u239c- \u239c\u2500\u2500\u2500(f(\u03be\u2081))\u239f\u2502 \u22c5r + \u239c\u2500\u2500\u2500(g(\u03be\u2081))\u239f\u2502 \u22c5r - 1 + \u212f \u239f\u22c5\u212f ", " \u239d \u239dd\u03be\u2081 \u23a0\u2502\u03be\u2081=r \u239dd\u03be\u2081 \u23a0\u2502\u03be\u2081=r \u23a0 " ] } ], "prompt_number": 13 }, { "cell_type": "markdown", "source": [ "The off-diagonal components are zero." ] }, { "cell_type": "code", "input": [ "all(ricci[i][j]==0 for i in range(4) for j in range(4) if i!=j)" ], "language": "python", "outputs": [ { "output_type": "pyout", "png": "iVBORw0KGgoAAAANSUhEUgAAACsAAAASCAYAAADCKCelAAAABHNCSVQICAgIfAhkiAAAAjJJREFU\nSInt1Vtoz2EYB/DPThiNslIa0syFHNpKc8qiqU2Klhs3oiV3SOLKhQuUQ9wop5Q55UJJEW7YyI0i\nFE3LULhgKdzMqbl437/99vM/JG0lvjfv7/d9n8P3fXre5+UvQlHieyYe4hMe4yPK0YAvuI1vkatD\nBSrxfgj1/sQuHMaIBDcdfTiRsp2Md0Mjqx+lie9aLMf3BNcQ1xspvxe4M3iysqM4rnVoN1Ao/WJv\npfgi9AyerPxYhvFZ+Nd4noUfiVWDqug3USP0a1uWvZU4hEuC8DXYg7OojzZTos1lvx5sI67lyFuL\nYzHeAZwSLnNetEaxrSl+OPbG7y5cwUJhMryMAotxBGXYhEepGPdwOkvOtcJEqkpw27CikNiTUWxN\nim9CC4ahFzsjPxEPsAhLhOrDVVxI+FcII3BdKu48fMWCBFcvFGNcIbHdQs+mMRdjhMvXh1lZbKri\nYaqES9uS2GuOflNTPtfxFvuwHwexHqMLCZ0QA57PY7NDmAhFeWw244PQOhnsxpuUXZlQ7aP5RBXn\n4HONrCQWo0M4VC404SY+p2Jn4lbHtRIlePYnYjty7JcL7dCeLzgm4WnKb7bwdMOWuPYIz3vykcpg\nmtjf2cQWo1F485/kEDFf6MlCYrswNvG/PQp6jhnojHymBZoNbKtGbMUZiY0SXMQooRqZGXtX6Lk2\nnEsEWY0NmCN/G1QLI6wz5jqOpcLE6BYq2xttS4XZWoVXQjHux9z5cvzHv4UfsudwW40c0GcAAAAA\nSUVORK5CYII=\n", "prompt_number": 14, "text": [ "True" ] } ], "prompt_number": 14 }, { "cell_type": "markdown", "source": [ "For completeness we can also check out the Christoffel symbol of 2nd kind. We will print only the non-zero components, and only one of the symmetric components (symmetric in the last two indices)." ] }, { "cell_type": "code", "input": [ "ch_2nd = metric_to_Christoffel_2nd(metric)", "filt = [((i,j,k), diffgeom_simplify(ch_2nd[i][j][k]))", " for i in range(4) for j in range(4) for k in range(j,4)", " if ch_2nd[i][j][k]!=0]" ], "language": "python", "outputs": [], "prompt_number": 15 }, { "cell_type": "code", "input": [ "filt[0:3]" ], "language": "python", "outputs": [ { "latex": [ "$$\\begin{bmatrix}\\begin{pmatrix}\\begin{pmatrix}0, & 0, & 1\\end{pmatrix}, & \\left. \\frac{\\partial}{\\partial \\xi_{1}} \\operatorname{f}{\\left (\\xi_{1} \\right )} \\right|_{\\substack{ \\xi_{1}=\\boldsymbol{\\mathrm{r}} }}\\end{pmatrix}, & \\begin{pmatrix}\\begin{pmatrix}1, & 0, & 0\\end{pmatrix}, & \\left. \\frac{\\partial}{\\partial \\xi_{1}} \\operatorname{f}{\\left (\\xi_{1} \\right )} \\right|_{\\substack{ \\xi_{1}=\\boldsymbol{\\mathrm{r}} }} e^{2 \\operatorname{f}{\\left (\\boldsymbol{\\mathrm{r}} \\right )} - 2 \\operatorname{g}{\\left (\\boldsymbol{\\mathrm{r}} \\right )}}\\end{pmatrix}, & \\begin{pmatrix}\\begin{pmatrix}1, & 1, & 1\\end{pmatrix}, & \\left. \\frac{\\partial}{\\partial \\xi_{1}} \\operatorname{g}{\\left (\\xi_{1} \\right )} \\right|_{\\substack{ \\xi_{1}=\\boldsymbol{\\mathrm{r}} }}\\end{pmatrix}\\end{bmatrix}$$" ], "output_type": "pyout", "prompt_number": 16, "text": [ "[((0, 0, 1), ", "\u239b d \u239e\u2502 ", "\u239c\u2500\u2500\u2500(f(\u03be\u2081))\u239f\u2502 ", "\u239dd\u03be\u2081 \u23a0\u2502\u03be\u2081=r),", " ((1, 0, 0),", " ", "\u239b d \u239e\u2502 2\u22c5f(r) - 2\u22c5g(r)", "\u239c\u2500\u2500\u2500(f(\u03be\u2081))\u239f\u2502 \u22c5\u212f ", "\u239dd\u03be\u2081 \u23a0\u2502\u03be\u2081=r ),", " ((1, 1, 1), ", "\u239b d \u239e\u2502 ", "\u239c\u2500\u2500\u2500(g(\u03be\u2081))\u239f\u2502 ", "\u239dd\u03be\u2081 \u23a0\u2502\u03be\u2081=r)]" ] } ], "prompt_number": 16 }, { "cell_type": "code", "input": [ "filt[3:6]" ], "language": "python", "outputs": [ { "latex": [ "$$\\begin{bmatrix}\\begin{pmatrix}\\begin{pmatrix}1, & 2, & 2\\end{pmatrix}, & - \\boldsymbol{\\mathrm{r}} e^{- 2 \\operatorname{g}{\\left (\\boldsymbol{\\mathrm{r}} \\right )}}\\end{pmatrix}, & \\begin{pmatrix}\\begin{pmatrix}1, & 3, & 3\\end{pmatrix}, & - \\sin^{2}{\\left (\\boldsymbol{\\mathrm{\\theta}} \\right )} \\boldsymbol{\\mathrm{r}} e^{- 2 \\operatorname{g}{\\left (\\boldsymbol{\\mathrm{r}} \\right )}}\\end{pmatrix}, & \\begin{pmatrix}\\begin{pmatrix}2, & 1, & 2\\end{pmatrix}, & \\left(\\boldsymbol{\\mathrm{r}}\\right)^{-1}\\end{pmatrix}\\end{bmatrix}$$" ], "output_type": "pyout", "prompt_number": 17, "text": [ "[((1, 2, 2), ", " -2\u22c5g(r)", "-r\u22c5\u212f ),", " ((1, 3, 3), ", " 2 -2\u22c5g(r)", "-sin (\u03b8)\u22c5r\u22c5\u212f ),", " ((2, 1, 2), ", " -1", "r )]" ] } ], "prompt_number": 17 }, { "cell_type": "code", "input": [ "filt[6:9]" ], "language": "python", "outputs": [ { "latex": [ "$$\\begin{bmatrix}\\begin{pmatrix}\\begin{pmatrix}2, & 3, & 3\\end{pmatrix}, & - \\cos{\\left (\\boldsymbol{\\mathrm{\\theta}} \\right )} \\sin{\\left (\\boldsymbol{\\mathrm{\\theta}} \\right )}\\end{pmatrix}, & \\begin{pmatrix}\\begin{pmatrix}3, & 1, & 3\\end{pmatrix}, & \\left(\\boldsymbol{\\mathrm{r}}\\right)^{-1}\\end{pmatrix}, & \\begin{pmatrix}\\begin{pmatrix}3, & 2, & 3\\end{pmatrix}, & \\frac{1}{\\tan{\\left (\\boldsymbol{\\mathrm{\\theta}} \\right )}}\\end{pmatrix}\\end{bmatrix}$$" ], "output_type": "pyout", "prompt_number": 18, "text": [ "[((2, 3, 3), -cos(\u03b8)\u22c5sin(\u03b8)),", " ((3, 1, 3), ", " -1", "r ),", " ((3, 2, 3), ", " -1 ", "tan (\u03b8))]" ] } ], "prompt_number": 18 }, { "cell_type": "markdown", "source": [ "We can also confirm that the Christoffel symbol is symmetric." ] }, { "cell_type": "code", "input": [ "all([ch_2nd[k][i][j] == ch_2nd[k][j][i] for k in range(4) for i in range(4) for j in range(4)])" ], "language": "python", "outputs": [ { "output_type": "pyout", "png": "iVBORw0KGgoAAAANSUhEUgAAACsAAAASCAYAAADCKCelAAAABHNCSVQICAgIfAhkiAAAAjJJREFU\nSInt1Vtoz2EYB/DPThiNslIa0syFHNpKc8qiqU2Klhs3oiV3SOLKhQuUQ9wop5Q55UJJEW7YyI0i\nFE3LULhgKdzMqbl437/99vM/JG0lvjfv7/d9n8P3fXre5+UvQlHieyYe4hMe4yPK0YAvuI1vkatD\nBSrxfgj1/sQuHMaIBDcdfTiRsp2Md0Mjqx+lie9aLMf3BNcQ1xspvxe4M3iysqM4rnVoN1Ao/WJv\npfgi9AyerPxYhvFZ+Nd4noUfiVWDqug3USP0a1uWvZU4hEuC8DXYg7OojzZTos1lvx5sI67lyFuL\nYzHeAZwSLnNetEaxrSl+OPbG7y5cwUJhMryMAotxBGXYhEepGPdwOkvOtcJEqkpw27CikNiTUWxN\nim9CC4ahFzsjPxEPsAhLhOrDVVxI+FcII3BdKu48fMWCBFcvFGNcIbHdQs+mMRdjhMvXh1lZbKri\nYaqES9uS2GuOflNTPtfxFvuwHwexHqMLCZ0QA57PY7NDmAhFeWw244PQOhnsxpuUXZlQ7aP5RBXn\n4HONrCQWo0M4VC404SY+p2Jn4lbHtRIlePYnYjty7JcL7dCeLzgm4WnKb7bwdMOWuPYIz3vykcpg\nmtjf2cQWo1F485/kEDFf6MlCYrswNvG/PQp6jhnojHymBZoNbKtGbMUZiY0SXMQooRqZGXtX6Lk2\nnEsEWY0NmCN/G1QLI6wz5jqOpcLE6BYq2xttS4XZWoVXQjHux9z5cvzHv4UfsudwW40c0GcAAAAA\nSUVORK5CYII=\n", "prompt_number": 19, "text": [ "True" ] } ], "prompt_number": 19 } ] } ] }