Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALSimulation 6.2.0.1-5e288d3
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
LALSimNRSur7dq2_c

Detailed Description

Routines for NR surrogate models "NRSur7dq2" and "NRSur7dq4"

C code for NRSur7dq2 and NRSur7dq4 NR surrogate waveform models.

Author
Jonathan Blackman, Vijay Varma

NRSur7dq2: This is a fully precessing time domain model including all subdominant modes up to ell=4. See Blackman et al [2] for details. Any studies that use this waveform model should include a reference to that paper. Using this model requires the file lalsuite-extra/data/lalsimulation/NRSur7dq2.h5 Make sure your $LAL_DATA_PATH points to lalsuite-extra/data/lalsimulation/. The lalsuite-extra commit hash at the time of review was 77613e7f5f01d5ea11829ded5677783cafc0d298

Note
The range of validity of the model is:
  • Mass ratios 1 <= q <= 2
  • Spin magnitudes |chi_i| <= 0.8
  • Total time before merger <= 4500M, which in practice leads to a parameter-dependent lower bound for fmin.
Additional notes:
  • Passing in a non-trivial ModeArray controls which co-orbital frame modes are evaluated.
  • A python version of this model can be installed with "pip install NRSur7dq2".
  • This lalsimulation implementation has been verified to agree with version 1.0.3 up to very small differences due to slightly differing time interpolation methods.
  • Note that for conventions to agree with ChooseTDWaveform (and XLALSimInspiralNRSur7dq2Polarizations), you must pass use_lalsimulation_conventions=True when calling the pip version of NRSur7dq2.
Review status:
NRSur7dq2 model and routines reviewed by Sebastian Khan, Harald Pfeiffer, Geraint Pratten, and Michael Pürrer. Reviewees were Jonathan Blackman, Scott Field, and Vijay Varma. The review page can be found at https://git.ligo.org/waveforms/reviews/nrsur/wikis/home

NRSur7dq4: This is a q=4 extension of NRSur7dq2. See Varma et al. (arxiv:1905.09300) for details. Any studies that use this waveform model should include a reference to that paper. The binary data file (NRSur7dq4_v1.0.h5) is available at: https://git.ligo.org/waveforms/software/lalsuite-waveform-data and on Zenodo at: https://zenodo.org/records/14999310. Get the lalsuite-waveform-data repo or put the data into a location in your LAL_DATA_PATH. The data is also available on CIT at /home/lalsimulation_data and via CVMFS at /cvmfs/shared.storage.igwn.org/igwn/shared/auxiliary/obs_sci/cbc/waveform/lalsimulation_data Make sure the files are in your LAL_DATA_PATH.

static UNUSED bool NRSur7dq2_IsSetup (void)
 Helper function which returns whether or not the global NRSur7dq2 surrogate data has been initialized. More...
 
static UNUSED bool NRSur7dq4_IsSetup (void)
 Helper function which returns whether or not the global NRSur7dq4 surrogate data has been initialized. More...
 
REAL8 ipow (REAL8 base, int exponent)
 Helper function for integer powers. More...
 
REAL8 NRSur7dq2_eval_fit (FitData *data, REAL8 *x)
 
static void NRSur7dq2_eval_vector_fit (REAL8 *res, VectorFitData *data, REAL8 *x)
 
static int NRSur7dq4_effective_spins (REAL8 *chiHat, REAL8 *chi_a, const REAL8 q, const REAL8 chi1z, const REAL8 chi2z)
 
REAL8 NRSur7dq4_eval_fit (FitData *data, REAL8 *x)
 
static void NRSur7dq4_eval_vector_fit (REAL8 *res, VectorFitData *data, REAL8 *x)
 
REAL8 PrecessingNRSur_eval_fit (FitData *data, REAL8 *x, PrecessingNRSurData *__sur_data)
 
static void PrecessingNRSur_eval_vector_fit (REAL8 *res, VectorFitData *data, REAL8 *x, PrecessingNRSurData *__sur_data)
 
static void PrecessingNRSur_normalize_y (REAL8 chiANorm, REAL8 chiBNorm, REAL8 *y)
 
static void PrecessingNRSur_normalize_results (REAL8 normA, REAL8 normB, gsl_vector **quat, gsl_vector **chiA, gsl_vector **chiB)
 
static void PrecessingNRSur_rotate_spins (gsl_vector **chiA, gsl_vector **chiB, gsl_vector *phi_vec)
 Transforms chiA and chiB from the coprecessing frame to the coorbital frame using the orbital phase. More...
 
static void PrecessingNRSur_ds_fit_x (REAL8 *x, REAL8 q, REAL8 *y)
 
static void PrecessingNRSur_assemble_dydt (REAL8 *dydt, REAL8 *y, REAL8 *Omega_coorb_xy, REAL8 omega, REAL8 *chiA_dot, REAL8 *chiB_dot)
 
static REAL8 cubic_interp (REAL8 xout, REAL8 *x, REAL8 *y)
 Cubic interpolation of 4 data points This gives a much closer result to scipy.interpolate.InterpolatedUnivariateSpline than using gsl_interp_cspline (see comment in spline_array_interp) More...
 
static gsl_vector * spline_array_interp (gsl_vector *xout, gsl_vector *x, gsl_vector *y)
 Do cubic spline interpolation using a gsl_interp_cspline. More...
 
static REAL8 PrecessingNRSur_get_omega (size_t node_index, REAL8 q, REAL8 *y0, PrecessingNRSurData *__sur_data)
 Computes the orbital angular frequency at a dynamics node. More...
 
static REAL8 PrecessingNRSur_get_t_ref (REAL8 omega_ref, REAL8 q, REAL8 *chiA0, REAL8 *chiB0, REAL8 *init_quat, REAL8 init_orbphase, PrecessingNRSurData *__sur_data)
 Computes a reference time from a reference orbital angular frequency. More...
 
static void PrecessingNRSur_get_time_deriv_from_index (REAL8 *dydt, int i0, REAL8 q, REAL8 *y, PrecessingNRSurData *__sur_data)
 Compute dydt at a given dynamics node, where y is the numerical solution to the dynamics ODE. More...
 
