## Main

Fully defining an attosecond pulse requires knowledge of its phase variation both temporally and spatially. Until now, temporal1,3,4,5,8,9 and spatial10,11,12 measurements are achieved only separately. As the temporal characterization methods (known as RABBIT; ref. 1 and CRAB; refs 3, 4, 5, 9, 13) rely on the photoelectric effect, they average over the spatial profile of a pulse, mixing the contribution from the different emitters of the extreme-ultraviolet (XUV) source at a secondary target. On the other hand, spatial measurements of XUV emission have been achieved using small apertures10,11 or two foci12. Although temporal information remains available in principle, neither method seems compatible with RABBIT or CRAB. Therefore, space–time measurements of attosecond pulses have never been made.

To solve the space–time problem, we turn to an in situ technique. The in situ method is a unique method of measurement that is feasible only for highly nonlinear processes14,15,16. It relies on the fact that adding a single photon to an already highly nonlinear process only weakly perturbs the process17,18. Yet, it can modify the spatial and spectral pattern of a beam. The in situ method has been considered in attosecond pulse metrology to determine only the temporal profile of the average attosecond pulse within attosecond pulse trains14. For that measurement, a weak second-harmonic beam co-propagates with the fundamental beam to break the symmetry between adjacent attosecond pulses, thereby allowing an even-order harmonic signal. Temporal information was encoded in the even-order harmonic signal as a function of the phase delay between the fundamental and second-harmonic laser pulses14.

For our spatially encoded in situ measurement, we produce XUV radiation using the fundamental laser pulse with a time-dependent polarization3 as illustrated in Fig. 1a and described in the Methods. We bring the weak perturbing beam into the medium at a small angle θp to gently modify the process of attosecond pulse generation in space as well as in time. This seemingly small change has a large impact. It perturbs the wavefront of the XUV radiation in the near-field (in the medium), which, in turn, modifies the far-field (at the detector) pattern as illustrated in Fig. 1a. As we delay the perturbing beam relative to the fundamental, we modulate the spatial dependence of the phase and therefore, the near- and far-field patterns. Our perturbing beam serves as a spatial gate. Measuring the far-field pattern as a function of delay τ shown in Fig. 1b allows us to reconstruct the amplitude and phase of the attosecond pulse in space and time in the region where it is produced and, therefore, everywhere in space.

Figure 2a,b shows experimental maps constructed from these two-dimensional (2D) images for the energy range of 46±0.8 eV and 79±0.8 eV. In these figure panels, each XUV component is isolated and plotted individually. The vertical axis is the spatial image of the XUV whereas the horizontal axis consists of 48 images placed side-by-side, each taken at a different time delay between the fundamental and the second-harmonic perturbing beam shown on the horizontal axis. Measuring the far-field distribution as a function of delay allows us to determine the amplitude and phase of XUV emission in the near-field.

To analyse the data and reconstruct the pulse, it is convenient to use the strong field approximation (SFA). This is the most intuitive way to treat high-harmonic and attosecond pulse generation19,20. In the SFA, the electron moves along quantum trajectories under the force of the laser field alone. The phase of the XUV emission is determined by the classical action and the XUV emission time. The perturbation to the quantum trajectories induced by the perturbing beam can be derived from the SFA (ref. 17). The phase modification is insensitive to the approximations in the SFA to first order14. In Supplementary Section S1, we arrive at the far-field intensity pattern for the XUV photon energy of ɛ under a 1D approximation as shown in equation (1):

In equation (1), |Eɛfar(θ,τ)|2 is the far-field pattern measured as a function of the propagation angle θ and the time delay τ. kɛ is the wavenumber of the XUV emission, c is the speed of the light and θp is the angle between the fundamental and the perturbation beam. Eɛnear is the complex spectral component of the unperturbed XUV as a function of the vertical position y in the near-field. The superscripts, s and l, are used to denote short and long quantum trajectories. The gate function, Gɛ(y) = $\left(1+{\alpha }_{\varepsilon }\right){\text{e}}^{i{\sigma }_{\varepsilon }}$, represents the first-order approximation of the amplitude (αɛ) and the phase (σɛ) modification due to the perturbing pulse.

