Installation

From PyPI:

pip install phenomxpy

From source:

git clone https://gitlab.com/imrphenom-dev/phenomxpy.git
cd phenomxpy
pip install .

For GPU support, user needs to install cupy according to the CUDA version of their installation (e.g. 12 or 13):

pip install cupy-cuda12x
pip install cupy-cuda13x

The CUDA installation might need cuda-toolkit.

Constants backend

Physical constants can be read from different backends: lisaconstants, astropy or hardcoded.

To choose the backend:

from phenomxpy import load_constants
load_constants("astropy")

or with an evironment variable at kernel initialization:

import os
os.environ["PHENOMXPY_CONSTANTS"] = "astropy"
import phenomxpy

or

PHENOMXPY_CONSTANTS=astropy python myscript.py

If no backend is provided, the priority is: lisaconstants, astropy, hardcoded. If the packages is not installed, it will try the next one.

Simple usage

import phenomxpy

# Initialize approximant class
# Available approximants are: IMRPhenomT, IMRPhenomTHM, IMRPhenomTP, IMRPhenomTPHM
phen = IMRPhenomTHM(eta=..., total_mass=..., s1=...., s2=..., f_lower=..., option1=...)

# Compute time domain polarizations
hp, hc = phen.compute_polarizations(times)

# Compute Fourier domain polarizations
hpf, hcf, frequencies = phen.compute_fd_polarizations(times)

# Compute individual modes (in time domain)
hlms = phen.compute_hlms(times)

# In the case of precessing approximants, we can compute modes in different frames
hlms = phen.compute_CPmodes(times)
hlms = phen.compute_Jmodes(times)
hlms = phen.compute_L0modes(times)

The time array times can be a custom array. If None, then it computes an equispaced array with delta_t given in the class initialization.

If total_mass is not provided it assumes input arguments in NR units (i.e. f_lower, delta_t in mass units) and returns the waveform in NR units.

If total_mass and distance are provided, it returns the waveform in SI units.

Note

Fourier domain function only supports SI units.