%display latex
M = Manifold(4, 'M')
print(M)
4-dimensional differentiable manifold M
X.<t,x,y,z> = M.chart()
X
g = M.lorentzian_metric('g')
g[0,0], g[1,1], g[2,2], g[3,3] = -1, 1, 1, 1
g.display()
u = M.scalar_field(coord_expression={X: t-sqrt(x^2+y^2+z^2)}, name='u')
u.display()
du = u.differential()
du.display()
l = - du.up(g)
l.set_name('l', latex_name=r'\ell')
print(l)
l.display()
Vector field l on the 4-dimensional differentiable manifold M
g(l,l).expr()
nab = g.connection()
print(nab)
Levi-Civita connection nabla_g associated with the Lorentzian metric g on the 4-dimensional differentiable manifold M
nab_l = nab(l)
print(nab_l)
nab_l.display()
Tensor field nabla_g(l) of type (1,1) on the 4-dimensional differentiable manifold M
nab_l[:]
for i in [1..3]:
nab_l[i,i].factor()
nab_l[:]
acc_l = l['^m']*nab_l['^a_m']
print(acc_l)
acc_l.display()
Vector field on the 4-dimensional differentiable manifold M
k = M.vector_field(name='k')
r = sqrt(x^2+y^2+z^2)
k[:] = [1/2, -x/(2*r), -y/(2*r), -z/(2*r)]
k.display()
Let us check that $k$ is a null vector:
g(k,k).expr()
and that it obeys $k\cdot\ell=-1$:
g(k,l).expr()
l_form = l.down(g)
l_form.set_name('lf', latex_name=r'\underline{\ell}')
print(l_form)
l_form.display()
1-form lf on the 4-dimensional differentiable manifold M
k_form = k.down(g)
k_form.set_name('kf', latex_name=r'\underline{k}')
print(k_form)
k_form.display()
1-form kf on the 4-dimensional differentiable manifold M
q = g + l_form*k_form + k_form*l_form
q.set_name('q')
print q
Tensor field q of type (0,2) on the 4-dimensional differentiable manifold M
q == q.symmetrize()
q = q.symmetrize()
q.set_name('q')
print q
Field of symmetric bilinear forms q on the 4-dimensional differentiable manifold M
q[:]
nab(l_form) == (1/r) * q
q(l,l).expr()
q(l,k).expr()
q(k,k).expr()
XS.<t,r,th,ph> = M.chart(r't r:(0,+oo) th:(0,pi):\theta ph:(0,2*pi):\phi')
XS
spher_to_cart = XS.transition_map(X, [t, r*sin(th)*cos(ph), r*sin(th)*sin(ph), r*cos(th)])
spher_to_cart.display()
spher_to_cart.set_inverse(t, sqrt(x^2+y^2+z^2), atan2(sqrt(x^2+y^2),z), atan2(y, x))
Check of the inverse coordinate transformation: t == t r == r th == arctan2(r*sin(th), r*cos(th)) ph == arctan2(r*sin(ph)*sin(th), r*cos(ph)*sin(th)) t == t x == x y == y z == z
q.display(XS.frame(), XS)
q[XS.frame(),:,XS]
n = 1/2*l + k
n.set_name('n')
n.display()
s = 1/2*l - k
s.set_name('s')
s.display()
s.display(XS.frame())
q_up = q.up(g)
print q_up
Tensor field of type (2,0) on the 4-dimensional differentiable manifold M
theta_l = 1/2 * q_up.contract(0,1, q.lie_der(l), 0,1)
print theta_l
Scalar field on the 4-dimensional differentiable manifold M
theta_l.expr()