  Here we prove that the classical (respectively, quantum) system, consisting
of a particle moving in a static electromagnetic field, is canonically
(respectively, unitarily) equivalent to a harmonic oscillator perturbed by a
spatially homogeneous force field. This system is canonically and unitarily
equivalent to a standard oscillator. Therefore, by composing the two
transformations we can integrate the initial problem. Actually, the eigenstates
of the initial problem turn out to be entangled states of the harmonic
oscillator. When the magnetic field is spatially homogeneous but
time-dependent, the equivalent harmonic oscillator has a time-varying
frequency. This system can be exactly integrated only for some particular cases
of the time dependence of the magnetic field. The unitary transformations
between the quantum systems are a representation of the canonical
transformations by unitary transformations of the corresponding Hilbert spaces.
