Skip to main content

Overview

The OPT 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

ase.Atoms
required
The input atomic structure. A copy is made internally so the original object is not mutated.
ase.calculators.calculator.BaseCalculator
required
The ASE-compatible calculator used to evaluate energies and forces.
Optimizer | str
default:"BFGSLineSearch"
Optimizer class or string name. Supported string values: "MDMin", "FIRE", "FIRE2", "LBFGS", "LBFGSLineSearch", "BFGS", "BFGSLineSearch", "QuasiNewton", "GPMin", "CellAwareBFGS", "ODE12r".
dict | None
default:"None"
Extra keyword arguments forwarded to the optimizer constructor.
Filter | str | None
default:"None"
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.
dict | None
default:"None"
Extra keyword arguments forwarded to the filter constructor.
dict | None
default:"None"
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).
boolean
default:"false"
When True, applies an ASE FixSymmetry constraint so that the crystal symmetry is preserved throughout the relaxation.

Return value

ase.Atoms
The relaxed atomic structure with the calculator attached.
int
Total number of optimizer steps performed.
bool
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.

Example