The 5-dimensional Kerr-AdS spacetime has been treated there.
The Riemann tensor was computed in a reasonable time (it is not shown in the notebook but its computation was triggered by `g.ricci()`

in cell 12). Since the 4-dimensional case should a priori be simpler, you could get some inspiration from this notebook (note the use of $\mu = \cos\theta$ instead of $\theta$).

**Update (28 Nov 2023)**:
Thanks for sharing the code in the above comment. There were actually some errors in the entries for the metric components $g_{00}$ (a factor `E ^2`

was missing), $g_{03}$ (`E`

should be replaced by `E^2`

) and $g_{33}$ (idem). Compare with Table 1 of https://arxiv.org/abs/1805.00243. Here are the corrected components (the commented lines are the original ones):

```
g = M.metric()
rho2 = r^2 + (a*cos(th))^2
Delta = (r^2 + a^2)*(1 - H^2*r^2) -2*m*r
Sigma = 1 + H^2*a^2*cos(th)^2
E = 1 + H^2*a^2
#g[0,0] = -(Delta - a^2*sin(th)^2*Sigma)/rho2
g[0,0] = -(Delta - a^2*sin(th)^2*Sigma)/(rho2*E^2)
#g[0,3] = -(a*sin(th)^2)*((r^2 + a^2)*Sigma - Delta)/(rho2*E)
g[0,3] = -(a*sin(th)^2)*((r^2 + a^2)*Sigma - Delta)/(rho2*E^2)
g[1,1], g[2,2] = rho2/Delta, rho2/Sigma
#g[3,3] = (sin(th)^2/(rho2*E))*((r^2 + a^2)^2*Sigma - Delta*a^2*sin(th)^2)
g[3,3] = (sin(th)^2/(rho2*E^2))*((r^2 + a^2)^2*Sigma - Delta*a^2*sin(th)^2)
```

As a test that this is the correct Kerr-de Sitter metric, one can check the Einstein equation:

```
g.ricci() == 3*H^2*g
```

returns `True`

.

With the corrected metric, the Riemann tensor is computed in 1 min 8 s on my Ubuntu 22.04 lntel Xeon E5-2623 computer running Sage 10.1 with parallization on 8 cores (switched on via `Parallelism().set(nproc=8)`

) and the Kretschmann scalar is computed in 3 min 55 s. Here is the result (outcome of `Kr_scalar.expr().factor()`

):

$$ \frac{24 \, {\left(H^{4} a^{12} \cos\left({\theta}\right)^{12} + 6 \, H^{4} a^{10} r^{2} \cos\left({\theta}\right)^{10} + 15 \, H^{4} a^{8} r^{4} \cos\left({\theta}\right)^{8} + 20 \, H^{4} a^{6} r^{6} \cos\left({\theta}\right)^{6} + 15 \, H^{4} a^{4} r^{8} \cos\left({\theta}\right)^{4} + 6 \, H^{4} a^{2} r^{10} \cos\left({\theta}\right)^{2} + H^{4} r^{12} - 2 \, a^{6} m^{2} \cos\left({\theta}\right)^{6} + 30 \, a^{4} m^{2} r^{2} \cos\left({\theta}\right)^{4} - 30 \, a^{2} m^{2} r^{4} \cos\left({\theta}\right)^{2} + 2 \, m^{2} r^{6}\right)}}{{\left(a^{2} \cos\left({\theta}\right)^{2} + r^{2}\right)}^{6}}$$

**Note on the computational time:** the rather long computational time (a few minutes for the Kretschmann scalar) is due to the default simplification chain used by SageMath for calculus on manifolds. The computational time can be significantly reduced by customizing the simplification chain via the method set_simplify_function and using $\mu := \cos\theta$ as a coordinate instead of $\theta$. For instance, introducing $\mu$ and setting

```
M.set_simplify_function(factor)
```

just after the definition of the chart $(t,r,\mu,\phi)$ yields a computational time of only 4 seconds for the Riemann tensor and 6 seconds for the Kretschmann scalar.

As general advice, try to give your metric in a closed form as much as you can. For example, instead of (r^2 + a^2*(cosθ)^2), use rho(r,theta), Delta_r(r), etc. Then perform the calculations. After everything is set, put the actual functions and simplify. If this cannot help, please share your code and we will see what we can do.

@tolga thanks for the comment, I have given my metric in closed form, but it is still not working. I want to give you the code please tell me how I can give it

Please check the answer of @eric_g below. If it does not work out, you can gather your code in one cell and paste it here, or upload it to your GitHub as a public file and share the link.

@tolga here is the link http://localhost:8888/notebooks/Untitled51.ipynb (http://localhost:8888/notebooks/Untit...)

@tolga here is the actual one I tried http://localhost:8889/notebooks/Untitled50.ipynb (http://localhost:8889/notebooks/Untit...)