mimes is hosted by Hepforge, IPPP Durham

Classes in C++

The Cosmo class

The mimes::Cosmo< LD > class is used to interpolate various quantities of the plasma. It is defined inside the header file MiMeS/src/Cosmo/Cosmo.hpp. The constructor is


    template< class LD >
    mimes::Cosmo< LD >(std::string cosmo_PATH, LD minT=0, LD maxT=mimes::Cosmo< LD >::mP)

The argument cosmo_PATH is the path of the data file that contains TT (in GeV), heffh_{eff}, geffg_{eff}, with increasing TT. The parameters minT and maxT are minimum and maximum interpolation temperatures. These temperatures are just limits, and the action interpolation is done between the closest temperatures in the data file. Moreover, beyond the interpolation temperatures, both heffh_{eff} and geffg_{eff} are assumed to be constants.

Interpolation of the RDOF, allows us to define various quantities related to the plasma. These quantities are given as the member functions:

  1. template< class LD > LD mimes::Cosmo< LD >::heff(LD T): heffh_{eff} as a function of TT.
  2. template< class LD > LD mimes::Cosmo< LD >::geff(LD T): geffg_{eff} as a function of TT.
  3. template< class LD > LD mimes::Cosmo< LD >::dheffdT(LD T): dheff/dTdh_{eff}/dT as a function of TT.
  4. template< class LD > LD mimes::Cosmo< LD >::dgeffdT(LD T): dgeff/dTdg_{eff}/dT as a function of TT.
  5. template< class LD > LD mimes::Cosmo< LD >::dh(LD T): δh=1+13dlogheffdlogT\delta_h = 1 + \frac{1}{3} \frac{d\log h_{eff}}{d\log T} as a function of TT.
  6. template< class LD > LD mimes::Cosmo< LD >::s(LD T): The entropy density of the plasma as a function of TT.
  7. template< class LD > LD mimes::Cosmo< LD >::rhoR(LD T): The energy density of the plasma as a function of TT.
  8. template< class LD > LD mimes::Cosmo< LD >::Hubble(LD T): The Hubble parameter assuming radiation dominated expansion as a function of TT.

Moreover, there are several cosmological quantities are given as members variables:1

  1. template< class LD > constexpr static LD mimes::Cosmo< LD >::T0: CMB temperature today in GeV.
  2. template< class LD > constexpr static LD mimes::Cosmo< LD >::h_hub: Dimensionless Hubble constant.
  3. template< class LD > constexpr static LD mimes::Cosmo< LD >::rho_crit: Critical density in GeV3^3.
  4. template< class LD > constexpr static LD mimes::Cosmo< LD >::relicDM_obs: Central value of the measured DM relic abundance.
  5. template< class LD > constexpr static LD mimes::Cosmo< LD >::mP: Planck mass in GeV.

The AxionMass class

The mimes::AxionMass<LD> class is responsible for the definition of the axion mass. The header file of this class is \mimes/src/AxionMass/AxionMass.hpp.

The class has two constructors. The first one is

    template< class LD >
    mimes::AxionMass(std::string chi_PATH, LD minT=0, LD maxT=mimes::Cosmo::mP)

The first argument, chi_PATH, is the path to a data file that contains two columns; TT (in GeV) and χ\chi (in GeV4GeV^4), with increasing TT. The arguments minT and maxT are the interpolation limits. These limits are used in order to stop the interpolation in the closest temperatures that exist in the data file. That is the actual interpolation limits are TminT_{\min}\geqminT and TmaxT_{\max}\leqmaxT. Beyond these limits, by default, the axion mass is assumed to be constant. However, this can be changed by using the member functions


    void set_ma2_MIN(std::function<LD(LD,LD)> ma2_MIN)
    void set_ma2_MAX(std::function<LD(LD,LD)> ma2_MAX)

