BINGO (BI-spectra and Non-Gaussianity Operator)

Scope of BINGO

The BI-spectra and Non-Gaussianity Operator or, simply, BINGO, is a Fortran 90 code that numerically evaluates the scalar bi-spectrum and the non-Gaussianity parameter fNL in single field inflationary models involving the canonical scalar field. The code is based on the Maldacena formalism to evaluate the bi-spectrum [1] and early efforts towards applying the formalism to situations involving deviations from slow roll as well as certain procedures developed to numerically investigate such scenarios [2,3].

BINGO can evaluate all the contributions to the scalar bi-spectrum and the non-Gaussianity parameter fNL for an arbitrary triangular configuration of the wavenumbers.

A few words on the methods and procedures adopted by BINGO

Computing the bi-spectrum involves first having to evaluate the background as well as the perturbations, and then carrying out integrals consisting of background quantities and the perturbation variables [1,2,3,4,5]. A discussion on the different contributions to the bi-spectrum can be found in Refs. [4,5], while the methods and the numerical procedures involved are described in detail in Ref. [6]. In what follows, we shall highlight a few essential points. The readme file available along with the code also contains a few related comments.

As far as the background is concerned, in single field models, given a potential, as is well known, the equations of motion are integrated with initial conditions such that the field starts on the inflationary attractor. Moreover, the initial conditions are chosen so that about 60-70 e-folds of inflation is achieved so as to overcome the horizon problem.

Recall that, in order to arrive at the inflationary power spectrum, the equations governing the perturbations are evolved from well inside the Hubble radius until suitably late times when the amplitudes of the modes have frozen to a constant value on super-Hubble scales. Barring special cases, the modes are typically evolved from k/(a H) of about 100 till, say, 10-5. The standard Bunch-Davies initial conditions are imposed in the sub-Hubble domain and the power spectrum is evaluated on super-Hubble scales. As should be evident, given a potential and the values of the parameters involved, the above arguments completely determine the inflationary perturbation spectrum.

In fact, these conditions prove to be sufficient to determine the inflationary bi-spectrum as well [6]. As can be demonstrated, in order to calculate the bi-spectrum for an arbitrary triangular configuration of the wavenumbers, it suffices to carry out the integrals involved from a time when the largest mode of interest is well inside the Hubble radius to a time when the smallest mode is sufficiently outside. BINGO can calculate all the different contributions to the bi-spectrum as well as the non-Gaussianity parameter fNL corresponding to these contributions. We should add that, since the perturbations are anyway required to be evolved in order to arrive at the bi-spectrum, the code can compute the power spectrum too.


    1. J. Maldacena, Non-Gaussian features of primordial fluctuations in single field inflationary models, JHEP 0305, 013 (2003).
    2. X. Chen, R. Easther and E. A. Lim, Large non-Gaussianities in single field inflation, JCAP 0706, 023 (2007).
    3. X. Chen, R. Easther and E. A. Lim, Generation and characterization of large non-Gaussianities in single field inflation, JCAP 0804, 010 (2008).
    4. J. Martin and L. Sriramkumar, The scalar bi-spectrum in the Starobinsky model: The equilateral case, JCAP 1201, 008 (2012).
    5. D. K. Hazra, J. Martin and L. Sriramkumar, Scalar bi-spectrum during preheating in single field inflationary models, Phys. Rev. D 86, 063523 (2012).
    6. D. K. Hazra, L. Sriramkumar and J. Martin, BINGO: A code for the efficient computation of the scalar bi-spectrum, JCAP 1305, 026 (2013).
    7. V. Sreenath, D. K. Hazra and L. Sriramkumar, On the scalar consistency relation away from slow roll, arXiv:1410.0252 [astro-ph.CO].

Downloading and using BINGO

Please register at this link to download the code. Download and extract the tarball (bingo-2.0.tar.gz for the current version). Follow the readme file to compile and run the code.

BINGO-2.0 is available on GitHub [].

If you face any difficulty in downloading the code from these pages, you can try the mirror located at this link.


If you use BINGO in your publication, we would request you to cite reference [6] and [7] above.

Sample plots

The results for a specific case, viz. that of the quadratic potential with a step can be found at this link.

If you find any bugs in the code (or if you have any question about the code), please do write to me at the address: hazra(at)bo(dot)infn(dot)it. We also welcome related comments and suggestions.


BINGO is written in Fortran 90. The code requires one of the following two Fortran compilers: ifort or gfortran. By default, it uses GNUPLOT to plot the results.

Some points to note:

