Skip to main content

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

diffhalos-0.2.0.tar.gz (9.6 MB view details)

Uploaded Source

File details

Details for the file diffhalos-0.2.0.tar.gz.

File metadata

  • Download URL: diffhalos-0.2.0.tar.gz
  • Upload date:
  • Size: 9.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for diffhalos-0.2.0.tar.gz
Algorithm Hash digest
SHA256 79ce52010df19032e60b16df9cd479cf71e8745303fc1735fceeb722b0e6d614
MD5 4d91de4e659d27fdc2c8716fcd71d19a
BLAKE2b-256 96395e09f46b2cc24ce3ad1528f4bb8f5fff385fb823f53d87095c690fb06545

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.0 This release

1 file

0.1.1

1 file

0.1.0

1 file

0.0.4

1 file

0.0.1

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page