LALSimulation  5.4.0.1-fe68b98
LALSimNRSurrogateUtilities.c File Reference

Prototypes

static void MultiModalWaveform_Init (MultiModalWaveform **wave, int LMax, int n_times)
 Initialize a MultiModalWaveforme. More...
 
static void MultiModalWaveform_Destroy (MultiModalWaveform *wave)
 Destroy a MultiModalWaveform structure; free all associated memory. More...
 
static void ComplexPowers_Init (ComplexPowers **cp, int LMax, int n_times)
 Initialize a ComplexPowers structure. More...
 
static void ComplexPowers_Destroy (ComplexPowers *cp)
 Destroy a ComplexPowers structure; free all associated memory. More...
 
static void RealPowers_Init (RealPowers **rp, int LMax, int n_times)
 Initialize a RealPowers structure. More...
 
static void RealPowers_Destroy (RealPowers *rp)
 Destroy a RealPowers structure; free all associated memory. More...
 
static void WignerDMatrices_Init (WignerDMatrices **matrices, int n_times, int LMax)
 Initialize a WignerDMatrices structure. More...
 
static void WignerDMatrices_Destroy (WignerDMatrices *matrices)
 Destroy a WignerDMatrices structure; free all associated memory. More...
 
static int WignerDMatrix_Index (int ell, int m, int mp)
 Computes the index of the (ell, m, mp) component in a WignerDMatices structure. More...
 
static REAL8 factorial (int n)
 
static REAL8 factorial_ratio (int n, int k)
 
static REAL8 binomial (int n, int k)
 
static REAL8 wigner_coef (int ell, int mp, int m)
 
static void complex_vector_mult (gsl_vector *x1, gsl_vector *y1, gsl_vector *x2, gsl_vector *y2, gsl_vector *tmpx, gsl_vector *tmpy)
 Multiplies z1(t) * z2(t) = (x1(t) + i*y1(t)) * (x2(t) + i*y2(t)), storing the result in x1 and y1. More...
 
static void NRSur_ab4_dy (REAL8 *dy, REAL8 *k1, REAL8 *k2, REAL8 *k3, REAL8 *k4, REAL8 t12, REAL8 t23, REAL8 t34, REAL8 t45, int dim)
 
static void ComplexPowers_Compute (ComplexPowers *cp, gsl_vector *x, gsl_vector *y)
 Computes all powers of z(t) = x(t) + i*y(t) needed for WignerDMatrices. More...
 
static void RealPowers_Compute (RealPowers *rp, gsl_vector *x)
 Computes all powers of x(t) needed for WignerDMatrices. More...
 
static void TransformModesCoorbitalToInertial (MultiModalWaveform *h, MultiModalWaveform *h_coorb, gsl_vector **quat, gsl_vector *orbphase)
 Transforms modes from the coorbital frame to the inertial frame. More...
 
static void WignerDMatrices_Compute (WignerDMatrices *matrices, gsl_vector **quat)
 Computes all the Wigner D Matrices. More...
 
static UNUSED int quatInv (REAL8 *qInv, REAL8 *q)
 Computes inverse, qInv, of a quaternion q such that q*qInv = 1. More...
 
static UNUSED int multiplyQuats (REAL8 *prod, REAL8 *q1, REAL8 *q2)
 Multiplies two quaternions. More...
 
static UNUSED int quaternionTransformVector (REAL8 *new_vec, REAL8 *quat, REAL8 *vec)
 Given a coprecessing frame quaternion (quat), transforms a 3-vector (vec) from the coprecessing frame to the inertial frame. More...
 
static UNUSED int transformTimeDependentVector (gsl_vector **vec, gsl_vector **quat)
 Transforms a vector from the coprecessing frame to the inertial frame using the coprecessing frame quaternions. More...
 
static UNUSED int get_dimless_omega (REAL8 *omegaMin_dimless, REAL8 *omegaRef_dimless, const REAL8 fMin, const REAL8 fRef, const REAL8 Mtot_sec)
 Wrapper to get dimensionless omegaMin/omegaRef from fMin/fRef. More...
 

Go to the source code of this file.

Function Documentation

◆ MultiModalWaveform_Init()

static void MultiModalWaveform_Init ( MultiModalWaveform **  wave,
int  LMax,
int  n_times 
)
static

Initialize a MultiModalWaveforme.

We also have the usual frame data, which is initially the m structure

Parameters
waveOutput; the MultiModalWaveform.
LMax(ell, m) modes with 2 <= ell <= LMax will be created.
n_timesNumber of time samples per mode.

Definition at line 30 of file LALSimNRSurrogateUtilities.c.

◆ MultiModalWaveform_Destroy()

