📚 Complete Documentation | Installation Guide | Quick Start | API Reference
CosmoForge is a comprehensive Python framework for power spectrum estimation and likelihood analysis of spin-0 and spin-2 fields on the sphere, using Fisher matrix, Quadratic Maximum Likelihood (QML), and pixel-based likelihood methods. While widely applicable to any sky signal (e.g. CMB, galaxy surveys, 21 cm), it is particularly optimized for the analysis of partial-sky, noisy observations with complex noise covariance.
Overview
CosmoForge consists of several interconnected packages designed for efficient and accurate cosmological parameter estimation:
- cosmocore: Core functionality for cosmological analysis including field management, matrix operations, and I/O utilities
- qube-qml: QML and Fisher matrix implementations for power spectrum estimation (imported as
qube) - picslike: Pixel-based Inference with Correlated-Skies Likelihood — pixel-space likelihood analysis for parameter estimation
Features
- Fisher Matrix Analysis: Fast Fisher matrix computation for cosmological parameter forecasting
- QML Power Spectrum Estimation: Quadratic Maximum Likelihood estimation for optimal power spectrum recovery
- Pixel-Based Likelihood: Direct likelihood evaluation in map pixel space for parameter estimation
- MPI Parallelization: Efficient parallel computation support for large-scale analyses
- HEALPix Integration: Full support for HEALPix pixelization scheme
- Flexible Field Management: Support for scalar (spin-0) and tensor (spin-2) fields
- Beam and Noise Modeling: Comprehensive instrumental effects modeling
Installation
📖 For detailed installation instructions, see the Installation Guide
Requirements
- Python 3.11–3.13
- NumPy, SciPy
- healpy
- mpi4py (for parallel computation)
Install from PyPI
The umbrella distribution installs all three subpackages:
pip install cosmoforge
Or pick subpackages individually:
pip install cosmocore # core utilities only
pip install qube-qml # adds QML / Fisher (imported as `qube`)
pip install picslike # adds pixel-space likelihood
Install from source
git clone https://github.com/ggalloni/CosmoForge.git
cd CosmoForge
uv sync --all-packages --all-extras --dev
Quick Start
🚀 For comprehensive tutorials and examples, visit the Quick Start Guide and Tutorials
Fisher Matrix Analysis
from qube import Fisher
# Initialize Fisher analysis
fisher = Fisher("config/fisher_config.yaml")
fisher.run()
# Get Fisher matrix
fisher_matrix = fisher.get_fisher_matrix()
QML Power Spectrum Estimation
from qube import Spectra
# Initialize QML analysis
qml = Spectra("config/qml_config.yaml")
qml.run()
# Get power spectra
power_spectra = qml.get_power_spectra()
noise_bias = qml.get_noise_bias()
Pixel-Based Likelihood Analysis
from picslike import PICSLike
# Initialize pixel-based likelihood
picslike = PICSLike(params="config/picslike_config.yaml")
picslike.run()
# Get results
chi_squared = picslike.get_chi_squared()
best_fit = picslike.get_best_fit()
Using with Precomputed Fisher
from qube import Fisher, Spectra
# Compute Fisher matrix first
fisher = Fisher("config/fisher_config.yaml")
fisher.run()
# Reuse Fisher computation for QML
qml = Spectra("config/qml_config.yaml", fisher=fisher)
qml.run()
Package Structure
CosmoForge/
├── src/
│ ├── cosmoforge.cosmocore/ # Core functionality (published as `cosmocore`)
│ ├── cosmoforge.qube/ # QML and Fisher analysis (published as `qube-qml`, imported as `qube`)
│ ├── cosmoforge.picslike/ # Pixel-space likelihood (published as `picslike`)
│ └── cosmoforge.meta/ # Umbrella metapackage (published as `cosmoforge`)
├── tests/ # Test suite
├── docs/ # Documentation
└── examples/ # Example configurations
Configuration
CosmoForge uses YAML configuration files to specify analysis parameters:
# Example configuration
nside: 4
lmax: 16
fields: "TEB"
maskfile: "data/mask.fits"
inputclfile: "data/fiducial_cls.txt"
# ... additional parameters
Testing
Run the test suite:
# Run all tests
uv run pytest
# Run specific package tests
uv run --package cosmocore pytest src/cosmoforge.cosmocore/tests/
uv run --package qube pytest src/cosmoforge.qube/tests/
uv run --package picslike pytest src/cosmoforge.picslike/tests/
Performance
CosmoForge is designed for high-performance cosmological analysis:
- Numba JIT compilation for critical mathematical operations
- MPI parallelization for distributed computing
- Optimized matrix operations using LAPACK/BLAS
- Memory-efficient algorithms for large datasets
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
License
[Add license information]
Citation
If you use CosmoForge in your research, please cite:
Galloni, G. & Pagano, L., CosmoForge. I. A unified framework for quadratic maximum likelihood power spectrum estimation and pixel-based likelihood analysis, A&A (2026), doi:10.1051/0004-6361/202661478, arXiv:2605.21149.
If you apply a pixel-space filter (pixel_filter= or cosmocore.filters), please also cite:
Galloni, G., CosmoForge. II. An exact treatment of arbitrary linear filters in quadratic maximum-likelihood power spectrum estimation, arXiv:2610.18012 (2026).
BibTeX entries for both are on the citation page of the documentation.
Support
📖 Complete documentation is available at: https://cosmoforge.readthedocs.io/en/latest/
For questions and support:
- Open an issue on GitHub
- Contact: [contact information]
Acknowledgments
CosmoForge builds upon established cosmological analysis methods and libraries:
- HEALPix for pixelization
- NumPy/SciPy for numerical computations
- MPI for parallelization
Metadata
Release files for cosmoforge 1.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cosmoforge-1.3.0.tar.gz | 5.3 kB | With provenance | Details for cosmoforge-1.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cosmoforge-1.3.0-py3-none-any.whl | Python 3 | none | any | Details for cosmoforge-1.3.0-py3-none-any.whl |
Total release size: 9.3 kB
Release files / cosmoforge-1.3.0.tar.gz
| Download URL | cosmoforge-1.3.0.tar.gz |
|---|---|
| Size | 5.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
67ac137142ac8204cd46d4564fc321adc051f2c476f609929b0c41565dcdc2ba
|
|
BLAKE2b-256 checksum How to use checksums |
f668dac7b3140cc0f84ad1925eb3850aae152280c49759d2b442b1c9d2461e28
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.
Transparency logRelease files / cosmoforge-1.3.0-py3-none-any.whl
| Download URL | cosmoforge-1.3.0-py3-none-any.whl |
|---|---|
| Size | 4.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a8e553a901de0f54779253a9af0e8c9d89c72aebf726a5a0d67bef39178fde6c
|
|
BLAKE2b-256 checksum How to use checksums |
c7741cb2f2e8628936fa6d91e203e16112e13882cc644d4ee4f1e77767009f13
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.
Transparency logSecurity for cosmoforge 1.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for cosmoforge-1.3.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.