# Predefined Metrics in Symbolic Module

### Importing some of the predefined tensors. All the metrics are comprehensively listed in EinsteinPy documentation.


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

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

### Printing the metrics for visualization
All the functions return instances of :py:class:`~einsteinpy.symbolic.metric.MetricTensor`


```python
sch = Schwarzschild()
sch.tensor()
```




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




```python
Minkowski(c=1).tensor()
```




$\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()
```




$\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()
```




$\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]$



### Calculating the scalar (Ricci) curavtures
They should be constant for De-Sitter and Anti-De-Sitter spacetimes.


```python
scalar_curvature_de_sitter = RicciScalar.from_metric(DeSitter())
scalar_curvature_anti_de_sitter = RicciScalar.from_metric(AntiDeSitter())
```


```python
scalar_curvature_de_sitter.expr
```


```python
scalar_curvature_anti_de_sitter.expr
```

On simplifying the expression we got above, we indeed obtain a constant


```python
simplify(scalar_curvature_anti_de_sitter.expr)
```

### Searching for a predefined metric
find function returns a list of available functions


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




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



76322c699f322c567d78f4eb38a105aac919d506
ipynb
Jupyter Notebook
docs/source/examples/Predefined Metrics in Symbolic Module.ipynb
r0cketr1kky/einsteinpy
d86f412736a42e2cf688a1e21d7b553868a14bc4
MIT
2019-04-07T04:01:57.000Z
2019-07-11T11:59:55.000Z
docs/source/examples/Predefined Metrics in Symbolic Module.ipynb
r0cketr1kky/einsteinpy
d86f412736a42e2cf688a1e21d7b553868a14bc4
MIT
docs/source/examples/Predefined Metrics in Symbolic Module.ipynb
r0cketr1kky/einsteinpy
d86f412736a42e2cf688a1e21d7b553868a14bc4
MIT
Qwen/Qwen-72B
1. YES
2. YES