lesgourg / class_public

Public repository of the Cosmic Linear Anisotropy Solving System (master for the most recent version of the standard code; GW_CLASS to include Cosmic Gravitational Wave Background anisotropies; classnet branch for acceleration with neutral networks; ExoCLASS branch for exotic energy injection; class_matter branch for FFTlog)
218 stars 291 forks source link

Strange output from halofit & hmcode when DM-baryon scattering is enabled #571

Open ctrendafilova opened 4 months ago

ctrendafilova commented 4 months ago

Hi, I would like to report some strange outputs from the non-linear P(k) computations (via both halofit and hmcode) when enabling additional dark sector interactions. In particular, here are some examples for dark matter-baryon scattering (section 7.2.3 in the explanatory file), though I see similar results for other models in section 7 as well.

I have set m_idm = 1.0e9, f_idm = 1.0, n_index_idm_b = 0. The value of the scattering cross-section is specified in the legend of each plot.

The right-hand panel shows the fractional change in the lensing power spectrum compared to using only the linear P(k) computation. I understand that halofit and hmcode are calibrated from sims that do not include this kind of exotic physics, so I was not expecting their outputs to be correct; however the behavior looks even more worrisome/unphysical than that.

0.pdf 2e-25.pdf 5e-25.pdf 1e-24.pdf

Am I missing some setting(s) that I need to change from their defaults? I know very little about hmcode/halofit and I don't really know how one would troubleshoot this. If it is not a trivial fix (which I imagine it is not), perhaps an error for the user would be helpful? Currently the code produces these outputs without error/failure.