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<0r<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
(M1,(t,r,θ,ϕ))\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
(M2,(t,r,θ,ϕ))\left(M_2,(t, r, {\theta}, {\phi})\right)
forget(r<0)
assumptions()
[txisxreal,rxisxreal,thxisxreal,θ>0,θ<π,phxisxreal,ϕ>0,ϕ<2π]\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=(2r4(a2cos(θ)2+r2)(r3+2b2)1)dtdt2ar4sin(θ)2(a2cos(θ)2+r2)(r3+2b2)dtdϕ+(a2cos(θ)2+r22r4r3+2b2a2r2)drdr+(a2cos(θ)2+r2)dθdθ2ar4sin(θ)2(a2cos(θ)2+r2)(r3+2b2)dϕdt+(2a2r4sin(θ)2(a2cos(θ)2+r2)(r3+2b2)+a2+r2)sin(θ)2dϕdϕ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())
gtttt=2r4(a2cos(θ)2+r2)(r3+2b2)1gtϕtϕ=2ar4sin(θ)2(a2cos(θ)2+r2)(r3+2b2)grrrr=a2cos(θ)2+r22r4r3+2b2a2r2gθθθθ=a2cos(θ)2+r2gϕtϕt=2ar4sin(θ)2(a2cos(θ)2+r2)(r3+2b2)gϕϕϕϕ=(2a2r4sin(θ)2(a2cos(θ)2+r2)(r3+2b2)+a2+r2)sin(θ)2\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=(2r4(a2cos(θ)2+r2)(r32b2)1)dtdt2ar4sin(θ)2(a2cos(θ)2+r2)(r32b2)dtdϕ+(a2cos(θ)2+r22r4r32b2a2r2)drdr+(a2cos(θ)2+r2)dθdθ2ar4sin(θ)2(a2cos(θ)2+r2)(r32b2)dϕdt+(2a2r4sin(θ)2(a2cos(θ)2+r2)(r32b2)+a2+r2)sin(θ)2dϕdϕ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())
gtttt=2r4(a2cos(θ)2+r2)(r32b2)1gtϕtϕ=2ar4sin(θ)2(a2cos(θ)2+r2)(r32b2)grrrr=a2cos(θ)2+r22r4r32b2a2r2gθθθθ=a2cos(θ)2+r2gϕtϕt=2ar4sin(θ)2(a2cos(θ)2+r2)(r32b2)gϕϕϕϕ=(2a2r4sin(θ)2(a2cos(θ)2+r2)(r32b2)+a2+r2)sin(θ)2\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())
g1=(2a2r4sin(θ)2+a2r5+r7+2a2b2r2+2b2r4+(a4r3+a2r5+2a4b2+2a2b2r2)cos(θ)2a2r5+r7+2a2b2r2+2b2r42r6+(a4r3+a2r5+2a4b2+2a2b2r22a2r4)cos(θ)2)tt+(2ar4a2r5+r7+2a2b2r2+2b2r42r6+(a4r3+a2r5+2a4b2+2a2b2r22a2r4)cos(θ)2)tϕ+(a2r3+r5+2a2b2+2b2r22r4r5+2b2r2+(a2r3+2a2b2)cos(θ)2)rr+(1a2cos(θ)2+r2)θθ+(2ar4a2r5+r7+2a2b2r2+2b2r42r6+(a4r3+a2r5+2a4b2+2a2b2r22a2r4)cos(θ)2)ϕt+(r5+2b2r22r4+(a2r3+2a2b2)cos(θ)22a2r4sin(θ)4+(a2r5+r7+2a2b2r22r62(a2b2)r4+(a4r3+a2r5+2a4b2+2a2b2r2)cos(θ)2)sin(θ)2)ϕϕ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())
g1=(2a2r4sin(θ)2+a2r5+r72a2b2r22b2r4+(a4r3+a2r52a4b22a2b2r2)cos(θ)2a2r5+r72a2b2r22b2r42r6+(a4r3+a2r52a4b22a2b2r22a2r4)cos(θ)2)tt+(2ar4a2r5+r72a2b2r22b2r42r6+(a4r3+a2r52a4b22a2b2r22a2r4)cos(θ)2)tϕ+(a2r3+r52a2b22b2r22r4r52b2r2+(a2r32a2b2)cos(θ)2)rr+(1a2cos(θ)2+r2)θθ+(2ar4a2r5+r72a2b2r22b2r42r6+(a4r3+a2r52a4b22a2b2r22a2r4)cos(θ)2)ϕt+(r52b2r22r4+(a2r32a2b2)cos(θ)22a2r4sin(θ)4+(a2r5+r72a2b2r22r62(a2+b2)r4+(a4r3+a2r52a4b22a2b2r2)cos(θ)2)sin(θ)2)ϕϕ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())

gttg_{tt} component

g.restrict(M1)[0,0]
2r4(a2cos(θ)2+r2)(r3+2b2)1\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]
2r4(a2cos(θ)2+r2)(r32b2)1\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 NN is deduced from the standard formula gtt=1/N2g^{tt} = - 1/N^2:

M.top_charts()
[(M1,(t,r,θ,ϕ)),(M2,(t,r,θ,ϕ))]\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

