Beta expanded ensemble

Example expanded ensemble simulation inverse temperature.

[1]:
params = {"beta_min": 0.8, "beta_max": 1.2}
beta_num = 5
params["delta_beta"] = (params["beta_max"] - params["beta_min"])/(beta_num-1)

script="""
MonteCarlo
Configuration cubic_side_length=8 particle_type=fluid:/feasst/particle/lj_new.txt
Potential Model=LennardJones
Potential VisitModel=LongRangeCorrections
ThermoParams beta=1.2 chemical_potential=1
FlatHistogram Macrostate=MacrostateBeta width={delta_beta} max={beta_max} min={beta_min} \
    Bias=WLTM collect_flatness=18 min_flatness=22 min_sweeps=10
TrialTranslate tunable_param=1
TrialAdd particle_type=fluid
Run until_num_particles=10
Remove name=TrialAdd
TrialBeta fixed_beta_change={delta_beta}
Let [write]=trials_per_write=1e4 output_file=lj_bet
Log [write].csv
Movie [write].xyz
CheckEnergy trials_per_update=1e4
Tune
CriteriaUpdater trials_per_update=1e4
CriteriaWriter [write]_crit.csv output_file_append_phase=true
Energy [write]_energy.csv output_file_append_phase=true multistate=true
Run num_trials=1e6
""".format(**params)

with open('script.txt', 'w') as file: file.write(script)
import subprocess
syscode = subprocess.call("../../../build/bin/fst < script.txt > script.log", shell=True, executable='/bin/bash')
with open('script.log', 'r') as file: print(file.read(), '\n', 'exit:', syscode)
# Usage: /Users/user/feasst/build/bin/fst < file.txt
FEASST version 0.25.13
MonteCarlo
Configuration cubic_side_length=8 particle_type=fluid:/feasst/particle/lj_new.txt
Potential Model=LennardJones
Potential VisitModel=LongRangeCorrections
ThermoParams beta=1.2 chemical_potential=1
FlatHistogram Bias=WLTM Macrostate=MacrostateBeta collect_flatness=18 max=1.2 min=0.8 min_flatness=22 min_sweeps=10 width=0.09999999999999998
TrialTranslate tunable_param=1
TrialAdd particle_type=fluid
Run until_num_particles=10
# Initializing random number generator with seed: 1749408494
Remove name=TrialAdd
TrialBeta fixed_beta_change=0.09999999999999998
Log output_file=lj_bet.csv trials_per_write=1e4
Movie output_file=lj_bet.xyz trials_per_write=1e4
CheckEnergy trials_per_update=1e4
Tune
CriteriaUpdater trials_per_update=1e4
CriteriaWriter output_file=lj_bet_crit.csv output_file_append_phase=true trials_per_write=1e4
Energy multistate=true output_file=lj_bet_energy.csv output_file_append_phase=true trials_per_write=1e4
Run num_trials=1e6

 exit: 0

Did this tutorial work as expected? Did you find any inconsistencies or have any comments? Please contact us. Any feedback is appreciated!