Sharedrotating_Hayward_metric_ext.ipynbOpen in CoCalc

# Extended rotating Hayward metric¶

This Jupyter/SageMath notebook is related to the article Lamy et al, arXiv:1802.01635.

The metric is that obtained by Bambi & Modesto, Phys. Lett. B 721, 329 (2013) by applying the Newman-Janis transformation to the (non-rotating) Hayward metric for regular black holes (Hayward, PRL 96, 031103 (2006)), extended to cover the region $r<0$.

version()
'SageMath version 8.1, Release Date: 2017-12-07'
%display latex

To speed up the computation of the Riemann tensor, we ask for parallel computations on 8 threads:

Parallelism().set(nproc=1)  # use nproc=1 on CoCalc
M = Manifold(4, 'M')
print(M)
4-dimensional differentiable manifold M
M1 = M.open_subset('M_1')
XBL1.<t,r,th,ph> = M1.chart(r't r:(0,+oo) th:(0,pi):\theta ph:(0,2*pi):\phi')
XBL1
$\left(M_1,(t, r, {\theta}, {\phi})\right)$
M2 = M.open_subset('M_2')
forget(r>0)
XBL2.<t,r,th,ph> = M2.chart(r't r:(-oo,0) th:(0,pi):\theta ph:(0,2*pi):\phi')
M._top_charts.append(XBL2)
XBL2
$\left(M_2,(t, r, {\theta}, {\phi})\right)$
forget(r<0)
assumptions()
$\left[\verb|t|\phantom{\verb!x!}\verb|is|\phantom{\verb!x!}\verb|real|, \verb|r|\phantom{\verb!x!}\verb|is|\phantom{\verb!x!}\verb|real|, \verb|th|\phantom{\verb!x!}\verb|is|\phantom{\verb!x!}\verb|real|, {\theta} > 0, {\theta} < \pi, \verb|ph|\phantom{\verb!x!}\verb|is|\phantom{\verb!x!}\verb|real|, {\phi} > 0, {\phi} < 2 \, \pi\right]$
g = M.lorentzian_metric('g')
a, b = var('a b')
Sigma = r^2 + a^2*cos(th)^2
m = r^3/(r^3 + 2*b^2)
m1 = m
Delta = r^2 - 2*m*r + a^2
g1 = g.restrict(M1)
g1[0,0] = -(1 - 2*r*m/Sigma)
g1[0,3] = -2*a*r*sin(th)^2*m/Sigma
g1[1,1] = Sigma/Delta
g1[2,2] = Sigma
g1[3,3] = (r^2 + a^2 + 2*r*(a*sin(th))^2*m/Sigma)*sin(th)^2
g.display(XBL1.frame())
$g = \left( \frac{2 \, r^{4}}{{\left(a^{2} \cos\left({\theta}\right)^{2} + r^{2}\right)} {\left(r^{3} + 2 \, b^{2}\right)}} - 1 \right) \mathrm{d} t\otimes \mathrm{d} t -\frac{2 \, a r^{4} \sin\left({\theta}\right)^{2}}{{\left(a^{2} \cos\left({\theta}\right)^{2} + r^{2}\right)} {\left(r^{3} + 2 \, b^{2}\right)}} \mathrm{d} t\otimes \mathrm{d} {\phi} + \left( -\frac{a^{2} \cos\left({\theta}\right)^{2} + r^{2}}{\frac{2 \, r^{4}}{r^{3} + 2 \, b^{2}} - a^{2} - r^{2}} \right) \mathrm{d} r\otimes \mathrm{d} r + \left( a^{2} \cos\left({\theta}\right)^{2} + r^{2} \right) \mathrm{d} {\theta}\otimes \mathrm{d} {\theta} -\frac{2 \, a r^{4} \sin\left({\theta}\right)^{2}}{{\left(a^{2} \cos\left({\theta}\right)^{2} + r^{2}\right)} {\left(r^{3} + 2 \, b^{2}\right)}} \mathrm{d} {\phi}\otimes \mathrm{d} t + {\left(\frac{2 \, a^{2} r^{4} \sin\left({\theta}\right)^{2}}{{\left(a^{2} \cos\left({\theta}\right)^{2} + r^{2}\right)} {\left(r^{3} + 2 \, b^{2}\right)}} + a^{2} + r^{2}\right)} \sin\left({\theta}\right)^{2} \mathrm{d} {\phi}\otimes \mathrm{d} {\phi}$
g.display_comp(XBL1.frame())
$\begin{array}{lcl} g_{ \, t \, t }^{ \phantom{\, t}\phantom{\, t} } & = & \frac{2 \, r^{4}}{{\left(a^{2} \cos\left({\theta}\right)^{2} + r^{2}\right)} {\left(r^{3} + 2 \, b^{2}\right)}} - 1 \\ g_{ \, t \, {\phi} }^{ \phantom{\, t}\phantom{\, {\phi}} } & = & -\frac{2 \, a r^{4} \sin\left({\theta}\right)^{2}}{{\left(a^{2} \cos\left({\theta}\right)^{2} + r^{2}\right)} {\left(r^{3} + 2 \, b^{2}\right)}} \\ g_{ \, r \, r }^{ \phantom{\, r}\phantom{\, r} } & = & -\frac{a^{2} \cos\left({\theta}\right)^{2} + r^{2}}{\frac{2 \, r^{4}}{r^{3} + 2 \, b^{2}} - a^{2} - r^{2}} \\ g_{ \, {\theta} \, {\theta} }^{ \phantom{\, {\theta}}\phantom{\, {\theta}} } & = & a^{2} \cos\left({\theta}\right)^{2} + r^{2} \\ g_{ \, {\phi} \, t }^{ \phantom{\, {\phi}}\phantom{\, t} } & = & -\frac{2 \, a r^{4} \sin\left({\theta}\right)^{2}}{{\left(a^{2} \cos\left({\theta}\right)^{2} + r^{2}\right)} {\left(r^{3} + 2 \, b^{2}\right)}} \\ g_{ \, {\phi} \, {\phi} }^{ \phantom{\, {\phi}}\phantom{\, {\phi}} } & = & {\left(\frac{2 \, a^{2} r^{4} \sin\left({\theta}\right)^{2}}{{\left(a^{2} \cos\left({\theta}\right)^{2} + r^{2}\right)} {\left(r^{3} + 2 \, b^{2}\right)}} + a^{2} + r^{2}\right)} \sin\left({\theta}\right)^{2} \end{array}$
m = -r^3/(-r^3 + 2*b^2)
m2 = m
Delta = r^2 - 2*m*r + a^2
g2 = g.restrict(M2)
g2[0,0] = -(1 - 2*r*m/Sigma)
g2[0,3] = -2*a*r*sin(th)^2*m/Sigma
g2[1,1] = Sigma/Delta
g2[2,2] = Sigma
g2[3,3] = (r^2 + a^2 + 2*r*(a*sin(th))^2*m/Sigma)*sin(th)^2
g.display(XBL2.frame())
$g = \left( \frac{2 \, r^{4}}{{\left(a^{2} \cos\left({\theta}\right)^{2} + r^{2}\right)} {\left(r^{3} - 2 \, b^{2}\right)}} - 1 \right) \mathrm{d} t\otimes \mathrm{d} t -\frac{2 \, a r^{4} \sin\left({\theta}\right)^{2}}{{\left(a^{2} \cos\left({\theta}\right)^{2} + r^{2}\right)} {\left(r^{3} - 2 \, b^{2}\right)}} \mathrm{d} t\otimes \mathrm{d} {\phi} + \left( -\frac{a^{2} \cos\left({\theta}\right)^{2} + r^{2}}{\frac{2 \, r^{4}}{r^{3} - 2 \, b^{2}} - a^{2} - r^{2}} \right) \mathrm{d} r\otimes \mathrm{d} r + \left( a^{2} \cos\left({\theta}\right)^{2} + r^{2} \right) \mathrm{d} {\theta}\otimes \mathrm{d} {\theta} -\frac{2 \, a r^{4} \sin\left({\theta}\right)^{2}}{{\left(a^{2} \cos\left({\theta}\right)^{2} + r^{2}\right)} {\left(r^{3} - 2 \, b^{2}\right)}} \mathrm{d} {\phi}\otimes \mathrm{d} t + {\left(\frac{2 \, a^{2} r^{4} \sin\left({\theta}\right)^{2}}{{\left(a^{2} \cos\left({\theta}\right)^{2} + r^{2}\right)} {\left(r^{3} - 2 \, b^{2}\right)}} + a^{2} + r^{2}\right)} \sin\left({\theta}\right)^{2} \mathrm{d} {\phi}\otimes \mathrm{d} {\phi}$
g.display_comp(XBL2.frame())
$\begin{array}{lcl} g_{ \, t \, t }^{ \phantom{\, t}\phantom{\, t} } & = & \frac{2 \, r^{4}}{{\left(a^{2} \cos\left({\theta}\right)^{2} + r^{2}\right)} {\left(r^{3} - 2 \, b^{2}\right)}} - 1 \\ g_{ \, t \, {\phi} }^{ \phantom{\, t}\phantom{\, {\phi}} } & = & -\frac{2 \, a r^{4} \sin\left({\theta}\right)^{2}}{{\left(a^{2} \cos\left({\theta}\right)^{2} + r^{2}\right)} {\left(r^{3} - 2 \, b^{2}\right)}} \\ g_{ \, r \, r }^{ \phantom{\, r}\phantom{\, r} } & = & -\frac{a^{2} \cos\left({\theta}\right)^{2} + r^{2}}{\frac{2 \, r^{4}}{r^{3} - 2 \, b^{2}} - a^{2} - r^{2}} \\ g_{ \, {\theta} \, {\theta} }^{ \phantom{\, {\theta}}\phantom{\, {\theta}} } & = & a^{2} \cos\left({\theta}\right)^{2} + r^{2} \\ g_{ \, {\phi} \, t }^{ \phantom{\, {\phi}}\phantom{\, t} } & = & -\frac{2 \, a r^{4} \sin\left({\theta}\right)^{2}}{{\left(a^{2} \cos\left({\theta}\right)^{2} + r^{2}\right)} {\left(r^{3} - 2 \, b^{2}\right)}} \\ g_{ \, {\phi} \, {\phi} }^{ \phantom{\, {\phi}}\phantom{\, {\phi}} } & = & {\left(\frac{2 \, a^{2} r^{4} \sin\left({\theta}\right)^{2}}{{\left(a^{2} \cos\left({\theta}\right)^{2} + r^{2}\right)} {\left(r^{3} - 2 \, b^{2}\right)}} + a^{2} + r^{2}\right)} \sin\left({\theta}\right)^{2} \end{array}$
graph = plot(m1.subs(b=1), (r, 0, 8), axes_labels=[r'$r/m$', r'$M(r)/m$'], gridlines=True)
graph += plot(m2.subs(b=1), (r, -8, 0))
graph
gm1 = g.inverse()
gm1.display(XBL1.frame())
$g^{-1} = \left( -\frac{2 \, a^{2} r^{4} \sin\left({\theta}\right)^{2} + a^{2} r^{5} + r^{7} + 2 \, a^{2} b^{2} r^{2} + 2 \, b^{2} r^{4} + {\left(a^{4} r^{3} + a^{2} r^{5} + 2 \, a^{4} b^{2} + 2 \, a^{2} b^{2} r^{2}\right)} \cos\left({\theta}\right)^{2}}{a^{2} r^{5} + r^{7} + 2 \, a^{2} b^{2} r^{2} + 2 \, b^{2} r^{4} - 2 \, r^{6} + {\left(a^{4} r^{3} + a^{2} r^{5} + 2 \, a^{4} b^{2} + 2 \, a^{2} b^{2} r^{2} - 2 \, a^{2} r^{4}\right)} \cos\left({\theta}\right)^{2}} \right) \frac{\partial}{\partial t }\otimes \frac{\partial}{\partial t } + \left( -\frac{2 \, a r^{4}}{a^{2} r^{5} + r^{7} + 2 \, a^{2} b^{2} r^{2} + 2 \, b^{2} r^{4} - 2 \, r^{6} + {\left(a^{4} r^{3} + a^{2} r^{5} + 2 \, a^{4} b^{2} + 2 \, a^{2} b^{2} r^{2} - 2 \, a^{2} r^{4}\right)} \cos\left({\theta}\right)^{2}} \right) \frac{\partial}{\partial t }\otimes \frac{\partial}{\partial {\phi} } + \left( \frac{a^{2} r^{3} + r^{5} + 2 \, a^{2} b^{2} + 2 \, b^{2} r^{2} - 2 \, r^{4}}{r^{5} + 2 \, b^{2} r^{2} + {\left(a^{2} r^{3} + 2 \, a^{2} b^{2}\right)} \cos\left({\theta}\right)^{2}} \right) \frac{\partial}{\partial r }\otimes \frac{\partial}{\partial r } + \left( \frac{1}{a^{2} \cos\left({\theta}\right)^{2} + r^{2}} \right) \frac{\partial}{\partial {\theta} }\otimes \frac{\partial}{\partial {\theta} } + \left( -\frac{2 \, a r^{4}}{a^{2} r^{5} + r^{7} + 2 \, a^{2} b^{2} r^{2} + 2 \, b^{2} r^{4} - 2 \, r^{6} + {\left(a^{4} r^{3} + a^{2} r^{5} + 2 \, a^{4} b^{2} + 2 \, a^{2} b^{2} r^{2} - 2 \, a^{2} r^{4}\right)} \cos\left({\theta}\right)^{2}} \right) \frac{\partial}{\partial {\phi} }\otimes \frac{\partial}{\partial t } + \left( \frac{r^{5} + 2 \, b^{2} r^{2} - 2 \, r^{4} + {\left(a^{2} r^{3} + 2 \, a^{2} b^{2}\right)} \cos\left({\theta}\right)^{2}}{2 \, a^{2} r^{4} \sin\left({\theta}\right)^{4} + {\left(a^{2} r^{5} + r^{7} + 2 \, a^{2} b^{2} r^{2} - 2 \, r^{6} - 2 \, {\left(a^{2} - b^{2}\right)} r^{4} + {\left(a^{4} r^{3} + a^{2} r^{5} + 2 \, a^{4} b^{2} + 2 \, a^{2} b^{2} r^{2}\right)} \cos\left({\theta}\right)^{2}\right)} \sin\left({\theta}\right)^{2}} \right) \frac{\partial}{\partial {\phi} }\otimes \frac{\partial}{\partial {\phi} }$
gm1.display(XBL2.frame())
$g^{-1} = \left( -\frac{2 \, a^{2} r^{4} \sin\left({\theta}\right)^{2} + a^{2} r^{5} + r^{7} - 2 \, a^{2} b^{2} r^{2} - 2 \, b^{2} r^{4} + {\left(a^{4} r^{3} + a^{2} r^{5} - 2 \, a^{4} b^{2} - 2 \, a^{2} b^{2} r^{2}\right)} \cos\left({\theta}\right)^{2}}{a^{2} r^{5} + r^{7} - 2 \, a^{2} b^{2} r^{2} - 2 \, b^{2} r^{4} - 2 \, r^{6} + {\left(a^{4} r^{3} + a^{2} r^{5} - 2 \, a^{4} b^{2} - 2 \, a^{2} b^{2} r^{2} - 2 \, a^{2} r^{4}\right)} \cos\left({\theta}\right)^{2}} \right) \frac{\partial}{\partial t }\otimes \frac{\partial}{\partial t } + \left( -\frac{2 \, a r^{4}}{a^{2} r^{5} + r^{7} - 2 \, a^{2} b^{2} r^{2} - 2 \, b^{2} r^{4} - 2 \, r^{6} + {\left(a^{4} r^{3} + a^{2} r^{5} - 2 \, a^{4} b^{2} - 2 \, a^{2} b^{2} r^{2} - 2 \, a^{2} r^{4}\right)} \cos\left({\theta}\right)^{2}} \right) \frac{\partial}{\partial t }\otimes \frac{\partial}{\partial {\phi} } + \left( \frac{a^{2} r^{3} + r^{5} - 2 \, a^{2} b^{2} - 2 \, b^{2} r^{2} - 2 \, r^{4}}{r^{5} - 2 \, b^{2} r^{2} + {\left(a^{2} r^{3} - 2 \, a^{2} b^{2}\right)} \cos\left({\theta}\right)^{2}} \right) \frac{\partial}{\partial r }\otimes \frac{\partial}{\partial r } + \left( \frac{1}{a^{2} \cos\left({\theta}\right)^{2} + r^{2}} \right) \frac{\partial}{\partial {\theta} }\otimes \frac{\partial}{\partial {\theta} } + \left( -\frac{2 \, a r^{4}}{a^{2} r^{5} + r^{7} - 2 \, a^{2} b^{2} r^{2} - 2 \, b^{2} r^{4} - 2 \, r^{6} + {\left(a^{4} r^{3} + a^{2} r^{5} - 2 \, a^{4} b^{2} - 2 \, a^{2} b^{2} r^{2} - 2 \, a^{2} r^{4}\right)} \cos\left({\theta}\right)^{2}} \right) \frac{\partial}{\partial {\phi} }\otimes \frac{\partial}{\partial t } + \left( \frac{r^{5} - 2 \, b^{2} r^{2} - 2 \, r^{4} + {\left(a^{2} r^{3} - 2 \, a^{2} b^{2}\right)} \cos\left({\theta}\right)^{2}}{2 \, a^{2} r^{4} \sin\left({\theta}\right)^{4} + {\left(a^{2} r^{5} + r^{7} - 2 \, a^{2} b^{2} r^{2} - 2 \, r^{6} - 2 \, {\left(a^{2} + b^{2}\right)} r^{4} + {\left(a^{4} r^{3} + a^{2} r^{5} - 2 \, a^{4} b^{2} - 2 \, a^{2} b^{2} r^{2}\right)} \cos\left({\theta}\right)^{2}\right)} \sin\left({\theta}\right)^{2}} \right) \frac{\partial}{\partial {\phi} }\otimes \frac{\partial}{\partial {\phi} }$
#g.christoffel_symbols_display(XBL1)
#gam = g.christoffel_symbols(XBL1)
#for i in range(4):
#    for j in range(4):
#        for k in range(j,4):
#            print("---------------------")
#            print("Gamma^{}_{}{} for r >=0:".format(i,j,k))
#            if gam[i,j,k] == 0:
#                print(0)
#            else:
#                show(gam[i,j,k].expr().factor())
#                print(gam[i,j,k].expr().factor())
#g.christoffel_symbols_display(XBL2)
#gam = g.christoffel_symbols(XBL2)
#for i in range(4):
#    for j in range(4):
#        for k in range(j,4):
#            print("--------------------")
#            print("Gamma^{}_{}{} for r < 0:".format(i,j,k))
#            if gam[i,j,k] == 0:
#                print(0)
#            else:
#                show(gam[i,j,k].expr().factor())
#                print(gam[i,j,k].expr().factor())

