LALSimulation  5.4.0.1-fe68b98
LALSimIMRSEOBNRv4ROM_NRTidal.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 Michael Puerrer
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with with program; see the file COPYING. If not, write to the
16  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17  * MA 02110-1301 USA
18  */
19 
20 #ifdef __GNUC__
21 #define UNUSED __attribute__ ((unused))
22 #else
23 #define UNUSED
24 #endif
25 
26 
27 #include <stdio.h>
28 #include <stdlib.h>
29 #include <math.h>
30 #include <complex.h>
31 #include <gsl/gsl_spline.h>
32 
33 #include <lal/Units.h>
34 #include <lal/SeqFactories.h>
35 #include <lal/LALConstants.h>
36 #include <lal/XLALError.h>
37 #include <lal/FrequencySeries.h>
38 #include <lal/Sequence.h>
39 #include <lal/LALSimIMR.h>
40 
42 
43 /**
44  * Function to internally add 2PN and 3PN spin-spin terms
45  * to be able to include spin-induced quadrupole moments
46  * in those terms; the BBH terms are excluded
47  * From LALSimInspiralPNCoefficients.c:XLALSimInspiralPNPhasing_F2()
48  * Compute 2.0PN SS, QM, and self-spin
49  * See Eq. (6.24) in arXiv:0810.5336
50  * 9b,c,d in arXiv:astro-ph/0504538
51  */
53  const REAL8 m1_SI, /**< Mass of neutron star 1 (kg) */
54  const REAL8 m2_SI, /**< Mass of neutron star 2 (kg) */
55  const REAL8 chi1L, /**< Dimensionless aligned component spin of NS 1 */
56  const REAL8 chi2L, /**< Dimensionless aligned component spin of NS 2 */
57  const REAL8 qm_def1, /**< Quadrupole deformation parameter of body 1 (dimensionless) */
58  const REAL8 qm_def2, /**< Quadrupole deformation parameter of body 2 (dimensionless) */
59  /**< qm_def1,2 = 0 for BH as it is defined here*/
60  REAL8 *pfa_v4_contrib, /**< self-spin contribution to v^4 */
61  REAL8 *pfa_v6_contrib /**< self-spin contribution to v^6 */
62  ) {
63  const REAL8 mtot = m1_SI + m2_SI;
64  const REAL8 eta = m1_SI*m2_SI/mtot/mtot;
65  const REAL8 m1M = m1_SI/mtot;
66  const REAL8 m2M = m2_SI/mtot;
67 
68  const REAL8 m1Msq = m1M * m1M;
69  const REAL8 m2Msq = m2M * m2M;
70 
71  const REAL8 chi1sq = chi1L*chi1L;
72  const REAL8 chi2sq = chi2L*chi2L;
73 
74  /* remove unnecessary calls and computations to speed up the final computation */
75  REAL8 pn_sigma = - 50.L*(qm_def1 * chi1sq * m1Msq + qm_def2 * chi2sq * m2Msq);
76  REAL8 pn_ss3 = 5.L/84.L*(9407.L+ 8218.L * m1M - 2016.L * m1Msq) * qm_def1 * m1Msq * chi1sq;
77  pn_ss3 += 5.L/84.L*(9407.L+ 8218.L * m2M - 2016.L * m2Msq) * qm_def2 * m2Msq * chi2sq;
78 
79  const REAL8 pfaN = 3.L/(128.L * eta);
80  // The leading order term pfa->v[0] is positive and so the
81  // self-spin corrections should be added to a postive phasing.
82 
83 
84  // *pfa_v4_contrib = -10.L * pn_sigma * pfaN;
85  // *pfa_v6_contrib = + pn_ss3 * pfaN;
86  // no additional factor 10 needed in the new implementation
87  *pfa_v4_contrib = pn_sigma * pfaN;
88  *pfa_v6_contrib = pn_ss3 * pfaN;
89 }
90 
92  struct tagCOMPLEX16FrequencySeries **hptilde, /**< Output: Frequency-domain waveform h+ */
93  struct tagCOMPLEX16FrequencySeries **hctilde, /**< Output: Frequency-domain waveform hx */
94  REAL8 phiRef, /**< Phase at reference time */
95  REAL8 fRef, /**< Reference frequency (Hz); 0 defaults to fLow */
96  REAL8 distance, /**< Distance of source (m) */
97  REAL8 inclination, /**< Inclination of source (rad) */
98  REAL8 m1_SI, /**< Mass of neutron star 1 (kg) */
99  REAL8 m2_SI, /**< Mass of neutron star 2 (kg) */
100  REAL8 chi1, /**< Dimensionless aligned component spin of NS 1 */
101  REAL8 chi2, /**< Dimensionless aligned component spin of NS 2 */
102  REAL8 lambda1, /**< Dimensionless tidal deformability of NS 1 */
103  REAL8 lambda2, /**< Dimensionless tidal deformability of NS 2 */
104  const REAL8Sequence *freqs_in, /**< Frequency points at which to evaluate the waveform (Hz) */
105  REAL8 deltaF, /**< Sampling frequency (Hz) */
106  LALDict *LALparams, /**< LAL dictionary containing accessory parameters */
107  NRTidal_version_type NRTidal_version /**< Version of NRTides; can be any one of NRTidal_V (arXiv:1706.02969), NRTidalv2_V (arXiv:1905.06011) or NRTidalv2NoAmpCorr_V (arXiv:1905.06011, without amplitude corrections) */ )
108 {
109  /* Check output arrays */
110  if(!hptilde || !hctilde)
112  if(*hptilde || *hctilde) {
113  XLALPrintError("(*hptilde) and (*hctilde) are supposed to be NULL, but got %p and %p",(*hptilde),(*hctilde));
115  }
116 
117  if (!freqs_in) XLAL_ERROR(XLAL_EFAULT);
118  double fLow = freqs_in->data[0];
119  double fHigh = freqs_in->data[freqs_in->length - 1];
120  if(fRef == 0.0)
121  fRef = fLow;
122 
125 
126  /* Internally we need m1 > m2, so change around if this is not the case */
127  if (m1_SI < m2_SI) {
128  // Swap m1 and m2
129  double m1temp = m1_SI;
130  double chi1temp = chi1;
131  double lambda1temp = lambda1;
132  double quadmon1temp = quad_mon1;
133  m1_SI = m2_SI;
134  chi1 = chi2;
135  m2_SI = m1temp;
136  chi2 = chi1temp;
137  if (lambda1!=lambda2){
138  lambda1 = lambda2;
140  lambda2 = lambda1temp;
142  }
143  if (quad_mon1 != quad_mon2) {
144  quad_mon1 = quad_mon2;
145  quad_mon2 = quadmon1temp;
146  }
147  }
148  // Call SEOBNRv4 ROM. We call either the FrequencySequence version
149  // or the regular LAL version depending on how we've been called.
150 
151  // These functions enforce m1 >= m2:
152  // XLALSimIMRSEOBNRv4ROM / XLALSimIMRSEOBNRv4ROMFrequencySequence
153  // XLALSimNRTunedTidesFDTidalPhaseFrequencySeries
154 
155  int ret = XLAL_SUCCESS;
156  if (deltaF > 0) {
157  // if using a uniform frequency series then we only need to generate
158  // SEOBNRv4_ROM upto a bit beyond the BNS merger frequency.
159  // if asked for a frequency beyond NRTIDAL_FMAX then the
160  // returned waveform contains frequencies up to the input fHigh but
161  // only contains zeros beyond NRTIDAL_FMAX
162  double f_max_nr_tidal = fHigh;
163  /**< tidal coupling constant.*/
164  const double kappa2T = XLALSimNRTunedTidesComputeKappa2T(m1_SI, m2_SI, lambda1, lambda2);
165  /* Prepare tapering of amplitude beyond merger frequency */
166  const double fHz_mrg = XLALSimNRTunedTidesMergerFrequency( (m1_SI+m2_SI)/LAL_MSUN_SI , kappa2T, m1_SI/m2_SI);
167  const double NRTIDAL_FMAX = 1.3*fHz_mrg;
168  if ( (NRTidal_version != NRTidalv2NSBH_V) && (( fHigh > NRTIDAL_FMAX ) || ( fHigh == 0.0 )) )
169  {
170  // only generate upto NRTIDAL_FMAX
171  f_max_nr_tidal = NRTIDAL_FMAX;
172  }
173 
174  ret = XLALSimIMRSEOBNRv4ROM(
175  hptilde, hctilde,
176  phiRef, deltaF, fLow, f_max_nr_tidal, fRef, distance, inclination,
177  m1_SI, m2_SI,
178  chi1, chi2,
179  -1, LALparams, NRTidal_version);
180 
181  // if uniform sampling and fHigh > NRTIDAL_FMAX then resize htilde
182  // so that it goes up to the user fHigh but is filled with zeros
183  // beyond NRTIDAL_FMAX (this does not apply to NSBH)
184  if (fHigh > NRTIDAL_FMAX && NRTidal_version != NRTidalv2NSBH_V)
185  {
186  // resize
187  // n_full is the next power of 2 +1.
188  size_t n_full = (size_t) pow(2,ceil(log2(fHigh / deltaF))) + 1;
189  *hptilde = XLALResizeCOMPLEX16FrequencySeries(*hptilde, 0, n_full);
190  XLAL_CHECK ( *hptilde, XLAL_ENOMEM, "Failed to resize hptilde COMPLEX16FrequencySeries");
191  *hctilde = XLALResizeCOMPLEX16FrequencySeries(*hctilde, 0, n_full);
192  XLAL_CHECK ( *hctilde, XLAL_ENOMEM, "Failed to resize hctilde COMPLEX16FrequencySeries");
193  }
194 
195  } else {
197  hptilde, hctilde,
198  freqs_in,
199  phiRef, fRef, distance, inclination,
200  m1_SI, m2_SI,
201  chi1, chi2,
202  -1, LALparams, NRTidal_version);
203  }
204  XLAL_CHECK(XLAL_SUCCESS == ret, ret, "XLALSimIMRSEOBNRv4ROM() failed.");
205 
206  UINT4 offset;
207  REAL8Sequence *freqs = NULL;
208  REAL8Sequence *phi_tidal = NULL;
209  REAL8Sequence *amp_tidal = NULL;
210  REAL8Sequence *planck_taper = NULL;
211  if (deltaF > 0) { // uniform frequencies
212  // Recreate freqs using only the lower and upper bounds
213  UINT4 iStart = (UINT4) ceil(fLow / deltaF);
214  UINT4 iStop = (*hptilde)->data->length - 1; // use the length calculated in the ROM function
215  freqs = XLALCreateREAL8Sequence(iStop - iStart);
216  if (!freqs) XLAL_ERROR(XLAL_EFUNC, "Frequency array allocation failed.");
217  for (UINT4 i=iStart; i<iStop; i++)
218  freqs->data[i-iStart] = i*deltaF;
219 
220  offset = iStart;
221  }
222  else { // unequally spaced frequency sequence
223  freqs = XLALCreateREAL8Sequence(freqs_in->length);
224  if (!freqs) XLAL_ERROR(XLAL_EFUNC, "Frequency array allocation failed.");
225  for (UINT4 i=0; i<freqs_in->length; i++)
226  freqs->data[i] = freqs_in->data[i]; // just copy input
227  offset = 0;
228  }
229  COMPLEX16 *pdata=(*hptilde)->data->data;
230  COMPLEX16 *cdata=(*hctilde)->data->data;
231 
232  const REAL8 m1 = m1_SI / LAL_MSUN_SI;
233  const REAL8 m2 = m2_SI / LAL_MSUN_SI;
234  const REAL8 mtot = m1 + m2;
235  const REAL8 m_sec = mtot * LAL_MTSUN_SI; /* total mass in seconds */
236  const REAL8 piM = LAL_PI * m_sec;
237  /* Initialising parameters for adding higher order spin corrections */
238  REAL8 X_A = m1/mtot;
239  REAL8 X_B = m2/mtot;
240  REAL8 eta = m1 * m2 / (mtot* mtot); /* Symmetric mass-ratio */
241  REAL8 pn_fac = 3./(128.*eta);
242  REAL8 SS_3p5PN = 0., SSS_3p5PN = 0.;
243  /* End of initialising */
244 
245  // Get FD tidal phase correction and amplitude factor from arXiv:1706.02969
246  phi_tidal = XLALCreateREAL8Sequence(freqs->length);
247  planck_taper = XLALCreateREAL8Sequence(freqs->length);
248  if (NRTidal_version == NRTidalv2_V) {
249  ret = XLALSimNRTunedTidesFDTidalPhaseFrequencySeries(phi_tidal, amp_tidal, planck_taper, freqs, m1_SI, m2_SI, lambda1, lambda2, NRTidalv2NoAmpCorr_V);
250  XLAL_CHECK(XLAL_SUCCESS == ret, ret, "XLALSimNRTunedTidesFDTidalPhaseFrequencySeries Failed.");
251  XLALSimInspiralGetHOSpinTerms(&SS_3p5PN, &SSS_3p5PN, X_A, X_B, chi1, chi2, quad_mon1+1., quad_mon2+1.);
252  }
253  else {
254  ret = XLALSimNRTunedTidesFDTidalPhaseFrequencySeries(phi_tidal, amp_tidal, planck_taper, freqs, m1_SI, m2_SI, lambda1, lambda2, NRTidal_version);
255  XLAL_CHECK(XLAL_SUCCESS == ret, ret, "XLALSimNRTunedTidesFDTidalPhaseFrequencySeries Failed.");
256  }
257 
258  // For NSBH, apply NSBH amplitude correction
259  if (NRTidal_version == NRTidalv2NSBH_V){
260  amp_tidal = XLALCreateREAL8Sequence(freqs->length);
262  amp_tidal, freqs,
263  m1_SI, m2_SI, chi1, lambda2
264  );
265  XLAL_CHECK(XLAL_SUCCESS == ret, ret, "XLALSEOBNRv4ROMNSBHAmplitudeCorrectionFrequencySeries Failed.");
266 
267  }
268 
269  // // Prepare tapering of amplitude beyond merger frequency
270  // double kappa2T = XLALSimNRTunedTidesComputeKappa2T(m1_SI, m2_SI, lambda1, lambda2);
271  // double fHz_mrg = XLALSimNRTunedTidesMergerFrequency(Mtot_MSUN, kappa2T, q);
272  // Tidal self-spin contributions to the phase
273 
274  REAL8 pfa_v4_contrib, pfa_v6_contrib;
275  Self_spin_phase_contributions(m1_SI, m2_SI, chi1, chi2, quad_mon1, quad_mon2,
276  &pfa_v4_contrib, &pfa_v6_contrib);
277 
278  gsl_interp_accel *acc_phi = gsl_interp_accel_alloc();
279  gsl_spline *spline_phi = gsl_spline_alloc(gsl_interp_cspline, freqs->length);
280  gsl_vector *f_vec = gsl_vector_alloc(freqs->length);
281  gsl_vector *phi_vec = gsl_vector_alloc(freqs->length);
282 
283  // Assemble waveform from amplitude and phase
284  for (size_t i=0; i<freqs->length; i++) { // loop over frequency points in sequence
285  int j = i + offset; // shift index for frequency series if needed
286  // Apply tidal phase correction and amplitude taper
287  // double taper = 1.0 - PlanckTaper(freqs->data[i], fHz_mrg, 1.2*fHz_mrg);
288  const REAL8 v = cbrt(piM * freqs->data[i]);
289  // phasing = (ss_term_v4 * v^4 + ss_term_v6 * v^6) / v^5
290  const REAL8 phi_ss = pfa_v4_contrib / v + pfa_v6_contrib * v;
291  const REAL8 phase_corr = phi_tidal->data[i] + phi_ss;
292  gsl_vector_set(f_vec, i, freqs->data[i]);
293  gsl_vector_set(phi_vec, i, phase_corr);
294 
295  COMPLEX16 Corr = planck_taper->data[i] * cexp(-I*phase_corr -I*v*v*(SS_3p5PN + SSS_3p5PN)*pn_fac);
296  if (NRTidal_version==NRTidalv2NSBH_V){
297  Corr *= amp_tidal->data[i];
298  }
299  pdata[j] *= Corr;
300  cdata[j] *= Corr;
301 
302  }
303 
304  /* Correct phasing so we coalesce at t=0 (with the definition of the epoch=-1/deltaF above) */
305  // Appendix A of 1512.02248
306 
307  // Get SEOBNRv4 ringdown frequency for 22 mode
308  // Note: IMRPhenomPv2_NRTidal also uses the BBH ringdown frequency and then just sets it
309  // to the last frequency in the grid
310 
311  double fHz_final = XLALSimInspiralGetFinalFreq(m1_SI, m2_SI, 0, 0, chi1, 0, 0, chi2, SEOBNRv4);
312 
313  gsl_spline_init(spline_phi, gsl_vector_const_ptr(f_vec, 0), gsl_vector_const_ptr(phi_vec, 0), freqs->length);
314 
315  // Time correction is t(f_final) = 1/(2pi) dphi/df (f_final)
316  // From Eqn. (A1) of arXiv:1512.02248
317  // Here we only apply this to phase corrections beyond SEOBNRv4_ROM.
318  // For SEOBNRv4_ROM the phase has already been corrected.
319 
320  if (fHz_final > freqs->data[freqs->length-1])
321  fHz_final = freqs->data[freqs->length-1];
322  REAL8 t_corr_s = gsl_spline_eval_deriv(spline_phi, fHz_final, acc_phi) / (2*LAL_PI);
323 
324  // Now correct phase
325  for (UINT4 i=0; i<freqs->length; i++) { // loop over frequency points in sequence
326  double fHz = freqs->data[i] - fRef;
327  int j = i + offset; // shift index for frequency series if needed
328  double phase_factor = -2*LAL_PI * fHz * t_corr_s;
329  COMPLEX16 t_factor = (cos(phase_factor) + I*sin(phase_factor));
330  pdata[j] *= t_factor;
331  cdata[j] *= t_factor;
332  }
333  gsl_vector_free(f_vec);
334  gsl_vector_free(phi_vec);
335  gsl_spline_free(spline_phi);
336  gsl_interp_accel_free(acc_phi);
338  XLALDestroyREAL8Sequence(phi_tidal);
339  XLALDestroyREAL8Sequence(amp_tidal);
340  XLALDestroyREAL8Sequence(planck_taper);
341 
342 
343  return XLAL_SUCCESS;
344 }
345 
346 // FIXME: limits below
347 /**
348  * @addtogroup LALSimIMRTIDAL_c
349  *
350  * @{
351  *
352  * @name SEOBNRv4_ROM_NRTidal
353  *
354  * @author Michael Puerrer
355  *
356  * @brief C code for SEOBNRv4ROM arXiv:1611.03703 with added tidal phase correction from arXiv:1706.02969.
357  *
358  * This is a frequency domain model that adds tidal modifications of the phasing
359  * to the SEOBNRv4ROM model.
360  *
361  * @note Parameter ranges:
362  * * ? <= eta <= 0.25
363  * * 0 <= Lambda_i <= ?
364  * * -1 <= chi_i <= 1
365  * * Mtot >= 2 Msun @ 20 Hz (inherited from the ROM)
366  *
367  * Aligned component spin on neutron stars.
368  * Symmetric mass-ratio eta = m1*m2/(m1+m2)^2.
369  * Total mass Mtot.
370  *
371  * @{
372  */
373 
374 /**
375  * Compute waveform in LAL format at specified frequencies for the SEOBNRv4_ROM_NRTidal
376  * tidal model based on SEOBNRv4_ROM.
377  *
378  * XLALSimIMRSEOBNRv4ROMNRTidal() returns the plus and cross polarizations as a complex
379  * frequency series with equal spacing deltaF and contains zeros from zero frequency
380  * to the starting frequency and zeros beyond the cutoff frequency in the ringdown.
381  *
382  * In contrast, XLALSimIMRSEOBNRv4ROMNRTidalFrequencySequence() returns a
383  * complex frequency series with entries exactly at the frequencies specified in
384  * the sequence freqs (which can be unequally spaced). No zeros are added.
385  *
386  * If XLALSimIMRSEOBNRv4ROMNRTidalFrequencySequence() is called with frequencies that
387  * are beyond the maxium allowed geometric frequency for the ROM, zero strain is returned.
388  * It is not assumed that the frequency sequence is ordered.
389  *
390  * This function is designed as an entry point for reduced order quadratures.
391  */
393  struct tagCOMPLEX16FrequencySeries **hptilde, /**< Output: Frequency-domain waveform h+ */
394  struct tagCOMPLEX16FrequencySeries **hctilde, /**< Output: Frequency-domain waveform hx */
395  const REAL8Sequence *freqs, /**< Frequency points at which to evaluate the waveform (Hz) */
396  REAL8 phiRef, /**< Phase at reference time */
397  REAL8 fRef, /**< Reference frequency (Hz); 0 defaults to fLow */
398  REAL8 distance, /**< Distance of source (m) */
399  REAL8 inclination, /**< Inclination of source (rad) */
400  REAL8 m1_SI, /**< Mass of neutron star 1 (kg) */
401  REAL8 m2_SI, /**< Mass of neutron star 2 (kg) */
402  REAL8 chi1, /**< Dimensionless aligned component spin of NS 1 */
403  REAL8 chi2, /**< Dimensionless aligned component spin of NS 2 */
404  REAL8 lambda1, /**< Dimensionless tidal deformability of NS 1 */
405  REAL8 lambda2, /**< Dimensionless tidal deformability of NS 2 */
406  LALDict *LALparams, /**< linked list containing the extra testing GR parameters */
407  NRTidal_version_type NRTidal_version /**< Version of NRTides; can be any one of NRTidal_V (arXiv:1706.02969), NRTidalv2_V (arXiv:1905.06011) or NRTidalv2NoAmpCorr_V (arXiv:1905.06011, without amplitude corrections) */ )
408 {
409  if (!freqs) XLAL_ERROR(XLAL_EFAULT);
410 
411  // Call the internal core function with deltaF = 0 to indicate that freqs is non-uniformly
412  // spaced and we want the strain only at these frequencies
413  int retcode = SEOBNRv4ROM_NRTidal_Core(hptilde, hctilde,
414  phiRef, fRef, distance, inclination, m1_SI, m2_SI, chi1, chi2, lambda1, lambda2, freqs, 0, LALparams, NRTidal_version);
415 
416  return(retcode);
417 }
418 
419 /**
420  * Compute waveform in LAL format for the SEOBNRv4_ROM_NRTidal
421  * tidal model based on SEOBNRv4_ROM.
422  *
423  * Returns the plus and cross polarizations as a complex frequency series with
424  * equal spacing deltaF and contains zeros from zero frequency to the starting
425  * frequency fLow and zeros beyond the cutoff frequency in the ringdown.
426  */
428  struct tagCOMPLEX16FrequencySeries **hptilde, /**< Output: Frequency-domain waveform h+ */
429  struct tagCOMPLEX16FrequencySeries **hctilde, /**< Output: Frequency-domain waveform hx */
430  REAL8 phiRef, /**< Phase at reference time */
431  REAL8 deltaF, /**< Sampling frequency (Hz) */
432  REAL8 fLow, /**< Starting GW frequency (Hz) */
433  REAL8 fHigh, /**< End frequency; 0 defaults to Mf=0.14 */
434  REAL8 fRef, /**< Reference frequency (Hz); 0 defaults to fLow */
435  REAL8 distance, /**< Distance of source (m) */
436  REAL8 inclination, /**< Inclination of source (rad) */
437  REAL8 m1_SI, /**< Mass of neutron star 1 (kg) */
438  REAL8 m2_SI, /**< Mass of neutron star 2 (kg) */
439  REAL8 chi1, /**< Dimensionless aligned component spin of NS 1 */
440  REAL8 chi2, /**< Dimensionless aligned component spin of NS 2 */
441  REAL8 lambda1, /**< Dimensionless tidal deformability of NS 1 */
442  REAL8 lambda2, /**< Dimensionless tidal deformability of NS 2 */
443  LALDict *LALparams, /**< linked list containing the extra testing GR parameters */
444  NRTidal_version_type NRTidal_version /**< Version of NRTides; can be one of NRTidal or NRTidalv2NoAmpCorr */
445  ) {
446  // Use fLow, fHigh, deltaF to compute freqs sequence
447  // Instead of building a full sequence we only transfer the boundaries and let
448  // the internal core function do the rest (and properly take care of corner cases).
450  freqs->data[0] = fLow;
451  freqs->data[1] = fHigh;
452 
453  int retcode = SEOBNRv4ROM_NRTidal_Core(hptilde, hctilde,
454  phiRef, fRef, distance, inclination, m1_SI, m2_SI, chi1, chi2, lambda1, lambda2, freqs, deltaF, LALparams, NRTidal_version);
455 
457 
458  return(retcode);
459 }
460 
461 /** @} */
462 /** @} */
void XLALSimInspiralGetHOSpinTerms(REAL8 *SS_3p5PN, REAL8 *SSS_3p5PN, REAL8 X_A, REAL8 X_B, REAL8 chi1, REAL8 chi2, REAL8 quadparam1, REAL8 quadparam2)
Function to add 3.5PN spin-squared and 3.5PN spin-cubed terms.
int XLALSimNRTunedTidesFDTidalPhaseFrequencySeries(const REAL8Sequence *phi_tidal, const REAL8Sequence *amp_tidal, const REAL8Sequence *planck_taper, const REAL8Sequence *fHz, REAL8 m1_SI, REAL8 m2_SI, REAL8 lambda1, REAL8 lambda2, NRTidal_version_type NRTidal_version)
Function to call the frequency domain tidal correction over an array of input frequencies.
double XLALSimNRTunedTidesMergerFrequency(const REAL8 mtot_MSUN, const REAL8 kappa2T, const REAL8 q)
compute the merger frequency of a BNS system.
double XLALSimNRTunedTidesComputeKappa2T(REAL8 m1_SI, REAL8 m2_SI, REAL8 lambda1, REAL8 lambda2)
convenient function to compute tidal coupling constant.
void Self_spin_phase_contributions(const REAL8 m1_SI, const REAL8 m2_SI, const REAL8 chi1L, const REAL8 chi2L, const REAL8 qm_def1, const REAL8 qm_def2, REAL8 *pfa_v4_contrib, REAL8 *pfa_v6_contrib)
Function to internally add 2PN and 3PN spin-spin terms to be able to include spin-induced quadrupole ...
int SEOBNRv4ROM_NRTidal_Core(struct tagCOMPLEX16FrequencySeries **hptilde, struct tagCOMPLEX16FrequencySeries **hctilde, REAL8 phiRef, REAL8 fRef, REAL8 distance, REAL8 inclination, REAL8 m1_SI, REAL8 m2_SI, REAL8 chi1, REAL8 chi2, REAL8 lambda1, REAL8 lambda2, const REAL8Sequence *freqs_in, REAL8 deltaF, LALDict *LALparams, NRTidal_version_type NRTidal_version)
double XLALSimInspiralGetFinalFreq(REAL8 m1, REAL8 m2, const REAL8 S1x, const REAL8 S1y, const REAL8 S1z, const REAL8 S2x, const REAL8 S2y, const REAL8 S2z, Approximant approximant)
Function that gives the default ending frequencies of the given approximant.
REAL8 XLALSimInspiralWaveformParamsLookupdQuadMon1(LALDict *params)
int XLALSimInspiralWaveformParamsInsertTidalLambda1(LALDict *params, REAL8 value)
int XLALSimInspiralWaveformParamsInsertTidalLambda2(LALDict *params, REAL8 value)
REAL8 XLALSimInspiralWaveformParamsLookupdQuadMon2(LALDict *params)
double i
Definition: bh_ringdown.c:118
COMPLEX16FrequencySeries * XLALResizeCOMPLEX16FrequencySeries(COMPLEX16FrequencySeries *series, int first, size_t length)
#define LAL_MSUN_SI
#define LAL_PI
#define LAL_MTSUN_SI
double complex COMPLEX16
double REAL8
uint32_t UINT4
NRTidal_version_type
Definition: LALSimIMR.h:80
@ NRTidalv2NoAmpCorr_V
version NRTidalv2, without amplitude corrections
Definition: LALSimIMR.h:83
@ NRTidalv2NSBH_V
version NRTidalv2: https://arxiv.org/abs/1905.06011 with amplitude corrections for NSBH (used for SEO...
Definition: LALSimIMR.h:84
@ NRTidalv2_V
version NRTidalv2: https://arxiv.org/abs/1905.06011
Definition: LALSimIMR.h:82
int XLALSimIMRSEOBNRv4ROM(struct tagCOMPLEX16FrequencySeries **hptilde, struct tagCOMPLEX16FrequencySeries **hctilde, REAL8 phiRef, REAL8 deltaF, REAL8 fLow, REAL8 fHigh, REAL8 fRef, REAL8 distance, REAL8 inclination, REAL8 m1SI, REAL8 m2SI, REAL8 chi1, REAL8 chi2, INT4 nk_max, LALDict *LALparams, NRTidal_version_type NRTidal_version)
Compute waveform in LAL format for the SEOBNRv4_ROM model.
int XLALSimIMRSEOBNRv4ROMFrequencySequence(struct tagCOMPLEX16FrequencySeries **hptilde, struct tagCOMPLEX16FrequencySeries **hctilde, const REAL8Sequence *freqs, REAL8 phiRef, REAL8 fRef, REAL8 distance, REAL8 inclination, REAL8 m1SI, REAL8 m2SI, REAL8 chi1, REAL8 chi2, INT4 nk_max, LALDict *LALparams, NRTidal_version_type NRTidal_version)
Compute waveform in LAL format at specified frequencies for the SEOBNRv4_ROM model.
int XLALSimIMRSEOBNRv4ROMNRTidalFrequencySequence(struct tagCOMPLEX16FrequencySeries **hptilde, struct tagCOMPLEX16FrequencySeries **hctilde, const REAL8Sequence *freqs, REAL8 phiRef, REAL8 fRef, REAL8 distance, REAL8 inclination, REAL8 m1_SI, REAL8 m2_SI, REAL8 chi1, REAL8 chi2, REAL8 lambda1, REAL8 lambda2, LALDict *LALparams, NRTidal_version_type NRTidal_version)
Compute waveform in LAL format at specified frequencies for the SEOBNRv4_ROM_NRTidal tidal model base...
int XLALSEOBNRv4ROMNSBHAmplitudeCorrectionFrequencySeries(const REAL8Sequence *amp_tidal, const REAL8Sequence *fHz, REAL8 m1_SI, REAL8 m2_SI, REAL8 chi1, REAL8 lambda2)
Compute amplitude correction to SEOBNRv4_ROM_NRTidalv2 in LAL format at specified frequencies for the...
int XLALSimIMRSEOBNRv4ROMNRTidal(struct tagCOMPLEX16FrequencySeries **hptilde, struct tagCOMPLEX16FrequencySeries **hctilde, REAL8 phiRef, REAL8 deltaF, REAL8 fLow, REAL8 fHigh, REAL8 fRef, REAL8 distance, REAL8 inclination, REAL8 m1_SI, REAL8 m2_SI, REAL8 chi1, REAL8 chi2, REAL8 lambda1, REAL8 lambda2, LALDict *LALparams, NRTidal_version_type NRTidal_version)
Compute waveform in LAL format for the SEOBNRv4_ROM_NRTidal tidal model based on SEOBNRv4_ROM.
@ SEOBNRv4
Spin nonprecessing EOBNR model v4.
void XLALDestroyREAL8Sequence(REAL8Sequence *sequence)
REAL8Sequence * XLALCreateREAL8Sequence(size_t length)
#define XLAL_ERROR(...)
#define XLAL_CHECK(assertion,...)
int XLALPrintError(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
XLAL_ENOMEM
XLAL_SUCCESS
XLAL_EFAULT
XLAL_EFUNC
REAL8 * data