  Recent advancements in abilities to create and manipulate the electron's
transverse wave function within the transmission electron microscope (TEM) and
scanning TEM (STEM) have enabled vectorially-resolved electron energy loss
(EEL) and gain (EEG) measurements of nanoscale and quantum material responses
using pre- and post-selected free electron states. This newfound capability is
prompting renewed theoretical interest in quantum mechanical treatments of
inelastic electron scattering observables and the information they contain.
Here, we present a quantum mechanical treatment of the inelastic scattering of
free electrons between pre- and post-selected transverse states with
fully-retarded electron-sample interactions for both spontaneous EEL and
continuous-wave laser-stimulated EEG measurements. General expressions for the
state-resolved energy loss and gain rates are recast in forms amenable to
numerical calculation using the method of coupled dipoles. We numerically
implement our theory within the $e$-DDA code, and use it to investigate
specific examples that highlight its versatility regarding the number, size,
geometry, and material composition of the target specimen, as well as its
ability to describe matter-wave diffraction from finite nanoscopic targets.