For a given photon energy, the relation between the near- and far-field shown in equation (1) is expressed as a superposition of two 2D spectrograms for short and long trajectories. Reconstructing the spatial structure of an attosecond pulse is equivalent to solving the phase retrieval problem of the unperturbed harmonics (Eɛnear) and the modulation (Gɛ) for both quantum trajectories. If the XUV generation is dominated by a single quantum trajectory, equation (1) becomes a simple spectrogram, and it is the spatial equivalent to the spectrogram used in the frequency-resolved optical gating to reconstruct the spectral amplitude and phase of femtosecond laser pulses21,22,23. One can use the principal component generalized projection algorithm22 for the reconstruction as described in Supplementary Section S2.

To completely reconstruct the XUV radiation generated from both quantum trajectories, we used a parametric fitting procedure as described in Supplementary Section S3. Reconstruction results are shown for 46±0.8 eV and 79±0.8 eV in Fig. 2c,d. The procedure determines the functions Eɛnear(s,l) and Gɛ(s,l) by searching for optimum parameters that produce the observed far-field intensity distribution |Eɛfar(θ,τ)|2. We perform this reconstruction for all energies. Thus, the amplitude and the phase as a function of position at each XUV frequency are directly obtained for both quantum trajectories.

To obtain the temporal information, we recall that the perturbing field imposes a phase modulation14, σɛ(s) = Aɛ(s)sin[kpθp(yc τ/θp)+Φɛ(s)], on the XUV wavefront with a frequency-dependent amplitude Aɛ(s) and phase Φɛ(s), where kp is the wavenumber of the perturbation. The phase of the modulation, Φɛ(s), depends linearly on the XUV emission time (or group delay)14 that defines the relative spectral phase of the short-trajectory components at the centre of the beam. This connects the spectral and spatial phase. The difference in the phase Φɛ(s) can be directly seen from the modulation as shown in Fig. 2c,d. The phase difference of 1.1 radindicates that the emission times for 46±0.8 eV and 79±0.8 eV radiation differ by 360 as. In this manner, the amplitude and phase of the XUV emission are fully determined for both quantum trajectories in space and time.

Figure 2f clearly shows that the XUV emission is strongly modulated in the near-field (for reference, the unperturbed far-field pattern is shown in Fig. 2e). This modulation occurs because two major quantum paths—short and long trajectories—contribute to the atomic dipole. This quantum-path interference depends on the local intensity, producing the radial dependence of the modulation. In Fig. 2g, we compare the experimental result (data points) with SFA calculations (solid curves). The first destructive interference is observed at 77 eV for the XUV emission generated at the centre of the medium (I0(y = 0) = 3.5×1014 W cm−2). At 7 μm off-centre, we observe that the interference has the opposite phase (I0(y = 7 μm) = 3.2×1014 W cm−2). If all of this radiation is captured by a collection mirror and re-imaged for a streak camera measurement, it is the average of this structure that is measured by RABBIT or CRAB.

Figure 3a,b shows a spatio-temporal snapshot of an isolated attosecond pulse in the nonlinear medium. Figure 3a shows the electric field (colour) of the attosecond pulse as a function of time and position. Figure 3b highlights how the temporal profile changes by moving from the pulse centre (red) to y = 12 μm off-axis (blue). The temporal profile of the attosecond pulse is delayed as we move off-axis. This delay arises because of the intensity-dependent emission time τɛ of the short-trajectory components of the pulse. The emission time contours for the short trajectories at 46 (τ46 eV(s)) and 79 eV (τ79 eV(s)) are shown with dotted lines in Fig. 3a. In contrast, the long-trajectory components (τ79 eV(l)) shows the opposite direction of the delay.

The emission time of different frequency components of the attosecond pulses can be seen in the time–frequency plots in Fig. 3b, insets. The slope of the emission times measured in the experiment agrees with the slope of the emission times calculated by the saddle point approximation20 shown as circles in Fig. 3b, insets. The slope of the emission time (dτɛ(s)/dɛ), called the atto-chirp, is 8.5 as eV−1 and 11.3 as eV−1 for I0(y = 0) = 3.5×1014 W cm−2 and I0(y = 12 μm) = 2.6×1014 W cm−2, showing the intensity dependence of the atto-chirp (dτɛ/dɛ 1/I0λ; refs 4, 15, 24).

The XUV pulse observed at the far-field (Fig. 3c) is the coherent superposition of all emissions in the near-field. Time–frequency analysis (Fig. 3d, top inset) shows that the attosecond pulse on-axis in Fig. 3d is mainly composed of lower-energy XUV photons owing to their flat wavefront in the near-field (Supplementary Fig. S3). However, the attosecond pulse at 2.5 mrad off-axis in Fig. 3d is mainly composed of high-energy XUV photons of both the short- and long-trajectory components as shown in Fig. 3d, bottom inset.