Skip to content

np.pi --> np.pi/2 in PhasePolarizationReversalProposal

I was speaking to Javier Roulet about the relationship of proposals in bilby_mcmc with those in his own code, and he pointed out that the current implementation may have a bug. In particular, the current implementation has

sample[self.phase_key] = np.mod(
    sample[self.phase_key] + np.pi + self.epsilon, 2 * np.pi
sample["psi"] = np.mod(sample["psi"] + np.pi / 2 + self.epsilon, np.pi)

but since a \pi shift in phase will leave the waveform unchanged and a \pi/2 shift in polarization will invert the waveform, this will make the proposal method ineffective. Instead the phase shift should be \pi/2. This MR simply implements that.

Merge request reports