geodpy


Namegeodpy JSON
Version 1.0.3 PyPI version JSON
download
home_pageNone
SummaryComputes space-time geodesics given an arbitrary metric and initial conditions.
upload_time2024-09-06 21:16:11
maintainerNone
docs_urlNone
authorNone
requires_python>=3.12
licenseMIT License Copyright (c) 2024 Benjamin Gauthier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords general relativity geodesics geodesic gr astrophysics astronomy physics riemann riemann geometry geometry metric space-time spacetime
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # geodpy
This code aims to simulate geodesics given an arbitrary space-time metric.

## Capabilities
- Calculate symbolic geodesics
- Solve the trajectory of a body given an arbitrary metric and symbolic geodesics.
- Calculate the norm of the velocity of a body.
- Plot the trajectories on matplotlib in both 2D and 3D.

## Installation using `pip`
To install the package using pip, first create a virtual python environment in your working directory and activate the environment:
```bash
python -m venv venv
source venv/bin/activate
```

Then, simply install the package using:
```bash
pip install geodpy
```

Depending on your system, you might also need to install manually PyQt5 or PyQt6, which are needed by `matplotlib` to render the plots dynamically. **Also note that by using this method of installation, you do not get access to the hardcoded examples and the documentation**. Both of these are currently only available through the GitHub repository. The `pip` method of installation only grants you access to all the classes and functions of the library.


## Installation using `git`
To install the package from git, you will need to download these dependencies:

- `matplotlib`
- `sympy`
- `scipy`
- `numpy`

Make sure these modules are correctly installed. More specifically, the package `matplotlib` might require the installation of PyQt5 or PyQt6 depending on your system. You can install these dependencies using:
```bash
pip install matplotlib numpy scipy sympy
```

Clone the repository and go to the main folder `geodpy`. You can use these commands:
```bash
git clone https://github.com/Sneaker679/geodpy
cd geodpy
```

In order to be able to import the classes and functions of this library, you will need to add the `./src` folder to your PYTHON PATH. Move to this folder using:
```bash
cd src
```
Then, run the following command to add it to your PYTHON PATH:
```bash
export PYTHONPATH="$(pwd):$PYTHONPATH"
```
To add the folder permanently to your PYTHON PATH, run this command instead:
```bash
echo 'export PYTHONPATH="$HOME'${PWD/#$HOME/}':$PYTHONPATH"' >> $HOME/.bashrc
```
Or, for zsh terminals, run this:
```bash
echo 'export PYTHONPATH="$HOME'${PWD/#$HOME/}':$PYTHONPATH"' >> $HOME/.zshrc
```

## Basic Usage -> Using the examples

### Example with the Schwarzschild metric
In the `./examples/1_schwarzschild` folder, run any of the python files except for `schwarzschild.py` (since it acts as a module for the other files). For instance, you could run:
```bash
python3 2_crashing_traj.py
```
which will run a configuration of the Schwarzschild metric where a body is falling into a Schwarzschild black hole. A plot should be displayed on the screen using `matplotlib`.

### Structure of the examples
With the last example in mind, here is a more detailed overlook of how the examples are structured. This section will make it easier to understand how you can customize the orbits to your liking and experiment with the code.

In the `examples` folder are many examples that simulate geodesics with varied metrics, including the Schwarzschild, Kerr and Schwarzschild de Sitter metric. All these folders work in the same way. Taking the schwarzschild folder as an example, inside it are many files, the main one being `schwarzschild.py`. This script acts as a python module for the other files. Inside this code, there is a `schwarzschild()` function, which you can call with varied parameters to generate different geodesics. The other files in the `schwarzschild` folder are simple sripts who call the `schwarzschild()` function with different initial values. As it was shown in the previous section, the `2_crashing_traj.py` script, for example, yields a geodesic simulated near the event horizon of a non rotating Schwarzschild blackhole. You can run the other examples in the other folders the same way.

The README inside each example folders specifies the meaning of the constants and quantities used.

