Code for ANalysis of modified Distance-duality with cosmological Inference
Welcome to the CANDI code!
This repository provides a cosmological analysis code to place constraints from supernovae (SN), baryon acoustic oscillations (BAO), and gravitational waves (GW) through distance measurements.
It allows you to:
Here you can find:
numpy, scipy, pandas, pyyamlcobaya, camb, getdist, nautilus# Clone the repository
git clone https://github.com/chiaradeleo1/CANDI.git
cd CANDI
# Install dependencies
pip install -r requirements.txt
The data are not included in this repository.
To reproduce the results in of (arXiv:2505.13613), you can simulate datasets and run chains using the package in Zenodo (https://doi.org/10.5281/zenodo.17043955).
The package contains a notebook to generate simulated data for:
The settings files to run the different scenarios discussed in the paper are provided in the settings/ folder and can be run using run_paper.py
Each run is controlled via a YAML settings file.
Key entries include:
output: name of the run / output folderSN_data, BAO_data, GW_data: specify which datasets to includecosmology: choose the expansion modelDDR_options: enable DDR-breaking modelssampler: choose between mcmc or nautilusExamples of YAML files can be found in the settings/ folder for different cosmological models, while interactive notebook examples are provided under the name DEMO_
You can implement your own cosmological model by following
theory_code/expansion_models/example_custom_cosmology.py.
A valid cosmology must provide at least:
H(z) — Hubble expansion ratecomoving(z) — comoving distanceWith this interface you can:
This makes it easy to go beyond ΛCDM and test custom scenarios with SN, BAO, and GW probes.
If you use this code, please cite our papers:
C. De Leo et. al , Distinguishing Distance Duality breaking models using electromagnetic and gravitational waves measurements, arXiv:2505.13613
E. Fazzari, C. De Leo et. al , Investigating f(R)-Inflation: background evolution and constraints, arXiv:2507.13890