For which of the following condition, potential energy of a dipole in an external magnetic field is zero?