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

Mismatch between CLASSY and CLASS Nonlinear Matter Power Spectrum #367

Closed ShazAlvi closed 3 years ago

ShazAlvi commented 3 years ago

While working with MontePython, I compared the non-linear matter power spectrum from CLASSY (through MontePython) and that produced by CLASS output. In both the platform I use Halofit set to nonlinear matter power spectrum. However, when I take the ratio of the matter power spectrum of CLASS/CLASSY and MontePython/CLASS, there seems to be a mismatch. I am attaching the plot of the ratio along with the parameter files used in making this plot. Note: In the plots, the two curves overlap.

Has anyone encountered this mismatch before? Also, if so, then is there a way around this?

Comp_Ratio_CLASSY_MontePython_CLASS Param_validation.txt Validation_Param.txt

ThomasTram commented 3 years ago

Hi

Just a quick thought: Did you remember to take into account that the wave number in the output files from CLASS uses h/Mpc and not 1/Mpc? And similarly for P(k) which is Mpc/h)^3 in the output file and Mpc^3 from classy?

Cheers, Thomas

ShazAlvi commented 3 years ago

Thank you for the quite reply @ThomasTram . You are right in pointing out the difference in the unit conversion. Once account for, the ratio is plotted below:

image

Thank you for pointing it out.

ShazAlvi commented 3 years ago

I am going to leave just one more quick update here. The wiggles in the above plot are due to the artifacts of the interpolation which was done in order to take the ratio at the right values of wavenumber. When the power spectrum is asked from CLASS at the correct wavenumber (thus not needing any interpolation) the ratio is nicely equal to 1 for "most" part of the wavenumber space.

image