CoCalc Public FilesBHLectures / sage / Schwarz_Kruskal_Szekeres.ipynbOpen with one click!
Author: Eric Gourgoulhon
Views : 55
Compute Environment: Ubuntu 18.04 (Deprecated)

Kruskal-Szekeres coordinates and Carter-Penrose diagram of Schwarzschild spacetime

This Jupyter/SageMath worksheet is relative to the lectures Geometry and physics of black holes

These computations are based on SageManifolds (v0.9)

Click here to download the worksheet file (ipynb format). To run it, you must start SageMath with the Jupyter notebook, with the command sage -n jupyter

First we set up the notebook to display mathematical objects using LaTeX formatting:

In [1]:
%display latex

Spacetime

We declare the spacetime manifold MM:

In [2]:
M = Manifold(4, 'M') print(M)
4-dimensional differentiable manifold M

The ingoing Eddington-Finkelstein domain

The domain of ingoing Eddington-Finkelstein coordinates (t~,r,θ,ϕ)(\tilde t, r, \theta, \phi):

In [3]:
M_EF = M.open_subset('M_EF', latex_name=r'M_{\rm EF}')

The Schwarzschild-Droste domain

The domain of Schwarzschild-Droste coordinates is MSD=MIMIIM_{\rm SD} = M_{\rm I} \cup M_{\rm II}:

In [4]:
M_SD = M_EF.open_subset('M_SD', latex_name=r'M_{\rm SD}') M_I = M_SD.open_subset('M_I', latex_name=r'M_{\rm I}') M_II = M_SD.open_subset('M_II', latex_name=r'M_{\rm II}') M_SD.declare_union(M_I, M_II)

The Schwarzschild-Droste coordinates (t,r,θ,ϕ)(t,r,\theta,\phi):

In [5]:
X_SD.<t,r,th,ph> = M_SD.chart(r't r:(0,+oo) th:(0,pi):\theta ph:(0,2*pi):\phi') m = var('m') ; assume(m>=0) X_SD.add_restrictions(r!=2*m) X_SD
(MSD,(t,r,θ,ϕ))\left(M_{\rm SD},(t, r, {\theta}, {\phi})\right)
In [6]:
X_SD_I = X_SD.restrict(M_I, r>2*m) ; X_SD_I
(MI,(t,r,θ,ϕ))\left(M_{\rm I},(t, r, {\theta}, {\phi})\right)
In [7]:
X_SD_II = X_SD.restrict(M_II, r<2*m) ; X_SD_II
(MII,(t,r,θ,ϕ))\left(M_{\rm II},(t, r, {\theta}, {\phi})\right)
In [8]:
M.default_chart()
(MSD,(t,r,θ,ϕ))\left(M_{\rm SD},(t, r, {\theta}, {\phi})\right)

Eddington-Finkelstein coordinates

The ingoing Eddington-Finkelstein chart:

