GWForge.fisher.derivatives¶
First and second derivatives of the detector response.
Most of the work is deciding which derivatives have to be numerical. A bilby
source model returns \(\tilde h_+\) and \(\tilde h_\times\) from the
intrinsic parameters plus theta_jn, phase and luminosity_distance,
and has no dependence on ra, dec, psi or geocent_time – so
those four, plus luminosity_distance, are exact. See
GWForge.fisher.antenna_derivatives for the geometry and
GWForge.fisher.stepsize for how the numerical steps are chosen.
Everything else is differenced with fourth-order five-point stencils, which give
the first and second derivative from the same five evaluations. Note phase
is not analytic for a higher-mode waveform: each \((\ell, m)\) carries
\(e^{-i m \phi_c}\) and the mode decomposition is not exposed.
Mixed second derivatives between a numerical and an analytic parameter are taken
by differencing the exact analytic derivative along the numerical stencil.
That matters when earth_rotation is on, because the masses then reach the
response through \(\tau(f)\) as well as through the waveform.
Classes¶
First and second derivatives of the detector response for one source. |
Functions¶
|
Exact response and derivatives for the five closed-form parameters. |
Module Contents¶
- GWForge.fisher.derivatives.analytic_derivatives(interferometer, polarizations, parameters, earth_rotation=True, finite_size=True, order=1)[source]¶
Exact response and derivatives for the five closed-form parameters.
Writing \(h = P\,S\) with \(P = F_+\tilde h_+ + F_\times\tilde h_\times\) and \(S = e^{-2\pi i f\tau}\),
\[\partial_a h = \big(\partial_a P - 2\pi i f\,\partial_a\tau\,P\big) S,\]and the second derivative follows from one more product rule.
ra,dec,psiandgeocent_timeenter throughAntennaDerivatives;luminosity_distanceis handled separately because \(h \propto 1/d_L\) makes every one of its derivatives a rescaling of a derivative we already have.- Parameters:
interferometer (bilby.gw.detector.Interferometer)
polarizations (dict) –
{'plus': ..., 'cross': ...}on the interferometer’s frequency grid.parameters (dict) – Source parameters.
earth_rotation (bool) – Response options; must match those used elsewhere.
finite_size (bool) – Response options; must match those used elsewhere.
order (int) –
2also returns second derivatives.
- Returns:
(response, first, second).firstmaps a parameter name to a full-length complex array;secondmaps a sorted name pair to one. Both are zero outside the interferometer’s frequency mask.- Return type:
tuple
- class GWForge.fisher.derivatives.WaveformDerivatives(interferometers, waveform_generator, parameters, fisher_parameters=None, earth_rotation=True, finite_size=True, step_sizes=None, order=1, calibrate=True, target_change=TARGET_FRACTIONAL_CHANGE, estimate_noise=True)[source]¶
First and second derivatives of the detector response for one source.
Combines the exact closed-form derivatives of
analytic_derivatives()with fourth-order finite differences for the parameters the waveform actually depends on.The waveform is evaluated once per stencil point and cached, because the polarizations do not depend on which detector is looking; detectors are then projected one at a time by
derivatives(). That ordering matters for memory: a second-derivative array isn_parameters**2frequency series, so holding one for every detector at once reaches gigabytes at a high sampling frequency, while the cached polarizations are only2series per stencil point.For eleven parameters this is
4 * n_numerical + 1waveform evaluations atorder = 1, plus four per numerical pair atorder = 2.- Variables:
names (list of str) – Parameter names, in the order used by the Fisher matrix.
numerical (analytic,) – The split of
namesby differentiation method.steps (dict) – Finite-difference step actually used for each numerical parameter.
waveform_evaluations (int) – How many times the waveform generator was called.
- names = ['chirp_mass', 'symmetric_mass_ratio', 'luminosity_distance', 'ra', 'dec', 'theta_jn', 'psi',...[source]¶
- derivatives(interferometer)[source]¶
Response and derivative arrays for one detector.
- Parameters:
interferometer (bilby.gw.detector.Interferometer) – Must belong to the network this object was built with.
- Returns:
(response, first, second)wherefirsthas shape(n_parameters, n_frequencies)andsecondhas shape(n_parameters, n_parameters, n_frequencies)– or isNonewhenorder < 2.- Return type:
tuple