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

Error when setting PBH evaporation #558

Open jpbrandtu opened 8 months ago

jpbrandtu commented 8 months ago

Hi,

When setting PBH evaporation fraction and mass on Jupyter Notebook:

params = {
    'output': 'tCl lCl',
    '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.12029,
    'PBH_evaporation_fraction': 1,
    'PBH_evaporation_mass': 10**12}

cosmo = Class()
cosmo.set(params)
cosmo.compute()

I get the following error:

---------------------------------------------------------------------------
CosmoComputationError                     Traceback (most recent call last)
Cell In[28], line 7
      1 # Run the whole code. Depending on your output, it will call the
      2 # CLASS modules more or less fast. For instance, without any
      3 # output asked, CLASS will only compute background quantities,
      4 # thus running almost instantaneously.
      5 # This is equivalent to the beginning of the `main` routine of CLASS,
      6 # with all the struct_init() methods called.
----> 7 cosmo.compute()

File classy.pyx:391, in classy.Class.compute()

CosmoComputationError: 

Error in Class: thermodynamics_init(L:392) :error in injection_init(ppr, pba, pth);
=>injection_init(L:97) :error in injection_rate_PBH_evaporation_mass_evolution(pba,pin);
=>injection_rate_PBH_evaporation_mass_evolution(L:849) :error in background_at_z(pba, loop_z, long_info, inter_normal, &last_index_back_loop, pvecback_loop);
=>background_at_z(L:160) :condition (loga > pba->loga_table[pba->bt_size-1]) is true; out of range: a/a_0 = 1.000000e+00 > a_max/a_0 = 1.000000e+00