Here, ma2_MIN and ma2_MAX are functors that define the axion mass squared beyond the interpolation limits. In order to ensure that the axion mass is continuous, usually we need TminT_{\min}, TmaxT_{\max}, χ(Tmin)\chi(T_{ min}), and χ(Tmax)\chi(T_{ max}). These values can be obtained using the member functions

  1. template< class LD > LD mimes::AxionMass::getTMin(): This function returns the minimum interpolation temperature, TminT_{ min}.
  2. template< class LD > LD mimes::AxionMass::getTMax(): This function returns the maximum interpolation temperature, TmaxT_{ max}.
  3. template< class LD > LD mimes::AxionMass::getChiMin(): This function returns χ(Tmin)\chi(T_{ min}).
  4. template< class LD > LD mimes::AxionMass::getChiMax(): This function returns χ(Tmax)\chi(T_{ max}).
An alternative way to define the axion mass is via the constructor

    template< class LD >
    mimes::AxionMass(std::function<LD(LD,LD)> ma2)

Here, the only argument is the axion mass squared, m̃a(T)\tilde{m}_a(T), defined as a callable object.

Once an instance of the class is defined, we can get m̃a2(T)\tilde{m}^2_a(T) using the member function

    template< class LD >    LD mimes::AxionMass::ma2(LD T, LD fa)

We should note that ma2 is a public std::function<LD(LD,LD)> member variable. Therefore, it can be assigned using the assignment operator. However, in order to change its definition, we can also use the following member function:


    template< class LD > void mimes::AxionMass::set_ma2(std::function<LD(LD,LD)> ma2)

The Axion class

The mimes::Axion< LD,Solver,Method > class is the class that combines all the others, and actually solves the axion EOM. Its header file is \mimes/src/Axion/AxionSolve.hpp and its constructor is

    template< class LD, const int Solver, class Method >
    mimes::Axion< LD, Solver, Method >(LD theta_i, LD fa, LD umax, LD TSTOP, 
                    LD ratio_ini, unsigned int N_convergence_max, LD convergence_lim, 
                    std::string inputFile, AxionMass *axionMass, LD initial_step_size=1e-2, 
                    LD minimum_step_size=1e-8, LD maximum_step_size=1e-2, LD absolute_tolerance=1e-8, 
                    LD relative_tolerance=1e-8, LD beta=0.9, LD fac_max=1.2, LD fac_min=0.8, 
                    unsigned int maximum_No_steps=10000000)
