  We apply the method of gauge transformation to spin glasses under the
microcanonical ensemble to study the possibility of ensemble inequivalence in
systems with long-range interactions and quenched disorder. It is proved that
all the results derived under the canonical ensemble on the Nishimori line (NL)
can be reproduced by the microcanonical ensemble irrespective of the range of
interactions. This establishes that ensemble inequivalence should take place
away from the NL if it happens in spin glasses. It is also proved on the NL
that the microcanonical configurational average of the energy as a function of
temperature is exactly equal to the average energy in the canonical ensemble
for any finite-size systems with Gaussian disorder. In this sense, ensembles
are equivalent even for finite systems.
