We introduce a real-space technique able to extend the standard Hopfield
approach commonly used in quantum polaritonics to the case of inhomogeneous
lossless materials interacting with the electromagnetic field. We derive the
creation and annihilation polaritonic operators for the system normal modes as
linear, space-dependent superpositions of the microscopic light and matter
fields, and we invert the Hopfield transformation expressing the microscopic
fields as functions of the polaritonic operators. As an example, we apply our
approach to the case of a planar interface between vacuum and a polar
dielectric, showing how we can consistently treat both propagative and surface
modes, and express their nonlinear interactions, arising from phonon
anharmonicity, as polaritonic scattering terms. We also show that our theory
can be naturally extended to the case of dissipative materials