Diffractive imaging of a rotational wavepacket in nitrogen molecules with femtosecond megaelectronvolt electron pulses

Imaging changes in molecular geometries on their natural femtosecond timescale with sub-Angström spatial precision is one of the critical challenges in the chemical sciences, as the nuclear geometry changes determine the molecular reactivity. For photoexcited molecules, the nuclear dynamics determine the photoenergy conversion path and efficiency. Here we report a gas-phase electron diffraction experiment using megaelectronvolt (MeV) electrons, where we captured the rotational wavepacket dynamics of nonadiabatically laser-aligned nitrogen molecules. We achieved a combination of 100 fs root-mean-squared temporal resolution and sub-Angstrom (0.76 Å) spatial resolution that makes it possible to resolve the position of the nuclei within the molecule. In addition, the diffraction patterns reveal the angular distribution of the molecules, which changes from prolate (aligned) to oblate (anti-aligned) in 300 fs. Our results demonstrate a significant and promising step towards making atomically resolved movies of molecular reactions.

T he dynamical behaviour of molecules is governed by the complex interplay of a correlated system of nuclei and electrons which interact via Coulomb and exchange forces. Determining how the individual nuclei within a molecule move relative to one another during a molecular transformation represents a key step to understanding chemical reactivity. Developments in the field of femtochemistry enabled capturing the motion of nuclear wavepackets using purely spectroscopic measurements with femtosecond laser pulses [1][2][3][4][5][6][7][8] . For small molecules, structural information on the nuclear geometry can be indirectly inferred based on exact knowledge of spectral transitions involved in the probe process. For larger molecules, this inference becomes unfeasible. Diffraction techniques, which provide direct access to the position of each atom within a molecule, are a more effective approach. Over the last few decades, great strides have been taken to observe ultrafast dynamics with ultrashort X-ray pulses from synchrotrons and free electron lasers (FELs) [9][10][11][12] and via diffraction of short electron pulses [13][14][15][16] . With the advent of FELs, X-ray diffraction experiments have now reached a sub-100 fs temporal resolution. The spatial resolution is sufficient to observe larger-scale molecular processes like light-induced opening of a six-membered ring, but not to resolve individual atoms because of the limited wavelength available in FELs 12 . Laser-induced electron diffraction 17,18 and photoelectron holography 19 can also provide spatial and temporal resolution simultaneously, but require significant theoretical input to retrieve the interatomic distances. Ultrafast electron diffraction (UED) from gas-phase molecules has achieved sub-Angstrom spatial resolution but the temporal resolution has not been sufficient to observe molecular geometry changes on the femtosecond timescale 20,21 . Here we report a crucial advance in gas-phase UED using multi-MeV relativistic electron pulses to achieve a temporal resolution of 100 fs root-mean-squared (RMS), or 230 fs full-width at half-maximum (FWHM) that opens the door to observing the motion of individual nuclei that result from structural changes during photochemical reactions of isolated molecules.
The majority of UED experiments have been performed on solid-state samples 22,23 , which are ideal to understand collective effects in condensed media such as superconductivity, heat transport and magnetism. Gaseous molecules are ideal to study prototypical processes in chemistry. They also provide a direct link between experiments and quantum chemical calculations, which can be performed on the highest level for isolated molecules [23][24][25] . Early gas phase UED studies employed stroboscopic electron diffraction 26 . A breakthrough was achieved when picosecond electron beams became available in late 1980s (ref. 27). Zewail and co-workers were able to resolve non-equilibrium molecular structures 28 , transient molecular structures 15 and radiationless dark structures 16 using picosecond UED. However, in order to resolve molecular geometry changes in real time, a better temporal resolution is required. In the context of the crucial excited state photoisomerization reactions 24 , a 200-fs resolution is suitable for exploring the nuclear dynamics of the isolated azobenzene isomerization 29 . In addition, this temporal resolution is sufficient to explore photoprotection processes of nucleobases [30][31][32][33] .
To improve UED temporal resolution, two major effects must be overcome: space-charge repulsion between electrons 34 and velocity mismatch 35 resulting from the electron pulse lagging behind light pulses used for the molecular excitation. Both of these limitations can be minimized using relativistic MeV electrons [36][37][38][39][40][41][42][43][44][45] . The longitudinal space-charge pulse elongation is proportional to 1/b 2 g 5 , where b ¼ v/c, g ¼ (1 À b 2 ) À 1/2 is the Lorentz factor, and v and c are the speed of electrons and the speed of light in vacuum, respectively 46 . Concerning the velocity mismatch, electrons with 3.7 MeV kinetic energy travels at v ¼ 0.993c. This results in only 5 fs delay with respect to an optical pulse for a typical 200 mm interaction length.
Here we present the ultrafast laser-induced rotational dynamics of N 2 molecules in the gas phase. We impulsively excited a rotational wavepacket in a N 2 gas sample using a 35-fs FWHM laser pulse, spectrally centred at 800 nm, which interacts non-resonantly with the anisotropic molecular polarizability tensor. In the impulsive alignment regime, the alignment laser pulse duration is much shorter than the rotational period of the molecule, and the ensemble reaches its maximum degree of alignment after the interaction with the laser pulse. The phase evolution of the rotational wavepacket results in rotational revivals, with molecules alternating between aligned and antialigned directions 47,48 . Previous efforts to investigate rotational wavepackets with UED have captured dynamics on picosecond timescales 49,50 . The rotational dynamics of laser-aligned N 2 has been previously observed with optical birefringence 51 , strong field ionization 52 , high harmonic generation 53,54 and Auger electron spectroscopy 55 . We have observed the temporal evolution of the full wavepacket revival with an 8.35 ps period by quantifying the anisotropy in the diffraction patterns. The temporal resolution was determined by a fitting routine using the measured dynamics. Furthermore, we have retrieved molecular images of the aligned and anti-aligned molecular ensemble with atomic resolution.

