OPT task minimizes the total energy of an atomic structure by iteratively updating atomic positions (and optionally the unit cell) until the maximum force falls below a convergence threshold.
It wraps ASE’s optimizer infrastructure and exposes a flexible interface for choosing the optimizer algorithm, a cell filter, symmetry constraints, and convergence criteria.
Function signature
Parameters
ase.Atoms
required
The atomic structure to optimize. A copy is made internally; the original object is not modified.
ase.calculators.calculator.BaseCalculator
required
The ASE-compatible calculator used to evaluate energies and forces. Any MLIP registered in
MLIPEnum or a custom BaseCalculator subclass is accepted.Optimizer | str
default:"BFGSLineSearch"
Optimizer algorithm. Accepts an ASE
Optimizer class or one of the following strings:dict | None
default:"None"
Extra keyword arguments forwarded to the optimizer constructor.
Filter | str | None
default:"None"
ASE cell filter to apply before the optimizer. Use a filter to also relax the unit cell. Accepts a
Filter class or one of the following strings:None relaxes only atomic positions.dict | None
default:"None"
Extra keyword arguments forwarded to the filter constructor.
dict | None
default:"{\"steps\": 1000}"
Convergence criterion dict forwarded to
optimizer.run(). Common keys:fmax(float) — maximum force in eV/Å (e.g.0.05)steps(int) — maximum number of steps (default1000)
boolean
default:"false"
If
True, applies an ASE FixSymmetry constraint to preserve crystal symmetry during relaxation.Return value
Returns adict with the following keys:
Example
1
Import and build a structure
2
Relax atomic positions only
3
Relax positions and cell
Notes on convergence
- The default criterion is
{"steps": 1000}with nofmaxlimit, so the optimizer always runs for 1000 steps unless you override it. - For most property calculations (EOS, elasticity), pass
{"fmax": 0.01}or tighter. - When using a cell filter, the “forces” seen by the optimizer include stress contributions scaled to the same units, so
fmaxapplies to both atomic forces and cell degrees of freedom. FixSymmetryis useful when you want to keep the space group fixed during relaxation.