critical bug fix to get_energy_gradient in pairwise potential, gradient entries needs to be assigned to 0 before iteration