static void PrecessingNRSur_get_time_deriv (REAL8 *dydt, REAL8 t, REAL8 q, REAL8 *y, PrecessingNRSurData *__sur_data)
 Compute dydt at any time by evaluating dydt at 4 nearby dynamics nodes and using cubic spline interpolation to evaluate at the desired time. More...
 
static int PrecessingNRSur_initialize_at_dynamics_node (REAL8 *dynamics_data, REAL8 t_ref, REAL8 q, REAL8 *chiA0, REAL8 *chiB0, REAL8 init_orbphase, REAL8 *init_quat, REAL8 normA, REAL8 normB, PrecessingNRSurData *__sur_data)
 Initialize the dynamics ODE at a dynamics node. More...
 
static void PrecessingNRSur_initialize_RK4_with_half_nodes (REAL8 *dynamics_data, REAL8 *time_steps, REAL8 *dydt0, REAL8 *dydt1, REAL8 *dydt2, REAL8 *dydt3, REAL8 normA, REAL8 normB, REAL8 q, PrecessingNRSurData *__sur_data)
 Initializes the AB4 ODE system from the surrogate start time by taking 3 RK4 steps, making use of the three additional half-time-step nodes for the RK4 substeps. More...
 
static int PrecessingNRSur_initialize_RK4 (REAL8 *dynamics_data, REAL8 *time_steps, REAL8 *dydt0, REAL8 *dydt1, REAL8 *dydt2, REAL8 *dydt3, REAL8 normA, REAL8 normB, REAL8 q, int i0, PrecessingNRSurData *__sur_data)
 Initializes the AB4 ODE system from a single arbitrary dynamics node by taking 3 RK4 steps. More...
 
static void PrecessingNRSur_integrate_AB4 (REAL8 *dynamics_data, REAL8 *time_steps, REAL8 *dydt0, REAL8 *dydt1, REAL8 *dydt2, REAL8 *dydt3, REAL8 normA, REAL8 normB, REAL8 q, int i_start, PrecessingNRSurData *__sur_data)
 Integrates the AB4 ODE system in time forwards, and backwards if needed. More...
 
static void PrecessingNRSur_eval_data_piece (gsl_vector *result, REAL8 q, gsl_vector **chiA, gsl_vector **chiB, WaveformDataPiece *data, PrecessingNRSurData *__sur_data)
 Evaluates a single NRSur coorbital waveoform data piece. More...
 
static int PrecessingNRSur_IntegrateDynamics (REAL8 *dynamics_data, REAL8 q, REAL8 *chiA0, REAL8 *chiB0, REAL8 omega_ref, REAL8 init_orbphase, REAL8 *init_quat, LALDict *LALparams, UINT4 PrecessingNRSurVersion)
 This is the main NRSur dynamics surrogate integration routine. More...
 
static PrecessingNRSurDataPrecessingNRSur_LoadData (UNUSED Approximant approximant)
 Wrapper for Loading NRSur7dq2 and NRSur7dq4 data. More...
 
static PrecessingNRSurDataPrecessingNRSur_core (MultiModalWaveform **h, REAL8 q, REAL8 *chiA0, REAL8 *chiB0, REAL8 omega_ref, REAL8 init_orbphase, REAL8 *init_quat, LALValue *ModeArray, LALDict *LALparams, Approximant approximant)
 
REAL8 PrecessingNRSur_StartFrequency (REAL8 m1, REAL8 m2, REAL8 s1x, REAL8 s1y, REAL8 s1z, REAL8 s2x, REAL8 s2y, REAL8 s2z, PrecessingNRSurData *__sur_data)
 Computes the starting frequency of the NRSur7dq2 or NRSur7dq4 waveform approximant when evaluated using fRef=0 (which uses the entire surrogate waveform starting 4500M for NRSur7dq2 and 4300M for NRSur7dq4, before the peak amplitude). More...
 
static bool PrecessingNRSur_switch_labels_if_needed (REAL8 *m1, REAL8 *m2, REAL8 *s1x, REAL8 *s1y, REAL8 *s1z, REAL8 *s2x, REAL8 *s2y, REAL8 *s2z)
 If m1<m2, swaps the labels for the two BHs such that Bh1 is always heavier. More...
 
int XLALSimInspiralPrecessingNRSurPolarizations (REAL8TimeSeries **hplus, REAL8TimeSeries **hcross, REAL8 phiRef, REAL8 inclination, REAL8 deltaT, REAL8 m1, REAL8 m2, REAL8 distance, REAL8 fMin, REAL8 fRef, REAL8 s1x, REAL8 s1y, REAL8 s1z, REAL8 s2x, REAL8 s2y, REAL8 s2z, LALDict *LALparams, Approximant approximant)
 This function evaluates the NRSur7dq2 or NRSur7dq4 surrogate model and sums over all ell <= 4 modes to obtain the + and x polarizations. More...
 
SphHarmTimeSeriesXLALSimInspiralPrecessingNRSurModes (REAL8 deltaT, REAL8 m1, REAL8 m2, REAL8 S1x, REAL8 S1y, REAL8 S1z, REAL8 S2x, REAL8 S2y, REAL8 S2z, REAL8 fMin, REAL8 fRef, REAL8 distance, LALDict *LALparams, Approximant approximant)
 This function evaluates the NRSur7dq2 or NRSur7dq4 surrogate model and returns the inertial frame modes in the form of a SphHarmTimeSeries. More...
 
int XLALPrecessingNRSurDynamics (gsl_vector **t_dynamics, gsl_vector **quat0, gsl_vector **quat1, gsl_vector **quat2, gsl_vector **quat3, gsl_vector **orbphase, gsl_vector **chiAx, gsl_vector **chiAy, gsl_vector **chiAz, gsl_vector **chiBx, gsl_vector **chiBy, gsl_vector **chiBz, REAL8 q, REAL8 chiA0x, REAL8 chiA0y, REAL8 chiA0z, REAL8 chiB0x, REAL8 chiB0y, REAL8 chiB0z, REAL8 omegaRef_dimless, REAL8 init_quat0, REAL8 init_quat1, REAL8 init_quat2, REAL8 init_quat3, REAL8 init_orbphase, LALDict *LALparams, Approximant approximant)
 This function evaluates the NRSur7dq2 or NRSur7dq4 surrogate model and returns the precessing frame dynamics. More...
 

