Skip to content

Commit

Permalink
Recover rustify
Browse files Browse the repository at this point in the history
  • Loading branch information
felixhekhorn committed Jan 13, 2025
1 parent 29c401d commit eb347df
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 20 deletions.
40 changes: 28 additions & 12 deletions src/eko/evolution_operator/__init__.py.patch
Original file line number Diff line number Diff line change
@@ -1,30 +1,45 @@
diff --git a/src/eko/evolution_operator/__init__.py b/src/eko/evolution_operator/__init__.py
index bd1b19d6..f543f7bc 100644
index 366f934c..73edf44f 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.
@@ -3,7 +3,6 @@ r"""Contains the central operator classes.
See :doc:`Operator overview </code/Operators>`.
"""

-import functools
import logging
import os
import time
@@ -11,13 +10,10 @@ from dataclasses import dataclass
from multiprocessing import Pool
from typing import Dict, Tuple

+import ekors
import numba as nb
import numpy as np
-from scipy import integrate
-
-import ekore.anomalous_dimensions.polarized.space_like as ad_ps
-import ekore.anomalous_dimensions.unpolarized.space_like as ad_us
-import ekore.anomalous_dimensions.unpolarized.time_like as ad_ut
+from scipy import LowLevelCallable, integrate

import ekore.anomalous_dimensions.polarized.space_like as ad_ps
import ekore.anomalous_dimensions.unpolarized.space_like as ad_us
@@ -32,91 +32,10 @@ from ..matchings import Segment, lepton_number
from .. import basis_rotation as br
from .. import interpolation, mellin
@@ -26,100 +22,12 @@ from ..couplings import Couplings
from ..interpolation import InterpolatorDispatcher
from ..io.types import EvolutionMethod, OperatorLabel
from ..kernels import ev_method
-from ..kernels import non_singlet as ns
-from ..kernels import non_singlet_qed as qed_ns
-from ..kernels import singlet as s
-from ..kernels import singlet_qed as qed_s
-from ..kernels import valence_qed as qed_v
-from ..matchings import Atlas, Segment, lepton_number
+from ..matchings import Atlas, Segment
from ..member import OpMember
from ..scale_variations import expanded as sv_expanded
from ..scale_variations import exponentiated as sv_exponentiated
-from ..scale_variations import expanded as sv_expanded
-from ..scale_variations import exponentiated as sv_exponentiated
+from .quad_ker import cb_quad_ker_qcd

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -114,7 +129,7 @@ index bd1b19d6..f543f7bc 100644
spec = [
("is_singlet", nb.boolean),
("is_QEDsinglet", nb.boolean),
@@ -188,421 +107,6 @@ class QuadKerBase:
@@ -191,422 +99,6 @@ class QuadKerBase:
return self.path.prefactor * pj * self.path.jac


Expand Down Expand Up @@ -533,10 +548,11 @@ index bd1b19d6..f543f7bc 100644
- )
- return ker
-

-
OpMembers = Dict[OperatorLabel, OpMember]
"""Map of all operators."""
@@ -792,49 +296,6 @@ class Operator(sv.ScaleVariationModeMixin):

@@ -809,49 +301,6 @@ class Operator(sv.ScaleVariationModeMixin):
"""Return the evolution method."""
return ev_method(EvolutionMethod(self.config["method"]))

Expand Down Expand Up @@ -586,7 +602,7 @@ index bd1b19d6..f543f7bc 100644
def initialize_op_members(self):
"""Init all operators with the identity or zeros."""
eye = OpMember(
@@ -857,10 +318,14 @@ class Operator(sv.ScaleVariationModeMixin):
@@ -874,10 +323,14 @@ class Operator(sv.ScaleVariationModeMixin):
else:
self.op_members[n] = zero.copy()

Expand All @@ -605,7 +621,7 @@ index bd1b19d6..f543f7bc 100644
"""Run the integration for each grid point.

Parameters
@@ -875,18 +339,53 @@ class Operator(sv.ScaleVariationModeMixin):
@@ -892,18 +345,53 @@ class Operator(sv.ScaleVariationModeMixin):
"""
column = []
k, logx = log_grid
Expand Down
17 changes: 9 additions & 8 deletions src/eko/evolution_operator/operator_matrix_element.py.patch
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
diff --git a/src/eko/evolution_operator/operator_matrix_element.py b/src/eko/evolution_operator/operator_matrix_element.py
index 098b52db..b56e27d1 100644
index e7d51df9..0f999809 100644
--- a/src/eko/evolution_operator/operator_matrix_element.py
+++ b/src/eko/evolution_operator/operator_matrix_element.py
@@ -3,22 +3,19 @@ evolution."""
@@ -3,23 +3,19 @@ evolution."""

import copy
import enum
-import functools
import logging
from typing import Optional

+import ekors
import numba as nb
Expand All @@ -21,14 +22,14 @@ index 098b52db..b56e27d1 100644
from .. import scale_variations as sv
from ..io.types import InversionMethod
from ..matchings import Segment
from ..scale_variations.exponentiated import gamma_variation
-from . import Operator, QuadKerBase
+from . import Operator
-from ..scale_variations.exponentiated import gamma_variation
-from . import Managers, Operator, QuadKerBase
+from . import Managers, Operator
+from .quad_ker import cb_quad_ker_ome

logger = logging.getLogger(__name__)

@@ -78,8 +75,6 @@ def build_ome(A, matching_order, a_s, backward_method):
@@ -79,8 +75,6 @@ def build_ome(A, matching_order, a_s, backward_method):
# Print;
# .end
ome = np.eye(len(A[0]), dtype=np.complex_)
Expand All @@ -37,7 +38,7 @@ index 098b52db..b56e27d1 100644
if backward_method is MatchingMethods.BACKWARD_EXPANDED:
# expended inverse
if matching_order[0] >= 1:
@@ -102,105 +97,6 @@ def build_ome(A, matching_order, a_s, backward_method):
@@ -103,105 +97,6 @@ def build_ome(A, matching_order, a_s, backward_method):
return ome


Expand Down Expand Up @@ -143,7 +144,7 @@ index 098b52db..b56e27d1 100644
class OperatorMatrixElement(Operator):
r"""Internal representation of a single |OME|.

@@ -290,41 +186,15 @@ class OperatorMatrixElement(Operator):
@@ -300,41 +195,15 @@ class OperatorMatrixElement(Operator):
)
return labels

Expand Down

0 comments on commit eb347df

Please sign in to comment.