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

Two writing issues in CLASS code #472

Open Serliou opened 2 years ago

Serliou commented 2 years ago

Hi, I read the code and find two writing issues:

Firstly, it is at line 534 in input.c

  char * const unknown_namestrings[] = {"h",                        /* unknown param for target '100*theta_s' */
                                        "Omega_ini_dcdm",           /* unknown param for target 'Omega_dcdmd' */
                                        "Omega_ini_dcdm",           /* unknown param for target 'omega_dcdmdr' */
                                        "scf_shooting_parameter",   /* unknown param for target 'Omega_scf' */
                                        "Omega_dcdmdr",             /* unknown param for target 'Omega_ini_dcdm' */
                                        "omega_dcdmdr"};             /* unknown param for target 'omega_ini_dcdm' */

The second "Omega_ini_dcdm" should be "omega_ini_dcdm".

Secondly, it is about scalar field potential function at line 2920 and 2931 in background.c. There are mistakes about the return of dV_e_scf and ddV_e_scf function.

double dV_e_scf(struct background *pba,
                double phi
                ) {
  double scf_lambda = pba->scf_parameters[0];
  //  double scf_alpha  = pba->scf_parameters[1];
  //  double scf_A      = pba->scf_parameters[2];
  //  double scf_B      = pba->scf_parameters[3];

  return -scf_lambda*V_scf(pba,phi);
}

double ddV_e_scf(struct background *pba,
                 double phi
                 ) {
  double scf_lambda = pba->scf_parameters[0];
  //  double scf_alpha  = pba->scf_parameters[1];
  //  double scf_A      = pba->scf_parameters[2];
  //  double scf_B      = pba->scf_parameters[3];

  return pow(-scf_lambda,2)*V_scf(pba,phi);
}

I believe the return of them should be like below:

  return -scf_lambda*V_e_scf(pba,phi);

  return pow(-scf_lambda,2)*V_e_scf(pba,phi);
schoeneberg commented 1 year ago

Dear @Serliou , nice catch. I will try to push them with the newest releases.

snesseris commented 11 months ago

The issue with V_e_scf seems to persist in the latest version.

schoeneberg commented 11 months ago

Dear @snesseris ,

Indeed the changes are in the development branch (the last step before being published). You have to ask @lesgourg about when the next release will be. At that point also these changes will be published.

snesseris commented 11 months ago

Fantastic, thanks! I'm also looking into an issue with the shooting for quintessence, I'll open another issue separately.