(hayashi means forest in japanese)
Python library for computing the number of absorption features of the 21 cm forest in a semianalytic formalism. Includes the enhancement of the signal due to the presence of substructures within minihalos, as studied in arXiv:2209.01305. It supports non-standard cosmologies with impact in the large scale structure, such as warm dark matter and primordial black holes. See the papers arXiv:2209.01305, arXiv:2104.10695 for more details.
The code is written in Python3, and makes use of the package for cosmological computations Colossus, as well as several standard Python libraries(numpy
,scipy
,tqdm
), which are automatically installed when hayashi
is installed.
For installing the Python package from PyPI:
pip install hayashi
The basis of the code is the 21 cm Forest
class. Given a redshift and the temperature of the intergalactic medium at that epoch, we can define an instance of the state of the 21 cm forest.
from hayashi.forest import Forest
from hayashi.cosmo import Tk_ad
# Define the redshift of interest
z = 10
# Get the adiabatic temperature of the intergalactic medium at z
Tk = Tk_ad(z)
forest = Forest(z, Tk)
This allows to call different observables such as the optical depth or the number of absorbers.
# Get a the optical depth, as a matrix in mass and impact parameter
tau = forest.tau_tot
# Get the number of absorption features and its (logarithmic) derivative with respect to tau
Nabs, dNabsdtau = forest.num_absorbers()
It is straightforward to include non-standard cosmologies by replacing the halo mass function, either using those included in the code or defined by the user. This is an example with primordial black holes, which modify the halo mass function due to a shot noise isocurvature mode (see arXiv:2104.10695):
from hayashi.nlcdm import dndlnM_PBH
# Define a cosmology where 10 % of dark matter is composed by primordial black holes of 1 solar mass
forest_PBH = Forest(z, Tk, dndlnM = lambda M, z: dndlnM_PBH(M, z, fpbh = 0.1, Mpbh = 1.))
See the source code at hayashi
for more details, and the sample notebooks for examples of usage.
In order to illustrate the usage of the library, we include several example notebooks:
-
absorbers_example.ipynb
: computes all the relevant outputs for the 21 cm forest, such as the optical depth, the maximum impact parameter and the number of absorbers, comparing the cases with and without the subhalo contribution. -
nlcdm_example.ipynb
: compares the standard CDM 21 cm forest with different non-standard cosmologies: warm dark matter and primordial black holes. -
density_profiles.ipynb
: compares the 21 cm forest outputs for different density profiles: NFW and uniform. -
tidal_disruption.ipynb
: compares the 21 cm forest observables when tidal disruption is considered in subhalos.
If you use the code, please link this repository, and cite arXiv:2209.01305 and the DOI 10.5281/zenodo.7044255.
For comments, questions etc. you can contact me at pablo.villanueva.domingo@gmail.com