Skip to content

Commit

Permalink
fixes polarized in parallel replica fit
Browse files Browse the repository at this point in the history
Co-authored-by: Juan M. Cruz-Martinez <juacrumar@lairen.eu>
  • Loading branch information
Radonirinaunimi and scarlehoff committed Jul 30, 2024
1 parent 16580b7 commit 523b1e7
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions n3fit/src/n3fit/layers/DY.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,11 @@ def compute_dy_observable_many_replica(pdf, padded_fk):
tensor
observable of shape (batch=1, replicas, ndata)
"""
# TODO: check which PDF must go first in case of different initial states!!!
temp = op.einsum('nxfyg, bryg -> brnxf', padded_fk, pdf[0])
return op.einsum('brnxf, brxf -> brn', temp, pdf[1])
pdfa = pdf[1]
pdfb = pdf[0]

temp = op.einsum('nxfyg, bryg -> brnxf', padded_fk, pdfa)
return op.einsum('brnxf, brxf -> brn', temp, pdfb)


def compute_dy_observable_one_replica(pdf, mask_and_fk):
Expand All @@ -95,7 +97,9 @@ def compute_dy_observable_one_replica(pdf, mask_and_fk):
masking the PDF rather than the fk table.
"""
mask, fk = mask_and_fk
pdfb = pdf[0][0][0] # yg
# Retrieve the two PDFs (which may potentially be coming from different initial states)
# Since this is the one-replica function, remove the batch and replica dimension
pdfb = pdf[0][0][0] # xf
pdfa = pdf[1][0][0] # yg

# TODO: check which PDF must go first in case of different initial states!!!
Expand Down

0 comments on commit 523b1e7

Please sign in to comment.