  Making quantitative predictions for quantum light-matter interactions in
ultra thin solids involves several fundamental challenges. Any realistic theory
must simultaneously account for the highly confined light modes and their
quantization in the presence of optical losses, while simultaneously describing
the electronic states from first principles. In this paper we develop a
framework that combines density functional theory (DFT) with macroscopic
quantum electrodynamics (MQED). We exemplify our methods by presenting
ab-initio predictions for the Purcell effect in atomically thin van der Waals
heterostructures. Our ab-initio predictions for the spontaneous emission rate
enhancement of intersubband transitions in few-layer transition metal
dichalcogenides (TMDs) sandwiched between graphene and a perfect conductor can
approach $10^7$. Such enhancement corresponds to a lifetime reduction from
microseconds to picoseconds due to the the extreme confinement of light modes
associated with the graphene plasmons. The general validity of our methodology
allows us to test the limitations of widely used approximations, including the
dipole-approximation, 1D quantum well wave functions, and Fermi's Golden rule
for spontaneous emission. Our approach lays the foundation for ab-initio
modeling of light matter interactions in structures where the quantum nature of
light influences the electron system.
