Overview
TheOPT task relaxes atomic positions and (optionally) the unit cell of an Atoms object using an ASE optimizer. It is registered as a Prefect task with the name OPT and uses a TASK_SOURCE + INPUTS cache policy so that identical inputs reuse previously computed results.
Function signature
Parameters
The input atomic structure. A copy is made internally so the original object is not mutated.
The ASE-compatible calculator used to evaluate energies and forces.
Optimizer class or string name. Supported string values:
"MDMin", "FIRE", "FIRE2", "LBFGS", "LBFGSLineSearch",
"BFGS", "BFGSLineSearch", "QuasiNewton", "GPMin",
"CellAwareBFGS", "ODE12r".Extra keyword arguments forwarded to the optimizer constructor.
ASE filter (cell/strain wrapper) applied around
atoms before passing to the optimizer. Supported string values: "Filter", "UnitCell", "ExpCell", "Strain", "FrechetCell". Set to None to optimize atomic positions only.Extra keyword arguments forwarded to the filter constructor.
Convergence criteria passed to
optimizer.run(). Defaults to {"steps": 1000} when None. Common keys include fmax (force threshold in eV/Å) and steps (maximum number of steps).When
True, applies an ASE FixSymmetry constraint so that the crystal symmetry is preserved throughout the relaxation.Return value
The relaxed atomic structure with the calculator attached.
Total number of optimizer steps performed.
True if the optimizer reached the convergence criterion before exhausting the step budget.Prefect task behavior
- Task name:
OPT - Run name: generated as
OPT: <formula> - <calculator>. - Cache policy:
TASK_SOURCE + INPUTS— results are cached based on the task source code and all input values. Identical calls return the cached result without re-running. - Retries: none by default (use
OPT.with_options(retries=N)to add retries). - Submittable: call
OPT.submit(...)to run asynchronously inside a Prefect flow.