  The computational study of energy storage and conversion processes calls for
simulation techniques that can reproduce the electronic response of metal
electrodes under electric fields. Despite recent advancements in
machine-learning methods applied to electronic-structure properties, predicting
the non-local behavior of the charge density in electronic conductors remains a
major open challenge. We combine long-range and equivariant kernel methods to
predict the Kohn-Sham electron density of metal electrodes in response to
various kinds of electric field perturbations. By taking slabs of gold as an
example, we first show how the non-local electronic polarization generated by
the interaction with an ionic species can be accurately reproduced in
electrodes of arbitrary thickness. A finite-field extension of the method is
then introduced, which allows us to predict the charge transfer and the
electrostatic potential drop induced by the application of a homogeneous and
constant electric field. Finally, we demonstrate the capability of the method
to reproduce the charge-density response in a gold/electrolyte capacitor under
an applied voltage, predicting the system polarization with a greater accuracy
than state-of-the-art classical atomic-charge models.
