EMRI_MC performs parameter inference for Extreme Mass Ratio Inspirals (EMRIs) based on the kludge formalism, including propagation effects due to modified gravity. It is designed to make use of GPU parallelisation for higher computational efficiency. For more information we refer to: https://arxiv.org/abs/2311.17174
-
Main authors: Ippocratis D. Saltas and Roberto Oliveri
-
Collaborators: Josef Dvoracek and Stephane Ilic
The code was developed predominantly by Ippocratis D. Saltas and Roberto Oliveri, with the valuable contributions of Stephane Ilic and Josef Dvoracek on MCMC and parallelisation aspects.
global_parameters.py: This module defines the values of physical constants in cgs units, the parameters of the fiducial model, geometrical parameters and initial conditions of the binary system, parameters for the ODE solver (e.g., integration time window and grid resolution), and MCMC-related definitions. It also defines the maximum number of orbital overtones
waveform.py: This module defines the set of kludge ODE equations, the waveform generator, and some GPU-related functionality.
mcmc.py: This module defines the MCMC-related functions and the MCMC iterator, including the prior and log-probability function.
propagation.py: This module defines the functions needed for the propagation of the GW wave through the cosmological background in the presence of any modified gravity effects.
run_code.py: This module starts the MCMC run, building on the parameter definitions in check global_parameters.py.
main.ipynb: Assuming all parameters and fiducial values are properly defined as explained earlier,
this Jupyter notebook calls the main functions to initiate the MCMC run,
using the package
On top of Python's usual numpy and scipy libraries, to run the code one needs the following modules:
-
cuda/cupy: https://nvidia.github.io/cuda-python/install.html
-
corner or seaborn or anything similar: https://corner.readthedocs.io/en/latest/install/ https://seaborn.pydata.org/installing.html
The cuda/cupy library provides the GPU functionality, emcee is the library with the MCMC sampler, multiprocessing is needed for parallelisation, and the corner/seaborn for producing the corner plots.
EMRI_MC was tested on Python 3.11, on a system with NVIDIA A100 and using NVIDIA's cuda 12.2.0. and cupy 13.3.
The code was tested with Python 3.11. Make sure the development package for given Python version is installed too. Eg. at EL-like Linux distributions, dnf install python3.11-devel
.
For example, on a cluster environment load the cuda toolkit. 1
module load CUDA/12.2.0
...and install recent pip
..
python3.11 -m venv ~/.venvs/EMRI_MC
pip install --upgrade pip
source ~/.venvs/EMRI_MC/bin/activate
pip install cupy emcee matplotlib pandas numpy emcee IPython ipykernel scipy h5py tqdm
The install step Running setup.py install for cupy ...
may take a considerable amount of time.
The packages related to interactive Python, such as IPython
and ipykernel
, are only needed for the example Jupyter notebooks and are not required by the underlying library.
Setting up all parameters as explained in the paper, one starts the notebook main.ipynb, and executes the cells (the code can also be executed through the terminal). This notebook serves as an example - it first computes and plots the fiducial model, and then starts the MCMC run around the chosen fiducial. The MCMC results are stored in a text file, please make sure the path is defined appropriately. The modifications needed in order to extend the parameter space, or include new effects is described in the paper.
Footnotes
-
CUDA Toolkit - https://developer.nvidia.com/cuda-toolkit ↩