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)
225 stars 282 forks source link

Dark energy perturbation for a variable equation of state in CLASS #138

Open barunp1985 opened 7 years ago

barunp1985 commented 7 years ago

Dear Julien, Is it possible to include the Dark Energy Perturbation for a variable equation of state in your code CLASS? If yes, then how? I am not an expert in code. Thanking you for your kind and active cooperation.

lesgourg commented 7 years ago

Dear @barunp1985, at the moment CLASS can include DE in the form of either fluid equations (with w0_fld, wa_fld, cs2_fld, ...) or single quintessence field equations (sector ..._scf). For quintessence, the perturbations are taken into account by the code, but they remain very small since scalar fields have cs2=1 in the gauge comoving with the field. For the fluid, a well-known issue is that when the background equation of state crosses w=-1, the perturbations explode exponentially. This is why you will get an error message if you run CLASS or MontePyhton with values of w0_fld, wa_fld such that w=-1 may occur. To overcome this, Hu & Sawicki have devised a clever parametrisation of DE called PPF, which is at the moment in CAMB and not in CLASS, but we are precisely working on it, and this modification will be part of a release very soon (1-2-3 weeks). Then, you will have a third possibility for DE: to use a PPF species, and this will give you the possibility to have w=-1 and perturbations at the same time. However I'd like to write here a warning. Since the time at which the PPF equations have been incorporated as a default in CAMB, many people got the wrong impression that it is perfectly reasonable to have models with w crossing -1 and perturbations at the same time. However this is very far-fetched theoretically. The PPF of Hu and Sawicki should be understood like " if some very complicated DE model (e.g. with several scaler fields and some tuning) managed to cross w=-1, then it would probably behave effectively as the system described by our PPF equations". But the PPF is not per se a definite physical model, as acknowledged by the authors themselves. In summary: we will be pleased to release soon this PPF stuff within CLASS, but people using it should keep in mind that most well-defined theoretical DE models are restricted to w \neq 1 (excepted the case of a homogeneous cosmological constant), and for such models the existing fluid equations should already provide a good effective description.

barunp1985 commented 7 years ago

Dear Julien, Thank you very much for your detailed explanation. I would like to request you for another help. I have a fluid with non-zero pressure (a mixture of CDM + DE, which cant be expressed separately as CDM & DE). I have analytical forms for its equation of state and energy density as well as hubble parameter. I want to run CLASS for this fluid. Is it possible?

surgithub commented 7 years ago

Hi Julien,

I am also interested to know how to implement a unified dark fluid in class. Is it possible to do in the present version of the class?

Thanks.

surgithub commented 7 years ago

Dear Julien,

Please reply my question whether a unified dark fluid (CDM + DE) with non-zero pressure can be implemented in the new version of CLASS.

Thanks.

ThomasTram commented 7 years ago

Hi

Everything is possible. But if what you are asking if it has been implemented already in the public version, the answer is no. What is new in v. 2.6 is the PPF approximation for uncoupled Dark Energy with variable equation of state. If you want a PPF approximation for a unified CDM+DE fluid you need to derive it and then implement it. Good luck!

Cheers, Thomas

surgithub commented 7 years ago

Thanks Thomas! Sorry. I am new to the CLASS code, and therefore do not know how to do it for the unified dark fluid. Please write the steps to do it in the best possible manner. It would be of great help to the CLASS users like me.

miguelzuma commented 7 years ago

Hi,

my advice is to look at whatever is already in class that most resembles your model and make modifications inspired on it. You can type on the terminal '*grep _xxx /*.***' (where xxx is the label for the species) to find all the occurrences of a given species in the code. I don't know your model, but depending on what you need here are a couple ideas:

surgithub commented 7 years ago

Thanks for helping!

In my model, the unified dark flud (CDM+DE) pressure and energy density read as p_DF = −B − 1 − 3B log a \rho_DF = C a^{-3} + D (1 + 3 B log a)

where a is scale factor and B = 0.01. The constants C and D are to be fixed by the data.

Please note that there is no separate CDM component in this model. Please write the steps in detail so that the other CLASS users like me can also understand the implementation of unified dark fluid in CLASS.

miguelzuma commented 7 years ago

From what you say the simplest thing is that you base your implementation on _fld (fluid DE).

For a very quick implementation you can just modify the _fld implementation. Go to background.c and search for _backgroundfunctions. There you will find the block where the energy density and pressure for the _fld component are computed:

if (pba->has_fld == TRUE) { pvecback[pba->index_bg_rho_fld] = pba->Omega0_fld pow(pba->H0,2) / pow(a_rel,3.(1.+pba->w0_fld+pba->wa_fld))

  • exp(3.pba->wa_fld(a_rel-1.)); rho_tot += pvecback[pba->index_bg_rho_fld]; p_tot += (pba->w0_fld+pba->wa_fld(1.-a_rel)) pvecback[pba->index_bg_rho_fld]; }

There you just need to change the lines for pvecback[pba->index_bg_rho_fld] and p_tot. I suggest you reuse the parameters of _fld for your model. For instance, you can decide that C is w0_fld and D is wa_fld (you need to define a new parameter if you want to vary B eventually).

After you recompile (make clean; make class) whenever you call _fld you will get resulst for your model. Note that you should make sure that your parameters get the right Omega_smg. You will also run CLASS with no separate CDM (however, it seems to me that the C term in your expression is exactly a CDM component).

This is a very minimal way to include your model (and of course, you still need to do the perturbations!). It is not very difficult to introduce your component as a separate ingredient (so you can eventually define more parameters, etc...). You can do that by searching for _fld and copy-pasting and modifying to adapt to your model.

I suggest you read Thoma's slides on how to implement new species https://lesgourg.github.io/class-tour/Tokyo2014/lecture14b_adding_species.pdf

You might also want to take a look at other CLASS learning resources https://lesgourg.github.io/class-tour-Tokyo.html

surgithub commented 7 years ago

Thank you so much!

I think I have got all the points except the following:

I wonder how to compile CLASS without separate CDM as I have no separate CDM in my model. Please write the command line for it.

miguelzuma commented 7 years ago

You don't need to recompile to change CDM, just set Omega_cdm = 0 in your .ini file. Read explanatory.ini for information.

to compile the code after modifying it type 'make clean' and then 'make class'

On 7 April 2017 at 05:48, surgithub notifications@github.com wrote:

Thank you so much!

I think I have got all the points except the following:

I wonder how to compile CLASS without separate CDM as I have no separate CDM in my model. Please write the command line for it.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/lesgourg/class_public/issues/138#issuecomment-292527346, or mute the thread https://github.com/notifications/unsubscribe-auth/AEyCCyUGIdMz0g2RQ4OB5d1AJbCKxraEks5rtjCagaJpZM4L9r73 .

gabygga commented 6 years ago

Hi! I'm new using CLASS, and it is confusing to me that for w(z) dark energy perturbations in some part of the code appers the complete evolution equation for delta_fld, but before the attractor solution is specified, so, I don't understand if delta_fld is being solved using one or another equation.

LuzGarciaP commented 5 years ago

Hi there! I'm new in Class as well, and I've been reading previous comments from other people above, but I'm still not sure where/how to introduce a file with an effective equation of state as a function of redshift to compute the Cl's... I installed Class on my laptop and everything seems to be working well and I understand there's a way to compute the perturbations of your EDE model once you have a file with w(z), but I can't find such function. Could you please help me?

Thanks!