Function Documentation

◆ NRSur7dq2_IsSetup()

static UNUSED bool NRSur7dq2_IsSetup ( void  )
static

Helper function which returns whether or not the global NRSur7dq2 surrogate data has been initialized.

Definition at line 560 of file LALSimIMRPrecessingNRSur.c.

◆ NRSur7dq4_IsSetup()

static UNUSED bool NRSur7dq4_IsSetup ( void  )
static

Helper function which returns whether or not the global NRSur7dq4 surrogate data has been initialized.

Definition at line 568 of file LALSimIMRPrecessingNRSur.c.

◆ ipow()

REAL8 ipow ( REAL8  base,
int  exponent 
)

Helper function for integer powers.

Definition at line 576 of file LALSimIMRPrecessingNRSur.c.

◆ NRSur7dq2_eval_fit()

REAL8 NRSur7dq2_eval_fit ( FitData data,
REAL8 x 
)
Parameters
dataData for fit
xsize 7, giving mass ratio q, and dimensionless spin components

Definition at line 596 of file LALSimIMRPrecessingNRSur.c.

◆ NRSur7dq2_eval_vector_fit()

static void NRSur7dq2_eval_vector_fit ( REAL8 res,
VectorFitData data,
REAL8 x 
)
static
Parameters
resResult
dataData for fit
xsize 7, giving mass ratio q, and dimensionless spin components

Definition at line 636 of file LALSimIMRPrecessingNRSur.c.

◆ NRSur7dq4_effective_spins()

static int NRSur7dq4_effective_spins ( REAL8 chiHat,
REAL8 chi_a,
const REAL8  q,
const REAL8  chi1z,
const REAL8  chi2z 
)
static
Parameters
chiHatOutput: chiHat
chi_aOutput: chi_a
qMass ratio >= 1
chi1zDimensionless z-spin of heavier BH
chi2zDimensionless z-spin of lighter BH

Definition at line 679 of file LALSimIMRPrecessingNRSur.c.

◆ NRSur7dq4_eval_fit()

REAL8 NRSur7dq4_eval_fit ( FitData data,
REAL8 x 
)
Parameters
dataData for fit
xsize 7, giving mass ratio q, and dimensionless spin components

Definition at line 699 of file LALSimIMRPrecessingNRSur.c.

◆ NRSur7dq4_eval_vector_fit()

static void NRSur7dq4_eval_vector_fit ( REAL8 res,
VectorFitData data,
REAL8 x 
)
static
Parameters
resResult
dataData for fit
xsize 7, giving mass ratio q, and dimensionless spin components

Definition at line 757 of file LALSimIMRPrecessingNRSur.c.

◆ PrecessingNRSur_eval_fit()

REAL8 PrecessingNRSur_eval_fit ( FitData data,
REAL8 x,
PrecessingNRSurData __sur_data 
)
Parameters
dataData for fit
xsize 7, giving mass ratio q, and dimensionless spin components
__sur_dataLoaded surrogate data

Definition at line 772 of file LALSimIMRPrecessingNRSur.c.

◆ PrecessingNRSur_eval_vector_fit()

static void PrecessingNRSur_eval_vector_fit ( REAL8 res,
VectorFitData data,
REAL8 x,
PrecessingNRSurData __sur_data 
)
static
Parameters
resResult
dataData for fit
xsize 7, giving mass ratio q, and dimensionless spin components
__sur_dataLoaded surrogate data

Definition at line 789 of file LALSimIMRPrecessingNRSur.c.

◆ PrecessingNRSur_normalize_y()

static void PrecessingNRSur_normalize_y ( REAL8  chiANorm,
REAL8  chiBNorm,
REAL8 y 
)
static
Parameters
chiANorm||vec{chi}_A||
chiBNorm||vec{chi}_B||
y[q0, qx, qy, qz, phi, chiAx, chiAy, chiAz, chiBx, chiBy, chiBz]

Definition at line 809 of file LALSimIMRPrecessingNRSur.c.

◆ PrecessingNRSur_normalize_results()

static void PrecessingNRSur_normalize_results ( REAL8  normA,
REAL8  normB,
gsl_vector **  quat,
gsl_vector **  chiA,
gsl_vector **  chiB 
)
static
Parameters
normA||vec{chi}_A||
normB||vec{chi}_B||
quatThe four quaternion time-dependent components
chiATime-dependent components of chiA
chiBTime-dependent components of chiB

Definition at line 853 of file LALSimIMRPrecessingNRSur.c.

◆ PrecessingNRSur_rotate_spins()

static void PrecessingNRSur_rotate_spins ( gsl_vector **  chiA,
gsl_vector **  chiB,
gsl_vector *  phi_vec 
)
static

Transforms chiA and chiB from the coprecessing frame to the coorbital frame using the orbital phase.

Parameters
chiA3 time-dependent components of chiA in the coorbital frame
chiB3 time-dependent components of chiB in the coorbital frame
phi_vecThe time-dependent orbital phase

Definition at line 905 of file LALSimIMRPrecessingNRSur.c.

◆ PrecessingNRSur_ds_fit_x()

static void PrecessingNRSur_ds_fit_x ( REAL8 x,
REAL8  q,
REAL8 y 
)
static
Parameters
xResult, length 7
qMass ratio
y[q0, qx, qy, qz, phi, chiAx, chiAy, chiAz, chiBx, chiBy, chiBz]

Definition at line 942 of file LALSimIMRPrecessingNRSur.c.

◆ PrecessingNRSur_assemble_dydt()

static void PrecessingNRSur_assemble_dydt ( REAL8 dydt,
REAL8 y,
REAL8 Omega_coorb_xy,
REAL8  omega,
REAL8 chiA_dot,
REAL8 chiB_dot 
)
static
Parameters
dydtResult, length 11
yODE solution at the current time step
Omega_coorb_xya form of time derivative of the coprecessing frame
omegaorbital angular frequency in the coprecessing frame
chiA_dotchiA time derivative
chiB_dotchiB time derivative

