{
"cells": [
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"%display latex"
]
},
{
"cell_type": "code",
"execution_count": 5,
"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": 6,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/plain": [
"Chart (M, (t, x, th, ph))"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"X. = M.chart(r't:\\tau x:(0,+oo):\\chi th:(0,pi):\\theta ph:(0,2*pi):\\phi')\n",
"X"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/plain": [
"g = -dt*dt + (-3*sqrt(1/2)*t*sqrt(m_0/xs^3) + 1)^(4/3) dx*dx + (-3*sqrt(1/2)*t*sqrt(m_0/xs^3) + 1)^(4/3)*x^2 dth*dth + (-3*sqrt(1/2)*t*sqrt(m_0/xs^3) + 1)^(4/3)*x^2*sin(th)^2 dph*dph"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"g = M.lorentzian_metric('g')\n",
"m0 = var('m_0', domain='real'); assume(m0>0)\n",
"xs = var('xs', latex_name=r'\\chi_{\\rm s}', domain='real'); assume(xs>0)\n",
"a = (1 - 3*sqrt(m0/(2*xs^3)) * t)^(2/3)\n",
"g[0,0] = -1\n",
"g[1,1] = a^2\n",
"g[2,2] = (a*x)^2\n",
"g[3,3] = (a*x*sin(th))^2\n",
"g.display()"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/plain": [
"g_t,t = -1 \n",
"g_x,x = (-3*sqrt(1/2)*t*sqrt(m_0/xs^3) + 1)^(4/3) \n",
"g_th,th = (-3*sqrt(1/2)*t*sqrt(m_0/xs^3) + 1)^(4/3)*x^2 \n",
"g_ph,ph = (-3*sqrt(1/2)*t*sqrt(m_0/xs^3) + 1)^(4/3)*x^2*sin(th)^2 "
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"g.display_comp()"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Field of symmetric bilinear forms Ric(g) on the 4-dimensional differentiable manifold M\n"
]
}
],
"source": [
"Ric = g.ricci()\n",
"print(Ric)"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/plain": [
"Ric(g)_t,t = -6*m_0/(6*sqrt(2)*sqrt(m_0)*t*xs^(3/2) - 9*m_0*t^2 - 2*xs^3) \n",
"Ric(g)_x,x = 3*2^(2/3)*m_0/((-3*sqrt(2)*sqrt(m_0)*t + 2*xs^(3/2))^(2/3)*xs^2) \n",
"Ric(g)_th,th = 3*2^(2/3)*m_0*x^2/((-3*sqrt(2)*sqrt(m_0)*t + 2*xs^(3/2))^(2/3)*xs^2) \n",
"Ric(g)_ph,ph = 3*2^(2/3)*m_0*x^2*sin(th)^2/((-3*sqrt(2)*sqrt(m_0)*t + 2*xs^(3/2))^(2/3)*xs^2) "
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"Ric.display_comp()"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/plain": [
"Ric(g) = -6*m_0/(6*sqrt(2)*sqrt(m_0)*t*xs^(3/2) - 9*m_0*t^2 - 2*xs^3) dt*dt + 3*2^(2/3)*m_0/((-3*sqrt(2)*sqrt(m_0)*t + 2*xs^(3/2))^(2/3)*xs^2) dx*dx + 3*2^(2/3)*m_0*x^2/((-3*sqrt(2)*sqrt(m_0)*t + 2*xs^(3/2))^(2/3)*xs^2) dth*dth + 3*2^(2/3)*m_0*x^2*sin(th)^2/((-3*sqrt(2)*sqrt(m_0)*t + 2*xs^(3/2))^(2/3)*xs^2) dph*dph"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"Ric.display()"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/plain": [
"-6*m_0/(6*sqrt(2)*sqrt(m_0)*t*xs^(3/2) - 9*m_0*t^2 - 2*xs^3)"
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"Ric[0,0]"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Field of symmetric bilinear forms G on the 4-dimensional differentiable manifold M\n"
]
}
],
"source": [
"G = Ric - 1/2*g.ricci_scalar() * g\n",
"G.set_name('G')\n",
"print(G)"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/plain": [
"G_t,t = -12*m_0/(6*sqrt(2)*sqrt(m_0)*t*xs^(3/2) - 9*m_0*t^2 - 2*xs^3) "
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"G.display_comp()"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/plain": [
"u = d/dt"
]
},
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"u = M.vector_field('u')\n",
"u[0] = 1\n",
"u.display()"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/plain": [
"g(u,u): M --> R\n",
" (t, x, th, ph) |--> -1"
]
},
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"g(u,u).display()"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"1-form on the 4-dimensional differentiable manifold M\n"
]
}
],
"source": [
"u_form = u.down(g)\n",
"print(u_form)"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/plain": [
"-dt"
]
},
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"u_form.display()"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Field of symmetric bilinear forms T on the 4-dimensional differentiable manifold M\n"
]
}
],
"source": [
"rho = function('rho')\n",
"T = rho(t,x)* (u_form * u_form)\n",
"T.set_name('T')\n",
"print(T)"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/plain": [
"T = rho(t, x) dt*dt"
]
},
"execution_count": 21,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"T.display()"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Field of symmetric bilinear forms E on the 4-dimensional differentiable manifold M\n"
]
}
],
"source": [
"E = G - 8*pi*T\n",
"E.set_name('E')\n",
"print(E)"
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/plain": [
"E = -4*(12*sqrt(2)*pi*sqrt(m_0)*t*xs^(3/2)*rho(t, x) - 18*pi*m_0*t^2*rho(t, x) - 4*pi*xs^3*rho(t, x) + 3*m_0)/(6*sqrt(2)*sqrt(m_0)*t*xs^(3/2) - 9*m_0*t^2 - 2*xs^3) dt*dt"
]
},
"execution_count": 23,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"E.display()"
]
},