Installation Guide

PyBird supports flexible installation modes to accommodate different computational needs and environments.

Installation from Repository

For current development and testing, install directly from the GitHub repository:

git clone https://github.com/pierrexyz/pybird.git
cd pybird

Choose your installation mode:

Core PyBird

pip install -e .

Includes: NumPy, SciPy, H5PY, pyyaml, fftlog, emcee, iminuit + documentation tools + development tools

PyBird-JAX

pip install -e ".[jax]"

Includes: Everything in Core + JAX ecosystem (jax, jaxlib, flax, optax, numpyro, blackjax, nautilus-sampler)

PyPI Installation

PyBird is available on PyPI with both core and JAX installation modes:

Core Installation (NumPy Backend)

For basic functionality with NumPy backend:

pip install pybird-lss

This installs essential dependencies:

  • numpy, scipy, h5py

  • emcee, iminuit

  • pyyaml

  • fftlog-lss

  • documentation and development tools

JAX Installation (Accelerated Computing)

For JAX-accelerated functionality:

pip install "pybird-lss[jax]"

This includes everything in Core plus the JAX ecosystem:

  • jax, jaxlib

  • flax, optax

  • numpyro, blackjax

  • nautilus-sampler

  • interpax

Troubleshooting

JAX Installation Issues

If JAX installation fails, try platform-specific installations:

# CPU-only JAX (most compatible)
pip install -e ".[jax]" --extra-index-url https://storage.googleapis.com/jax-releases/jax_cpu_releases.html

# CUDA support (NVIDIA GPUs)
pip install -e ".[jax]" --extra-index-url https://storage.googleapis.com/jax-releases/jax_cuda_releases.html

Testing Your Installation

Verify your PyBird installation works correctly by running the test suite (available if you clone the repository). These may take a few minutes but we recommend running tests after an install as these will also automatically build cached loop matrices for the default configuration that can be used in future computations.

cd tests

# Run all tests (recommended)
python run_tests.py

# Test specific components
python run_tests.py --class correlator
python run_tests.py --class bird
python run_tests.py --class likelihood
python run_tests.py --class emulator
python run_tests.py --class utils

Expected Output:

🎉 All tests passed!

The tests automatically work with both NumPy and JAX backends (i.e. it will skip the JAX tests if JAX is not installed), verifying that your installation mode is functioning correctly.

Dependencies

Core PyBird

  • NumPy - Numerical computing library

  • SciPy - Scientific computing library

  • h5py - HDF5 file format support

  • PyYAML - YAML configuration file support

  • fftlog-lss - FFTLog routines

JAX

  • JAX - Accelerated computing: jit, vmap, AD, and NN-embedding

  • jaxlib - Companion to JAX providing XLA and GPU/TPU support

  • Flax - Neural network library for JAX

  • Optax - Gradient processing and optimization library for JAX

  • NumPyro - Probabilistic programming with NumPy and JAX

  • BlackJAX - Sampling algorithms for JAX

  • nautilus-sampler - Nested sampling for high-dimensional inference

Boltzmann codes

Cosmological Boltzmann solver for background evolution and linear perturbations compatible with PyBird

Running with MontePython

To run with MontePython 3, once PyBird is installed as above,

  • Copy the likelihood folder montepython/likelihoods/eftboss to your working MontePython repository: montepython_public/montepython/likelihoods/

  • Copy the data folder data/eftboss to your working MontePython data folder: montepython_public/data/

  • Run the likelihood of BOSS DR12 with the input param file montepython/eftboss.param

  • Posterior covariances for Metropolis-Hasting Gaussian proposal (in MontePython format) can be found here.