This project implements a direct N-body simulation using C++ or JAX as computing backend and Python. This project is developed as my submission for the role of Software Engineer at Leiden University.
git clone git@github.com:sahiljhawar/nbody.git
cd nbodyOn mac
CONDA_SUBDIR=osx-arm64 conda create -n nbody python=3.11 -y
conda activate nbody
conda config --env --set subdir osx-arm64On linux
conda create -n nbody python=3.11 -y
conda activate nbodyInstall the package
pip install -r requirements.txt
pip install .To run the simulation, use the following command:
export NBODY_BACKEND=cpp # or jax
python nbody.pyThis project uses GitHub Actions for continuous integration. The workflow is defined in .github/workflows/deploy.yml. The action runs the nbody.py script and produces plots for the simulation results. The plots are then uploaded as artifacts for each run here: https://sahiljhawar.in/nbody/