
{
"cell_type": "code",
"execution_count": 24,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/plain": [
"E_t,t = -4*(12*sqrt(2)*pi*sqrt(m_0)*t*xs^(3/2)*rho(t, x) - 18*pi*m_0*t^2*rho(t, x) - 4*pi*xs^3*rho(t, x) + 3*m_0)/(6*sqrt(2)*sqrt(m_0)*t*xs^(3/2) - 9*m_0*t^2 - 2*xs^3) "
]
},
"execution_count": 24,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"E.display_comp()"
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/plain": [
"-4*(12*sqrt(2)*pi*sqrt(m_0)*t*xs^(3/2)*rho(t, x) - 18*pi*m_0*t^2*rho(t, x) - 4*pi*xs^3*rho(t, x) + 3*m_0)/(6*sqrt(2)*sqrt(m_0)*t*xs^(3/2) - 9*m_0*t^2 - 2*xs^3)"
]
},
"execution_count": 25,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"E[0,0]"
]
},
{
"cell_type": "code",
"execution_count": 26,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/plain": [
"12*sqrt(2)*pi*sqrt(m_0)*t*xs^(3/2)*rho(t, x) - 18*pi*m_0*t^2*rho(t, x) - 4*pi*xs^3*rho(t, x) + 3*m_0 == 0"
]
},
"execution_count": 26,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"eq = (-E[0,0]/4).expr().numerator() == 0\n",
"eq"
]
},
{
"cell_type": "code",
"execution_count": 27,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/plain": [
"[rho(t, x) == -3/2*m_0/(6*sqrt(2)*pi*sqrt(m_0)*t*xs^(3/2) - 9*pi*m_0*t^2 - 2*pi*xs^3)]"
]
},
"execution_count": 27,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"solve(eq, rho(t,x))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "SageMath 7.5.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.10"
}
},
"nbformat": 4,
"nbformat_minor": 0
}