# vim:ft=plumed
# Read energy and volume
energy: READ FILE=COLVAR-READ VALUES=energy IGNORE_FORCES
vol: READ FILE=COLVAR-READ VALUES=vol IGNORE_FORCES

# Construct a bias potential using VES
# The hyperparameters used here might not reflect correct values for simulations
# Please refer to the original papers for suitable hyperparameters

# Basis functions
bf1: BF_LEGENDRE ORDER=10 MINIMUM=-15000 MAXIMUM=-12250
bf2: BF_LEGENDRE ORDER=10 MINIMUM=6.5 MAXIMUM=8.25

# Target distributions
TD_MULTITHERMAL_MULTIBARIC ...
 MIN_TEMP=260
 MAX_TEMP=350
 MAX_PRESSURE=180.66422571
 MIN_PRESSURE=0.06022140857
 PRESSURE=0.06022140857
 STEPS_PRESSURE=20
 STEPS_TEMP=20
 SIGMA=50.,0.05
 THRESHOLD=1
 LABEL=td_multi
... TD_MULTITHERMAL_MULTIBARIC

# Expansion
VES_LINEAR_EXPANSION ...
 ARG=energy,vol
 BASIS_FUNCTIONS=bf1,bf2
 TEMP=300.0
 GRID_BINS=50,50
 TARGET_DISTRIBUTION=td_multi
 LABEL=b1
... VES_LINEAR_EXPANSION

# Optimization algorithm
OPT_AVERAGED_SGD ...
  BIAS=b1
  STRIDE=1
  LABEL=o1
  STEPSIZE=0.1
  TARGETDIST_OUTPUT=10000
  COEFFS_OUTPUT=5000
  TARGETDIST_STRIDE=5000
  COEFFS_FMT=%12.6f
... OPT_AVERAGED_SGD

PRINT ARG=* FILE=COLVAR STRIDE=10

