- The paper introduces CosmoForge I, a unified Python toolkit that combines QML power spectrum estimation with pixel-based Gaussian likelihood analysis for spherical data.
- It leverages both pixel and harmonic implementations, adapting to computational demands while effectively handling non-diagonal noise and mask-induced mode coupling.
- Extensive validation, including Monte Carlo simulations and Planck cross-checks, demonstrates unbiased, minimum-variance estimates and robust cosmological parameter inference.
CosmoForge I: A Unified Framework for QML Power Spectrum Estimation and Pixel-Based Likelihood Analysis
Introduction and Motivation
CosmoForge addresses a central challenge in large-scale cosmological data analysis: unifying optimal Quadratic Maximum Likelihood (QML) power spectrum estimation with pixel-based Gaussian likelihood inference for scalar and tensor fields on the sphere, accounting for realistic, non-diagonal noise covariance structures. Historically, optimal CMB power spectrum analyses at low multipoles (ℓ) have depended on implementations that handle either estimation or likelihood but not both within one coherent, validated framework. Furthermore, no public software previously combined support for both pixel- and harmonic-basis computation, generalized (possibly correlated) noise, spin-2 fields, and native binning or decorrelation of power spectrum estimates. CosmoForge aims to fill this gap with a modular, extensible, and validated Python-based toolkit.
CosmoForge implements the canonical QML estimator, which provides unbiased, minimum-variance estimates of the angular power spectrum {Cℓ} by constructing quadratic estimators normalized by the Fisher information matrix. Both pixel-space and harmonic-basis (Sherman–Morrison–Woodbury, SMW) implementations are supported, with automatic selection of the optimal path depending on computational cost. This flexibility is crucial for scaling analyses from large, low-resolution (pixel-dominated) datasets to smaller, high-resolution cases where harmonic methods are more tractable.
The framework accommodates spin-0 and spin-2 fields, supporting the full set of auto- and cross-spectra, and allows for non-block diagonal, spatially correlated noise covariance — a requirement for realistic CMB likelihoods and polarization analyses.
Key Aspects of QML Implementation
- Signal and Noise Modeling: Generalizes to arbitrary combinations of fields (e.g., T, Q, U for the CMB; galaxy surveys).
- Covariance Assembly: Efficient construction of the total covariance C=S+N in both pixel and harmonic representations.
- Estimator Optimality: Saturating the Cramér–Rao bound for unbiased spectrum estimation, with rigorous handling of mask-induced mode coupling and noise anisotropy.
- Multipole Binning and Normalisation Options: Supports binned bandpower estimation, Fisher-weighted decorrelation, and window-function-convolved outputs.
- Cross-Correlation Modes: Accommodates both joint (block-structured) and independent (cross-QML) approaches for cross-spectra.
The direct pixel-based likelihood computes the true Gaussian log-likelihood lnL=−21[d⊤C−1d+ln∣C∣], providing a rigorous end-to-end path from maps to parameter inference.
Architecture and Implementation
CosmoForge is partitioned into three installable packages: CosmoCore (computational infrastructure), QUBE (QML estimation pipeline), and PICSLike (pixel-based likelihood evaluation). All core algorithms are implemented in Python but numerically accelerated via Numba JIT and optimized BLAS/LAPACK routines, ensuring practical feasibility on both cluster and workstation hardware. MPI parallelization is implemented for both Fisher trace evaluation and parameter-grid likelihood sweeps.
(Figure 1)
Figure 1: Architecture and data flow of CosmoForge, showing interchangeable pixel and harmonic computation bases driving both QML estimation (QUBE) and pixel-likelihood (PICSLike) via a unified interface.
- Computation Basis Abstraction: A shared interface exposes both pixel and harmonic implementations for covariance, inversion, and derivatives. The SMW basis leverages the low-rank structure of the signal plus noise, reducing cost for high-ℓ analyses.
- Field Block-Diagonalization: Automatic detection and exploitation of field group independence at the covariance level minimizes computational overhead in multi-field, multi-spectrum scenarios.
CosmoForge has undergone exhaustive validation:
- Cross-Checks with Planck Low-ℓ Reference: All primary outputs (signal and noise covariance, Fisher matrix, QML bandpowers, pixel-likelihood) are consistent to double-precision limits with the Planck collaboration’s Fortran reference implementations.
- Monte Carlo Validation: 104 simulations of CMB polarization fields confirm QML unbiasedness at the 10−8 level, absence of E-to-B leakage, and variance saturation with Fisher predictions.
Figure 2: Monte Carlo validation of the QML estimator for the BB power spectrum — mean deviation from input is negligible compared to estimator uncertainty.
- Variance/Optimality vs. Pseudo-Cℓ: QML consistently yields tighter error bars, with up to 60% lower variance at low sky fraction compared to state-of-the-art pseudo-{Cℓ}0 approaches such as NaMaster, and maintains statistical optimality across a wide range of masks and resolutions.
Figure 3: Standard deviation of the estimated {Cℓ}1 spectrum versus Fisher-predicted errors as a function of sky fraction; empirical and predicted variances coincide at all tested configurations.
- End-to-End Pixel-Likelihood Inference: Likelihood surfaces for cosmological parameters (e.g., tensor-to-scalar ratio {Cℓ}2) are unbiased, and upper limits are consistent with simulated truths.
Figure 4: Mean-{Cℓ}3 PICSLike likelihood curve for tensor-to-scalar ratio {Cℓ}4 from {Cℓ}5 simulations; recovered limits are consistent with input values with high precision.
- Consistency with Alternate Estimators: Empirical bandpower correlation matrices confirm QML outputs are closer to diagonal (uncorrelated), unlike pseudo-{Cℓ}6 outputs which display strong mask-induced mode coupling.
Figure 5: Comparison of CosmoForge QML estimator and NaMaster: QML recovers mean spectra with lower variance and uncorrelated bandpowers.
Figure 6: Bandpower correlation matrices — QML (upper triangle) vs. NaMaster pseudo-{Cℓ}7 (lower triangle) — illustrating the superior decorrelation properties of the QML approach.
Algorithmic and Computational Considerations
Key algorithmic advances of CosmoForge include:
- SMW Reformulation: Reduces the cubic scaling with pixel count to cubic or quartic in mode count, depending on the stage.
- Sparse and Blockwise Fisher Trace Evaluation: Achieves {Cℓ}8 scaling for the Fisher matrix computation, crucial for tractable analyses at {Cℓ}9.
- Field Block-Diagonalisation and Multipole Windowing: Automatically exploits block-diagonal structure for both speed and memory savings; multipole switching reduces kernel dimension for targeted parameter inference.
- Numerical Stability: Careful evaluation of projected inverses and traces to prevent catastrophic cancellation in the high signal-to-noise regime.
Empirical performance benchmarks demonstrate practical wall-times — e.g., Fisher matrix plus 10 QML realizations for C=S+N0, C=S+N1, C=S+N2 completed in under 25 minutes on a single multi-core node, with acceptable per-rank memory usage.
Feature Landscape and Code Comparison
CosmoForge unifies capabilities previously distributed among multiple single-purpose codes. Unlike prior tools such as ECLIPSE, xQML, QML-FAST, or legacy Planck Fortran codes, CosmoForge provides in one package:
- Simultaneous support for spin-0 and spin-2 fields, all cross/auto-spectra, and both joint and cross-spectra estimation.
- Native handling of non-diagonal, correlated noise.
- Both harmonic (SMW) and direct pixel-basis computation, automatically selected for cost.
- Decorrelated and window-convolved bandpowers as well as conventional deconvolved estimates.
- Direct pixel-likelihood routines with MPI parallelization.
- Full validation against Planck reference calculations.
- Comprehensive, pip-installable Python packaging, modern YAML-based configuration, and modular design for extensibility to non-CMB science.
Implications and Future Directions
Practically, CosmoForge lowers the barrier for optimal, interpretable, and reproducible estimation in CMB, large-scale structure, and related spherical data applications. The combination of QML and full pixel-likelihood pathways in one framework is particularly pertinent for future missions (e.g., LiteBIRD, Simons Observatory, CMB-S4) with demanding requirements on systematics control, correlated noise, and multi-field cross-analysis.
Theoretically, this unification enables more robust validation of analytic approximations, exploration of systematic cross-correlations, and facilitates methodological extensions such as iterative QML and hybrid optimal-binned analyses. CosmoForge’s design also opens the door to further advances, including integration with GPU computation and cosmological sampling frameworks.
Conclusion
CosmoForge represents a significant step toward the consolidation and modernization of optimal power spectrum and parameter inference pipelines for spherical cosmological fields. By exposing validated, computationally optimized, and feature-complete QML and pixel-likelihood tools with a clean Python interface, CosmoForge directly supports the scientific goals of current and future CMB and large-scale structure experiments, and sets a foundation for new algorithmic developments in spherical data analysis.
Reference:
"CosmoForge I: A unified framework for QML power spectrum estimation and pixel-based likelihood analysis" (2605.21149)