the pump of the optical rectification process [@Schneider2014] generating the THz pulses, resulting in a timing stability of better than 4 fs.

![image](fig4.jpg)

Rather than numerically solve Maxwell’s equations for a THz resonator, we include the influence of the compressor by a time dependent momentum transfer to the electron pulse. This is discussed in the Methods. The action of the compressor is shown in figure 4 as the number of electrons per pulse and the peak electric field are varied. The changing electron density shifts the spatial foci of lenses C1 and C2, so all pre-compressor optics are optimised for each pulse charge. As with earlier figures, the duration of the electron pulse is quantified as 2$\sigma$(t).

At a peak electric field of 10 MV/m as shown in figure 4(a), pulses of up to 100e can be compressed to a 2$\sigma$(t) duration less than 10 fs. A peak field of 5 MV/m is less experimentally demanding, and as is apparent from figure 4(a), electron pulses with a charge up to 20e can be compressed to a 2$\sigma$(t) less than 10 fs. As shown in figure 4(b), a decrease in the peak field to 2 MV/m causes a further increase in 