Benjamin L’Huillier


Cosmologist and Astrophysicist, Research Fellow at KASI, Daejeon, South Korea

ComputePk (ascl:1403.015)

Update 2017-03-29: For the latest version of the code, please contact me directly.


You can download the code here.

If you use the code for your research, please cite it as L'Huillier (2014). You may use the following bibtex reference:

   author = {{L'Huillier}, {B.}},
    title = "{computePk: Power spectrum computation}",
     note = {in Astrophysics Source Code Library, record ascl:1403.015},
     year = 2014,
archivePrefix = "ascl",
   eprint = {1403.015},
    month = mar,
   adsurl = {},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}


Code to compute the density power spectrum in cosmological simulations. It uses MPI and FFTW-2.15. It is strongly inspired by N-GenIC for the parallelisation and from GenPK for the calculation of the power spectrum. So far it can read gadget format, but more will be available. It has been tested on $N_\text{g} = 2048^3$ simulation on 24 nodes and performed well. You may chose NGP, CIC or TSC for the mass assignment. I personally use $N_\text{g}^3 = 8\,N_\text{p}^3$ for a simulation using $N_\text{p}^3$ particles. Should you find any bug, please contact me.

The code has only be tested using Intel compiler (icc).

Release notes


Power Spectrum
Figure: power spectrum computed on a $N=512^3$ N-body simulations, with different schemes and grid sizes. The lower panel shows the relative difference with respect to the TSC $1024^3$ case