Page 1 of 1

external dark energy

Posted: August 17 2022
by Adam Ormondroyd
Hi,

I'm attempting to modify Cobaya to replicate the external_priomordial_pk functionality, but for the dark energy equation of state parameter w(a). I am using PolyChord as my sampler.

I have made a theory class which takes several (a, w) values as its parameters, and uses these to create a much denser linear spline which is added to the state dictionary. I have added a boolean external_wa parameter to cobaya.theories.camb.camb.CAMB, which if True then uses the set_dark_energy_wa() method to add these to the CAMB parameters in set(). I've reordered things so that this is set before all the other parameters, to avoid complications where dark energy needs to be set first.

To ensure that CAMB.set() is called when any of the dark energy parameters are changed, I've been manually putting those parameters in the same blocking as the other CAMB parameters (theta_MC_100, ombh2, omch2, tau) in the yaml file, but this means I also have to specify the oversampling factors. I think either must_provide() or get_requirements() should be used to indicate the CAMB theory depends on my dark energy theory, but I'm not sure how.

If anyone could explain how to specify this dependency that would be great!

Adam

Re: external dark energy

Posted: August 18 2022
by Antony Lewis
I think CAMB's requirements should be changed to include the thing calculated by your theory, or you can return that requirement from must_provide if your theory's parameters are actually used (as for external_primordial_pk). Your new parameters should be defined in your new theory.

Re: external dark energy

Posted: August 23 2022
by Adam Ormondroyd
I fear I'm not getting this quite right, I'm getting different oversampling factors for camb and my dark energy theory parameters (1 vs 2). I expected them to be the same as camb needs to be recomputed every time the dark energy parameters change.

My simplest dark energy theory has params a0, w0, a1, w1, and creates a linear spline between these which it adds to the state dict:

state["dark_energy"] = {"a": [a0, ..., a1], "w": [w0, ..., w1]}.

I've changed camb.set() to use "a" and "w" to set the dark energy table.

My question is: what exactly would be added to the dict which camb.must_provide() returns?

Re: external dark energy

Posted: August 24 2022
by Antony Lewis
"dark_energy" if that is the name of what your theory model is providing

Re: external dark energy

Posted: August 24 2022
by Adam Ormondroyd
So just must_provide["dark_energy"] = None, with no mention of a or w?

Re: external dark energy

Posted: August 24 2022
by Antony Lewis
I should think so, see if it works.

Re: external dark energy

Posted: August 25 2022
by Adam Ormondroyd
This is what I tried originally, but Cobaya gave different oversampling factors between my dark energy parameters and the other CAMB parameters:

...
[polychord] Parameter blocks and their oversampling factors:
[polychord] * 1 : ['theta_MC_100', 'ombh2', 'omch2', 'tau']
[polychord] * 2 : ['N', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'w0', 'w1', 'w2', 'w3', 'w4', 'w5', 'w6', 'w7', 'w8'] (dark energy parameters)
[polychord] * 2 : ['logA', 'ns']
...

I expected changing dark energy parameters would incur the same cost as theta_MC etc?

Re: external dark energy

Posted: August 29 2022
by Antony Lewis
Are the dependencies etc being setup correctly? (from --debug output)

Re: external dark energy

Posted: September 03 2022
by Adam Ormondroyd
The input/output part of the output looks like this:

...
[model] - planck_2018_lensing.clik:
[model] Input: ['A_planck']
[model] Output: []
[model] - dark_linf.AdaptiveDarkLinf:
[model] Input: ['N', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'w0', 'w1', 'w2', 'w3', 'w4', 'w5', 'w6', 'w7', 'w8']
[model] Output: []
[model] - camb.transfers:
[model] Input: ['cosmomc_theta', 'ombh2', 'omch2', 'mnu', 'tau']
[model] Output: []
[model] - camb:
[model] Input: ['As', 'ns']
[model] Output: ['H0', 'omegam', 'omega_de', 'YHe', 'Y_p', 'zre', 'sigma8', 'age', 'rdrag', 'DH']
[model] Components will be computed in the order:
[model] - [planck_2018_highl_plik.SZ, dark_linf.AdaptiveDarkLinf, camb.transfers, camb, planck_2018_lowl.TT, planck_2018_lowl.EE, planck_2018_highl_plik.TTTEEE, planck_2018_lensing.clik]
[model] Requirements will be calculated by these components:
[model] - Cl: camb
[model] - CAMB_transfers: camb.transfers
[model] - dark_energy: dark_linf.AdaptiveDarkLinf
...

Should I add ["a", "w"] to the dark energy output and to either the camb or camb.transfers input? How would I do this?

Re: external dark energy

Posted: September 05 2022
by Antony Lewis
Would check dark_energy is being returned as a requirement from CambTransfers not from CAMB directly.