```python
from einsteinpy.symbolic.predefined import Schwarzschild, DeSitter, AntiDeSitter, Minkowski, find
from einsteinpy.symbolic import RicciTensor, RicciScalar, ChristoffelSymbols, RiemannCurvatureTensor, WeylTensor
import sympy
from sympy import simplify

sympy.init_printing()  # for pretty printing
```


```python
sch = Schwarzschild(c=1) # Define Schwarzschild metric in natural units
sch.tensor()
```




$\displaystyle \left[\begin{matrix}1 - \frac{r_{s}}{r} & 0 & 0 & 0\\0 & - \frac{1}{1 - \frac{r_{s}}{r}} & 0 & 0\\0 & 0 & - r^{2} & 0\\0 & 0 & 0 & - r^{2} \sin^{2}{\left(\theta \right)}\end{matrix}\right]$




```python
Minkowski(c=1).tensor() # Minkowski Spacetime in natural units
```




$\displaystyle \left[\begin{matrix}-1 & 0 & 0 & 0\\0 & 1.0 & 0 & 0\\0 & 0 & 1.0 & 0\\0 & 0 & 0 & 1.0\end{matrix}\right]$




```python
DeSitter().tensor() # de Sitter metric 
```




$\displaystyle \left[\begin{matrix}-1 & 0 & 0 & 0\\0 & e^{\frac{2 x}{\alpha}} & 0 & 0\\0 & 0 & e^{\frac{2 x}{\alpha}} & 0\\0 & 0 & 0 & e^{\frac{2 x}{\alpha}}\end{matrix}\right]$




```python
AntiDeSitter().tensor() # anti de Sitter Metric
```




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




```python
find("sitter")
```




    ['AntiDeSitter', 'AntiDeSitterStatic', 'DeSitter']




```python
ch = ChristoffelSymbols.from_metric(sch)  # Compute Christoffel Symbols from Schwarzschild metric
ch.tensor()
```




$\displaystyle \left[\begin{matrix}\left[\begin{matrix}0 & \frac{r_{s}}{2 r^{2} \left(1 - \frac{r_{s}}{r}\right)} & 0 & 0\\\frac{r_{s}}{2 r^{2} \left(1 - \frac{r_{s}}{r}\right)} & 0 & 0 & 0\\0 & 0 & 0 & 0\\0 & 0 & 0 & 0\end{matrix}\right] & \left[\begin{matrix}- \frac{r_{s} \left(- \frac{1}{2} + \frac{r_{s}}{2 r}\right)}{r^{2}} & 0 & 0 & 0\\0 & \frac{r_{s} \left(- \frac{1}{2} + \frac{r_{s}}{2 r}\right)}{r^{2} \left(1 - \frac{r_{s}}{r}\right)^{2}} & 0 & 0\\0 & 0 & 2 r \left(- \frac{1}{2} + \frac{r_{s}}{2 r}\right) & 0\\0 & 0 & 0 & 2 r \left(- \frac{1}{2} + \frac{r_{s}}{2 r}\right) \sin^{2}{\left(\theta \right)}\end{matrix}\right] & \left[\begin{matrix}0 & 0 & 0 & 0\\0 & 0 & \frac{1}{r} & 0\\0 & \frac{1}{r} & 0 & 0\\0 & 0 & 0 & - \sin{\left(\theta \right)} \cos{\left(\theta \right)}\end{matrix}\right] & \left[\begin{matrix}0 & 0 & 0 & 0\\0 & 0 & 0 & \frac{1}{r}\\0 & 0 & 0 & \frac{\cos{\left(\theta \right)}}{\sin{\left(\theta \right)}}\\0 & \frac{1}{r} & \frac{\cos{\left(\theta \right)}}{\sin{\left(\theta \right)}} & 0\end{matrix}\right]\end{matrix}\right]$




```python
Rm1 = RiemannCurvatureTensor.from_christoffels(ch) # Compute Riemann Curvature Tensor from Christoffel Symbols
Rm1.tensor()
```