Definition at line 970 of file LALSimIMRPrecessingNRSur.c.

◆ cubic_interp()

static REAL8 cubic_interp ( REAL8  xout,
REAL8 x,
REAL8 y 
)
static

Cubic interpolation of 4 data points This gives a much closer result to scipy.interpolate.InterpolatedUnivariateSpline than using gsl_interp_cspline (see comment in spline_array_interp)

Parameters
xoutThe target x value
xThe x values of the points to interpolate. Length 4, must be increasing.
yThe y values of the points to interpolate. Length 4.

Definition at line 1010 of file LALSimIMRPrecessingNRSur.c.

◆ spline_array_interp()

static gsl_vector * spline_array_interp ( gsl_vector *  xout,
gsl_vector *  x,
gsl_vector *  y 
)
static

Do cubic spline interpolation using a gsl_interp_cspline.

Results differ from scipy.interpolate.InterpolatedUnivariateSpline due to different boundary conditions. This difference leads to small differences between this implementation and the python implementation, especially near the start and end of the waveform.

Parameters
xoutThe vector of points onto which we want to interpolate.
xThe x values of the data to interpolate.
yThe y values of the data to interpolate.

Definition at line 1030 of file LALSimIMRPrecessingNRSur.c.

◆ PrecessingNRSur_get_omega()

static REAL8 PrecessingNRSur_get_omega ( size_t  node_index,
REAL8  q,
REAL8 y0,
PrecessingNRSurData __sur_data 
)
static

Computes the orbital angular frequency at a dynamics node.

Parameters
node_indexThe index of the dynamics node.
qThe mass ratio.
y0The value of the ODE state y = [q0, qx, qy, qz, orbphase, chiAx, chiAy, chiAz, chiBx, chiBy, chiBz]
__sur_dataLoaded surrogate data

Definition at line 1053 of file LALSimIMRPrecessingNRSur.c.

◆ PrecessingNRSur_get_t_ref()

static REAL8 PrecessingNRSur_get_t_ref ( REAL8  omega_ref,
REAL8  q,
REAL8 chiA0,
REAL8 chiB0,
REAL8 init_quat,
REAL8  init_orbphase,
PrecessingNRSurData __sur_data 
)
static

Computes a reference time from a reference orbital angular frequency.

Parameters
omega_refreference orbital angular frequency
qmass ratio
chiA0chiA at reference point
chiB0chiB at reference point
init_quatcoprecessing frame quaternion at reference point
init_orbphaseorbital phase at reference point
__sur_dataLoaded surrogate data

Definition at line 1069 of file LALSimIMRPrecessingNRSur.c.

◆ PrecessingNRSur_get_time_deriv_from_index()

static void PrecessingNRSur_get_time_deriv_from_index ( REAL8 dydt,
int  i0,
REAL8  q,
REAL8 y,
PrecessingNRSurData __sur_data 
)
static

Compute dydt at a given dynamics node, where y is the numerical solution to the dynamics ODE.

Parameters
dydtOutput: dy/dt evaluated at the ODE time node with index i0. Must have space for 11 entries.
i0Time node index. i0=-1, -2, and -3 are used for time nodes 1/2, 3/2, and 5/2 respectively.
qMass ratio
yCurrent ODE state: [q0, qx, qy, qz, orbphase, chiAx, chiAy, chiAz, chiBx, chiBy, chiBz]
__sur_dataLoaded surrogate data

Definition at line 1134 of file LALSimIMRPrecessingNRSur.c.

◆ PrecessingNRSur_get_time_deriv()

static void PrecessingNRSur_get_time_deriv ( REAL8 dydt,
REAL8  t,
REAL8  q,
REAL8 y,
PrecessingNRSurData __sur_data 
)
static

Compute dydt at any time by evaluating dydt at 4 nearby dynamics nodes and using cubic spline interpolation to evaluate at the desired time.

Parameters
dydtOutput: dy/dt evaluated at time t. Must have space for 11 entries.
tTime at which the ODE should be evaluated.
qMass ratio
yCurrent ODE state
__sur_dataLoaded surrogate data

Definition at line 1169 of file LALSimIMRPrecessingNRSur.c.

◆ PrecessingNRSur_initialize_at_dynamics_node()

static int PrecessingNRSur_initialize_at_dynamics_node ( REAL8 dynamics_data,
REAL8  t_ref,
REAL8  q,
REAL8 chiA0,
REAL8 chiB0,
REAL8  init_orbphase,
REAL8 init_quat,
REAL8  normA,
REAL8  normB,
PrecessingNRSurData __sur_data 
)
static

Initialize the dynamics ODE at a dynamics node.

Given t_ref, finds the nearest dynamics node and integrates the initial conditions at t_ref a tiny bit to obtain the ODE state at the dynamics node.

Parameters
dynamics_dataODE output
t_refreference time. t_ds[i0] will be close to t_ref.
qmass ratio
chiA0chiA at t_ref.
chiB0chiB at t_ref.
init_orbphaseorbital phase at t_ref.
init_quatquaternion at t_ref.
normA|chiA|
normB|chiB|
__sur_dataLoaded surrogate data

Definition at line 1221 of file LALSimIMRPrecessingNRSur.c.

◆ PrecessingNRSur_initialize_RK4_with_half_nodes()

static void PrecessingNRSur_initialize_RK4_with_half_nodes ( REAL8 dynamics_data,
REAL8 time_steps,
REAL8 dydt0,
REAL8 dydt1,
REAL8 dydt2,
REAL8 dydt3,
REAL8  normA,
REAL8  normB,
REAL8  q,
PrecessingNRSurData __sur_data 
)
static

Initializes the AB4 ODE system from the surrogate start time by taking 3 RK4 steps, making use of the three additional half-time-step nodes for the RK4 substeps.

This is the recommended way to initialize the AB4 ODE system - the additional nodes are there to increase accuracy during initialization. The drawback is that we are forced to accept fRef to be the surrogate start frequency, which will depend on masses and spins. The ODE system is for the vector of 11 quantities: [q0, qx, qy, qz, varphi, chiAx, chiAy, chiAz, chiBx, chiBy, chiBz] where (q0, qx, qy, qz) is the coprecessing frame quaternion, varphi is the orbital phase, and the spin components are in the coprecessing frame.