### $g_{tt}$ component¶

g.restrict(M1)[0,0]
$\frac{2 \, r^{4}}{{\left(a^{2} \cos\left({\theta}\right)^{2} + r^{2}\right)} {\left(r^{3} + 2 \, b^{2}\right)}} - 1$
g.restrict(M2)[0,0]
$\frac{2 \, r^{4}}{{\left(a^{2} \cos\left({\theta}\right)^{2} + r^{2}\right)} {\left(r^{3} - 2 \, b^{2}\right)}} - 1$
def plot_profile(field, param_values, rmin, rmax, y_label, comp=None,
ymin=None, ymax=None, gridlines=True):
graph = Graphics()
rmin0 = max(rmin, 0)
rmax0 = min(rmax, 0)
if rmax > 0:
f1 = field.restrict(M1)
if comp is not None:
f1 = f1[comp].expr()
else:
f1 = f1.expr()
f1 = f1.subs(param_values)
graph += plot(f1.subs(th=0), (r, rmin0, rmax), color='lightblue',
legend_label=r'$\theta=0$', axes_labels = [r'$r/m$', y_label],
ymin=ymin, ymax=ymax, gridlines=gridlines)
graph += plot(f1.subs(th=pi/4), (r, rmin0, rmax), color='magenta',
legend_label=r'$\theta=\pi/4$')
graph += plot(f1.subs(th=pi/2), (r, rmin0, rmax), color='blue',
legend_label=r'$\theta=\pi/2$')
if rmin < 0:
f1 = field.restrict(M2)
if comp is not None:
f1 = f1[comp].expr()
else:
f1 = f1.expr()
f1 = f1.subs(param_values)
graph += plot(f1.subs(th=0), (r, rmin, rmax0), color='lightblue',
axes_labels = [r'$r/m$', y_label],
ymin=ymin, ymax=ymax)
graph += plot(f1.subs(th=pi/4), (r, rmin, rmax0), color='magenta')
graph += plot(f1.subs(th=pi/2), (r, rmin, rmax0), color='blue')
return graph
graph = plot_profile(g, {a: 0.9, b: 1}, -8, 8, r'$g_{tt}$', comp=(0,0))
graph.save('g_tt.pdf')
graph

