This page contains the cosmological recombination code CosmoRec, which was developed to solve the recombination problem including the following main processes:

  1. recombinations to highly exited states (Chluba et al. 2007; Grin et al. 2010; Chluba, Vasil & Dursi 2010)

  2. corrections to the 2s-1s two-photon channel (Chluba & Sunyaev 2006; Kholupenko et al. 2006)

  3. HI Lyn-feedback (Chluba & Sunyaev 2007; Switzer & Hirata 2008; Hirata 2008)

  4. n>2 two-photon profile corrections (Chluba & Sunyaev 2008; Hirata 2008; Chluba & Thomas 2010)

  5. n≥2 Raman-processes (Hirata 2008; Chluba & Thomas 2010)

  6. time-dependent aspects for Ly-α (Chluba & Sunyaev 2009)

  7. the thermodynamic correction factor for Ly-α (Chluba & Sunyaev 2010)

  8. Ly-α diffusion (Grachev & Dubrovich 2008; Forbes & Hirata 2009; Chluba & Sunyaev 2009)

  9. electron scattering (Chluba & Sunyaev 2009; Ali-Haimoud et al. 2010)

  1. the effect of HeI intercombination transitions (Dubrovich & Grachev 2005; Wong et al. 2008)

  2. absorption of helium photons by hydrogen (Switzer & Hirata 2008; Kholupenko et al. 2008; Rubino-Martin et al. 2008)

  3. feedback of helium photons and quadrupole lines (Switzer & Hirata 2008; Chluba & Sunyaev 2010; Chluba, Fung & Switzer, 2012)

The effect of collisions is not included, but has shown to be small (Chluba, Vasil & Dursi, 2010). For a more detailed overview see Sunyaev & Chluba 2009 and Rubino-Martin et al. 2010.

In batch mode the current version of CosmoRec (CosmoRec v2.0.3 beta) runs within ~1 seconds for default settings. This performance was achieved using the effective multi-level approach, proposed by Ali-Haimoud & Hirata 2010. Effective rates for both hydrogen and helium were implemented. With the startup file it is currently possible to include the effective rates for up to 500 shells for hydrogen, and 30 shells for helium. The precision of the output should be ≤ 0.1% for hydrogen recombination and similar to 0.1%-0.2% during helium recombination.

Several different setting for the considered physical processes were implemented. Two-photon and Raman processes for nmax= 8 can be included. The HI diffusion correction can be switched on/off. For helium, feedback can be switched on/off, as well as the effect of HI continuum absorption. Furthermore, the effective number of hydrogen levels can be varied (in the 'lite' version of CosmoRec only the rates for 500 shells are included). For details about installation and how to run the code we refer the user to the ‘README’ file of the distribution.

Fig. 1: Corrections to the ionization history. The curves were computed using CosmoRec with different cosmological models. The effective rates for a 500-shell hydrogen model were used. Changes of this type cannot be modelled easily using fudges.

  1. Chluba & Thomas, 2011, MNRAS, 412, 748-764 (arXiv:1010.3631)

  2. Ali-Haimoud & Hirata, 2010, Phys.Rev.D, 82, 063521

  3. Chluba, Vasil & Dursi, 2010, MNRAS, 407, 599-612 (arXiv:1003.4928)

  4. Switzer & Hirata, 2008, Phys.Rev.D. 77, 083006

  5. Grin & Hirata, 2010, Phys.Rev.D, 81, 083005

  6. Rubino-Martin et al., 2010, MNRAS, 403, 439-452

A patch for CAMB can be downloaded here. For use with CAMB and CosmoMC we recommend CosmoRec v2.0.3 beta (see below for details on the update). The tar-ball is about 20MB large (mainly because of the precomputed recombination database which provides large flexibility). We also put a 'lite' version (3.0MB), for which the database is cut down to the default case only. For maximum flexibility we recommend the full version.

When using CosmoRec please consider referring to:

For comments, questions, or bug reports please email:


Lastest Updates

