# Einstein 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()
```

0adad0af4ca525c98f6ae1d18f27abf97e959176
ipynb
Jupyter Notebook
docs/source/examples/Einstein Tensor symbolic calculation.ipynb
bibek22/einsteinpy
78bf5d942cbb12393852f8e4d7a8426f1ffe6f23
MIT
2020-06-01T18:37:53.000Z
2020-06-01T18:37:53.000Z
docs/source/examples/Einstein Tensor symbolic calculation.ipynb
bibek22/einsteinpy
78bf5d942cbb12393852f8e4d7a8426f1ffe6f23
MIT
2019-04-08T17:39:50.000Z
2019-04-11T03:10:09.000Z
docs/source/examples/Einstein Tensor symbolic calculation.ipynb
bibek22/einsteinpy
78bf5d942cbb12393852f8e4d7a8426f1ffe6f23
MIT
Qwen/Qwen-72B
1. YES
2. YES