  Based on an analysis of the short range chemical environment of each atom in
a system, standard machine learning based approaches to the construction of
interatomic potentials aim at determining directly the central quantity which
is the total energy. This prevents for instance an accurate description of the
energetics of systems where long range charge transfer is important as well as
of ionized systems. We propose therefore not to target directly with machine
learning methods the total energy but an intermediate physical quantity namely
the charge density, which then in turn allows to determine the total energy. By
allowing the electronic charge to distribute itself in an optimal way over the
system, we can describe not only neutral but also ionized systems with
unprecedented accuracy. We demonstrate the power of our approach for both
neutral and ionized NaCl clusters where charge redistribution plays a decisive
role for the energetics. We are able to obtain chemical accuracy, i.e. errors
of less than a milli Hartree per atom compared to the reference density
functional results. The introduction of physically motivated quantities which
are determined by the short range atomic environment via a neural network leads
also to an increased stability of the machine learning process and
transferability of the potential.
