Skip to content
Snippets Groups Projects

Enable nf=3 with `evolven3fit_new`.

Merged Emanuele Roberto Nocera requested to merge fix_evolven3fit_for_nf=3 into master

Created by: scarlehoff

This PR enables the possibility of running evolven3fit_new with a fit in nf=3.

In order to make it more general now the operator receives a card where every time there is a threshold the Q_threshold is passed for both nf and nf+1 in order to avoid the hack of simply repeating one value.

The problem at the bottom threshold still remains.

Testing a fit evolved with apfel and eko for theory 200/400, they agree with a relative precision of 1e-3 for all points in x and for Q != mb (for nf=5 the agreement is a bit worse when you are close to mb). I've done the same test for theory 211 (perturbative charm, fit done in nf=3), there we again have a problem at the bottom threshold but as far as I can see the same problem doesn't appear at the charm threshold not sure why.

-> The problem at Q=mb for nf=5 is being investigated. Might be connected to this issue: https://github.com/NNPDF/eko/issues/173

-> The problem at Q=mb for nf=4 is due to eko which at the moment returns an object after evolution which is pdf(q), and pdf(q, nf=4) get's overwritten by pdf(q, nf=5). (same thing happens at nf=3 in theory).

This is still a draft because I would like to:

  • Organize better the Q-grids in a separate file.
  • Decide whether to set to 0.0 from n3fit the exportgrid for nf > nf0.

Merge request reports

