CAMB_sources: Limber approximation
-
- Posts: 29
- Joined: September 25 2004
- Affiliation: Institut d'Estudis Espacials de Catalunya
- Contact:
CAMB_sources: Limber approximation
Hi,
I found that camb_sources has some accuracy problem at high multipoles
(typically for l>500, when it switches to the Limber windows), when computing the cross-correlation between the CMB lensing potential and a distribution of source counts (at low z).
If you have a working solution for this, i would be grateful!
cheers, Pablo
I found that camb_sources has some accuracy problem at high multipoles
(typically for l>500, when it switches to the Limber windows), when computing the cross-correlation between the CMB lensing potential and a distribution of source counts (at low z).
If you have a working solution for this, i would be grateful!
cheers, Pablo
-
- Posts: 2
- Joined: October 02 2010
- Affiliation: University of Sussex
CAMB_sources: Limber approximation
Hello!
I have recently modified CAMB_sources to do something similar. As it is, the code is not set up to do the limber approximated cross correlation of lensing potential and redshift windows. This is probably why you get something weird at high multipoles when you try it.
Because of the structure of the code, modifying it to do the limber approximated cross correlation between the lensing potential and a redshift window is harder than modifying it to do the limber approximated cross correlation between 2 different redshift windows. The easiest solution is to implement the latter and use a second window which looks like the lensing potential.
To make a window which looks like the lensing potential, make a high redshift source window of type lensing. E.g. in the params.ini set the second redshift window to:
redshift(2) = 1050
redshift_kind(2) = lensing
redshift_sigma(2) = 20
Note that the output for this window will be [tex] C_{l}^{\kappa\kappa} [/tex] which is related to the lensing potential via:
[tex] C_{l}^{\kappa\kappa}=\frac{[l(l+1)]^2}{4}C_{l}^{\phi\phi} [/tex]
(You can easily check that this works by comparing it to the standard CAMB_sources lensing potential output, the agreement is pretty good.)
The limber approximated auto correlations are calculated in cmbmain.f90 in the subroutine CalcLimberScalCls. Below is a modified version of the subroutine which also calculates the cross correlations.
You can change the multipole at which the limber approximation turns on by modifying these lines in the GetLimberTransfers subroutine:
Ruth
I have recently modified CAMB_sources to do something similar. As it is, the code is not set up to do the limber approximated cross correlation of lensing potential and redshift windows. This is probably why you get something weird at high multipoles when you try it.
Because of the structure of the code, modifying it to do the limber approximated cross correlation between the lensing potential and a redshift window is harder than modifying it to do the limber approximated cross correlation between 2 different redshift windows. The easiest solution is to implement the latter and use a second window which looks like the lensing potential.
To make a window which looks like the lensing potential, make a high redshift source window of type lensing. E.g. in the params.ini set the second redshift window to:
redshift(2) = 1050
redshift_kind(2) = lensing
redshift_sigma(2) = 20
Note that the output for this window will be [tex] C_{l}^{\kappa\kappa} [/tex] which is related to the lensing potential via:
[tex] C_{l}^{\kappa\kappa}=\frac{[l(l+1)]^2}{4}C_{l}^{\phi\phi} [/tex]
(You can easily check that this works by comparing it to the standard CAMB_sources lensing potential output, the agreement is pretty good.)
The limber approximated auto correlations are calculated in cmbmain.f90 in the subroutine CalcLimberScalCls. Below is a modified version of the subroutine which also calculates the cross correlations.
Code: Select all
subroutine CalcLimberScalCls(CTrans)
Type(ClTransferData) :: CTrans
integer ell, i, j, ii,s_ix, s_ix2, ik, pix
real(dl) CL, reall,fac, dbletmp, contribution
if (.not. limber_windows) return
do pix=1,CP%InitPower%nn
do i =1, num_redshiftwindows
s_ix = 3+i
do j= 1, num_redshiftwindows
s_ix2 = 3+j
if (CTrans%limber_l_min(s_ix) /=0 .and. CTrans%limber_l_min(s_ix2) /=0) then
!$OMP PARALLEL DO DEFAUlT(SHARED), SCHEDUlE(STATIC,2), PRIVATE(Cl,ell,reall,fac,ik,dbletmp,contribution,ii)
do ell = max(CTrans%limber_l_min(s_ix), CTrans%limber_l_min(s_ix2)), Ctrans%ls%l0
Cl = 0
reall = real(CTrans%ls%l(ell),dl)
fac = (2*pi**2)/fourpi/reall**3 !fourpi because multipled by fourpi later
do ik = 1, CTrans%Limber_windows(s_ix,ell)%num_k
!Actually integral over chi; source has sqrt( chi dchi)
contribution=0
do ii=1,CTrans%Limber_windows(s_ix2,ell)%num_k
if (CTrans%Limber_windows(s_ix,ell)%k(ik) .eq. CTrans%Limber_windows(s_ix2,ell)%k(ii)) then
contribution=CTrans%Limber_windows(s_ix,ell)%Source(ik)*CTrans%Limber_windows(s_ix2,ell)%Source(ii)
end if
end do
Cl=Cl+ contribution *fac*ScalarPower(CTrans%Limber_windows(s_ix,ell)%k(ik) ,pix)
end do
if(Redshift_w(i)%kind == window_lensing) Cl = Cl*sqrt((reall*(reall+1)/2)**2)
if(Redshift_w(j)%kind == window_lensing) Cl = Cl*sqrt((reall*(reall+1)/2)**2)
if(i .eq. j) iCl_scalar(ell,C_PhiTemp + i,pix) =Cl
dbletmp=(reall*(reall+1))/OutputDenominator*fourpi
iCl_Array(ell,s_ix,s_ix2,pix) = Cl*dbletmp
end do
!$OMP END PARAllEl DO
end if
end do
end do
end do
end subroutine CalcLimberScalCls
Code: Select all
if (W%kind==window_lensing) then
ell_limb = 500*AccuracyBoost
else
ell_limb = nint(AccuracyBoost*max(200, nint(6* W%chi0/W%sigma_tau)))
end if
Ruth
-
- Posts: 29
- Joined: September 25 2004
- Affiliation: Institut d'Estudis Espacials de Catalunya
- Contact:
CAMB_sources: Limber approximation
Hi Ruth,
thanks a lot for the post.
In fact, what worked for me was to use the cross-correlation between the source counts and the lensing windows, and then switch off the Limber approximation (i.e, setting the switch to Limber to arbitrary high-l).
cheers, Pablo
thanks a lot for the post.
In fact, what worked for me was to use the cross-correlation between the source counts and the lensing windows, and then switch off the Limber approximation (i.e, setting the switch to Limber to arbitrary high-l).
cheers, Pablo
-
- Posts: 2
- Joined: October 02 2010
- Affiliation: University of Sussex
CAMB_sources: Limber approximation
Hi Pablo,
That sounds like an easier solution. What is the maximum value of ell which you use with limber turned off? Does running slow down much when you do that?
Ruth
That sounds like an easier solution. What is the maximum value of ell which you use with limber turned off? Does running slow down much when you do that?
Ruth
-
- Posts: 29
- Joined: September 25 2004
- Affiliation: Institut d'Estudis Espacials de Catalunya
- Contact:
CAMB_sources: Limber approximation
I used lmax=1000, since this is all I needed.
It was pretty fast anyway....
cheers, Pablo
It was pretty fast anyway....
cheers, Pablo