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
andscatter_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).
- 7.1. Results Importer
- 7.1.1. ResultsImporter overview
- 7.1.1.1. ResultsImporter summary
- 7.1.1.2. ResultsImporter settings
- 7.1.1.3. Training set, validation set, etc.
- 7.1.1.4. Save and load from disk
- 7.1.1.5. add_singlejob
- 7.1.1.6. add_trajectory_singlepoints
- 7.1.1.7. add_reaction_energy
- 7.1.1.8. add_pesscan_singlepoints
- 7.1.1.9. add_neb_singlepoints
- 7.1.1.10. add_pesexploration_singlepoints
- 7.1.2. AMS, VASP, Quantum ESPRESSO, and Gaussian reference data
- 7.1.3. ResultsImporters API
- 7.1.1. ResultsImporter overview
- 7.2. Extractors and Comparators
- 7.2.1. Available Extractors
- 7.2.1.1. Angle
- 7.2.1.2. Average distance
- 7.2.1.3. BandGap
- 7.2.1.4. BandStructure
- 7.2.1.5. Bulk modulus
- 7.2.1.6. Cell angles
- 7.2.1.7. Cell lengths
- 7.2.1.8. Cell volume
- 7.2.1.9. Charges
- 7.2.1.10. Dihedral
- 7.2.1.11. Distance
- 7.2.1.12. Distance vector
- 7.2.1.13. Energy
- 7.2.1.14. Forces
- 7.2.1.15. Hessian
- 7.2.1.16. PES
- 7.2.1.17. PES compared
- 7.2.1.18. PESScan angle
- 7.2.1.19. PESScan dihedral
- 7.2.1.20. PESScan distance
- 7.2.1.21. RMSD
- 7.2.1.22. Shear modulus
- 7.2.1.23. Stress tensor
- 7.2.1.24. Stress tensor 1D
- 7.2.1.25. Stress tensor 2D
- 7.2.1.26. Stress tensor 3D
- 7.2.1.27. Stress tensor diagonal 2D
- 7.2.1.28. Stress tensor diagonal 3D
- 7.2.1.29. Stress tensor off-diagonal 2D
- 7.2.1.30. Stress tensor off-diagonal 3D
- 7.2.1.31. Vibrational frequencies
- 7.2.1.32. Young modulus
- 7.2.2. Custom Extractors
- 7.2.3. Supported Data Structures
- 7.2.4. Custom Comparators
- 7.2.1. Available Extractors
- 7.3. Parameter Interfaces
- 7.3.1. Available Parameter Interfaces
- 7.3.1.1. GFN1-xTB
- 7.3.1.2. ReaxFF
- 7.3.1.2.1. Reading Legacy params Files
- 7.3.1.2.2. Addition of Parameters
- 7.3.1.2.3. Trim (remove elements) from a ReaxFF force field
- 7.3.1.2.4. Apply recommended parameter ranges (constraints)
- 7.3.1.2.5. Parameter Databases and Value Suggestions
- 7.3.1.2.6. ReaxFF Conversion Functions
- 7.3.1.2.7. ReaxFF Interface API
- 7.3.1.2.8. Full List of Parameter Names
- 7.3.1.2.9. Parameter Categories
- 7.3.1.3. SCC-DFTB repulsive potential
- 7.3.1.4. Lennard Jones
- 7.3.1.5. No parameters (empty interface)
- 7.3.1.6. ASE Parameters
- 7.3.2. Working with Parameter Interfaces
- 7.3.1. Available Parameter Interfaces
- 7.4. ParAMSJob
- 7.5. ParAMSResults
- 7.6. Job and Engine Collections
- 7.7. Data Set
- 7.7.1. An example DataSet
- 7.7.2. Load or store DataSet
- 7.7.3. Adding entries
- 7.7.4. Demonstration: Working with a DataSet
- 7.7.5. Calculating and Adding Reference Data with AMS
- 7.7.6. Calculating the Loss Function Value
- 7.7.7. Checking for Consistency with a given Job Collection
- 7.7.8. Sigma vs. weight: What is the difference?
- 7.7.9. Data Set Entry API
- 7.7.10. Data Set API
- 7.8. Data Set Evaluator
- 7.9. Utilities
- 7.10. Internal ParAMS classes