The conventional perturbation theory in quantum mechanics for the interaction of electromagnetic radiation with matter, which is based on the time-dependent vector and scalar potentials, is shown to be dependent on the gauge. The problem is reformulated, using the approach of Yang, in a gauge-invariant way, in which the transitions between states are induced by the quantum-mechanical power operator. In order to use an unperturbed Hamiltonian which does not involve the electromagnetic field, the gauge is chosen to give the electric dipole interaction. This choice can be made if the magnetic field is negligible and the electric field is slowly varying over atomic dimensions. For a comparison of the gauge-invariant and conventional formulation, a two-level atom in a radiation field is considered. For the probability that an atom originally in the lower state will make a transition to the upper state when the field is not in resonance, the gauge-invariant formulation gives the correct result, whereas the gauge-dependent formulation gives an incorrect result.
A novel Hamiltonian scheme for non–relativistic quantum electrodynamics in which the gauge arbitrariness of the field potential is kept explicit is used to study the gauge–dependence properties of various versions of perturbation theory when resonance and line–broadening effects are admitted. Time–dependent perturbation theory is shown to have severe gauge–dependence problems unless ad hoc modifications are made. A time–independent formulation of S–matrix theory is then studied. Far from resonance, the S–matrix is gauge invariant in all orders of perturbation theory due to a very precise cancellation of gauge–dependent terms which requires, among other things, complete sets of intermediate states; energy conservation also has a crucial role. However, an obvious separation of the S–matrix into a resonant (pole) and non–resonant background leads to incomplete cancellation of the gauge–dependent terms. The introduction of the Heitler damping matrix into an integral equation for the T–matrix leads to a gauge–invariant result. This provides the basis for a gauge invariant S–matrix theory of atoms and molecules interacting with electromagnetic radiation that encompasses resonance and damping effects.