Export citation

Export citation

Choose format for download:

Download Citation
  • Access by Xinjiang University

Variational autoencoder for generating realistic N-body simulations for dark matter halos

Jazhiel Chacón-Lavanderos*

Isidro Gómez-Vargas

Ricardo Menchaca-Mendez

J. Alberto Vázquez§

  • *Contact author: chaconl2021@cic.ipn.mx
  • Contact author: isidro.gomezvargas@unige.ch
  • Contact author: ric@cic.ipn.mx
  • §Contact author: javazquez@icf.unam.mx

Phys. Rev. D 113, 063520 – Published 5 March, 2026

DOI: https://doi.org/10.1103/b6lj-rlff

Abstract

In this paper, we present a deep-learning approach to generate synthetic cosmological images by training a convolutional variational autoencoder on two-dimensional dark matter density slices projected from Λ cold dark matter (ΛCDM) N-body simulations. The model learns a compact latent representation that enables accurate reconstructions and fast generation of new synthetic realizations through a single forward pass through the decoder. We validate the generated fields using cosmology-based summary statistics, focusing on the matter power spectrum and related Fourier space diagnostics, and found good agreement with the reference simulation across the range of scales where the maps exhibit good resolution. Thanks to its low inference cost and stable training target, this variational-autoencoder approach provides a lightweight and reproducible basis for generative modeling of large-scale projected structures and can support downstream tasks such as fast simulation generation and data augmentation.

Physics Subject Headings (PhySH)

See Also

Analysis of dark matter halo structure formation in N-body simulations with machine learning

Jazhiel Chacón, Isidro Gómez-Vargas, Ricardo Menchaca Méndez, and J. Alberto Vázquez
Phys. Rev. D 107, 123515 (2023)

Article Text

