cosmicfishpie is a Python package for cosmological Fisher forecasts. It is designed to help prepare and compare forecasts for surveys such as Euclid, DESI, SKAO, and CMB experiments, using flexible pipelines that combine cosmology backends, survey specs, and post-processing tools.
- Compute Fisher matrices for multiple observables (e.g. spectroscopic/photometric galaxy probes and CMB spectra).
- Use established Einstein-Boltzmann solvers such as CAMB (and configurable backend workflows).
- Choose finite-difference strategies and numerical settings for derivatives and stability.
- Run likelihood-based Bayesian sampling with Nautilus (nested sampling / MCMC-style posterior analysis).
- Combine, reparameterize, and post-process Fisher matrices after the initial run.
- Generate publication-ready comparison and corner plots.
cosmicfishpie supports Python >=3.10,<3.13.
Create a virtual environment and install from source:
git clone https://github.com/santiagocasas/cosmicfishpie.git
cd cosmicfishpie
uv venv --python 3.11
source .venv/bin/activate
uv sync --extra devFor a lighter install (without the dev extras):
uv syncIf you prefer Conda-style environments, create one with mamba (or conda) and install from source in editable mode:
mamba create -n cosmicfishpie -c conda-forge python=3.11 pip
mamba activate cosmicfishpie
git clone https://github.com/santiagocasas/cosmicfishpie.git
cd cosmicfishpie
pip install -e .This setup lets you manage the environment with conda-forge while using the latest repository version.
After installation, run:
python -c "import cosmicfishpie; print('cosmicfishpie import OK')"If you installed from source (dev setup), you can also run tests:
uv run pytestimport cosmicfishpie.fishermatrix.cosmicfish as cff
options = {
"accuracy": 1,
"feedback": 2,
"outroot": "example_run",
"results_dir": "results/",
"derivatives": "3PT",
"nonlinear": True,
"cosmo_model": "LCDM",
"code": "camb",
"survey_name": "Euclid",
"survey_name_spectro": "Euclid-Spectroscopic-ISTF-Pessimistic",
}
observables = ["GCsp"]
fiducial = {"Omegam": 0.32, "h": 0.67}
freepars = {"Omegam": 0.01, "h": 0.01}
fm = cff.FisherMatrix(
fiducialpars=fiducial,
freepars=freepars,
options=options,
observables=observables,
cosmoModel=options["cosmo_model"],
surveyName=options["survey_name"],
)
fisher_matrix = fm.compute()For fuller examples and configuration details, see the documentation.
- Docs: https://cosmicfishpie.readthedocs.io/
- Repository: https://github.com/santiagocasas/cosmicfishpie
- Citation metadata:
CITATION.cff - Nautilus sampler docs (and citation info): https://nautilus-sampler.readthedocs.io/
Thanks goes to these wonderful people (emoji key):
Sefa Pamuk 💻 🎨 🤔 |
Santiago Casas 🐛 🖋 🔣 📖 💡 🤔 🚧 📆 🔬 👀 |
Matteo Martinelli 💻 🎨 🤔 |
This project follows the all-contributors specification. Contributions of any kind are welcome.
