Enable nf=3 with `evolven3fit_new`.
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 fornf > nf0
.
Merge request reports
Activity
requested review from @enocera
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: scarlehoff
This is ready for review. Some notes:
- 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 to1e-1
(specially at lower values of x) - 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
- 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
fornf-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 fornf=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)- The agreement between an apfel and eko evolved PDF is mostly at the level of a relative difference of
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 atnf-1
the result ofnf
). 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.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: 23 23 raise ValueError(f"The values of {title} are not sorted!") 24 24 25 25 26 def check_consecutive_members(grid, value): 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 givennf0
is ignored. On contrary by default from the cli here we have Q2s to None so you actually want to usenf0
, it's just a bit confusing, but I don't see a quick fix as wellCreated 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 neverNone
(despite being always 4, at least for the time being - but remember that is 3 for perturbative charm). You should be allowed to discard thenf
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 ofQ0
withmc * 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.mentioned in merge request !1715 (merged)