7. Python Classes and Functions

See also

Tutorial: Getting Started: Python

For ParAMS users, the five most important Python classes to know are

  • ResultsImporter: It lets you convert a reference (DFT) calculation into the ParAMS format (job collections, engine collections, and data sets)

  • Extractors: Functions that extract data from jobs, e.g. energy, forces, angle, etc.

  • Parameter interfaces like ReaxFFParameters and GFN1xTBParameters: They let you set which parameters to optimize, their initial values, and can convert between the ParAMS format and the AMS format.

  • ParAMSJob: It lets you set up the settings for a ParAMS job and run it through Python (using PLAMS).

  • ParAMSResults: It lets you extract results from a finished ParAMS job (also works if the job was run with the GUI).

The ResultsImporter class is usually enough to add training data. For full control of your training set, you can also use the classes that ResultsImporter uses internally:

  • Job Collection: Contains most settings for the jobs (the structure and task like SinglePoint or GeometryOptimization).

  • Engine Collection: Contains additional engine settings. It is usually not needed, but may be used to set e.g. k-space sampling for GFN1-xTB parametrizations.

  • Data Set: Contains reference values with units, what to extract from jobs, and the weights. It used for both the training set and (optionally) validation set.

To set the data set weights, you may be interested in

  • Weights schemes: They let you set different weights to different force components (for example) depending on how large the forces are.

To get more from your results, you may be interested in

  • Data Set Evaluator: It lets you access the contents of files like stats.txt and scatter_plots/forces.txt.

Finally, there are some classes that are used internally by ParAMS. You typically shouldn’t use these yourself, but instead set the corresponding input options in the input file (that you can set up with a ParAMSJob).