cmbant / CAMB

Code for Anisotropies in the Microwave Background
https://camb.info/
Other
200 stars 147 forks source link

Confusing labelling of HALOFIT versions with massive neutrinos #88

Closed alexander-mead closed 4 months ago

alexander-mead commented 4 years ago

I was looking at the different HALOFIT versions in CAMB and found myself confused. I think others will be confused too. At the moment, the main possible HALOFIT versions (ignoring the Peacock fudge, PKequal, and HMcode) are:

If the neutrino mass is zero, then these all map to the versions that can be found in the respective papers, withstanding some very slight differences between the parameter values in the papers, those in CAMB, and those in other published codes. However, if the neutrino mass is non-zero then some extra terms activate, and I feel that the way this happens is quite non intuitive given the labels.

The neutrino mass affects the calculation in two distinct places: The first is in the calculation of beta, which occurs on lines 368 and 388 of https://github.com/cmbant/CAMB/blob/master/fortran/halofit.f90 with line 368 being used if HALOFIT is either Smith or Bird, and line 388 being used if it is Takahashi. The second place the neutrino mass affects the calculation is in the calculation of the quasi-linear and halo terms on lines 414 and 415, which are used by all versions of HALOFIT.

The equation on line 368 is very similar to what is in the Bird et al. (2012) paper, but those on lines 388 and 414/415 do not appear in any paper, but in conversations with Simeon Bird I am told that they are re-fittings of the Bird et al. (2012) model but using Takahashi et al. (2012) as a baseline for the model, rather than Smith et al. (2003). I am certainly not complaining about these unpublished results, and doing this re-fitting seems very sensible given the content of the two papers that came out at very similar times.

My confusion arises because the following happens when I have massive neutrinos:

What I expected to happen was that I would get what was written in the papers, so that Smith and Takahashi would have no explicit massive-neutrino dependence and Bird would have exactly what was published in the Bird et al. (2012) paper. My feeling is that it would be better to have what was written in the papers, rather than the confusing mix situation described in the above bullet points. As it stands there is no way to get the published Smith et al., Bird et al. or Takahashi et al. results out of the CAMB implementation of HALOFIT when you have massive neutrinos.

I would then suggest adding a new HALOFIT version (called Bird_Takahashi maybe?) which would be the default, which would contain the unpublished version of the Bird et al. (2012) model with Takahashi et al. (2012) used as the baseline. Does that make sense?

cmbant commented 4 years ago

You don't want to make your new HMcode the default?

alexander-mead commented 4 years ago

Ah, well, that might be better for me. But I think I'd rather wait for the paper to be reviewed before recommending you changed the default model.

cmbant commented 3 years ago

Happy to add more refined/less ambiguous mnu names, and/or make the new HMcode the default if you want to make a PR.

alexander-mead commented 3 years ago

Let me open a separate issue to do with the default non-linear model.

Regarding the HALOFIT versions, would it be helpful if I implemented this in a pull request? I could probably find time to do that this week. I think that it would be useful to involve @sbird in this discussion to make sure that he agrees with what I would like to do.

Summary: Update HALOFIT versions so that there would be Smith, Takahashi, Bird, and Takahashi_Bird where the first three of these would map exactly to the published papers, while Takahashi_Bird would map to what is currently labelled Takahashi in CAMB.

I'm also happy not to do this if you think this is unnecessary/unwise. It is certainly not adversely affecting any of my work at the moment.

cmbant commented 3 years ago

Thanks, good for me, might certainly be useful to clarify it - I'm a bit lost on all the variations. (and no way I can meaningfully test them either) As long as it's backwards compatible/consistent should be fine.

alexander-mead commented 3 years ago

Hmm... the changes I was planning to make would not be backwards compatible. I was planning to alter the way that Smith, Bird and Takahashi work for cosmologies with massive neutrinos because I think that the way in which they are currently implemented does not reflect what is written in the respective papers.

Then I was planning to add a new version Takahashi_Bird, which would be identical to the current Takahashi version, which is the unpublished hybrid of the two versions.

cmbant commented 3 years ago

Could add new names with date tags that match the papers or something?

sbird commented 3 years ago

Happy with new names with date tags that match the papers. It's largely moot at this point with M_nu < 0.2 anyway.

JiachuanXu commented 4 months ago

Hi all and thank you for all those discussions! I just want to quickly double-check after reading the threads: If I want nonlinear Pk with Takahashi halofit with Bird re-fits for massive neutrino, I should use halofit_version=takahashi, right?

cmbant commented 4 months ago

I think so. I might close this issue, but happy to add new names if someone wants to make a PR