Merged by Emanuele Roberto NoceraEmanuele Roberto Nocera 1 year ago (Jun 19, 2023 12:39pm UTC)

Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
72
67
68 if "nfref" not in theory:
69 theory["nfref"] = NFREF_DEFAULT
70
71 # Set nf_0 according to the fitting scale unless set explicitly
72 mu0 = theory["Q0"]
73 if "nf0" not in theory:
74 if mu0 < theory["mc"] * thresholds["c"]:
75 theory["nf0"] = 3
76 elif mu0 < theory["mb"] * thresholds["b"]:
77 theory["nf0"] = 4
78 elif mu0 < theory["mt"] * thresholds["t"]:
79 theory["nf0"] = 5
80 else:
81 theory["nf0"] = 6
  • Created by: felixhekhorn

    this should be the same as int(nf_default(mu0**2, atlas)) with the atlas from below (you can first use an atlas with a random origin)

    PS: @AleCandido you see: for outsiders we need to preserve nf_default

  • Created by: scarlehoff

    If I need to create a fake atlas I prefer to have this explicit here. All things considered it is not very ugly and it makes very explicit what nf0 means.

  • Created by: giacomomagni

    In which case nf0 will not be present in the theory card? Maybe the old ones?

  • Created by: scarlehoff

    In the nnpdf theory database it's not present (although the information is there because we have mu0 and the thresholds.

  • Created by: scarlehoff

    This is ready for review. Some notes:

    1. The agreement between an apfel and eko evolved PDF is mostly at the level of a relative difference of 1e-3 but for some points it can go up to 1e-1 (specially at lower values of x)
    2. There is no agreement at the quark thresholds, at both sides of the threshold. This seems to be a genuine difference https://github.com/NNPDF/eko/issues/173
    3. At every threshold we have two instances of the threshold Q: (Q, nf-1) and (Q, nf). At the moment eko cannot deal (at evolution time) with two values of nf for the same Q so I've added a -epsilon for nf-1.

    Organize better the Q-grids in a separate file.

    I think they actually fit well in the utils.py module which has only those grids and functions around them. So I've added the one for nf=3 there.

    Decide whether to set to 0.0 from n3fit the exportgrid for nf > nf0.

    Right now there is no nf0 in the theory and would need to be derived. So I'll pospone this decision to #1756 (closed)

  • Created by: scarlehoff

    At every threshold we have two instances of the threshold Q: (Q, nf-1) and (Q, nf). At the moment eko cannot deal (at evolution time) with two values of nf for the same Q so I've added a -epsilon for nf-1.

    @giacomomagni @andreab1997 @niclaurenti once this PR is merged it will be necessary to recompute previous eko due to the -epsilon. So whether to merge this change or not depends on whether you rather prefer to keep the same eko (but have at nf-1 the result of nf). And this depends on whether you believe eko is giving the right results around the thresholds (@felixhekhorn @AleCandido) because if it isn't then it doesn't matter (that much) how wrong they are.

    Alternatively, this can be fixed in the eko side, do a new release and then previous ekos should even work (since the value for (Q, nf-1) is included in the operator, the bug is only for the evolution.

  • mentioned in issue #283 (closed)

  • Created by: scarlehoff

    I've opened an issue in eko https://github.com/NNPDF/eko/issues/283

    I will remove the hack of - epsilon since the current bug is just a "reimplementation" of the old behaviour, and that -epsilon forces a recomputation of the eko.

  • Created by: scarlehoff

    I've reverted the hack. Please @andreab1997 have a look at this when you have time, as far as I am concerned this can be merged.

  • 145 145 """
    146 146 nnfitpath = usr_path / "nnfit"
    147 147 pdf_dict = {}
    148 for yaml_file in nnfitpath.glob("replica_*/*.exportgrid"):
    148 for yaml_file in nnfitpath.glob(f"replica_*/{usr_path.name}.exportgrid"):
  • 123 178 return my_runcard["theory"]["theoryid"]
    124 179
    125 180
    126 def generate_q2grid(Q0, Qfin, Q_points, match_dict):
    181 def generate_q2grid(Q0, Qfin, Q_points, match_dict, nf0=None):
    127 182 """Generate the q2grid used in the final evolved pdfs or use the default grid if Qfin or Q_points is
    128 183 not provided.
    129 184
    130 185 match_dict contains the couples (mass : factor) where factor is the number to be multiplied to mass
    131 186 in order to obtain the relative matching scale.
    132 187 """
    133 188 if Qfin is None and Q_points is None:
    134 return DEFAULT_Q2GRID
    189 if nf0 == 4:
    • Created by: andreab1997

      Since now it is becoming more difficult and we have two different defaults, I am wondering if we should just remove all the defaults and just compute the q2grid with Q0, Qfin and Q_points

    • Created by: scarlehoff

      Given a theory I think it makes sense to have a default or at least a recipe. Since the theories are a bit messy right now I think I prefer to have two defaults for the ~400 theories we have rather than put my hands there (for now).

  • 23 23 raise ValueError(f"The values of {title} are not sorted!")
    24 24
    25 25
    26 def check_consecutive_members(grid, value):
  • Created by: andreab1997

    Review: Approved

    Just a few comments but it looks good to me

  • 77 87 legacy_class = runcards.Legacy(theory, {})
    78 88 theory_card = legacy_class.new_theory
    79 89
    80 90 # construct operator card
    81 91 q2_grid = utils.generate_q2grid(
    82 theory["Q0"],
    92 mu0,
    83 93 q_fin,
    84 94 q_points,
    85 {theory["mb"]: thresholds["b"], theory["mt"]: thresholds["t"]},
    95 {
    96 theory["mc"]: thresholds["c"],
    97 theory["mb"]: thresholds["b"],
    98 theory["mt"]: thresholds["t"],
    99 },
    100 theory["nf0"],
    • Created by: giacomomagni

      I understand this work, so in principle is fine. When you call generate_q2grid with both Q2s given nf0 is ignored. On contrary by default from the cli here we have Q2s to None so you actually want to use nf0, it's just a bit confusing, but I don't see a quick fix as well

    • Created by: scarlehoff

      Yes, the nf0 is acting a bit like a secret parameter to generate the q2grid from the defaults. I guess another option is not to call generate_q2grid when there is nothing to generate (just a default being used).

    • Created by: giacomomagni

      maybe that's more clean.

    • Created by: alecandido

      Just to point out: nf0 parameter is going to disappear, or better to move. Now that we are propagating evolution points from EKO, everything should be an evolution point (a point on a lane, rather than on the ladder), and also fitting scale will be an evolution point.

      So nf0 should be always used, and never None (despite being always 4, at least for the time being - but remember that is 3 for perturbative charm). You should be allowed to discard the nf information only at the latest possible time (i.e. when generating the LHAPDF grid file).

      nf0 is an EKO extension to the NNPDF theory database, and inferred from the comparison of Q0 with mc * kcThr, but it would be better to always have it explicit, and infer as little as possible.

  • Created by: scarlehoff

    @niclaurenti @andreab1997 check that this version is compatible with QED also for 0.13.5 and if so please feel free to merge, there's still the nf-qgrid reorganization open but I won't be back until late next week and I think having all these fixes in master would be best.

  • Created by: niclaurenti

    @scarlehoff did you apply the changes I was doing in #1758?

  • Merged by: niclaurenti at 2023-06-19 12:39:01 UTC

  • merged manually

  • mentioned in merge request !1715 (merged)

  • Please register or sign in to reply
    Loading