Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kurtamohler/spacetimelib
Special relativity physics library for Python
https://github.com/kurtamohler/spacetimelib
physics python special-relativity
Last synced: 11 days ago
JSON representation
Special relativity physics library for Python
- Host: GitHub
- URL: https://github.com/kurtamohler/spacetimelib
- Owner: kurtamohler
- License: mit
- Created: 2022-07-25T01:02:38.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-14T05:23:53.000Z (about 1 year ago)
- Last Synced: 2024-10-13T05:50:40.022Z (25 days ago)
- Topics: physics, python, special-relativity
- Language: Jupyter Notebook
- Homepage:
- Size: 2.41 MB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SpacetimeLib
SpacetimeLib is a special relativity physics library for Python.
SpacetimeLib performs mathematical operations on events, velocities, and
worldlines in N+1 Minkowski spacetime.You can calculate Lorentz transformations, time dilation, length contraction,
and more.## Documentation and getting started
The documentation for the latest `main` branch is found here:
[https://kurtamohler.github.io/spacetimelib/](https://kurtamohler.github.io/spacetimelib/)The [Start Here - Twin Paradox
tutorial](https://kurtamohler.github.io/spacetimelib/notebooks/Twin%20Paradox.html)
page is a good starting point to see what SpacetimeLib can do.## Installation
### Pip
```bash
pip install spacetimelib
```### From source
Install Miniconda:
[instructions](https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html)Clone SpacetimeLib the repository.
```bash
https://github.com/kurtamohler/spacetimelib.git && cd spacetimelib
```Run the following to create and activate an environment with all dependencies.
```bash
conda env create -f environment.yaml -n spacetimelib && conda activate spacetimelib
```Then install SpacetimeLib.
```bash
pip install -e .
```## How to import SpacetimeLib
To access SpacetimeLib, import it into your Python code:
```python
>>> import spacetimelib as st
```Shorten the imported name to `st` for better code readability, but you can just
use the unshortened name if you want.