Preserve CCL neutrino masses and species in CAMB predictions - #97
Open
cailmdaley wants to merge 2 commits into
Open
cailmdaley wants to merge 2 commits into
cailmdaley wants to merge 2 commits into
Conversation
CAMB previously defaulted to one 0.06-eV neutrino regardless of the CCL cosmology, so sigma8-to-As normalization and lensing spectra used the wrong background. Transfer the mass sum and resolved species, temperature and density as CCL does in its CAMB interface, and remove the redundant neutrino subtraction from CDM. Also preserve Neff, CMB temperature and curvature, and apply dark energy before normalization. Test massless, scalar and per-species inputs and the CCL/CAMB lensing mass response.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0133mw5vATUB7QfqbhYac7Fz
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CAMB silently used its default 0.06-eV neutrino instead of the CCL mass, including during σ₈→Aₛ normalization.
The bridge now transfers the summed mass and resolved species, densities and temperatures, matching CCL's CAMB interface rather than approximating its hierarchy.
It also preserves Neff, T_CMB and Omega_k, applies w/wa before normalization, and removes the redundant neutrino subtraction from cold dark matter.
CAMB/CCL − 1 at ℓ=1000 (Planck defaults at fixed σ₈; Gaussian n(z), mean 0.7, width 0.2; CAMB 2.0.4 / CCL 3.3.6):
The two backends' mass responses agree within 1.3% at ℓ=100, 500 and 1000; their different nonlinear models remain unchanged.
All 50 tests in
test_camb_neutrinos.py,test_cosmology.pyandtest_cosmo.pypass in the Slurm/container environment.Tests cover zero mass, scalar/array inputs, normal/inverted/equal splits, background parameters and σ₈ normalization.
Default sp_validation iNKA predictions also change slightly because the bridge now preserves CCL's normal-hierarchy species (about +0.09% in this C₁₀₀₀).
Closes #96
— Sol on behalf of Cail
🤖 Generated with Claude Code