Problem when running Cobaya with Polychord sampler

Use of Cobaya. camb, CLASS, cosmomc, compilers, etc.
Post Reply
Thomas Montandon
Posts: 1
Joined: October 05 2018
Affiliation: Laboratoire AstroParticule et Cosmologie

Problem when running Cobaya with Polychord sampler

Post by Thomas Montandon » January 28 2019

Hello,

I have some troubles when I am running the code Cobaya with the sampler Poychord. It gives me an error that doesn't happen with the sampler MCMC which works well. If you need the full debug file, could you tell me in which extension can I load it as an attachment ?

I think that somehow the problem come from the set_cosmology function where the function f(H0) is minimized (self.H0 = brentq(f, theta_H0_range[0], theta_H0_range[1], rtol=1e-4)). I hope you will help me solve my problem.

Thank a lot !
Thomas Montandon

Here is the error message:

Traceback (most recent call last):
441 File "/pbs/home/t/tmontand/.local/bin/cobaya-run", line 11, in <module>
442 load_entry_point('cobaya==1.0.3', 'console_scripts', 'cobaya-run')()
443 File "/pbs/home/t/tmontand/.local/lib/python2.7/site-packages/cobaya-1.0.3-py2.7.egg/cobaya/run.py", line 124, in run_script
444 run(info)
445 File "/pbs/home/t/tmontand/.local/lib/python2.7/site-packages/cobaya-1.0.3-py2.7.egg/cobaya/run.py", line 65, in run
446 sampler.run()
447 File "/pbs/home/t/tmontand/.local/lib/python2.7/site-packages/cobaya-1.0.3-py2.7.egg/cobaya/sampler.py", line 170, in __exit__
448 self.close(exception_type, exception_value, traceback)
449 File "/pbs/home/t/tmontand/.local/lib/python2.7/site-packages/cobaya-1.0.3-py2.7.egg/cobaya/run.py", line 65, in run
450 sampler.run()
451 File "/pbs/home/t/tmontand/.local/lib/python2.7/site-packages/cobaya-1.0.3-py2.7.egg/cobaya/samplers/polychord/polychord.py", line 191, in run
452 self.pc_settings, self.pc_prior)
453 File "/sps/planck/Users/tmontand/python/cosmo_module/code/PolyChord/build/lib.linux-x86_64-2.7/PyPolyChord/__init__.py", line 216, in run_polychord
454 settings.seed)
455 File "/sps/planck/Users/tmontand/python/cosmo_module/code/PolyChord/build/lib.linux-x86_64-2.7/PyPolyChord/__init__.py", line 179, in wrap_loglikelihood
456 logL, phi[:] = loglikelihood(theta)
457 File "/pbs/home/t/tmontand/.local/lib/python2.7/site-packages/cobaya-1.0.3-py2.7.egg/cobaya/samplers/polychord/polychord.py", line 176, in logpost
458 self.model.logposterior(params_values))
459 File "/pbs/home/t/tmontand/.local/lib/python2.7/site-packages/cobaya-1.0.3-py2.7.egg/cobaya/model.py", line 282, in logposterior
460 make_finite=make_finite, cached=cached, _no_check=True)
461 File "/pbs/home/t/tmontand/.local/lib/python2.7/site-packages/cobaya-1.0.3-py2.7.egg/cobaya/model.py", line 188, in loglikes
462 _derived=_derived, cached=cached)
463 File "/pbs/home/t/tmontand/.local/lib/python2.7/site-packages/cobaya-1.0.3-py2.7.egg/cobaya/likelihood.py", line 355, in logps
464 **theory_params_dict)
465 File "/pbs/home/t/tmontand/.local/lib/python2.7/site-packages/cobaya-1.0.3-py2.7.egg/cobaya/theories/camb/camb.py", line 644, in compute
466 _ , intermediates = self.help2compute(result, i_state, get_intermediates=True)
467 File "/pbs/home/t/tmontand/.local/lib/python2.7/site-packages/cobaya-1.0.3-py2.7.egg/cobaya/theories/camb/camb.py", line 495, in help2compute
468 intermediates["CAMBparams"]["result"])
469 File "/sps/planck/Users/tmontand/python/cosmo_module/code/CAMB/pycamb/camb/camb.py", line 1276, in get_results
470 res.calc_power_spectra(params)
471 File "/sps/planck/Users/tmontand/python/cosmo_module/code/CAMB/pycamb/camb/camb.py", line 454, in calc_power_spectra
472 result = self.calc_transfers(params, only_transfers=False)
473 File "/sps/planck/Users/tmontand/python/cosmo_module/code/CAMB/pycamb/camb/camb.py", line 435, in calc_transfers
474 if not only_transfers: self._check_powers(params)
475 File "/sps/planck/Users/tmontand/python/cosmo_module/code/CAMB/pycamb/camb/camb.py", line 440, in _check_powers
476 if params.InitPower.has_tensors() and not params.WantTensors:
477 AttributeError: 'bool' object has no attribute 'InitPower'

Antony Lewis
Posts: 1941
Joined: September 23 2004
Affiliation: University of Sussex
Contact:

Re: Problem when running Cobaya with Polychord sampler

Post by Antony Lewis » March 12 2019

Please try running with the latest Cobaya from github? (line numbers seem to have changed)

Post Reply