CAMB_sources: Limber approximation

Use of Cobaya. camb, CLASS, cosmomc, compilers, etc.
Post Reply
Pablo Fosalba
Posts: 29
Joined: September 25 2004
Affiliation: Institut d'Estudis Espacials de Catalunya
Contact:

CAMB_sources: Limber approximation

Post by Pablo Fosalba » April 05 2013

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

Ruth Pearson
Posts: 2
Joined: October 02 2010
Affiliation: University of Sussex

CAMB_sources: Limber approximation

Post by Ruth Pearson » April 06 2013

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.

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
You can change the multipole at which the limber approximation turns on by modifying these lines in the GetLimberTransfers subroutine:

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

Pablo Fosalba
Posts: 29
Joined: September 25 2004
Affiliation: Institut d'Estudis Espacials de Catalunya
Contact:

CAMB_sources: Limber approximation

Post by Pablo Fosalba » April 06 2013

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

Ruth Pearson
Posts: 2
Joined: October 02 2010
Affiliation: University of Sussex

CAMB_sources: Limber approximation

Post by Ruth Pearson » April 06 2013

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

Pablo Fosalba
Posts: 29
Joined: September 25 2004
Affiliation: Institut d'Estudis Espacials de Catalunya
Contact:

CAMB_sources: Limber approximation

Post by Pablo Fosalba » April 06 2013

I used lmax=1000, since this is all I needed.
It was pretty fast anyway....

cheers, Pablo

Post Reply