Theory codes

Synopsis:Prototype theory class and theory loader
Author:Jesus Torrado

If you are using a experimental likelihood, chances are the you will need a theoretical code to compute the observables needed to compute the likelihood.

This module contains the prototype of the theory code and the loader for the requested code.


At this moment, of all modules of cobaya, this is the one with the least fixed structure. Don’t pay much attention to it for now. Just go on to the documentation of CAMB and CLASS.

Theory class

class theory.Theory(info_theory, modules=None, timing=None)

Prototype of the theory class.


Initializes the theory code: imports the theory code, if it is an external one, and makes any necessary preparations.


Function to be called by the likelihoods at their initialization, to specify their requests. Its specific behaviour for a code must be defined.


Takes a dictionary of parameter values and computes the products needed by the likelihood. If passed a keyword derived with an empty dictionary, it populates it with the value of the derived parameters for the present set of sampled and fixed parameter values.


Finalizes the theory code, if something needs to be done (releasing memory, etc.)


Dimension of the input vector.

NB: Different from dimensionality of the sampling problem, e.g. this may include fixed input parameters.