@@ -146,71 +146,72 @@ def main():
146146 dhdl_files = [f'sim_{ j } /iteration_{ i - 1 } /dhdl.xvg' for j in range (EEXE .n_sim )]
147147 log_files = [f'sim_{ j } /iteration_{ i - 1 } /md.log' for j in range (EEXE .n_sim )]
148148 states_ = EEXE .extract_final_dhdl_info (dhdl_files )
149- wl_delta , weights_ , counts = EEXE .extract_final_log_info (log_files )
149+ wl_delta , weights_ , counts_ = EEXE .extract_final_log_info (log_files )
150150 print ()
151151
152152 # 3-2. Identify swappable pairs, propose swap(s), calculate P_acc, and accept/reject swap(s)
153153 # Note after `get_swapping_pattern`, `states_` and `weights_` won't be necessarily
154154 # since they are updated by `get_swapping_pattern`. (Even if the function does not explicitly
155155 # returns `states_` and `weights_`, `states_` and `weights_` can still be different after
156156 # the use of the function.) Therefore, here we create copies for `states_` and `weights_`
157- # before the use of `get_swapping_pattern`, so we can use them in `histogram_correction `,
157+ # before the use of `get_swapping_pattern`, so we can use them in `weight_correction `,
158158 # `combine_weights` and `update_MDP`.
159159 states = copy .deepcopy (states_ )
160160 weights = copy .deepcopy (weights_ )
161+ counts = copy .deepcopy (counts_ )
161162 swap_pattern , swap_list = EEXE .get_swapping_pattern (dhdl_files , states_ , weights_ ) # swap_list will only be used for modify_coords # noqa: E501
162163
163- # 3-3. Perform histogram correction/weight combination
164+ # 3-3. Perform weight correction/weight combination
164165 if wl_delta != [None for i in range (EEXE .n_sim )]: # weight-updating
165166 print (f'\n Current Wang-Landau incrementors: { wl_delta } \n ' )
166167
167168 # (1) First we prepare the weights to be combined.
168- # Note that although averaged weights are sometimes used for histogram correction/weight combination,
169+ # Note that although averaged weights are sometimes used for weight correction/weight combination,
169170 # the final weights are always used for calculating the acceptance ratio.
170171 if EEXE .N_cutoff != - 1 or EEXE .w_combine is not None :
171- # Only when histogram correction/weight combination is needed.
172+ # Only when weight correction/weight combination is needed.
172173 weights_avg , weights_err = EEXE .get_averaged_weights (log_files )
173174 weights_input = EEXE .prepare_weights (weights_avg , weights ) # weights_input is for weight combination # noqa: E501
174175
175- # (2) Now we perform histogram correction/weight combination.
176+ # (2) Now we perform weight correction/weight combination.
176177 # The product of this step should always be named as "weights" to be used in update_MDP
177178 if EEXE .N_cutoff != - 1 and EEXE .w_combine is not None :
178179 # perform both
179180 if weights_input is None :
180- # Then only histogram correction will be performed
181+ # Then only weight correction will be performed
181182 print ('Note: Weight combination is deactivated because the weights are too noisy.' )
182- weights = EEXE .histogram_correction (weights , counts )
183- _ = EEXE .combine_weights (weights , print_weights = False )[1 ] # just to print the combiend weights
183+ weights = EEXE .weight_correction (weights , counts )
184+ _ = EEXE .combine_weights (counts_ , weights , print_values = False )[1 ] # just to print the combiend weights # noqa: E501
184185 else :
185- weights_preprocessed = EEXE .histogram_correction (weights_input , counts )
186+ weights_preprocessed = EEXE .weight_correction (weights_input , counts )
186187 if EEXE .verbose is True :
187188 print ('Performing weight combination ...' )
188189 else :
189190 print ('Performing weight combination ...' , end = '' )
190- weights , g_vec = EEXE .combine_weights (weights_preprocessed ) # inverse-variance weighting seems worse # noqa: E501
191+ counts , weights , g_vec = EEXE .combine_weights (counts_ , weights_preprocessed ) # inverse-variance weighting seems worse # noqa: E501
191192 EEXE .g_vecs .append (g_vec )
192193 elif EEXE .N_cutoff == - 1 and EEXE .w_combine is not None :
193194 # only perform weight combination
194- print ('Note: No histogram correction will be performed.' )
195+ print ('Note: No weight correction will be performed.' )
195196 if weights_input is None :
196197 print ('Note: Weight combination is deactivated because the weights are too noisy.' )
197- _ = EEXE .combine_weights (weights , print_weights = False )[1 ] # just to print the combined weights
198+ _ = EEXE .combine_weights (counts_ , weights , print_values = False )[1 ] # just to print the combined weights # noqa: E501
198199 else :
199200 if EEXE .verbose is True :
200201 print ('Performing weight combination ...' )
201202 else :
202203 print ('Performing weight combination ...' , end = '' )
203- weights , g_vec = EEXE .combine_weights (weights_input ) # inverse-variance weighting seems worse
204+ counts , weights , g_vec = EEXE .combine_weights (counts_ , weights_input ) # inverse-variance weighting seems worse # noqa: E501
204205 EEXE .g_vecs .append (g_vec )
205206 elif EEXE .N_cutoff != - 1 and EEXE .w_combine is None :
206- # only perform histogram correction
207+ # only perform weight correction
207208 print ('Note: No weight combination will be performed.' )
208209 weights = EEXE .histogram_correction (weights_input , counts )
209- _ = EEXE .combine_weights (weights , print_weights = False )[1 ] # just to print the combined weights
210+ _ = EEXE .combine_weights (counts_ , weights , print_values = False )[1 ] # just to print the combined weights # noqa: E501
210211 else :
211- print ('Note: No histogram correction will be performed.' )
212+ print ('Note: No weight correction will be performed.' )
212213 print ('Note: No weight combination will be performed.' )
213- _ = EEXE .combine_weights (weights , print_weights = False )[1 ] # just to print the combiend weights
214+ _ = EEXE .combine_weights (counts_ , weights , print_values = False )[1 ] # just to print the combiend weights # noqa: E501
214215
215216 # 3-5. Modify the MDP files and swap out the GRO files (if needed)
216217 # Here we keep the lambda range set in mdp the same across different iterations in the same folder but swap out the gro file # noqa: E501
0 commit comments