LALSimulation  5.4.0.1-fe68b98
LALSimIMRPhenomXHM_structs.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 Marta Colleoni, Cecilio García Quirós
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 //
21 // LALSimIMRPhenomXHM_structs.h
22 //
23 // Created by Marta on 13/02/2019.
24 //
25 #ifndef LALSimIMRPhenomXHM_structs_h
26 #define LALSimIMRPhenomXHM_structs_h
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 
33 #include <lal/LALAtomicDatatypes.h>
35 
36 #define N_HIGHERMODES_IMPLEMENTED 4 // lm = (21, 33, 32, 44)
37 
38 #define N_MAX_COEFFICIENTS_PHASE_INS 13 //Maximun number of coefficients of the inspiral ansatz
39 #define N_MAX_COEFFICIENTS_PHASE_INTER 6 //Maximun number of coefficients of the intermediate ansatz
40 #define N_MAX_COEFFICIENTS_PHASE_RING 8 //Maximun number of coefficients of the ringdown ansatz. 5 + 3 optional for flattened phi'
41 
42 #define N_MAX_COEFFICIENTS_AMPLITUDE_INS 3 //Maximun number of collocation points in the inspiral
43 #define N_MAX_COEFFICIENTS_AMPLITUDE_INTER 8 //Maximun number of collocation points in the intermediate. New release 4 coll points + 2x2 boundaries
44 #define N_MAX_COEFFICIENTS_AMPLITUDE_RING 6 //Maximun number of coefficients in the ringdown. We only use 3 degrees of freedom, but we have the double to store fits of 3 coefficients or 3 collocation points
45 #define N_MAX_COEFFICIENTS_AMPLITUDE_RDAUX 4 //Maximun number of coefficients in the ringdown auxiliar region for mode-mixing. Default 2 collocation points + point & derivative right boundary
46 
47 // Data structure to hold QNM frequencies
48 typedef double (*fitQNM_fring) (double finalDimlessSpin);
49 typedef double (*fitQNM_fdamp) (double finalDimlessSpin);
50 
51 typedef struct tagQNMFits {
54 } QNMFits;
55 
56 
57 // General fit function. This is a type for defining the functions for the parameter space fits.
58 typedef double (*ParameterSpaceFit) (IMRPhenomXWaveformStruct *pWF, int flag);
59 
60 // Waveform struct. Store useful variable specific of the higher modes that are not in 22 IMRPhenomXWaveformStruct or that need to be updated mode-by-mode. */
61 typedef struct tagIMRPhenomXHMWaveformStruct
62 {
63  /* Model Version Parameters */
67 
71 
75 
79 
83 
87 
88 
89 
91 
92  /* Parameters that define deviation of the tuned coprecessing mode PhenomXCP from PhenomX (500) */
93  REAL8 MU1; // MR Amplitude
94  REAL8 MU2; // MR Amplitude: modifies gamma2
95  REAL8 MU3; // MR Amplitude: modifies gamma3
96  REAL8 MU4; // MR Amplitude: would modify appearance of fRing in MR amplitude
97  REAL8 NU0; // MR Phase
98  REAL8 NU4; // MR Phase
99  REAL8 NU5; // MR Phase
100  REAL8 NU6; // MR Phase
101  REAL8 ZETA1; // INT Phase
102  REAL8 ZETA2; // INT Phase
103  REAL8 PNR_DEV_PARAMETER; // Is zero when no precession, and non-zero otherwise
104 
105 
106  /* Spin Parameters */
107  REAL8 chi_s, chi_a; // (chi1 +/- chi2)/2
108 
109  /* MECO, Ringdown and Damping Frequencies */
110  REAL8 fMECOlm; // = wf22->fMECO*m/2
113 
114  /* Limit between comparable and extreme mass ratios for the phase */
116 
117  /* The PhenomXAS functions returns the phase without a linear part that is not relevant for the matches.
118  We need this linear part for the multimode waveform. timeshift * f + phaseshift */
121  /* NOTE that we wish to destinguish between the global timshihft for 22, and that for each higher moment */
124  REAL8 phiref22; //Correction to apply to PhX phase for returning phiRef at reference frequency
125 
126  /* mode labels ad tags*/
127  INT4 ell; // spherical harmomic l
128  INT4 emm; // spherical harmomic m
131 
132  /* Number collocation points */
137 
138  /* variable to control use of mode-mixing routines */
140 
141  // 2x2 matrix containing the mixing coefficients of the lm mode with the nearest dominant neighbour
142  COMPLEX8 mixingCoeffs[4];
143  COMPLEX8 mu22, mu32;
144 
145  /* Variables to control use of Amplitude Veto for removing certain collocation points. */
146  INT4 InspiralAmpVeto, IntermediateAmpVeto, RingdownAmpVeto;
147 
148  // The same than in WF22, sqrt(2*eta/3)/Pi, this is the normalization factor of the leading order of the 22.
150 
151  // Variable to control if the case is EMR and apply the two intermediate regions for the amplitude
153 
154  // Variable to control if the odd modes are zero
156 
157  // Multiply by Amp0 to transform NR amplitude to physical amplitude (= pWF22->ampNorm * pWF22->amp0 )
159 
160  // Variable to control the use of FAmpPN function for 21 instead of the power series
162 
163  /* time-shift of the peak of the hybrids' 22 wrt end of the waveform*/
165 
166  REAL8 fPhaseRDflat; // Ringdown -> Flattened region
167  REAL8 fAmpRDfalloff; // Ringdown -> Falloff region
168 
170 
171 
172  /******************* AMPLITUDE ****************/
173 
174  // Store the coefficients needed to perform the amplitude reconstruction
175  typedef struct tagIMRPhenomXHMAmpCoefficients
176  {
177  /* Cutting frequencies */
178  REAL8 fAmpMatchIN; // Inspiral -> Intermediate
179  REAL8 fAmpMatchInt12; // Intermediate1 -> Intermediate2. Only for EMR cases
180  REAL8 fAmpMatchIM; // Intermediate -> Ringdown
181  REAL8 fRDAux; // Auxiliar Ringdown region for mode-mixing
182 
183  /* PN Amplitude Prefactors */
184  COMPLEX16 pnInitial, pnOneThird, pnTwoThirds, pnThreeThirds, pnFourThirds, pnFiveThirds, pnSixThirds, pnSevenThirds, pnEightThirds,pnNineThirds;
185 
186  /* PN Amplitude dominant factor = Pi * Sqrt(2 eta/3) (2Pi /m)^(-7/6) */
187  REAL8 PNdominant, PNdominantlm, ampNorm;
188 
190 
191  /* PN Amplitude global prefactor = leading lm order after substracting PNdominant*/
193 
194  /* Coefficients of the pseudo-PN terms */
195  REAL8 rho1, rho2, rho3;
196 
197  /* Coefficients of the polynomial in the intermediate region. 5th order by default */
198  REAL8 delta0, delta1, delta2, delta3, delta4, delta5;
199 
200  /* Coefficients of the polynomial in the first intermediate region (for EMR only). 4th order.*/
201  REAL8 alpha0, alpha1, alpha2, alpha3, alpha4;
202 
203  // fits of coefficients/collocation points
207 
208  /* Flag to set how many collocation points the inspiral region uses */
209  REAL8 CollocationPointsValuesAmplitudeInsp[N_MAX_COEFFICIENTS_AMPLITUDE_INS];
210  REAL8 CollocationPointsFreqsAmplitudeInsp[N_MAX_COEFFICIENTS_AMPLITUDE_INS];
212 
213  /* Flag to set how many collocation points the intermediate region uses */
214  REAL8 CollocationPointsFreqsAmplitudeInter[N_MAX_COEFFICIENTS_AMPLITUDE_INTER];
215  REAL8 CollocationPointsValuesAmplitudeInter[N_MAX_COEFFICIENTS_AMPLITUDE_INTER];
219 
220  /* Flag to set how many collocation points the intermediate region uses */
221  REAL8 CollocationPointsFreqsAmplitudeRD[N_MAX_COEFFICIENTS_AMPLITUDE_RING];
222  REAL8 CollocationPointsValuesAmplitudeRD[N_MAX_COEFFICIENTS_AMPLITUDE_RING];
224  REAL8 CollocationPointsFreqsAmplitudeRDAux[N_MAX_COEFFICIENTS_AMPLITUDE_RDAUX];
225  REAL8 CollocationPointsValuesAmplitudeRDAux[N_MAX_COEFFICIENTS_AMPLITUDE_RDAUX];
227  UINT2 nCollocPtsRDAux, nCoefficientsRDAux;
228 
229  // Frequencies, values and derivatives for the intermediate reconstruction
230  // The frequencies are the same than in CollocationPointsFreqsAmplitudeInsp for the corresponding mode,
231  // but in this way they are easier accesible.
232  REAL8 f1,f2,f3,f4,v1,v2,v3,v4,d1,d4;
233 
234  // Order of the polynomial in the intermediate region. 5th->105, for the first EMR region is 1042
236 
237  // Store the PN amplitude at the frequencies of the collocation points in the inspiral
239 
240  // For the pseudo part of Inspiral Amplitude ansatz. Used in LALSimIMRPhenomXHM_inspiral.c
244 
245  // Coefficients of the phasing factor coming from the SPA and time-domain Post-newtonian series, only for the 21 mode
246  REAL8 xdot5, xdot6, xdot65, xdot7, xdot75, xdot8, xdot8Log, xdot85, log2pi_two_thirds;
247  COMPLEX16 x05, x1, x15, x25, x2, x3;
249 
250  // Variable to control the use of the inspiral ansatz to compute the amplitude at fmaxCalc
252 
253  // Variables to control if we have to check that the collocation points are wavy
254  INT4 WavyInsp, WavyInt;
255 
256  // Amp0 = wf22->ampNorm * wf22->amp0. Multiplying by this gives the amp factor of the 22 and transforms to "physical" units
258 
259  UINT2 InspRescaleFactor, InterRescaleFactor, RDRescaleFactor;
260 
262 
263 
264 /*************** PHASE *****************/
265 
266 // Store the coefficients needed to perform the phase reconstruction
267 typedef struct tagIMRPhenomXHMPhaseCoefficients
268 {
269  /* Phase Transition Frequencies */
272 
274 
275  /* These are the RD phenomenological coefficients, with mode-mixing off */
276  REAL8 alpha0, alpha2, alphaL;
277  REAL8 phi0RD, dphi0RD;
278 
279  /* These are the RD phenomenological coefficients, with mode-mixing on: they give a phenomenological representation of the spheroidal-harmonic phase */
280  REAL8 phi0_S, alpha0_S, alpha2_S, alpha4_S, alphaL_S;
281 
282  /* These are the intermediate phenomenological coefficients */
283  REAL8 c0, c1, c2, c3, c4, cL;
284  REAL8 CRD, C1RD, CINSP, C1INSP;
285 
286  /* These are the inspiral phenomenological coefficients */
290 
291  // fits of coefficients/collocation points
295 
296  /* Flag to set how many collocation points the RD region uses --used only for the 32 mode */
298  REAL8 CollocationPointsValuesPhaseRD[N_MAX_COEFFICIENTS_PHASE_RING];
299  REAL8 CollocationPointsFreqsPhaseRD[N_MAX_COEFFICIENTS_PHASE_RING];
300  REAL8 RDCoefficient[N_MAX_COEFFICIENTS_PHASE_RING + 3]; // Add the three coefficient for rational decay
301 
302  /* Flag to set how many collocation points the intermediate region uses */
304  REAL8 CollocationPointsFreqsPhaseInter[N_MAX_COEFFICIENTS_PHASE_INTER];
305  REAL8 CollocationPointsValuesPhaseInter[N_MAX_COEFFICIENTS_PHASE_INTER];
306 
308 
309 
310 #ifdef __cplusplus
311 }
312 #endif
313 
314 #endif /* LALSimIMRPhenomXHM_structs_h */
const double c1
const double c2
#define N_MAX_COEFFICIENTS_AMPLITUDE_INTER
#define N_MAX_COEFFICIENTS_PHASE_RING
#define N_MAX_COEFFICIENTS_PHASE_INS
#define N_MAX_COEFFICIENTS_PHASE_INTER
#define N_HIGHERMODES_IMPLEMENTED
double(* fitQNM_fdamp)(double finalDimlessSpin)
#define N_MAX_COEFFICIENTS_AMPLITUDE_RDAUX
double(* ParameterSpaceFit)(IMRPhenomXWaveformStruct *pWF, int flag)
#define N_MAX_COEFFICIENTS_AMPLITUDE_RING
#define N_MAX_COEFFICIENTS_AMPLITUDE_INS
double(* fitQNM_fring)(double finalDimlessSpin)
const double rho2
double complex COMPLEX16
double REAL8
uint16_t UINT2
float complex COMPLEX8
int32_t INT4