Finite-Difference Calculator
- class ase.calculators.fd.FiniteDifferenceCalculator(calc: BaseCalculator, eps_disp: float = 1e-06, eps_strain: float = 1e-06)[source]
Wrapper calculator using the finite-difference method.
The forces and the stress are computed using the finite-difference method.
Added in version 3.24.0.
- ase.calculators.fd.calculate_numerical_forces(atoms: Atoms, eps: float = 1e-06, iatoms: Iterable[int] | None = None, icarts: Iterable[int] | None = None) ndarray [source]
Calculate forces numerically based on the finite-difference method.
- Parameters:
eps (float, default 1e-6) – Displacement.
iatoms (Optional[Iterable[int]]) – Indices of atoms for which forces are computed. By default, all atoms are considered.
icarts (Optional[Iterable[int]]) – Indices of Cartesian coordinates for which forces are computed. By default, all three coordinates are considered.
- Returns:
forces – Forces computed numerically based on the finite-difference method.
- Return type:
np.ndarray