  By placing an atom into a cavity, the electromagnetic mode structure of the
cavity is modified. In Cavity QED, one manifestation of this phenomenon is the
appearance of a gauge-dependent diamagnetic term, known as the $A^2$
contribution. Although in atomic Cavity QED, the resulting modification in the
eigenmodes is negligible, in recent superconducting circuit realizations, such
corrections can be observable and may have qualitative implications. We revisit
the canonical quantization procedure of a circuit QED system consisting of a
single superconducting transmon qubit coupled to a multimode superconducting
microwave resonator. A complete derivation of the quantum Hamiltonian of an
open circuit QED system consisting of a transmon qubit coupled to a leaky
transmission line cavity is presented. We introduce a complete set of modes
that properly conserves the current in the entire structure and present a sum
rule for the dipole transition matrix elements of a multi-level transmon qubit
coupled to a multi-mode cavity. Finally, an effective multi-mode Rabi model is
derived with coefficients that are given in terms of circuit parameters.
