## 3 Results and Discussion
### Terawatt-Attosecond Hard X-ray Pulse Generation  
First, an electron beam with an energy of 10 GeV, a 200 pC bunch charge, an average current of 2.0 kA, 66 fs in length with a normalized emittance of 0.5 mm-mrad, and an un-correlated energy  
Figure 1: (Color online) Schematic layout for the terawatt (TW)-attosecond X-ray free electron laser (XFEL) [29], **(a)** ESASE section; **(b)** SASE undulator; **(c)** Chicane-mirror system; **(d)** single undulator module (UM4); **(e)** a small magnet chicane for e-beam delay followed by single undulator module (UM5); and **(f)** a small magnet chicane for e-beam delay. spread of 0.01% is generated using ELEGANT code [37] by taking into account the space-charge effects and the microbunching instabilities [38]. The popular ELEGANT code has been used to track the particle dynamics in six dimensional phase space coordinates. For the energy modulation of an electron beam (Figure 1a), an 800 nm, 30 fs, and 50 GW laser is used inside a two period modulator with a wiggler period of 50 cm; the density modulation is generated by a magnetic chicane with a time-of-flight parameter R\({}_{56}\) of \(\sim\)0.16 mm. The generated current distribution after these two processes is shown in Figure 3a: several current spikes with different magnitudes at an average background current of 2 kA. Figure 3b shows the corresponding plot in the longitudinal phase space after the energy and current modulation of a 10 GeV electron beam. Note that the current spikes are larger by a factor of approximately 8 compared to the background current. Note also that the window for the lasing section of the current profile can be controlled by the slotted foil system [27]. The red line in Figure 3a is the unspoiled section of the electron bunch, which is fed to UMs to generate an X-ray pulse at a photon energy of 12.4 keV. The nine current spikes in total are considered. These spikes radiate strongly in an undulator. Usually, the advantage of operating an FEL with a high peak current is the increase in X-ray output power. However, high current spikes also suffer from the energy spread, which is taken into account in this calculation. In Figure 3b, one can see that the increase in peak currents is accompanied by corresponding increases in the peak-peak energy modulation depth. Now, the electron beam is sent to UMs to generate an X-ray pulse at a 12.4 keV photon energy. For undulator radiation, simulations are performed using three-dimensional time-dependent FEL code GENESIS [39]. Note that, due to large energy modulation, high peak current spikes suffer from the energy chirp [40] due to short-range and long-range space-charge effects. Short range space-charge effects acting against microbunching have been included in the GENESIS code [39] but the long-range space-charge effect (or longitudinal debunching effect) is overlooked in the simulation code [39]. Here, it is worth acknowledging that according to [41], longitudinal debunching causes a reduction in the peak current of the current spikes during radiation amplification and the reduction is of the order of only a few percents, not significant for high-electron beam energies (i.e., >3 GeV). Figure 4a shows the temporal profile of the radiation pulse after the 3 rd UM. The first three UMs play a role in generating initial SASE radiation. Each UM is 5 m long with an undulator period of 2.6 cm (Figure 1b). The drift space between two UMs is long enough to accommodate the magnetic chicane used for the electron beam delay. After the first amplification stage, the optical delay is adjusted before the next UM to align the target pulse (i.e., the 9 th pulse in the radiation profile) with the tail current spike (i.e., the 1 st current spike in the current profile) (Figure 2c).