Skip to content

Add check for the presence of lr in the sv grids - #271

Open
kamillaurent wants to merge 3 commits into
mainfrom
check_ren_sv_subgrids
Open

kamillaurent wants to merge 3 commits into
mainfrom
check_ren_sv_subgrids

Conversation

@kamillaurent

Copy link
Copy Markdown

Fix the scale-variation guard in check_scvar_evolve

The check for the scale-variation subgrids was triggered by max_as < max_as_effective, which can never be true. It now raises when max_as_effective == max_as.

Change:

  • src/pineko/theory.py: the error says which case it is: CENTRAL (sv orders missing) or SCVAR (central order missing).
  • tests/test_theory_sv.py: the existing test expected grid_central and grid_scvar at max_as=3 not to raise, i.e. it asserted the bug. Both are now wrapped in pytest.raises.

Validation:
Ran pineko theory opcards with theory 41000013 (NNLO, xiR = 2) on all datasets, using the original grids:

  • the 8 NNLO single-jet datasets (ATLAS and CMS 7, 8, 13 TeV, incl. ALTCORR1) raise CENTRAL only, as expected;
  • all other datasets pass.

Known limitation:
Only the highest order is checked, and only when the grid reaches the theory order. A grid that stops below the theory order (e.g. an NLO-only grid used in an NNLO theory) is not checked.

AI usage:
Claude Code, Claude Opus 5.5: bug analysis, code change and test. Reviewed and validated by the author.

@felixhekhorn felixhekhorn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is a heavy change (potentially fixing a previous bug), so we need more tests

Comment thread tests/test_theory_sv.py
pineko.check.Scale.REN,
)
with pytest.raises(ValueError, match="CENTRAL only"):
pineko.theory.check_scvar_evolve(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This would imply that we never call pineko.theory.check_scvar_evolve on central predictions - is this true?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yes, this should be the case, as if I run pineko theory opcards with any theory for which we do not vary the ren scale it does not raise the error.

Comment thread tests/test_theory_sv.py
max_al,
pineko.check.Scale.REN,
)
with pytest.raises(ValueError, match="SCVAR only"):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why is this considered an error? it looks fine to me. Compared to the first case above this just has an empty (2,0,0,0,0), which in principle could happen I guess?

Comment thread tests/test_theory_sv.py
return self.orders


def test_check_scvar_evolve():

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please add a bunch of more test cases here, in particular some where the LO is not $\alpha_s^0$, but is $\alpha_s^1$ and $\alpha_s^2$ including their respective SV. All real-life cases should be covered if possible

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Ok, I will add more cases in the test

@felixhekhorn felixhekhorn added the bug Something isn't working label Nov 25, 2026
@scarlehoff

Copy link
Copy Markdown
Member

Only the highest order is checked, and only when the grid reaches the theory order. A grid that stops below the theory order (e.g. an NLO-only grid used in an NNLO theory) is not checked.

At what order is checked a NNLO grid used in a NLO theory? (and what about a NNLO grid in a N3LO theory?)

Comment thread CHANGELOG.md
## [Unreleased](https://github.com/NNPDF/pineko/compare/v0.6.0...HEAD)

### Fixed
- `check_scvar_evolve` now raises when the highest order of a grid has only the central order (`CENTRAL`) or only the scale-variation orders (`SCVAR`); before, the check could never trigger. ([#271](https://github.com/NNPDF/pineko/pull/271))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

All DIS grids, for all nfonll pieces, pass?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I did not try the DIS grids, I will make the same test with those

@kamillaurent

Copy link
Copy Markdown
Author

Related to this PR: after this fix, running pineko theory ren-sv-grids is not enough for an NNLO theory with XIR != 1.

For example with ATLAS_1JET_13TEV_DIF_PT-Y, theory 41000013 (PTO = 2, XIR = 2):

Before:

0 O(as^2)
1 O(as^3)
2 O(as^4)

After pineko theory ren-sv-grids 41000013 ATLAS_1JET_13TEV_DIF_PT-Y I get orders:

0 O(as^2)
1 O(as^3)
2 O(as^4)
3 O(as^3 lr^1)

Only the NLO log is added; as^4 lr and as^4 lr^2 are missing, so pineko theory opcards 41000013 ATLAS_1JET_13TEV_DIF_PT-Y now raises CENTRAL only. Running ren-sv-grids again does not add anything. Is this intended or it is a bug?

@kamillaurent

Copy link
Copy Markdown
Author

Only the highest order is checked, and only when the grid reaches the theory order. A grid that stops below the theory order (e.g. an NLO-only grid used in an NNLO theory) is not checked.

At what order is checked a NNLO grid used in a NLO theory? (and what about a NNLO grid in a N3LO theory?)

The test only checks the order of alpha_s which is PTO powers above the alpha_s power of the LO. For example if at LO I have $as^m$ and I am using PTO = 2 the check is for the order $as^{m+2}$

This branch has not been deployed

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants