Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better sampling of sigma_8 #86

Merged
merged 5 commits into from
Jul 17, 2023

Conversation

tilmantroester
Copy link
Contributor

This PR replaces the janky sigma_8 sampling setup. Instead of running CAMB twice, the transfer function (which takes the most time) is only computed once and then the power spectra are recomputed using the correct A_s corresponding to the requested sigma_8.

This speeds things up by ~50% and also avoids the numerical uncertainty in the initial estimate of sigma_8 due to the low accuracy settings of the first run. Since sigma_8_input now agrees with the output sigma_8, I added the option of taking sigma_8 as the input directly. If both sigma_8 and A_s are provided, sigma_8 takes precedence.

This approach could in principle be used to do fast sampling of all non-cosmology parameters, such as primordial power spectrum parameters in general or HMCode parameters. See for example cells 50 onward here: https://camb.readthedocs.io/en/latest/CAMBdemo.html

Copy link
Owner

@joezuntz joezuntz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more request - could you update e.g the des-y1 ini file to use the new name. That is tested in the CI.

boltzmann/camb/camb_interface.py Show resolved Hide resolved
boltzmann/camb/camb_interface.py Outdated Show resolved Hide resolved
@tilmantroester
Copy link
Contributor Author

Back to you!

@joezuntz joezuntz merged commit 54f641f into joezuntz:main Jul 17, 2023
@joezuntz
Copy link
Owner

Brilliant, thanks for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants