Skip to content

Commit

Permalink
Merge pull request #48 from N3PDF/physics/alpha_s_NLO
Browse files Browse the repository at this point in the history
Alpha_s at NLO for Yadism
  • Loading branch information
felixhekhorn committed Jun 25, 2020
2 parents 9d35593 + 40a4ccc commit d9e33c1
Show file tree
Hide file tree
Showing 13 changed files with 333 additions and 128 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@ jobs:
build:

runs-on: ubuntu-latest
strategy:
# max-parallel: 2
matrix:
python-version: [3.7, 3.8]
fail-fast: false

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
- name: Set up Python ${{ matrix.python-version }} 🐍
uses: actions/setup-python@v1
with:
python-version: 3.8
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-get install -y libgsl-dev
Expand Down
2 changes: 2 additions & 0 deletions doc/source/Theory/pQCD.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ We use perturbative QCD with the running coupling

Our main reference is :cite:`Herzog:2017ohr`.

The matching conditions are given in :cite:`Chetyrkin:1997sg`.

Implementation: :class:`~eko.strong_coupling.StrongCoupling`

Splitting Functions
Expand Down
12 changes: 12 additions & 0 deletions doc/source/refs.bib
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,16 @@ @article{Vogt:2004ns
title = "{Efficient evolution of unpolarized and polarized parton distributions with QCD-PEGASUS}",
volume = "170",
year = "2005"
}
@article{Chetyrkin:1997sg,
author = "Chetyrkin, K.G. and Kniehl, Bernd A. and Steinhauser, M.",
title = "{Strong coupling constant with flavor thresholds at four loops in the MS scheme}",
eprint = "hep-ph/9706430",
archivePrefix = "arXiv",
reportNumber = "MPI-PHT-97-025",
doi = "10.1103/PhysRevLett.79.2184",
journal = "Phys. Rev. Lett.",
volume = "79",
pages = "2184--2187",
year = "1997"
}
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from setuptools import setup, find_packages

setup(name='eko',
version='0.0.1',
version='0.2.0',
description='Evolution Kernel Operator',
author = 'S.Carrazza, J.Cruz-Martinez, F. Hekhorn',
author_email='stefano.carrazza@cern.ch',
Expand Down Expand Up @@ -36,5 +36,5 @@
"cffi>1.0.0"
],
cffi_modules=["src/cfunctions/digamma.py:ffibuilder"],
python_requires='>=3.8'
python_requires='>=3.7'
)
4 changes: 3 additions & 1 deletion src/eko/evolution_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,8 @@ def __mul__(self, other):
p : PhysicalOperator
self * other
"""
if not isinstance(other, PhysicalOperator):
raise ValueError("Can only multiply with another PhysicalOperator")
# prepare paths
instructions = {}
for my_op in self.op_members.values():
Expand All @@ -377,7 +379,7 @@ def __mul__(self, other):
new_ops = {}
for key, paths in instructions.items():
new_ops[key] = OperatorMember.join(op_to_compose, paths)
return PhysicalOperator(new_ops, self.q2_final)
return self.__class__(new_ops, self.q2_final)

def get_raw_operators(self):
"""
Expand Down
4 changes: 2 additions & 2 deletions src/eko/kernel_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,12 @@ def njit(self, function):
Parameters
---------
function : callable or list(callable)
input (list of) function
input (list of) callable(s)
Returns
-------
function : callable or list(callable)
compiled (list of) function
compiled (list of) callable(s)
"""
if isinstance(function, abc.Iterable):
return [self.njit(f) for f in function]
Expand Down
21 changes: 11 additions & 10 deletions src/eko/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def apply_pdf(self, input_pdfs, targetgrid=None):
Returns
---------
out_grid : dict
output PDFs and their associated errors for the computed q2_grid
output PDFs and their associated errors for the computed Q2grid
"""
# TODO rotation from the evolution basis to flavor basis? if yes, here!
# turn input_pdfs into lists
Expand All @@ -47,7 +47,7 @@ def apply_pdf(self, input_pdfs, targetgrid=None):

# build output
out_grid = {}
for q2 in self["q2_grid"]:
for q2 in self["Q2grid"]:
pdfs, errs = self.get_op(q2).apply_pdf(input_lists)
out_grid[q2] = {"pdfs": pdfs, "errors": errs}

Expand Down Expand Up @@ -85,7 +85,7 @@ def get_raw(self):
"""
# prepare output dict
out = {
"q2_grid": {},
"Q2grid": {},
}
# dump raw elements
for f in ["polynomial_degree", "is_log_interpolation", "q2_ref"]:
Expand All @@ -94,8 +94,8 @@ def get_raw(self):
for k in ["xgrid"]:
out[k] = self[k].tolist()
# make operators raw
for q2 in self["q2_grid"]:
out["q2_grid"][q2] = self.get_op(q2).get_raw_operators()
for q2 in self["Q2grid"]:
out["Q2grid"][q2] = self.get_op(q2).get_raw_operators()
return out

def dump_yaml(self, stream=None):
Expand All @@ -113,6 +113,7 @@ def dump_yaml(self, stream=None):
result of dump(output, stream), i.e. a string, if no stream is given or
Null, if self is written sucessfully to stream
"""
# TODO explicitly silence yaml
out = self.get_raw()
return yaml.dump(out, stream)

Expand Down Expand Up @@ -187,10 +188,10 @@ def get_op(self, q2):
corresponding Operator
"""
# check existence
if q2 not in self["q2_grid"]:
if q2 not in self["Q2grid"]:
raise KeyError(f"q2={q2} not in grid")
# compose
ops = self["q2_grid"][q2]
ops = self["Q2grid"][q2]
op_members = {}
for name in ops["operators"]:
op_members[name] = OperatorMember(
Expand Down Expand Up @@ -225,16 +226,16 @@ def concat(self, other):
raise ValueError(f"'xgrid' of the two factors does not match")
# check matching
mid_scale = self["q2_ref"]
if not mid_scale in other["q2_grid"]:
if not mid_scale in other["Q2grid"]:
raise ValueError("Operators can not be joined")
# prepare output
other_op = other.get_op(mid_scale)
out = copy.deepcopy(self)
out["q2_ref"] = other["q2_ref"]
for q2 in self["q2_grid"]:
for q2 in self["Q2grid"]:
# multiply operators
me = self.get_op(q2)
prod = me * other_op
out["q2_grid"][q2] = prod.get_raw_operators()
out["Q2grid"][q2] = prod.get_raw_operators()

return out
Loading

0 comments on commit d9e33c1

Please sign in to comment.