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)
218 stars 291 forks source link

Time evolution of matter density contrast and power spectrum with massive neutrinos #575

Open Ferrangelo opened 3 months ago

Ferrangelo commented 3 months ago

Hello,

I am comparing the redshift evolution of the matter density contrast Ddelta = delta_m(z) / delta_m(z=0) at a given scale k=0.01 [1/Mpc], against the square root of the ratio of the matter power spectrum Dpk = sqrt{Pk(z) / Pk(z=0)} , with massive neutrinos: 'N_ur': 2.0328, 'N_ncdm': 1., 'm_ncdm': 0.06.

I would think these two quantities coincide (and they do at most scales), but at this particular scale they don't, as you can see from the plot below.

The ratios coincide if I consider massless neutrinos. I have excluded this is related to gauge issues, as they are present for much smaller values of k and can be removed by gauge transforming delta_m as in here, to get agreement between the two quantities at very large scales.

I am obtaining the linear matter power spectrum using the method pk_lin(k,z) and the matter density contrast from get_perturbations() and then summing the keys delta_b, delta_cdm, delta_ncdm[0]

Am I wrong in assuming these ratios should coincide or I am doing something wrong in extracting the quantities of interests from classy?

The only precisions parameters I tweaked are the following: 'z_max_pk': 5, 'tol_perturbations_integration':1.e-10, 'tol_thermo_integration':1e-10, 'tol_background_integration':1e-10, 'perturbations_sampling_stepsize':0.01

This is similar to issue #95, but they were comparing the growth factor computed in the background module with the ratio of the Pk, while here I am comparing the matter density contrast from the perturbations module with the power spectrum.

image