@@ -34,7 +34,6 @@ def evolve_fit(
34
34
force ,
35
35
eko_path ,
36
36
dump_eko = None ,
37
- ncores = 1 ,
38
37
):
39
38
"""
40
39
Evolves all the fitted replica in fit_folder/nnfit
@@ -126,7 +125,10 @@ def evolve_fit(
126
125
# Read the information from all replicas into what eko wants:
127
126
all_replicas = []
128
127
for pdf_data in initial_PDFs_dict .values ():
129
- all_replicas .append (np .array (pdf_data ["pdfgrid" ]).T )
128
+ # swap photon postion to match eko.basis_roation.flavor_basis_pids
129
+ pdfgrid = np .array (pdf_data ["pdfgrid" ])
130
+ pdfgrid = np .append (pdfgrid [:,- 1 ].reshape (x_grid .size ,1 ), pdfgrid [:,:- 1 ], axis = 1 )
131
+ all_replicas .append (pdfgrid .T )
130
132
131
133
# reshape the xgrid eko if necessary
132
134
for _ , elem in eko_op .items ():
@@ -138,26 +140,24 @@ def evolve_fit(
138
140
inputgrid = XGrid (x_grid ),
139
141
)
140
142
141
- all_evolved , _ = apply .apply_grids (eko_op , np .array (all_replicas ))
142
143
# {(Q2, nf): (replica, flavour, x)}
143
- nreplicas = len (all_replicas )
144
- all_evolved = [{i : k [r ] for i , k in all_evolved .items ()} for r in range (nreplicas )]
144
+ all_evolved , _ = apply .apply_grids (eko_op , np .array (all_replicas ))
145
145
146
146
# Now, replica by replica, break into blocks
147
147
targetgrid = eko_op .xgrid .tolist ()
148
148
by_nf = defaultdict (list )
149
- for q , nf in sorted (eko_op .evolgrid , key = lambda ep : ep [1 ]):
150
- by_nf [nf ].append (q )
151
- q2block_per_nf = {nf : sorted (qs ) for nf , qs in by_nf .items ()}
149
+ for q2 , nf in sorted (eko_op .evolgrid , key = lambda ep : ep [1 ]):
150
+ by_nf [nf ].append (q2 )
151
+ q2block_per_nf = {nf : sorted (q2s ) for nf , q2s in by_nf .items ()}
152
152
153
- for replica , evolved_pdf in enumerate ( all_evolved ):
153
+ for replica in range ( len ( all_replicas ) ):
154
154
blocks = []
155
155
for nf , q2grid in q2block_per_nf .items ():
156
156
157
157
def pdf_xq2 (pid , x , Q2 ):
158
158
x_idx = targetgrid .index (x )
159
159
pid_idx = info ["Flavors" ].index (pid )
160
- return x * evolved_pdf [(Q2 , nf )][pid_idx ][x_idx ]
160
+ return x * all_evolved [(Q2 , nf )][ replica ][pid_idx ][x_idx ]
161
161
162
162
block = genpdf .generate_block (
163
163
pdf_xq2 ,
0 commit comments