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
The atomic structure to optimize. A copy is made internally; the original object is not modified.
The ASE-compatible calculator used to evaluate energies and forces. Any MLIP registered in
MLIPEnum or a custom BaseCalculator subclass is accepted.Optimizer algorithm. Accepts an ASE
Optimizer class or one of the following strings:| String | Class |
|---|---|
"MDMin" | ase.optimize.MDMin |
"FIRE" | ase.optimize.FIRE |
"FIRE2" | ase.optimize.FIRE2 |
"LBFGS" | ase.optimize.LBFGS |
"LBFGSLineSearch" | ase.optimize.LBFGSLineSearch |
"BFGS" | ase.optimize.BFGS |
"BFGSLineSearch" | ase.optimize.BFGSLineSearch |
"QuasiNewton" | ase.optimize.QuasiNewton |
"GPMin" | ase.optimize.GPMin |
"CellAwareBFGS" | ase.optimize.CellAwareBFGS |
"ODE12r" | ase.optimize.ODE12r |
Extra keyword arguments forwarded to the optimizer constructor.
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:| String | Class |
|---|---|
"Filter" | ase.filters.Filter |
"UnitCell" | ase.filters.UnitCellFilter |
"ExpCell" | ase.filters.ExpCellFilter |
"Strain" | ase.filters.StrainFilter |
"FrechetCell" | ase.filters.FrechetCellFilter |
None relaxes only atomic positions.Extra keyword arguments forwarded to the filter constructor.
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)
If
True, applies an ASE FixSymmetry constraint to preserve crystal symmetry during relaxation.Return value
Returns adict with the following keys:
| Key | Type | Description |
|---|---|---|
atoms | ase.Atoms | Relaxed structure with calculator attached |
steps | int | Number of optimizer steps taken |
converged | bool | Whether the convergence criterion was satisfied |
Example
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.