gtϕ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()
(a4r3cos(θ)2+a2r5cos(θ)2+2a4b2cos(θ)2+2a2b2r2cos(θ)2+2a2r4sin(θ)2+a2r5+r7+2a2b2r2+2b2r4)sin(θ)2(a2cos(θ)2+r2)(r3+2b2)\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()
(a4r3cos(θ)2+a2r5cos(θ)22a4b2cos(θ)22a2b2r2cos(θ)2+2a2r4sin(θ)2+a2r5+r72a2b2r22b2r4)sin(θ)2(a2cos(θ)2+r2)(r32b2)\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())
Ric(g)tttt=12(3a2b2r10+2b2r12+6a2b4r7+2b4r94b2r114b6r6+4b4r8+(a4b2r82a4b4r56a2b4r72a2b2r98a4b6r212a2b6r4+8a2b4r6)cos(θ)2)r18+8b2r15+24b4r12+32b6r9+16b8r6+(a6r12+8a6b2r9+24a6b4r6+32a6b6r3+16a6b8)cos(θ)6+3(a4r14+8a4b2r11+24a4b4r8+32a4b6r5+16a4b8r2)cos(θ)4+3(a2r16+8a2b2r13+24a2b4r10+32a2b6r7+16a2b8r4)cos(θ)2Ric(g)tϕtϕ=12((a5b2r8+a3b2r102a5b4r52a3b4r72a3b2r98a5b6r28a3b6r4+8a3b4r6)sin(θ)4(4a3b2r10+3ab2r122a5b4r5+4a3b4r74ab2r118a5b6r28a3b6r4+8a3b4r62(a3b23ab4)r9+(a5b2+4ab4)r8)sin(θ)2)r18+8b2r15+24b4r12+32b6r9+16b8r6+(a6r12+8a6b2r9+24a6b4r6+32a6b6r3+16a6b8)cos(θ)6+3(a4r14+8a4b2r11+24a4b4r8+32a4b6r5+16a4b8r2)cos(θ)4+3(a2r16+8a2b2r13+24a2b4r10+32a2b6r7+16a2b8r4)cos(θ)2Ric(g)rrrr=12(2b2r72b4r4+(a2b2r54a2b4r2)cos(θ)2)a2r11+r13+6a2b2r8+6b2r102r12+12a2b4r5+12b4r78b2r9+8a2b6r2+8b6r48b4r6+(a4r9+a2r11+6a4b2r6+6a2b2r82a2r10+12a4b4r3+12a2b4r58a2b2r7+8a4b6+8a2b6r28a2b4r4)cos(θ)2Ric(g)θθθθ=12b2r4r8+4b2r5+4b4r2+(a2r6+4a2b2r3+4a2b4)cos(θ)2Ric(g)ϕtϕt=12((a5b2r8+a3b2r102a5b4r52a3b4r72a3b2r98a5b6r28a3b6r4+8a3b4r6)sin(θ)4(4a3b2r10+3ab2r122a5b4r5+4a3b4r74ab2r118a5b6r28a3b6r4+8a3b4r62(a3b23ab4)r9+(a5b2+4ab4)r8)sin(θ)2)r18+8b2r15+24b4r12+32b6r9+16b8r6+(a6r12+8a6b2r9+24a6b4r6+32a6b6r3+16a6b8)cos(θ)6+3(a4r14+8a4b2r11+24a4b4r8+32a4b6r5+16a4b8r2)cos(θ)4+3(a2r16+8a2b2r13+24a2b4r10+32a2b6r7+16a2b8r4)cos(θ)2Ric(g)ϕϕϕϕ=12(3a4b2r10+4a2b2r12+b2r14+6a4b4r7+10a2b4r9+4a2b6r64(a2b2b4)r11+4(a2b4+b6)r8+(a6b2r8+a4b2r102a6b4r52a4b4r72a4b2r98a6b6r28a4b6r4+8a4b4r6)cos(θ)6+2(a2b2r12+2a6b4r5+3a4b4r72a2b2r11+8a6b6r2+6a4b6r4+(2a4b2+a2b4)r9(a6b22a2b4)r82(4a4b4+a2b6)r6)cos(θ)4(4a4b2r10+6a2b2r12+b2r14+2a6b4r5+10a4b4r7+8a6b6r2+4a4b6r48a4b4r64(2a2b2b4)r11+2(a4b2+6a2b4)r9(a6b28a2b44b6)r8)cos(θ)2)r18+8b2r15+24b4r12+32b6r9+16b8r6+(a6r12+8a6b2r9+24a6b4r6+32a6b6r3+16a6b8)cos(θ)6+3(a4r14+8a4b2r11+24a4b4r8+32a4b6r5+16a4b8r2)cos(θ)4+3(a2r16+8a2b2r13+24a2b4r10+32a2b6r7+16a2b8r4)cos(θ)2\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=0b=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)])
True\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]
((a7r9+a5r11+10a7b2r6+10a5b2r82a5r10+16a7b4r3+16a5b4r516a5b2r7)cos(θ)5(3a7r9+8a5r11+5a3r13+30a7b2r6+56a5b2r86a3r12+48a7b4r3+80a5b4r52(a513a3b2)r1016(a5b22a3b4)r7)cos(θ)3+3(3a5r11+5a3r13+2ar15+6a5b2r8+10a3b2r102(a32ab2)r12)cos(θ))sin(θ)a2r15+r17+6a2b2r12+6b2r142r16+12a2b4r9+12b4r118b2r13+8a2b6r6+8b6r88b4r10+(a8r9+a6r11+6a8b2r6+6a6b2r82a6r10+12a8b4r3+12a6b4r58a6b2r7+8a8b6+8a6b6r28a6b4r4)cos(θ)6+3(a6r11+a4r13+6a6b2r8+6a4b2r102a4r12+12a6b4r5+12a4b4r78a4b2r9+8a6b6r2+8a4b6r48a4b4r6)cos(θ)4+3(a4r13+a2r15+6a4b2r10+6a2b2r122a2r14+12a4b4r7+12a2b4r98a2b2r11+8a4b6r4+8a2b6r68a2b4r8)cos(θ)2-\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}}