GTRPy is a python package that allows you to calculate the well-known tensors in General Theory of Relativity.
Project description
GTRPy
GTRPy is a python package that allows you to calculate the well-known tensors in General Theory of Relativity, without writing a single line of code. Furthermore, you can apply many operations to 6 different type of fields, in both 4D and 3D.
It's tested for GNU/Linux, however it should also work in MacOS. If you ever encounter with a problem, feel free to create an issue.
Installation (via pip)
You can easily install GTRPy via
python3 -m pip install gtrpy
later on you can install the requirements by running
python3 -m pip install numpy Pillow pysimplegui sympy
Installation (via git)
If you want, you can also directly clone the repository via
git clone https://github.com/seVenVo1d/GTRPy.git
and install the requirements by running
python3 -m pip install -r requirements.txt
Requirements (Extra)
Additionally, you will also need tkinter
and LaTeX
to properly run the GTRPy. In Fedora, these can be easily installed by running
sudo dnf install python3-tkinter
sudo dnf install texlive-scheme-full
You can look for your distributions package manager and search for an equivalent installation method.
User Guide
To start GTRPy, simply run
python3 -m gtrpy.run
from the terminal (it does not matter what directory you are in, if you are installed it via pip
). This will create logs
directory under your current directory, which will contain the outputs of the performed operations.
Please take a look at the
docs/user_guide.md
for a summary of the GTRPy. To see more detailed examples, you can look at thedemos
directory.
Current Features
GR Tensor Objects
Either by using predefined coordinates, or by defining the coordinate system yourself, you can calculate:
- Inverse Metric Tensor
- Christoffel Symbol
- Riemann Tensor
- Ricci Tensor
- Ricci Scalar
- Weyl Tensor
- Traceless Ricci Tensor
- Einstein Tensor
- Kretschmann Scalar
Field Objects
Currently, there are 6 different field objects that you can carry out operations. These are:
- Scalar Field
- Type (1,0) Vector Field
- Type (0,1) Vector Field
- Type (2,0) Tensor Field
- Type (1,1) Tensor Field
- Type (0,2) Tensor Field
Operations on Fields
- Varying the type of a given vector field
- Calculating covariant and Lie derivatives for each field object (scalar, vector and tensor)
- Checking the Killing field condition for a given vector field
Overview
4D/Main Page | 3D/Main Page |
---|---|
4D/Scalar Field Operations | 4D/Vector Field Operations | 4D/Tensor Field Operations |
---|---|---|
3D/Scalar Field Operations | 3D/Vector Field Operations | 3D/Tensor Field Operations |
---|---|---|
Upcoming Features
- Raising and lowering indices for a given tensor field
- Gradient, Divergence, Curl and Laplace operations on fields
- Partial and Covariant derivatives of the GR Tensors (Christoffel Symbol, Riemann Tensor, etc.)
- Including more coordinate systems
- Adding a button that prints the equations in LaTeX form
Contributing
I am looking for developers who would like to contribute to the project. If you are interested, feel free to create an issue by stating how would you like to contribute. Any help or idea is welcomed.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.