  We consider the nonadiabatic energy fluctuations of a many-body system in a
time-dependent harmonic trap. In the presence of scale-invariance, the dynamics
becomes self-similar and the nondiabatic energy fluctuations can be found in
terms of the initial expectation values of the second moments of the
Hamiltonian, square position, and squeezing operators. Nonadiabatic features
are expressed in terms of the scaling factor governing the size of the atomic
cloud, which can be extracted from time-of-flight images. We apply this exact
relation to a number of examples: the single-particle harmonic oscillator, the
one-dimensional Calogero-Sutherland model, describing bosons with
inverse-square interactions that includes the non-interacting Bose gas and the
Tonks-Girdardeau gas as limiting cases, and the unitary Fermi gas. We
illustrate these results for various expansion protocols involving sudden
quenches of the trap frequency, linear ramps and shortcuts to adiabaticity. Our
results pave the way to the experimental study of nonadiabatic energy
fluctuations in driven quantum fluids.
