lesgourg / class_public

Public repository of the Cosmic Linear Anisotropy Solving System (master for the most recent version of the standard code; GW_CLASS to include Cosmic Gravitational Wave Background anisotropies; classnet branch for acceleration with neutral networks; ExoCLASS branch for exotic energy injection; class_matter branch for FFTlog)
230 stars 285 forks source link

TT, TE and EE from CLASS and MontePython #381

Closed ShazAlvi closed 3 years ago

ShazAlvi commented 3 years ago

I am using MontePython for my work with temperature and galaxy cross-correlations. I am calling the temperature and polarization (TT, TE and EE) power spectra from CLASS in MontePython (through CLASSY, I suppose). When I compare the power spectra between MontePython and those that CLASS produces as output for the same parameters, I get a mismatch. Here is the comparison of the power spectra and their ratio. image image image image image image The parameter files for MontePython and CLASS are attached in this message. MontePython.txt CLASS.txt

My question is: Is this a known situation and that it is normal to have this much deviation between CLASS output and MontePython power spectra? If yes, this much deviation appears to be significant for what I am doing. Is there a way around this?

Thanks for your time and effort.

ThomasTram commented 3 years ago

Hi

How do you get the MontePython spectra? MontePython just calls CLASS through classy, so there should be no difference at all. Things to check:

My guess is that you are in fact comparing slightly different cosmologies.

Cheers, Thomas

ShazAlvi commented 3 years ago

Hi @ThomasTram ,

Thanks for your prompt reply. I get the power spectra using the function get_cl.

ShazAlvi commented 3 years ago

Also, I have checked that lensing is included in both MontePython and CLASS.

ShazAlvi commented 3 years ago

Hi @ThomasTram, As you suggested there, was a minor difference in the omega_b (0.02253 instead of 00.22253). But there is still a difference in the Power Spectra. The resultant difference between the plots that I showed before is this,

image image

So, the $/chi(z)$ is the same between CLASS and MontePython (which I think suggests that the cosmologies are indeed the same) but the difference between the power spectra is still significant. Just to clarify one thing about lensing: While the lensing parameter is set to yes for both CLASS and MP, I am making the comparison with the CLASS Cl file called *"_cl_lensed.dat".

Other than this, I have checked the parameter file MP passes to CLASS (by writing data.cosmo_arguments['write parameters'] = 'yes') in the code. This resultant ini file produced file also confirms that the parameters are the same between MP and CLASS.

Do you have any ideas where the difference can stem from?

ShazAlvi commented 3 years ago

Just want to give an update on this matter and close the issue. After taking the ini file from MontePython and feeding it to CLASS, I get the following comparison which effectively solves the tension in TT. The updated TT plot looks like this, image image And there is no tension between the two as far as TT spectrum is considered. There is still tension in TD between CLASS and CLASSY for which I have opened another issue #401.