## Advanced Usage
For more advance usages, refer to `./docs/1_HowTo_trajectories.md`, `./docs/2_HowTo_coordinates.md` and `./docs/3_HowTo_plotters.md`.

## Interface
If you wish to see a more detailed overview of all the classes and functions at your disposition, be sure to checkout the `./docs/class_documentation/`. There are many Markdown files there explaining how all the classes and functions work. The REAMDEs in this folder also specify how you can import them.

## Numerical errors
Since this code uses a generalized approach to solving geodesics, it is prone to significant numerical errors, especially for metrics with complicated algebraic geodesics expressions. For instance, the `3_kerr` example has a lot of numerical errors because the metric is not diagonal and its geodesics are very complex. Be mindful of this when you want accurate results.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "geodpy",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.12",
    "maintainer_email": null,
    "keywords": "general relativity, geodesics, geodesic, gr, astrophysics, astronomy, physics, riemann, riemann geometry, geometry, metric, space-time, spacetime",
    "author": null,
    "author_email": "Benjamin Gauthier <benjamin.gauthier@hotmail.ca>",
    "download_url": "https://files.pythonhosted.org/packages/6e/3c/aa53a482bb413efbd64ed834c360a4174537cdb6a9e99a592e65d4502850/geodpy-1.0.3.tar.gz",
    "platform": null,
    "description": "# geodpy\nThis code aims to simulate geodesics given an arbitrary space-time metric.\n\n## Capabilities\n- Calculate symbolic geodesics\n- Solve the trajectory of a body given an arbitrary metric and symbolic geodesics.\n- Calculate the norm of the velocity of a body.\n- Plot the trajectories on matplotlib in both 2D and 3D.\n\n## Installation using `pip`\nTo install the package using pip, first create a virtual python environment in your working directory and activate the environment:\n```bash\npython -m venv venv\nsource venv/bin/activate\n```\n\nThen, simply install the package using:\n```bash\npip install geodpy\n```\n\nDepending on your system, you might also need to install manually PyQt5 or PyQt6, which are needed by `matplotlib` to render the plots dynamically. **Also note that by using this method of installation, you do not get access to the hardcoded examples and the documentation**. Both of these are currently only available through the GitHub repository. The `pip` method of installation only grants you access to all the classes and functions of the library.\n\n\n## Installation using `git`\nTo install the package from git, you will need to download these dependencies:\n\n- `matplotlib`\n- `sympy`\n- `scipy`\n- `numpy`\n\nMake sure these modules are correctly installed. More specifically, the package `matplotlib` might require the installation of PyQt5 or PyQt6 depending on your system. You can install these dependencies using:\n```bash\npip install matplotlib numpy scipy sympy\n```\n\nClone the repository and go to the main folder `geodpy`. You can use these commands:\n```bash\ngit clone https://github.com/Sneaker679/geodpy\ncd geodpy\n```\n\nIn order to be able to import the classes and functions of this library, you will need to add the `./src` folder to your PYTHON PATH. Move to this folder using:\n```bash\ncd src\n```\nThen, run the following command to add it to your PYTHON PATH:\n```bash\nexport PYTHONPATH=\"$(pwd):$PYTHONPATH\"\n```\nTo add the folder permanently to your PYTHON PATH, run this command instead:\n```bash\necho 'export PYTHONPATH=\"$HOME'${PWD/#$HOME/}':$PYTHONPATH\"' >> $HOME/.bashrc\n```\nOr, for zsh terminals, run this:\n```bash\necho 'export PYTHONPATH=\"$HOME'${PWD/#$HOME/}':$PYTHONPATH\"' >> $HOME/.zshrc\n```\n\n## Basic Usage -> Using the examples\n\n### Example with the Schwarzschild metric\nIn the `./examples/1_schwarzschild` folder, run any of the python files except for `schwarzschild.py` (since it acts as a module for the other files). For instance, you could run:\n```bash\npython3 2_crashing_traj.py\n```\nwhich will run a configuration of the Schwarzschild metric where a body is falling into a Schwarzschild black hole. A plot should be displayed on the screen using `matplotlib`.\n\n### Structure of the examples\nWith the last example in mind, here is a more detailed overlook of how the examples are structured. This section will make it easier to understand how you can customize the orbits to your liking and experiment with the code.\n\nIn the `examples` folder are many examples that simulate geodesics with varied metrics, including the Schwarzschild, Kerr and Schwarzschild de Sitter metric. All these folders work in the same way. Taking the schwarzschild folder as an example, inside it are many files, the main one being `schwarzschild.py`. This script acts as a python module for the other files. Inside this code, there is a `schwarzschild()` function, which you can call with varied parameters to generate different geodesics. The other files in the `schwarzschild` folder are simple sripts who call the `schwarzschild()` function with different initial values. As it was shown in the previous section, the `2_crashing_traj.py` script, for example, yields a geodesic simulated near the event horizon of a non rotating Schwarzschild blackhole. You can run the other examples in the other folders the same way.\n\nThe README inside each example folders specifies the meaning of the constants and quantities used.\n\n## Advanced Usage\nFor more advance usages, refer to `./docs/1_HowTo_trajectories.md`, `./docs/2_HowTo_coordinates.md` and `./docs/3_HowTo_plotters.md`.\n\n## Interface\nIf you wish to see a more detailed overview of all the classes and functions at your disposition, be sure to checkout the `./docs/class_documentation/`. There are many Markdown files there explaining how all the classes and functions work. The REAMDEs in this folder also specify how you can import them.\n\n## Numerical errors\nSince this code uses a generalized approach to solving geodesics, it is prone to significant numerical errors, especially for metrics with complicated algebraic geodesics expressions. For instance, the `3_kerr` example has a lot of numerical errors because the metric is not diagonal and its geodesics are very complex. Be mindful of this when you want accurate results.\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 Benjamin Gauthier  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Computes space-time geodesics given an arbitrary metric and initial conditions.",
    "version": "1.0.3",
    "project_urls": {
        "Homepage": "https://github.com/Sneaker679/geodpy/tree/main"
    },
    "split_keywords": [
        "general relativity",
        " geodesics",
        " geodesic",
        " gr",
        " astrophysics",
        " astronomy",
        " physics",
        " riemann",
        " riemann geometry",
        " geometry",
        " metric",
        " space-time",
        " spacetime"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "55042988f2a6f60d2b5545e88dae990a7c84da7e88349c420a507431dd6b6b9e",
                "md5": "873603575e184cd860b25dfb3ca1e42a",
                "sha256": "63a73c429558e764f8053b35d5cf29f3c080df36629b83b3905acf4988e43f73"
            },
            "downloads": -1,
            "filename": "geodpy-1.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "873603575e184cd860b25dfb3ca1e42a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.12",
            "size": 19370,
            "upload_time": "2024-09-06T21:15:57",
            "upload_time_iso_8601": "2024-09-06T21:15:57.818609Z",
            "url": "https://files.pythonhosted.org/packages/55/04/2988f2a6f60d2b5545e88dae990a7c84da7e88349c420a507431dd6b6b9e/geodpy-1.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6e3caa53a482bb413efbd64ed834c360a4174537cdb6a9e99a592e65d4502850",
                "md5": "2bbf85a6210497ae02a9294f4855aaec",
                "sha256": "85bb842d45ec9d037a8acd75a34ffd4d9042c205fdc97ad969f5b94259ad9e6a"
            },
            "downloads": -1,
            "filename": "geodpy-1.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "2bbf85a6210497ae02a9294f4855aaec",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.12",
            "size": 15325,
            "upload_time": "2024-09-06T21:16:11",
            "upload_time_iso_8601": "2024-09-06T21:16:11.037018Z",
            "url": "https://files.pythonhosted.org/packages/6e/3c/aa53a482bb413efbd64ed834c360a4174537cdb6a9e99a592e65d4502850/geodpy-1.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-06 21:16:11",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Sneaker679",
    "github_project": "geodpy",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "geodpy"
}
        
Elapsed time: 0.34832s