# Ricci Tensor and Scalar Curvature calculations using Symbolic module¶

[1]:

import sympy
from sympy import cos, sin, sinh
from einsteinpy.symbolic import MetricTensor, RicciTensor, RicciScalar

sympy.init_printing()


## Defining the Anti-de Sitter spacetime Metric¶

[2]:

syms = sympy.symbols("t chi theta phi")
t, ch, th, ph = syms
m = sympy.diag(-1, cos(t) ** 2, cos(t) ** 2 * sinh(ch) ** 2, cos(t) ** 2 * sinh(ch) ** 2 * sin(th) ** 2).tolist()
metric = MetricTensor(m, syms)


## Calculating the Ricci Tensor(with both indices covariant)¶

[3]:

Ric = RicciTensor.from_metric(metric)
Ric.tensor()

[3]:

$$\left[\begin{matrix}3 & 0 & 0 & 0\\0 & - 3 \cos^{2}{\left (t \right )} & 0 & 0\\0 & 0 & \left(\sin^{2}{\left (t \right )} - 1\right) \sinh^{2}{\left (\chi \right )} - 2 \cos^{2}{\left (t \right )} \sinh^{2}{\left (\chi \right )} & 0\\0 & 0 & 0 & \left(\sin^{2}{\left (t \right )} - 1\right) \sin^{2}{\left (\theta \right )} \sinh^{2}{\left (\chi \right )} - 2 \sin^{2}{\left (\theta \right )} \cos^{2}{\left (t \right )} \sinh^{2}{\left (\chi \right )}\end{matrix}\right]$$

## Calculating the Ricci Scalar(Scalar Curvature) from the Ricci Tensor¶

[4]:

R = RicciScalar.from_riccitensor(Ric)
R.expr

[4]:

$$-12$$

The curavture is -12 which is in-line with the theoretical results