Parameters
dynamics_dataA pointer to the start of the ODE output; the first 11 entries (for node 0) should have already been set.
time_stepsOutput: first three time steps. Should have size 3.
dydt0Output: dydt at node 0. Should have size 11.
dydt1Output: dydt at node 1. Should have size 11.
dydt2Output: dydt at node 2. Should have size 11.
dydt3Output: dydt at node 3. Should have size 11.
normA|chiA|
normB|chiB|
qmass ratio
__sur_dataLoaded surrogate data

Definition at line 1299 of file LALSimIMRPrecessingNRSur.c.

◆ PrecessingNRSur_initialize_RK4()

static int PrecessingNRSur_initialize_RK4 ( REAL8 dynamics_data,
REAL8 time_steps,
REAL8 dydt0,
REAL8 dydt1,
REAL8 dydt2,
REAL8 dydt3,
REAL8  normA,
REAL8  normB,
REAL8  q,
int  i0,
PrecessingNRSurData __sur_data 
)
static

Initializes the AB4 ODE system from a single arbitrary dynamics node by taking 3 RK4 steps.

Compared to PrecessingNRSur_initialize_RK4_with_half_nodes, this may be slightly less accurate and slightly more time consuming as we must interpolate many dynamics node fit evaluations, but this is more flexible as we can initialize from any node instead of just node 0.

Parameters
dynamics_dataA pointer to the start of the ODE output. Entries with i0*11 <= i < (i0+1)*11 should have already be computed.
time_stepsOutput: first three time steps. Should have size 3.
dydt0Output: dydt at node i0 + 0. Should have size 11.
dydt1Output: dydt at node i0 + 1. Should have size 11.
dydt2Output: dydt at node i0 + 2. Should have size 11.
dydt3Output: dydt at node i0 + 3. Should have size 11.
normA|chiA|
normB|chiB|
qmass ratio
i0the node that is already initialized
__sur_dataLoaded surrogate data

Definition at line 1378 of file LALSimIMRPrecessingNRSur.c.

◆ PrecessingNRSur_integrate_AB4()

static void PrecessingNRSur_integrate_AB4 ( REAL8 dynamics_data,
REAL8 time_steps,
REAL8 dydt0,
REAL8 dydt1,
REAL8 dydt2,
REAL8 dydt3,
REAL8  normA,
REAL8  normB,
REAL8  q,
int  i_start,
PrecessingNRSurData __sur_data 
)
static

Integrates the AB4 ODE system in time forwards, and backwards if needed.

The system should have already been initialized at 4 adjacent dynamics nodes. Output is a flattened array where entries i*11 <= j < (i+1)*11 are [q0, qx, qy, qz, varphi, chiAx, chiAy, chiAz, chiBx, chiBy, chiBz] at dynamics node i, where (q0, qx, qy, qz) is the coprecessing frame quaternion, varphi is the orbital phase, and the spin components are in the coprecessing frame.

Parameters
dynamics_dataODE output
time_stepsThe first three time steps beginning at i_start.
dydt0dydt at node i_start
dydt1dydt at node i_start + 1
dydt2dydt at node i_start + 2
dydt3dydt at node i_start + 3
normA|chiA|
normB|chiB|
qmass ratio
i_startnodes i_start through i_start+3 are already initialized
__sur_dataLoaded surrogate data

Definition at line 1520 of file LALSimIMRPrecessingNRSur.c.

◆ PrecessingNRSur_eval_data_piece()

static void PrecessingNRSur_eval_data_piece ( gsl_vector *  result,
REAL8  q,
gsl_vector **  chiA,
gsl_vector **  chiB,
WaveformDataPiece data,
PrecessingNRSurData __sur_data 
)
static

Evaluates a single NRSur coorbital waveoform data piece.

The dynamics ODE must have already been solved, since this requires the spins evaluated at all of the empirical nodes for this waveform data piece.

Parameters
resultOutput: Should have already been assigned space
qMass ratio
chiA3 gsl_vector *s, one for each (coorbital) component
chiBsimilar to chiA
dataThe data piece to evaluate
__sur_dataLoaded surrogate data

Definition at line 1630 of file LALSimIMRPrecessingNRSur.c.

◆ PrecessingNRSur_IntegrateDynamics()

static int PrecessingNRSur_IntegrateDynamics ( REAL8 dynamics_data,
REAL8  q,
REAL8 chiA0,
REAL8 chiB0,
REAL8  omega_ref,
REAL8  init_orbphase,
REAL8 init_quat,
LALDict *  LALparams,
UINT4  PrecessingNRSurVersion 
)
static

This is the main NRSur dynamics surrogate integration routine.

Given omega_ref and the system parameters at omega_ref, we find the corresponding t_ref and first (if needed) take a tiny time step and evolve the system to the nearest dynamics node. We then initialize the AB4 ODE system at 4 consecutive dynamics nodes by taking 3 RK4 steps. Finally, we integrate forwards (and backwards if needed) to obtain the solution at all dynamics nodes. Output is a flattened array where entries i*11 <= j < (i+1)*11 are [q0, qx, qy, qz, varphi, chiAx, chiAy, chiAz, chiBx, chiBy, chiBz] at dynamics node i, where (q0, qx, qy, qz) is the coprecessing frame quaternion, varphi is the orbital phase, and the spin components are in the coprecessing frame.

Parameters
dynamics_dataOutput: length (n_dynamics_nodes * 11)
qMass ratio mA / mB
chiA0chiA at the reference point
chiB0chiB at the reference point
omega_reforbital angular frequency at reference point
init_orbphaseorbital phase at the reference point
init_quatcoprecessing quaterion at the reference point
LALparamsDict with extra parameters
PrecessingNRSurVersion0 for NRSur7dq2, 1 for NRSur7dq4

Definition at line 1675 of file LALSimIMRPrecessingNRSur.c.

◆ PrecessingNRSur_LoadData()

