Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tgiani committed Jan 24, 2024
1 parent f094118 commit f5ed0af
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 46 deletions.
10 changes: 3 additions & 7 deletions src/eko/evolution_operator/beam_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,12 @@ class SCET_I(Operator):
order in alpha_s and L
"""

log_label = "Matching"
# complete list of possible matching operators labels
log_label = "Scet_I"
full_labels = br.scet_labels

def __init__(self, config, managers, order):
# dummy values for nf and q2
nf=5
q2=1
super().__init__(config, managers, Segment(q2, q2, nf))
# this is the order (QCD, L) of the scet kernel
super().__init__(config, managers, Segment(origin=1, target=1, nf=5))
# order (alpha_s, L) of the SCET kernel
self.order_scet = order

@property
Expand Down
43 changes: 4 additions & 39 deletions src/eko/member.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,44 +310,7 @@ def to_flavor_basis_tensor(self, qed: bool):
] += out_weight * (op.error * in_weight)
return value_tensor, error_tensor

# def to_flavor_basis_tensor_scet(self, qed: bool):
# """Convert the computations into an rank 4 tensor.

# A sparse tensor defined with dot-notation (e.g. ``S.g``) is converted
# to a plain rank-4 array over flavor operator space and momentum
# fraction operator space.

# """

# len_pids = len(br.flavor_basis_pids)
# len_xgrid = list(self.op_members.values())[0].value.shape[0]
# # dimension will be pids^2 * xgrid^2
# value_tensor = np.zeros((len_pids, len_xgrid, len_pids, len_xgrid))
# error_tensor = value_tensor.copy()

# for name, op in self.op_members.items():
#
# in_pids = (np.asarray(br.flavor_basis_names)==name.input).astype(int)
# out_pids = (np.asarray(br.flavor_basis_names)==name.target).astype(int)

# for out_idx, out_weight in enumerate(out_pids):
# for in_idx, in_weight in enumerate(in_pids):
# # keep the outer index to the left as we're multiplying from the right
# value_tensor[
# out_idx, # output pid (position)
# :, # output momentum fraction
# in_idx, # input pid (position)
# :, # input momentum fraction
# ] += out_weight * (op.value * in_weight)
# error_tensor[
# out_idx, # output pid (position)
# :, # output momentum fraction
# in_idx, # input pid (position)
# :, # input momentum fraction
# ] += out_weight * (op.error * in_weight)

# return value_tensor, error_tensor


def to_flavor_basis_tensor_scet(self):
"""Convert the computations into an rank 4 tensor.
Expand All @@ -364,7 +327,7 @@ def to_flavor_basis_tensor_scet(self):


for name, op in self.op_members.items():

# np.asarray might not be necessary
in_idx = np.where(np.asarray(br.flavor_basis_names)==name.input)[0][0]
out_idx = np.where(np.asarray(br.flavor_basis_names)==name.target)[0][0]

Expand All @@ -380,6 +343,8 @@ def to_flavor_basis_tensor_scet(self):
in_idx, # input pid (position)
:, # input momentum fraction
] += op.error

# error can be removed (ongoing PR)
return value_tensor, error_tensor


Expand Down

0 comments on commit f5ed0af

Please sign in to comment.