  We derive a Hamiltonian for the external and internal dynamics of an
electromagnetically bound, charged two-particle system in external
electromagnetic and gravitational fields, including leading-order relativistic
corrections. We apply this Hamiltonian to describe the relativistic coupling of
the external and internal dynamics of cold ions in Paul traps, including the
effects of micromotion, excess micromotion, and trap imperfections. This
provides a systematic and fully quantum-mechanical treatment of relativistic
frequency shifts in atomic clocks based on single trapped ions. Our approach
reproduces well-known formulas for the second-order Doppler shift for thermal
states, which were previously derived on the basis of semiclassical arguments.
We complement and clarify recent discussions in the literature on the role of
time dilation and mass defect in ion clocks.