### Lapse function¶

The lapse function $N$ is deduced from the standard formula $g^{tt} = - 1/N^2$:

M.top_charts()
$\left[\left(M_1,(t, r, {\theta}, {\phi})\right), \left(M_2,(t, r, {\theta}, {\phi})\right)\right]$
NN = M.scalar_field(coord_expression={XBL1: sqrt(- 1 / g.restrict(M1).inverse()[0,0]),
XBL2: sqrt(- 1 / g.restrict(M2).inverse()[0,0])},
name='N')
NN.display()
graph = plot_profile(NN, {a: 0.9, b: 1}, -8, 8, r'$N$')
graph.save('lapse.pdf')
graph

### $g_{t\phi}$ component¶

graph = plot_profile(g, {a: 0.9, b: 1}, -8, 8, r'$g_{t\phi}$', comp=(0,3))
graph.save('g_tphi.pdf')
graph

### Other metric components¶

graph = plot_profile(g, {a: 2, b: 0.5}, -4, 4, r'$g_{\phi\phi}$', comp=(3,3))
graph.save('g_phiphi.pdf')
graph
g.restrict(M1)[3,3].expr().factor()
$\frac{{\left(a^{4} r^{3} \cos\left({\theta}\right)^{2} + a^{2} r^{5} \cos\left({\theta}\right)^{2} + 2 \, a^{4} b^{2} \cos\left({\theta}\right)^{2} + 2 \, a^{2} b^{2} r^{2} \cos\left({\theta}\right)^{2} + 2 \, a^{2} r^{4} \sin\left({\theta}\right)^{2} + a^{2} r^{5} + r^{7} + 2 \, a^{2} b^{2} r^{2} + 2 \, b^{2} r^{4}\right)} \sin\left({\theta}\right)^{2}}{{\left(a^{2} \cos\left({\theta}\right)^{2} + r^{2}\right)} {\left(r^{3} + 2 \, b^{2}\right)}}$
g.restrict(M2)[3,3].expr().factor()
$\frac{{\left(a^{4} r^{3} \cos\left({\theta}\right)^{2} + a^{2} r^{5} \cos\left({\theta}\right)^{2} - 2 \, a^{4} b^{2} \cos\left({\theta}\right)^{2} - 2 \, a^{2} b^{2} r^{2} \cos\left({\theta}\right)^{2} + 2 \, a^{2} r^{4} \sin\left({\theta}\right)^{2} + a^{2} r^{5} + r^{7} - 2 \, a^{2} b^{2} r^{2} - 2 \, b^{2} r^{4}\right)} \sin\left({\theta}\right)^{2}}{{\left(a^{2} \cos\left({\theta}\right)^{2} + r^{2}\right)} {\left(r^{3} - 2 \, b^{2}\right)}}$
graph = plot_profile(g, {a: 0.9, b: 1}, -4, 4, r'$g_{rr}$', comp=(1,1))
graph.save('g_rr.pdf')
graph
graph = plot_profile(g, {a: 0.9, b: 1}, -2, 2, r'$g_{\theta\theta}$', comp=(2,2))
graph.save('g_thth.pdf')
graph

