Skip to content

Commit

Permalink
rust: Pass ev/back method
Browse files Browse the repository at this point in the history
  • Loading branch information
felixhekhorn committed Aug 9, 2024
1 parent ad063c5 commit 25a3cdd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
8 changes: 4 additions & 4 deletions src/eko/evolution_operator/__init__.py.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/src/eko/evolution_operator/__init__.py b/src/eko/evolution_operator/__init__.py
index fe07ade9..0f58c9e5 100644
index fe07ade9..20c4539d 100644
--- a/src/eko/evolution_operator/__init__.py
+++ b/src/eko/evolution_operator/__init__.py
@@ -3,16 +3,16 @@ r"""Contains the central operator classes.
Expand Down Expand Up @@ -588,7 +588,7 @@ index fe07ade9..0f58c9e5 100644
def initialize_op_members(self):
"""Init all operators with the identity or zeros."""
eye = OpMember(
@@ -858,10 +317,13 @@ class Operator(sv.ScaleVariationModeMixin):
@@ -858,10 +317,14 @@ class Operator(sv.ScaleVariationModeMixin):
else:
self.op_members[n] = zero.copy()

Expand All @@ -601,12 +601,13 @@ index fe07ade9..0f58c9e5 100644
+ cfg.as1 = self.as_list[1]
+ cfg.as0 = self.as_list[0]
+ cfg.py = ekors.ffi.cast("void *", cb_quad_ker_qcd.address)
+ cfg.method_num = self.ev_method
+
+ def run_op_integration(self, log_grid):
"""Run the integration for each grid point.

Parameters
@@ -876,18 +332,54 @@ class Operator(sv.ScaleVariationModeMixin):
@@ -876,18 +339,53 @@ class Operator(sv.ScaleVariationModeMixin):
"""
column = []
k, logx = log_grid
Expand All @@ -622,7 +623,6 @@ index fe07ade9..0f58c9e5 100644
+ cfg.is_log = self.int_disp.log
+ cfg.logx = logx
+ cfg.Lsv = np.log(self.xif2)
+ cfg.method_num = 1
+ cfg.ev_op_iterations = self.config["ev_op_iterations"]
+ cfg.ev_op_max_order_qcd = self.config["ev_op_max_order"][0]
+ cfg.sv_mode_num = self.sv_mode
Expand Down
5 changes: 3 additions & 2 deletions src/eko/evolution_operator/operator_matrix_element.py.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/src/eko/evolution_operator/operator_matrix_element.py b/src/eko/evolution_operator/operator_matrix_element.py
index 022f8073..017ec73d 100644
index 022f8073..f6b3235d 100644
--- a/src/eko/evolution_operator/operator_matrix_element.py
+++ b/src/eko/evolution_operator/operator_matrix_element.py
@@ -2,11 +2,12 @@
Expand Down Expand Up @@ -142,7 +142,7 @@ index 022f8073..017ec73d 100644
class OperatorMatrixElement(Operator):
r"""
Internal representation of a single |OME|.
@@ -291,41 +191,14 @@ class OperatorMatrixElement(Operator):
@@ -291,41 +191,15 @@ class OperatorMatrixElement(Operator):
)
return labels

Expand Down Expand Up @@ -189,6 +189,7 @@ index 022f8073..017ec73d 100644
+ cfg.as1 = self.a_s
+ cfg.as0 = 0.0
+ cfg.Lsv = np.log(self.xif2)
+ cfg.method_num = self.backward_method

@property
def a_s(self):
12 changes: 4 additions & 8 deletions src/eko/evolution_operator/quad_ker.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def cb_quad_ker_qcd(
areas_x,
areas_y,
_L,
_method_num,
method_num,
as1,
as0,
ev_op_iterations,
Expand All @@ -105,8 +105,7 @@ def cb_quad_ker_qcd(
# combute basis functions
areas = nb.carray(areas_raw, (areas_x, areas_y))
pj = interpolation.evaluate_grid(n, is_log, logx, areas)
# TODO recover parameters
method = "iterate-exact"
method = method_num
order = (order_qcd, 0)
ev_op_max_order = (ev_op_max_order_qcd, 0)
if is_singlet:
Expand Down Expand Up @@ -235,7 +234,7 @@ def cb_quad_ker_ome(
areas_x,
areas_y,
L,
_method_num,
method_num,
as1,
_as0,
_ev_op_iterations,
Expand All @@ -251,7 +250,7 @@ def cb_quad_ker_ome(
# compute basis functions
areas = nb.carray(areas_raw, (areas_x, areas_y))
pj = interpolation.evaluate_grid(n, is_log, logx, areas)
# TODO recover parameters
backward_method = method_num
order = (order_qcd, 0)
if is_singlet:
indices = {21: 0, 100: 1, 90: 2}
Expand All @@ -270,9 +269,6 @@ def cb_quad_ker_ome(
if sv_mode == sv.Modes.exponentiated:
A = sv.exponentiated.gamma_variation(A, order, nf, Lsv)

# TODO recover InversionMethod
backward_method = None

# build the expansion in alpha_s depending on the strategy
ker = build_ome(A, order, as1, backward_method)

Expand Down

0 comments on commit 25a3cdd

Please sign in to comment.