Skip to content

Comments

Change GR flag from 1 to 0 in boltzmann.py#1257

Open
bastiencarreres wants to merge 1 commit intomasterfrom
Issue-1256
Open

Change GR flag from 1 to 0 in boltzmann.py#1257
bastiencarreres wants to merge 1 commit intomasterfrom
Issue-1256

Conversation

@bastiencarreres
Copy link

Change the GR flag from 1 to 0 to activate modified gravity

@bastiencarreres bastiencarreres linked an issue Oct 31, 2025 that may be closed by this pull request
Copy link
Contributor

@nikosarcevic nikosarcevic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, Bastien!

Thank you for this.

Can you please submit some plots that show how this fixes the problem?

@bastiencarreres
Copy link
Author

bastiencarreres commented Dec 5, 2025

This plot show the power spectrum for various value of mu0 when setting GR=0 or 1
image

Copy link

@Lhior Lhior left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only potential improvement is to add a check if there's any MG parameters actually being used in order to enable MG, e.g.
is_mg = (abs(cosmo.mg_parametrization.mu_0) > 0 or abs(cosmo.mg_parametrization.sigma_0) > 0 or abs(cosmo.mg_parametrization.lambda_mg) > 0) cp.GR = 0
if is_mg else 1 # GR==0 to allow MG in ISiTGR
But you can very easily convince me that the fact that someone is actively calling isitgr is enough to assume they're using MG, so the current modifications look good to me as is!

@nikosarcevic
Copy link
Contributor

Only potential improvement is to add a check if there's any MG parameters actually being used in order to enable MG, e.g. is_mg = (abs(cosmo.mg_parametrization.mu_0) > 0 or abs(cosmo.mg_parametrization.sigma_0) > 0 or abs(cosmo.mg_parametrization.lambda_mg) > 0) cp.GR = 0 if is_mg else 1 # GR==0 to allow MG in ISiTGR But you can very easily convince me that the fact that someone is actively calling isitgr is enough to assume they're using MG, so the current modifications look good to me as is!

I think this check is still important to do. Before anyone approving this merge can we ask MG people to check of if @bastiencarreres can do it quickly?

@bastiencarreres
Copy link
Author

bastiencarreres commented Dec 11, 2025

@Lhior @nikosarcevic
I think that default values of MG parameters are GR values thus even if GR=0 having the MG parameters set to GR values will return the GR power spectrum!

Copy link
Contributor

@carlosggarcia carlosggarcia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are test that are failing. They are related to the correlations functions. Can you check what's going on?

@nikosarcevic
Copy link
Contributor

nikosarcevic commented Dec 17, 2025

There are test that are failing. They are related to the correlations functions. Can you check what's going on?

Currently the CI is failing on main. So every time you branch out to fix something you inherit the CI fails (I tihnk for me it is in bacco tests). Can you confirm that?
When I was working on my PRs I stated that. I checked my tests only on the files I have changed but not the stuff that is currently killing the CI from main.

also there is this circular import issue aside from the bacco test #1259

@bastiencarreres
Copy link
Author

bastiencarreres commented Dec 17, 2025

@carlosggarcia It seems that some of the failing tests are related to MG models, if the values the tests are using as baseline were computed using the GR = 1 flag (?), I guess that it cannot match.

@nikosarcevic
Copy link
Contributor

@carlosggarcia It seems that some of the failing tests are related to MG models, if the values the tests are using as baseline were computed using the GR = 1 flag (?), I guess that it cannot match.

can we tag @Lhior to check this and help out?

@Lhior Lhior self-requested a review December 18, 2025 04:15
@Lhior
Copy link

Lhior commented Dec 18, 2025

I believe what @carlosggarcia pointed out is exactly right, specifically the tests in test_power_mg2.py are failing because the reference values where computed with the wrong flag. All other MG tests (e.g. OMP_NUM_THREADS=2 python -m pytest -vv benchmarks/test_*MG*.py benchmarks/test_*mg*.py pass on my laptop even when manually lowering the tolerance to 1e-6.

After further investigation though, I have some questions... why is the tolerance in the classy implementation set to 1e-2 while the tolerance in the isitgr implementation set to 1e-4? If I set the classy tolerance to 1e-4, all test_power_mg.py tests fail. On the other side, if I set the tolerance in test_power_mg2.py to 1e-2 all tests pass.
I found this while trying to do a temporal workaround of benchmarking isitgr against classy evaluates values on the fly instead of using the current reference ones, even in that case the tolerance needs to be set to 1e-2 for the tests to pass and fails when set to 1e-4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Modified GR not activated when using ISiTGR

4 participants