Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different non-linear matter power spectra for different variables #91

Open
alexander-mead opened this issue Sep 23, 2020 · 1 comment
Open

Comments

@alexander-mead
Copy link
Contributor

# Import CAMB
import camb

# Set parameters
pars = camb.CAMBparams()
pars.set_cosmology(H0=67.5, ombh2=0.022, omch2=0.122, mnu=0.07)
pars.set_matter_power([0.], kmax=100., nonlinear=True)
pars.NonLinearModel.set_params(halofit_version='mead')

# Do the calculation
data = camb.get_results(pars)

# Get the power spectrum at some wavenumber
_, _, Pk_tot = data.get_nonlinear_matter_power_spectrum(params=pars, var1='delta_tot', var2='delta_tot')
_, _, Pk_cdm = data.get_nonlinear_matter_power_spectrum(params=pars, var1='delta_cdm', var2='delta_cdm')
print(Pk_tot[0][160], Pk_cdm[0][160])

If I run the above code I get the following printed out: 810.7663200215078 820.4239789024388

I'm confused by the fact that these numbers are different, since the HMcode model for the non-linear power spectrum only calculates the result for the total matter power spectrum, and has not been calibrated for the non-linear CDM-CDM power spectrum, or anything else like that.

I checked and the two results are also different if halofit_version='takahashi' and HALOFIT was also only calibrated to provide the total matter power spectrum.

In principle, one ought to be able to calculate the non-linear (cross) power for any combination of var1 and var2, but the above models have not been calibrated to do this. I'm not sure what either calculation would be doing when either var1 or var2 is set to delta_cdm. Should an error message be generated instead of a result?

@cmbant
Copy link
Owner

cmbant commented Sep 23, 2020

Yes, it at assumes all sources scale the same way (by the ratio of the nonlinear to nonlinear that you do calculate). Clearly it's wrong, though it will be right in the linear limit and approximately correct in most cases. In principle there should be separate results for each density and the velocity (the latter is implemented in SecondOrderPK but only used for high-redshift 21cm).

@cmbant cmbant changed the title Confusion over 'var' with non-linear matter power spectrum Using different non-linear matter power spectrum Dec 11, 2020
@cmbant cmbant changed the title Using different non-linear matter power spectrum Using different non-linear matter power spectra Dec 11, 2020
@cmbant cmbant changed the title Using different non-linear matter power spectra Different non-linear matter power spectra for different variables Dec 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants