Hi Westpa community,
We are currently working on a reweighting WE scheme where using an algorithm we recalculate the weights of the walkers after every 5 (currently arbitrary for a simple system) iterations. The code we currently use (attached below), seems to make changes to the weights only in the west.h5 file, but WESTPA continues the simulation with earlier original weights.
run = Run.open("west.h5")
n_iters = run.num_iterations
run.close()
run.h5file
with h5py.File("west.h5", "r+") as h5file:
path = "iterations/iter_" + str(niters).zfill(8)
group = h5file[path]['seg_index']
weights = h5file[path]['seg_index']['weight']
new_weight_data = np.loadtxt("file_weights.txt") #Assuming the new weights is present in this file
for j in range(nsegs):
weights[j] = new_weight_data[j]
group['weight', ...] = weights
h5file.close()
The above code updates the weights of the walkers in the west.h5 file. Our reweighting scheme ensures the total probabilities add up to 1. We tried our algorithm on the NACl system and obtained the below graph

Here we can see that when reweighting is happening (from the stripes), the weights are changing (from free energy), but WESTPA simulation continues the next iteration with older weights. Can you please provide any guidance on how we can make WESTPA consider the updated new weights?
Best,
Praveen