static void MultiModalWaveform_Destroy ( MultiModalWaveform wave)
static

Destroy a MultiModalWaveform structure; free all associated memory.

Definition at line 69 of file LALSimNRSurrogateUtilities.c.

◆ ComplexPowers_Init()

static void ComplexPowers_Init ( ComplexPowers **  cp,
int  LMax,
int  n_times 
)
static

Initialize a ComplexPowers structure.

Parameters
cpThe ComplexPowers structure to be initialized.
LMaxThe maximum ell that will be needed by WignerDMatrices.
n_timesThe number of time samples.

Definition at line 85 of file LALSimNRSurrogateUtilities.c.

◆ ComplexPowers_Destroy()

static void ComplexPowers_Destroy ( ComplexPowers cp)
static

Destroy a ComplexPowers structure; free all associated memory.

Definition at line 113 of file LALSimNRSurrogateUtilities.c.

◆ RealPowers_Init()

static void RealPowers_Init ( RealPowers **  rp,
int  LMax,
int  n_times 
)
static

Initialize a RealPowers structure.

Parameters
rpThe RealPowers structure to be initialized.
LMaxThe maximum ell that will be needed by WignerDMatrices.
n_timesThe number of time samples.

Definition at line 127 of file LALSimNRSurrogateUtilities.c.

◆ RealPowers_Destroy()

static void RealPowers_Destroy ( RealPowers rp)
static

Destroy a RealPowers structure; free all associated memory.

Definition at line 152 of file LALSimNRSurrogateUtilities.c.

◆ WignerDMatrices_Init()

static void WignerDMatrices_Init ( WignerDMatrices **  matrices,
int  n_times,
int  LMax 
)
static

Initialize a WignerDMatrices structure.

