Skip to main content

diffhalos

Diffhalos is a generative model of cosmological lightcones of dark matter halos, subhalos, and their merger trees. This library is written in JAX, and makes differentiable predictions for halo populations in a lightcone, or at a single redshift.

Documentation

Online documentation is available at diffhalos.readthedocs.io

Installation

To install diffhalos into your environment from the source code:

$ cd /path/to/root/diffhalos
$ pip install .

Testing

To run the suite of unit tests:

$ cd /path/to/root/diffhalos
$ pytest

To build html of test coverage:

$ pytest -v --cov --cov-report html
$ open htmlcov/index.html

Demo notebooks

The diffhalos_quickstart.ipynb notebook illustrates how to use some of the core functions of diffhalos. In particular, it demonstrates how to generate halo and subhalo lightcones using the Monte-Carlo and quasi-Monte Carlo versions of the generator. In addition, it shows that the lightcone outputs agree well with the exact theory predictions from the halo and subhalo mass functions in Diffhalos.

In the notebook diffhalos_mah.ipynb we go over the basics of using the DiffmahNet model in Diffhalos to generate mass assembly histories (MAHs) of populations of dark matter halos. It also demonstrates how the MAH of synthetic halos is part of the standard output in the lightcones.

We demonstrate and explain in more detail the fundamentals of using the Monte Carlo and quasi-Monte Carlo generators, and discuss their differences, in the notebook diffhalos_mc_vs_qmc.ipynb. In there, we cover the basics of how to use each version for host halos, and we talk about how they differ in their approch to lightcone generation.

Metadata

Release files for diffhalos 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for diffhalos 0.2.0
File Size Uploaded
diffhalos-0.2.0.tar.gz 9.6 MB Details

Release files / diffhalos-0.2.0.tar.gz

Download URL diffhalos-0.2.0.tar.gz
Size 9.6 MB
Tags Source
SHA-256 checksum
How to use checksums
79ce52010df19032e60b16df9cd479cf71e8745303fc1735fceeb722b0e6d614
BLAKE2b-256 checksum
How to use checksums
96395e09f46b2cc24ce3ad1528f4bb8f5fff385fb823f53d87095c690fb06545
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.11

Release history Release notifications | RSS feed

This release

0.2.0 This release

1 release file

0.1.1

1 release file

0.1.0

1 release file

0.0.4

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page