Nicole Drakos

Research Blog

Welcome to my Research Blog.

This is mostly meant to document what I am working on for myself, and to communicate with my colleagues. It is likely filled with errors!

This project is maintained by ndrakos

Neutrino Transfer Function

To assign neutrino positions, neutrinos are placed on a coarse grid, then displaced using LPT. This requires a transfer function.

CAMB

I will use the Code for Anisotropies in the Microwave Background (CAMB). MUSIC has a plugin to read CAMB outputs. The different transfer variables are listed here.

Python Version

There is now a python wrapper for CAMB. I pip installed CAMB to play around with (see the example notebook here).

Here is some code for generating transfer functions in python:

import camb

pars = camb.CAMBparams()
pars.set_cosmology(H0=70, ombh2=0.022, omch2=0.122)
pars.InitPower.set_params(ns=1)
pars.set_matter_power(redshifts=[zstart], kmax=kmax)

results= camb.get_results(pars)
trans = results.get_matter_transfer_data()
kh = trans.transfer_data[0,:,0] #get kh - the values of k/h at which they are calculated

delta_cdm = trans.transfer_data[model.Transfer_cdm-1,:,0] #Deltac/k^2
delta_b = trans.transfer_data[model.Transfer_b-1,:,0]
delta_nu = trans.transfer_data[model.Transfer_nu-1,:,0]
delta_tot = trans.transfer_data[model.Transfer_tot-1,:,0]

Fortran version

To actually run this in MUSIC, I’ll just use the fortran version, since it automatically creates the correct output files needed for MUSIC.

To install and compile:

git clone https://github.com/cmbant/CAMB.git --recurse-submodules
cd CAMB/fortran
make

To run the code:

./camb ../inifiles/params.ini

The params.ini file is pretty straightforward to modify. I can set the cosmological parameters in here.

Modification to MUSIC Code

As mentioned above, MUSIC already as a CAMB plugin. transfer_camb.cc contains machinery for reading in the transfer functions from camb output. I just needed to change it so that it stores the neutrino transfer function, rather than discard it as a dummy variable. This just meant reading through the code, and adding neutrinos in the same way cdm particles were treated throughout.

I also needed to add neutrinos to the tf_type types in transfer_function.hh.

This compiled fine.

Next steps

Make sure initial positions all make sense

  1. Fix the Gadget output so that it has write_neutrino_position properly written
  2. Check I am getting the correct number of dark matter particles and neutrinos
  3. Plot the power spectrum of the MUSIC ICs, and make sure this matches the input

Make sure initial velocities make sense

  1. Look into the bulk velocity assignment for neutrinos
  2. Assign velocities to neutrinos in MUSIC
  3. Check the initial velocity distribution

Try in Gadget

  1. Make sure the code runs in Gadget
  2. Check the evolution of the power spectrum, and that it makes sense

Possible Complications


« Neutrino Positions in MUSIC
Writing my own IC Code »