Using a robust photon loss model for photonic quantum experiments, the authors derive th order parameter-shift rules for computing gradients of Fock boson sampling transition probabilities where photons are sent into a lossy interferometer. They also show it is not generally possible to generalize this gradient recipe to Gaussian boson sampling, except when the transmission matrix factorizes as a diagonal loss matrix premultiplied by a pure unitary.