--------------------------------------------------------------------------------------------------------------------------------------------- Update (19.02.2015 | CosmoRec v2.0.3b) [main implementations: Feb & March 2011 and July 2014]

  1. added simple OPENMP support for ODE and PDE solver.

  2. added precomputed Pesc-data to distribution (avoids initial setup)

  3. memory checked with valgrind.

  4. Hydrogen specific:

  5. added possibility to change A2s1s two-photon decay rate

  6. Hydrogen nD-1s line corrections can be activated (default off; changes needed in './PDE_Problem/Solve_PDEs.cpp' and './Modules/Diffusion_correction.cpp').

  7. HI diffusion correction can be added in two parametrizations ('./Modules/Diffusion_correction.cpp').

  8. hydrogen quadrupole lines can be activated (default off; changes need in './Modules/HI_routines.cpp')

  9. Helium specific:

  10. radiative transfer problem for helium photons can now be explicitly solved. This module can be called instead of the simple approximate treatment of HI absorption on the escape probabilities of the main helium resonances. Furthermore, it allows computing the precise feedback between partially overlapping lines. The corresponding module is located in './PDE_Problem_HeI'. The feature can be switched on/off using the helium diffusion flag (see './runfiles/parameters.dat' for more explanation). The solver takes the processes discussed in Fung, Chluba and Switzer, MNRAS, 2011 into account. In particular, electron scattering can be included using the full Compton kernel. The corresponding parameters have to be set in './PDE_Problem_HeI/Solve_PDEs_HeI.cpp', however, note that the runtime of CosmoRec increases significantly when this module is activated.

  11. new helium runmodes that can be changed when calling from CosmoMC.

  12. helium feedback in the analytic model of Chluba & Sunyaev, MNRAS, 402, 1221–1248 (2010) can now be included for up to 10 shells.

--------------------------------------------------------------------------------------------------------------------------------------------- Update (17.07.2014 | CosmoRec v1.5b)

  1. added (optional) 'Grace' support, which can be used for runtime visualization of the PDE solution for hydrogen. This option can be activated in the '' and outputs can be controlled from './PDE_Problem/Solve_PDEs.cpp' and './PDE_Problem/Solve_PDEs_Grace.cpp'.

  2. thinned the effective rate tables (only for HI n=3 can one vary the number of shells that are included for the effective rate calculation).

  3. tidied HI two-photon and Raman profile computations up (./Development/Line_profiles). Small bug-fix for 3d1s profile, but the difference was below Planck sensitivity.

  4. 2s-1s two-photon decay previously were computed using the simple fitting formula for the two-photon profile given by Nussbaumer & Schmutz, 1984. This has been replaced with the latest computation of the 2s-1s two-photon profile. The normalization of the new profile can be set in './Development/Definitions/physical_constants.h', and is currently set to 8.2206 1/sec (Labzowsky et al. 2005). Difference was again below Planck sensitivity.

  5. optimized the control over the distribution of grid points in the radiative transfer problem. The distributions of grid points is now determined using density parameters in the Doppler core and Lorentzian wings (see './PDE_Problem/Solve_PDEs_grid.cpp' for setup of the grid and './PDE_Problem/Solve_PDEs.cpp' for control parameters). The computation of two-photon and Raman events for up to 8 shells was sped up in this way without loss of precision.

  6. tidied up and improved ODE and PDE solvers (./Development/ODE_PDE_Solver).

  7. Iterations over radiative transfer solver set to 1 (for batchmode) and 2 when calling CosmoRec directly. For higher precision, this can be changed in './CosmoRec.cpp' and './Modules/global_variables.cpp' (parameter Diff_iteration_max), respectively.

  8. PDE-setup and integration over resonances was tidied up and improved.

--------------------------------------------------------------------------------------------------------------------------------------------- Update (26.07.2012 | CosmoRec v1.4.2b)

  1. updated helium atom & setup routines

  2. added possibility to set Hubble function from CAMB using function pointer

  3. fixed small problem with gsl-1.15 compatibility of spline routine

  4. added HeI rates for nHe=2 to lite-version (CAMB compatibility of lite-version)

  5. additional cosmetic changes to some of the routines

--------------------------------------------------------------------------------------------------------------------------------------------- Update (11.06.2012 | CosmoRec v1.4.1b)

  1. added possibility to load Hubble factor from CAMB

  2. additional cosmetic changes to some of the routines

