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)
223 stars 292 forks source link

Multiple issues with scf perturbations #434

Open arsalanadil opened 3 years ago

arsalanadil commented 3 years ago

Hi all,

I'm perplexed by a few results from CLASS in both Newtonian and Synchronous gauges when implementing a dark energy quintessence field and am writing in hopes that someone might have figured out what's going on.

1) In Newtonian gauge, the matter power spectrum (and the corresponding \delta_i's) has the following erroneous output:

image

(Here AS is the result when \Lambda is switched out for a quintessence field with all other parameters staying the same). A similar issue was reported in #380, although that does not seem to be the source of this problem since the issue continues to persist when approximating $\psi' \approx \phi'$ (as is done for the ultra-relativistic fluid approx). For reference, we expect an overall suppression at all scales in the presence of the quintessence field, but no drastic changes to the shape of the power spectrum.

More important is the following issue: 2) In Sync gauge, the perturbations for each component look like so:

image

I don't think this is correct -- we expect the perturbation from the scalar field to stay subdominant (c_s^2 = 1 for the quintessence field in the gauge comoving with the field). The resolution seems to be similar to what is pointed out in #298 by commenting out the lines below "/* converting synchronous variables to newtonian ones */". Although I am not sure why this correction works: the gauge transformation in this block is correctly implemented for the scalar field, as per Eqn. (3.14-3.16) in Ballesteros & Lesgourgues and should not lead to such an enormous contribution from \delta_scf. I think that this issue in the synchronous gauge is isolated and does not affect mPk or Cl's, since the error is in perturb_print_variables() and not the earlier computations, but I am not sure.

Thanks for the help, and as always thanks to the writers of CLASS for enabling all this science!

Best wishes, Arsalan

akshay-ghalsasi commented 2 years ago

Hi,

I am getting a similar matter power spectrum with wild variations for Newtonian Gauge. On the other hand I am not getting the correct matter power spectrum in the synchrounous gauge (It looks smooth, like in your plot but I expect a feature from solving simplified version of the diff. eqns. myself).

Did you conclusively understand what's going on. Is it a problem with translating from synchronous to newtonian gauge?

Thanks, Akshay

matiasleize commented 2 years ago

Hi,

We implemented ClassFreeSF to work on CLASS 3.2 (the original code was a modification of CLASS 2.5). In addition to that, we made it available to run using the Newtonian Gauge. While working with the Newtonian gauge, we had a similar problem to the one reported in this issue. Below, we attached a plot of the power spectrum that we got using both gauges:

output_github_15

We used the following input parameters: params = { 'output': 'tCl, lCl, mPk', 'l_max_scalars': 2000, 'lensing': 'yes', 'A_s': 2.3e-9, 'n_s': 0.9624, 'h': 0.6711, 'omega_b': 0.022068, 'Omega_cdm': 0.0001, 'Omega_scf': 0.3, 'attractor_ic_scf': 'yes', 'scf_parameters': '1.e-15, 1.e-16, 1.e-30, 0.01', 'scf_tuning_index': 3, 'format': 'class' }, while the rest were set to default values. We have the same question as Akshay, is it necessary to have some spetial care when we compare Syn and Newtonian?

lurena-lopez commented 2 years ago

Hi,

There is a small mistake in the conversion of the density contrast delta_scf from the synchronous gauge to the Newtonian one. Just go to line 8376 in the file perturbations.c and include the scale factor 'a' besides the Hubble parameter 'H'. That is, the correct formula should be:

delta_scf += alpha(-3.0aH(1.0+pvecback[pba->index_bg_p_scf]/pvecback[pba->index_bg_rho_scf]));

Notice that Eq. (3.14) in Ballesteros & Lesgourgues includes the Hubble parameter in conformal time, but the Hubble parameter in the expression above is given in terms of the cosmic time, and this is the reason to include an extra scale factor to get the right gauge conversion. See also for instance line 8355 in perturbations.c for the CDM density contrast.

I hope this helps to resolve the issue.

PD Matías, thanks for noticing this issue in ClassFreeSF. It seems that this typo in CLASS has been there since version 2.5.

Kind regards, Luis