### Ricci tensor¶

Ric = g.ricci() ; print(Ric)
Field of symmetric bilinear forms Ric(g) on the 4-dimensional differentiable manifold M
Ric.display_comp(XBL1.frame())
$\begin{array}{lcl} \mathrm{Ric}\left(g\right)_{ \, t \, t }^{ \phantom{\, t}\phantom{\, t} } & = & \frac{12 \, {\left(3 \, a^{2} b^{2} r^{10} + 2 \, b^{2} r^{12} + 6 \, a^{2} b^{4} r^{7} + 2 \, b^{4} r^{9} - 4 \, b^{2} r^{11} - 4 \, b^{6} r^{6} + 4 \, b^{4} r^{8} + {\left(a^{4} b^{2} r^{8} - 2 \, a^{4} b^{4} r^{5} - 6 \, a^{2} b^{4} r^{7} - 2 \, a^{2} b^{2} r^{9} - 8 \, a^{4} b^{6} r^{2} - 12 \, a^{2} b^{6} r^{4} + 8 \, a^{2} b^{4} r^{6}\right)} \cos\left({\theta}\right)^{2}\right)}}{r^{18} + 8 \, b^{2} r^{15} + 24 \, b^{4} r^{12} + 32 \, b^{6} r^{9} + 16 \, b^{8} r^{6} + {\left(a^{6} r^{12} + 8 \, a^{6} b^{2} r^{9} + 24 \, a^{6} b^{4} r^{6} + 32 \, a^{6} b^{6} r^{3} + 16 \, a^{6} b^{8}\right)} \cos\left({\theta}\right)^{6} + 3 \, {\left(a^{4} r^{14} + 8 \, a^{4} b^{2} r^{11} + 24 \, a^{4} b^{4} r^{8} + 32 \, a^{4} b^{6} r^{5} + 16 \, a^{4} b^{8} r^{2}\right)} \cos\left({\theta}\right)^{4} + 3 \, {\left(a^{2} r^{16} + 8 \, a^{2} b^{2} r^{13} + 24 \, a^{2} b^{4} r^{10} + 32 \, a^{2} b^{6} r^{7} + 16 \, a^{2} b^{8} r^{4}\right)} \cos\left({\theta}\right)^{2}} \\ \mathrm{Ric}\left(g\right)_{ \, t \, {\phi} }^{ \phantom{\, t}\phantom{\, {\phi}} } & = & \frac{12 \, {\left({\left(a^{5} b^{2} r^{8} + a^{3} b^{2} r^{10} - 2 \, a^{5} b^{4} r^{5} - 2 \, a^{3} b^{4} r^{7} - 2 \, a^{3} b^{2} r^{9} - 8 \, a^{5} b^{6} r^{2} - 8 \, a^{3} b^{6} r^{4} + 8 \, a^{3} b^{4} r^{6}\right)} \sin\left({\theta}\right)^{4} - {\left(4 \, a^{3} b^{2} r^{10} + 3 \, a b^{2} r^{12} - 2 \, a^{5} b^{4} r^{5} + 4 \, a^{3} b^{4} r^{7} - 4 \, a b^{2} r^{11} - 8 \, a^{5} b^{6} r^{2} - 8 \, a^{3} b^{6} r^{4} + 8 \, a^{3} b^{4} r^{6} - 2 \, {\left(a^{3} b^{2} - 3 \, a b^{4}\right)} r^{9} + {\left(a^{5} b^{2} + 4 \, a b^{4}\right)} r^{8}\right)} \sin\left({\theta}\right)^{2}\right)}}{r^{18} + 8 \, b^{2} r^{15} + 24 \, b^{4} r^{12} + 32 \, b^{6} r^{9} + 16 \, b^{8} r^{6} + {\left(a^{6} r^{12} + 8 \, a^{6} b^{2} r^{9} + 24 \, a^{6} b^{4} r^{6} + 32 \, a^{6} b^{6} r^{3} + 16 \, a^{6} b^{8}\right)} \cos\left({\theta}\right)^{6} + 3 \, {\left(a^{4} r^{14} + 8 \, a^{4} b^{2} r^{11} + 24 \, a^{4} b^{4} r^{8} + 32 \, a^{4} b^{6} r^{5} + 16 \, a^{4} b^{8} r^{2}\right)} \cos\left({\theta}\right)^{4} + 3 \, {\left(a^{2} r^{16} + 8 \, a^{2} b^{2} r^{13} + 24 \, a^{2} b^{4} r^{10} + 32 \, a^{2} b^{6} r^{7} + 16 \, a^{2} b^{8} r^{4}\right)} \cos\left({\theta}\right)^{2}} \\ \mathrm{Ric}\left(g\right)_{ \, r \, r }^{ \phantom{\, r}\phantom{\, r} } & = & -\frac{12 \, {\left(2 \, b^{2} r^{7} - 2 \, b^{4} r^{4} + {\left(a^{2} b^{2} r^{5} - 4 \, a^{2} b^{4} r^{2}\right)} \cos\left({\theta}\right)^{2}\right)}}{a^{2} r^{11} + r^{13} + 6 \, a^{2} b^{2} r^{8} + 6 \, b^{2} r^{10} - 2 \, r^{12} + 12 \, a^{2} b^{4} r^{5} + 12 \, b^{4} r^{7} - 8 \, b^{2} r^{9} + 8 \, a^{2} b^{6} r^{2} + 8 \, b^{6} r^{4} - 8 \, b^{4} r^{6} + {\left(a^{4} r^{9} + a^{2} r^{11} + 6 \, a^{4} b^{2} r^{6} + 6 \, a^{2} b^{2} r^{8} - 2 \, a^{2} r^{10} + 12 \, a^{4} b^{4} r^{3} + 12 \, a^{2} b^{4} r^{5} - 8 \, a^{2} b^{2} r^{7} + 8 \, a^{4} b^{6} + 8 \, a^{2} b^{6} r^{2} - 8 \, a^{2} b^{4} r^{4}\right)} \cos\left({\theta}\right)^{2}} \\ \mathrm{Ric}\left(g\right)_{ \, {\theta} \, {\theta} }^{ \phantom{\, {\theta}}\phantom{\, {\theta}} } & = & \frac{12 \, b^{2} r^{4}}{r^{8} + 4 \, b^{2} r^{5} + 4 \, b^{4} r^{2} + {\left(a^{2} r^{6} + 4 \, a^{2} b^{2} r^{3} + 4 \, a^{2} b^{4}\right)} \cos\left({\theta}\right)^{2}} \\ \mathrm{Ric}\left(g\right)_{ \, {\phi} \, t }^{ \phantom{\, {\phi}}\phantom{\, t} } & = & \frac{12 \, {\left({\left(a^{5} b^{2} r^{8} + a^{3} b^{2} r^{10} - 2 \, a^{5} b^{4} r^{5} - 2 \, a^{3} b^{4} r^{7} - 2 \, a^{3} b^{2} r^{9} - 8 \, a^{5} b^{6} r^{2} - 8 \, a^{3} b^{6} r^{4} + 8 \, a^{3} b^{4} r^{6}\right)} \sin\left({\theta}\right)^{4} - {\left(4 \, a^{3} b^{2} r^{10} + 3 \, a b^{2} r^{12} - 2 \, a^{5} b^{4} r^{5} + 4 \, a^{3} b^{4} r^{7} - 4 \, a b^{2} r^{11} - 8 \, a^{5} b^{6} r^{2} - 8 \, a^{3} b^{6} r^{4} + 8 \, a^{3} b^{4} r^{6} - 2 \, {\left(a^{3} b^{2} - 3 \, a b^{4}\right)} r^{9} + {\left(a^{5} b^{2} + 4 \, a b^{4}\right)} r^{8}\right)} \sin\left({\theta}\right)^{2}\right)}}{r^{18} + 8 \, b^{2} r^{15} + 24 \, b^{4} r^{12} + 32 \, b^{6} r^{9} + 16 \, b^{8} r^{6} + {\left(a^{6} r^{12} + 8 \, a^{6} b^{2} r^{9} + 24 \, a^{6} b^{4} r^{6} + 32 \, a^{6} b^{6} r^{3} + 16 \, a^{6} b^{8}\right)} \cos\left({\theta}\right)^{6} + 3 \, {\left(a^{4} r^{14} + 8 \, a^{4} b^{2} r^{11} + 24 \, a^{4} b^{4} r^{8} + 32 \, a^{4} b^{6} r^{5} + 16 \, a^{4} b^{8} r^{2}\right)} \cos\left({\theta}\right)^{4} + 3 \, {\left(a^{2} r^{16} + 8 \, a^{2} b^{2} r^{13} + 24 \, a^{2} b^{4} r^{10} + 32 \, a^{2} b^{6} r^{7} + 16 \, a^{2} b^{8} r^{4}\right)} \cos\left({\theta}\right)^{2}} \\ \mathrm{Ric}\left(g\right)_{ \, {\phi} \, {\phi} }^{ \phantom{\, {\phi}}\phantom{\, {\phi}} } & = & \frac{12 \, {\left(3 \, a^{4} b^{2} r^{10} + 4 \, a^{2} b^{2} r^{12} + b^{2} r^{14} + 6 \, a^{4} b^{4} r^{7} + 10 \, a^{2} b^{4} r^{9} + 4 \, a^{2} b^{6} r^{6} - 4 \, {\left(a^{2} b^{2} - b^{4}\right)} r^{11} + 4 \, {\left(a^{2} b^{4} + b^{6}\right)} r^{8} + {\left(a^{6} b^{2} r^{8} + a^{4} b^{2} r^{10} - 2 \, a^{6} b^{4} r^{5} - 2 \, a^{4} b^{4} r^{7} - 2 \, a^{4} b^{2} r^{9} - 8 \, a^{6} b^{6} r^{2} - 8 \, a^{4} b^{6} r^{4} + 8 \, a^{4} b^{4} r^{6}\right)} \cos\left({\theta}\right)^{6} + 2 \, {\left(a^{2} b^{2} r^{12} + 2 \, a^{6} b^{4} r^{5} + 3 \, a^{4} b^{4} r^{7} - 2 \, a^{2} b^{2} r^{11} + 8 \, a^{6} b^{6} r^{2} + 6 \, a^{4} b^{6} r^{4} + {\left(2 \, a^{4} b^{2} + a^{2} b^{4}\right)} r^{9} - {\left(a^{6} b^{2} - 2 \, a^{2} b^{4}\right)} r^{8} - 2 \, {\left(4 \, a^{4} b^{4} + a^{2} b^{6}\right)} r^{6}\right)} \cos\left({\theta}\right)^{4} - {\left(4 \, a^{4} b^{2} r^{10} + 6 \, a^{2} b^{2} r^{12} + b^{2} r^{14} + 2 \, a^{6} b^{4} r^{5} + 10 \, a^{4} b^{4} r^{7} + 8 \, a^{6} b^{6} r^{2} + 4 \, a^{4} b^{6} r^{4} - 8 \, a^{4} b^{4} r^{6} - 4 \, {\left(2 \, a^{2} b^{2} - b^{4}\right)} r^{11} + 2 \, {\left(a^{4} b^{2} + 6 \, a^{2} b^{4}\right)} r^{9} - {\left(a^{6} b^{2} - 8 \, a^{2} b^{4} - 4 \, b^{6}\right)} r^{8}\right)} \cos\left({\theta}\right)^{2}\right)}}{r^{18} + 8 \, b^{2} r^{15} + 24 \, b^{4} r^{12} + 32 \, b^{6} r^{9} + 16 \, b^{8} r^{6} + {\left(a^{6} r^{12} + 8 \, a^{6} b^{2} r^{9} + 24 \, a^{6} b^{4} r^{6} + 32 \, a^{6} b^{6} r^{3} + 16 \, a^{6} b^{8}\right)} \cos\left({\theta}\right)^{6} + 3 \, {\left(a^{4} r^{14} + 8 \, a^{4} b^{2} r^{11} + 24 \, a^{4} b^{4} r^{8} + 32 \, a^{4} b^{6} r^{5} + 16 \, a^{4} b^{8} r^{2}\right)} \cos\left({\theta}\right)^{4} + 3 \, {\left(a^{2} r^{16} + 8 \, a^{2} b^{2} r^{13} + 24 \, a^{2} b^{4} r^{10} + 32 \, a^{2} b^{6} r^{7} + 16 \, a^{2} b^{8} r^{4}\right)} \cos\left({\theta}\right)^{2}} \end{array}$