There are a few points concerning the code which we would like to stress here.

    1. The current version of code can evaluate the scalar bi-spectrum for an arbitrary configuration of the wavenumbers.
    2. At this stage, we have not implemented any interpolation routine to arrive at the power spectrum and the bi-spectrum. The scalar power spectrum and the bi-spectrum are calculated from a kmin to a kmax specified in the file fnlparams.ini.
    3. The number of points for which the power spectrum and the bi-spectrum are to be evaluated can be specified in the file fnlparams.ini.
    4. Apart from the machine dependency, the speed of the code depends on:
      • The number of points between kmin and kmax for which the bi-spectrum is to be evaluated.
      • The specific contribution to the bi-spectrum. For instance, often, one finds that it is the so-called fourth term that leads to the dominant contribution to the bi-spectrum when deviations from slow roll occur. One may wish to calculate just this term in such scenarios.
      • The inflationary model of interest. If there exist features in the power spectrum, typically, the code takes longer to calculate the corresponding bi-spectrum.
      • The desired level of accuracy.

Frequently asked questions (FAQ)

    • Does the code involve any assumptions or approximations?

The code does not involve any assumptions or approximations and it can evaluate the scalar power spectrum and the bi-spectrum for any inflationary model involving the canonical scalar field. The code even allows several punctuations in inflation (where the first slow roll parameter becomes greater than unity) from where inflation can resume again.

    • I would like to compute the bi-spectrum for my own inflationary model (say, my_model). How can I do that?

You will just need to follow the following four steps:

    1. Step 1: Create a folder in the models folder with the name, say, my_model.
    2. Step 2: Copy the files from any pre-existing model (say, from qp-stp) folder to my_model. Make sure that you copy all the four files, viz. fnlparams.ini, parameters.f90, potential.f90, theory_param.f90.
    3. Step 3: Change the POTENTIAL_USED [i.e. V(φ)], POTENTIALPRIME [viz. dV(φ)/dφ] and V_PHI_PHI [d2V(φ)/dφ2] according to your model in the file potential.f90. There exist options for four parameters are by default, viz. PARAM_1, PARAM_2, PARAM_3 and PARAM_4. You should write your potential in terms of these parameters and provide their values in the file fnlparams.ini. Note that you may need to change the initial conditions on the field and its velocity in fnlparams.ini.
    4. Step 4: In the Makefile, change, model = my_model. Then compile and run.

    • My model has more than four parameters. How can I add an extra parameter in the code?
      1. In the specific model folder (say, my_model) define your extra parameters (say, PARAM_5) in the file theory_param.f90. In fnlparams.ini assign the value of the parameter (say, using param5). Finally, in driver.f90 map PARAM_5 to param5 using the following command:
      2. param_5=Ini_Read_double('param5',0.0d0)
      3. Then compile and run.

    • Do I need GNUPLOT to plot the results?
      1. Upon completion of the run, all the results will be available in the plots directory. You can choose any plotter to plot it. But the command
      2. $ make figs

will make use of GNUPLOT to plot them. Two python scripts are provided in the tarball to plot 2D and 3D plots of bispectrum.

    • Can I calculate the different contributions to the bi-spectrum for a given model?

Yes. There is an option "Term" in the file fnlparams.ini in the models folder. You can choose to compute a particular contribution to the bi-spectrum using this option. In fnlparams.ini, you can specify suitably to evaluate one of the following seven terms: 1, 2, 3, 47, 5, 6 and 0. To calculate the total fNL from all the contribution set Term = 0.

    • Can I evaluate the bi-spectrum for a larger range of wavenumbers?

Note that the present code calculates the bi-spectrum over five decades in wavenumber with a fair level of accuracy. If you wish to evaluate the bi-spectrum for smaller scales (i.e. for k larger than kmax), it is important that you work with a larger level of accuracy. This, in particular, becomes important if features (which arise due to deviations from slow roll) are present at small scales in the power spectrum. In such cases, while evaluating the bi-spectrum, one ought to ensure that the integrals involved encompass the period(s) of deviation from slow roll.

Versions and history

The current version of BINGO is version 2.0. This is the second version of the code. The first version had focused on the equilateral configuration. The second version can evaluate the scalar bi-spectrum for an arbitrary triangular configuration of the wavenumbers. The latest version also includes Python codes to create two-dimensional density plots and three-dimensional contour plots of the bi-spectrum.

The history of the two versions and the changelog are as follows:

Version 2.0: October 2014

    • The bi-spectrum can be calculated for an arbitrary triangular configurations of the wavenumbers.
    • The bi-spectrum can be obtained in squeezed limit to, say, examine the consistency relation.
    • Python scripts have been included to create two-dimensional density plots and three-dimensional contour plots of bi-spectrum.
    • Added mpif90 option to run BINGO in multiple nodes.
    • Term = 0 calculates the total f_nl from all terms in the bi-spectrum.

Version 1.0: February 2013

    • The first release of BINGO.
    • The scalar bi-spectrum is evaluated in the equilateral configurations of wavenumbers.
    • It also includes calculations of the scalar power spectrum.


The following routines, which have been used in BINGO, were not written by the authors:

    1. d1mach.f, dqagse.f, dqelg.f, dqk21.f, dqpsrt.f : Routines for numerical integration, downloaded from Netlib
    2. inifile.f90 : Routine to read in parameter names from a file, written by Antony Lewis
    3. rksuite.f90 : Routines to solve ordinary differential equations, downloaded from Netlib