$\displaystyle \left[\begin{matrix}\left[\begin{matrix}0 & 0 & 0 & 0\\0 & - \frac{r_{s}}{r^{2} \left(r - r_{s}\right)} & 0 & 0\\0 & 0 & \frac{r_{s}}{2 r} & 0\\0 & 0 & 0 & \frac{r_{s} \sin^{2}{\left(\theta \right)}}{2 r}\end{matrix}\right] & \left[\begin{matrix}0 & \frac{r_{s}}{r^{2} \left(r - r_{s}\right)} & 0 & 0\\0 & 0 & 0 & 0\\0 & 0 & 0 & 0\\0 & 0 & 0 & 0\end{matrix}\right] & \left[\begin{matrix}0 & 0 & - \frac{r_{s}}{2 r} & 0\\0 & 0 & 0 & 0\\0 & 0 & 0 & 0\\0 & 0 & 0 & 0\end{matrix}\right] & \left[\begin{matrix}0 & 0 & 0 & - \frac{r_{s} \sin^{2}{\left(\theta \right)}}{2 r}\\0 & 0 & 0 & 0\\0 & 0 & 0 & 0\\0 & 0 & 0 & 0\end{matrix}\right]\\\left[\begin{matrix}0 & 0 & 0 & 0\\- \frac{r_{s} \left(r - r_{s}\right)}{r^{4}} & 0 & 0 & 0\\0 & 0 & 0 & 0\\0 & 0 & 0 & 0\end{matrix}\right] & \left[\begin{matrix}\frac{r_{s} \left(r - r_{s}\right)}{r^{4}} & 0 & 0 & 0\\0 & 0 & 0 & 0\\0 & 0 & \frac{r_{s}}{2 r} & 0\\0 & 0 & 0 & \frac{r_{s} \sin^{2}{\left(\theta \right)}}{2 r}\end{matrix}\right] & \left[\begin{matrix}0 & 0 & 0 & 0\\0 & 0 & - \frac{r_{s}}{2 r} & 0\\0 & 0 & 0 & 0\\0 & 0 & 0 & 0\end{matrix}\right] & \left[\begin{matrix}0 & 0 & 0 & 0\\0 & 0 & 0 & - \frac{r_{s} \sin^{2}{\left(\theta \right)}}{2 r}\\0 & 0 & 0 & 0\\0 & 0 & 0 & 0\end{matrix}\right]\\\left[\begin{matrix}0 & 0 & 0 & 0\\0 & 0 & 0 & 0\\\frac{r_{s} \left(r - r_{s}\right)}{2 r^{4}} & 0 & 0 & 0\\0 & 0 & 0 & 0\end{matrix}\right] & \left[\begin{matrix}0 & 0 & 0 & 0\\0 & 0 & 0 & 0\\0 & - \frac{r_{s}}{2 r^{2} \left(r - r_{s}\right)} & 0 & 0\\0 & 0 & 0 & 0\end{matrix}\right] & \left[\begin{matrix}- \frac{r_{s} \left(r - r_{s}\right)}{2 r^{4}} & 0 & 0 & 0\\0 & \frac{r_{s}}{2 r^{2} \left(r - r_{s}\right)} & 0 & 0\\0 & 0 & 0 & 0\\0 & 0 & 0 & - \frac{r_{s} \sin^{2}{\left(\theta \right)}}{r}\end{matrix}\right] & \left[\begin{matrix}0 & 0 & 0 & 0\\0 & 0 & 0 & 0\\0 & 0 & 0 & \frac{r_{s} \sin^{2}{\left(\theta \right)}}{r}\\0 & 0 & 0 & 0\end{matrix}\right]\\\left[\begin{matrix}0 & 0 & 0 & 0\\0 & 0 & 0 & 0\\0 & 0 & 0 & 0\\\frac{r_{s} \left(r - r_{s}\right)}{2 r^{4}} & 0 & 0 & 0\end{matrix}\right] & \left[\begin{matrix}0 & 0 & 0 & 0\\0 & 0 & 0 & 0\\0 & 0 & 0 & 0\\0 & - \frac{r_{s}}{2 r^{2} \left(r - r_{s}\right)} & 0 & 0\end{matrix}\right] & \left[\begin{matrix}0 & 0 & 0 & 0\\0 & 0 & 0 & 0\\0 & 0 & 0 & 0\\0 & 0 & \frac{r_{s}}{r} & 0\end{matrix}\right] & \left[\begin{matrix}- \frac{r_{s} \left(r - r_{s}\right)}{2 r^{4}} & 0 & 0 & 0\\0 & \frac{r_{s}}{2 r^{2} \left(r - r_{s}\right)} & 0 & 0\\0 & 0 & - \frac{r_{s}}{r} & 0\\0 & 0 & 0 & 0\end{matrix}\right]\end{matrix}\right]$




```python
wt = WeylTensor.from_metric(sch) # Compute Weyl tensor from Schwarzschild metric
wt.tensor()
```




