# Eisntein Tensor calculations using Symbolic module


```python
import numpy as np
import pytest
import sympy
from sympy import cos, simplify, sin, sinh, tensorcontraction
from einsteinpy.symbolic import EinsteinTensor, MetricTensor, RicciScalar

sympy.init_printing()
```

### Defining the Anti-de Sitter spacetime Metric


```python
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 Einstein Tensor (with both indices covariant)


```python
einst = EinsteinTensor.from_metric(metric)
einst.tensor()
```

c722970826c908ce91ed41926c7dc64c5f9e02e7
ipynb
Jupyter Notebook
docs/source/examples/Einstein_Tensor_symbolic_calculation.ipynb
Varunvaruns9/einsteinpy
befc0879c65a53b811e7d6a9ec47675ae28a08c5
MIT
2019-03-08T16:13:56.000Z
2019-03-08T16:13:56.000Z
docs/source/examples/Einstein_Tensor_symbolic_calculation.ipynb
Varunvaruns9/einsteinpy
befc0879c65a53b811e7d6a9ec47675ae28a08c5
MIT
docs/source/examples/Einstein_Tensor_symbolic_calculation.ipynb
Varunvaruns9/einsteinpy
befc0879c65a53b811e7d6a9ec47675ae28a08c5
MIT
2022-03-19T18:46:13.000Z
2022-03-19T18:46:13.000Z
Qwen/Qwen-72B
1. YES
2. YES