xdatbus.fun_mtd

Functions

fes_1d(hillspot_path, hills_count, cv_range[, resolution])

Calculate the 1D free energy profile from a HILLSPOT file.

fes_2d(hillspot_path, hills_count, cv_1_range, cv_2_range)

Calculate the 2D free energy profile from a HILLSPOT file.

fes_3d(hillspot_path, hills_count, cv_1_range, ...[, ...])

Calculate the 2D free energy profile from a HILLSPOT file.

hillspot2hills(hillspot_dir, hills_dir, cv[, ...])

Convert HILLSPOT file to HILLS file

report_loader(aimd_path[, load_pre_report, ...])

Initialize a trajectory writer instance for filename.

xdc2xtc(xdc_path)

Convert a VASP XDATCAR file to an XTC trajectory file.

reweight(fes, cv, nv, kb, t, grid_min, grid_max, grid_num)

Reweight a metadynamics simulation to the unbiased ensemble using histogram reweighting.

pmf_321(fes3d, axis1, axis2)

project 3d free energy surface to 1d

neb_2d(fes, minima_1, minima_2, n_images, n_steps, ...)

local_minima(data[, size])

Module Contents

xdatbus.fun_mtd.fes_1d(hillspot_path, hills_count, cv_range, resolution=100)

Calculate the 1D free energy profile from a HILLSPOT file.

hillspot_pathstr

The path of the HILLSPOT file

hills_countint

The number of hills to be read

cv_rangelist

The range of the collective variable

resolutionint (optional)

The resolution of the free energy profile

xdatbus.fun_mtd.fes_2d(hillspot_path, hills_count, cv_1_range, cv_2_range, resolution=100)

Calculate the 2D free energy profile from a HILLSPOT file.

hillspot_pathstr

The path of the HILLSPOT file

hills_countint

The number of hills to be read

cv_1_rangelist

The range of the first collective variable

cv_2_rangelist

The range of the second collective variable

resolutionint (optional)

The resolution of the free energy profile

xdatbus.fun_mtd.fes_3d(hillspot_path, hills_count, cv_1_range, cv_2_range, cv_3_range, resolution=100)

Calculate the 2D free energy profile from a HILLSPOT file.

hillspot_pathstr

The path of the HILLSPOT file

hills_countint

The number of hills to be read

cv_1_rangelist

The range of the first collective variable

cv_2_rangelist

The range of the second collective variable

cv_3_rangelist

The range of the third collective variable

resolutionint (optional)

The resolution of the free energy profile

xdatbus.fun_mtd.hillspot2hills(hillspot_dir, hills_dir, cv, height_conversion=1, sigma_conversion=1, del_inter=False)
Convert HILLSPOT file to HILLS file
hillspot_dirstr

Path to HILLSPOT file

hills_dirstr

Path to the directory where the HILLS file will be created

cvstr or list

Name of the collective variable(s)

height_conversionfloat(optional)

Conversion factor to convert the unit of the height from eV to kJ/mol

sigma_conversionfloat(optional)

Conversion factor to convert the unit of the sigma based on the lattice in Angstrom

del_interbool(optional)

Delete the intermediate files created by this function.

xdatbus.fun_mtd.report_loader(aimd_path, load_pre_report=True, load_last_report=False, delete_intermediate_folders=True)

Initialize a trajectory writer instance for filename.

aimd_pathstr

Output filename of the trajectory; the extension determines the format.

load_pre_reportbool (optional)

If True, the trajectory will contain the previous frames (before the current run)

load_last_reportbool (optional)

If True, the trajectory will contain the last frame

delete_intermediate_foldersbool (optional)

If True, the intermediate folders will be deleted

xdatbus.fun_mtd.xdc2xtc(xdc_path)

Convert a VASP XDATCAR file to an XTC trajectory file.

Parameters

xdc_pathstr

Path to the XDATCAR file

xdatbus.fun_mtd.reweight(fes, cv, nv, kb, t, grid_min, grid_max, grid_num)

Reweight a metadynamics simulation to the unbiased ensemble using histogram reweighting.

In many cases you might decide which variable should be analyzed after having performed a metadynamics simulation. For example, you might want to calculate the free energy as a function of CVs other than those biased during the metadynamics simulation. At variance with standard MD simulations, you cannot simply calculate histograms of other variables directly from your metadynamics trajectory, because the presence of the metadynamics bias potential has altered the statistical weight of each frame. To remove the effect of this bias and thus be able to calculate properties of the system in the unbiased ensemble, you must reweight (unbias) your simulation.

fesnp.ndarray

The free energy surface calculated from the metadynamics simulation.

cvnp.ndarray

The collective variable used in the metadynamics simulation.

nvnp.ndarray

The new collective variable for which the potential of mean force will be calculated.

kbfloat

The Boltzmann constant.

tfloat

The temperature of the simulation.

grid_minfloat

The minimum value of the collective variable.

grid_maxfloat

The maximum value of the collective variable.

grid_numint

The number of bins in the histogram.

Returns

np.ndarray

The unbiased free energy surface.

xdatbus.fun_mtd.pmf_321(fes3d, axis1, axis2)

project 3d free energy surface to 1d

Parameters

fes3dnp.ndarray

The 3d free energy surface.

axis1int

The axis to be projected.

axis2int

The axis to be projected.

Returns

np.ndarray

The 2d free energy surface.

xdatbus.fun_mtd.neb_2d(fes, minima_1, minima_2, n_images, n_steps, spring_constant)
xdatbus.fun_mtd.local_minima(data, size=3)