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

Possible issue with Conformal-Newtonian-gauge Klein Gordon equation? #380

Open dgrin1 opened 3 years ago

dgrin1 commented 3 years ago

Some collaborators and I have been working on a project where one of the models we have been exploring is a scalar-field non-minimally coupled to gravity. Because we thought past work done in the synchronous gauge in these models may suffer from some gauge ambiguities (and we weren't sure if those were properly addressed in work in CAMB by other folks), we decided to also test things out in conformal Newtonian gauge. Along the way, I have been trying to understand CLASS's implementation of the conformal-Newtonian-gauge Klein Gordon equation, even for the minimal-coupling case. I think I may have stumbled onto a (hopefully very minor) bug.

The relevant lines are 8682 in the public CLASS in perturbations.c dy[pv->index_pt_phi_prime_scf] = - 2.a_prime_over_ay[pv->index_pt_phi_prime_scf] - metric_continuitypvecback[pba->index_bg_phi_prime_scf] - (k2 + a2pvecback[pba->index_bg_ddV_scf])y[pv->index_pt_phi_scf]; //checked// metric_continuity = h'/2 and line 8542 preceding it
metric_continuity = -3.
pvecmetric[ppw->index_mt_phi_prime];

As far as I can tell from Eq. 67 in https://arxiv.org/pdf/astro-ph/0402060.pdf and a number of other references , this  term (line 8542) should actually be        metric_continuity = -3.*(psidot+pvecmetric[ppw->index_mt_phi_prime];)

If one goes from the continuity to fluid equation this arises transparently, or uses the version of the KG equation with sqrt(-g) everywhere, likewise. I found it took more care to properly count orders when using explicit instances of the metric tensors in the Einstein raising-lowering convention throughout, but also got it to work out there.

Has this been noticed before? Am I missing something?

Best wishes and hope everyone is staying healthy! Dan

ThomasTram commented 3 years ago

Hi Dan

I worked on this 5-6 years ago, so I do not remember all the details. But as I remember, the problem was the psi_prime contribution which is related to the time-derivative of the total anisotropic stress perturbation, and this is cumbersome to compute in general. (You need to use the equations of motions for all species, and for ncdm-species you also need to perform a new integral.) This seemed like a lot of extra work just to evolve scalar-field perturbations in the conformal Newtonian gauge, so the idea was to evolve these equations in another gauge. However, I am not sure if this idea was implemented in the end, and what gauge was used in that case.

So if I had time I would check the following things:

Cheers, Thomas