Available Waveform Models

PhenomHM (PhenomD)

class bbhx.waveforms.phenomhm.PhenomHMAmpPhase(force_backend=None, run_phenomd=False, mf_min=0.0001, mf_max=0.6, initial_t_val=0.0)

Bases: BBHxParallelModule

Produce PhenomHM in the amplitude and phase representation

This class implements PhenomD and PhenomHM in a GPU-accelerated form. If you use this class, please cite arXiv:2005.01827, arXiv:2111.01064 arXiv:1708.00404, arXiv:1508.07250, and `arXiv:1508.07253 <https://arxiv.org/abs/1508.07253>_.

Parameters:
  • force_backend (str, optional) – ``”cpu”’’, ``”gpu”’’, ``”cuda”’’, ``”cuda12x”’’, or ``”cuda11x”’’.

  • run_phenomd (bool, optional) – If True, run the PhenomD waveform rather than PhenomHM. Really this is the same as choosing modes=[(2,2)] in the PhenomHM waveform.

  • mf_min (double, optional) – Dimensionless minimum frequency to use when performing interpolation. (Default: 1e-4)

  • mf_max (double, optional) – Dimensionless maximum frequency to use when performing interpolation. (Default: 6e-1)

  • initial_t_val (double, optional) – Time at the start of the time window. This shifts the phase accordingly but does not shift the tf correspondence so that the response is still accurately reflected. (Default: 0.0)

allowable_modes

Allowed list of mode tuple pairs (l,m) for the chosen waveform model.

Type:

list

ells_default

Default values for the l index of the harmonic.

Type:

np.ndarray

mms_default

Default values for the m index of the harmonic.

Type:

np.ndarray

mf_max

Dimensionless maximum frequency to use when performing interpolation.

Type:

double

mf_min

Dimensionless minimum frequency to use when performing interpolation.

Type:

double

phenomhm_ringdown_freqs

Ringdown frequency determination in PhenomHM.

Type:

obj

phenomd_ringdown_freqs

Ringdown frequency determination in PhenomD.

Type:

obj

run_phenomd

If True, run the PhenomD waveform rather than PhenomHM. Really this is the same as choosing modes=[(2,2)] in the PhenomHM waveform.

Type:

bool

y_rd

Y-values for PhenomD ringdown frequncy for Cubic Spline.

Type:

xp.ndarray

c1_rd

Cubic Spline c1 values for PhenomD ringdown frequency.

Type:

xp.ndarray

c2_rd

Cubic Spline c2 values for PhenomD ringdown frequency.

Type:

xp.ndarray

c3_rd

Cubic Spline c3 values for PhenomD ringdown frequency.

Type:

xp.ndarray

y_dm

Y-values for PhenomD damping frequncy for Cubic Spline.

Type:

xp.ndarray

c1_dm

Cubic Spline c1 values for PhenomD damping frequency.

Type:

xp.ndarray

c2_dm

Cubic Spline c2 values for PhenomD damping frequency.

Type:

xp.ndarray

c3_dm

Cubic Spline c3 values for PhenomD damping frequency.

Type:

xp.ndarray

waveform_carrier

Carrier for amplitude, phase, and tf information.

Type:

xp.ndarray

property xp: object

Numpy or Cupy

classmethod supported_backends() list

List of backends supported by a parallel module by order of preference.

property waveform_gen: callable

C/CUDA wrapped function for computing interpolation.

property phenomhm_ringdown_freqs: callable

C/CUDA wrapped function for computing PhenomHM Ringdown frequencies.

property phenomd_ringdown_freqs: callable

C/CUDA wrapped function for computing PhenomD Ringdown frequencies.

property citation

Return citations for this class

property amp

Get the amplitude array with shape (num_bin_all, num_modes, length)

property phase

Get the phase array with shape (num_bin_all, num_modes, length)

property tf

Get the tf array with shape (num_bin_all, num_modes, length)

static CPU_ONLY() list[str]

List of supported backend for CPU only class

List of supported backends for CPU-recommended class with GPU support

static GPU_ONLY() list[str]

List of supported backends for GPU-only class

List of supported backends for GPU-recommended class with CPU support

adapt_backend_kwargs(kwargs: dict | None = None) dict

Adapt a set of keyword arguments to add/set ‘force_backend’ to current backend

property backend: Backend

Access the underlying backend.

property backend_name: str

Return the name of current backend

build_with_same_backend(module_class: type[ParallelModuleDerivate], args: list | None = None, kwargs: dict | None = None) ParallelModuleDerivate

Build an instance of module_class with same backend as current object.

Parameters:
  • module_class – class of the object to be built, must derive from ParallelModuleBase

  • args (list, optional) – positional arguments for module_class constructor

  • kwargs (dict, optional) – keyword arguments for module_class constructor (the ‘force_backend’ argument will be ignored and replaced)

property freqs_shaped

Get the freqs array with shape (num_bin_all, length)

property freqs

Get the flat freqs array

run_wave(m1, m2, chi1z, chi2z, distance, phi_ref, f_ref, t_ref, length, freqs=None, out_buffer=None, modes=None)

Generate PhenomHM/D waveforms

Generate PhenomHM/PhenomD waveforms based on user given quantitites in the Amplitude-Phase representation.

Parameters:
  • m1 (double scalar or np.ndarray) – Mass 1 in Solar Masses \((m1 > m2)\).

  • m2 (double or np.ndarray) – Mass 2 in Solar Masses \((m1 > m2)\).

  • chi1z (double or np.ndarray) – Dimensionless spin 1 (for Mass 1) in Solar Masses.

  • chi2z (double or np.ndarray) – Dimensionless spin 2 (for Mass 1) in Solar Masses.

  • distance (double or np.ndarray) – Luminosity distance in m.

  • phi_ref (double or np.ndarray) – Phase at f_ref.

  • f_ref (double or np.ndarray) – Reference frequency at which phi_ref and t_ref are set. If f_ref == 0, it will be set internally by the PhenomHM code to \(f_\text{max} = \text{max}(f^2A_{22}(f))\).

  • t_ref (double or np.ndarray) – Reference time in seconds. It is set at f_ref.

  • length (int) – Length of the frequency array over which the waveform is created.

  • freqs (1D or 2D xp.ndarray, optional) – If None, the class will generate the frequency array over which the waveform is evaluated. If 1D xp.ndarray, this array will be copied for all binaries evaluated. If 2D, it must have shape (num_bin_all, length). (Default: None)

  • out_buffer (xp.ndarray, optional) – If None, a buffer array will be created. If provided, it should be flattened from shape (nparams, length, num_modes, num_bin_all). nparams can be 3 if just evaluating PhenomHM/D. If using the same buffer for the response it must be 9. (Default: None)

  • modes (list, optional) – Harmonic modes to use. If not given, they will default to those available in the waveform model. For PhenomHM: [(2,2), (3,3), (4,4), (2,1), (3,2), (4,3)]. For PhenomD: [(2,2)]. (Default: None)

__call__(*args, Tobs=None, direct=False, **kwargs)

Call self as a function.