All band-structure calculations were done with FHI-aims using the PBE exchangecorrelation functional with the MBD-NL dispersion correction scheme. FHI-aims relies on numerically tabulated, atom-centered orbitals and supports both periodic and open boundary conditions. Except for the free molecule in vacuum, which was modeled with open boundary conditions, all calculations were done using periodic boundary conditions employing the repeated-slab approach. The metal slab was modelled with 9 metal layers, with a vacuum region of more than 55 Å above it. The electric field is modelled by applying a sawtooth potential with a potential jump in the vacuum region. The polarizability tensor for the system is calculated using ab-initio density-functional perturbation theory. Our SCF convergence settings require the energy to change by less than 1 × 10 -6 eV and the electron density by less than 1 × 10 -2 e -between subsequent SCF iterations. We used a Gaussian occupation scheme with a broadening of 0.1 eV for the states. The reciprocal space was sampled by a generalized Monkhorst-Pack grid with a maximal spacing of Δk = 2π/80Å -1