Tools for computing and analyzing properties derived from the dark matter density field in cosmological simulations.
This repository provides methods and scripts for:
- Building the density field from dark matter particles using grid assignment schemes (CIC, TSC, etc.).
- Computing the tidal tensor and its eigenvalues/eigenvectors.
- Deriving related quantities such as tidal anisotropy and linear bias.
- Performing auxiliary analyses on density fields, including smoothing, Fourier transforms, and memory-efficient batching.
Clone the repository and create the environment:
git clone https://github.com/<your-username>/density_field_properties.git
cd density_field_properties
conda env create -f environment.yml
conda activate density_fieldAlternatively, install it as a local editable package:
pip install -e .To ensure consistent code style and quality, this repository uses pre-commit hooks configured with:
Install pre-commit
pip install pre-commitSet up hooks in your local repository
pre-commit installRun checks manually (optional)
pre-commit run --all-filesThe hooks will automatically run on every git commit, ensuring that code is formatted, imports are sorted, and style issues are caught early.
numpyscipyh5pymatplotlibtqdmnumba(optional, for JIT acceleration)
This codebase is designed for studies involving:
- Assembly bias and extended HOD models (e.g.
hod_madrid_py). - Tidal tensor and anisotropy in large-scale structure (Haloscope project).
- Applications to UNIT (UNIT simulations), FastPM (FastPM GitHub), and CAMELS (CAMELS project).
- Integration within cosmological survey frameworks such as Euclid (ESA Euclid mission) and DESI (DESI collaboration).