ForceBalance API  1.3
Automated optimization of force fields and empirical potentials
List of all members | Public Member Functions | Public Attributes
src.liquid.Liquid Class Reference

Subclass of Target for liquid property matching. More...

Inheritance diagram for src.liquid.Liquid:
[legend]
Collaboration diagram for src.liquid.Liquid:
[legend]

Public Member Functions

def __init__ (self, options, tgt_opts, forcefield)
 
def post_init (self, options)
 
def prepare_temp_directory (self)
 Prepare the temporary directory by copying in important files. More...
 
def read_data (self)
 
def check_files (self, there)
 
def npt_simulation (self, temperature, pressure, simnum)
 Submit a NPT simulation to the Work Queue. More...
 
def nvt_simulation (self, temperature)
 Submit a NVT simulation to the Work Queue. More...
 
def polarization_correction (self, mvals)
 
def indicate (self)
 
def objective_term (self, points, expname, calc, err, grad, name="Quantity", SubAverage=False)
 
def submit_jobs (self, mvals, AGrad=True, AHess=True)
 
def read (self, mvals, AGrad=True, AHess=True)
 Read in time series for all previous iterations. More...
 
def get (self, mvals, AGrad=True, AHess=True)
 Wrapper of self.get_normal() and self.get_pure_num_grad() More...
 
def get_normal (self, mvals, AGrad=True, AHess=True)
 Fitting of liquid bulk properties. More...
 
def get_pure_num_grad (self, mvals, AGrad=True, AHess=True)
 This function calls self.get_normal(AGrad=False) to get the property values and std_err, but compute the property gradients using finite difference of the FF parameters. More...
 
def form_get_result (self, property_results, AGrad=True, AHess=True)
 This function takes the property_results from get_normal() or get_pure_num_grad() and form the answer for the return of the self.get() function. More...
 

