Skip to content

Commit

Permalink
Apply formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
juraskov committed Feb 15, 2024
1 parent e8b2253 commit b1ef180
Show file tree
Hide file tree
Showing 79 changed files with 4,717 additions and 3,730 deletions.
76 changes: 47 additions & 29 deletions examples/DA_paper/1d_fes/fes.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,39 @@
mlt.Config.n_cores = 10

if __name__ == '__main__':
us = mlt.UmbrellaSampling(zeta_func=mlt.AverageDistance((1,12), (6,11)),
kappa=10)
us = mlt.UmbrellaSampling(
zeta_func=mlt.AverageDistance((1, 12), (6, 11)), kappa=10
)
temp = 300

neb = mlt.ConfigurationSet()
neb.load_xyz(filename='neb_optimised.xyz', charge=0, mult=1)

irc = mlt.ConfigurationSet()
for config in neb:
config.box = Box([18.5, 18.5, 18.5])
irc.append(config)

r112_reactant = np.linalg.norm(irc[0].atoms[1].coord-irc[0].atoms[12].coord)
r611_reactant = np.linalg.norm(irc[0].atoms[6].coord-irc[0].atoms[11].coord)
r112_reactant = np.linalg.norm(
irc[0].atoms[1].coord - irc[0].atoms[12].coord
)
r611_reactant = np.linalg.norm(
irc[0].atoms[6].coord - irc[0].atoms[11].coord
)

r112_product = np.linalg.norm(irc[-1].atoms[1].coord-irc[-1].atoms[12].coord)
r611_product = np.linalg.norm(irc[-1].atoms[6].coord-irc[-1].atoms[11].coord)
r112_product = np.linalg.norm(
irc[-1].atoms[1].coord - irc[-1].atoms[12].coord
)
r611_product = np.linalg.norm(
irc[-1].atoms[6].coord - irc[-1].atoms[11].coord
)

logger.info(f'average bond length in reactant is {(r112_reactant+r611_reactant)/2}')
logger.info(f'average bond length in product is {(r112_product+r611_product)/2}')
logger.info(
f'average bond length in reactant is {(r112_reactant+r611_reactant)/2}'
)
logger.info(
f'average bond length in product is {(r112_product+r611_product)/2}'
)

irc.reverse() # Go product -> reactant, the NEB path is from reactant -> product

Expand All @@ -37,31 +50,36 @@

endo = mlt.potentials.ACE('endo_in_water_ace_wB97M', system)

us.run_umbrella_sampling(irc,
mlp=endo,
temp=temp,
interval=5,
dt=0.5,
n_windows=15,
init_ref=1.55,
final_ref=4,
ps=10)
us.run_umbrella_sampling(
irc,
mlp=endo,
temp=temp,
interval=5,
dt=0.5,
n_windows=15,
init_ref=1.55,
final_ref=4,
ps=10,
)
us.save('wide_US')

# Run a second, narrower US with a higher force constant
us.kappa = 20
us.run_umbrella_sampling(irc,
mlp=endo,
temp=temp,
interval=5,
dt=0.5,
n_windows=15,
init_ref=1.7,
final_ref=2.5,
ps=10)
us.run_umbrella_sampling(
irc,
mlp=endo,
temp=temp,
interval=5,
dt=0.5,
n_windows=15,
init_ref=1.7,
final_ref=2.5,
ps=10,
)

us.save('narrow_US')

total_us = mlt.UmbrellaSampling.from_folders('wide_US', 'narrow_US',
temp=temp)
total_us = mlt.UmbrellaSampling.from_folders(
'wide_US', 'narrow_US', temp=temp
)
total_us.wham()
Loading

0 comments on commit b1ef180

Please sign in to comment.