Abstract
The gauge-invariant formulation of quantum mechanics is applied to the charged harmonic oscillator in an electromagnetic field in the electric dipole approximation to obtain the probability that the oscillator is in a particular state at time t. This probability is compared with the corresponding 'probability' calculated from the conventional approach to the interaction of radiation with matter using the interaction A.p. The probabilities do not agree with each other. From the principle of gauge invariance it is concluded that the probability calculated from the gauge-invariant formulation is correct in this case, and that the conventional approach in general is incorrect.