This repo is archieved along with AIMS_Tools. Please check ms-tools for latest development.
Automatically optimize the LJ parameters for TEAM Force Field against experimental data of density and enthalpy of vaporization.
AIMS_Tools
, DFF
, Packmol
and GROMACS
are required.
- Specify paths for required packages.
The version of
mstools
should be0.1
.
MS_TOOLS_DIR = '/home/gongzheng/GitHub/AIMS_Tools'
PACKMOL_BIN = '/share/apps/tools/packmol'
DFF_ROOT = '/home/gongzheng/apps/DFF/Developing'
- Specify the DFF table for assigning atom types
DFF_TABLE = 'MGI'
- Specify the
Slurm
partitions and correspondingGROMACS
binaries. The default in config.py is good forgtx
partition.
- Prepare data file which contains SMILES and experimental density and Hvap data.
An example is provided as
example_LJ/data.txt
. For better GPU performance, make sure that there are even lines in expt data file. - Prepare PPF file which contains initial parameters.
The parameters to be optimized should be unfrozen.
An example is provided as
example_LJ/initial.ppf
. - Prepare an empty directory
WORKDIR
for running simulation - Init
cd example_LJ
./run.py init task_name data.txt initial.ppf WORKDIR
./run.py optimize task_name
Three examples are provided for optimized LJ, temperature-dependent LJ and dihedral parameters
Three files are required
data.txt
lists the molecules and experimental data and their weight for optimization. The names of molecules are arbitrary but should only contain alphabets and numbers.initial.ppf
is the initial parameters exported from DFF. TheN12_6
lines forc_4h3
,c_4h2
andh_1
are unfrozen so that the epsilon and sigma for these three atom types will be optimized.run.py
is the controlling script. No modification is required for this script.
Start optimization by
mkdir WORKDIR
./run.py init LJ data.txt initial.ppf WORKDIR
./run.py optimize LJ
Check the generated log
file. Make sure RSQ
is decreasing and new parameters are reasonable.
It usually converges in less than 6 iterations.
data.txt
and initial.pff
are the same as previous example. Modifications should be made in run.py
to optimize temperature parameters.
- Two variables
drde_dict
anddrde_atoms
should be specified inrun.py
to optimize the temperature parameter\lambda
for different atom types. optimizer.drde_dict
lists temperature parameters that will be fixed during the optimization.optimizer.optimize(drde_atoms=...)
lists temperature parameters that are subject to optimization.- the
\lambda
parameters are always named asxxx_dl
. It will match all atom types starting withxxx
. For example,c_4_dl
is the\lambda
parameter forc_4h2
,c_4h3
,c_4o
...
Note that
- If a parameter appears in both
drde_dict
anddrde_atoms
, it will be subject to optimization. - It is better to have at most one free
\lambda
parameter to get rid of coupling between parameters.
Start optimization and check the log
file. Make sure RSQ
is decreasing and new parameters are reasonable.
The RSQ
should be smaller than previous example because of the introduction of temperature-dependence.
data.txt
is the same as previous example. Modifications should be made in initial.pff
and run.py
to optimize dihedrals.
The dihedrals are fitted to QM energy surface by using DFF.
- Unfreeze the dihedral parameters in
initial.ppf
so that they can be optimized. - Variable
torsions
lists the dihedrals subject to optimization. - Corresponding
MSD
andQMD
files should be provided.
Note that
- Dihedral fitting here only make sense for the backbone of linear molecules. For example, alkanes, diphenyl...
Start optimization and check the log
file. Make sure RSQ
is decreasing and new parameters are reasonable.
Check the dft
file to make sure dihedrals are correctly fitted.