  We study the evolution of the energy of a harmonic oscillator when its
frequency slowly varies with time and passes through zero value. We consider
both the classical and quantum descriptions of the system. We show that after a
single frequency passage through zero value, the famous adiabatic invariant
ratio of energy to frequency (which does not hold for zero frequency) is
reestablished again, but with the proportionality coefficient dependent on the
initial state. The dependence on the initial state disappears after averaging
over phases of initial states with the same energy (in particular, for the
initial vacuum, Fock and thermal quantum states). In this case, the mean
proportionality coefficient is always greater than unity. The concrete value of
the mean proportionality coefficient depends on the power index of the
frequency dependence on time near zero point. In particular, the mean energy
triplicates if the frequency tends to zero linearly. If the frequency attains
zero more than once, the adiabatic proportionality coefficient strongly depends
on lengths of time intervals between zero points, so that the mean energy
behavior turns out quasi-stochastic after many passages through zero value. The
original Born-Fock theorem does not work after the frequency passes through
zero. However, its generalization is found: the initial Fock state becomes a
wide superposition of many Fock states, whose weights do not depend on time in
the new adiabatic regime. When the mean energy triplicates, the initial Nth
Fock state becomes a superposition of, roughly speaking, 6N states, distributed
non-uniformly. The initial vacuum and low-order Fock states become squeezed, as
well as initial thermal states with low values of the mean energy.
