result
What a calculator returns, and the names of the things it can be asked for.
Units throughout are eV and Angstroms:
energy eV
energies eV, per atom, summing to `energy`
forces eV/A, `-dE/dr`
stress eV/A^3, `(1/V) dE/deps`
stress follows the ASE sign convention, where eps is the symmetric strain
applied as r -> (I + eps) r (so, for row-stored positions and lattice
vectors, P @ (I + eps) and A @ (I + eps)). A crystal under compression has
a negative pressure. virial = -V * stress = -dE/deps is the same quantity
without the volume, which is what a machine-learned model usually differentiates
and what the strain degrees of freedom in chmpy.opt want.
CalculatorStats
dataclass
Call counts and wall time, so "why is this slow" has an answer.
Read it off any calculator as calc.stats.
Source code in chmpy/calc/result.py
seconds_per_call
property
Mean wall time of an actual evaluation, excluding cache hits
GradientCheck
dataclass
How well a calculator's analytic derivatives match finite differences.
Produced by Calculator.check_gradients. ok is the verdict; the rest is
there so a failure says which component and by how much.
Source code in chmpy/calc/result.py
ok
property
True when every checked derivative is within tolerance of numeric.
The comparison is relative to the largest analytic component, with only enough of a floor to survive a geometry where everything is zero. An earlier version floored it at 1.0 eV/A, which quietly made the check pass for anything near a stationary point -- the very place a gradient bug is easiest to hide.
Result
dataclass
The properties a calculator computed for one geometry.
Anything not asked for is None rather than zero, so a missing property is a
TypeError at the point of use instead of a plausible-looking answer.
Source code in chmpy/calc/result.py
fmax
property
Largest force on any atom, eV/A
pressure
property
Hydrostatic pressure in GPa, positive under compression
smax
property
Largest stress component, GPa
stress_gpa
property
(3, 3) stress in GPa
stress_voigt
property
(6,) stress as xx, yy, zz, yz, xz, xy
virial
property
(3, 3) -dE/deps in eV, i.e. the stress without the volume
normalise_properties(want)
Validate a requested property set, naming anything unrecognised.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
want
|
a property name, or an iterable of them |
required |
Returns:
| Type | Description |
|---|---|
frozenset
|
frozenset of property names, always including |