<jupyter_start><jupyter_text>Read MD output<jupyter_code>import numpy as np
import matplotlib.pyplot as plt<jupyter_output><empty_output><jupyter_text>Unbiased result<jupyter_code>x,y = np.loadtxt('output/unbiased/xvyw1beta5.0gammax1.0gammay1.0_h0.01.txt', usecols = (0,1), unpack = True, skiprows=1)

beta=5.0
levels = np.linspace(1, 5, 9)

hist = np.histogram2d(x, y, bins=50)
prob = hist[0].T/np.sum(hist[0].T)
free = -(1/beta)*np.log(prob+1e-10)
mids_x, mids_y = 0.5*(hist[1][1:]+hist[1][:-1]), 0.5*(hist[2][1:]+hist[2][:-1])

plt.contourf(mids_x, mids_y, free, levels=levels)
plt.xlim(-1.0,1.0)
plt.ylim(-1.0,1.0)
plt.xlabel('x')
plt.ylabel('y')
plt.colorbar()
plt.show()<jupyter_output><empty_output><jupyter_text>Biased result<jupyter_code>x,y = np.loadtxt('output/biased/xvyw1beta5.0gammax1.0gammay1.0_h0.01.txt', usecols = (0,1), unpack = True, skiprows=1)
weights = np.loadtxt('output/biased/reweighting_factor.txt')

beta=5.0
levels = np.linspace(1, 5, 9)

hist = np.histogram2d(x, y, bins=50, weights = weights)
prob = hist[0].T/np.sum(hist[0].T)
free = -(1/beta)*np.log(prob+1e-10)
mids_x, mids_y = 0.5*(hist[1][1:]+hist[1][:-1]), 0.5*(hist[2][1:]+hist[2][:-1])

plt.contourf(mids_x, mids_y, free, levels=levels)
plt.xlim(-1.0,1.0)
plt.ylim(-1.0,1.0)
plt.xlabel('x')
plt.ylabel('y')
plt.colorbar()
plt.show()<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup