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)
230 stars 285 forks source link

(w0, wa) in classy #324

Closed gouyoub closed 4 years ago

gouyoub commented 4 years ago

Hello,

It is possible to set the values for the dark energy equation of state (w0, wa) while using the standard initialization file, with w0_fld and wa_fld. But when I try to pass these cosmological arguments with classy, it does not recognize the parameters. Is there a way to set these parameters while using classy ?

cosmo_w0 = Class() cosmo_w0.set({'w0_fld' : -1.1, 'wa_fld' : -0.3}) cosmo_w0.compute()

Error : CosmoSevereError Traceback (most recent call last)

in () 63 cosmo_w0 = Class() 64 cosmo_w0.set({'w0_fld' : -1.1, 'wa_fld' : -0.3}) ---> 65 cosmo_w0.compute() classy.pyx in classy.Class.compute() CosmoSevereError: Error in Class: Class did not read input parameter(s): w0_fld, wa_fld Thank you, Sylvain GB.
lesgourg commented 4 years ago

Dear Sylvain, The syntax for passing parameters through the input file and through classy is the exact very same one, because there is a unique parser in Class, not one for each method. All set of cosmological parameters that would work in the input file automatically work in the classy input, and vice-versa: this is just a structural fact. In both the input file and the wrapper, w0_fld and wa_fld are read only if you state that there is a fluid (which is distinct from a cosmological constant: in principle you could have a universe with only one of them, or both, or none). This means that Omega_fld must be non-zero, and either fixed to a value of your choice or adjusted by the code to match the budget equation. You can read this logic in explanatory.ini, section 8a). To ask the code to match the budget equation with Omega_fld instead of a cosmological constant, you must set Omega_Lambda=0. You have this line somewhere in your input file where you tested w0_fld and wa_fld, and you must also pass it to the classy input, because it is not the default (the default is: Omega_fld=0 and Omega_Lambda adjusted). Sorry if this was not clear. I will add a warning in the parser that will write such a reminder when the user passes w0_fld and wa_fld while sticking to the default Omega_fld=0 value.

gouyoub commented 4 years ago

Great, thanks a lot for the answer.

Sylvain.