Public Attributes

 do_self_pol
 
 loop_over_snapshots
 LPW 2018-02-11: This is set to True if the target calculates a single-point property over several existing snapshots. More...
 
 liquid_mol
 
 n_molecules
 
 gas_mol
 
 last_traj
 
 extra_output
 
 surf_ten_mol
 Read the reference data. More...
 
 SavedTraj
 Saved trajectories for all iterations and all temperatures. More...
 
 MBarEnergy
 Evaluated energies for all trajectories (i.e. More...
 
 AllResults
 Saved results for all iterations self.SavedMVals = []. More...
 
 gas_engine
 
 read_indicate
 
 write_indicate
 
 RefData
 
 PhasePoints
 
 Labels
 
 engname
 
 rundir
 
 w_rho
 
 w_hvap
 
 w_alpha
 
 w_kappa
 
 w_cp
 
 w_eps0
 
 w_surf_ten
 
 Xp
 
 Wp
 
 Pp
 
 Gp
 
 Objective
 

Detailed Description

Subclass of Target for liquid property matching.

Definition at line 91 of file liquid.py.

Constructor & Destructor Documentation

◆ __init__()

def src.liquid.Liquid.__init__ (   self,
  options,
  tgt_opts,
  forcefield 
)

Definition at line 94 of file liquid.py.

Here is the call graph for this function:

Member Function Documentation

◆ check_files()

def src.liquid.Liquid.check_files (   self,
  there 
)

Definition at line 359 of file liquid.py.

◆ form_get_result()

def src.liquid.Liquid.form_get_result (   self,
  property_results,
  AGrad = True,
  AHess = True 
)

This function takes the property_results from get_normal() or get_pure_num_grad() and form the answer for the return of the self.get() function.

property_results

Returns
Answer Contribution to the objective function

Definition at line 1138 of file liquid.py.

Here is the call graph for this function:

◆ get()

def src.liquid.Liquid.get (   self,
  mvals,
  AGrad = True,
  AHess = True 
)

Wrapper of self.get_normal() and self.get_pure_num_grad()

Definition at line 697 of file liquid.py.

Here is the call graph for this function:

◆ get_normal()

def src.liquid.Liquid.get_normal (   self,
  mvals,
  AGrad = True,
  AHess = True 
)

Fitting of liquid bulk properties.

This is the current major direction of development for ForceBalance. Basically, fitting the QM energies / forces alone does not always give us the best simulation behavior. In many cases it makes more sense to try and reproduce some experimentally known data as well.

In order to reproduce experimentally known data, we need to run a simulation and compare the simulation result to experiment. The main challenge here is that the simulations are computationally intensive (i.e. they require energy and force evaluations), and furthermore the results are noisy. We need to run the simulations automatically and remotely (i.e. on clusters) and a good way to calculate the derivatives of the simulation results with respect to the parameter values.

This function contains some experimentally known values of the density and enthalpy of vaporization (Hvap) of liquid water. It launches the density and Hvap calculations on the cluster, and gathers the results / derivatives. The actual calculation of results / derivatives is done in a separate file.

After the results come back, they are gathered together to form an objective function.

Parameters
[in]mvalsMathematical parameter values
[in]AGradSwitch to turn on analytic gradient
[in]AHessSwitch to turn on analytic Hessian
Returns
property_results Fill in the weight matrix with MBAR weights where MBAR was run, and equal weights otherwise.

Definition at line 736 of file liquid.py.

Here is the call graph for this function:

◆ get_pure_num_grad()

def src.liquid.Liquid.get_pure_num_grad (   self,
  mvals,
  AGrad = True,
  AHess = True 
)

This function calls self.get_normal(AGrad=False) to get the property values and std_err, but compute the property gradients using finite difference of the FF parameters.

Parameters
[in]mvalsMathematical parameter values
[in]AGradSwitch to turn on analytic gradient
[in]AHessSwitch to turn on analytic Hessian
Returns
property_results

Definition at line 1098 of file liquid.py.

Here is the call graph for this function:

◆ indicate()

def src.liquid.Liquid.indicate (   self)

Definition at line 439 of file liquid.py.

Here is the call graph for this function:

◆ npt_simulation()

def src.liquid.Liquid.npt_simulation (   self,
  temperature,
  pressure,
  simnum 
)

Submit a NPT simulation to the Work Queue.

Definition at line 374 of file liquid.py.

Here is the call graph for this function:

◆ nvt_simulation()

def src.liquid.Liquid.nvt_simulation (   self,
  temperature 
)

Submit a NVT simulation to the Work Queue.

Definition at line 399 of file liquid.py.

Here is the call graph for this function:

◆ objective_term()

def src.liquid.Liquid.objective_term (   self,
  points,
  expname,
  calc,
  err,
  grad,
  name = "Quantity",
  SubAverage = False 
)

Definition at line 466 of file liquid.py.

Here is the call graph for this function:

◆ polarization_correction()

def src.liquid.Liquid.polarization_correction (   self,
  mvals 
)

Definition at line 420 of file liquid.py.

Here is the call graph for this function:

◆ post_init()

def src.liquid.Liquid.post_init (   self,
  options 
)

Definition at line 234 of file liquid.py.

Here is the call graph for this function:

◆ prepare_temp_directory()

def src.liquid.Liquid.prepare_temp_directory (   self)

Prepare the temporary directory by copying in important files.

Definition at line 250 of file liquid.py.

Here is the call graph for this function:

◆ read()

def src.liquid.Liquid.read (   self,
  mvals,
  AGrad = True,
  AHess = True 
)

Read in time series for all previous iterations.

Definition at line 621 of file liquid.py.

Here is the call graph for this function:

◆ read_data()

def src.liquid.Liquid.read_data (   self)

Definition at line 257 of file liquid.py.

◆ submit_jobs()

def src.liquid.Liquid.submit_jobs (   self,
  mvals,
  AGrad = True,
  AHess = True 
)

Definition at line 546 of file liquid.py.

Here is the call graph for this function:

Member Data Documentation

◆ AllResults

src.liquid.Liquid.AllResults

Saved results for all iterations self.SavedMVals = [].

Definition at line 232 of file liquid.py.

◆ do_self_pol

src.liquid.Liquid.do_self_pol

Definition at line 146 of file liquid.py.

◆ engname

src.liquid.Liquid.engname

Definition at line 379 of file liquid.py.

◆ extra_output

src.liquid.Liquid.extra_output

Definition at line 200 of file liquid.py.

◆ gas_engine

src.liquid.Liquid.gas_engine

Definition at line 243 of file liquid.py.

◆ gas_mol

src.liquid.Liquid.gas_mol

Definition at line 196 of file liquid.py.

◆ Gp

src.liquid.Liquid.Gp

Definition at line 1196 of file liquid.py.

◆ Labels

src.liquid.Liquid.Labels

Definition at line 349 of file liquid.py.

◆ last_traj

src.liquid.Liquid.last_traj

Definition at line 198 of file liquid.py.

◆ liquid_mol

src.liquid.Liquid.liquid_mol

Definition at line 177 of file liquid.py.

◆ loop_over_snapshots

src.liquid.Liquid.loop_over_snapshots

LPW 2018-02-11: This is set to True if the target calculates a single-point property over several existing snapshots.

Definition at line 172 of file liquid.py.

◆ MBarEnergy

src.liquid.Liquid.MBarEnergy

Evaluated energies for all trajectories (i.e.

all iterations and all temperatures), using all mvals

Definition at line 229 of file liquid.py.

◆ n_molecules

src.liquid.Liquid.n_molecules

Definition at line 181 of file liquid.py.

◆ Objective

src.liquid.Liquid.Objective

Definition at line 1198 of file liquid.py.

◆ PhasePoints

src.liquid.Liquid.PhasePoints

Definition at line 347 of file liquid.py.

◆ Pp

src.liquid.Liquid.Pp

Definition at line 1193 of file liquid.py.

◆ read_indicate

src.liquid.Liquid.read_indicate

Definition at line 245 of file liquid.py.

◆ RefData

src.liquid.Liquid.RefData

Definition at line 268 of file liquid.py.

◆ rundir

src.liquid.Liquid.rundir

Definition at line 609 of file liquid.py.

◆ SavedTraj

src.liquid.Liquid.SavedTraj

Saved trajectories for all iterations and all temperatures.

Definition at line 227 of file liquid.py.

◆ surf_ten_mol

src.liquid.Liquid.surf_ten_mol

Read the reference data.

Definition at line 213 of file liquid.py.

◆ w_alpha

src.liquid.Liquid.w_alpha

Definition at line 1164 of file liquid.py.

◆ w_cp

src.liquid.Liquid.w_cp

Definition at line 1166 of file liquid.py.

◆ w_eps0

src.liquid.Liquid.w_eps0

Definition at line 1167 of file liquid.py.

◆ w_hvap

src.liquid.Liquid.w_hvap

Definition at line 1163 of file liquid.py.

◆ w_kappa

src.liquid.Liquid.w_kappa

Definition at line 1165 of file liquid.py.

◆ w_rho

src.liquid.Liquid.w_rho

Definition at line 1162 of file liquid.py.

◆ w_surf_ten

src.liquid.Liquid.w_surf_ten

Definition at line 1168 of file liquid.py.

◆ Wp

src.liquid.Liquid.Wp

Definition at line 1191 of file liquid.py.

◆ write_indicate

src.liquid.Liquid.write_indicate

Definition at line 246 of file liquid.py.

◆ Xp

src.liquid.Liquid.Xp

Definition at line 1189 of file liquid.py.


The documentation for this class was generated from the following file: