Skip to content

dft.runtime_state

Runtime-owned DFT state accounting and serialization adapters.

import mlx_atomistic.dft.runtime_state

def fixed_density_state_metrics(*, result: Any, basis: Any) -> dict[str, int]

Return logical runtime-owned bytes for one fixed-density eigenstate.

Parameters

NameTypeDefaultDescription
resultAnyPeriodic eigensolver result.
basisAnyBasis owning the result coefficients.

Returns

  • dict[str, int] — Logical coefficient payload and full-grid byte counts.
def serialize_fixed_density_state(state: Mapping[str, Any]) -> dict[str, bytes]

Serialize one runtime-owned fixed-density state without report coupling.

Parameters

NameTypeDefaultDescription
stateMapping[str, Any]Mapping containing result, basis, density, and effective potential.

Returns

  • dict[str, bytes] — Relative payload names mapped to deterministic bytes.
def serialize_periodic_scf_state(result: Any) -> dict[str, bytes]

Serialize a periodic SCF result through the runtime-owned state adapter.

Parameters

NameTypeDefaultDescription
resultAnyPeriodic SCF result to serialize.

Returns

  • dict[str, bytes] — Relative payload names mapped to deterministic bytes.