Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALSimulation 6.2.0.1-8a6b96f
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
LALSimIMRPhenomX_precession.h
Go to the documentation of this file.
1#ifndef _LALSIM_IMR_PHENOMX_PRECESSION_H
2#define _LALSIM_IMR_PHENOMX_PRECESSION_H
3/*
4 * Copyright (C) 2018/2019 Geraint Pratten
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with with program; see the file COPYING. If not, write to the
18 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 * MA 02110-1301 USA
20 */
21
22
23/**
24 * \author Geraint Pratten
25 *
26 */
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
32#ifdef __GNUC__
33#define UNUSED __attribute__ ((unused))
34#else
35#define UNUSED
36#endif
37
38#include "LALSimIMRPhenomX.h"
41
42#include "LALSimIMRPhenomXHM.h"
44
45//#include "LALSimIMRPhenomX_PNR_beta.h"
46
47#include <lal/LALStdlib.h>
48#include <lal/LALSimIMR.h>
49#include <lal/LALConstants.h>
50
51#include <lal/FrequencySeries.h>
52#include <lal/LALSimInspiral.h>
53#include <gsl/gsl_spline.h>
54
55/**
56 * Tolerance used below which numbers are treated as zero for the calculation of atan2
57 */
58#define MAX_TOL_ATAN 1.0e-15
59
60/* Cartesian 3-vector */
61typedef struct tagvector
62{
63 double x; // x-component
64 double y; // y-component
65 double z; // z-component
66} vector;
67
68/* Spherical Polar 3-vector */
69typedef struct tagsphpolvector
70{
71 double r; // radial-component
72 double theta; // theta-component
73 double phi; // phi-component
75
76/* MRD angles utilities */
77typedef struct tagPhenomXPbetaMRD
78 {
79 double aRD;
80 double bRD;
81 double cRD;
82 double dRD;
84 bool flat_RD;
85 double dfdamp;
86
88
89typedef struct tagPhenomXPalphaMRD
90 {
91 double aRD;
92 double bRD;
93 double cRD;
94
96
97typedef struct tagPhenomXPInspiralArrays{
98
110
111/* Struct to store all precession relevant variables */
112typedef struct tagIMRPhenomXPrecessionStruct
113{
114 /* Flag to define the version of IMRPhenomXP called */
115 INT4 IMRPhenomXPrecVersion; /**< Flag to set version of Euler angles used. */
116
117 /* Toggle to return coprecessing model without any twisting up */
119
120 // /* Parameters that define deviation of the tuned coprecessing mode PhenomXCP from PhenomX */
121 // REAL8 MU2; // MR Amplitude
122 // REAL8 MU3; // MR Amplitude
123 // REAL8 MU4; // MR Amplitude
124 // REAL8 NU4; // MR Phase
125 // REAL8 NU5; // MR Phase
126 // REAL8 NU6; // MR Phase
127 // REAL8 ZETA2; // INT Phase
128
129 /* Debug flag */
130 INT4 debug_prec; /**< Set debugging level. */
131
132 /* Mass and spin weightings */
133 REAL8 A1; /**< Mass weighted pre-factor, see Eq. 3.2 of Schmidt et al, arXiv:1408.1810 */
134 REAL8 A2; /**< Mass weighted pre-factor, see Eq. 3.2 of Schmidt et al, arXiv:1408.1810 */
135 REAL8 ASp1; /**< \f$A1 * S_{1 \perp}\f$, see Eq. 3.3 of Schmidt et al, arXiv:1408.1810 */
136 REAL8 ASp2; /**< \f$A2 * S_{2 \perp}\f$, see Eq. 3.3 of Schmidt et al, arXiv:1408.1810 */
137 REAL8 chi1_perp; /**< \f$ \chi_{1 \perp} \f$ */
138 REAL8 chi2_perp; /**< \f$ \chi_{2 \perp} \f$ */
139 REAL8 S1_perp; /**< \f$ S_{1 \perp} \f$ */
140 REAL8 S2_perp; /**< \f$ S_{2 \perp} \f$ */
141 REAL8 SL; /**< \f$ \chi_{1 L} m^1_2 + \chi_{2 L} m^2_2 \f$ */
142 REAL8 Sperp; /**< \f$ \chi_{p} m^1_2 \f$ */
143 REAL8 STot_perp; /**< \f$ S_{1 \perp} + S_{2 \perp} \f$ */
145 REAL8 chiTot_perp; /**< \f$ S_{1 \perp} + S_{2 \perp} \f$ */
146
147 /* Effective precessing spin parameter: Schmidt et al, Phys. Rev. D 91, 024043 (2015), arXiv:1408.1810 */
148 REAL8 chi_p; /**< \f$ \chi_{p} = S_p / (A_1 \chi^2_1) \f$, Eq. 3.4 of Schmidt et al, arXiv:1408.1810 */
149
150 /* Dimensionless aligned spin components on companion 1 and 2 respectively */
151 REAL8 chi1L; /**< \f$ \chi_{1L} = \chi_{1} \cdot \hat{L} \f$ */
152 REAL8 chi2L; /**< \f$ \chi_{2L} = \chi_{2} \cdot \hat{L} \f$ */
153
154 /* Angle between J0 and line of sight (z-direction) */
155 REAL8 thetaJN; /**< Angle between J0 and line of sight (z-direction) */
156
157 /* The initial phase that we pass to the underlying aligned spin IMR waveform model */
158 REAL8 phi0_aligned; /**< Initial phase to feed the underlying aligned-spin model */
159
160 /* Angle to rotate the polarization */
161 REAL8 zeta_polarization; /**< Angle to rotate the polarizations */
162
163 /* Post-Newtonian Euler angles */
164 REAL8 alpha0; /**< Coefficient of \f$\alpha\f$ */
165 REAL8 alpha1; /**< Coefficient of \f$\alpha\f$ */
166 REAL8 alpha2; /**< Coefficient of \f$\alpha\f$ */
167 REAL8 alpha3; /**< Coefficient of \f$\alpha\f$ */
168 REAL8 alpha4L; /**< Coefficient of \f$\alpha\f$ */
169 REAL8 alpha5; /**< Coefficient of \f$\alpha\f$ */
170 REAL8 alpha6; /**< Coefficient of \f$\alpha\f$ */
171 REAL8 alphaNNLO; /**< Post Newtonian \f$\alpha\f$ at NNLO. */
172 REAL8 alpha_offset; /**< Offset for \f$\alpha\f$ */
173
174 REAL8 epsilon0; /**< Coefficient of \f$\epsilon \f$ */
175 REAL8 epsilon1; /**< Coefficient of \f$\epsilon \f$ */
176 REAL8 epsilon2; /**< Coefficient of \f$\epsilon \f$ */
177 REAL8 epsilon3; /**< Coefficient of \f$\epsilon \f$ */
178 REAL8 epsilon4L; /**< Coefficient of \f$\epsilon \f$ */
179 REAL8 epsilon5; /**< Coefficient of \f$\epsilon \f$ */
180 REAL8 epsilon6; /**< Coefficient of \f$\epsilon \f$ */
181 REAL8 epsilonNNLO; /**< Post Newtonian \f$\epsilon \f$ at NNLO. */
182 REAL8 epsilon_offset; /**< Offset for \f$\epsilon \f$ */
183
184 /* Alpha and epsilon offset for mprime !=2. alpha_offset corresponds to mprime=2 */
185 REAL8 alpha_offset_1; /**< \f$\alpha\f$ offset passed to \f$m = 1\f$ modes. */
186 REAL8 alpha_offset_3; /**< \f$\alpha\f$ offset passed to \f$m = 3\f$ modes. */
187 REAL8 alpha_offset_4; /**< \f$\alpha\f$ offset passed to \f$m = 4\f$ modes. */
188 REAL8 epsilon_offset_1; /**< \f$\epsilon\f$ offset passed to \f$m = 1\f$ modes. */
189 REAL8 epsilon_offset_3; /**< \f$\epsilon\f$ offset passed to \f$m = 3\f$ modes. */
190 REAL8 epsilon_offset_4; /**< \f$\epsilon\f$ offset passed to \f$m = 4\f$ modes. */
191
192 /* Complex exponential of the Euler angles */
193 COMPLEX16 cexp_i_alpha; /**< \f$e^{i \alpha}\f$ */
194 COMPLEX16 cexp_i_epsilon; /**< \f$e^{i \epsilon}\f$ */
196
197 /* Multibanding applied to Euler angles */
198 INT4 MBandPrecVersion; /**< Flag to control multibanding for Euler angles. */
199
200 /* Source Frame Variables */
201 REAL8 J0x_Sf; /**< \f$ J_{0,x}\f$ in L frame. */
202 REAL8 J0y_Sf; /**< \f$ J_{0,y}\f$ in L frame. */
203 REAL8 J0z_Sf; /**< \f$ J_{0,z}\f$ in L frame. */
204 REAL8 J0; /**< \f$ J_{0}\f$ in L frame. */
205 REAL8 thetaJ_Sf; /**< Angle between \f$J_0\f$ and \f$ L_{\rm{N}} \f$ (z-direction) */
206 REAL8 phiJ_Sf; /**< Azimuthal angle of \f$J_0\f$ in the L frame */
207 REAL8 Nx_Sf; /**< Line-of-sight vector component \f$ N_{x}\f$ in L frame. */
208 REAL8 Ny_Sf; /**< Line-of-sight vector component \f$ N_{y}\f$ in L frame. */
209 REAL8 Nz_Sf; /**< Line-of-sight vector component \f$ N_{z}\f$ in L frame. */
210 REAL8 Xx_Sf; /**< Component of triad basis vector X in L frame. */
211 REAL8 Xy_Sf; /**< Component of triad basis vector X in L frame. */
212 REAL8 Xz_Sf; /**< Component of triad basis vector X in L frame. */
213 REAL8 kappa; /**< Eq. C12 of arXiv:XXXX.YYYY */
214
215 /* J-frame variables */
216 REAL8 Nx_Jf; /**< Line-of-sight vector component \f$ N_{x}\f$ in J frame. */
217 REAL8 Ny_Jf; /**< Line-of-sight vector component \f$ N_{x}\f$ in J frame. */
218 REAL8 Nz_Jf; /**< Line-of-sight vector component \f$ N_{x}\f$ in LJ frame. */
219 REAL8 PArunx_Jf; /**< Component of triad basis vector P in J frame, arXiv:0810.5336. */
220 REAL8 PAruny_Jf; /**< Component of triad basis vector P in J frame, arXiv:0810.5336. */
221 REAL8 PArunz_Jf; /**< Component of triad basis vector P in J frame, arXiv:0810.5336. */
222 REAL8 QArunx_Jf; /**< Component of triad basis vector Q in J frame, arXiv:0810.5336. */
223 REAL8 QAruny_Jf; /**< Component of triad basis vector Q in J frame, arXiv:0810.5336. */
224 REAL8 QArunz_Jf; /**< Component of triad basis vector Q in J frame, arXiv:0810.5336. */
225 REAL8 XdotPArun; /**< \f$ X \cdot P \f$ */
226 REAL8 XdotQArun; /**< \f$ X \cdot Q \f$ */
227
228 /* Orbital angular momentum */
229 REAL8 L0, L1, L2, L3, L4, L5, L6, L7, L8, L8L, LN, LOrb, LRef,LInit;
230
231 /* Reference frequencies */
232 REAL8 omega_ref, logomega_ref, omega_ref_cbrt, omega_ref_cbrt2;
233
234 /* Spin weighted spherical harmonics */
235 /* l = 2 */
236 COMPLEX16 Y2m2, Y2m1, Y20, Y21, Y22;
237
238 /* l = 3 */
239 COMPLEX16 Y3m3, Y3m2, Y3m1, Y30, Y31, Y32, Y33;
240
241 /* l = 4 */
242 COMPLEX16 Y4m4, Y4m3, Y4m2, Y4m1, Y40, Y41, Y42, Y43, Y44;
243
244 /* Useful sqare roots */
245 REAL8 sqrt2, sqrt5, sqrt6, sqrt7, sqrt10, sqrt14, sqrt15, sqrt70, sqrt30, sqrt2p5;
246
247 /* Variables for MSA precession angles of Chatziioannou et al, arXiv:1703.03967 */
248 /* Lhat = {0,0,1} */
249 REAL8 Lhat_theta, Lhat_phi, Lhat_norm, Lhat_cos_theta;
250
251 /* Cartesian Dimensionful Spins */
252 REAL8 S1x; /**< \f$ S_{1,x} \f$ in L frame */
253 REAL8 S1y; /**< \f$ S_{1,y} \f$ in L frame */
254 REAL8 S1z; /**< \f$ S_{1,z} \f$ in L frame */
255 REAL8 S2x; /**< \f$ S_{2,x} \f$ in L frame */
256 REAL8 S2y; /**< \f$ S_{2,y} \f$ in L frame */
257 REAL8 S2z; /**< \f$ S_{2,z} \f$ in L frame */
258
259 /* Spherical Polar Dimensionful Spins */
260 REAL8 S1_norm; /**< \f$ \left| S_{1} \right| \f$ */
261 REAL8 S1_theta; /**< Spherical polar component \f$ S_{1,\theta} \f$ in L frame */
262 REAL8 S1_phi; /**< Spherical polar component \f$ S_{1,\phi} \f$ in L frame */
263 REAL8 S1_cos_theta; /**< Spherical polar component \f$ \cos S_{1,\theta} \f$ in L frame */
264
265 REAL8 S2_norm; /**< \f$ \left| S_{2} \right| \f$ */
266 REAL8 S2_theta; /**< Spherical polar component \f$ S_{2,\theta} \f$ in L frame */
267 REAL8 S2_phi; /**< Spherical polar component \f$ S_{2,\phi} \f$ in L frame */
268 REAL8 S2_cos_theta; /**< Spherical polar component \f$ \cos S_{2,\theta} \f$ in L frame */
269
270 /* Cartesian Dimensionless Spin Variables */
271 REAL8 chi1x; /**< \f$ \chi_{1,x} \f$ in L frame */
272 REAL8 chi1y; /**< \f$ \chi_{1,y} \f$ in L frame */
273 REAL8 chi1z; /**< \f$ \chi_{1,z} \f$ in L frame */
274
275 REAL8 chi2x; /**< \f$ \chi_{2,x} \f$ in L frame */
276 REAL8 chi2y; /**< \f$ \chi_{2,y} \f$ in L frame */
277 REAL8 chi2z; /**< \f$ \chi_{2,z} \f$ in L frame */
278
279 /* Spherical Polar Dimensionless Spins */
280 REAL8 chi1_theta; /**< Spherical polar component \f$ \chi_{1,\theta} \f$ in L frame */
281 REAL8 chi1_phi; /**< Spherical polar component \f$ \chi_{1,\phi} \f$ in L frame */
282 REAL8 chi1_norm; /**< \f$ \left| \chi_{1} \right| \f$ */
283 REAL8 chi1_cos_theta; /**< Spherical polar component \f$ \cos \chi_{1,\theta} \f$ in L frame */
284
285 REAL8 chi2_theta; /**< Spherical polar component \f$ \chi_{2,\theta} \f$ in L frame */
286 REAL8 chi2_phi; /**< Spherical polar component \f$ \chi_{2,\phi} \f$ in L frame */
287 REAL8 chi2_norm; /**< \f$ \left| \chi_{2} \right| \f$ */
288 REAL8 chi2_cos_theta; /**< Spherical polar component \f$ \cos \chi_{2,\theta} \f$ in L frame */
289
290 INT4 ExpansionOrder; /**< Flag to control expansion order of MSA system of equations. */
291
292 REAL8 twopiGM, piGM;
293
294 REAL8 L_Norm_N; /**< Norm of Newtonian orbital angular momentum \f$ \left| L_N \right| \f$ */
295 REAL8 L_Norm_3PN; /**< Norm of orbital angular momentum at 3PN \f$ \left| L_{3 \rm{PN}} \right| \f$ */
296 REAL8 J_Norm_N; /**< Norm of total angular momentum using Newtonian orbital angular momentum \f$ \left| J_{N} \right| \f$ */
297 REAL8 J_Norm_3PN; /**< Norm of total angular momentum at 3PN \f$ \left| J_{3 \rm{PN}} \right| \f$ */
298
299 REAL8 dotS1L; /**< \f$ S_1 \cdot \hat{L} \f$ */
300 REAL8 dotS1Ln; /**< \f$ \hat{S}_1 \cdot \hat{L} \f$ */
301 REAL8 dotS2L; /**< \f$ S_2 \cdot \hat{L} \f$ */
302 REAL8 dotS2Ln; /**< \f$ \hat{S}_1 \cdot \hat{L} \f$ */
303 REAL8 dotS1S2; /**< \f$ S_1 \cdot S_2 \f$ */
304 REAL8 Seff; /**< \f$ S_{\rm{eff}} = (1 + q^{-1}) S_1 \cdot \hat{L} + (1 + q) S_2 \cdot \hat{L} \f$, Eq. 7 of arXiv:1703.03967. Note convention for q. */
305 REAL8 Seff2; /**< \f$ S_{\rm{eff}}^2 \f$ */
306
307 vector S1_0; /**< Initial value for \f$ S_{1} \f$ */
308 vector S2_0; /**< Initial value for \f$ S_{2} \f$ */
309 vector L_0; /**< Initial value for \f$ L \f$ */
310 vector Lhat_0; /**< Initial value for \f$ \hat{L} \f$ */
311 vector S_0; /**< Initial value for \f$ S_1 + S_2 \f$ */
312 vector J_0; /**< Initial value for \f$ J \f$ */
313
314 REAL8 S_0_norm, S_0_norm_2;
315 REAL8 J_0_norm, J_0_norm_2;
316 REAL8 L_0_norm, L_0_norm_2;
317
318 REAL8 deltam_over_M; /**< \f$ (m_1 - m_2) / (m_1 + m_2) \f$ */
319
320 //REAL8 phiz_0, phiz_1, phiz_2, phiz_3, phiz_4, phiz_5;
321 REAL8 phiz_0_coeff, phiz_1_coeff, phiz_2_coeff, phiz_3_coeff, phiz_4_coeff, phiz_5_coeff;
322
323 // Omegaz_i coefficients in D10 - D15
324 REAL8 Omegaz0_coeff, Omegaz1_coeff, Omegaz2_coeff, Omegaz3_coeff, Omegaz4_coeff, Omegaz5_coeff;
325
326 // Omegaz terms in D16 - D21
327 REAL8 Omegaz0, Omegaz1, Omegaz2, Omegaz3, Omegaz4, Omegaz5;
328
329 REAL8 Omegazeta0_coeff, Omegazeta1_coeff, Omegazeta2_coeff, Omegazeta3_coeff, Omegazeta4_coeff, Omegazeta5_coeff;
330 REAL8 Omegazeta0, Omegazeta1, Omegazeta2, Omegazeta3, Omegazeta4, Omegazeta5;
331
332 // MSA-SUA Euler Angles
333 REAL8 phiz; /**< Azimuthal angle of L around J */
334 REAL8 zeta; /**< Angle to describe L w.r.t. J */
335 REAL8 cos_theta_L; /**< Cosine of polar angle between L and J */
336
337 // First order MSA corrections
338 REAL8 zeta_0_MSA; /**< First MSA correction \f$ \zeta_0 \f$, Eq. F19 of arXiv:1703.03967 */
339 REAL8 phiz_0_MSA; /**< First MSA correction \f$ \phi_{z,0} \f$, Eq. 67 of arXiv:1703.03967 */
340
341 // Initial values
342 REAL8 zeta_0; /**< Initial value of \f$ \zeta \f$ */
343 REAL8 phiz_0; /**< Initial value of \f$ \phi_{z,0} \f$ */
344
345 // Orbital velocity, v and v^2
346 REAL8 v; /**< Orbital velocity, \f$ v \f$ */
347 REAL8 v2; /**< Orbital velocity squared, \f$ v^2 \f$ */
348
349 // Reference orbital velocity, v and v^2
350 REAL8 v_0; /**< Orbital velocity at reference frequency, \f$ v_{\rm{ref}} \f$ */
351 REAL8 v_0_2; /**< Orbital velocity at reference frequency squared, \f$ v_{\rm{ref}}^2 \f$ */
352
353 REAL8 Delta; /**< Eq. C3 of arXiv:1703.03967 */
354
357
358 // Precession averaged total spin, Eq. 45
359 REAL8 SAv; /**< \f$ S_{\rm{av}} \f$ as defined in Eq. 45 of arXiv:1703.03967 */
360 REAL8 SAv2; /**< \f$ S_{\rm{av}}^2 \f$ */
361 REAL8 invSAv2; /**< \f$ 1 / S_{\rm{av}}^2 \f$ */
362 REAL8 invSAv; /**< \f$ 1 / S_{\rm{av}} \f$ */
363
364 // Eq. C1, C2 for Eq. 51
365 REAL8 psi1; /**< \f$ \psi_1 \f$ as defined in Eq. C1 of arXiv:1703.03967 */
366 REAL8 psi2; /**< \f$ \psi_2 \f$ as defined in Eq. C2 of arXiv:1703.03967 */
367
368 // Integration constant in Eq. 51
369 REAL8 psi0; /**< \f$ \psi_0 \f$ as per Eq. 51 of arXiv:1703.03967 */
370
371 // Eq. 51 and Eq. 24
372 REAL8 psi; /**< \f$ \psi \f$ as defined by Eq. 51 of arXiv:1703.03967 */
373 REAL8 psi_dot; /**< \f$ \dot{\psi} \f$ as per Eq. 50 of arXiv:1703.03967 */
374
375
376 REAL8 Cphi; /**< \f$ C_{\phi} \f$ as defined by Eq. B14 of arXiv:1703.03967 */
377 REAL8 Dphi; /**< \f$ C_{\phi} \f$ as defined by Eq. B15 of arXiv:1703.03967 */
378
379 //REAL8 phiz_0_MSA_Cphi_term, phiz_0_MSA_Dphi_term;
380
381 // PN Coefficients in Appendix A of Chatziioannou et al, PRD, 88, 063011, (2013)
382 REAL8 a0, a1, a2, a3, a4, a5, a6, a7, b6, a0_2, a0_3, a2_2;
383 REAL8 c0, c1, c2, c4, c12, c1_over_eta;
384
385 // Eq. B9 - B11
386 REAL8 d0, d2, d4;
387
388 // Eq. A1 - A8
389 REAL8 g0, g2, g3, g4, g5, g6, g7, g6L;
390
391 // Spin-Orbit couplings
392 REAL8 beta3, beta5, beta6, beta7, sigma4;
393
394 // Total normed spin of primary and secondary BH squared
395 REAL8 S1_norm_2, S2_norm_2;
396
397 // Precession averaged spin couplings in A9 - A14
398 REAL8 S1L_pav; /**< Precession averaged coupling \f$ \langle S_1 \cdot \hat{L} \rangle_{\rm{pr}} \f$, Eq. A9 of arXiv:1703.03967 */
399 REAL8 S2L_pav; /**< Precession averaged coupling \f$ \langle S_2 \cdot \hat{L} \rangle_{\rm{pr}} \f$, Eq. A10 of arXiv:1703.03967 */
400 REAL8 S1S2_pav; /**< Precession averaged coupling \f$ \langle S_1 \cdot S_2 \rangle_{\rm{pr}} \f$, Eq. A11 of arXiv:1703.03967 */
401 REAL8 S1Lsq_pav; /**< Precession averaged coupling \f$ \langle (S_1 \cdot \hat{L})^2 \rangle_{\rm{pr}} \f$, Eq. A12 of arXiv:1703.03967 */
402 REAL8 S2Lsq_pav; /**< Precession averaged coupling \f$ \langle (S_2 \cdot \hat{L})^2 \rangle_{\rm{pr}} \f$, Eq. A13 of arXiv:1703.03967 */
403 REAL8 S1LS2L_pav; /**< Precession averaged coupling \f$ \langle (S_1 \cdot \hat{L}) (S_2 \cdot \hat{L}) \rangle_{\rm{pr}} \f$, Eq. A14 of arXiv:1703.03967 */
404
405 // Total spin in Eq. 23 of Chatziioannou et al PRD, 95, 104004, (2017)
406 REAL8 S_norm, S_norm_2;
407
408 REAL8 Spl2; /**< Largest root of polynomial \f$ S^2_+ \f$, Eq. 22 of arXiv:1703.03967 */
409 REAL8 Smi2; /**< Smallest root of polynomial \f$ S^2_- \f$, Eq. 22 of arXiv:1703.03967 */
410 REAL8 S32; /**< Third root of polynomial \f$ S^2_3 \f$, Eq. 22 of arXiv:1703.03967 */
411 REAL8 Spl; /**< \f$ S_+ \f$ */
412 REAL8 Smi; /**< \f$ S_- \f$ */
413 REAL8 S3; /**< \f$ S_3 \f$ */
414 REAL8 Spl2mSmi2; /**< \f$ S^2_+ - S^2_- \f$ */
415 REAL8 Spl2pSmi2; /**< \f$ S^2_+ + S^2_- \f$ */
416
417 REAL8 A_coeff, B_coeff, C_coeff, D_coeff;
418
419 REAL8 qq, invqq, eta, eta2, eta3, eta4;
420 REAL8 delta_qq, delta2_qq, delta3_qq, delta4_qq;
421 REAL8 inveta, inveta2, inveta3, inveta4, sqrt_inveta;
422
424
425 REAL8 LPN_coefficients[6];
426
427 REAL8 constants_L[5];
428
429 // Variables to interpolate SpinTaylor angles, up to fmax_angles
430 gsl_spline *alpha_spline;
431 gsl_spline *cosbeta_spline;
432 gsl_spline *gamma_spline;
433
434 gsl_interp_accel *alpha_acc;
435 gsl_interp_accel *cosbeta_acc;
436 gsl_interp_accel *gamma_acc;
437
439 REAL8 alpha_ref; /**< Record value of alpha at f_ref */
440 REAL8 gamma_ref; /**< Record value of gamma at f_ref */
441 REAL8 alpha_ftrans; /**< Record value of alpha at end of inspiral, used in IMRPhenomXPHMTwistUp and IMRPhenomXPHMTwistUpOneMode */
442 REAL8 cosbeta_ftrans; /**< Record value of cosbeta at end of inspiral, used in IMRPhenomXPHMTwistUp and IMRPhenomXPHMTwistUpOneMode */
443 REAL8 gamma_ftrans; /**< Record value of gamma at end of inspiral, used in IMRPhenomXPHMTwistUp and IMRPhenomXPHMTwistUpOneMode */
444 REAL8 gamma_in; /**< Record last value of gamma, used in IMRPhenomXPHMTwistUp and IMRPhenomXPHMTwistUpOneMode */
445 PhenomXPalphaMRD *alpha_params; /**< Parameters needed for analytical MRD continuation of alpha */
446 PhenomXPbetaMRD *beta_params; /**< Parameters needed for analytical MRD continuation of cosbeta */
455 REAL8 integration_buffer; /**< Buffer region for integration of SpinTaylor equations: added so that interpolated angles cover the frequency range requested by user */
456 REAL8 fmin_integration; /**< Minimum frequency covered by the integration of PN spin-precessing equations for SpinTaylor models */
457 REAL8 Mfmin_integration; /**< Minimum frequency covered by the integration of PN spin-precessing equations for SpinTaylor models */
458
459 INT4 MSA_ERROR; /**< Flag to track errors in initialization of MSA system. */
460
461 /* PNR-specific additions for single-spin mapping */
462 REAL8 chi_singleSpin; /**< Magnitude of effective single spin used for tapering two-spin angles, Eq. 18 of arXiv:2107.08876 */
463 REAL8 costheta_singleSpin; /**< Polar angle of effective single spin, Eq. 19 or arXiv:2107.08876 */
464 REAL8 costheta_final_singleSpin; /**< Polar angle of approximate final spin, see technical document FIXME: add reference */
465
468
469 REAL8 chi1x_evolved; /**< x-component of spin on primary at end of SpinTaylor evolution */
470 REAL8 chi1y_evolved; /**< y-component of spin on primary at end of SpinTaylor evolution */
471 REAL8 chi1z_evolved; /**< z-component of spin on primary at end of SpinTaylor evolution */
472 REAL8 chi2x_evolved; /**< x-component of spin on secondary at end of SpinTaylor evolution */
473 REAL8 chi2y_evolved; /**< y-component of spin on secondary at end of SpinTaylor evolution */
474 REAL8 chi2z_evolved; /**< z-component of spin on secondary at end of SpinTaylor evolution */
475
476 REAL8 chi_singleSpin_antisymmetric; /**< magnitude of effective single spin of a two spin system for the antisymmetric waveform */
477 REAL8 theta_antisymmetric; /**< Polar angle effective single spin for antisymmetric waveform */
478
479 REAL8 PNR_HM_Mflow; /**< Mf_alpha_lower stored from alphaParams struct, 2 A4 / 7 from arXiv:2107.08876 */
480 REAL8 PNR_HM_Mfhigh; /**< Mf_beta_lower stored from betaParams struct, Eq. 58 from arXiv:2107.08876 */
481 REAL8 PNR_q_window_lower; /**< Boundary values for PNR angle transition window */
485 UINT4 PNRInspiralScaling; /**< Enforce inpsiral scaling for HM angles outside of calibration window */
486
487 /* Store PNR-specific waveform flags for turning on and off tuning */
494
495 /* A copy of the XAS 22 object */
498
499 /* Store anti-symmetric waveform flag for turning on and off */
501
502 /* polarization symmetry property, refer to XXXX.YYYYY for details */
504
505 /* variables to store PNR angles for use in existing XP and XPHM twist-up functions */
509
510 /* flag to use MR beta or analytic continuation with PNR angles */
512
514
515 /* flag to toggle conditional precession multibanding */
517
518 LALDict *LALparams;
519
520
522
523double IMRPhenomX_L_norm_3PN_of_v(const double v, const double v2, const double L_norm, IMRPhenomXPrecessionStruct *pPrec);
524
525/* ~~~~~~~~~~ Perform transformations & initialize struct ~~~~~~~~~~ */
527 REAL8 m1_SI, REAL8 m2_SI,
528 REAL8 S1x, REAL8 S1y, REAL8 S1z,
529 REAL8 S2x, REAL8 S2y, REAL8 S2z,
530 LALDict *lalParams, INT4 debug_flag
531);
532
533/* ~~~~~~~~~~ Post Newtonian Orbital Angular Momentum ~~~~~~~~~~ */
534/* Functions to generate post-Newtonian Orbital Angular Momenta */
539
540REAL8 XLALSimIMRPhenomXLPNAnsatz(REAL8 v, REAL8 LN, REAL8 L0, REAL8 L1, REAL8 L2, REAL8 L3, REAL8 L4, REAL8 L5, REAL8 L6, REAL8 L7, REAL8 L8, REAL8 L8L);
541
542/* Function to check the maximum opening angle */
544 IMRPhenomXWaveformStruct *pWF, /**< IMRPhenomX Waveform Struct */
545 IMRPhenomXPrecessionStruct *pPrec, /**< IMRPhenomX Precession Struct */
546 LALDict *lalParams /**< LAL dictionary */
547);
548
549/* ~~~~~~~~~~ Wigner Functions ~~~~~~~~~~ */
550/* Wigner d Functions */
552 REAL8 *cos_beta_half, /**< [out] cos(beta/2) */
553 REAL8 *sin_beta_half, /**< [out] sin(beta/2) */
554 const REAL8 v, /**< Cubic root of Pi * Frequency in geometric units */
555 IMRPhenomXWaveformStruct *pWF, /**< IMRPhenomX Waveform Struct */
556 IMRPhenomXPrecessionStruct *pPrec /**< IMRPhenomX Precession Struct */
557);
558
559/* Wigner d Functions */
561 REAL8 *cos_beta_half, /**< [out] cos(beta/2) */
562 REAL8 *sin_beta_half, /**< [out] sin(beta/2) */
563 REAL8 cos_beta /**< cos(beta) */
564);
565
566
567/* ~~~~~~~~~~ Routine to twist up aligned spin model ~~~~~~~~~~ */
568/* Generic routine for twisting up 22-only models */
570 const REAL8 Mf, /**< Frequency (Hz) */
571 const COMPLEX16 hAS, /**< Underlying aligned-spin IMRPhenomXAS waveform*/
572 IMRPhenomXWaveformStruct *pWF, /**< IMRPhenomX Waveform Struct */
573 IMRPhenomXPrecessionStruct *pPrec, /**< IMRPhenomX Precession Struct */
574 COMPLEX16 *hp, /**< [out] h_+ polarization \f$\tilde h_+\f$ */
575 COMPLEX16 *hc /**< [out] h_x polarization \f$\tilde h_x\f$ */
576);
577
578/* ~~~~~~~~~~ NNLO post-Newtonian Euler Angles ~~~~~~~~~~ */
580 REAL8 f, /**< Geometric frequency */
581 REAL8 eta, /**< Symmetric mass rato */
582 REAL8 chi1L, /**< Dimensionless aligned spin of larger BH */
583 REAL8 chi2L, /**< Dimensionless aligned spin of smaller BH */
584 REAL8 chip, /**< Effective precession parameter: Schmidt, Ohme, Hannam, PRD, 91,024043 (2015) */
585 REAL8 epsilon0 /**< Euler angle at reference Frequency, defines a constant offset */
586);
587
589 REAL8 f, /**< Geometric frequency */
590 REAL8 eta, /**< Symmetric mass rato */
591 REAL8 chi1L, /**< Dimensionless aligned spin of larger BH */
592 REAL8 chi2L, /**< Dimensionless aligned spin of smaller BH */
593 REAL8 chip, /**< Effective precession parameter: Schmidt, Ohme, Hannam, PRD, 91,024043 (2015) */
594 REAL8 epsilon0 /**< Euler angle at reference Frequency, defines a constant offset */
595);
596
597
598/* Get alpha and epsilon offset depending of the mprime (second index of the non-precessing mode) */
600 REAL8 *alpha_offset, /**< [out] alpha offset for mprime */
601 REAL8 *epsilon_offset, /**< [out] epsilon offset for mprime */
602 UINT4 mprime, /**< Second index non-precessing mode */
603 IMRPhenomXPrecessionStruct *pPrec, /**< IMRPhenomX Precession Struct */
604 IMRPhenomXWaveformStruct *pWF /**< IMRPhenomX Waveform Struct */
605);
606
608 IMRPhenomXPrecessionStruct *pPrec, /**< IMRPhenomX Precession Struct */
609 const double omega, /**< Orbital frequency */
610 const double omega_cbrt2, /**< Orbital frequency */
611 const double omega_cbrt, /**< Cubic root of orbital frequency */
612 const double logomega /**< Natural logarithm of orbital frequency */
613);
614
616 IMRPhenomXPrecessionStruct *pPrec, /**< IMRPhenomX Precession Struct */
617 const double omega, /**< Orbital frequency */
618 const double omega_cbrt2, /**< Orbital frequency */
619 const double omega_cbrt, /**< Cubic root of orbital frequency */
620 const double logomega /**< Natural logarithm of orbital frequency */
621);
622
623
624/* ~~~~~~~~~~ MSA-SUA Euler Angle Functions ~~~~~~~~~~ */
627vector IMRPhenomX_Return_Constants_c_MSA(double v, const double JNorm, const IMRPhenomXPrecessionStruct *pPrec);
628vector IMRPhenomX_Return_Constants_d_MSA(const double LNorm, const double JNorm, const IMRPhenomXPrecessionStruct *pPrec);
629double IMRPhenomX_costhetaLJ(const double J_norm, const double L_norm, const double S_norm);
630double IMRPhenomX_Return_Psi_MSA(double v, double v2, const IMRPhenomXPrecessionStruct *pPrec);
631double IMRPhenomX_Return_Psi_dot_MSA(double v, const IMRPhenomXPrecessionStruct *pPrec);
632double IMRPhenomX_Return_SNorm_MSA(const double v, IMRPhenomXPrecessionStruct *pPrec);
633double IMRPhenomX_JNorm_MSA(const double LNorm, IMRPhenomXPrecessionStruct *pPrec);
634int IMRPhenomX_Get_MSA_Euler_Angles(REAL8 *alpha, REAL8 *beta, REAL8 *mprime_epsilon, REAL8 fHz, INT4 mprime, const REAL8 twopi_Msec, IMRPhenomXPrecessionStruct *pPrec);
635vector IMRPhenomX_Return_Roots_MSA(const double LNorm, const double JNorm, const IMRPhenomXPrecessionStruct *pPrec);
638vector IMRPhenomX_Return_MSA_Corrections_MSA(double v, const double LNorm, const double JNorm, const IMRPhenomXPrecessionStruct *pPrec);
639double IMRPhenomX_Return_zeta_MSA(const double v, const IMRPhenomXPrecessionStruct *pPrec);
640double IMRPhenomX_Return_phiz_MSA(const double v, const double JNorm, const IMRPhenomXPrecessionStruct *pPrec);
641double IMRPhenomX_psiofv(const double v, const double v2, const double psi0, const double psi1, const double psi2, const IMRPhenomXPrecessionStruct *pPrec);
643
644
645/* ~~~~~~~~~~ Spin Couplings for post-Newtonian Orbital Angular Momentum ~~~~~~~~~~ */
646double IMRPhenomX_Get_PN_beta(const double a, const double b, const IMRPhenomXPrecessionStruct *pPrec);
647double IMRPhenomX_Get_PN_sigma(const double a, const double b, const IMRPhenomXPrecessionStruct *pPrec);
648double IMRPhenomX_Get_PN_tau(const double a, const double b, const IMRPhenomXPrecessionStruct *pPrec);
649
650
651
652
653/* ~~~~~~~~~~ Vector Utility Functions ~~~~~~~~~~ */
654/* Function to calculate dot product: vout = v1 . v2 */
655double IMRPhenomX_vector_dot_product(const vector v1, const vector v2);
656/* Function to calculate cross product: vout = v1 x v2 */
658/* Function to calculate L2 norm: vout = |v1| */
659double IMRPhenomX_vector_L2_norm(const vector v1);
660/* Function to perform scalar multiplications: vout = a * v1 */
661vector IMRPhenomX_vector_scalar(const vector v1, const double a);
662/* Vector addition: vout = v1 + v2 */
663vector IMRPhenomX_vector_sum(const vector v1, const vector v2);
664/* Vector subtraction: vout = v1 - v2 */
665vector IMRPhenomX_vector_diff(const vector v1, const vector v2);
666
667/* Function to transform polar to Cartesian */
670
671/* Function to transform Cartesian to polar */
673/* Function to rotate vector about z axis by given angle */
674vector IMRPhenomX_vector_rotate_z(const REAL8 angle, const vector v1);
675/* Function to rotate vector about y axis by given angle */
676vector IMRPhenomX_vector_rotate_y(const REAL8 angle, const vector v1);
677/* Function to rotate vector about z axis by given angle */
678void IMRPhenomX_rotate_z(const REAL8 angle, REAL8 *vx, REAL8 *vy, REAL8 *vz);
679/* Function to rotate vector about y axis by given angle */
680void IMRPhenomX_rotate_y(const REAL8 angle, REAL8 *vx, REAL8 *vy, REAL8 *vz);
681
682/* Vector Utility Functions */
683REAL8 IMRPhenomX_Cartesian_to_SphericalPolar_theta(const double x, const double y, const double z);
684REAL8 IMRPhenomX_Cartesian_to_SphericalPolar_phi(const double x, const double y, const double z);
685void IMRPhenomX_CartesianToPolar(REAL8 *polar,REAL8 *azimuthal,REAL8 *magnitude,REAL8 x,REAL8 y,REAL8 z);
686vector IMRPhenomXCreateSphere(const double r, const double th, const double ph);
687
688/* Function to set remnant quantities related to final
689spin within IMRPhenomXGetAndSetPrecessionVariables */
693 LALDict *lalParams
694);
695/* twisting-up functions via precomputed angles*/
697int IMRPhenomXPSpinTaylorAnglesIMR(REAL8Sequence **alphaFS,REAL8Sequence **cosbetaFS,REAL8Sequence **gammaFS,REAL8Sequence *freqsIN,IMRPhenomXWaveformStruct *pWF,IMRPhenomXPrecessionStruct *pPrec,LALDict *LALparams);
699/* function to evaluate spline for Euler angle gamma --used in SpinTaylor precessing version */
701/* wrapper of IMRPhenomX_InterpolateAlphaBeta_SpinTaylor and SpinTaylorGammaSpline */
704 PhenomXPInspiralArrays *arrays, /**< [out] Struct containing solutions returned by PNEvolveOrbit */
705 double* fmin_PN, /**< [out] Minimum frequency in PN solutions array */
706 REAL8 chi1x, /**< x-component of the dimensionless spin of object 1 w.r.t. Lhat = (0,0,1) at fRef */
707 REAL8 chi1y, /**< y-component of the dimensionless spin of object 1 w.r.t. Lhat = (0,0,1) at fRef */
708 REAL8 chi1z, /**< z-component of the dimensionless spin of object 1 w.r.t. Lhat = (0,0,1) at fRef */
709 REAL8 chi2x, /**< x-component of the dimensionless spin of object 2 w.r.t. Lhat = (0,0,1) at fRef */
710 REAL8 chi2y, /**< y-component of the dimensionless spin of object 2 w.r.t. Lhat = (0,0,1) at fRef */
711 REAL8 chi2z, /**< z-component of the dimensionless spin of object 2 w.r.t. Lhat = (0,0,1) at fRef */
712 REAL8 fmin, /**< minimum frequency */
713 int PrecVersion, /**< precessing version (int) */
714 IMRPhenomXWaveformStruct *pWF, /**< Waveform structure [in]*/
715 LALDict *LALparams /**< LAL Dictionary struct */
716 );
717
719void IMRPhenomX_GetandSetModes(LALValue *ModeArray,IMRPhenomXPrecessionStruct *pPrec);
720
721int betaMRD_coeff(gsl_spline spline_cosb, gsl_interp_accel accel_cosb, double fmaxPN, IMRPhenomXWaveformStruct *pWF, IMRPhenomXPrecessionStruct *pPrec);
722double betaMRD(double Mf, IMRPhenomXWaveformStruct *pWF,PhenomXPbetaMRD *beta_params);
723int alphaMRD_coeff(gsl_spline spline_alpha, gsl_interp_accel accel_alpha, double fmaxPN, IMRPhenomXWaveformStruct *pWF, PhenomXPalphaMRD *alpha_params);
724double alphaMRD(double Mf, PhenomXPalphaMRD *alpha_params);
725double dalphaMRD(double Mf, PhenomXPalphaMRD *alpha_params);
727int gamma_from_alpha_cosbeta(double *gamma, double Mf, double deltaMf,IMRPhenomXWaveformStruct *pWF,IMRPhenomXPrecessionStruct *pPrec);
729
730#ifdef __cplusplus
731}
732#endif
733
734#endif /* _LALSIM_IMR_PHENOMX_PRECESSION_H */
const double c1
const double g3
const double g2
const double c2
static double double delta
vector IMRPhenomX_Return_Spin_Evolution_Coefficients_MSA(double LNorm, double JNorm, const IMRPhenomXPrecessionStruct *pPrec)
Get coefficients for Eq 21 of Chatziioannou et al, PRD 95, 104004, (2017), arXiv:1703....
double IMRPhenomX_psiofv(const double v, const double v2, const double psi0, const double psi1, const double psi2, const IMRPhenomXPrecessionStruct *pPrec)
double IMRPhenomX_Return_Psi_MSA(double v, double v2, const IMRPhenomXPrecessionStruct *pPrec)
Get using Eq 51 of Chatziioannou et al, PRD 95, 104004, (2017), arXiv:1703.03967:
double IMRPhenomX_Get_PN_tau(const double a, const double b, const IMRPhenomXPrecessionStruct *pPrec)
Internal function to computes PN spin-spin couplings.
vector IMRPhenomX_vector_PolarToCartesian(const sphpolvector v1)
double dalphaMRD(double Mf, PhenomXPalphaMRD *alpha_params)
int betaMRD_coeff(gsl_spline spline_cosb, gsl_interp_accel accel_cosb, double fmaxPN, IMRPhenomXWaveformStruct *pWF, IMRPhenomXPrecessionStruct *pPrec)
Function to determine coefficients of analytical continuation of beta through MRD.
vector IMRPhenomX_vector_sum(const vector v1, const vector v2)
int IMRPhenomX_SpinTaylorAnglesSplinesAll(REAL8 fmin, REAL8 fmax, IMRPhenomXWaveformStruct *pWF, IMRPhenomXPrecessionStruct *pPrec, LALDict *LALparams)
This function builds and stores splines for and in the frequency range covered by PN,...
vector IMRPhenomX_vector_cross_product(const vector v1, const vector v2)
vector IMRPhenomX_Return_MSA_Corrections_MSA(double v, const double LNorm, const double JNorm, const IMRPhenomXPrecessionStruct *pPrec)
sphpolvector IMRPhenomX_vector_CartesianToPolar(const vector v1)
vector IMRPhenomX_Return_Constants_c_MSA(double v, const double JNorm, const IMRPhenomXPrecessionStruct *pPrec)
Get c constants from Appendix B (B6, B7, B8) of Chatziioannou et al, PRD 95, 104004,...
double IMRPhenomX_Get_PN_beta(const double a, const double b, const IMRPhenomXPrecessionStruct *pPrec)
Internal function to computes the PN spin-orbit couplings.
REAL8 IMRPhenomX_Cartesian_to_SphericalPolar_phi(const double x, const double y, const double z)
vector IMRPhenomX_Return_Roots_MSA(const double LNorm, const double JNorm, const IMRPhenomXPrecessionStruct *pPrec)
Here we solve for the roots of Eq 21 in Chatziioannou et al, PRD 95, 104004, (2017),...
int IMRPhenomXPSpinTaylorAnglesIMR(REAL8Sequence **alphaFS, REAL8Sequence **cosbetaFS, REAL8Sequence **gammaFS, REAL8Sequence *freqsIN, IMRPhenomXWaveformStruct *pWF, IMRPhenomXPrecessionStruct *pPrec, LALDict *LALparams)
This function evaluates the SpinTaylor Euler angles on a frequency grid passed by the user.
int IMRPhenomX_InterpolateGamma_SpinTaylor(REAL8 fmin, REAL8 fmax, IMRPhenomXWaveformStruct *pWF, IMRPhenomXPrecessionStruct *pPrec)
This function computes gamma from the minimal rotation condition and stores a spline for it.
REAL8 IMRPhenomX_Cartesian_to_SphericalPolar_theta(const double x, const double y, const double z)
double IMRPhenomX_Return_zeta_MSA(const double v, const IMRPhenomXPrecessionStruct *pPrec)
Get using Eq F5 in Appendix F of Chatziioannou et al, PRD 95, 104004, (2017):
vector IMRPhenomX_Return_Constants_d_MSA(const double LNorm, const double JNorm, const IMRPhenomXPrecessionStruct *pPrec)
Get d constants from Appendix B (B9, B10, B11) of Chatziioannou et al, PRD 95, 104004,...
int IMRPhenomXWignerdCoefficients_cosbeta(REAL8 *cos_beta_half, REAL8 *sin_beta_half, REAL8 cos_beta)
int IMRPhenomXPTwistUp22(const REAL8 Mf, const COMPLEX16 hAS, IMRPhenomXWaveformStruct *pWF, IMRPhenomXPrecessionStruct *pPrec, COMPLEX16 *hp, COMPLEX16 *hc)
Core twisting up routine, see Section III A of arXiv:2004.06503.
double IMRPhenomX_PN_Euler_epsilon_NNLO(IMRPhenomXPrecessionStruct *pPrec, const double omega, const double omega_cbrt2, const double omega_cbrt, const double logomega)
Internal function to calculate epsilon using pre-cached NNLO PN expressions.
double IMRPhenomX_vector_L2_norm(const vector v1)
REAL8 XLALSimIMRPhenomXPNEuleralphaNNLO(REAL8 f, REAL8 eta, REAL8 chi1L, REAL8 chi2L, REAL8 chip, REAL8 epsilon0)
External wrapper function to next-to-next-to-leading (NNLO) in spin-orbit expression for the PN Euler...
double IMRPhenomX_Return_SNorm_MSA(const double v, IMRPhenomXPrecessionStruct *pPrec)
Get norm of S, see PRD 95, 104004, (2017)
vector IMRPhenomX_vector_PolarToCartesian_components(const REAL8 mag, const REAL8 theta, const REAL8 phi)
int IMRPhenomX_InterpolateAlphaBeta_SpinTaylor(IMRPhenomXWaveformStruct *pWF, IMRPhenomXPrecessionStruct *pPrec, LALDict *LALparams)
This function computes cubic splines of the alpha and beta inspiral Euler angles, which are then stor...
double IMRPhenomX_PN_Euler_alpha_NNLO(IMRPhenomXPrecessionStruct *pPrec, const double omega, const double omega_cbrt2, const double omega_cbrt, const double logomega)
Internal function to calculate alpha using pre-cached NNLO PN expressions.
INT4 IMRPhenomX_SetPrecessingRemnantParams(IMRPhenomXWaveformStruct *pWF, IMRPhenomXPrecessionStruct *pPrec, LALDict *lalParams)
void IMRPhenomX_GetandSetModes(LALValue *ModeArray, IMRPhenomXPrecessionStruct *pPrec)
int IMRPhenomXPCheckMaxOpeningAngle(IMRPhenomXWaveformStruct *pWF, IMRPhenomXPrecessionStruct *pPrec, LALDict *lalParams)
Helper function to check if maximum opening angle > pi/2 or pi/4 and issues a warning.
int IMRPhenomXWignerdCoefficients(REAL8 *cos_beta_half, REAL8 *sin_beta_half, const REAL8 v, IMRPhenomXWaveformStruct *pWF, IMRPhenomXPrecessionStruct *pPrec)
REAL8 XLALSimIMRPhenomXL4PNAS(REAL8 v, REAL8 eta, REAL8 chi1L, REAL8 chi2L, REAL8 delta)
4PN orbital angular momentum as a function of x = v^2 = (Pi M f)^{2/3}
vector IMRPhenomX_vector_rotate_z(const REAL8 angle, const vector v1)
Function to rotate vector about z axis by given angle.
int gamma_from_alpha_cosbeta(double *gamma, double Mf, double deltaMf, IMRPhenomXWaveformStruct *pWF, IMRPhenomXPrecessionStruct *pPrec)
vector IMRPhenomXCreateSphere(const double r, const double th, const double ph)
vector IMRPhenomX_vector_scalar(const vector v1, const double a)
vector IMRPhenomX_vector_diff(const vector v1, const vector v2)
double betaMRD(double Mf, IMRPhenomXWaveformStruct *pWF, PhenomXPbetaMRD *beta_params)
void IMRPhenomX_rotate_y(const REAL8 angle, REAL8 *vx, REAL8 *vy, REAL8 *vz)
Function to rotate vector about y axis by given angle.
void IMRPhenomX_rotate_z(const REAL8 angle, REAL8 *vx, REAL8 *vy, REAL8 *vz)
Function to rotate vector about z axis by given angle.
double get_deltaF_from_wfstruct(IMRPhenomXWaveformStruct *pWF)
int IMRPhenomX_Initialize_MSA_System(IMRPhenomXWaveformStruct *pWF, IMRPhenomXPrecessionStruct *pPrec, const int ExpansionOrder)
This function initializes all the core variables required for the MSA system.
double alphaMRD(double Mf, PhenomXPalphaMRD *alpha_params)
REAL8 XLALSimIMRPhenomXL2PNNS(REAL8 v, REAL8 eta)
2PN non-spinning orbital angular momentum as a function of x = v^2 = (Pi M f)^{2/3}
int IMRPhenomXPTwistUp22_NumericalAngles(const COMPLEX16 hAS, REAL8 alpha, REAL8 cos_beta, REAL8 gamma, IMRPhenomXPrecessionStruct *pPrec, COMPLEX16 *hp, COMPLEX16 *hc)
Core twisting up routine for SpinTaylor angles.
double IMRPhenomX_Get_PN_sigma(const double a, const double b, const IMRPhenomXPrecessionStruct *pPrec)
Internal function to compute PN spin-spin couplings.
int alphaMRD_coeff(gsl_spline spline_alpha, gsl_interp_accel accel_alpha, double fmaxPN, IMRPhenomXWaveformStruct *pWF, PhenomXPalphaMRD *alpha_params)
Analytical continuation for alpha angle in MRD.
double IMRPhenomX_L_norm_3PN_of_v(const double v, const double v2, const double L_norm, IMRPhenomXPrecessionStruct *pPrec)
Returns the 3PN accurate orbital angular momentum as implemented in LALSimInspiralFDPrecAngles_intern...
int IMRPhenomX_InspiralAngles_SpinTaylor(PhenomXPInspiralArrays *arrays, double *fmin_PN, REAL8 chi1x, REAL8 chi1y, REAL8 chi1z, REAL8 chi2x, REAL8 chi2y, REAL8 chi2z, REAL8 fmin, int PrecVersion, IMRPhenomXWaveformStruct *pWF, LALDict *LALparams)
Wrapper of XLALSimInspiralSpinTaylorPNEvolveOrbit : if integration is successful, stores arrays conta...
REAL8 XLALSimIMRPhenomXL4PNLOSIAS(REAL8 v, REAL8 eta, REAL8 chi1L, REAL8 chi2L, REAL8 delta)
4PN orbital angular momentum as a function of x = v^2 = (Pi M f)^{2/3}
int IMRPhenomX_Initialize_Euler_Angles(IMRPhenomXWaveformStruct *pWF, IMRPhenomXPrecessionStruct *pPrec, LALDict *lalParams)
Wrapper of IMRPhenomX_SpinTaylorAnglesSplinesAll: fmin and fmax are determined by the function based ...
double IMRPhenomX_Spin_Evolution_Equation_MSA(IMRPhenomXWaveformStruct *pWF, IMRPhenomXPrecessionStruct *pPrec)
REAL8 XLALSimIMRPhenomXL3PNAS(REAL8 v, REAL8 eta, REAL8 chi1L, REAL8 chi2L, REAL8 delta)
3PN orbital angular momentum as a function of x = v^2 = (Pi M f)^{2/3}
vector IMRPhenomX_vector_rotate_y(const REAL8 angle, const vector v1)
Function to rotate vector about y axis by given angle.
REAL8 XLALSimIMRPhenomXPNEulerepsilonNNLO(REAL8 f, REAL8 eta, REAL8 chi1L, REAL8 chi2L, REAL8 chip, REAL8 epsilon0)
External wrapper to NNLO PN epsilon angle.
void IMRPhenomX_CartesianToPolar(REAL8 *polar, REAL8 *azimuthal, REAL8 *magnitude, REAL8 x, REAL8 y, REAL8 z)
double IMRPhenomX_JNorm_MSA(const double LNorm, IMRPhenomXPrecessionStruct *pPrec)
Get norm of J using Eq 41 of Chatziioannou et al, PRD 95, 104004, (2017)
double IMRPhenomX_Return_phiz_MSA(const double v, const double JNorm, const IMRPhenomXPrecessionStruct *pPrec)
Get using Eq 66 of Chatziioannou et al, PRD 95, 104004, (2017), arXiv:1703.03967:
vector IMRPhenomX_Return_phi_zeta_costhetaL_MSA(const double xi, IMRPhenomXWaveformStruct *pWF, IMRPhenomXPrecessionStruct *pPrec)
Wrapper to generate , and at a given frequency.
double IMRPhenomX_Return_Psi_dot_MSA(double v, const IMRPhenomXPrecessionStruct *pPrec)
Get using Eq 24 of Chatziioannou et al, PRD 95, 104004, (2017), arXiv:1703.03967:
double IMRPhenomX_vector_dot_product(const vector v1, const vector v2)
REAL8 alpha_SpinTaylor_IMR(REAL8 Mf, IMRPhenomXWaveformStruct *pWF, IMRPhenomXPrecessionStruct *pPrec)
int IMRPhenomXGetAndSetPrecessionVariables(IMRPhenomXWaveformStruct *pWF, IMRPhenomXPrecessionStruct *pPrec, REAL8 m1_SI, REAL8 m2_SI, REAL8 S1x, REAL8 S1y, REAL8 S1z, REAL8 S2x, REAL8 S2y, REAL8 S2z, LALDict *lalParams, INT4 debug_flag)
Function to populate the IMRPhenomXPrecessionStruct:
void Get_alphaepsilon_atfref(REAL8 *alpha_offset, REAL8 *epsilon_offset, UINT4 mprime, IMRPhenomXPrecessionStruct *pPrec, IMRPhenomXWaveformStruct *pWF)
Get alpha and epsilon offset depending of the mprime (second index of the non-precessing mode)
int IMRPhenomX_Get_MSA_Euler_Angles(REAL8 *alpha, REAL8 *beta, REAL8 *mprime_epsilon, REAL8 fHz, INT4 mprime, const REAL8 twopi_Msec, IMRPhenomXPrecessionStruct *pPrec)
REAL8 XLALSimIMRPhenomXLPNAnsatz(REAL8 v, REAL8 LN, REAL8 L0, REAL8 L1, REAL8 L2, REAL8 L3, REAL8 L4, REAL8 L5, REAL8 L6, REAL8 L7, REAL8 L8, REAL8 L8L)
This is a convenient wrapper function for PN orbital angular momentum.
double IMRPhenomX_costhetaLJ(const double J_norm, const double L_norm, const double S_norm)
Calculate (L dot J)
static double beta(const double a, const double b, const sysq *system)
Internal function that computes the spin-orbit couplings.
REAL8 g4
REAL8 g5
double theta
Definition: bh_sphwf.c:118
const double a4
const double vy
const double qq
const double a2
const double vz
const double vx
double complex COMPLEX16
double REAL8
uint32_t UINT4
int32_t INT4
static const INT4 r
static const INT4 a
double alpha
Definition: sgwb.c:106
REAL8 phiz
Azimuthal angle of L around J.
REAL8 epsilon_offset_3
offset passed to modes.
REAL8 Ny_Sf
Line-of-sight vector component in L frame.
REAL8 chi2y_evolved
y-component of spin on secondary at end of SpinTaylor evolution
PhenomXPbetaMRD * beta_params
Parameters needed for analytical MRD continuation of cosbeta.
REAL8 chi2_theta
Spherical polar component in L frame.
REAL8 S2_theta
Spherical polar component in L frame.
REAL8 Mfmin_integration
Minimum frequency covered by the integration of PN spin-precessing equations for SpinTaylor models
REAL8 PNR_q_window_lower
Boundary values for PNR angle transition window.
REAL8 epsilonNNLO
Post Newtonian at NNLO.
INT4 ExpansionOrder
Flag to control expansion order of MSA system of equations.
REAL8 QArunz_Jf
Component of triad basis vector Q in J frame, arXiv:0810.5336.
REAL8 zeta
Angle to describe L w.r.t.
REAL8 S2L_pav
Precession averaged coupling , Eq.
REAL8 QAruny_Jf
Component of triad basis vector Q in J frame, arXiv:0810.5336.
REAL8 chi2x_evolved
x-component of spin on secondary at end of SpinTaylor evolution
REAL8 alpha_offset_4
offset passed to modes.
REAL8 chi1x_evolved
x-component of spin on primary at end of SpinTaylor evolution
REAL8 zeta_polarization
Angle to rotate the polarizations.
REAL8 v_0
Orbital velocity at reference frequency, .
REAL8 S1_theta
Spherical polar component in L frame.
REAL8 A2
Mass weighted pre-factor, see Eq.
REAL8 phiJ_Sf
Azimuthal angle of in the L frame.
REAL8 thetaJ_Sf
Angle between and (z-direction)
REAL8 PNR_HM_Mflow
Mf_alpha_lower stored from alphaParams struct, 2 A4 / 7 from arXiv:2107.08876.
REAL8 cosbeta_ftrans
Record value of cosbeta at end of inspiral, used in IMRPhenomXPHMTwistUp and IMRPhenomXPHMTwistUpOneM...
REAL8 alpha_ftrans
Record value of alpha at end of inspiral, used in IMRPhenomXPHMTwistUp and IMRPhenomXPHMTwistUpOneMod...
REAL8 J_Norm_3PN
Norm of total angular momentum at 3PN .
INT4 MBandPrecVersion
Flag to control multibanding for Euler angles.
REAL8 thetaJN
Angle between J0 and line of sight (z-direction)
REAL8 alpha_offset_3
offset passed to modes.
REAL8 epsilon_offset_4
offset passed to modes.
REAL8 chi1y_evolved
y-component of spin on primary at end of SpinTaylor evolution
REAL8 chi1_cos_theta
Spherical polar component in L frame.
REAL8 alpha_offset_1
offset passed to modes.
REAL8 zeta_0_MSA
First MSA correction , Eq.
REAL8 Spl2
Largest root of polynomial , Eq.
REAL8 Ny_Jf
Line-of-sight vector component in J frame.
REAL8 chi2_cos_theta
Spherical polar component in L frame.
REAL8 costheta_singleSpin
Polar angle of effective single spin, Eq.
REAL8 PArunz_Jf
Component of triad basis vector P in J frame, arXiv:0810.5336.
REAL8 S2Lsq_pav
Precession averaged coupling , Eq.
REAL8 alphaNNLO
Post Newtonian at NNLO.
REAL8 Xx_Sf
Component of triad basis vector X in L frame.
REAL8 S1_phi
Spherical polar component in L frame.
REAL8 gamma_ref
Record value of gamma at f_ref.
REAL8 S2_phi
Spherical polar component in L frame.
REAL8 fmin_integration
Minimum frequency covered by the integration of PN spin-precessing equations for SpinTaylor models
REAL8 S32
Third root of polynomial , Eq.
IMRPhenomXWaveformStruct * pWF22AS
REAL8 gamma_ftrans
Record value of gamma at end of inspiral, used in IMRPhenomXPHMTwistUp and IMRPhenomXPHMTwistUpOneMod...
REAL8 PArunx_Jf
Component of triad basis vector P in J frame, arXiv:0810.5336.
REAL8 Nx_Jf
Line-of-sight vector component in J frame.
REAL8 chi1_phi
Spherical polar component in L frame.
REAL8 QArunx_Jf
Component of triad basis vector Q in J frame, arXiv:0810.5336.
INT4 IMRPhenomXPrecVersion
Flag to set version of Euler angles used.
REAL8 gamma_in
Record last value of gamma, used in IMRPhenomXPHMTwistUp and IMRPhenomXPHMTwistUpOneMode.
UINT4 PNRInspiralScaling
Enforce inpsiral scaling for HM angles outside of calibration window.
REAL8 Smi2
Smallest root of polynomial , Eq.
REAL8 chi1_theta
Spherical polar component in L frame.
REAL8 Nz_Jf
Line-of-sight vector component in LJ frame.
INT4 MSA_ERROR
Flag to track errors in initialization of MSA system.
REAL8 chi_singleSpin_antisymmetric
magnitude of effective single spin of a two spin system for the antisymmetric waveform
REAL8 cos_theta_L
Cosine of polar angle between L and J.
REAL8 PAruny_Jf
Component of triad basis vector P in J frame, arXiv:0810.5336.
REAL8 S2_cos_theta
Spherical polar component in L frame.
REAL8 phiz_0_MSA
First MSA correction , Eq.
REAL8 Nz_Sf
Line-of-sight vector component in L frame.
REAL8 chi2z_evolved
z-component of spin on secondary at end of SpinTaylor evolution
REAL8 chi1z_evolved
z-component of spin on primary at end of SpinTaylor evolution
PhenomXPalphaMRD * alpha_params
Parameters needed for analytical MRD continuation of alpha.
REAL8 L_Norm_3PN
Norm of orbital angular momentum at 3PN .
REAL8 v2
Orbital velocity squared, .
REAL8 S1S2_pav
Precession averaged coupling , Eq.
REAL8 S1Lsq_pav
Precession averaged coupling , Eq.
REAL8 Xy_Sf
Component of triad basis vector X in L frame.
REAL8 chi_singleSpin
Magnitude of effective single spin used for tapering two-spin angles, Eq.
REAL8 S1_cos_theta
Spherical polar component in L frame.
REAL8 theta_antisymmetric
Polar angle effective single spin for antisymmetric waveform.
REAL8 epsilon_offset_1
offset passed to modes.
REAL8 L_Norm_N
Norm of Newtonian orbital angular momentum .
REAL8 J_Norm_N
Norm of total angular momentum using Newtonian orbital angular momentum .
REAL8 A1
Mass weighted pre-factor, see Eq.
REAL8 phi0_aligned
Initial phase to feed the underlying aligned-spin model.
REAL8 v_0_2
Orbital velocity at reference frequency squared, .
REAL8 integration_buffer
Buffer region for integration of SpinTaylor equations: added so that interpolated angles cover the fr...
REAL8 alpha_ref
Record value of alpha at f_ref.
REAL8 Xz_Sf
Component of triad basis vector X in L frame.
REAL8 Nx_Sf
Line-of-sight vector component in L frame.
REAL8 PNR_HM_Mfhigh
Mf_beta_lower stored from betaParams struct, Eq.
REAL8 S1LS2L_pav
Precession averaged coupling , Eq.
REAL8 S1L_pav
Precession averaged coupling , Eq.
REAL8 chi2_phi
Spherical polar component in L frame.
REAL8 costheta_final_singleSpin
Polar angle of approximate final spin, see technical document FIXME: add reference.