%display latex
We introduce the Schwarzschild spacetime (which represents a static black hole in general relativity) as a 4-dimensional Lorentzian manifold $M$ and we endow it with the chart $X$ of standard Schwarzschild coordinates $(t,r,\theta,\phi)$:
M = Manifold(4, 'M', structure='Lorentzian')
X.<t, r, th, ph> = M.chart(r"t r:(0,+oo) th:(0,pi):\theta ph:(0,2*pi):\phi")
M.atlas()
We define next the metric tensor $g$ from its non-vanishing components. It depends on the parameter $m$, which is the black hole mass:
m = var('m')
g = M.metric()
g[0, 0] = -(1 - 2*m/r)
g[1,1] = 1/(1-2*m/r)
g[2,2] = r^2
g[3,3] = r^2*sin(th)^2
g.display()
The volume form (also called Levi-Civita tensor) associated with $g$ can then be evaluated:
print(g.volume_form())
g.volume_form().display()
4-form eps_g on the 4-dimensional Lorentzian manifold M
The Riemann curvature tensor is computed as
Riem = g.riemann()
print(Riem)
Riem.display_comp(only_nonredundant=True)
Tensor field Riem(g) of type (1,3) on the 4-dimensional Lorentzian manifold M
The component $\mathrm{Riem}(g)^t_{\ \, rtr} = \mathrm{Riem}(g)^0_{\ \, 101}$ is returned by
Riem[0,1,0,1]
The Kretschmann scalar is defined as the following contraction of the Riemann tensor with itself:
$$K = \mathrm{Riem}(g)_{abcd} \; \mathrm{Riem}(g)^{abcd},$$where the Einstein summation convention on repeated indices is assumed. We evaluate it by using LaTeX notations for the indices:
K = Riem.down(g)['_{abcd}'] * Riem.up(g)['^{abcd}']
print(K)
K.display()
Scalar field on the 4-dimensional Lorentzian manifold M
The Ricci tensor of $g$ is identically zero, reflecting the fact that the Schwarzschild metric is a solution of the Einstein equation in vacuum:
print(g.ricci())
g.ricci().display()
Field of symmetric bilinear forms Ric(g) on the 4-dimensional Lorentzian manifold M