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.
The documentation for the latest main branch is found here:
https://kurtamohler.github.io/spacetimelib/
The Start Here - Twin Paradox tutorial page is a good starting point to see what SpacetimeLib can do.
pip install spacetimelibInstall Miniconda: instructions
Clone SpacetimeLib the repository.
https://github.com/kurtamohler/spacetimelib.git && cd spacetimelibRun the following to create and activate an environment with all dependencies.
conda env create -f environment.yaml -n spacetimelib && conda activate spacetimelibThen install SpacetimeLib.
pip install -e .To access SpacetimeLib, import it into your Python code:
>>> import spacetimelib as stShorten the imported name to st for better code readability, but you can just
use the unshortened name if you want.