Skip to content

santiagocasas/topo-cobaya

 
 

Repository files navigation

TOPO-Cobaya

TOPO-Cobaya is a fork of Cobaya to cryptographically verify results of cosmological inference

Using TOPO: Time-Ordered Provable Outputs

TOPO (Time-Ordered Provable Outputs) is a cryptographic protocol for verifying the results of cosmological parameter inference. Topo in Spanish is Mole, which gives the idea of blinding.

Authors:Santiago Casas, Christian Fidler
TOPO-Cobaya
TOPO-Cobaya Source:

TOPO-Cobaya at GitHub

TOPO Source:

TOPO code at GitHub

Documentation:

Same as Cobaya's documentation, see below.

TOPO Documentation:

At TOPO's Github

TOPO paper:

Time Ordered Provable Outputs arXiv:2411.00072

Installation:

Only development mode at the moment.

git clone https://github.com/santiagocasas/topo-cobaya.git

cd topo-cobaya

## Create a new fresh environment and install dependencies ## Make sure your python version is 3.9 or above (if needed, use python3 or python3.9.x in your system)

python -m venv topoenv

source topoenv/bin/activate

pip install -r requirements.txt

pip install -e .

Cobaya cosmological installation:

For installing all cosmological codes.

cobaya-install cosmo -p cosmo/

TOPO-Cobaya example of a successful verification

This section explains how to run and verify an example analysis with TOPO-Cobaya.

The example run is a simple Gaussian mixture likelihood.

The script to run this analysis is located at scripts/gaussianmix.yaml.

It contains a random seed, which is necessary for the verification process to be reproducible.

Type topocobaya -h in the command line to see the available commands.

:Copy the topo/params.json.template file to topo/params.json and modify it to your needs.

Create a new private key:

encrypt your key with a password for more security

topocobaya keygen

If you already have a private key:

topocobaya keygen --load path/to/your/private_key.txt

Freeze your analysis pipeline:

this creates a pre-commit object

topocobaya freeze -p scripts/gaussianmix.yaml

Run your analysis:

This creates chains at chains/gaussianmix.*

cobaya-run scripts/gaussianmix.yaml

Generate proof of your analysis:

this creates the Merkle tree and the proof object

topocobaya proof -p scripts/gaussianmix.yaml

Verify the proof of your analysis:

topocobaya verify -p scripts/gaussianmix.yaml

If the verification is successful, you will see the following message: Full Verfiication completed! sTOPOing cobaya!

Verification of an example BAO likelihood MCMC run

TOPO-Cobaya installation of dependencies:

for the example BAO likelihood

cobaya-install --upgrade scripts/BAOs.yaml

Run previous steps using the same commands:

using this script

scripts/BAOs.yaml

Cobaya, a code for Bayesian analysis in Cosmology

Author:Jesus Torrado and Antony Lewis
Source:Source code at GitHub
Documentation:Documentation at Readthedocs
Licence:LGPL + bug reporting asap + arXiv'ing of publications using it (see LICENCE.txt for details and exceptions). The documentation is licensed under the GFDL.
E-mail list:https://cosmocoffee.info/cobaya/sign up for important bugs and release announcements!
Support:For general support, CosmoCoffee; for bugs and issues, use the issue tracker.
Installation:pip install cobaya --upgrade (see the installation instructions; in general do not clone)
https://img.shields.io/travis/com/CobayaSampler/cobaya https://readthedocs.org/projects/cobaya/badge/?version=latest https://img.shields.io/pypi/v/cobaya.svg?style=flat https://static.pepy.tech/personalized-badge/cobaya?period=total&units=international_system&left_color=grey&right_color=blue&left_text=pypi%20downloads https://img.shields.io/badge/arXiv-2005.05290-b31b1b.svg?color=0B6523

Cobaya (code for bayesian analysis, and Spanish for Guinea Pig) is a framework for sampling and statistical modelling: it allows you to explore an arbitrary prior or posterior using a range of Monte Carlo samplers (including the advanced MCMC sampler from CosmoMC, and the advanced nested sampler PolyChord). The results of the sampling can be analysed with GetDist. It supports MPI parallelization (and very soon HPC containerization with Docker/Shifter and Singularity).

Its authors are Jesus Torrado and Antony Lewis. Some ideas and pieces of code have been adapted from other codes (e.g CosmoMC by Antony Lewis and contributors, and Monte Python, by J. Lesgourgues and B. Audren).

Cobaya has been conceived from the beginning to be highly and effortlessly extensible: without touching cobaya's source code, you can define your own priors and likelihoods, create new parameters as functions of other parameters...

Though cobaya is a general purpose statistical framework, it includes interfaces to cosmological theory codes (CAMB and CLASS) and likelihoods of cosmological experiments (Planck, Bicep-Keck, SDSS... and more coming soon). Automatic installers are included for all those external modules. You can also use cobaya simply as a wrapper for cosmological models and likelihoods, and integrate it in your own sampler/pipeline.

The interfaces to most cosmological likelihoods are agnostic as to which theory code is used to compute the observables, which facilitates comparison between those codes. Those interfaces are also parameter-agnostic, so using your own modified versions of theory codes and likelihoods requires no additional editing of cobaya's source.

How to cite us

If you use cobaya, please cite its pre-print, arXiv:2005.05290, and its ASCL record, ascl:1910.019.

To appropriately cite the packages (samplers, theory codes, likelihoods) that you have used, simply run the script cobaya-bib with your input file(s) as argument(s), and you will get bibtex references and a short suggested text snippet for each module mentioned in your input file. You can find a usage example here.

Acknowledgements

Thanks to J. Lesgourgues and W. Handley for support on interfacing CLASS and PolyChord respectively.

Thanks too to G. Cañas Herrera, A. Finke, X. Garrido, S. Heimersheim, L. Hergt, C. Hill, P. Lemos, M.S. Madhavacheril, V. Miranda, T. Morton, M. Rashkovetskyi, J. Zunz and many others for extensive and somewhat painful testing.


University of Sussex RWTH Aachen European Research Council STFC

About

TOPO-Cobaya: Time-Ordered Provable Outputs with Cobaya inference

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 97.1%
  • TeX 2.1%
  • Other 0.8%