Boltzmann Code Docs¶
Basic documentation for the python version of Boltzmann code.
Last update: Sep 20, 2017
Detailed Contents:¶
Boltzmann Equations¶
General Formalism and Approximations¶
The general Boltzmann equation for the number distribution of a particle species can be written as (assuming isotropy):
where \(F_{i}(p)\) is the number distribution of particle \(i\) as function of momentum \(p\), \(C\) represents a source/sink term and \(H\) is the Hubble constant:
with \(M_{P} = 1.22\times 10^{19}\) GeV and \(\rho_T = \sum_{i} \rho_i\). The number, energy and pressure densities are given in terms of \(F_{i}\) as:
where \(m_i\) is the mass of particle \(i\) and \(E_i = \sqrt{p_i^2 + m_i^2}\). Using Eq. (1), we obtain the following equations for the number and energy densities:
The collision term, \(C_i\), for the process \(i + f + \ldots \leftrightarrow a + b + c + \ldots\) is given by:
where the plus (minus) sign is for bosons (fermions). Below we always assume \(f_{i,j,a,..} \ll 1\), so:
We will assume that \(C\) is given by:
where \(C_{dec}\) contains the contributions from decays and inverse decays (\(i \leftrightarrow a + b + \ldots\)), \(C_{prod}\) contains the contributions from decay injection and inverse decay injection (\(a \leftrightarrow i + b + \ldots\)) and \(C_{ann}\) from annihilations with the thermal plasma (\(i + i \leftrightarrow a + b\)). Below we compute each term separately, under some assumptions.
Annihilation Term¶
The annihilation term \(C_{ann}\) for the \(i + j \leftrightarrow a + b\) process is given by:
where \(d\Pi_{i} = d^{3} p_i/((2\pi)^3 2 E_i)\). Since we are ultimately interested in Eqs.([eq:meqs]) for the number and energy densities, we will consider the following integral:
where \(\alpha = 0 (1)\) for the number (energy) density. Here we assume that the distributions can be approximated by:
so the annihilation term can then be written as:
where above we have used conservation of energy (\(E_i + E_j = E_a + E_b\)). Since for the cases of interest the equilibrium distributions have zero chemical potential, we have:
so:
In particular, for the process \(i + i \leftrightarrow a + b\), where \(a\) and \(b\) are in thermal equilibrium (\(\mu_a = \mu_b = 0\)):
For \(\alpha = 0\), the above equation is the well known contribution from thermal scatterings to the annihilation term. To estimate its value for \(\alpha = 1\), we assume:
where \(\langle \;\; \rangle\) represents thermal average. Thus:
Decay Term¶
Now we derive a simplified expression for the decay (and inverse decay) term, under approximations similar to the ones used in the last section. The decay term includes the contributions from particle decay and inverse decay:
As in the case of the annihilation term, we assume that the distributions for \(a,b,\ldots\) can be approximated by \(f_x \simeq \exp(-(E_x - \mu_x)/T)\), so we can write:
where we used conservation of energy (\(E_a + E_b + \ldots = E_i\)) and \(\bar{f}_i\) is the equilibrium distribution for the species \(i\). Hence we can write Eq.([eq:dec0]) as:
where \(\Gamma_i\) is the width for \(i\) and \(\mathcal{B}_{ab\ldots} \equiv BR(i \to a + b + \ldots)\)
Once again we consider the integral:
where we have included the sum over all decay channels and \(\alpha = 0 (1)\) for the contribution to the number (energy) density equation. Note that both integrals are identical, except for the replacement \(f_i \to \bar{f_i}\). The first integral in Eq.([eq:dec2]) gives:
where
Hence we can write Eq.([eq:dec2]) as:
For the non-equilibrium average we assume:
which is exact in the non-relativistic limit, but it is only an approximation for the relativistic case. Although we can compute the equilibrium average (\(\langle \frac{1}{E_i}\rangle_{eq}\)) explicitly, in order to have an exact cancellation between the decay and inverse decay terms when \(i\), \(a\) and \(b\) are all in equilibrium, we take:
With the above approximations we finally obtain:
where \(\mathcal{B}_{ab\ldots} \equiv BR(i\to a+b+\ldots)\).
Production Term¶
The decay and inverse decay of other particles (\(a \to i + b + \ldots\)) can also affect the species \(i\). The contribution from these terms we label \(C_{prod}\), which is given by:
Using the same approximations of the previous section, we write:
Hence:
and
with \(\alpha = 0 (1)\) for the contribution to the number (energy) density equation. For \(\alpha = 0\) we obtain:
where \(\mathcal{B}_{ib\ldots} \equiv BR(a \to i + b + \ldots)\), \(\mathcal{B}_i = \sum_{b} \mathcal{B}_{ib\ldots}\) and we have once again assumed \(\langle 1/E_a \rangle \simeq \langle 1/E_a \rangle_{eq} \simeq n_a/\rho_a\).
For \(\alpha = 1\), the integral in Eq.([eq:prod2]) does not take a simple form. In order to compute it, we assume:
The above expression is only exact for 2-body decays and \(m_a \gg m_i,m_b\). For the remaining cases, it is only an estimate.
Combining the results for \(\alpha = 0\) and 1, we have:
Number and Energy Density Equations¶
Using the results of Eqs.([eq:collfin]), ([eq:decfin]) and ([eq:prodfin]) in the Boltzmann equations for \(n_i\) and \(\rho_i\) (Eq.([eq:meqs])), we obtain:
where \(\mathcal{B}_{ab\ldots} = BR(i \to a + b+ \ldots)\), \(\mathcal{B}_{ib\ldots} = BR(a \to i + b + \ldots)\), \(\mathcal{B}_i = \sum_b \mathcal{B}_{ib\ldots}\) and we have included an extra term (\(C_i\) and \(\tilde{C}_i\)) to allow for other possible sources for the number and energy densities. For simplicity we assume \(C_i = \tilde{C}_{i}\) from now on.
It is also convenient to use the above results to obtain a simpler equation for \(\rho_i/n_i\):
Besides the above equations, it is useful to consider the evolution equation for entropy:
where \(dQ^{dec}\) is the net energy injected from decays. With the above definition we have:
where \(R\) is the scale factor and \(BR(i,X)\) is the fraction of energy injected in the thermal bath from \(i\) decays.
The above expressions can be written in a more compact form if we define the following ”effective thermal densities” and ”effective BR”:
where \(g_Y\) is the \(Y\) multiplicity in the final state of \(X\) decays. In addition, defining:
we can write Eqs.([Seq]), ([eq:nieq]) and ([eq:Rieq]) as:
where \('=d/dx\).
The above equation for \(N_i\) also applies for coherent oscillating fields, if we define:
so
where we assume that the coherent oscillating component does not couple to any of the other fields.
Collecting Eqs.([Seqb])-([Nieq]) and ([Nico]) we have a closed set of first order differential equations:
Entropy:
\[N_S' = \frac{e^{(3 x - N_S)}}{HT} \sum_{i} BR(i,X) \Gamma_i m_i \left(n_i - \mathcal{N}_{i}^{th} \right) \label{eq:Sfin}\]Thermal fields:
\[\begin{split}\begin{aligned} N_i'& = -3 + \frac{{\langle \sigma v \rangle}_i}{H} n_i [\left(\frac{\bar{n}_i}{n_i}\right)^2 -1] - \frac{\Gamma_i}{H} \frac{m_i}{R_i}\left(1 - \frac{\mathcal{N}_{i}^{th}}{n_i} \right) \\ & + \sum_{a} \mathcal{B}_{ai}^{eff} \frac{\Gamma_a}{H} \frac{m_a}{R_a}\left(\frac{n_a}{n_i} - \frac{\mathcal{N}_{ai}^{th}}{n_i} \right) \nonumber \\ R_i' & = -3 \frac{P_i}{n_i} + \sum_{a} \mathcal{B}_{ai}^{eff} \frac{\Gamma_a}{H} m_a \left( \frac{1}{2} - \frac{R_i}{R_a} \right) \left(\frac{n_a}{n_i} - \frac{\mathcal{N}_{ai}^{th}}{n_i} \right)\end{aligned}\end{split}\]Coherent Oscillating fields:
\[\begin{split}\begin{aligned} N_i' & = -3 - \frac{\Gamma_i}{H} \nonumber \\ R_i' & = 0 \label{eq:COeq}\end{aligned}\end{split}\]
As seen above, the equation for \(R_i = \rho_i/n_i\) depends on \(P_i/n_i\). A proper evaluation of this quantity requires knowledge of the distribution \(F_i(p,t)\). However, for relativistic (or massless) particles we have \(P_i = \rho_i/3\), as seen from Eq.([beqs]), while for particles at rest we have \(P_i = 0\). Hence \(F_i(p,t)\) is only required to evaluate the relativistic/non-relativistic transition, which corresponds to a relatively small part of the evolution history of particle \(i\). Nonetheless, to model this transition we approximate \(F_i\) by a thermal distribution and take \(T_i, \mu_i \ll m_i\), where \(T_i\) is the temperature of the particle (which can be different from the thermal bath’s). Under these approximations we have:
where \(K_{1,2}\) are the modified Bessel functions. In particular, if \(m_i/T_i \gg 1\):
As shown above, for a given value of \(R_i = \rho_i/n_i\), Eq.([eq:p1]) can be inverted to compute \(T_i\) (\(=P_i/n_i\)):
Since we are interested in the non-relativistic/relativistic transition, we can expand the above expression around \(R_i/m_i = 1\), so \(P_i/n_i\) can be written as:
where the coefficients \(a_n\) can be numerically computed from Eq.([eq:p1]). The above approximation should be valid for \(m_i/T_i \gtrsim 1\) (or \(R_i \gtrsim m_i\)). On the other hand, for \(m_i/T_i \ll 1\) (or \(R_i \gg m_i\)), we have the relativistic regime, with \(P_i/n_i = R_i/3\). Therefore we can approximate the \(P_i/n_i\) function for all values of \(R_i\) by:
where the coefficients \(a_n\) are given by the numerical fit of Eq.([eq:p1]) and \(\tilde{R}\) is given by the matching of the two solutions.
Finally, to solve Eqs.([eq:Sfin])-([eq:COeq]) we need to compute \(H\) according to Eq.([H]), which requires knowledge of the energy densities for all particles (\(\rho_i\)) and for the thermal bath (\(\rho_R\)). The former are directly obtained from \(N_i\) and \(R_i\), while the latter can be computed from \(N_S\):
Eqs.([eq:Sfin])-([eq:COeq]), with the auxiliary equations for \(H\) (Eq.([H])) and \(P_i/n_i\) (Eq.([Pfin])) form a set of closed equations, which can be solved once the initial conditions for the number density (\(n_i\)), energy density (\(\rho_i\)) and entropy (\(S\)) are given. For thermal fluids we assume:
where \(\bar{\rho}_i\) is the equilibrium energy density (with zero chemical potential) for the particle \(i\). While for coherent oscillating fluids the initial condition is set at the beginning of oscillations:
where \(T^{osc}_i\) is the oscillation temperature, given by \(3H(T^{osc}_i) = m_i(T^{osc}_i)\) and \(\rho_i^{0}\) the initial energy density for oscillations.
Finally, the initial condition for the entropy \(S\) is trivially obtained, once we assume a radiation dominated universe at \(T=T_R\):
Installation¶
The code is written in Python and requires Python version 2.6 or later (but not Python 3) with the following external Python libraries:
In addition, some of the plotting functions may require:
For a successful installation of Assilumo, SUNDIALS must also be installed.
Running the code¶
A basic example of how to run the code is provided by Example.py. If all dependencies have been successfully installed, this code can be run as:
Example.py -p parameters.ini -o output.dat -P
The resulting output will be written to the output file output.dat. If the flag -P is set, a simple plot showing the evolution of the energy densities will also be displayed. The main arguments are described below:
usage: nonThermalDM.py [-h] [-p PARAMETERFILE] [-o OUTPUTFILE] [-P]
- optional arguments:
-h, --help show this help message and exit -p PARAMETERFILE, --parameterFile PARAMETERFILE name of parameter file, where most options are defined -o OUTPUTFILE, --outputFile OUTPUTFILE name of output file (optional argument). If not define, no output will be saved -P, --plotResult show simple plot for the evolution of densities
Model Definitions¶
For each new BSM species, the user must supply the main functions required by the Boltzmann equations. These functions are supplied when defining the new state in the main file (using the Component class ) and correspond to:
- decays : specify the BRs and total width. Can be temperature-dependent.
- mass : specify the mass. Can be temperature-dependent.
- sigv : specify the thermally averaged annihilation cross-section. Can be temperature-dependent.
For the example provided these functions are given in modelDefinitions.py.
Furthermore, for each species, the user must specify if its spin set by the dof property \(dof = \pm 2*spin + 1\) (where the plus sign is for bosons and minus for fermions).
The Parameters File¶
The basic models parameters are set in the parameters file. These are model dependent and should be adapted for each individual input model. For the simple models assumed in nonThermalDM.py, the following parameters are defined:
- model parameters:
- yCoupling (float): Mediator-DM-SM coupling
- mMediator (float): Mediator mass (in GeV)
- mDM (float): DM mass (in GeV)
- TRH (float): reheat temperature (in GeV)
- TF (float): Final temperature for evolution (should be after mediator decay)
The Output¶
If an output file is defined, all the output will be written to the file. This output includes the input parameters used, a summary of the main cosmological observables (relic densities, effective number of additional neutrinos,...). Furthermore, a table containing the values for the number and energy densities of each species defined as a function of the temperature (or scale factor) is also printed.
If no output file is defined, only the summary information will be written to the file. An example of a typical output is the following:
#-------------
# Parameters:
# mdm = 1.
# mmediator = 1000.
# tf = 1e-5
# trh = 100.
# ycoupling = 1e-10
#-------------
#-------------
# Summary
# TF=1e-05
# DM: T(osc)= None | T(decouple)= 100.0 | T(decay)= None | Omega h^2 (@TF) = 0.113472811107
#
# Mediator: T(osc)= None | T(decouple)= None | T(decay)= 0.0475383532448 | Omega h^2 (@decay) = 5.53551558304e-29
#
# Delta Neff (@TF) = 0.0
#-------------
#-------------
# Header:
# R T (GeV) n_{DM} (GeV^{3}) #rho_{DM} (GeV^{2}) n_{Mediator} (GeV^{3}) #rho_{Mediator} (GeV^{2})
1.0000E+00 1.0000E+02 1.0901E-17 2.9445E-15 2.1794E+02 2.5433E+05
1.0000E+00 1.0000E+02 1.0954E-17 2.9757E-15 2.1794E+02 2.5433E+05
1.0000E+00 1.0000E+02 1.1008E-17 3.0069E-15 2.1794E+02 2.5433E+05
1.0000E+00 1.0000E+02 1.1062E-17 3.0381E-15 2.1794E+02 2.5433E+05
...
Code Documentation¶
Example
File¶
-
Example.
main
(parameterFile, outputFile, showPlot=True)[source] Main code to define the BSM contents and properties and solve the Boltzmann equations
Parameters: - parameterFile – Path to the file defining the main model parameters
- outputFile – Path to the output file. If None, no results will be written.
- showPlot – If True, will show a simple plot for the evolution of the energy densities
modelDefinitions
File¶
component
File¶
boltzSolver
File¶
boltzEqs
File¶
AuxFuncs
File¶
AuxDecays
File¶
synopsis: | This module provides decay classes and methods |
---|---|
author: | Andre Lessa <lessa.a.p@gmail.com> |
-
class
AuxDecays.
Decay
(instate=None, fstates=None, br=0.0)[source] Bases:
object
Main class to store information about a specific decay.
Parameters: - motherID – ID for the decaying mother
- fstateIDs – list of IDs for the daughters
- br – branching ratio value
-
compress
(ID, IDecays)[source] Generates a new DecayList() from compressing the ID decays