$\displaystyle \left[\begin{matrix}\left[\begin{matrix}0 & 0 & 0 & 0\\0 & - \frac{r_{s}}{r^{3}} & 0 & 0\\0 & 0 & \frac{r_{s} \left(r - r_{s}\right)}{2 r^{2}} & 0\\0 & 0 & 0 & \frac{r_{s} \left(r - r_{s}\right) \sin^{2}{\left(\theta \right)}}{2 r^{2}}\end{matrix}\right] & \left[\begin{matrix}0 & \frac{r_{s}}{r^{3}} & 0 & 0\\0 & 0 & 0 & 0\\0 & 0 & 0 & 0\\0 & 0 & 0 & 0\end{matrix}\right] & \left[\begin{matrix}0 & 0 & - \frac{r_{s} \left(r - r_{s}\right)}{2 r^{2}} & 0\\0 & 0 & 0 & 0\\0 & 0 & 0 & 0\\0 & 0 & 0 & 0\end{matrix}\right] & \left[\begin{matrix}0 & 0 & 0 & - \frac{r_{s} \left(r - r_{s}\right) \sin^{2}{\left(\theta \right)}}{2 r^{2}}\\0 & 0 & 0 & 0\\0 & 0 & 0 & 0\\0 & 0 & 0 & 0\end{matrix}\right]\\\left[\begin{matrix}0 & 0 & 0 & 0\\\frac{r_{s}}{r^{3}} & 0 & 0 & 0\\0 & 0 & 0 & 0\\0 & 0 & 0 & 0\end{matrix}\right] & \left[\begin{matrix}- \frac{r_{s}}{r^{3}} & 0 & 0 & 0\\0 & 0 & 0 & 0\\0 & 0 & - \frac{r_{s}}{2 r - 2 r_{s}} & 0\\0 & 0 & 0 & - \frac{r_{s} \sin^{2}{\left(\theta \right)}}{2 r - 2 r_{s}}\end{matrix}\right] & \left[\begin{matrix}0 & 0 & 0 & 0\\0 & 0 & \frac{r_{s}}{2 \left(r - r_{s}\right)} & 0\\0 & 0 & 0 & 0\\0 & 0 & 0 & 0\end{matrix}\right] & \left[\begin{matrix}0 & 0 & 0 & 0\\0 & 0 & 0 & \frac{r_{s} \sin^{2}{\left(\theta \right)}}{2 \left(r - r_{s}\right)}\\0 & 0 & 0 & 0\\0 & 0 & 0 & 0\end{matrix}\right]\\\left[\begin{matrix}0 & 0 & 0 & 0\\0 & 0 & 0 & 0\\- \frac{r_{s} \left(r - r_{s}\right)}{2 r^{2}} & 0 & 0 & 0\\0 & 0 & 0 & 0\end{matrix}\right] & \left[\begin{matrix}0 & 0 & 0 & 0\\0 & 0 & 0 & 0\\0 & \frac{r_{s}}{2 \left(r - r_{s}\right)} & 0 & 0\\0 & 0 & 0 & 0\end{matrix}\right] & \left[\begin{matrix}\frac{r_{s} \left(r - r_{s}\right)}{2 r^{2}} & 0 & 0 & 0\\0 & - \frac{r_{s}}{2 r - 2 r_{s}} & 0 & 0\\0 & 0 & 0 & 0\\0 & 0 & 0 & r r_{s} \sin^{2}{\left(\theta \right)}\end{matrix}\right] & \left[\begin{matrix}0 & 0 & 0 & 0\\0 & 0 & 0 & 0\\0 & 0 & 0 & - r r_{s} \sin^{2}{\left(\theta \right)}\\0 & 0 & 0 & 0\end{matrix}\right]\\\left[\begin{matrix}0 & 0 & 0 & 0\\0 & 0 & 0 & 0\\0 & 0 & 0 & 0\\- \frac{r_{s} \left(r - r_{s}\right) \sin^{2}{\left(\theta \right)}}{2 r^{2}} & 0 & 0 & 0\end{matrix}\right] & \left[\begin{matrix}0 & 0 & 0 & 0\\0 & 0 & 0 & 0\\0 & 0 & 0 & 0\\0 & \frac{r_{s} \sin^{2}{\left(\theta \right)}}{2 \left(r - r_{s}\right)} & 0 & 0\end{matrix}\right] & \left[\begin{matrix}0 & 0 & 0 & 0\\0 & 0 & 0 & 0\\0 & 0 & 0 & 0\\0 & 0 & - r r_{s} \sin^{2}{\left(\theta \right)} & 0\end{matrix}\right] & \left[\begin{matrix}\frac{r_{s} \left(r - r_{s}\right) \sin^{2}{\left(\theta \right)}}{2 r^{2}} & 0 & 0 & 0\\0 & - \frac{r_{s} \sin^{2}{\left(\theta \right)}}{2 r - 2 r_{s}} & 0 & 0\\0 & 0 & r r_{s} \sin^{2}{\left(\theta \right)} & 0\\0 & 0 & 0 & 0\end{matrix}\right]\end{matrix}\right]$




```python

```

8ff3dcbeaa8553a56f2864aa7a7c41ead277e305
ipynb
Jupyter Notebook
Common Metrics and Spacetimes.ipynb
SheepWaitForWolf/General-Relativity
e9eb0f8cc65be9368c6648c8afaa1f8e631516a8
MIT
2021-06-04T11:01:54.000Z
2021-06-04T11:01:54.000Z
Common Metrics and Spacetimes.ipynb
SheepWaitForWolf/General-Relativity
e9eb0f8cc65be9368c6648c8afaa1f8e631516a8
MIT
Common Metrics and Spacetimes.ipynb
SheepWaitForWolf/General-Relativity
e9eb0f8cc65be9368c6648c8afaa1f8e631516a8
MIT
Qwen/Qwen-72B
1. YES
2. YES