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

WaveformDerivatives

First and second derivatives of the detector response for one source.

Functions

analytic_derivatives(interferometer, polarizations, ...)

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, psi and geocent_time enter through AntennaDerivatives; luminosity_distance is 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) – 2 also returns second derivatives.

Returns:

(response, first, second). first maps a parameter name to a full-length complex array; second maps 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 is n_parameters**2 frequency series, so holding one for every detector at once reaches gigabytes at a high sampling frequency, while the cached polarizations are only 2 series per stencil point.

For eleven parameters this is 4 * n_numerical + 1 waveform evaluations at order = 1, plus four per numerical pair at order = 2.

Variables:
  • names (list of str) – Parameter names, in the order used by the Fisher matrix.

  • numerical (analytic,) – The split of names by differentiation method.

  • steps (dict) – Finite-difference step actually used for each numerical parameter.

  • waveform_evaluations (int) – How many times the waveform generator was called.

interferometers[source]
waveform_generator[source]
parameters[source]
names = ['chirp_mass', 'symmetric_mass_ratio', 'luminosity_distance', 'ra', 'dec', 'theta_jn', 'psi',...[source]
earth_rotation = True[source]
finite_size = True[source]
order = 1[source]
estimate_noise = True[source]
index[source]
analytic[source]
numerical[source]
steps[source]
noise_ratios[source]
waveform_evaluations = 0[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) where first has shape (n_parameters, n_frequencies) and second has shape (n_parameters, n_parameters, n_frequencies) – or is None when order < 2.

Return type:

tuple