external dark energy

Use of Cobaya. camb, CLASS, cosmomc, compilers, etc.
Post Reply
Adam Ormondroyd
Posts: 6
Joined: August 17 2022
Affiliation: Cavendish Astrophysics, University of Cambridge
Contact:

external dark energy

Post by Adam Ormondroyd » August 17 2022

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

Antony Lewis
Posts: 1941
Joined: September 23 2004
Affiliation: University of Sussex
Contact:

Re: external dark energy

Post by Antony Lewis » August 18 2022

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.

Adam Ormondroyd
Posts: 6
Joined: August 17 2022
Affiliation: Cavendish Astrophysics, University of Cambridge
Contact:

Re: external dark energy

Post by Adam Ormondroyd » August 23 2022

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?

Antony Lewis
Posts: 1941
Joined: September 23 2004
Affiliation: University of Sussex
Contact:

Re: external dark energy

Post by Antony Lewis » August 24 2022

"dark_energy" if that is the name of what your theory model is providing

Adam Ormondroyd
Posts: 6
Joined: August 17 2022
Affiliation: Cavendish Astrophysics, University of Cambridge
Contact:

Re: external dark energy

Post by Adam Ormondroyd » August 24 2022

So just must_provide["dark_energy"] = None, with no mention of a or w?

Antony Lewis
Posts: 1941
Joined: September 23 2004
Affiliation: University of Sussex
Contact:

Re: external dark energy

Post by Antony Lewis » August 24 2022

I should think so, see if it works.

Adam Ormondroyd
Posts: 6
Joined: August 17 2022
Affiliation: Cavendish Astrophysics, University of Cambridge
Contact:

Re: external dark energy

Post by Adam Ormondroyd » August 25 2022

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?

Antony Lewis
Posts: 1941
Joined: September 23 2004
Affiliation: University of Sussex
Contact:

Re: external dark energy

Post by Antony Lewis » August 29 2022

Are the dependencies etc being setup correctly? (from --debug output)

Adam Ormondroyd
Posts: 6
Joined: August 17 2022
Affiliation: Cavendish Astrophysics, University of Cambridge
Contact:

Re: external dark energy

Post by Adam Ormondroyd » September 03 2022

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?

Antony Lewis
Posts: 1941
Joined: September 23 2004
Affiliation: University of Sussex
Contact:

Re: external dark energy

Post by Antony Lewis » September 05 2022

Would check dark_energy is being returned as a requirement from CambTransfers not from CAMB directly.

Post Reply