  Spatial modulation of electron beams is an essential tool for various
applications such as nanolithography and imaging, yet its implementations are
severely limited and inherently non-tunable. Conversely, light-driven electron
spatial modulation could potentially allow arbitrary electron wavefront shaping
via the underlying mechanism of photon-induced near-field electron microscopy
(PINEM). Here, we present tunable photon-induced spatial modulation of
electrons through their externally-controlled interaction with surface plasmon
polaritons (SPPs). Using recently developed methods of shaping SPP patterns, we
demonstrate a dynamic control of the electron beam with a variety of
high-quality electron distributions. Intriguingly, by utilizing the intrinsic
interaction nonlinearity, we attain the first observation of 2D spatial Rabi
oscillations and generate electron features below the SPP wavelength. Our work
paves the way to on-demand electron wavefront shaping at ultrafast timescales,
with prospects for aberration correction, nano-fabrication and material
characterization.
