  Standard flavors of density-functional theory (DFT) calculations are known to
fail in describing anions, due to large self-interaction errors. The problem
may be circumvented by using localized basis sets of reduced size, leaving no
variational flexibility for the extra electron to delocalize. Alternatively, a
recent approach exploiting DFT evaluations of total energies on electronic
densities optimized at the Hartree-Fock (HF) level has been reported, showing
that the self-interaction-free HF densities are able to lead to an improved
description of the additional electron, returning affinities in close agreement
with the experiments. Nonetheless, such an approach can fail when the HF
densities are too inaccurate. Here, an alternative approach is presented, in
which an embedding environment is used to stabilize the anion in a bound
configuration. Similarly to the HF case, when computing total energies at the
DFT level on these corrected densities, electron affinities in very good
agreement with experiments can be recovered. The effect of the environment can
be evaluated and removed by an extrapolation of the results to the limit of
vanishing embedding. Moreover, the approach can be easily applied to DFT
calculations with delocalized basis sets, e.g. plane-waves, for which
alternative approaches are either not viable or more computationally demanding.
The proposed extrapolation strategy can be thus applied also to extended
systems, as often studied in condensed-matter physics and materials science,
and we illustrate how the embedding environment can be exploited to determine
the energy of an adsorbing anion - here a chloride ion on a metal surface -
whose charge configuration would be incorrectly predicted by standard density
functionals.