We check that for $b=0$, we are dealing with a solution of the vacuum Einstein equation:

all([all([Ric[i,j].expr().subs(b=0) == 0 for i in range(4)]) for j in range(4)])
$\mathrm{True}$

The Ricci scalar:

Rscal = g.ricci_scalar()
Rscal.display()
graph = plot_profile(Rscal, {a: 0.9, b: 1}, -3, 3, r'$R$')
graph.save('ricci_scalar_HT.pdf')
graph

### Riemann tensor¶

R = g.riemann() ; print(R)
Tensor field Riem(g) of type (1,3) on the 4-dimensional differentiable manifold M
R[0,1,2,3]
$-\frac{{\left({\left(a^{7} r^{9} + a^{5} r^{11} + 10 \, a^{7} b^{2} r^{6} + 10 \, a^{5} b^{2} r^{8} - 2 \, a^{5} r^{10} + 16 \, a^{7} b^{4} r^{3} + 16 \, a^{5} b^{4} r^{5} - 16 \, a^{5} b^{2} r^{7}\right)} \cos\left({\theta}\right)^{5} - {\left(3 \, a^{7} r^{9} + 8 \, a^{5} r^{11} + 5 \, a^{3} r^{13} + 30 \, a^{7} b^{2} r^{6} + 56 \, a^{5} b^{2} r^{8} - 6 \, a^{3} r^{12} + 48 \, a^{7} b^{4} r^{3} + 80 \, a^{5} b^{4} r^{5} - 2 \, {\left(a^{5} - 13 \, a^{3} b^{2}\right)} r^{10} - 16 \, {\left(a^{5} b^{2} - 2 \, a^{3} b^{4}\right)} r^{7}\right)} \cos\left({\theta}\right)^{3} + 3 \, {\left(3 \, a^{5} r^{11} + 5 \, a^{3} r^{13} + 2 \, a r^{15} + 6 \, a^{5} b^{2} r^{8} + 10 \, a^{3} b^{2} r^{10} - 2 \, {\left(a^{3} - 2 \, a b^{2}\right)} r^{12}\right)} \cos\left({\theta}\right)\right)} \sin\left({\theta}\right)}{a^{2} r^{15} + r^{17} + 6 \, a^{2} b^{2} r^{12} + 6 \, b^{2} r^{14} - 2 \, r^{16} + 12 \, a^{2} b^{4} r^{9} + 12 \, b^{4} r^{11} - 8 \, b^{2} r^{13} + 8 \, a^{2} b^{6} r^{6} + 8 \, b^{6} r^{8} - 8 \, b^{4} r^{10} + {\left(a^{8} r^{9} + a^{6} r^{11} + 6 \, a^{8} b^{2} r^{6} + 6 \, a^{6} b^{2} r^{8} - 2 \, a^{6} r^{10} + 12 \, a^{8} b^{4} r^{3} + 12 \, a^{6} b^{4} r^{5} - 8 \, a^{6} b^{2} r^{7} + 8 \, a^{8} b^{6} + 8 \, a^{6} b^{6} r^{2} - 8 \, a^{6} b^{4} r^{4}\right)} \cos\left({\theta}\right)^{6} + 3 \, {\left(a^{6} r^{11} + a^{4} r^{13} + 6 \, a^{6} b^{2} r^{8} + 6 \, a^{4} b^{2} r^{10} - 2 \, a^{4} r^{12} + 12 \, a^{6} b^{4} r^{5} + 12 \, a^{4} b^{4} r^{7} - 8 \, a^{4} b^{2} r^{9} + 8 \, a^{6} b^{6} r^{2} + 8 \, a^{4} b^{6} r^{4} - 8 \, a^{4} b^{4} r^{6}\right)} \cos\left({\theta}\right)^{4} + 3 \, {\left(a^{4} r^{13} + a^{2} r^{15} + 6 \, a^{4} b^{2} r^{10} + 6 \, a^{2} b^{2} r^{12} - 2 \, a^{2} r^{14} + 12 \, a^{4} b^{4} r^{7} + 12 \, a^{2} b^{4} r^{9} - 8 \, a^{2} b^{2} r^{11} + 8 \, a^{4} b^{6} r^{4} + 8 \, a^{2} b^{6} r^{6} - 8 \, a^{2} b^{4} r^{8}\right)} \cos\left({\theta}\right)^{2}}$