PySCo: A fast particle-mesh

We present <ns0:monospace>PySCo</ns0:monospace>, a fast and user-friendly Python library designed to run cosmological N-body simulations across various cosmological models, such as ΛCDM (Λ with cold dark matter) and w0waCDM, and alternative theories of gravity, including f (R), MOND (modified newtonian dynamics) and time-dependent gravitational constant parameterisations. <ns0:monospace>PySCo</ns0:monospace> employs particle-mesh solvers, using multigrid or fast Fourier transform (FFT) methods in their different variations. Additionally, <ns0:monospace>PySCo</ns0:monospace> can be easily integrated as an external library, providing utilities for particle and mesh computations. The library offers key features, including an initial condition generator based on up to third-order Lagrangian perturbation theory (LPT), power spectrum estimation, and computes the background and growth of density perturbations. In this paper, we detail <ns0:monospace>PySCo’s</ns0:monospace> architecture and algorithms and conduct extensive comparisons with other codes and numerical methods. Our analysis shows that, with sufficient small-scale resolution, the power spectrum at redshift z = 0 remains independent of the initial redshift at the 0.1% level for zini ≥ 125, 30, and 10 when using first, second, and third-order LPT, respectively. Moreover, we demonstrate that acceleration (or force) calculations should employ a configuration-space finite-difference stencil for central derivatives with at least five points, as three-point derivatives result in significant power suppression at small scales. Although the seven-point Laplacian method used in multigrid also leads to power suppression on small scales, this effect can largely be mitigated when computing ratios. In terms of performance, <ns0:monospace>PySCo</ns0:monospace> only requires approximately one CPU hour to complete a Newtonian simulation with 5123 particles (and an equal number of cells) on a laptop. Due to its speed and ease of use, <ns0:monospace>PySCo</ns0:monospace> is ideal for rapidly generating vast ensemble of simulations and exploring parameter spaces, allowing variations in gravity theories, dark energy models, and numerical approaches. This versatility makes <ns0:monospace>PySCo</ns0:monospace> a valuable tool for producing emulators, covariance matrices, or training datasets for machine learning.

Authors

Publication Details

Journal
Springer Link (Chiba Institute of Technology)
Published
2025-03-19
DOI
https://doi.org/10.1051/0004-6361/202452770/pdf
Primary Topic
Galaxies: Formation, Evolution, Phenomena
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

PySCo: A fast particle-mesh

Michel-Andrès Breton
Springer Link (Chiba Institute of Technology)
Galaxies: Formation, Evolution, Phenomena
article

PySCo: A fast particle-mesh

Michel-Andrès Breton
article en

Abstract

We present <ns0:monospace>PySCo</ns0:monospace>, a fast and user-friendly Python library designed to run cosmological N-body simulations across various cosmological models, such as ΛCDM (Λ with cold dark matter) and w0waCDM, and alternative theories of gravity, including f (R), MOND (modified newtonian dynamics) and time-dependent gravitational constant parameterisations. <ns0:monospace>PySCo</ns0:monospace> employs particle-mesh solvers, using multigrid or fast Fourier transform (FFT) methods in their different variations. Additionally, <ns0:monospace>PySCo</ns0:monospace> can be easily integrated as an external library, providing utilities for particle and mesh computations. The library offers key features, including an initial condition generator based on up to third-order Lagrangian perturbation theory (LPT), power spectrum estimation, and computes the background and growth of density perturbations. In this paper, we detail <ns0:monospace>PySCo’s</ns0:monospace> architecture and algorithms and conduct extensive comparisons with other codes and numerical methods. Our analysis shows that, with sufficient small-scale resolution, the power spectrum at redshift z = 0 remains independent of the initial redshift at the 0.1% level for zini ≥ 125, 30, and 10 when using first, second, and third-order LPT, respectively. Moreover, we demonstrate that acceleration (or force) calculations should employ a configuration-space finite-difference stencil for central derivatives with at least five points, as three-point derivatives result in significant power suppression at small scales. Although the seven-point Laplacian method used in multigrid also leads to power suppression on small scales, this effect can largely be mitigated when computing ratios. In terms of performance, <ns0:monospace>PySCo</ns0:monospace> only requires approximately one CPU hour to complete a Newtonian simulation with 5123 particles (and an equal number of cells) on a laptop. Due to its speed and ease of use, <ns0:monospace>PySCo</ns0:monospace> is ideal for rapidly generating vast ensemble of simulations and exploring parameter spaces, allowing variations in gravity theories, dark energy models, and numerical approaches. This versatility makes <ns0:monospace>PySCo</ns0:monospace> a valuable tool for producing emulators, covariance matrices, or training datasets for machine learning.

Springer Link (Chiba Institute of Technology)
Openalex Percentile: Top 25%
Galaxies: Formation, Evolution, Phenomena
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.