pmwd: A Differentiable Cosmological Particle-Mesh N-body Library

Yin Li, Libin Lu, Chirag Modi, Drew Jamieson, Yucheng Zhang +5 more
11/18/2022
astro-ph.IMastro-ph.CO

Official code: eelregit/pmwd (96 stars, Python, BSD-3-Clause, JAX, last commit 2026-06-12).

Abstract

The formation of the large-scale structure, the evolution and distribution of galaxies, quasars, and dark matter on cosmological scales, requires numerical simulations. Differentiable simulations provide gradients of the cosmological parameters, that can accelerate the extraction of physical information from statistical analyses of observational data.

Show full abstract

The deep learning revolution has brought not only myriad powerful neural networks, but also breakthroughs including automatic differentiation (AD) tools and computational accelerators like GPUs, facilitating forward modeling of the Universe with differentiable simulations. Because AD needs to save the whole forward evolution history to backpropagate gradients, current differentiable cosmological simulations are limited by memory. Using the adjoint method, with reverse time integration to reconstruct the evolution history, we develop a differentiable cosmological particle-mesh (PM) simulation library pmwd (particle-mesh with derivatives) with a low memory cost. Based on the powerful AD library JAX, pmwd is fully differentiable, and is highly performant on GPUs.

View on arXivView PDF

Code Implementations(1)

eelregit/pmwdOfficial100%
JAXBSD-3-Clause

Differentiable Cosmological Forward Model

9625PythonAug 30, 20215 months agoBSD-3-Clause
cosmologydifferentiableforward-modeljaxn-body+2 more

Similar Papers

Cite this paper

@article{li2022pmwd,
  title  = {pmwd: A Differentiable Cosmological Particle-Mesh N-body Library},
  author = {Yin Li and Libin Lu and Chirag Modi and Drew Jamieson and Yucheng Zhang and Yu Feng and Wenda Zhou and Ngai Pok Kwan and François Lanusse and Leslie Greengard},
  year   = {2022},
  eprint = {2211.09958},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2211.09958}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2211.09958.svg)](https://codeofpaper.com/paper/2211.09958)

Discussion