In [9]:
X_EF.<te,r,th,ph> = M_EF.chart(r'te:\tilde{t} r:(0,+oo) th:(0,pi):\theta ph:(0,2*pi):\phi') X_EF
(MEF,(t~,r,θ,ϕ))\left(M_{\rm EF},({\tilde{t}}, r, {\theta}, {\phi})\right)
In [10]:
SD_to_EF = X_SD.transition_map(X_EF, [t+2*m*ln(abs(r/(2*m)-1)), r, th, ph]) SD_to_EF.display()
{t~=2mlog(r2m1)+tr=rθ=θϕ=ϕ\left\{\begin{array}{lcl} {\tilde{t}} & = & 2 \, m \log\left({\left| \frac{r}{2 \, m} - 1 \right|}\right) + t \\ r & = & r \\ {\theta} & = & {\theta} \\ {\phi} & = & {\phi} \end{array}\right.
In [11]:
SD_to_EF.inverse().display()
{t=2mlog(2)+2mlog(m)2mlog(2m+r)+t~r=rθ=θϕ=ϕ\left\{\begin{array}{lcl} t & = & 2 \, m \log\left(2\right) + 2 \, m \log\left(m\right) - 2 \, m \log\left({\left| -2 \, m + r \right|}\right) + {\tilde{t}} \\ r & = & r \\ {\theta} & = & {\theta} \\ {\phi} & = & {\phi} \end{array}\right.
In [12]:
X_EF_I = X_EF.restrict(M_I, r>2*m) ; X_EF_I
(MI,(t~,r,θ,ϕ))\left(M_{\rm I},({\tilde{t}}, r, {\theta}, {\phi})\right)
In [13]:
X_EF_II = X_EF.restrict(M_II, r<2*m) ; X_EF_II
(MII,(t~,r,θ,ϕ))\left(M_{\rm II},({\tilde{t}}, r, {\theta}, {\phi})\right)
In [14]:
M.atlas()
[(MSD,(t,r,θ,ϕ)),(MI,(t,r,θ,ϕ)),(MII,(t,r,θ,ϕ)),(MEF,(t~,r,θ,ϕ)),(MSD,(t~,r,θ,ϕ)),(MI,(t~,r,θ,ϕ)),(MII,(t~,r,θ,ϕ))]\left[\left(M_{\rm SD},(t, r, {\theta}, {\phi})\right), \left(M_{\rm I},(t, r, {\theta}, {\phi})\right), \left(M_{\rm II},(t, r, {\theta}, {\phi})\right), \left(M_{\rm EF},({\tilde{t}}, r, {\theta}, {\phi})\right), \left(M_{\rm SD},({\tilde{t}}, r, {\theta}, {\phi})\right), \left(M_{\rm I},({\tilde{t}}, r, {\theta}, {\phi})\right), \left(M_{\rm II},({\tilde{t}}, r, {\theta}, {\phi})\right)\right]
In [ ]:

Kruskal-Szekeres coordinates

In [15]:
X_KS.<T,X,th,ph> = M.chart(r'T X th:(0,pi):\theta ph:(0,2*pi):\phi') X_KS.add_restrictions(T^2 < 1 + X^2) X_KS
(M,(T,X,θ,ϕ))\left(M,(T, X, {\theta}, {\phi})\right)
In [16]:
X_KS_I = X_KS.restrict(M_I, [X>0, T<X, T>-X]) ; X_KS_I
(MI,(T,X,θ,ϕ))\left(M_{\rm I},(T, X, {\theta}, {\phi})\right)
In [17]:
X_KS_II = X_KS.restrict(M_II, [T>0, T>abs(X)]) ; X_KS_II
(MII,(T,X,θ,ϕ))\left(M_{\rm II},(T, X, {\theta}, {\phi})\right)
In [18]:
X_KS_EF = X_KS.restrict(M_EF, X+T>0) ; X_KS_EF
(MEF,(T,X,θ,ϕ))\left(M_{\rm EF},(T, X, {\theta}, {\phi})\right)
In [19]:
SD_I_to_KS = X_SD_I.transition_map(X_KS_I, [sqrt(r/(2*m)-1)*exp(r/(4*m))*sinh(t/(4*m)), sqrt(r/(2*m)-1)*exp(r/(4*m))*cosh(t/(4*m)), th, ph]) SD_I_to_KS.display()
{T=r2m1e(r4m)sinh(t4m)X=r2m1cosh(t4m)e(r4m)θ=θϕ=ϕ\left\{\begin{array}{lcl} T & = & \sqrt{\frac{r}{2 \, m} - 1} e^{\left(\frac{r}{4 \, m}\right)} \sinh\left(\frac{t}{4 \, m}\right) \\ X & = & \sqrt{\frac{r}{2 \, m} - 1} \cosh\left(\frac{t}{4 \, m}\right) e^{\left(\frac{r}{4 \, m}\right)} \\ {\theta} & = & {\theta} \\ {\phi} & = & {\phi} \end{array}\right.
In [20]:
SD_II_to_KS = X_SD_II.transition_map(X_KS_II, [sqrt(1-r/(2*m))*exp(r/(4*m))*cosh(t/(4*m)), sqrt(1-r/(2*m))*exp(r/(4*m))*sinh(t/(4*m)), th, ph]) SD_II_to_KS.display()
{T=r2m+1cosh(t4m)e(r4m)X=r2m+1e(r4m)sinh(t4m)θ=θϕ=ϕ\left\{\begin{array}{lcl} T & = & \sqrt{-\frac{r}{2 \, m} + 1} \cosh\left(\frac{t}{4 \, m}\right) e^{\left(\frac{r}{4 \, m}\right)} \\ X & = & \sqrt{-\frac{r}{2 \, m} + 1} e^{\left(\frac{r}{4 \, m}\right)} \sinh\left(\frac{t}{4 \, m}\right) \\ {\theta} & = & {\theta} \\ {\phi} & = & {\phi} \end{array}\right.
In [21]:
EF_to_KS = X_EF.transition_map(X_KS_EF, [exp(r/(4*m))*(cosh(te/(4*m))-r/(4*m)*exp(-te/(4*m))), exp(r/(4*m))*(sinh(te/(4*m))+r/(4*m)*exp(-te/(4*m))), th, ph]) EF_to_KS.display()
{T=14(re(t~4m)m4cosh(t~4m))e(r4m)X=14(re(t~4m)m+4sinh(t~4m))e(r4m)θ=θϕ=ϕ\left\{\begin{array}{lcl} T & = & -\frac{1}{4} \, {\left(\frac{r e^{\left(-\frac{{\tilde{t}}}{4 \, m}\right)}}{m} - 4 \, \cosh\left(\frac{{\tilde{t}}}{4 \, m}\right)\right)} e^{\left(\frac{r}{4 \, m}\right)} \\ X & = & \frac{1}{4} \, {\left(\frac{r e^{\left(-\frac{{\tilde{t}}}{4 \, m}\right)}}{m} + 4 \, \sinh\left(\frac{{\tilde{t}}}{4 \, m}\right)\right)} e^{\left(\frac{r}{4 \, m}\right)} \\ {\theta} & = & {\theta} \\ {\phi} & = & {\phi} \end{array}\right.

Plot of the IEF grid in terms of KS coordinates:

In [22]:
graph = X_EF.plot(X_KS, ambient_coords=(X,T), fixed_coords={th:pi/2,ph:pi}, ranges={te:(-16,6), r:(1e-6,5)}, steps={te:1, r:0.5}, style={te:'--', r:'-'}, parameters={m:1})
In [23]:
graph += text(r'$\tilde{t}=0$', (2.65, 0.25), fontsize=16, color='red', rotation=-24) graph += text(r'$\tilde{t}=2m$', (2.8, 1.6), fontsize=16, color='red') graph += text(r'$\tilde{t}=-2m$', (2.68, -0.9), fontsize=16, color='red', rotation=-35) show(graph, xmin=-3, xmax=3, ymin=-3, ymax=3)

Adding the Schwarzschild horizon to the plot:

In [24]:
hor = line([(0,0), (4,4)], color='black', thickness=2) \ + text(r'$\mathscr{H}$', (3, 2.7), fontsize=20, color='black') graph += hor

Adding the curvature singularity r=0r=0 to the plot:

In [25]:
sing = X_SD_II.plot(X_KS, fixed_coords={r:0, th:pi/2, ph:pi}, ambient_coords=(X,T), color='brown', thickness=4, style='--', parameters={m:1}) \ + text(r'$r=0$', (2.5, 3), rotation=45, fontsize=16, color='brown') graph += sing show(graph, xmin=-3, xmax=3, ymin=-3, ymax=3)
In [26]:
graph.save("sch_IEF_KS.pdf", xmin=-3, xmax=3, ymin=-3, ymax=3)

Plot of Schwarzschild-Droste grid on MIM_{\rm I} in terms of KS coordinates

In [27]:
graph = X_SD_I.plot(X_KS, ambient_coords=(X,T), fixed_coords={th:pi/2,ph:pi}, ranges={t:(-10,10), r:(2.001,5)}, steps={t:1, r:0.5}, style={t:'--', r:'-'}, color='blue', parameters={m:1})
In [28]:
hor2 = line([(0,0), (4,4)], color='black', thickness=2) \ + text(r'$\mathscr{H}$', (2.95, 3.2), fontsize=20, color='black') region_labels = text(r'$\mathscr{M}_{\rm I}$', (2.4, 0.4), fontsize=20, color='blue') graph2 = graph + hor2 + region_labels show(graph2, xmin=-3, xmax=3, ymin=-3, ymax=3)
In [29]:
graph2.save("sch_SD_I_KS.pdf", xmin=-3, xmax=3, ymin=-3, ymax=3)
In [30]:
graph += X_SD_II.plot(X_KS, ambient_coords=(X,T), fixed_coords={th:pi/2,ph:pi}, ranges={t:(-10,10), r:(0.001,1.999)}, steps={t:1, r:0.5}, style={t:'--', r:'-'}, color='blue', parameters={m:1}) region_labels = text(r'$\mathscr{M}_{\rm I}$', (2.4, 0.4), fontsize=20, color='blue') + \ text(r'$\mathscr{M}_{\rm II}$', (0, 0.5), fontsize=20, color='blue') graph += hor + sing + region_labels show(graph, xmin=-3, xmax=3, ymin=-3, ymax=3)
In [31]:
graph.save("sch_SD_KS.pdf", xmin=-3, xmax=3, ymin=-3, ymax=3)

Radial null geodesics

The outgoing family:

In [32]:
var('u') outgeod = M.curve({X_EF: [r + 4*m*ln(abs(r/(2*m)-1)) + u, r, pi/2, pi]}, (r, 0, +oo)) outgeod.display()
(0,+)Mr(t~,r,θ,ϕ)=(4mlog(r2m1)+r+u,r,12π,π)r(T,X,θ,ϕ)=((22m+rcosh(4mlog(2)+4mlog(m)4mlog(2m+r)ru4m)e(r4m+u4m)r)e(u4m)22m+r,(22m+re(r4m+u4m)sinh(4mlog(2)+4mlog(m)4mlog(2m+r)ru4m)+r)e(u4m)22m+r,12π,π)\begin{array}{llcl} & \left( 0 , +\infty \right) & \longrightarrow & M \\ & r & \longmapsto & \left({\tilde{t}}, r, {\theta}, {\phi}\right) = \left(4 \, m \log\left({\left| \frac{r}{2 \, m} - 1 \right|}\right) + r + u, r, \frac{1}{2} \, \pi, \pi\right) \\ & r & \longmapsto & \left(T, X, {\theta}, {\phi}\right) = \left(\frac{{\left(2 \, {\left| -2 \, m + r \right|} \cosh\left(-\frac{4 \, m \log\left(2\right) + 4 \, m \log\left(m\right) - 4 \, m \log\left({\left| -2 \, m + r \right|}\right) - r - u}{4 \, m}\right) e^{\left(\frac{r}{4 \, m} + \frac{u}{4 \, m}\right)} - r\right)} e^{\left(-\frac{u}{4 \, m}\right)}}{2 \, {\left| -2 \, m + r \right|}}, \frac{{\left(2 \, {\left| -2 \, m + r \right|} e^{\left(\frac{r}{4 \, m} + \frac{u}{4 \, m}\right)} \sinh\left(-\frac{4 \, m \log\left(2\right) + 4 \, m \log\left(m\right) - 4 \, m \log\left({\left| -2 \, m + r \right|}\right) - r - u}{4 \, m}\right) + r\right)} e^{\left(-\frac{u}{4 \, m}\right)}}{2 \, {\left| -2 \, m + r \right|}}, \frac{1}{2} \, \pi, \pi\right) \end{array}

The ingoing family:

In [33]:
var('v') ingeod = M.curve({X_EF: [-r + v, r, pi/2, pi]}, (r, 0, +oo)) ingeod.display()
(0,+)Mr(t~,r,θ,ϕ)=(r+v,r,12π,π)r(T,X,θ,ϕ)=((4mcosh(rv4m)e(r4m+v4m)re(r2m))e(v4m)4m,(4me(r4m+v4m)sinh(rv4m)+re(r2m))e(v4m)4m,12π,π)\begin{array}{llcl} & \left( 0 , +\infty \right) & \longrightarrow & M \\ & r & \longmapsto & \left({\tilde{t}}, r, {\theta}, {\phi}\right) = \left(-r + v, r, \frac{1}{2} \, \pi, \pi\right) \\ & r & \longmapsto & \left(T, X, {\theta}, {\phi}\right) = \left(\frac{{\left(4 \, m \cosh\left(-\frac{r - v}{4 \, m}\right) e^{\left(\frac{r}{4 \, m} + \frac{v}{4 \, m}\right)} - r e^{\left(\frac{r}{2 \, m}\right)}\right)} e^{\left(-\frac{v}{4 \, m}\right)}}{4 \, m}, \frac{{\left(4 \, m e^{\left(\frac{r}{4 \, m} + \frac{v}{4 \, m}\right)} \sinh\left(-\frac{r - v}{4 \, m}\right) + r e^{\left(\frac{r}{2 \, m}\right)}\right)} e^{\left(-\frac{v}{4 \, m}\right)}}{4 \, m}, \frac{1}{2} \, \pi, \pi\right) \end{array}
In [34]:
graph = Graphics() for u0 in range(-10, 10, 2): graph += outgeod.plot(chart=X_KS, ambient_coords=(X,T), prange=(0.01, 1.99), parameters={m: 1, u: u0}, color='green', style='-') graph += outgeod.plot(chart=X_KS, ambient_coords=(X,T), prange=(2.01, 5), parameters={m: 1, u: u0}, color='green', style='-') graph += ingeod.plot(chart=X_KS, ambient_coords=(X,T), prange=(0.01, 5), parameters={m: 1, v: u0}, color='green', style='--') graph += hor graph += sing show(graph, xmin=-3, xmax=3, ymin=-3, ymax=3)
In [35]:
graph.save("sch_rad_null_geod_KS.pdf", xmin=-3, xmax=3, ymin=-3, ymax=3)

Extension to MIIIM_{\rm III} and MIVM_{\rm IV}

In [36]:
M_III = M.open_subset('M_III', latex_name=r'M_{\rm III}', coord_def={X_KS: [X<0, X<T, T<-X]}) X_KS_III = X_KS.restrict(M_III) ; X_KS_III
(MIII,(T,X,θ,ϕ))\left(M_{\rm III},(T, X, {\theta}, {\phi})\right)
In [37]:
M_IV = M.open_subset('M_IV', latex_name=r'M_{\rm IV}', coord_def={X_KS: [T<0, T<-abs(X)]}) X_KS_IV = X_KS.restrict(M_IV) ; X_KS_IV
(MIV,(T,X,θ,ϕ))\left(M_{\rm IV},(T, X, {\theta}, {\phi})\right)

Schwarzschild-Droste coordinates in MIIIM_{\rm III} and MIVM_{\rm IV}:

In [38]:
X_SD_III.<t,r,th,ph> = M_III.chart(r't r:(2*m,+oo) th:(0,pi):\theta ph:(0,2*pi):\phi') X_SD_III
(MIII,(t,r,θ,ϕ))\left(M_{\rm III},(t, r, {\theta}, {\phi})\right)
In [39]:
SD_III_to_KS = X_SD_III.transition_map(X_KS_III, [-sqrt(r/(2*m)-1)*exp(r/(4*m))*sinh(t/(4*m)), - sqrt(r/(2*m)-1)*exp(r/(4*m))*cosh(t/(4*m)), th, ph]) SD_III_to_KS.display()
{T=r2m1e(r4m)sinh(t4m)X=r2m1cosh(t4m)e(r4m)θ=θϕ=ϕ\left\{\begin{array}{lcl} T & = & -\sqrt{\frac{r}{2 \, m} - 1} e^{\left(\frac{r}{4 \, m}\right)} \sinh\left(\frac{t}{4 \, m}\right) \\ X & = & -\sqrt{\frac{r}{2 \, m} - 1} \cosh\left(\frac{t}{4 \, m}\right) e^{\left(\frac{r}{4 \, m}\right)} \\ {\theta} & = & {\theta} \\ {\phi} & = & {\phi} \end{array}\right.
In [40]:
X_SD_IV.<t,r,th,ph> = M_IV.chart(r't r:(0,2*m) th:(0,pi):\theta ph:(0,2*pi):\phi') X_SD_IV
(MIV,(t,r,θ,ϕ))\left(M_{\rm IV},(t, r, {\theta}, {\phi})\right)
In [41]:
SD_IV_to_KS = X_SD_IV.transition_map(X_KS_IV, [-sqrt(1-r/(2*m))*exp(r/(4*m))*cosh(t/(4*m)), -sqrt(1-r/(2*m))*exp(r/(4*m))*sinh(t/(4*m)), th, ph]) SD_IV_to_KS.display()
{T=r2m+1cosh(t4m)e(r4m)X=r2m+1e(r4m)sinh(t4m)θ=θϕ=ϕ\left\{\begin{array}{lcl} T & = & -\sqrt{-\frac{r}{2 \, m} + 1} \cosh\left(\frac{t}{4 \, m}\right) e^{\left(\frac{r}{4 \, m}\right)} \\ X & = & -\sqrt{-\frac{r}{2 \, m} + 1} e^{\left(\frac{r}{4 \, m}\right)} \sinh\left(\frac{t}{4 \, m}\right) \\ {\theta} & = & {\theta} \\ {\phi} & = & {\phi} \end{array}\right.

Plot of the maximal extension

In [42]:
graph = X_SD_I.plot(X_KS, ambient_coords=(X,T), fixed_coords={th:pi/2,ph:pi}, ranges={t:(-10,10), r:(2.001,5)}, steps={t:1, r:0.5}, style={t:'--', r:'-'}, color='blue', parameters={m:1}) graph += X_SD_II.plot(X_KS, ambient_coords=(X,T), fixed_coords={th:pi/2,ph:pi}, ranges={t:(-10,10), r:(0.001,1.999)}, steps={t:1, r:0.5}, style={t:'--', r:'-'}, color='steelblue', parameters={m:1}) graph += X_SD_III.plot(X_KS, ambient_coords=(X,T), fixed_coords={th:pi/2,ph:pi}, ranges={t:(-10,10), r:(2.001,5)}, steps={t:1, r:0.5}, style={t:'--', r:'-'}, color='chocolate', parameters={m:1}) graph += X_SD_IV.plot(X_KS, ambient_coords=(X,T), fixed_coords={th:pi/2,ph:pi}, ranges={t:(-10,10), r:(0.001,1.999)}, steps={t:1, r:0.5}, style={t:'--', r:'-'}, color='gold', parameters={m:1})
In [43]:
bifhor = line([(-4,-4), (4,4)], color='black', thickness=3) + \ line([(-4,4), (4,-4)], color='black', thickness=3) + \ text(r'$\mathscr{H}$', (3, 2.7), fontsize=20, color='black') sing2 = X_SD_IV.plot(X_KS, fixed_coords={r:0, th:pi/2, ph:pi}, ambient_coords=(X,T), color='brown', thickness=4, style='--', parameters={m:1}) \ + text(r"$r'=0$", (2.5, -3), rotation=-45, fontsize=16, color='brown') region_labels = text(r'$\mathscr{M}_{\rm I}$', (2.4, 0.4), fontsize=20, color='blue') + \ text(r'$\mathscr{M}_{\rm II}$', (0, 0.5), fontsize=20, color='steelblue') + \ text(r'$\mathscr{M}_{\rm III}$', (-2.4, 0.4), fontsize=20, color='chocolate') + \ text(r'$\mathscr{M}_{\rm IV}$', (0, -0.5), fontsize=20, color='gold') graph += bifhor + sing + sing2 + region_labels show(graph, xmin=-3, xmax=3, ymin=-3, ymax=3)