  We introduce a new selected configuration interaction plus perturbation
theory algorithm that is based on a deterministic analog of our recent
efficient heat-bath sampling algorithm. This Heat-bath Configuration
Interaction (HCI) algorithm makes use of two parameters that control the
tradeoff between speed and accuracy, one which controls the selection of
determinants to add to a variational wavefunction, and one which controls the
the selection of determinants used to compute the perturbative correction to
the variational energy. We show that HCI provides an accurate treatment of both
static and dynamic correlation by computing the potential energy curve of the
multireference carbon dimer in the cc-pVDZ basis. We then demonstrate the speed
and accuracy of HCI by recovering the full configuration interaction energy of
both the carbon dimer in the cc-pVTZ basis and the strongly-correlated chromium
dimer in the Ahlrichs VDZ basis, correlating all electrons, to an accuracy of
better than 1 mHa, in just a few minutes on a single core. These systems have
full variational spaces of 3x10^14 and 2x10^22 determinants respectively.
