[COBAYA] Modifying interface between CAMB and HALOFIT

 Posts: 12
 Joined: March 21 2016
 Affiliation: Leinweber Center for Theoretical Physics, University of Michigan
 Contact:
[COBAYA] Modifying interface between CAMB and HALOFIT
Hi,
I want to use cobaya for cosmological inference from some largescale galaxy survey(s), with a modification: the model we consider introduces parameter(s) whose functions scale the linear matter powerspectrum P(k,z).
I know that CAMB solves for the linear Bolztman equations for the density perturbations in each component of the fluid, but I'm not sure what it passes to HALOFIT exactly. If it passes the linear matter powerspectrum and that is all required by HALOFIT, presumably I should be able to "catch" the linear matter powerspectrum, before it is passed to HALOFIT, and modify that part of the code, correct? If yes, where should I attempt this? If no, what is the potential pitfall(s)? Many thanks!
I want to use cobaya for cosmological inference from some largescale galaxy survey(s), with a modification: the model we consider introduces parameter(s) whose functions scale the linear matter powerspectrum P(k,z).
I know that CAMB solves for the linear Bolztman equations for the density perturbations in each component of the fluid, but I'm not sure what it passes to HALOFIT exactly. If it passes the linear matter powerspectrum and that is all required by HALOFIT, presumably I should be able to "catch" the linear matter powerspectrum, before it is passed to HALOFIT, and modify that part of the code, correct? If yes, where should I attempt this? If no, what is the potential pitfall(s)? Many thanks!

 Posts: 27
 Joined: July 18 2005
 Affiliation: University of Michigan
 Contact:
Re: [COBAYA] Modifying interface between CAMB and HALOFIT
Let me try to rephrase the question a bit (Minh and I are working together):
We would like to "forcefeed" CAMB to use the linear power spectrum P(k, z) with the growth index [f = Om(a)^gamma, and corresponding D(z) which I know in general is zdependent but we will ignore that here]. One way to do this is to write
P(k, z) = P(k, 0) / [P(k, z)/P(k, 0)] * growth^2
where 'growth' is D(z) given with the gamma thing. So, divide by the true growth and multiply by the growthindex approx.
That said, in which place is the linear power reported and passed on to other functions (that compute, e.g., lensing observables)? It seems that this would be the best place to implement the above.
We would like to "forcefeed" CAMB to use the linear power spectrum P(k, z) with the growth index [f = Om(a)^gamma, and corresponding D(z) which I know in general is zdependent but we will ignore that here]. One way to do this is to write
P(k, z) = P(k, 0) / [P(k, z)/P(k, 0)] * growth^2
where 'growth' is D(z) given with the gamma thing. So, divide by the true growth and multiply by the growthindex approx.
That said, in which place is the linear power reported and passed on to other functions (that compute, e.g., lensing observables)? It seems that this would be the best place to implement the above.

 Posts: 1874
 Joined: September 23 2004
 Affiliation: University of Sussex
 Contact:
Re: [COBAYA] Modifying interface between CAMB and HALOFIT
TNonLinearModel classes are passed MatterPowerData structure with linear information. But halofit does also use cosmological parameters directly.

 Posts: 1874
 Joined: September 23 2004
 Affiliation: University of Sussex
 Contact:
Re: [COBAYA] Modifying interface between CAMB and HALOFIT
Note that CMB lensing is computed directly from the potentials outside limber approximation.
Otherwise, you can probably just change the code where it computes the linear matter power spectra.
Otherwise, you can probably just change the code where it computes the linear matter power spectra.

 Posts: 12
 Joined: March 21 2016
 Affiliation: Leinweber Center for Theoretical Physics, University of Michigan
 Contact:
Re: [COBAYA] Modifying interface between CAMB and HALOFIT
Thank you, Antony, for the reminder! I'll be careful about the CMB lensing part.
Right now, I'm undecided between two possibilities:
a/ only rescaling linear Pk inside the nonlinear module halofit.f90
b/ directly rescaling Pk inside the module results.f90, namely at.
I'm inclined to the first option, since I can factorize and reuse most of the code within that module, also I'd likely stick to LSS datasets+likelihoods, which only asks for nonlinear Pk anyway.
However, I encountered some renormalization which is possibly enforced outside of `halofit.f90`(?) I opened an issue on the CAMB github repo.
Right now, I'm undecided between two possibilities:
a/ only rescaling linear Pk inside the nonlinear module halofit.f90
b/ directly rescaling Pk inside the module results.f90, namely at
Code: Select all
Transfer_GetMatterPowerData()
I'm inclined to the first option, since I can factorize and reuse most of the code within that module, also I'd likely stick to LSS datasets+likelihoods, which only asks for nonlinear Pk anyway.
However, I encountered some renormalization which is possibly enforced outside of `halofit.f90`(?) I opened an issue on the CAMB github repo.