Skip to content

Commit

Permalink
Make generate_missing* more symmetric
Browse files Browse the repository at this point in the history
  • Loading branch information
felixhekhorn committed Jun 27, 2023
1 parent 54bad14 commit f1f82a6
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 35 deletions.
6 changes: 5 additions & 1 deletion src/yadism/coefficient_functions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,11 @@ def heavy_components(self):
if self.scheme == "FFN0":
heavy_comps[sfh].extend(
asy.kernels.generate_missing_asy(
self.esf, nf, ihq, self.esf.info.theory["pto_evol"]
self.esf,
nf,
ihq,
self.esf.info.theory["pto_evol"],
icoupl=sfh,
)
)
else:
Expand Down
59 changes: 29 additions & 30 deletions src/yadism/coefficient_functions/asy/kernels.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,51 +18,50 @@ def import_pc_module(kind, process, subpkg=None):
return kernels.import_local(kind, process, subpkg)


def generate_missing_asy(esf, nf, ihq, pto_evol):
def generate_missing_asy(esf, nf, ihq, pto_evol, icoupl=None):
r"""
Collect the high-virtuality limit of missing.
Parameters
----------
esf : EvaluatedStructureFunction
kinematic point
nf : int
number of light flavors
ihq : int
heavy quark
pto_evol : int
PTO of evolution
esf : EvaluatedStructureFunction
kinematic point
nf : int
number of light flavors
ihq : int
heavy quark
pto_evol : int
PTO of evolution
icoupl : None or int
PID of the flavor coupling (default: None)
Returns
-------
elems : list(yadism.kernels.Kernel)
list of elements
elems : list(yadism.kernels.Kernel)
list of elements
"""
kind = esf.info.obs_name.kind
# in CC there are no missing diagrams known yet
if esf.process == "CC":
light_weights = kernels.cc_weights(
esf.info.coupling_constants,
esf.Q2,
br.quark_names[:nf],
nf + 1,
esf.info.obs_name.is_parity_violating,
)
else:
light_weights = light.kernels.nc_weights(
esf.info.coupling_constants,
esf.Q2,
nf + 1,
esf.info.obs_name.is_parity_violating,
skip_heavylight=True,
)
return ()
# only NC
weights = light.kernels.nc_weights(
esf.info.coupling_constants,
esf.Q2,
nf,
esf.info.obs_name.is_parity_violating,
skip_heavylight=True,
)
if icoupl is not None:
weights["ns"] = {k: v for k, v in weights["ns"].items() if abs(k) == icoupl}

asys = []
m2hq = esf.info.m2hq[ihq - 4]
kind = esf.info.obs_name.kind
asy_cfs = import_pc_module(kind, esf.process)
m2hq = esf.info.m2hq[ihq - 4]
asys = []
for res in range(pto_evol + 1):
name = "Asy" + ("N" * res) + "LL" + "NonSinglet"
km = kernels.Kernel(
light_weights["ns"], asy_cfs.__getattribute__(name)(esf, nf, m2hq=m2hq)
weights["ns"], asy_cfs.__getattribute__(name)(esf, nf, m2hq=m2hq)
)
asys.append(km)
return asys
Expand Down
8 changes: 4 additions & 4 deletions src/yadism/coefficient_functions/heavy/kernels.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,10 @@ def generate_missing(esf, nf, ihq, icoupl=None):
list of elements
"""
kind = esf.info.obs_name.kind
pcs = import_pc_module(kind, esf.process)
m2hq = esf.info.m2hq[ihq - 4]
# in CC there are no missing diagrams known yet
if esf.process == "CC":
return ()

# only NC
weights = light_nc_weights(
esf.info.coupling_constants,
esf.Q2,
Expand All @@ -112,6 +109,9 @@ def generate_missing(esf, nf, ihq, icoupl=None):
)
if icoupl is not None:
weights["ns"] = {k: v for k, v in weights["ns"].items() if abs(k) == icoupl}
kind = esf.info.obs_name.kind
pcs = import_pc_module(kind, esf.process)
m2hq = esf.info.m2hq[ihq - 4]
return (kernels.Kernel(weights["ns"], pcs.NonSinglet(esf, nf, m2hq=m2hq)),)


Expand Down

0 comments on commit f1f82a6

Please sign in to comment.