Scattering theory and the trace of the wave group