Force Field editing with ADFtrain

In the advanced ReaxFF parametrization tutorial, ADFtrain is used to visualize and manage a training set but it can do much more than that. This tutorial will introduce you to some of the Force Field editing functionality most useful when preparing an optimization run:

  • Set active or freeze parameters during the optimization
  • Set or guess parameter ranges

In the following few lines, you will learn how the initial guess and parameter ranges for the reparametrization tutorial were chosen and activated using ADFtrain.

Tip

The Force Field editing tools allow extensive inspection and modification of both params and force field files. This goes as far as having it create a completely guessed force field from a bare training set. Take a look at the ADF train manual for an overview of all functionality.

Load a force field into ADFtrain

Begin by placing a copy of the force field file you want to edit into a new folder:

Download the CHON-weak.ff force field
Place it into a new (empty!) folder

Tip

You can find all force fields shipped with the Amsterdam Modeling Suite in the AMS home directory (ADF2019.103) → atomicdata → ForceFields → ReaxFF. Always make a copy before editing any of these files.

Now open a new instance of ADFtrain and load the force field file:

SCM → Train
File → Open

You will see that contents of the force field file are displayed on the bottom part of ADFtrain

/scm-uploads/doc.2019/Tutorials/_images/adftrain_ff_editing_1.png

Note

ADFtrain will automatically check the directory from where it reads the force field for trainset.in, params or other relevant optimization related files and load them if present.

Inspect the parameters

Once the force field has been loaded into ADFtrain you can inspect the parameters by double clicking on any one of table entries.

/scm-uploads/doc.2019/Tutorials/_images/adftrain_ff_editing_2.png

In the small pop up window you will be presented with information regarding that particular parameter:

  • Optimize: Whether or not it should be optimized
  • Value: It’s current value in the force field
  • Min: It’s lower limit in the optimization
  • Max: It’s upper limit in the optimization
  • Delta: The finite stepsize in which the parameter is allowed to vary in the optimization.

The values presented in the optimization fields stem from an analysis of all ReaxFF force fields included in the Amsterdam Modeling Suite. These guesses are provided by the powerful command line tool rxffutil. The options ADFtrain uses for rxffutil parameter gessing can be set from the Force Field → RXFFUtil Options menu.

Tip

Hover your mouse pointer of any of the parameters and ADFtrain will show help balloon with the name of the parameter. Use this name to look up the parameter in the ffield file description.

Edit the parameters

Following the reasoning outlined in the ReaxFF Parametrization tutorial, we want to refit the parameters related to the atom (pairs) C-O, C-N and N-H.

We begin with applying a filter so we only see the bonding parameters:

From the Type menu, select Bonds

Next we unfreeze the parameters of the C-O bond during the optimization. We can either double-click and tick the checkbox in the popup window or we use an ADFtrain shortcut:

Right-click on the first parameter of the C-O bond to activate it
activate all C-O parameters the same way (except constants #6, #12 and boolean flags #15, #16)
/scm-uploads/doc.2019/Tutorials/_images/adftrain_ff_editing_3.png

As soon as one parameter is is set active for the optimization, ADFtrain will write a params file that can be used for the actual optimization runs.

File → Save
Go to the folder were you saved CHON-weak.ff to find a params file

More information about the params file is found in the params file documentation.

To generate the exact same params file used in the parametrization tutorial, activate the following parameters:

  • Bond parameters: C-O, C-N, N-H
  • Off-diagonal parameters: C-O, C-N, N-H
  • Angle parameters: C-C-N, H-N-H, O-C-N, C-O-C, C-N-H, C-C-O, H-C-O
  • H-bond parameters: O-H-N, N-H-O, N-H-N

If you want to use your new params file with the parametrization tutorial, copy and replace the params file located in the folder training_data of your CMA-ES parametrization package.