Parameters
matricesOutput; the WignerDMatrices.
n_timesThe number of time samples for each (ell, m, m') component.
LMaxThe maximum ell to generate.

Definition at line 164 of file LALSimNRSurrogateUtilities.c.

◆ WignerDMatrices_Destroy()

static void WignerDMatrices_Destroy ( WignerDMatrices matrices)
static

Destroy a WignerDMatrices structure; free all associated memory.

Definition at line 197 of file LALSimNRSurrogateUtilities.c.

◆ WignerDMatrix_Index()

static int WignerDMatrix_Index ( int  ell,
int  m,
int  mp 
)
static

Computes the index of the (ell, m, mp) component in a WignerDMatices structure.

Definition at line 215 of file LALSimNRSurrogateUtilities.c.

◆ factorial()

static REAL8 factorial ( int  n)
static

Definition at line 222 of file LALSimNRSurrogateUtilities.c.

◆ factorial_ratio()

static REAL8 factorial_ratio ( int  n,
int  k 
)
static

Definition at line 227 of file LALSimNRSurrogateUtilities.c.

◆ binomial()

static REAL8 binomial ( int  n,
int  k 
)
static

Definition at line 232 of file LALSimNRSurrogateUtilities.c.

◆ wigner_coef()

static REAL8 wigner_coef ( int  ell,
int  mp,
int  m 
)
static

Definition at line 236 of file LALSimNRSurrogateUtilities.c.

◆ complex_vector_mult()

static void complex_vector_mult ( gsl_vector *  x1,
gsl_vector *  y1,
gsl_vector *  x2,
gsl_vector *  y2,
gsl_vector *  tmpx,
gsl_vector *  tmpy 
)
static

Multiplies z1(t) * z2(t) = (x1(t) + i*y1(t)) * (x2(t) + i*y2(t)), storing the result in x1 and y1.

Parameters
x1Real part of z1.
y1Imag part of z1.
x2Real part of z2.
y2Imag part of z2.
tmpxA vector for storing temporary results.
tmpyA second vector for storing temporary results.

Definition at line 244 of file LALSimNRSurrogateUtilities.c.

◆ NRSur_ab4_dy()

static void NRSur_ab4_dy ( REAL8 dy,
REAL8 k1,
REAL8 k2,
REAL8 k3,
REAL8 k4,
REAL8  t12,
REAL8  t23,
REAL8  t34,
REAL8  t45,
int  dim 
)
static
Parameters
dyResult
k1dy/dt evaluated at node 1
k2dy/dt evaluated at node 2
k3dy/dt evaluated at node 3
k4dy/dt evaluated at node 4
t12t_2 - t_1
t23t_3 - t_2
t34t_4 - t_3
t45t_5 - t_4
dimVector dimension. Length of dy, k1, k2, k3, k4.

Definition at line 277 of file LALSimNRSurrogateUtilities.c.

◆ ComplexPowers_Compute()

static void ComplexPowers_Compute ( ComplexPowers cp,
gsl_vector *  x,
gsl_vector *  y 
)
static

Computes all powers of z(t) = x(t) + i*y(t) needed for WignerDMatrices.

Definition at line 349 of file LALSimNRSurrogateUtilities.c.

◆ RealPowers_Compute()

static void RealPowers_Compute ( RealPowers rp,
gsl_vector *  x 
)
static

Computes all powers of x(t) needed for WignerDMatrices.

Definition at line 427 of file LALSimNRSurrogateUtilities.c.

◆ TransformModesCoorbitalToInertial()

static void TransformModesCoorbitalToInertial ( MultiModalWaveform h,
MultiModalWaveform h_coorb,
gsl_vector **  quat,
gsl_vector *  orbphase 
)
static

Transforms modes from the coorbital frame to the inertial frame.

Note that this is a coorbital frame determined entirely from the waveform modes and not from the trajectories; it is a rotation of the coprecessing frame about the z-axis by an orbital phase computed from the waveform modes. See eqns 6-9 and the surrounding text of https://arxiv.org/abs/1705.07089

Parameters
hOutput. Dimensionless waveform modes. Should be initialized already.
h_coorbCoorbital frame waveform modes.
quatCoprecessing frame quaternions - 4 vectors.
orbphaseOrbital phase.

Definition at line 458 of file LALSimNRSurrogateUtilities.c.

◆ WignerDMatrices_Compute()

static void WignerDMatrices_Compute ( WignerDMatrices matrices,
gsl_vector **  quat 
)
static

Computes all the Wigner D Matrices.

We compute them all at once because a lot of the work is just processing quat. Parts of this function are adapted from GWFrames: https://github.com/moble/GWFrames written by Michael Boyle, based on his paper: http://arxiv.org/abs/1302.2919 although we are working with the conjugate of quat.

Parameters
matricesThe initialized WignerDMatrices which will contain the output.
quatThe 4 quaternion components representing the coorbital frame.

Definition at line 574 of file LALSimNRSurrogateUtilities.c.

◆ quatInv()

static UNUSED int quatInv ( REAL8 qInv,
REAL8 q 
)
static

Computes inverse, qInv, of a quaternion q such that q*qInv = 1.

Parameters
qInvOutput: Inverse of q. Should be initialized with size=4
qInput quaternion. Should have size=4

Definition at line 764 of file LALSimNRSurrogateUtilities.c.

◆ multiplyQuats()

static UNUSED int multiplyQuats ( REAL8 prod,
REAL8 q1,
REAL8 q2 
)
static

Multiplies two quaternions.

Parameters
prodOutput: Product of q1 and q2. Should be initialized with size=4.
q1First quaternion. Should have size=4.
q2Second quaternion. Should have size=4.

Definition at line 780 of file LALSimNRSurrogateUtilities.c.

◆ quaternionTransformVector()

static UNUSED int quaternionTransformVector ( REAL8 new_vec,
REAL8 quat,
REAL8 vec 
)
static

Given a coprecessing frame quaternion (quat), transforms a 3-vector (vec) from the coprecessing frame to the inertial frame.

Reference: Eq.(A6) of https://arxiv.org/pdf/1302.2919.pdf

Parameters
new_vecOutput: Transformed vector in inertial frame. Should be initialized with size=3
quatCoprecessing frame quaternion. Should have size=4.
vecInput vector in coprecessing frame. Should have size=3.

Definition at line 798 of file LALSimNRSurrogateUtilities.c.

◆ transformTimeDependentVector()

static UNUSED int transformTimeDependentVector ( gsl_vector **  vec,
gsl_vector **  quat 
)
static

Transforms a vector from the coprecessing frame to the inertial frame using the coprecessing frame quaternions.

Parameters
vecInput and Output: 3 time-dependent components of vec in the coprecessing frame
quat4 time-dependent components of coprecessing frame quaternions.

Definition at line 830 of file LALSimNRSurrogateUtilities.c.

◆ get_dimless_omega()

static UNUSED int get_dimless_omega ( REAL8 omegaMin_dimless,
REAL8 omegaRef_dimless,
const REAL8  fMin,
const REAL8  fRef,
const REAL8  Mtot_sec 
)
static

Wrapper to get dimensionless omegaMin/omegaRef from fMin/fRef.

Parameters
omegaMin_dimlessOutput. omegaMin in units rad/M.
omegaRef_dimlessOutput. omegaRef in units rad/M.
fMinfMin in Hertz.
fReffRef in Hertz.
Mtot_secTotal mass in seconds.

Definition at line 874 of file LALSimNRSurrogateUtilities.c.