## CAMB: lensing

Use of Cobaya. camb, CLASS, cosmomc, compilers, etc.
Nicolas Ponthieu
Posts: 1
Joined: October 19 2004
Affiliation: IAS, Paris
Contact:

### CAMB: lensing

Hi,

I'm a new CAMB user.
I tried to run CAMB with the default parameters file, simply setting do_lensing to 1 and I'm asked to provide a realistic normalization.
I could not find on any of the site i've looked at or in documentation how to fix this and try to have the B mode produced by Weak lensing.

Does one of you guys have the solution ?
Thank you very much in advance.

Cheers,
Nicolas.

Antony Lewis
Posts: 1765
Joined: September 23 2004
Affiliation: University of Sussex
Contact:

### Re: CAMB: lensing

CAMB computes the linear theory transfer functions, so the unlensed $C_l$ you get depend linearly on the primordial fluctutation power. By default CAMB sets the primordial power in the curvature perturbation (at 0.05 h^{-1} Mpc) to be 1. To obtain realistic results you need to multiply by the actual primordial power, which is O(10^{-5})^2, i.e. A_s \sim 2.5 \times 10^{-9}.

To do this in practice just change the settings in the params.ini file e.g.

scalar_amp(1) = 2.5e-9

The output will then be dimensionless. If you'd like it in \mu K^2 also set

CMB_outputscale = 7.4311e12

(this number is (2.726 \times 10^6)^2).

Note that to get B at all accurately you need to set l_max_scalar and k_eta_max_scalar quite large (e.g. 3000, 10000). Also the result will not be accurate to percent level because CAMB assumes linear evolution of the matter perturbations, whereas B is senstive at some level to non-linear evolution.

Also note that the Aug 2004 CAMB version (and earlier) lensed C_l are not accurate to better than 1% at l > 1500. There will be a new version soon, please let me know if you want to try it.

Lukas Hollenstein
Posts: 16
Joined: March 31 2009
Affiliation: IPhT CEA-Saclay
Contact:

### CAMB: lensing

Hi,

using CosmoMC with a slightly modified CAMB and some additional parameters I encountered this issue as well, although A_s is varied in the default range

Code: Select all

param&#91;logA&#93; = 3 2.7 4 0.01 0.01
So my questions is what are the checks

Code: Select all

  if &#40;Cphil3&#40;10&#41; > 1e-7&#41; then …

if &#40;RR&#40;1&#41; > 1e-5&#41; then
write &#40;*,*&#41; 'You need to normalize realistically to use lensing.'
write &#40;*,*&#41; 'see http&#58;//cosmocoffee.info/viewtopic.php?t=94'
stop
end if

in "lensing.f90" actually based on? Is it very unsafe to comment the "stop" in those statements to avoid CosmoMC to stop when falling into that trap?

Lukas

Antony Lewis
Posts: 1765
Joined: September 23 2004
Affiliation: University of Sussex
Contact:

### Re: CAMB: lensing

The check is pretty conservative - if you get an error much the most likely thing is that something is wrong in your modification (or maybe you are a miles from the allowed region of parameter space, in which case check ranges for other parameters you've added).

Lukas Hollenstein
Posts: 16
Joined: March 31 2009
Affiliation: IPhT CEA-Saclay
Contact:

### CAMB: lensing

Thanks a lot for the quick reply. Yes, I seem to have been outside the reasonnable range of the additional parameters.

But, in principle, if I comment the stops in the lensing code, the likelihoods of the unreasonnable models will simply be very low, isn't it? Or could the likelihood codes crash in such cases?

Thanks again,
Lukas

Savvas Nesseris
Posts: 73
Joined: April 05 2005
Affiliation: UAM/IFT
Contact:

### CAMB: lensing

Hi,

Sorry for the thread necromancy, but I'm having the same issue with a slightly modified CAMB. The problem is that in my case, I'm sure that I'm within reasonable and interesting to explore parameter ranges.

Also and more importantly, the flag "stop_on_error = F" doesn't seem to prevent CosmoMC from bombing out, so I think I will take the risk and comment out the relevant lines in /camb/lensing.f90 (maybe just the "stop" and not the warning).

Cheers,
Savvas

Jason Dossett
Posts: 97
Joined: March 19 2010
Affiliation: The University of Texas at Dallas
Contact:

### CAMB: lensing

Hi Savvas,

It may also be good to inject a call to GlobalError() there too. That way cosmoMC rejects that sample where CAMB bombs. You will need to add a

Code: Select all

use Errors

at the beginning of the module if you choose to do this though. This is what I do with ISiTGR.

Savvas Nesseris
Posts: 73
Joined: April 05 2005
Affiliation: UAM/IFT
Contact:

### CAMB: lensing

Hi Jason,

Good point, thanks!

Cheers,
Savvas