  Recently, integrated photonic circuits have brought new capabilities to
electron microscopy and been used to demonstrate efficient electron phase
modulation and electron-photon correlations. Here, we quantitatively analyze
the feasibility of high fidelity and high purity quantum state heralding using
a free electron and a photonic integrated circuit with parametric coupling, and
propose schemes to shape useful electron and photonic states in different
application scenarios. Adopting a dissipative quantum electrodynamics
treatment, we formulate a framework for the coupling of free electrons to
waveguide spatial-temporal modes. To avoid multimode-coupling induced state
decoherence, we show that with proper waveguide design, the interaction can be
reduced to a single-mode coupling to a quasi-TM00 mode. In the single-mode
coupling limit, we go beyond the conventional state ladder treatment, and show
that the electron-photon energy correlations within the ladder subspace can
still lead to a fundamental purity and fidelity limit on complex optical and
electron state preparations through heralding schemes. We propose applications
that use this underlying correlation to their advantage, but also show that the
imposed limitations for general applications can be overcome by using photonic
integrated circuits with an experimentally feasible interaction length, showing
its promise as a platform for free-electron quantum optics.
