class

Boltzmann and background integrator for BG, CMB, matter power, and more

File

boltzmann/class/class_interface.py

Attribution

Julien Lesgourgues

Thomas Tram

Benjamin Audren

Simon Prunet

Jesus Torrado

Miguel Zumalacarregui

etc

URL

http://class-code.net

Citations

http://arxiv.org/abs/1104.2932

JCAP 07 (2011) 034

http://arxiv.org/abs/1104.2934

JCAP 09 (2011) 032

CLASS is one of the standard cosmology codes for evolving perturbations in the primordial universe into CMB and other power spectra, as well as various other quantities. This is a very preliminary interface to the general and powerful CLASS code.

See http://class-code.net for a fuller description and the github repository https://github.com/lesgourg/class_public for the latest public code.

You should also check out the MontePython sampler code, which uses CLASS to do similar inference to CosmoSIS.

This version of CLASS has been modified very slightly to be able to output at more redshifts and to use the cosmosis build system.

The CosmoSIS team packaged this module into cosmosis form so any issues running it here please ask us first.

Assumptions

  • The LCDM model

  • Various choices for approximations and implementations of the Boltzmann and related equations

Setup Parameters

Name

Type

Default

Description

version

str

3.2.5

Version of CLASS to use

lmax

int

2000

Max angular frequency ell to use for cmb calculation

kmax

real

10.0

The max wavenumber k to use for P(k,z) calculation

zmax

real

3.0

Max redshift to save P(k,z) and distances

nk

int

100

Number of k values to use for P(k,z) calculation

cmb

bool

True

Whether to compute CMB spectra

mpk

bool

True

Whether to compute matter power spectra

lensing

bool

True

Whether to lens the output CMB power spectra

background_only

bool

False

Run the class module on background only mode. If set to true, it will not calculate any perturbations.

debug

bool

False

Whether to give a fuller traceback on errors

save_matter_power_lin

bool

True

Whether to save linear matter power spectrum

save_cdm_baryon_power_lin

bool

False

Whether to save linear CDM-baryon power spectrum

Input values

Section

Name

Type

Default

Description

cosmological_parameters

ombh2

real

Physical baryon density fraction today, Omega_b * h**2

omch2

real

Physical cdm density fraction today, Omega_c * h**2

h0

real

Hubble parameter H0 / 100 km/s/Mpc

tau

real

Optical depth to last-scattering

n_s

real

Scalar spectral index

A_s

real

Scalar spectrum primordial amplitude

massless_nu

real

3.046

Effective number of massless neutrinos

t_cmb

real

2.726

The CMB temperature today in Kelvin

N_ur

real

get_N_ur()

Number of ultra-relativistic species. If not given, calculates it from num_massive_neutrinos and nnu based on the values suggest by CLASS such that N_eff = 3.044.

Output values

Output values

Section

Name

Type

Description

cosmological_parameters

sigma_8

real

Amplitude of linear matter power at 8/h Mpc at z=0. Only calculated if mode=all

distances

nz

int

Number of z samples

z

real 1d

Redshifts of samples

d_a

real 1d

Angular diameter distance in Mpc

d_m

real 1d

Co-moving distance in Mpc

d_l

real 1d

Luminosity distance in Mpc

d_c

real 1d

Comoving Distance in Mpc

d_v

real 1d

Angular average of comoving angular diameter and line of sight distance

age

real

Age of universe in GYr

rs_zdrag

real

Sound horizon size at zdrag. Only if mode!=background

matter_power_lin

z

real 1d

Redshifts of samples. Only if mode=all

k_h

real 1d

K wavenumbers of samples in Mpc/h. Only if mode=all

p_k

real 2d

Matter power spectrum at samples in (Mpc/h)^-3. Only if mode=all

cmb_cl

ell

int 1d

Angular frequencies. Only if mode=cmb or all

tt

real 1d

ell * (ell+1) C_ell^TT / 2 pi in mu K^2. Only if mode=cmb or all

ee

real 1d

ell * (ell+1) C_ell^EE / 2 pi in mu K^2. Only if mode=cmb or all

bb

real 1d

ell * (ell+1) C_ell^BB / 2 pi in mu K^2. Only if mode=cmb or all

te

real 1d

ell * (ell+1) C_ell^TE / 2 pi in mu K^2. Only if mode=cmb or all

pp

real 1d

ell*(ell+1) C_ell^PhiPhi / 2pi. The CMB lensing power spectra. Only if lensing=True.

tp

real 1d

ell*(ell+1) C_ell^PhiT / 2pi. CMB Lensing cross-correlations with temperature. Only if lensing=True.