Results
Experimental layout and static diffraction. The experimental layout is shown in Fig. 1. The electron pulse (blue) is diffracted from the nitrogen gas jet (grey), which is introduced into the vacuum chamber using a pulsed nozzle (black). The diffraction pattern is captured by a phosphor screen and a detector. The 800-nm alignment laser pulse (red) is directed to the target and removed from the vacuum chamber by two holey mirrors at a 45°a ngle to the electron beam. The full setup is discussed in detail elsewhere 56 . The electron and the laser beam have a small angle of B5°. This makes the velocity of the laser 0.996c along the electron beam direction, very close to 0.993c, the velocity of   3.7-MeV pulsed electron beam (blue) is directed towards a nitrogen gas jet (grey). The gas jet is introduced into the vacuum chamber using a pulsed nozzle (black). The pump laser pulse (red) is deflected by two ring-shaped mirrors. The laser propagates at a small angle (B5°) with respect to the electron beam as it traverses the target, and is then deflected away from the detector by the second mirror. The electron diffraction pattern is recorded with a phosphor screen located 3.1 m downstream from the interaction region. The unscattered electron beam is transmitted through a hole in the phosphor screen. the electron beam. Therefore, the velocity mismatch is nearly eliminated. More details of the experiment can be found in the Experimental Setup section in the Methods.
The diffraction pattern is commonly expressed as a function of the momentum transfer where l is the wavelength of the electron beam and y is the angle between the scattered and transmitted electrons. For a 3.7-MeV electron beam, l ¼ 0.30 pm. The total scattering intensity I tot is the sum of the atomic scattering intensity I at and the molecular scattering intensity I mol . I at is defined as where N is the number of atoms in the molecule and f i is the elastic scattering amplitude for the ith atom. For MeV electrons, f i can be calculated using the ELSEPA program 57 . The structural information of the molecule is encoded in the molecular scattering intensity, I mol , given by where Z i is the scattering phase of the ith atom and r ij is the distance between the ith and the jth atoms 20 .
The so-called modified diffraction intensity is defined as The spatial resolution, d, is determined by the maximum measured s value s max using the formula In Fig. 2a, the red curve shows an azimuthally averaged raw pattern after subtraction with a dark background pattern that is taken with the electron beam turned off. The azimuthal average of the subtracted background pattern is shown in the green curve in Fig. 2a, and the black dashed curve shows the experimental scattering background, determined using a standard fitting procedure 20 . This fitted background includes the atomic scattering I at , scattering from background gas and other types of background scatterings. The details of the bond length determination are explained in the Bond Length Determination from Static Pattern section in the Methods. Figure 2b shows the azimuthally averaged experimental and theoretical modified diffraction intensity for static diffraction pattern. The bond length was determined to be 1.073 ± 0.027 Å, in agreement with the previously measured N 2 bond length of 1.098 Å (ref. 58). The 2.5% measurement uncertainty is due to the uncertainty in the calibration of the sample-to-detector distance and electron energy, as explained in the Experimental Setup section in the Methods. It should be noted that for time-resolved experiments usually the ground-state structure is known, in which case the static diffraction patterns can be used as a calibration. We show later that the interatomic distance can be determined very accurately from diffraction of transiently aligned molecules if the static diffraction is used as a calibration. In this experiment, scattering signal is available in the region between 3.5 and 12 Å À 1 . The fitting procedure relies on the zeros of sM(s) and this reduces the available data in Fig. 2 to s44.5 Å À 1 . The measurement agrees well with the simulation up to sB12 Å À 1 .
Temporal evolution of N 2 alignment. For impulsive alignment, the full rotational revival is expected at t ¼ 1/2cB, where B is the rotational constant and c is the speed of light in vacuum. For N 2 molecules, the full revival is at 8.35 ps (B ¼ 1.998 cm À 1 ). The rapid evolution of the angular distribution can be used to determine the temporal resolution of the measurement technique. Diffraction patterns from a molecular ensemble aligned with a polarization in the detector plane are not circularly symmetric, contrary to the static case in equation (3). The anisotropy, a(t), in a diffraction pattern can be used to trace the temporal evolution of alignment 49 . In addition, a(t) is a self-normalized parameter that is extracted directly from the diffraction patterns (see Data Processing of Diffraction Patterns and Anisotropy in the Methods). Figure 3 shows the temporal evolution of the simulated and experimentally measured a(t) values. The experimental data are recorded with 100 fs steps in the delay between laser and electron pulses, and at each point data are collected for 2 min (14,400 shots at a repetition rate of 120 Hz). The simulation is composed of two parts: an impulsive alignment simulation that calculates the angular distribution at different delay times 59 , followed by a diffraction pattern simulation based on the modelled angular distribution 60 . The anisotropy of the simulated patterns is calculated using the same method as for the experimental patterns. The details of the Before the excitation, the ensemble is described by a Boltzmann distribution of rotational states taking into account the exact nuclear statistics. Initially, the angular distribution is isotropic. For the initial rotational temperature of our sample of 54 K, all values of J up to 10 are considerably populated before excitation. The laser pulse interacts with the polarizability tensor of the molecules, which is highest along the internuclear axis. Classically, it induces a dipole that minimizes its energy by aligning the molecular axis parallel to the laser field. Quantum mechanically, the laser induces transitions of DJ ¼ 0, ± 2 and DM ¼ 0. After excitation, the maximum value of J is about 14. The phase of each rotational state evolves with time. When the rotational states are in phase, the angular distribution becomes aligned or anti-aligned with respect to the laser polarization axis.
The temporal evolution of the alignment has a rich structure that varies on a fast timescale. For example, at the half-revival (delay of 4 ps), the distribution changes from aligned to antialigned in 300 fs. The alignment peak corresponds to a prolate angular distribution, with the long axis along the direction of the laser polarization. The angular distribution during anti-alignment is oblate, with the molecules preferentially lying in a plane perpendicular to the laser polarization. The full revival at around 8 ps shows a similarly fast transition from oblate to prolate distribution. In between the revivals, the anisotropy of the diffraction pattern captures additional dynamics.
We have used the fast-changing distribution to characterize the temporal resolution of the measurement. The shape of the aligned molecular ensemble is determined by the initial temperature of the molecules and the fluence of the alignment laser pulse 61 . In this experiment, the laser fluence was measured to be 2.0 J cm À 2 and the initial temperature was estimated to be 65 K, using a supersonic expansion model 62 . At these parameters, the wavepacket revivals are relatively sharp compared with the temporal resolution. The limited temporal resolution effectively blurs out the rotational dynamics and has a significant effect on the observed structure. We performed first a two-parameter w 2 fitting by fixing the laser fluence and initial rotational temperature to the measured and calculated values, and then a full four-parameter fit where all parameters were allowed to vary.
The two-parameter fit, varying only the temporal resolution and a re-scaling factor that accounts for the spatial overlap between laser and electron pulse, returned a temporal resolution of 85 fs RMS (200 fs FWHM). The four-parameter fit, which varies temporal resolution in addition to initial rotational temperature, laser fluence and the re-scaling factor, accounts for uncertainties in the laser fluence, initial temperature and the fraction of molecules excited by the laser. In the simulation, we assume that all excited molecules are exposed to the same laser intensity. This method achieved a best fit resolution of 100 fs RMS (230 fs FWHM), with an initial temperature of 54 K and a laser fluence of 1.8 J cm À 2 , which are comparable to our initial estimates for the twoparameter fit. The re-scaling factor was 0.42, meaning that the best match to the experimental data is when the simulation assumes that 42% of the molecules in the diffraction volume are excited by the laser. The simulation shown in Fig. 3 shows the best fit for all four parameters. The left axis in the figure shows the anisotropy in the diffraction pattern, and the axis on the right shows the degree of alignment quantified by the ocos 2 a4 value from simulation, where a is the angle between the molecular axis and the laser polarization direction. The reduced w 2 error in the four-parameter fit versus the RMS temporal resolution is shown as an inset in Fig. 3. We obtained a 0.96 reduced w 2 , indicating a good fit. More details of the fitting are explained in the Temporal Evolution Fitting section in the Methods.
The 100-fs (RMS) overall temporal resolution of this experiment is consistent with our expectations, based on the performance study of this machine 56 . A simulation showed that the electron bunch length was 70 fs RMS at the interaction region. Measurements of the phase and amplitude stability of the radiofrequency (RF) gun lead to an expected time of arrival jitter of 50 fs RMS 56 . The calculated overall temporal resolution was then 87 fs RMS, or 205 fs FWHM, which is close to the measured value.
Molecular images with different angular distribution. High-resolution molecular diffraction images were retrieved for prolate and oblate ensembles at the half revival. Diffraction patterns with adequate signal-to-noise ratio were recorded with 60 and 90 min of integration time for oblate and prolate distributions, respectively. We use diffraction-difference patterns to remove the experimental background and the diffraction signal from unexcited molecules. The diffraction intensity difference is given by DI(t) ¼ I(t) À I(t ¼ À 5 ps), where t ¼ 0 corresponds to the maximum of the first alignment peak after laser. Before t ¼ À 0.4 ps when the pump laser arrives, the angular distribution is isotropic. In the two-dimensional (2D) diffraction patterns, the s max ¼ 8.3 Å À 1 , corresponding to a spatial resolution of 0.76 Å. This makes it possible to observe molecular structures with resolution better than the shortest possible bond lengths. Figure 4 shows the experimental (left panels) and simulated (right panels) 2D diffraction patterns and their corresponding Fourier transforms for prolate and oblate distribution at the half revival. Figure 4a,b shows the experimental and simulated diffraction-difference patterns DI for the prolate distribution. The diffraction pattern was captured at a time delay of 3.8 ps after the first alignment peak (Fig. 3a). The diffraction-difference pattern is anisotropic as a result of molecular alignment. The experimental pattern shows excellent agreement with the simulation for a range of s ¼ 3.5-8.3 Å À 1 . Figure 4c,d shows the Fourier transforms of the difference signals in Fig. 4a,b, respectively. The Fourier transform of the diffraction pattern displays the autocorrelation of the molecular structure, convolved with the angular distribution and projected onto the detector plane. The centre of the Fourier transforms goes to zero because they are generated from the difference of two diffraction patterns. For a diatomic molecule, the autocorrelation is directly related to the molecular image. For more complex molecules, an image of the structure can be reconstructed using phase retrieval algorithms 60 . In the autocorrelation functions depicted in Fig. 4c,d, the positive regions indicate an increase in population, and the negative regions indicate a decrease. Specifically, Fig. 4c,d indicates that the population of molecules that are lying perpendicular to the laser polarization has decreased, whereas the population parallel to the polarization (vertical in Fig. 4) has increased, that is, more molecules are aligned along the vertical direction. Similarly, Fig. 4e,f shows the measured and simulated diffraction pattern for the oblate distribution at half revival, corresponding to a time delay of 4.1 ps. Figure 4g,h are the Fourier transforms of Fig. 4e,f, which show that the molecular ensemble is aligned in the horizontal plane.
Bond length measurement from diffraction patterns. We have used a fitting method to extract the N 2 bond length from diffraction patterns of aligned and anti-aligned molecules, using the static diffraction pattern as a calibration. The details of the fitting are given in the section Bond Length Fitting from Aligned Patterns in the Methods. The extracted bond length is 1.091±0.036 Å for the prolate distribution and 1.096±0.056 Å for the oblate distribution, in good agreement with 1.098 Å, the bond length of the ground-state N 2 . The small uncertainties indicate that changes in interatomic distances could be measured very accurately with this method. The precision of determining the bond length, 0.036 and 0.056 Å, should not be confused with the 0.76 Å spatial resolution. The spatial resolution gives the capability to distinguish two bond lengths that are very close to each other, whereas the precision gives how accurate a single bond length can be determined. In real space, the resolution is determined by the width of the peak, whereas the precision is determined by how accurate one can find the centre of the peak. Generally, for well-separated peaks, the centre can be determined to much higher accuracy than its width.
Spatial resolution of the molecular images. The spatial resolution of the 2D diffraction patterns shown in Fig. 4 can be determined in two different ways. First we can use equation (6), with s max ¼ 8.3 Å À 1 we get the spatial resolution d ¼ 0.76 Å. We can also determine spatial resolution directly from the autocorrelation images (Fig. 4c,g). For example, in Fig. 4c, the spatial resolution can be determined by converting the image into polar coordinates o(r, y'), then using a Gaussian function to fit to along the r dimension. The FWHM of the Gaussian fit was 0.76 Å using this method, consistent with the spatial resolution obtained using equation (5) and s max ¼ 8.3 Å À 1 .

Angular distribution based on 2D images of aligned molecules.
The angular distribution of the molecules can be extracted from the patterns in Fig. 4c,g. The resulting distributions for prolate and oblate molecular ensembles are shown in Fig. 5a,b, respectively (see Angular Distribution section in the Methods). The prolate distribution peaks at a ¼ 0 and 180°, in the direction of the laser polarization. The oblate distribution peaks at a ¼ 90°, in the direction perpendicular to the laser polarization. The degree of alignment is commonly measured by the quantity where f(a) is the angular distribution and a is the angle between the molecular axis and the laser polarization. A value of the alignment parameter ocos 2 a4 ¼ 1 corresponds to perfect alignment, whereas random orientation gives ocos 2 a4 ¼ 1/3. Any value between 1/3 and 1 indicates alignment, whereas any value below 1/3 indicates anti-alignment. In Fig. 5, three curves are displayed: f(a) extracted from data (red), f(a) obtained from simulation using the fluence and temperature extracted from the fitting routine (black), and the simulation results convolved with the 100 fs RMS temporal resolution (blue). The temporal resolution is included by convolving a Gaussian pulse with the simulated temporal evolution of the angular distribution, and it has a significant effect because the distribution changes from prolate to oblate in 300 fs. The extracted angular distributions are in good agreement with the simulation for both prolate and oblate distributions, after taking into account the effect of the temporal resolution. The measured angular distribution can also be used to provide additional confirmation of the temporal resolution. Using the laser parameters and the initial temperature as determined by the fitting from the data in Fig. 3, we ran an optimization to find the temporal convolution that results in a best fit between the measured and simulated angular distributions. From this, we obtain a resolution of 107 fs RMS for the prolate angular distribution and 102 fs RMS for the oblate distribution, in good agreement with the value of 100 fs RMS obtained before.

Discussion
In summary, we have shown that MeV UED can simultaneously reach a temporal resolution of 100 fs RMS and spatial resolution of 0.76 Å, which allows us to characterize the ultrafast evolution of a rotational wavepacket in N 2 , measuring the angular distribution and the acquired molecular images with atomic resolution.
This achievement opens the door to a new class of experiments where changes in molecular geometry during a chemical reaction can be followed in space and time. The current results demonstrate not only excellent temporal resolution, but also that sufficient signal-to-noise ratio for sub-Angstrom spatial resolution can be acquired with MeV electrons. Previous picosecond UED experiments with similar spatial resolution have successfully retrieved the structure of transient states 15 . Nitrogen has a low atomic number, Z, and therefore a low scattering cross-section, so we expect that the method will be successful for observing molecular dynamics in a large class of molecules. RF-compressed electron pulses 63,64 and compact UED guns [65][66][67] have achieved similar temporal resolution in condensed matter experiments, but have not yet been successfully applied to gas-phase experiments. For future developments, a number of upgrades can potentially improve both spatial and temporal resolution significantly. For example, a RF compression cavity could be used to compress the electron beam longitudinally 68 , which can potentially lead to a temporal resolution on the order of 10 fs together with orders-of-magnitude increase in charge per pulse. Time jitter and drift could be addressed by time-stamping techniques similar to those developed for X-Ray free electron lasers (XFELs) 69 . Spatial resolution is limited by the signal-tonoise ratio (SNR) in the scattering at larger angles, so RF compression would also improve the spatial resolution by increasing the number of electrons per pulse. Complementary metal-oxide semiconductor (CMOS) active pixel sensor could potentially achieve single electron, single shot detection and thus eliminate detector noise 70 , which would also improve the SNR.

Methods
Experimental setup. The electron gun used in this experiment is a replica of the photo-injector used at the LCLS facility at SLAC National Accelerator Laboratory. A 15 fC per pulse charge is generated at the photocathode and 6 fC per pulse is delivered on target. A 50-nm-thick Si 3 N 4 membrane is used to separate the sample chamber and preserve the high vacuum in the electron gun. Roughly 60% of the charge is lost after the Si 3 N 4 membrane and a 200-mm diameter collimator. The electron beam and pump laser are generated with a repetition rate of 120 Hz.
The N 2 gas is delivered into the chamber through a pulsed valve at a 120-Hz repetition rate. The backing pressure is 0.7 bar, and the nozzle orifice is 100 mm in diameter. During operation, the chamber pressure is B6 Â 10 À 5 torr. The interaction region is roughly 350 mm away from the nozzle exit. The width of the laser beam, the electron beam and the gas jet are all around 200 mm FWHM at the interaction region. The sample-to-detector distance is calibrated with diffraction from a single crystal gold sample. There is a ±2.5% uncertainty in the distance calibration, due to the quality of the gold sample and quality of the electron beam after the Si 3 N 4 membrane. The Si 3 N 4 window has a strong diffraction and makes the emittance of the beam much worse. The electrons scattered inelastically from Si 3 N 4 also diffract from the gold sample, making the Bragg spots larger. Spatial alignment of the gas jet, the electron beam and the pump laser is obtained by positioning the focus of the laser approximately underneath the tip of the nozzle, and maximizing for the electron beam deflection by the plasma. Time zero can then be found, to within B200 fs, by adjusting the delay between the pump and the probe beams and observing plasma deflection effects on the unscattered beam 20 . The laser focus is adjusted to 50 mm FWHM spot size for plasma lensing, giving a peak intensity of 8 Â 10 14 W cm À 2 . For the alignment experiments, the lens is driven 4 mm out of the focus to reach a spot size of 200 mm in the interaction region. The peak intensity for the experiment is 5 Â 10 13 W cm À 2 ; only very faint plasma is observed in the interaction region for this intensity.
The detector comprises a phosphor screen, a ring-shaped mirror at a 45°angle to the beam, an f/0.85 lens and an electron multiply charge-coupled device. A 4-mm diameter hole is drilled in the centre of the phosphor screen to allow the unscattered electron beam to pass through. Data in the region so3.5 Å À 1 are not captured due to the hole in the phosphor screen. This can be improved by replacing the phosphor screen by a similar one with a smaller hole. We have seen that by replacing the phosphor screen the missing region can be reduced to 1.6 Å À 1 .
The beam divergence s is 28 mrad RMS. Using the definition l/2ps, we get a transverse coherence length of 1.7 nm.
Bond length determination from static pattern. The following steps are used to determine the bond length from the static N 2 diffraction pattern 20 . (i)Starting from an initial guess of the bond length the modified diffraction intensity sM is calculated. (ii) A series of zero points is determined from the simulated sM. Data processing of diffraction patterns and anisotropy. The experimental pattern is symmetrized over four quadrants, and the central region (so3.5 Å À 1 ) is extrapolated from existing data by letting the pattern smoothly go to zero towards the centre.
The diffraction pattern of the prolate distribution is integrated over 90 min, and that of the oblate distribution is integrated over 60 min. The anisotropy is calculated by dividing the total counts in a horizontal cone by the total counts in a vertical cone for each diffraction pattern. The region used for this calculation is between s ¼ 3 Å À 1 and s ¼ 4.5 Å À 1 . The horizontal cone has a half angle of 35°a nd the vertical cone has a half angle of 55°.
Alignment simulation. The simulation of impulsive alignment is calculated using a linear rigid rotor interacting with a non-resonant pulse described by the time-dependent Schrodinger equation 59 . The temporal resolution is implemented by a convolution with a Gaussian function in time.
Diffraction pattern simulation. The simulations of diffraction patterns of a given angular distribution are calculated using an incoherent weighted sum of diffraction patterns from single molecules with different orientations. In the simulations, the atoms are assumed to be stationary at their equilibrium positions without vibrations 60 .
Temporal evolution fitting. The temporal evolution fitting shown in Fig. 3a is obtained by a w 2 fitting of the simulation and data. The simulated anisotropy is obtained by an alignment simulation that gives angular distribution as a function of time, followed by a diffraction simulation according to the angular distribution. The anisotropy is calculated using the same method as for data, and the temporal resolution is obtained by a convolution of the calculated anisotropy with a Gaussian beam in time. The reduced w 2 error, plotted in the Fig. 3 inset, is defined as w 2 red ¼ 1 w P ðO À EÞ 2 s 2 , where w is the number of degrees of freedom, O and E are the data and the best fit, s is the s.e., respectively. Here s is calculated using the standard deviation of 13 patterns before t ¼ 0.
Bond length fitting from aligned patterns. The optimal bond length is found by comparing the experimental diffraction pattern with many simulated patterns with different bond lengths using the least-square error. For the experimental patterns, a vertical cone with a half opening angle of 30°is selected, and this part is averaged radially to generate a one-dimensional curve. For the simulated patterns, diffraction patterns with different bond lengths and the same angular distribution are simulated, and the same region is selected to generate the one-dimensional curve. The prolate/ oblate angular distributions are obtained by the fitting in Fig. 3. To get statistics, ten independent data set (6 min data in each set) were used in the fits separately, and the mean and standard deviation of the ten fitting results are taken as the final result and the standard error. In this fitting, we use the static pattern (shown in Fig. 2) as a calibration of the sample-detector distance and electron beam energy. Angular distribution. The angular distribution in Fig. 5a,b are extracted from Fig. 4c,g, respectively. The procedure includes three steps: (i) extracting the NATURE COMMUNICATIONS | DOI: 10.1038/ncomms11232 ARTICLE difference angular distribution from the 2D difference pattern, (ii) adding a baseline that accounts for the angular distribution of the reference pattern to the difference in angular distribution and (iii) normalizing the angular distribution.
Step i is implemented by first converting Fig. 4c,g to polar coordinates, then integrating over the radial coordinate within the FWHM of the peak. In step ii, the baseline is simulated using equations (2) and (3), corrected by the rescaling parameter that accounts for the spatial overlap between laser and electrons (0.42, obtained from the fitting for Fig. 3). In step iii, the normalization used is R p 0 f a ð Þ Á sina Á da ¼ 1.