static PrecessingNRSurData * PrecessingNRSur_LoadData ( UNUSED Approximant  approximant)
static

Wrapper for Loading NRSur7dq2 and NRSur7dq4 data.

Calls NRSur7dq2_Init_LALDATA() or NRSur7dq4_Init_LALDATA() if surrogate data is not already loaded, and returns loaded surrogate data. If surrogate data is already loaded, just returns the loaded data.

Parameters
approximantapproximant (NRSur7dq2 or NRSur7dq4)

Definition at line 1797 of file LALSimIMRPrecessingNRSur.c.

◆ PrecessingNRSur_core()

static PrecessingNRSurData * PrecessingNRSur_core ( MultiModalWaveform **  h,
REAL8  q,
REAL8 chiA0,
REAL8 chiB0,
REAL8  omega_ref,
REAL8  init_orbphase,
REAL8 init_quat,
LALValue *  ModeArray,
LALDict *  LALparams,
Approximant  approximant 
)
static
Parameters
hOutput. Dimensionless waveform modes sampled on t_coorb
qMass ratio mA / mB
chiA0chiA at the reference point
chiB0chiB at the reference point
omega_reforbital angular frequency at the reference point
init_orbphaseorbital phase at the reference point
init_quatcoprecessing quaterion at the reference point
ModeArrayContainer for the ell and m co-orbital modes to generate
LALparamsDict with extra parameters
approximantapproximant (NRSur7dq2 or NRSur7dq4)

Definition at line 1848 of file LALSimIMRPrecessingNRSur.c.

◆ PrecessingNRSur_StartFrequency()

REAL8 PrecessingNRSur_StartFrequency ( REAL8  m1,
REAL8  m2,
REAL8  s1x,
REAL8  s1y,
REAL8  s1z,
REAL8  s2x,
REAL8  s2y,
REAL8  s2z,
PrecessingNRSurData __sur_data 
)

Computes the starting frequency of the NRSur7dq2 or NRSur7dq4 waveform approximant when evaluated using fRef=0 (which uses the entire surrogate waveform starting 4500M for NRSur7dq2 and 4300M for NRSur7dq4, before the peak amplitude).

Parameters
m1mass of companion 1 (kg)
m2mass of companion 2 (kg)
s1xinitial value of S1x
s1yinitial value of S1y
s1zinitial value of S1z
s2xinitial value of S2x
s2yinitial value of S2y
s2zinitial value of S2z
__sur_dataLoaded surrogate data

Definition at line 2021 of file LALSimIMRPrecessingNRSur.c.

◆ PrecessingNRSur_switch_labels_if_needed()

static bool PrecessingNRSur_switch_labels_if_needed ( REAL8 m1,
REAL8 m2,
REAL8 s1x,
REAL8 s1y,
REAL8 s1z,
REAL8 s2x,
REAL8 s2y,
REAL8 s2z 
)
static

If m1<m2, swaps the labels for the two BHs such that Bh1 is always heavier.

Then rotates the in-plane spins by pi. These two together are the same as a rigid rotation of the system by pi. This rotation will be undone by multiplying the odd-m modes by a minus sign after the modes are generated.

Parameters
m1Input and Output. mass of companion 1 (kg)
m2Input and Output. mass of companion 2 (kg)
s1xInput and Output. S1x at reference epoch
s1yInput and Output. S1y at reference epoch
s1zInput and Output. S1z at reference epoch
s2xInput and Output. S2x at reference epoch
s2yInput and Output. S2y at reference epoch
s2zInput and Output. S2z at reference epoch

Definition at line 2059 of file LALSimIMRPrecessingNRSur.c.

◆ XLALSimInspiralPrecessingNRSurPolarizations()

int XLALSimInspiralPrecessingNRSurPolarizations ( REAL8TimeSeries **  hplus,
REAL8TimeSeries **  hcross,
REAL8  phiRef,
REAL8  inclination,
REAL8  deltaT,
REAL8  m1,
REAL8  m2,
REAL8  distance,
REAL8  fMin,
REAL8  fRef,
REAL8  s1x,
REAL8  s1y,
REAL8  s1z,
REAL8  s2x,
REAL8  s2y,
REAL8  s2z,
LALDict *  LALparams,
Approximant  approximant 
)

This function evaluates the NRSur7dq2 or NRSur7dq4 surrogate model and sums over all ell <= 4 modes to obtain the + and x polarizations.

Papers: NRSur7dq2: https://arxiv.org/abs/1705.07089 NRSur7dq4: https://arxiv.org/abs/1905.09300

