{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/pmwd-a-differentiable-cosmological-particle","title":"pmwd: A Differentiable Cosmological Particle-Mesh $N$-body Library","arxiv_id":"2211.09958","date":"2022-11-18","proceeding":null,"authors":["Yin Li","Libin Lu","Chirag Modi","Drew Jamieson","Yucheng Zhang","Yu Feng","Wenda Zhou","Ngai Pok Kwan","François Lanusse","Leslie Greengard"],"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. 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.","url_abs":"https://arxiv.org/abs/2211.09958v1","url_pdf":"https://arxiv.org/pdf/2211.09958v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"links_only","authors_date_abstract":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license), from the Kaggle arXiv metadata snapshot of 2026-09-12"},"code_links":[{"paper_slug":"pmwd-a-differentiable-cosmological-particle","repo_url":"https://github.com/eelregit/pmwd","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"jax","reach":{"status":"ok","spdx":"BSD-3-Clause"}}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2211.09958","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2211.09958"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/eelregit/pmwd","reach":{"status":"ok","spdx":"BSD-3-Clause"}}],"summary":{"unverified":16},"by_repo_kind":{"official":{"samples":16,"ran":0,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"06d44ba997224d0a","entry":"E2","repo":"eelregit/pmwd","repo_kind":"official","path":"pmwd/cosmology.py","file_url":"https://github.com/eelregit/pmwd/blob/HEAD/pmwd/cosmology.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"06d44ba997224d0a"}},{"code_sha256_prefix":"c87c940b4ea493e3","entry":"H_deriv","repo":"eelregit/pmwd","repo_kind":"official","path":"pmwd/cosmology.py","file_url":"https://github.com/eelregit/pmwd/blob/HEAD/pmwd/cosmology.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"c87c940b4ea493e3"}},{"code_sha256_prefix":"15c76c3399b7016a","entry":"Omega_m_a","repo":"eelregit/pmwd","repo_kind":"official","path":"pmwd/cosmology.py","file_url":"https://github.com/eelregit/pmwd/blob/HEAD/pmwd/cosmology.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"15c76c3399b7016a"}},{"code_sha256_prefix":"4e3ecccc48afd1d0","entry":"enmesh","repo":"eelregit/pmwd","repo_kind":"official","path":"pmwd/pm_util.py","file_url":"https://github.com/eelregit/pmwd/blob/HEAD/pmwd/pm_util.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"4e3ecccc48afd1d0"}},{"code_sha256_prefix":"21ccfeec2cae0aa7","entry":"fftfreq","repo":"eelregit/pmwd","repo_kind":"official","path":"pmwd/pm_util.py","file_url":"https://github.com/eelregit/pmwd/blob/HEAD/pmwd/pm_util.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"21ccfeec2cae0aa7"}},{"code_sha256_prefix":"52caf6b0e7f33f92","entry":"interp_fit_dopri","repo":"eelregit/pmwd","repo_kind":"official","path":"pmwd/ode_util.py","file_url":"https://github.com/eelregit/pmwd/blob/HEAD/pmwd/ode_util.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"52caf6b0e7f33f92"}},{"code_sha256_prefix":"0d1fcfe2dec1367c","entry":"laplace","repo":"eelregit/pmwd","repo_kind":"official","path":"pmwd/gravity.py","file_url":"https://github.com/eelregit/pmwd/blob/HEAD/pmwd/gravity.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"0d1fcfe2dec1367c"}},{"code_sha256_prefix":"69c17c4e7524e5c6","entry":"laplace_bwd","repo":"eelregit/pmwd","repo_kind":"official","path":"pmwd/gravity.py","file_url":"https://github.com/eelregit/pmwd/blob/HEAD/pmwd/gravity.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"69c17c4e7524e5c6"}},{"code_sha256_prefix":"64f13b6b0df4a7e7","entry":"laplace_fwd","repo":"eelregit/pmwd","repo_kind":"official","path":"pmwd/gravity.py","file_url":"https://github.com/eelregit/pmwd/blob/HEAD/pmwd/gravity.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"64f13b6b0df4a7e7"}},{"code_sha256_prefix":"3a832a9c3a79cb14","entry":"levi_civita","repo":"eelregit/pmwd","repo_kind":"official","path":"pmwd/lpt.py","file_url":"https://github.com/eelregit/pmwd/blob/HEAD/pmwd/lpt.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"3a832a9c3a79cb14"}},{"code_sha256_prefix":"7087607fb22695f3","entry":"ravel_first_arg","repo":"eelregit/pmwd","repo_kind":"official","path":"pmwd/ode_util.py","file_url":"https://github.com/eelregit/pmwd/blob/HEAD/pmwd/ode_util.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"7087607fb22695f3"}},{"code_sha256_prefix":"55bf5813189f1bcc","entry":"ravel_first_arg_","repo":"eelregit/pmwd","repo_kind":"official","path":"pmwd/ode_util.py","file_url":"https://github.com/eelregit/pmwd/blob/HEAD/pmwd/ode_util.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"55bf5813189f1bcc"}},{"code_sha256_prefix":"d4bf76e2ba592993","entry":"rfftnfreq","repo":"eelregit/pmwd","repo_kind":"official","path":"pmwd/pm_util.py","file_url":"https://github.com/eelregit/pmwd/blob/HEAD/pmwd/pm_util.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"d4bf76e2ba592993"}},{"code_sha256_prefix":"0c1b2530da71719d","entry":"transfer","repo":"eelregit/pmwd","repo_kind":"official","path":"pmwd/boltzmann.py","file_url":"https://github.com/eelregit/pmwd/blob/HEAD/pmwd/boltzmann.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"0c1b2530da71719d"}},{"code_sha256_prefix":"882c55607004378b","entry":"transfer_fit","repo":"eelregit/pmwd","repo_kind":"official","path":"pmwd/boltzmann.py","file_url":"https://github.com/eelregit/pmwd/blob/HEAD/pmwd/boltzmann.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"882c55607004378b"}},{"code_sha256_prefix":"b3ba2c1312101ef7","entry":"transfer_integ","repo":"eelregit/pmwd","repo_kind":"official","path":"pmwd/boltzmann.py","file_url":"https://github.com/eelregit/pmwd/blob/HEAD/pmwd/boltzmann.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"b3ba2c1312101ef7"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}