## 3 Results and Discussion  
In Figure 2 the optimization has been obtained by filtering the harmonics in a spectral region centered at 36 eV and considering a bandwidth of 30 eV, using a single loop iteration. The XUV\({}_{1}\) pulse resulting from the first gas target is combined with the IR intense pulse and sent to the second interaction region by scanning its intensity from \(\alpha=10^{6}\) to \(\alpha=10^{7}\), in steps of \(\Delta\alpha=10^{6}\), where \(\alpha\) is an attenuation coefficient that has been defined with respect to the peak intensity of the IR pulse as \(I_{XUV}=I_{IR}/\alpha\), with \(I_{XUV}\) and \(I_{IR}\) being the peak intensities of the XUV and the IR pulses, respectively. The position at which the XUV\({}_{1}\) pulse is combined with the IR pulse has been scanned from \(\theta=-720^{\circ}\) to \(\theta=720^{\circ}\), in steps of \(\Delta\theta=2^{\circ}\), where \(\theta\) is the angular location defined with respect to the IR cycle. From Figure 2a, we can observe that the obtained optimal spectral amplitude (red dotted line) is substantially enhanced  
Figure 1: (Color online) Schematic illustration of the numerical experiment. An intense IR laser pulse interacts with a first gas target—helium in this case. The output is filtered in a particular spectral region—and occasionally split in several pulses, in order to modify the XUV intensity, which is achieved by using variable light attenuators \(A_{i}\). The attenuated XUV\({}_{i}\) pulses are combined with the original IR pulse with a given delay provided by variable delay lines \(D_{i}\). The combination of the IR+XUV\({}_{i}\) pulses generates harmonics in a second gas target. The output from the second interaction region is analyzed by a spectrum analyzer for optimization of the spectral amplitude in an iterative loop procedure managed by a computer. with respect to the original spectrum (black line), although the optimal XUV\({}_{1}\) pulse corresponds to an attenuation parameter as high as \(\alpha=10^{7}\). As commented above, the fitness function considered for the spectral amplitude control is the normalized \(\chi^{2}\) function obtained from a linear regression of the spectral amplitude versus photon energy in the second interaction region. The normalized \(\chi^{2}\) parameter is minimized by the numerical algorithm in order to find the values of the attenuation \(\alpha\) and delay \(\theta\) fitness parameters that produce a spectral amplitude shape the closest to a straight-line. The present results demonstrate that the fitness function \(\chi^{2}\) is indeed extremely efficient to achieve optimal isolated attosecond pulses by spectral amplitude shaping. As it can be observed from Figure 2c,d, the energy from the original HHG process is strongly compressed in time by the effect of the optimization process, which results in an almost single attosecond pulse, as shown in Figure 2d. **Figure 2.** (Color online) Optimization of the HHG spectral region 21-51 eV obtained by considering a single feedback loop. The scan in \(\theta\) is from \(\theta=-720^{\circ}\) to \(\theta=720^{\circ}\), and \(\alpha\) is scanned from \(\alpha=10^{6}\) to \(\alpha=10^{7}\). The value of the normalized \(\chi^{2}\) function is 0.9998 for the original spectrum and 0.8929 for the optimized one. In (**a**) the spectral intensity of the original and optimized spectra are shown, as indicated. The IR driving pulse together with the optimal XUV\({}_{1}\) pulse are shown in (**b**). The amplitude of the IR pulse is normalized, and the one corresponding to the XUV\({}_{1}\) pulse has been rescaled to allow its visualization. In this case the optimal values of the fitness parameters are \(\alpha=10^{7}\) and \(\theta=718^{\circ}\). (**c**) and (**d**) show the temporal evolution of the intensities of the XUV pulses resulting from the second interaction region, before and after optimization, respectively, which are centered at a photon energy of 36 eV. The inset in (**d**) shows the spectral phase for the original and optimized spectra.