ModeCode and MultiModeCode – Bayesian Parameter Estimation for Inflation

ModeCode [Mortonson, Peiris and Easther] provides a numerical solution of the perturbation equations and resulting spectrum for an arbitrary inflationary potentials and implement Bayesian parameter estimation for inflation. ModeCode was based on code previously used in Peiris et al. (2003) [BibTeX] and Mortonson, Dvorkin, Peiris & Hu (2009) [BibTeX]. It is based on the algorithm described in Adams, Cresswell and Easther (2001) [BibTeX]. 
In 2014, ModeCode was generalised to deal with multifield scenarios and interfaced with PolyChord. The new version, MultiModeCode, is described in Price, Frazer, Xu, Peiris and Easther (2014) [BibTeX]. 

Constraints on spectral parameters for natural inflation, assuming instant reheating (red) and general reheating (grey); arXiv:1007.4205


Histograms for the spectral index and running for N-quadratic inflation with equal-energy initial conditions (Phys. Rev. Lett. 112, 161302 (2014)) .


DOWNLOAD:  Details and git repository at  

OLD VERSION: The initial version of ModeCode was interfaced with the Jan 2011 version of CosmoMC, in order to use ModeCode for parameter estimation; you may download the tarball of the old version directly below.

  1. README (with code use description and installation instructions)
  2. ModeCode tarball
  3. Tarball (>100 Mb) of MCMC results from arXiv:1007.4205 (code release paper)




PSpectRe [PSeudo Spectral Reheating] is a C++ code for evolving interacting scalar fields in the early universe.   PSpectRe is (as the name suggests!) based on a pseudo-spectral algorithm, so the fundamental variables are the momentum modes of the interacting fields, unlike finite difference routines, which evaluate the fields in position space.   As currently implemented, PSpectRe simulates two fields interacting via a quartic polynomial potential, or a single field with a sixth-order potential, and it is designed to be easily extendable to a variety of problems and scenarios in early universe physics.

PSpectRe was developed by Richard Easther, Hal Finkel and Nathaniel Roth, and available under a BSD-style license and you are free to reuse and adapt this code, with or without redistribution of the source, but must provide appropriate acknowledgement in any derivative work.

PSpectRe is designed the code to be flexible and adaptable. PSpectRe has been well tested for some scenarios, but has not been thoroughly tested for all combinations of all options.  If you find bugs, have feedback, or want to be emailed when we update the code, please contact Hal Finkel or Richard Easther.

Using PSpectRe:  The makefile makes intelligent guesses about which compiler to use (either g++ or Intel), and hopefully the code can be built by simply typing “make” at the command line. The code can be invoked with the following command, to get a sample run for a model with a quadratic inflaton potential:

./pspectre @example_params.txt


./pspectre @lambdaphi4_params.txt

will run a model with a quartic potential  while

./pspectre @oscphi6_params.txt

runs an oscillon model.

Documentation is in the “documentation” directory! Good luck.

PSpectRe is described in arXiv:1005.1921 


Click to download PSpectRe

Other Numerical Resources:

  1. LatticeEasy – staggered leapfrog finite difference (Felder and Tkachev)
  2. CUDAEasy – GPU accelerated LatticeEasy (Sainio).
  3. Defrost – higher order finite difference (Frolov) and MPI-Defrost (Finkel)