The various arguments are :
  1. theta_i: Initial angle, θi\theta_i.
  2. fa: The PQ scale.
  3. umax : If u>u> umax the integration stops (remember that u=log(a/ai)u=\log(a/a_i)). Typically, this should be a large number (1000\sim 1000), in order to avoid stopping the integration before the axion begins to evolve adiabatically.
  4. TSTOP: If the temperature drops below this, integration stops. In most cases this should be around 10410^{-4} GeV, in order to be sure that any entropy injection has stopped before integration stops should not be violated).
  5. ratio_ini: Integration starts when $3H/ m_a(T) $ ratio_ini (the exact point depends on the file `` inputFile", which we will see later).
  6. N_convergence_max and convergence_lim: Integration stops when the relative difference between two consecutive peaks is less than convergence_lim for N_convergence_max consecutive peaks. This is the point beyond which adiabatic evolution is assumed.
  7. inputFile : Relative (or absolute) path to a file that describes the cosmology. the columns should be: uu TT (in GeV) logH\log H, sorted so that uu increases.2 It is important to remember that MiMeS assumes that the entropy injection has stopped before the lowest temperature given in inputFile. Since MiMeS is unable to guess the cosmology beyond what is given in this file, the user has to make sure that there are data between the initial temperature (which corresponds to ratio_ini), and TSTOP.
  8. axionMass: An instance of the mimes::AxionMass class, passed by pointer.
  9. initial_stepsize (optional): Initial step the solver takes.
  10. maximum_stepsize (optional): This limits the step-size to an upper limit.
  11. minimum_stepsize (optional): This limits the step-size to a lower limit.
  12. absolute_tolerance (optional): Absolute tolerance of the RK solver.
  13. relative_tolerance (optional): Relative tolerance of the RK solver. Generally, both absolute and relative tolerances should be 10810^{-8}. In some cases, however, one may need more accurate result (if fa is extremely high, the oscillations happen violently, and the system destabilizes). In any case, if the tolerances are below 10810^{-8}, LD should be long double. MiMeS by default uses long double variables, in order to change it see the options available in Compile-time choices.
  14. beta (optional): Controls how agreesive the adaptation is. Generally, it should be around but less than 1.
  15. fac_max, fac_min (optional): The stepsize does not increase more than fac_max, and less than fac_min. This ensures a better stability. Ideally, fac_max==\infty and fac_min=0=0, but in reality one must tweak them in order to avoid instabilities.
  16. maximum_No_steps (optional): Maximum steps the solver can take. Quits if this number is reached even if integration is not finished.
The member function responsible for solving the EOM is

    template< class LD, const int Solver, class Method >
    void mimes::Axion< LD, Solver, Method >::solveAxion()

Once this function finishes, the results are stored in several member variables.

The quantities a/ai,T,θ,ζ,ρaa/a_i, \ T, \ \theta, \ \zeta, \rho_a, at the integration steps are stored in

    template< class LD, const int Solver, class Method > 
    std::vector< std::vector< LD > > mimes::Axion< LD, Solver, Method >::points
The quantities a/ai,T,θ,ζ,ρa,Ja/a_i, \ T, \ \theta, \ \zeta, \rho_a, \ J, at the peaks of the oscillation are stored in

    template< class LD, const int Solver, class Method > 
    std::vector< std::vector< LD > > mimes::Axion< LD, Solver, Method >::peaks

Note that these points are computed using linear interpolation between two integration points with a change in the sign of ζ\zeta.

The local integration errors for θ\theta and ζ\zeta are stored in

    template< class LD, const int Solver, class Method > 
    std::vector< LD > mimes::Axion< LD, Solver, Method >::dtheta
    
    template< class LD, const int Solver, class Method > 
    std::vector< LD > mimes::Axion< LD, Solver, Method >::dzeta
Moreover, the oscillation temperature, ToscT_{osc}, and the corresponding values of a/aia/a_i and θ\theta are given in

    template< class LD, const int Solver, class Method >
    LD mimes::Axion< LD, Solver, Method >::T_osc
    
    template< class LD, const int Solver, class Method >
    LD mimes::Axion< LD, Solver, Method >::a_osc

    template< class LD, const int Solver, class Method >
    LD mimes::Axion< LD, Solver, Method >::theta_osc
Also, the entropy injection between the last peak (T=TpeakT=T_{peak}) and today (T=T0T=T_0), γ\gamma (the entropy increase factor from T=TiT=T_i), is given in

    template
    LD mimes::Axion< LD, Solver, Method >::gamma
The relic abundance is stored in the following member variable

    template< class LD, const int Solver, class Method >
    LD mimes::Axion< LD, Solver, Method >::relic
We can set another initial condition, θi\theta_i, using

    template< class LD, const int Solver, class Method >
    void mimes::Axion< LD, Solver, Method >::setTheta_i(LD theta_i)

We should note that running this function all variables are cleared. So we lose all information about the last time axionSolve() ran.

In case the mass of the axion is changed, we also need to remake the interpolation (run mimes::AxionEOM::makeInt()). This is done using

    template< class LD, const int Solver, class Method >
    void mimes::Axion< LD, Solver, Method >::restart()

Again, this function clears all member variables. So it should be used with caution.

Finally, there is static mimes::Cosmo< LD > member variable

    template< class LD, const int Solver, class Method >
    static mimes::Cosmo< LD > mimes::Axion< LD, Solver, Method >::plasma

This variable can be used without an instance of the mimes::Axion< LD,Solver,Method > class.


  1. Taken from PRD and the Planck Collaboration.

  2. One can run bash MiMeS/src/FormatFile.sh inputFile in order to sort it and remove any unwanted duplicates.