  We describe a first principles method to calculate scanning tunneling
microscopy (STM) images, and compare the results to well-characterized
experiments combining STM with atomic force microscopy (AFM). The theory is
based on density functional theory (DFT) with a localized basis set, where the
wave functions in the vacuum gap are computed by propagating the
localized-basis wave functions into the gap using a real-space grid.
Constant-height STM images are computed using Bardeen's approximation method,
including averaging over the reciprocal space. We consider copper adatoms and
single CO molecules adsorbed on Cu(111), scanned with a single-atom copper tip
with and without CO functionalization. The calculated images agree with
state-of-the-art experiments, where the atomic structure of the tip apex is
determined by AFM. The comparison further allows for detailed interpretation of
the STM images.
