Here below a script that computes matter power spectra with CAMB, CLASS and HI-CLASS Boltzmann codes. The CAMB and CLASS parts represent the LCDM model whereas HI-CLASS is used to generate Brans-Dicke's matter power spectrum.
Code: Select all
import numpy as np
import matplotlib.pyplot as plt
from classy import Class
import camb
from hi_classy import Class as hiClass
# Cosmological parameters for LCDM
cosmo = {
'h': 0.67810,
'omega_b': 0.02238280,
'omega_cdm': 0.1201075,
'A_s': 2.100549e-09,
'tau_reio': 0.05430842,
'n_s': 0.9660499
}
# DEFAULT VALUES
cosmo_bd = {
'Omega_Lambda': '0.',
'Omega_fld': '0.',
'Omega_smg': '-1.',
'gravity_model': 'brans dicke',
'parameters_smg': '0.7, 800, 1., 1.',
'pert_initial_conditions_smg': 'zero',
'output': 'tCl, mPk',
'a_min_stability_test_smg': '1.e-7',
}
kmin = 1e-4
kmax = 1
npoints = 1000
lmax = 2500
# CAMB configuration
pars = camb.CAMBparams()
pars.set_cosmology(H0=cosmo['h']*100, ombh2=cosmo['omega_b'], omch2=cosmo['omega_cdm'], tau=cosmo['tau_reio'])
pars.InitPower.set_params(As=cosmo['A_s'], ns=cosmo['n_s'])
pars.set_matter_power(redshifts=[0.], kmax=2.0)
pars.NonLinear = camb.model.NonLinear_none
results = camb.get_results(pars)
kh, z, pk_camb = results.get_matter_power_spectrum(minkh=kmin, maxkh=kmax, npoints=npoints)
# CLASS configuration for LCDM
LambdaCDM = Class()
LambdaCDM.set(cosmo)
LambdaCDM.set({'output': 'mPk', 'P_k_max_1/Mpc': 3.0})
LambdaCDM.compute()
pk_class = [LambdaCDM.pk(k*cosmo['h'], 0.) * cosmo['h']**3 for k in kh]
# Hi-CLASS configuration for Brans-Dicke
hi_class_bd = hiClass()
hi_class_bd.set(cosmo_bd)
hi_class_bd.compute()
pk_hi_class = [hi_class_bd.pk(k, 0.) for k in kh]
# Plotting the power spectra
plt.figure()
plt.loglog(kh, pk_class, 'r-', label='CLASS - LCDM')
plt.loglog(kh, pk_camb[0], 'k--', label='CAMB - LCDM')
plt.loglog(kh, pk_hi_class, 'b-.', label='Hi-CLASS - Brans-Dicke')
plt.legend(loc='upper right')
plt.xlabel(r'$k \,\,\,\, [h/\mathrm{Mpc}]$')
plt.ylabel(r'$P(k) \,\,\,\, [\mathrm{Mpc}/h]^3$')
plt.savefig('Matter_power_spectrum_comparison.png')
plt.show()
Then, I get the following plot :
As you can see, the Brans-Dicke curve is pretty higher than the 2 others LCDM ones (CLASS and CAMB).
The goal here is to find parameters into "cosmo_bd" block above in script in order to get similar LCDM matter power spectrum.
For this, i tried to set a high value for [math], typically 4e4 (instead of 0.7 in "parameters_smg") but it doesn't really change the curve of Brans-Dicke, still higer than LCDM.
I don't know how to play on these parameters to reproduce LCDM.
If someone has already managed to find the LCDM model from Brans-Dicke with Hi-CLASS, I would be grateful to help me on these different parameters.
Best regards.