Skip to content

dft.periodic_forces

Analytic fixed-cell forces for converged periodic plane-wave DFT.

import mlx_atomistic.dft.periodic_forces

class PeriodicForceResult
def __init__(forces: mx.array, local: mx.array, nonlocal_force: mx.array, ion_ewald: mx.array, timings: dict[str, float], provenance: dict[str, str])

Hellmann—Feynman force decomposition at a converged SCF state.

Parameters

NameTypeDefaultDescription
forcesmx.arrayTotal ionic forces in Hartree/bohr.
localmx.arrayLocal GTH electron-ion contribution.
nonlocal_forcemx.arrayNonlocal GTH projector contribution.
ion_ewaldmx.arrayPeriodic ion-ion Ewald contribution.
timingsdict[str, float]Wall-clock phase timings in milliseconds.
provenancedict[str, str]Method and stationarity metadata.

Properties

  • max_force float — Return the largest ionic force norm in Hartree/bohr.
  • net_force tuple[float, float, float] — Return the translational force residual in Hartree/bohr.

Methods

def to_dict() -> dict[str, object]

Return a JSON-safe force decomposition.

Returns

  • dict[str, object]
def periodic_scf_forces(system: PeriodicDFTSystem, result: PeriodicSCFResult, *, ewald_tolerance: float = 1e-10) -> PeriodicForceResult

Evaluate fixed-cell periodic forces from a converged SCF result.

The local and nonlocal electron-ion terms use analytic derivatives of the GTH phase factors. The ion-ion term uses the analytic Ewald derivative. There is no ionic Pulay term because the fixed-cell plane-wave basis does not depend on ion positions.

Parameters

NameTypeDefaultDescription
systemPeriodicDFTSystemExact periodic system used for the SCF calculation.
resultPeriodicSCFResultConverged periodic SCF result retaining compact occupied states.
ewald_tolerancefloat1e-10Real/reciprocal Ewald truncation target. Defaults to 1e-10.

Returns

  • PeriodicForceResult — Total forces, component forces, timings, and provenance.

Raises

  • TypeError — If system or result has an unsupported type.
  • ValueError — If the SCF state is unconverged, mismatched, incomplete, or non-finite.