The system is initialized at a time where the orbital frequency of the waveform in the coprecessing frame (Eq.11 of https://arxiv.org/abs/1705.07089) is pi * fRef. At this reference point, the system is initialized in the coorbital frame, with the z-axis along the principal eigenvector of the angular momentum operator acting on the waveform, the x-axis along the line of separation from the lighter BH to the heavier BH, and the y-axis completing the triad. The polarizations of the waveform are returned in the sky of this frame at (inclination, pi/2 - phiRef). This agrees with the LAL convention.

Extra options are passed through a LALDict: dictParams = lal.CreateDict()

  1. Mode options: When using a custom ModeArray the user must explicitly supply all modes, -ve and +ve m-modes. Note that these are modes in the co-orbital frame, not the inertial frame. Examples:

First, create the 'empty' mode array

ma=lalsim.SimInspiralCreateModeArray()

1a. If you want all models upto ellMax:

add the modes (these are in the coorbital frame)

for ell in range(2, ellMax+1): lalsim.SimInspiralModeArrayActivateAllModesAtL(ma, ell)

then insert your ModeArray into the LALDict params with

lalsim.SimInspiralWaveformParamsInsertModeArray(dictParams, ma)

1b. If you want only a single mode:

add (l,m) and (l,-m) modes (these are in the coorbital frame)

lalsim.SimInspiralModeArrayActivateMode(ma, l, m) lalsim.SimInspiralModeArrayActivateMode(ma, l, -m)

then insert your ModeArray into the LALDict params with

lalsim.SimInspiralWaveformParamsInsertModeArray(params, ma)

  1. Extrapolation: The surrogate models are trained on the following ranges. NRSur7dq2: q <= 2.01, |chi_1|, |chi_2| <= 0.81. NRSur7dq4: q <= 4.01, |chi_1|, |chi_2| <= 0.81. If you want a guarantee of accuracy you should stick to the above ranges.

    We allow extrapolation to the following ranges, but with a warning: NRSur7dq2: q <= 3.01, |chi_1|, |chi_2| <= 1. NRSur7dq4: q <= 6.01, |chi_1|, |chi_2| <= 1. We expect the models to be reasonable when extrapolated to these ranges.

    Beyond the above ranges, we raise an error. If you want to extrapolate beyond these limits you can specify unlimited_extrapolation = 1 in your dictParams as follows:

USE AT YOUR OWN RISK!!

lal.DictInsertUINT4Value(dictParams, "unlimited_extrapolation", 1)

Parameters
hplusOUTPUT h_+ vector
hcrossOUTPUT h_x vector
phiRefazimuthal angle for Ylms
inclinationinclination angle
deltaTsampling interval (s)
m1mass of companion 1 (kg)
m2mass of companion 2 (kg)
distancedistance of source (m)
fMinstart GW frequency (Hz)
fRefreference GW frequency (Hz)
s1xinitial value of S1x
s1yinitial value of S1y
s1zinitial value of S1z
s2xinitial value of S2x
s2yinitial value of S2y
s2zinitial value of S2z
LALparamsDict with extra parameters
approximantapproximant (NRSur7dq2 or NRSur7dq4)

Definition at line 2154 of file LALSimIMRPrecessingNRSur.c.

◆ XLALSimInspiralPrecessingNRSurModes()

SphHarmTimeSeries * XLALSimInspiralPrecessingNRSurModes ( REAL8  deltaT,
REAL8  m1,
REAL8  m2,
REAL8  S1x,
REAL8  S1y,
REAL8  S1z,
REAL8  S2x,
REAL8  S2y,
REAL8  S2z,
REAL8  fMin,
REAL8  fRef,
REAL8  distance,
LALDict *  LALparams,
Approximant  approximant 
)

This function evaluates the NRSur7dq2 or NRSur7dq4 surrogate model and returns the inertial frame modes in the form of a SphHarmTimeSeries.

Papers: NRSur7dq2: https://arxiv.org/abs/1705.07089 NRSur7dq4: https://arxiv.org/abs/1905.09300

The system is initialized at a time where the orbital frequency of the waveform in the coprecessing frame (Eq.11 of https://arxiv.org/abs/1705.07089) is pi * fRef. At this reference point, the system is initialized in the coorbital frame, with the z-axis along the principal eigenvector of the angular momentum operator acting on the waveform, the x-axis along the line of separation from the lighter BH to the heavier BH, and the y-axis completing the triad. The modes are returned in this frame, which agrees with the LAL convention. When combining the modes to get the polarizations, the Ylms should be evaluated at (inclination, pi/2 - phiRef), following the LAL convention.

Extra options are passed through a LALDict: dictParams = lal.CreateDict()

  1. Mode options: When using a custom ModeArray the user must explicitly supply all modes, -ve and +ve m-modes. Note that these are modes in the co-orbital frame, not the inertial frame. Examples:

First, create the 'empty' mode array

ma=lalsim.SimInspiralCreateModeArray()

1a. If you want all models upto ellMax:

add the modes (these are in the coorbital frame)

for ell in range(2, ellMax+1): lalsim.SimInspiralModeArrayActivateAllModesAtL(ma, ell)

then insert your ModeArray into the LALDict params with

lalsim.SimInspiralWaveformParamsInsertModeArray(dictParams, ma)

1b. If you want only a single mode:

add (l,m) and (l,-m) modes (these are in the coorbital frame)

lalsim.SimInspiralModeArrayActivateMode(ma, l, m) lalsim.SimInspiralModeArrayActivateMode(ma, l, -m)

then insert your ModeArray into the LALDict params with

lalsim.SimInspiralWaveformParamsInsertModeArray(params, ma)

  1. Extrapolation: The surrogate models are trained on the following ranges. NRSur7dq2: q <= 2.01, |chi_1|, |chi_2| <= 0.81. NRSur7dq4: q <= 4.01, |chi_1|, |chi_2| <= 0.81. If you want a guarantee of accuracy you should stick to the above ranges.

    We allow extrapolation to the following ranges, but with a warning: NRSur7dq2: q <= 3.01, |chi_1|, |chi_2| <= 1. NRSur7dq4: q <= 6.01, |chi_1|, |chi_2| <= 1. We expect the models to be reasonable when extrapolated to these ranges.

    Beyond the above ranges, we raise an error. If you want to extrapolate beyond these limits you can specify unlimited_extrapolation = 1 in your dictParams as follows:

USE AT YOUR OWN RISK!!

lal.DictInsertUINT4Value(dictParams, "unlimited_extrapolation", 1)

Parameters
deltaTsampling interval (s)
m1mass of companion 1 (kg)
m2mass of companion 2 (kg)
S1xx-component of the dimensionless spin of object 1
S1yy-component of the dimensionless spin of object 1
S1zz-component of the dimensionless spin of object 1
S2xx-component of the dimensionless spin of object 2
S2yy-component of the dimensionless spin of object 2
S2zz-component of the dimensionless spin of object 2
fMinstart GW frequency (Hz)
fRefreference GW frequency (Hz)
distancedistance of source (m)
LALparamsDict with extra parameters
approximantapproximant (NRSur7dq2 or NRSur7dq4)

Definition at line 2423 of file LALSimIMRPrecessingNRSur.c.

◆ XLALPrecessingNRSurDynamics()

int XLALPrecessingNRSurDynamics ( gsl_vector **  t_dynamics,
gsl_vector **  quat0,
gsl_vector **  quat1,
gsl_vector **  quat2,
gsl_vector **  quat3,
gsl_vector **  orbphase,
gsl_vector **  chiAx,
gsl_vector **  chiAy,
gsl_vector **  chiAz,
gsl_vector **  chiBx,
gsl_vector **  chiBy,
gsl_vector **  chiBz,
REAL8  q,
REAL8  chiA0x,
REAL8  chiA0y,
REAL8  chiA0z,
REAL8  chiB0x,
REAL8  chiB0y,
REAL8  chiB0z,
REAL8  omegaRef_dimless,
REAL8  init_quat0,
REAL8  init_quat1,
REAL8  init_quat2,
REAL8  init_quat3,
REAL8  init_orbphase,
LALDict *  LALparams,
Approximant  approximant 
)

This function evaluates the NRSur7dq2 or NRSur7dq4 surrogate model and returns the precessing frame dynamics.

Papers: NRSur7dq2: https://arxiv.org/abs/1705.07089 NRSur7dq4: https://arxiv.org/abs/1905.09300

Example usage: t_dynamics, quat0, quat1, quat2, quat3, orbphase, chiAx, chiAy, chiAz, chiBx, chiBy, chiBz = lalsim.PrecessingNRSurDynamics( q, chiA0x, chiA0y, chiA0z, chiB0x, chiB0y, chiB0z, omegaRef_dimless, init_quat0, init_quat1, init_quat2, init_quat3, init_orbphase, LALparams, approxTag)

INPUTS: q mass ratio, mA/mB >= 1. chiA0x chiA0y chiA0z spin of the heavier BH at the reference epoch, in the coorbital frame, as defined in the above papers. This agrees with the LAL convention, see LALSimInspiral.h for definition of the LAL frame. chiB0x chiB0y chiB0z spin of the lighter BH at the reference epoch, in the coorbital frame. omegaRef_dimless reference dimensionless orbital frequency in the coprecessing frame, this is used to set the reference epoch. The coprecessing frame is defined in the above papers. init_quat0 init_quat1 init_quat2 init_quat3 coprecessing frame quaternion at the reference epoch. To follow the LAL convention this should be [1, 0, 0, 0], but the surrogate allows arbitrary unit quaternions. init_orbphase orbital phase in the coprecessing frame at the reference epoch. To follow the LAL convention this should be 0, but the surrogate allows arbitrary initial orbital phase. LALparams LAL dictionary containing additional parameters, if required. Initialized with: LALparams = lal.CreateDict()

Extrapolation options: The surrogate models are trained on the following ranges: NRSur7dq2: q <= 2.01, |chi_1|, |chi_2| <= 0.81. NRSur7dq4: q <= 4.01, |chi_1|, |chi_2| <= 0.81. If you want a guarantee of accuracy you should stick to the above ranges.

We allow extrapolation to the following ranges, but with a warning: NRSur7dq2: q <= 3.01, |chi_1|, |chi_2| <= 1. NRSur7dq4: q <= 6.01, |chi_1|, |chi_2| <= 1. We expect the models to be reasonable when extrapolated to these ranges.

Beyond the above ranges, we raise an error. If you want to extrapolate beyond these limits you can specify unlimited_extrapolation = 1 in your LALparams as follows: USE AT YOUR OWN RISK!! lal.DictInsertUINT4Value(LALparams,"unlimited_extrapolation",1) approxTag LAL object specifying the surrogate model to use. Example: approxTag = lalsim.SimInspiralGetApproximantFromString('NRSur7dq4') OUTPUTS: t_dynamics time values at which the dynamics are returned. These are the dynamics time nodes as described in the above papers and are nonuniform and sparse. quat0 quat1 quat2 quat3 time series of coprecessing frame quaternions. These are used to transform between the inertial frame and the coprecessing frames. orbphase orbital phase time series in the coprecessing frame. This is used to transform between the coprecessing and the coorbital frames. chiAx chiAy chiAz time series of spin of the heavier BH in the coprecessing frame. For convenience for the main use case with surrogate remnant fits, these are in coprecessing frame rather then the reference frame in which the input spins are specified. chiBx chiBy chiBz time series of spin of the heavier BH in the coprecessing frame.

Parameters
t_dynamicsOutput: Time array at which the dynamics are returned.
quat0Output: Time series of 0th index of coprecessing frame quaternion.
quat1Output: Time series of 1st index of coprecessing frame quaternion.
quat2Output: Time series of 2nd index of coprecessing frame quaternion.
quat3Output: Time series of 3rd index of coprecessing frame quaternion.
orbphaseOutput: Time series of orbital phase in the coprecessing frame.
chiAxOutput: Time series of x-comp of dimensionless spin of BhA in the coprecessing frame.
chiAyOutput: Time series of y-comp of dimensionless spin of BhA in the coprecessing frame.
chiAzOutput: Time series of z-comp of dimensionless spin of BhA in the coprecessing frame.
chiBxOutput: Time series of x-comp of dimensionless spin of BhB in the coprecessing frame.
chiByOutput: Time series of y-comp of dimensionless spin of BhB in the coprecessing frame.
chiBzOutput: Time series of z-comp of dimensionless spin of BhB in the coprecessing frame.
qmass ratio m1/m2 >= 1.
chiA0xx-comp of dimensionless spin of BhA in the coorbital frame at the reference epoch.
chiA0yy-comp of dimensionless spin of BhA in the coorbital frame at the reference epoch.
chiA0zz-comp of dimensionless spin of BhA in the coorbital frame at the reference epoch.
chiB0xx-comp of dimensionless spin of BhB in the coorbital frame at the reference epoch.
chiB0yy-comp of dimensionless spin of BhB in the coorbital frame at the reference epoch.
chiB0zz-comp of dimensionless spin of BhB in the coorbital frame at the reference epoch.
omegaRef_dimlessDimensionless orbital frequency (rad/M) in the coprecessing frame at the reference epoch.
init_quat00th comp of the coprecessing frame quaternion at the reference epoch.
init_quat11st comp of the coprecessing frame quaternion at the reference epoch.
init_quat22nd comp of the coprecessing frame quaternion at the reference epoch.
init_quat33rd comp of the coprecessing frame quaternion at the reference epoch.
init_orbphaseorbital phase in the coprecessing frame at the reference epoch.
LALparamsDict with extra parameters.
approximantapproximant (NRSur7dq2 or NRSur7dq4).

Definition at line 2696 of file LALSimIMRPrecessingNRSur.c.