{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Light cone in Minkowski spacetime" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": true }, "outputs": [], "source": [ "%display latex" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "4-dimensional differentiable manifold M\n" ] } ], "source": [ "M = Manifold(4, 'M')\n", "print(M)" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "Chart (M, (t, x, y, z))" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "X. = M.chart()\n", "X" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "g = -dt*dt + dx*dx + dy*dy + dz*dz" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "g = M.lorentzian_metric('g')\n", "g[0,0], g[1,1], g[2,2], g[3,3] = -1, 1, 1, 1\n", "g.display()" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "u: M --> R\n", " (t, x, y, z) |--> t - sqrt(x^2 + y^2 + z^2)" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "u = M.scalar_field(coord_expression={X: t-sqrt(x^2+y^2+z^2)}, name='u')\n", "u.display()" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "du = dt - x/sqrt(x^2 + y^2 + z^2) dx - y/sqrt(x^2 + y^2 + z^2) dy - z/sqrt(x^2 + y^2 + z^2) dz" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "du = u.differential()\n", "du.display()" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Vector field l on the 4-dimensional differentiable manifold M\n" ] }, { "data": { "text/html": [ "" ], "text/plain": [ "l = d/dt + x/sqrt(x^2 + y^2 + z^2) d/dx + y/sqrt(x^2 + y^2 + z^2) d/dy + z/sqrt(x^2 + y^2 + z^2) d/dz" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "l = - du.up(g)\n", "l.set_name('l', latex_name=r'\\ell')\n", "print(l)\n", "l.display()" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "0" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "g(l,l).expr()" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Levi-Civita connection nabla_g associated with the Lorentzian metric g on the 4-dimensional differentiable manifold M\n" ] } ], "source": [ "nab = g.connection()\n", "print(nab)" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Tensor field nabla_g(l) of type (1,1) on the 4-dimensional differentiable manifold M\n" ] }, { "data": { "text/html": [ "" ], "text/plain": [ "nabla_g(l) = sqrt(x^2 + y^2 + z^2)*(y^2 + z^2)/(x^4 + 2*x^2*y^2 + y^4 + z^4 + 2*(x^2 + y^2)*z^2) d/dx*dx - x*y/(x^2 + y^2 + z^2)^(3/2) d/dx*dy - x*z/(x^2 + y^2 + z^2)^(3/2) d/dx*dz - x*y/(x^2 + y^2 + z^2)^(3/2) d/dy*dx + sqrt(x^2 + y^2 + z^2)*(x^2 + z^2)/(x^4 + 2*x^2*y^2 + y^4 + z^4 + 2*(x^2 + y^2)*z^2) d/dy*dy - y*z/(x^2 + y^2 + z^2)^(3/2) d/dy*dz - x*z/(x^2 + y^2 + z^2)^(3/2) d/dz*dx - y*z/(x^2 + y^2 + z^2)^(3/2) d/dz*dy + sqrt(x^2 + y^2 + z^2)*(x^2 + y^2)/(x^4 + 2*x^2*y^2 + y^4 + z^4 + 2*(x^2 + y^2)*z^2) d/dz*dz" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "nab_l = nab(l)\n", "print(nab_l)\n", "nab_l.display()" ] }, { "cell_type": "code", "execution_count": 11, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "[ 0 0 0 0]\n", "[ 0 sqrt(x^2 + y^2 + z^2)*(y^2 + z^2)/(x^4 + 2*x^2*y^2 + y^4 + z^4 + 2*(x^2 + y^2)*z^2) -x*y/(x^2 + y^2 + z^2)^(3/2) -x*z/(x^2 + y^2 + z^2)^(3/2)]\n", "[ 0 -x*y/(x^2 + y^2 + z^2)^(3/2) sqrt(x^2 + y^2 + z^2)*(x^2 + z^2)/(x^4 + 2*x^2*y^2 + y^4 + z^4 + 2*(x^2 + y^2)*z^2) -y*z/(x^2 + y^2 + z^2)^(3/2)]\n", "[ 0 -x*z/(x^2 + y^2 + z^2)^(3/2) -y*z/(x^2 + y^2 + z^2)^(3/2) sqrt(x^2 + y^2 + z^2)*(x^2 + y^2)/(x^4 + 2*x^2*y^2 + y^4 + z^4 + 2*(x^2 + y^2)*z^2)]" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "nab_l[:]" ] }, { "cell_type": "code", "execution_count": 12, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "[ 0 0 0 0]\n", "[ 0 (y^2 + z^2)/(x^2 + y^2 + z^2)^(3/2) -x*y/(x^2 + y^2 + z^2)^(3/2) -x*z/(x^2 + y^2 + z^2)^(3/2)]\n", "[ 0 -x*y/(x^2 + y^2 + z^2)^(3/2) (x^2 + z^2)/(x^2 + y^2 + z^2)^(3/2) -y*z/(x^2 + y^2 + z^2)^(3/2)]\n", "[ 0 -x*z/(x^2 + y^2 + z^2)^(3/2) -y*z/(x^2 + y^2 + z^2)^(3/2) (x^2 + y^2)/(x^2 + y^2 + z^2)^(3/2)]" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "for i in [1..3]:\n", " nab_l[i,i].factor()\n", "nab_l[:]" ] }, { "cell_type": "code", "execution_count": 13, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Vector field on the 4-dimensional differentiable manifold M\n" ] }, { "data": { "text/html": [ "" ], "text/plain": [ "0" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "acc_l = l['^m']*nab_l['^a_m']\n", "print(acc_l)\n", "acc_l.display()" ] }, { "cell_type": "code", "execution_count": 14, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "k = 1/2 d/dt - 1/2*x/sqrt(x^2 + y^2 + z^2) d/dx - 1/2*y/sqrt(x^2 + y^2 + z^2) d/dy - 1/2*z/sqrt(x^2 + y^2 + z^2) d/dz" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "k = M.vector_field(name='k')\n", "r = sqrt(x^2+y^2+z^2)\n", "k[:] = [1/2, -x/(2*r), -y/(2*r), -z/(2*r)]\n", "k.display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let us check that $k$ is a null vector:" ] }, { "cell_type": "code", "execution_count": 15, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "0" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "g(k,k).expr()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "and that it obeys $k\\cdot\\ell=-1$:" ] }, { "cell_type": "code", "execution_count": 16, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "-1" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "g(k,l).expr()" ] }, { "cell_type": "code", "execution_count": 19, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "1-form lf on the 4-dimensional differentiable manifold M\n" ] }, { "data": { "text/html": [ "" ], "text/plain": [ "lf = -dt + x/sqrt(x^2 + y^2 + z^2) dx + y/sqrt(x^2 + y^2 + z^2) dy + z/sqrt(x^2 + y^2 + z^2) dz" ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "l_form = l.down(g)\n", "l_form.set_name('lf', latex_name=r'\\underline{\\ell}')\n", "print(l_form)\n", "l_form.display()" ] }, { "cell_type": "code", "execution_count": 20, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "1-form kf on the 4-dimensional differentiable manifold M\n" ] }, { "data": { "text/html": [ "" ], "text/plain": [ "kf = -1/2 dt - 1/2*x/sqrt(x^2 + y^2 + z^2) dx - 1/2*y/sqrt(x^2 + y^2 + z^2) dy - 1/2*z/sqrt(x^2 + y^2 + z^2) dz" ] }, "execution_count": 20, "metadata": {}, "output_type": "execute_result" } ], "source": [ "k_form = k.down(g)\n", "k_form.set_name('kf', latex_name=r'\\underline{k}')\n", "print(k_form)\n", "k_form.display()" ] }, { "cell_type": "code", "execution_count": 22, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Tensor field q of type (0,2) on the 4-dimensional differentiable manifold M\n" ] } ], "source": [ "q = g + l_form*k_form + k_form*l_form\n", "q.set_name('q')\n", "print q" ] }, { "cell_type": "code", "execution_count": 23, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "True" ] }, "execution_count": 23, "metadata": {}, "output_type": "execute_result" } ], "source": [ "q == q.symmetrize()" ] }, { "cell_type": "code", "execution_count": 25, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Field of symmetric bilinear forms q on the 4-dimensional differentiable manifold M\n" ] } ], "source": [ "q = q.symmetrize()\n", "q.set_name('q')\n", "print q" ] }, { "cell_type": "code", "execution_count": 26, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "[ 0 0 0 0]\n", "[ 0 (y^2 + z^2)/(x^2 + y^2 + z^2) -x*y/(x^2 + y^2 + z^2) -x*z/(x^2 + y^2 + z^2)]\n", "[ 0 -x*y/(x^2 + y^2 + z^2) (x^2 + z^2)/(x^2 + y^2 + z^2) -y*z/(x^2 + y^2 + z^2)]\n", "[ 0 -x*z/(x^2 + y^2 + z^2) -y*z/(x^2 + y^2 + z^2) (x^2 + y^2)/(x^2 + y^2 + z^2)]" ] }, "execution_count": 26, "metadata": {}, "output_type": "execute_result" } ], "source": [ "q[:]" ] }, { "cell_type": "code", "execution_count": 28, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "True" ] }, "execution_count": 28, "metadata": {}, "output_type": "execute_result" } ], "source": [ "nab(l_form) == (1/r) * q" ] }, { "cell_type": "code", "execution_count": 38, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "0" ] }, "execution_count": 38, "metadata": {}, "output_type": "execute_result" } ], "source": [ "q(l,l).expr()" ] }, { "cell_type": "code", "execution_count": 39, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "0" ] }, "execution_count": 39, "metadata": {}, "output_type": "execute_result" } ], "source": [ "q(l,k).expr()" ] }, { "cell_type": "code", "execution_count": 40, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "0" ] }, "execution_count": 40, "metadata": {}, "output_type": "execute_result" } ], "source": [ "q(k,k).expr()" ] }, { "cell_type": "code", "execution_count": 41, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "Chart (M, (t, r, th, ph))" ] }, "execution_count": 41, "metadata": {}, "output_type": "execute_result" } ], "source": [ "XS. = M.chart(r't r:(0,+oo) th:(0,pi):\\theta ph:(0,2*pi):\\phi')\n", "XS" ] }, { "cell_type": "code", "execution_count": 42, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "t = t\n", "x = r*cos(ph)*sin(th)\n", "y = r*sin(ph)*sin(th)\n", "z = r*cos(th)" ] }, "execution_count": 42, "metadata": {}, "output_type": "execute_result" } ], "source": [ "spher_to_cart = XS.transition_map(X, [t, r*sin(th)*cos(ph), r*sin(th)*sin(ph), r*cos(th)])\n", "spher_to_cart.display()" ] }, { "cell_type": "code", "execution_count": 43, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Check of the inverse coordinate transformation:\n", " t == t\n", " r == r\n", " th == arctan2(r*sin(th), r*cos(th))\n", " ph == arctan2(r*sin(ph)*sin(th), r*cos(ph)*sin(th))\n", " t == t\n", " x == x\n", " y == y\n", " z == z\n" ] } ], "source": [ "spher_to_cart.set_inverse(t, sqrt(x^2+y^2+z^2), atan2(sqrt(x^2+y^2),z), atan2(y, x))" ] }, { "cell_type": "code", "execution_count": 44, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "q = r^2 dth*dth + r^2*sin(th)^2 dph*dph" ] }, "execution_count": 44, "metadata": {}, "output_type": "execute_result" } ], "source": [ "q.display(XS.frame(), XS)" ] }, { "cell_type": "code", "execution_count": 45, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "[ 0 0 0 0]\n", "[ 0 0 0 0]\n", "[ 0 0 r^2 0]\n", "[ 0 0 0 r^2*sin(th)^2]" ] }, "execution_count": 45, "metadata": {}, "output_type": "execute_result" } ], "source": [ "q[XS.frame(),:,XS]" ] }, { "cell_type": "code", "execution_count": 46, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "n = d/dt" ] }, "execution_count": 46, "metadata": {}, "output_type": "execute_result" } ], "source": [ "n = 1/2*l + k \n", "n.set_name('n')\n", "n.display()" ] }, { "cell_type": "code", "execution_count": 47, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "s = x/sqrt(x^2 + y^2 + z^2) d/dx + y/sqrt(x^2 + y^2 + z^2) d/dy + z/sqrt(x^2 + y^2 + z^2) d/dz" ] }, "execution_count": 47, "metadata": {}, "output_type": "execute_result" } ], "source": [ "s = 1/2*l - k\n", "s.set_name('s')\n", "s.display()" ] }, { "cell_type": "code", "execution_count": 48, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "s = d/dr" ] }, "execution_count": 48, "metadata": {}, "output_type": "execute_result" } ], "source": [ "s.display(XS.frame())" ] }, { "cell_type": "code", "execution_count": 50, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Tensor field of type (2,0) on the 4-dimensional differentiable manifold M\n" ] } ], "source": [ "q_up = q.up(g)\n", "print q_up" ] }, { "cell_type": "code", "execution_count": 58, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Scalar field on the 4-dimensional differentiable manifold M\n" ] } ], "source": [ "theta_l = 1/2 * q_up.contract(0,1, q.lie_der(l), 0,1)\n", "print theta_l" ] }, { "cell_type": "code", "execution_count": 59, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "2/sqrt(x^2 + y^2 + z^2)" ] }, "execution_count": 59, "metadata": {}, "output_type": "execute_result" } ], "source": [ "theta_l.expr()" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Sage 6.9", "language": "", "name": "sage_6_9" }, "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.9" } }, "nbformat": 4, "nbformat_minor": 0 }