Geometry Optimization

The Geopt class allows to perform a geometry optimization to relax the forces on a given structure, using a machine learning model.

class mlcalcdriver.workflows.geopt.Geopt(posinp, calculator, forcemax=0.01, step_size=0.002, max_iter=500)[source]

Bases: object

This class allows to relax the input geometry of a given system in order to find the structure that minimizes the forces. The final result obtained depends on the trained machine learning model used.

Parameters
  • posinp (mybigdft.Posinp) – Starting configuration to relax

  • calculator (Calculator) – mlcalcdriver.Calculator instance that will be used in the created Job to evaluate properties.

  • forcemax (float) – Stopping criterion on the forces (in eV/Angstrom). Default is 0.01.

  • step_size (float) – Step size for each relaxation step. Default is 0.003 Angstrom<sup>2</sup>/eV.

  • max_iter (int) – Maximum number of iterations. Default is 500.

property posinp
Returns

Initial posinp of the geometry optimization procedure

Return type

Posinp

property calculator
Returns

The Calculator object to use for the Jobs necessary to perform the geometry optimisation.

Return type

Calculator

property final_posinp
Returns

Final posinp of the geometry optimization or None if the the optimization has not been completed

Return type

Posinp or None

property forcemax
Returns

Stopping criterion on the forces (in eV/Angstrom)

Return type

float

property step_size
Returns

Step size for each relaxation step

Return type

float

property max_iter
Returns

Maximum number of iterations

Return type

int

run(batch_size=128, recenter=False, verbose=0)[source]
Parameters
  • batch_size (int) – Size of the mini-batches used in predictions. Default is 128.

  • recenter (bool) – If True, the structure is recentered on its centroid after the relaxation. Default is False.

  • verbose (int) – Controls the verbosity of the output. If 0 (Default), no written output. If 1, a message will indicate if the optimization was succesful or not and the remaining forces. If 2 or more, each iteration will provide an output.