References (65)

  1. Volker Springel, The cosmological simulation code gadget-2, Mon. Not. R. Astron. Soc. 364, 1105 (2005).
  2. Svetlin Tassev, Matias Zaldarriaga, and Daniel J. Eisenstein, Solving large scale structure in ten easy steps with cola, J. Cosmol. Astropart. Phys. 06 (2013) 036.
  3. Volker Springel, Rüdiger Pakmor, Oliver Zier, and Martin Reinecke, Simulating cosmic structure formation with the gadget-4 code, Mon. Not. R. Astron. Soc. 506, 2871 (2021).
  4. Greg L. Bryan, Michael L. Norman, Brian W. O’Shea, Tom Abel, John H. Wise, Matthew J. Turk, Daniel R. Reynolds, David C. Collins, Peng Wang, Samuel W. Skillman et al., Enzo: An adaptive mesh refinement code for astrophysics, Astrophys. J. Suppl. Ser. 211, 19 (2014).
  5. Ian Goodfellow, Yoshua Bengio, and Aaron Courville, Deep Learning (MIT Press, Cambridge, MA, 2016).
  6. Ian J. Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio, Generative adversarial nets, in Advances in Neural Information Processing Systems, edited by Z. Ghahramani, M. Welling, C. Cortes, N. Lawrence, and K. Q. Weinberger (Curran Associates, Inc., 2014), Vol. 27.
  7. Yang Song, Jascha Sohl-Dickstein, Diederik P Kingma, Abhishek Kumar, Stefano Ermon, and Ben Poole, Score-based generative modeling through stochastic differential equations, arXiv:2011.13456.
  8. Ziyi Chang, George Alex Koulieris, and Hubert P. H. Shum, On the design fundamentals of diffusion models: A survey, arXiv:2306.04542.
  9. M. A. Kramer, Autoassociative neural networks, Comput. Chem. Eng. 16, 313 (1992).
  10. Geoffrey E. Hinton and Richard Zemel, Autoencoders, minimum description length and helmholtz free energy, in Advances in Neural Information Processing Systems, edited by J. Cowan, G. Tesauro, and J. Alspector (Morgan-Kaufmann, Red Hook, NY, 1993), Vol. 6.
  11. Jazhiel Chacón, Isidro Gómez-Vargas, Ricardo Menchaca Méndez, and J Alberto Vázquez, Analysis of dark matter halo structure formation in n-body simulations with machine learning, Phys. Rev. D 107, 123515 (2023).
  12. Luisa Lucie-Smith, Giulia Despali, and Volker Springel, A deep-learning model for the density profiles of subhaloes in illustrisTNG, Mon. Not. R. Astron. Soc. 532, 164 (2024).
  13. Mauro Bernardini, Lucio Mayer, Darren Reed, and Robert Feldmann, Predicting dark matter halo formation in n-body simulations with deep regression networks, Mon. Not. R. Astron. Soc. 496, 5116 (2020).
  14. F. Villaescusa-Navarro et al., The camels project: Cosmology and astrophysics with machine-learning simulations, Astrophys. J. 915, 71 (2021).
  15. Isidro Gómez-Vargas and J. Alberto Vázquez, Deep learning and genetic algorithms for cosmological Bayesian inference speed-up, Phys. Rev. D 110, 083518 (2024).
  16. Jonathan Chardin, Grégoire Uhlrich, Dominique Aubert, Nicolas Deparis, Nicolas Gillet, Pierre Ocvirk, and Joseph Lewis, A deep learning model to emulate simulations of cosmic reionization, Mon. Not. R. Astron. Soc. 490, 1055 (2019).
  17. Amrita Mathuriya, Deborah Bard, Peter Mendygral, Lawrence Meadows, James Arnemann, Lei Shao, Siyu He, Tuomas Kärnä, Diana Moise, Simon J. Pennycook et al., Cosmoflow: Using deep learning to learn the universe at scale, in SC18: International Conference for High Performance Computing, Networking, Storage and Analysis (IEEE, New York, 2018), pp. 819–829.
  18. Chun-Hao To, Eduardo Rozo, Elisabeth Krause, Hao-Yi Wu, Risa H. Wechsler, and Andrés N. Salcedo, Linna: Likelihood inference neural network accelerator, J. Cosmol. Astropart. Phys. 01 (2023) 016.
  19. Nathanaël Perraudin, Ankit Srivastava, Aurelien Lucchi, Tomasz Kacprzak, Thomas Hofmann, and Alexandre Réfrégier, Cosmological n-body simulations: A challenge for scalable generative models, Comput. Astrophys. Cosmol. 6, 1 (2019).
  20. Marion Ullmo, Aurélien Decelle, and Nabila Aghanim, Encoding large-scale cosmological structure with generative adversarial networks, Astron. Astrophys. 651, A46 (2021).
  21. Yin Li, Yueying Ni, Rupert A. C. Croft, Tiziana Di Matteo, Simeon Bird, and Yu Feng, Ai-assisted superresolution cosmological simulations, Proc. Natl. Acad. Sci. U.S.A. 118, e2022038118 (2021).
  22. Adam Rouhiainen, Moritz Münchmeyer, Gary Shiu, Michael Gira, and Kangwook Lee, Superresolution emulation of large cosmological fields with a 3d conditional diffusion model, Phys. Rev. D 109, 123536 (2024).
  23. Nayantara Mudur and Douglas P. Finkbeiner, Can denoising diffusion probabilistic models generate realistic astrophysical fields?, arXiv:2211.12444.
  24. Nayantara Mudur, Carolina Cuesta-Lazaro, and Douglas P. Finkbeiner, Cosmological field emulation and parameter inference with diffusion models, arXiv:2312.07534.
  25. Andreas Schanz, Florian List, and Oliver Hahn, Stochastic super-resolution of cosmological simulations with denoising diffusion models, arXiv:2310.06929.
  26. D. G. York et al., The sloan digital sky survey: Technical summary, Astron. J. 120, 1579 (2000).
  27. T. M. C. Abbott et al. (DES Collaboration), Dark energy survey year 1 results: Cosmological constraints from galaxy clustering and weak lensing, Phys. Rev. D 98, 043526 (2018).
  28. R. Laureijs et al., Euclid definition study report, arXiv:1110.3193.
  29. LSST Science Collaboration, Lsst science book, version 2.0, 2009.
  30. M. Vogelsberger, S. Genel, V. Springel, P. Torrey, D. Sijacki, D. Xu, G. Snyder, S. Bird, D. Nelson, and L. Hernquist, Introducing the illustris project: Simulating the coevolution of dark and visible matter in the universe, Nature (London) 509, 177 (2014).
  31. V. Springel et al., Simulations of the formation, evolution and clustering of galaxies and quasars, Nature (London) 435, 629 (2005).
  32. Isidro Gómez-Vargas, Ricardo Medel-Esquivel, Ricardo García-Salcedo, and J. Alberto Vázquez, Neural network reconstructions for the hubble parameter, growth rate and distance modulus, Eur. Phys. J. C 83, 304 (2023).
  33. Kai Yi, Yi Guo, Yanan Fan, Jan Hamann, and Yu Guang Wang, Cosmo vae: Variational autoencoder for CMB image inpainting, in 2020 International Joint Conference on Neural Networks (IJCNN) (IEEE, New York, 2020), pp. 1–7.
  34. Irham T. Andika, Stefan Schuldt, Sherry H. Suyu, Satadru Bag, Raoul Cañameras, Alejandra Melo, Claudio Grillo, and James H. H. Chan, Accelerating lensed quasar discovery and modeling with physics-informed variational autoencoders, Astron. Astrophys. 694, A227 (2025).
  35. Hunter Gabbard, Chris Messenger, Ik Siong Heng, Francesco Tonolini, and Roderick Murray-Smith, Bayesian parameter estimation using conditional variational autoencoders for gravitational-wave astronomy, Nat. Phys. 18, 112 (2022).
  36. Jazhiel Chacon, J. Alberto Vazquez, and Ruslan Gabbasov, Dark matter with n-body numerical simulations, Rev. Mex. Fis. E 17, 241 (2020).
  37. Josh Barnes and Piet Hut, A hierarchical O(N log N) force-calculation algorithm, Nature (London) 324, 446 (1986).
  38. Alexander A. Vlasov, The vibrational properties of an electron gas, Uspekhi Fizicheskih Nauk (1967).
  39. M. L. Norman and G. L. Bryan, Cosmological Adaptive Mesh Refinement (Springer, Netherlands, 1999), pp. 19–28.
  40. Felipe L. Gewers, Gustavo R. Ferreira, Henrique F. De Arruda, Filipi N. Silva, Cesar H. Comin, Diego R. Amancio, and Luciano Da F. Costa, Principal component analysis: A natural approach to data exploration, ACM Comput. Surv. 54, 1 (2021).
  41. Diederik P. Kingma and Max Welling, An introduction to variational autoencoders, Found. Trends® Mach. Learn. 12, 307 (2019).
  42. David Foster, Generative deep learning (O’Reilly Media, Inc., Sebastopol, CA, 2022).
  43. Solomon Kullback and Richard A. Leibler, On information and sufficiency, Ann. Math. Stat. 22, 79 (1951).
  44. Calvin Luo, Understanding diffusion models: A unified perspective, arXiv:2208.11970.
  45. Isidro Gómez-Vargas, Joshua Briones Andrade, and J. Alberto Vázquez, Neural networks optimized by genetic algorithms in cosmology, Phys. Rev. D 107, 043509 (2023).
  46. Takuya Akiba, Shotaro Sano, Toshihiko Yanase, Takeru Ohta, and Masanori Koyama, Optuna: A next-generation hyperparameter optimization framework, in Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining (2019), pp. 2623–2631.
  47. Marina Seikel, Chris Clarkson, and Mathew Smith, Reconstruction of dark energy and expansion dynamics using Gaussian processes, J. Cosmol. Astropart. Phys. 06 (2012) 036.
  48. Ming-Jian Zhang and Hong Li, Gaussian processes reconstruction of dark energy from observational data, Eur. Phys. J. C 78, 1 (2018).
  49. José de Jesús Velázquez, Luis A. Escamilla, Purba Mukherjee, and J. Alberto Vázquez, Non-parametric reconstruction of cosmological observables using Gaussian processes regression, Universe 10, 464 (2024).
  50. R. E. Smith, J. A. Peacock, A. Jenkins, S. D. M. White, C. S. Frenk, F. R. Pearce, P. A. Thomas, G. Efstathiou, and H. M. P. Couchman, Stable clustering, the halo model and non-linear cosmological power spectra, Mon. Not. R. Astron. Soc. 341, 1311 (2003).
  51. Ryuichi Takahashi, Masanori Sato, Takahiro Nishimichi, Atsushi Taruya, and Masamune Oguri, Revising the halofit model for the nonlinear matter power spectrum, Astrophys. J. 761, 152 (2012).
  52. J. Bayron Orjuela-Quintana, Savvas Nesseris, and Domenico Sapone, Machine learning unveils the linear matter power spectrum of modified gravity, Phys. Rev. D 109, 063511 (2024).
  53. Francisco Prada, Claudia G. Scóccola, Chia-Hsun Chuang, Gustavo Yepes, Anatoly A. Klypin, Francisco-Shu Kitaura, Stefan Gottlöber, and Cheng Zhao, Hunting down systematics in baryon acoustic oscillations after cosmic high noon, Mon. Not. R. Astron. Soc. 458, 613 (2016).
  54. David Alonso, Oleksandr Hetmantsev, Giulio Fabbian, Anze Slosar, and Kate Storey-Fisher, Measurement of the power spectrum turnover scale from the cross-correlation between CMB lensing and quaia, arXiv:2410.24134.
  55. Ya. B. Zel’dovich, Gravitational instability: An approximate theory for large density perturbations, Astron. Astrophys. 5, 84 (1970).
  56. Martin White, Jeremy L. Tinker, and Cameron K. McBride, Mock galaxy catalogues using the quick particle mesh method, Mon. Not. R. Astron. Soc. 437, 2594 (2014).
  57. Sara Konrad, Yonadav Barry Ginat, and Matthias Bartelmann, On the asymptotic behaviour of cosmic density-fluctuation power spectra of cold dark matter, Mon. Not. R. Astron. Soc. 515, 5823 (2022).
  58. Lawrence M. Widrow, Pascal J. Elahi, Robert J. Thacker, Mark Richardson, and Evan Scannapieco, Power spectrum for the small-scale Universe, Mon. Not. R. Astron. Soc. 397, 1275 (2009).
  59. Yonadav Barry Ginat, Michael L. Nastac, Robert J. Ewart, Sara Konrad, Matthias Bartelmann, and Alexander A. Schekochihin, Gravitational turbulence: The small-scale limit of the cold-dark-matter power spectrum, Phys. Rev. D 112, 063501 (2025).
  60. M. Raissi, P. Perdikaris, and G. E. Karniadakis, Physics-informed neural networks: A deep learning framework for solving forward and inverse problems involving nonlinear partial differential equations, J. Comput. Phys. 378, 686 (2019).
  61. George Em Karniadakis, Ioannis G. Kevrekidis, Lu Lu, Paris Perdikaris, Sifan Wang, and Liu Yang, Physics-informed machine learning, Nat. Rev. Phys. 3, 422 (2021).
  62. C. Modi, F. Lanusse, and U. Seljak, Flowpm: Distributed tensorflow implementation of the fastpm cosmological n-body solver, Astron. Comput. 37, 100505 (2021).
  63. Yinhao Zhu, Nicholas Zabaras, Phaedon-Stelios Koutsourelakis, and Paris Perdikaris, Physics-constrained deep learning for high-dimensional surrogate modeling and uncertainty quantification without labeled data, J. Comput. Phys. 394, 56 (2019).
  64. Mohammad H. Taufik and Tariq Alkhalifah, Latentpinns: Generative physics-informed neural networks via a latent representation learning, Artif. Intell. Geosci. 6, 100115 (2025).
  65. GitHub repository, https://github.com/igomezv/NcosmoVAE, accessed on 2/03/2026.

Outline

Information

Sign In to Your Journals Account

Filter

Filter

Article Lookup

Enter a citation