Abstract
Capturing the structural changes that molecules undergo during chemical reactions in real space and time is a long-standing dream and an essential prerequisite for understanding and ultimately controlling femtochemistry. A key approach to tackle this challenging task is Coulomb explosion imaging, which has benefited decisively from recently emerging high-repetition-rate X-ray free-electron laser sources. With this technique, information on the molecular structure is inferred from the momentum distributions of the ions produced by the rapid Coulomb explosion of molecules. Retrieving molecular structures from these distributions poses a highly nonlinear inverse problem that remains unsolved for molecules consisting of more than a few atoms. Here, we address this challenge using a diffusion-based Transformer neural network. We show that the network reconstructs unknown molecular geometries from ion-momentum distributions with a mean absolute error below one Bohr radius, which is half the length of a typical chemical bond.
Similar content being viewed by others
Data availability
The datasets and model weights used in this study have been deposited in the Zenodo database under accession code 1579447053. The raw data recorded for the water, tetrafluoromethane, and ethanol experiments at the European XFEL are available at https://doi.org/10.22003/XFEL.EU-DATA-002150-00, https://doi.org/10.22003/XFEL.EU-DATA-002181-00, and https://doi.org/10.22003/XFEL.EU-DATA-002926-00, respectively. Source data are provided with this paper.
Code availability
The source code is publicly available at https://github.com/xli025/molexa54.
References
Zewail, A. H. Femtochemistry: Atomic-Scale Dynamics of the Chemical Bond. J. Phys. Chem. A 104, 5660–5694 (2000).
Egerton, R. F. Physical Principles of Electron Microscopy. Vol. 56, (Springer US, New York, NY, 2005).
Centurion, M., Wolf, T. J. A. & Yang, J. Ultrafast Imaging of Molecules with Electron Diffraction. Annu. Rev. Phys. Chem. 73, 21–42 (2022).
Odate, A., Kirrander, A., Weber, P. M. & Minitti, M. P. Brighter, faster, stronger: ultrafast scattering of free molecules. Adv. Phys. X 8, 2126796 (2023).
Vager, Z., Naaman, R. & Kanter, E. P. Coulomb Explosion Imaging of Small Molecules. Science 244, 426–431 (1989).
Levin, J. et al. Study of Unimolecular Reactions by Coulomb Explosion Imaging: The Nondecaying Vinylidene. Phys. Rev. Lett. 81, 3347 (1998).
Herwig, P. et al. Imaging the Absolute Configuration of a Chiral Epoxide in the Gas Phase. Science 342, 1084–1086 (2013).
Stapelfeldt, H., Constant, E., Sakai, H. & Corkum, P. B. Time-resolved Coulomb explosion imaging: A method to measure structure and dynamics of molecular nuclear wave packets. Phys. Rev. A 58, 426 (1998).
Ergler, T. et al. Spatiotemporal Imaging of Ultrafast Molecular Motion: Collapse and Revival of the \({{{{{\rm{D}}}}}_{2}}^{+}\) Nuclear Wave Packet. Phys. Rev. Lett. 97, 193001 (2006).
Hishikawa, A., Matsuda, A., Fushitani, M. & Takahashi, E. J. Visualizing Recurrently Migrating Hydrogen in Acetylene Dication by Intense Ultrashort Laser Pulses. Phys. Rev. Lett. 99, 258302 (2007).
Jiang, Y. H. et al. Ultrafast Extreme Ultraviolet Induced Isomerization of Acetylene Cations. Phys. Rev. Lett. 105, 263002 (2010).
Hansen, J. L. et al. Control and femtosecond time-resolved imaging of torsion in a chiral molecule. J. Chem. Phys. 136, 204310 (2012).
Ibrahim, H. et al. Tabletop imaging of structural evolutions in chemical reactions demonstrated for the acetylene cation. Nat. Commun. 5, 4422 (2014).
Liekhus-Schmaltz, C. E. et al. Ultrafast isomerization initiated by X-ray core ionization. Nat. Commun. 6, 8199 (2015).
Endo, T. et al. Capturing roaming molecular fragments in real time. Science 370, 1072–1077 (2020).
Jahnke, T. et al. Inner-Shell-Ionization-Induced Femtosecond Structural Dynamics of Water Molecules Imaged at an X-Ray Free-Electron Laser. Phys. Rev. X 11, 041044 (2021).
Jahnke, T. et al. Direct observation of ultrafast symmetry reduction during internal conversion of 2-thiouracil using Coulomb explosion imaging. Nat. Commun. 16, 2074 (2025).
Li, X. et al. Imaging a light-induced molecular elimination reaction with an X-ray free-electron laser. Nat. Commun. 16, 7006 (2025).
Pitzer, M. et al. Direct Determination of Absolute Molecular Stereochemistry in Gas Phase by Coulomb Explosion Imaging. Science 341, 1096–1100 (2013).
Pitzer, M. et al. Absolute Configuration from Different Multifragmentation Pathways in Light-Induced Coulomb Explosion Imaging. ChemPhysChem 17, 2465–2472 (2016).
Boll, R. et al. X-ray multiphoton-induced Coulomb explosion images complex single molecules. Nat. Phys. 18, 423–428 (2022).
Li, X. et al. Coulomb explosion imaging of small polyatomic molecules with ultrashort x-ray pulses. Phys. Rev. Res. 4, 013029 (2022).
Richard, B. et al. Imaging collective quantum fluctuations of the structure of a complex molecule. Science 389, 650–654 (2025).
Green, A. E. et al. Visualizing the Three-Dimensional Arrangement of Hydrogen Atoms in Organic Molecules by Coulomb Explosion Imaging. J. Am. Chem. Soc. 147, 37133–37143 (2025).
Ongie, G. et al. Deep Learning Techniques for Inverse Problems in Imaging. JSAIT 1, 39–56 (2020).
Zhao, Z., Ye, J. C. & Bresler, Y. Generative Models for Inverse Imaging Problems: From mathematical foundations to physics-driven applications. IEEE Signal Process. Mag. 40, 148–163 (2023).
Légaré, F. et al. in Ultrafast Phenomena XIV (eds. Kobayashi, T., Okada, T., Kobayashi, T., Nelson, K. A. & De Silvestri, S.) 888–890 (Springer Berlin Heidelberg, Berlin, Heidelberg, 2005).
Kunitski, M. et al. Observation of the Efimov state of the helium trimer. Science 348, 551–555 (2015).
Vaswani, A. et al. Attention Is All You Need. Adv. Neural Inf. Process. Syst. 5998–6008 (2017).
Sohl-Dickstein, J., Weiss, E., Maheswaranathan, N. & Ganguli, S. Deep Unsupervised Learning Using Nonequilibrium Thermodynamics. Proc. 2256–2265 (ICML, 2015).
Ho, J., Jain, A. & Abbeel, P. Denoising Diffusion Probabilistic Models. Proc. (NeurIPS, 2020).
Song, Y. et al. Score-Based Generative Modeling through Stochastic Differential Equations. Proc. (ICLR, 2021).
Song, J., Meng, C. & Ermon, S. Denoising Diffusion Implicit Models. Proc. (ICLR, 2021).
Karras, T., Aittala, M., Aila, T. & Laine, S. Elucidating the Design Space of Diffusion-Based Generative Models. Adv. Neural Inf. Process. Syst. 35, 26565–26577 (2022).
Xu, M. et al. Geodiff: A Geometric Diffusion Model for Molecular Conformation Generation. Proc. (ICLR, 2022).
Bhattacharyya, S. et al. Strong-Field-Induced Coulomb Explosion Imaging of Tribromomethane. J. Phys. Chem. Lett. 13, 5845–5853 (2022).
Lam, H. V. S. et al. Differentiating Three-Dimensional Molecular Structures Using Laser-Induced Coulomb Explosion Imaging. Phys. Rev. Lett. 132, 123201 (2024).
Yuan, H. et al. Coulomb Explosion Imaging of Complex Molecules Using Highly Charged Ions. Phys. Rev. Lett. 133, 193002 (2024).
Hochreiter, S. & Schmidhuber, J. Long Short-Term Memory. Neural Comput. 9, 1735–1780 (1997).
Ho, P. J. & Knight, C. Large-scale atomistic calculations of clusters in intense x-ray pulses. J. Phys. B: At. Mol. Opt. Phys. 50, 104003 (2017).
Sayler, A. M. et al. Nonunique and nonuniform mapping in few-body Coulomb-explosion imaging. Phys. Rev. A 97, 033412 (2018).
Dörner, R. et al. Cold Target Recoil Ion Momentum Spectroscopy: a ‘momentum microscope’ to view atomic collision dynamics. Phys. Rep. 330, 95–192 (2000).
Piancastelli, M. N. et al. Dynamic response of water molecules to a ultra-intense X-ray beam. https://doi.org/10.22003/XFEL.EU-DATA-002150-00 (2019).
Jahnke, T. et al. Multi-photon ionization of atoms and small molecules. https://doi.org/10.22003/XFEL.EU-DATA-002181-00 (2019).
Boll, R. et al. REMI commissioning. https://doi.org/10.22003/XFEL.EU-DATA-002926-00 (2021).
Ong, M. T. The Photochemical and Mechanochemical Ring Opening of Cyclobutene from First Principles. (University of Illinois at Urbana-Champaign, 2010).
Ryufuku, H., Sasaki, K. & Watanabe, T. Oscillatory behavior of charge transfer cross sections as a function of the charge of projectiles in low-energy collisions. Phys. Rev. A 21, 745 (1980).
Niehaus, A. A classical model for multiple-electron capture in slow collisions of highly charged ions with atoms. J. Phys. B: Atom. Mol. Phys. 19, 2925 (1986).
Ho, P. J. et al. X-ray induced electron and ion fragmentation dynamics in IBr. J. Chem. Phys. 158, 134304 (2023).
Glorot, X. & Bengio, Y. Understanding the difficulty of training deep feedforward neural networks. Proc. AISTATS 9, 249–256 (2010).
Saxe, A. M., McClelland, J. L. & Ganguli, S. Exact solutions to the nonlinear dynamics of learning in deep linear neural networks. https://arxiv.org/abs/1312.6120 (2014).
Kingma, D. P. & Ba, J. Adam: A Method for Stochastic Optimization. Proc. (ICLR, 2015).
Li, X. Datasets and model weights for paper “Generative modeling enables molecular structure retrieval from coulomb explosion imaging”, Zenodo. https://doi.org/10.5281/zenodo.15794470 (2025).
Li, X. xli025/molexa: v1.0.0, Zenodo. https://doi.org/10.5281/zenodo.18510545 (2026).
NIST Computational Chemistry Comparison and Benchmark Database. NIST Standard Reference Database Number 101. http://cccbdb.nist.gov/. Release 22 May (2022).
Acknowledgements
We acknowledge the LCLS data team and the SLAC Shared Science Data Facility (S3DF) for providing the computing and data storage used in model development. We acknowledge the teams of the three European XFEL experiments (2150, 2181, and 2926) for sharing the associated data. X.L. would like to thank Patricia Vindel Zandbergen for her help related to the model testing and Philipp Schmidt for his support in experimental data processing. This work is supported by the Linac Coherent Light Source, SLAC National Accelerator Laboratory, which is funded by the U.S. Department of Energy, Office of Science, Office of Basic Energy Sciences under Contract No. DE-AC02-76SF00515. P.J.H. is supported by the U.S. DOE BES Chemical Sciences, Geosciences, and Biosciences Division under Contract No. DE-AC02-06CH11357. D.R. and A.R. are supported by grant no. DE-FG02-86ER13491 from the same funding agency, and also acknowledge dedicated support for ML/AI developments through the GRIPex program at Kansas State University. F.T. acknowledges funding by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) – Project 509471550, Emmy Noether Program. T.J.A.W. was supported by the Atomic, Molecular, and Optical Sciences Program of the U.S. Department of Energy, Office of Science, Office of Basic Energy Sciences, Chemical Sciences, Geosciences, and Biosciences Division, through Contract No. DE-AC0276SF00515.
Author information
Authors and Affiliations
Contributions
Conceptualization and methodology: X.L. with support from J.B.T., J.P.C. and P.J.H.; Dataset creation and curation: X.L. and P.J.H.; Generative model development: X.L., J.H., M.X. and S.E.; CEI experiments: X.L., T.J., R.B., M.M., M.N.P., D.R., A.R. and F.T.; CEI experiment data analysis: X.L. and T.J.; Original draft: X.L., T.J., R.B., J.H., M.X., D.R., F.T., T.J.A.W., S.E. and P.J.H.; Final draft: all authors.
Corresponding author
Ethics declarations
Competing interests
The authors declare no competing interests.
Peer review
Peer review information
Nature Communications thanks Xinwen Ma, Henrik Stapelfeldt, Daniel Strasser, and the other, anonymous, reviewer(s) for their contribution to the peer review of this work. A peer review file is available.
Additional information
Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Supplementary information
Source data
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License, which permits any non-commercial use, sharing, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if you modified the licensed material. You do not have permission under this licence to share adapted material derived from this article or parts of it. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
About this article
Cite this article
Li, X., Jahnke, T., Boll, R. et al. Generative modeling enables molecular structure retrieval from Coulomb explosion imaging. Nat Commun (2026). https://doi.org/10.1038/s41467-026-70160-5
Received:
Accepted:
Published:
DOI: https://doi.org/10.1038/s41467-026-70160-5


