Lyman-alpha Cosmology Emulator. This code is a normalising flow emulator for the 3D flux power spectrum of the Lyman-alpha forest.
The documentation includes the user guide and complete API reference generated from NumPy-style docstrings.
To build the documentation locally:
python -m pip install -e ".[docs]"
make docsOpen docs/_build/html/index.html after the build completes. Read the Docs uses
the repository's .readthedocs.yaml file to perform the same build online.
These are the parameters that describe each individual P3D(k, mu) power spectrum. We have detached these from redshift and traditional cosmology parameters.
Delta2_p is the amplitude of the (dimensionless) linear spectrum at k_p = 0.7 1/Mpc
n_p is the slope of the linear power spectrum at k_p
mF is the mean transmitted flux fraction in the box (mean flux)
sigT_Mpc is the thermal broadening scale in comoving units, computed from T_0 in the temperature-density relation
gamma is the slope of the temperature-density relation
kF_Mpc is the filtering length (or pressure smoothing scale) in inverse comoving units
In the Notebooks folder, there are several tutorials one can run to learn how to use
the emulators and archives.
- Archive tutorial: notebooks/Tutorial_archive.ipynb
- Emulator tutorial: notebooks/Tutorial_emulator.ipynb
ForestFlow requires Python 3.12 or newer. We recommend installing it in a dedicated environment:
conda create -n forestflow python=3.12
conda activate forestflowForestFlow uses LaCE for cosmology and simulation archive support. Install LaCE by following its installation instructions, then clone and install ForestFlow:
git clone https://github.com/igmhub/ForestFlow.git
cd ForestFlow
python -m pip install -e .The editable installation is recommended for development. To install the documentation and testing tools as well, use:
python -m pip install -e ".[docs,test]"Install the dependencies required by the cross-power routines with:
python -m pip install -e ".[px]"To generate notebooks from the Jupytext sources:
python -m pip install jupytext
jupytext --to ipynb notebooks/*/*.pyTo expose the environment as a Jupyter kernel:
python -m pip install ipykernel
python -m ipykernel install --user --name forestflow --display-name forestflow