This python code can be used to find the Christoffel Symbol, Riemann Tensor, Ricci Tensor and Ricci Scalar for a given metric.
Instructions : -
-
Install gravipy and sympy modules in python using :- In terminal type, sudo pip install gravipy and sudo pip install sympy.
-
Define the variables of your metric space. In Sympy, you have to declare symbolic variables explicitly. Example:- For cartesian space, I would define my symbols as x, y, z = symbols("x, y, z"). Note that you may need to use back-slashes ('') to escape any special characters you may be using as a symbol.
-
Declare these symbols as your cooordinate-system variables. Example:- For cartesian space, I would use C = Coordinates('\chi', [x, y, z]).
-
Define your metric matrix. Example:- For cartesian space, I would use Metric = diag(1,1,1).
-
You are ready to go!! Just cd to the directory where the code is and run the code, the corresponding quantities will be dispayed. In terminal, type cd /path_to_the_folder_where_code_is_placed and python gr.py.
-
Additional help can be found in the gravipy tutorial.