  It is a long-standing goal to generate robust deterministic states of light
with unique quantum properties, such as squeezing, sub-Poissonian statistics
and entanglement. It is of interest to consider whether such quantum states of
light could be generated by exploiting interactions with free electrons, going
beyond their already ubiquitous use in generating classical light. This
question is motivated by developments in electron microscopy, which present a
new platform for manipulating photons through their interaction with quantum
free electrons. Here, we explore the shaping of photon statistics using the
quantum interactions of free electrons with photons in optical cavities. We
find a variety of quantum states of light that can be generated by a judicious
choice of the input light and electron states. For example, we show how shaping
an electron into an energy comb can provide an implementation of a photon
displacement operation, allowing, for instance, the generation of displaced
Fock and displaced squeezed states. We also show how one can generate a desired
Fock state by repeated interactions of electrons with a cavity, followed by
measurements. We develop the underlying theory of the interaction of both a
single and many consecutive electrons with a common cavity mode. Looking
forward, by exploiting the degrees of freedom of arbitrary electron-photon
quantum states, we may achieve complete control over the statistics and
correlations of output photonic states, leading to the generation of novel
quantum states of light.