--------------------------------------------------------------------------------------------------------------------------------------------- Update (24.03.2012 | CosmoRec v1.4b)

  1. added interface for 'Camb' support

  2. added new runmode for Recfast++ with corrections function

  3. small changes to ODE and PDE-solver

  4. cosmetic changes to some of the routines

--------------------------------------------------------------------------------------------------------------------------------------------- Update (30.12.2010 | CosmoRec v1.3b)

  1. tables for the HI rates were extended to allow 'full' computations down to redshift z=50.

  2. implemented switch for different accuracies of the recombination model used by CosmoRec in the batch mode.

  3. Helium:
  4. Extended HeI effective rate tables. Now ground state transition from levels with n≤10 can be included.

  5. Added HeI nD-1S Singlet (n≤10) quadrupole lines (can be switch on/off in './Modules/He_routines.cpp'). They lead to a small additional acceleration of helium recombination at z~2200 (Chluba & Sunyaev, 2010).

  6. HeI-feedback model now also includes nD-1S Singlet quadrupole lines. This increases the feedback correction.

  7. fixed a small bug in ΔPesc interpolation routine connected with HeI-intercombination line. This had no important effect on the ionization history.

  8. Confirmed CosmoRec helium model for concordance model using multi-level recombination code. Agreement was better than 0.001% when doing physically identical cases.

--------------------------------------------------------------------------------------------------------------------------------------------- Update (04.12.2010 | CosmoRec v1.2.1b)

  1. compiled CosmoRec with Intel C++ compiler (icpc)

  2. CosmoRec also was extensively tested together with CosmoMC. Everything is running smoothly!

  3. parameter estimations were performed including dark matter annihilation.

--------------------------------------------------------------------------------------------------------------------------------------------- Update (24.11.2010 | CosmoRec v1.2b)

  1. improved the stability of the PDE-solver. The radiative transfer corrections are now only included at 500 < z < 2000.

  2. ran tests for default case over a wide range of cosmologies. For flat Universes CosmoRec now returns the electron fraction without encountering problems for: 0.01 ≤ Ωbh2 ≤ 0.04; 0.05 ≤ Ωcdmh2 ≤ 0.22; 0.6 ≤ h100 ≤ 0.8; 2.6K ≤ T0 ≤ 2.8K; 0.1 ≤ Yp ≤ 0.6; 1.0 ≤ Nν ≤ 6.0. Ωk=0 in all cases.

  3. implemented additional error handling for ODE-solver.

  4. switched to 4. order in ODE-solver. This increases the stability without affecting the performance.

  5. for default settings CosmoRec now runs in 1.3 sec average per cosmology.

--------------------------------------------------------------------------------------------------------------------------------------------- Update (23.11.2010 | CosmoRec v1.2b)

  1. fixed additional memory leak using 'valgrind'

  2. further improved module accounting for HI continuum absorption of HeI photons. In particular the code should now run for a wide range of input parameters, without calling ΔPesc integrals explicitly.

  3. changed the interface for batch mode. The curvature has to be specified now instead of ΩΛ. ΩΛ is computed internally using Ωtot= 1-ΩkmΛreltot: total; Ωk: curvature; Ωm: cold dark matter + baryons; ΩΛ: Lambda; Ωrel: photons & neutrinos)

  4. --------------------------------------------------------------------------------------------------------------------------------------------- Update (19.11.2010 | CosmoRec v1.2b)

    1. Added a simple module (./Modules/DM_annihilation.cpp) to account for the effect of dark matter annihilation according to Chluba, 2010, MNRAS, 402, 1195-1207. The DM annihilation efficiency can be set in the parameter file.

    2. the HeI feedback module was improved.

    3. --------------------------------------------------------------------------------------------------------------------------------------------- Update (14.11.2010 | CosmoRec v1.1b)

      1. several small bugs and memory leaks were fixed.

      2. CosmRec now has an interface to be called in batch mode for different cosmologies.

      3. the module accounting for HI continuum absorption of HeI photons was strongly improved.

      4. effective rates for 30 shells of helium were added

      5. the interpolation scheme for the effective rates was improved.

      6. a CosmoRec 'lite' version with decreased recombination-database is now available.

      7. formatting of the code has been improved.

      8. ---------------------------------------------------------------------------------------------------------------------------------------------
weebly analytics