dft.periodic_phonon_persistence
Portable no-pickle persistence for periodic phonon force samples.
import mlx_atomistic.dft.periodic_phonon_persistence
Functions
Section titled “Functions”read_periodic_phonon_samples
Section titled “read_periodic_phonon_samples”def read_periodic_phonon_samples(path: str | Path, plan: PeriodicDisplacementPlan) -> PeriodicPhononSampleSetLoad and validate a no-pickle periodic phonon sample collection.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
path | str | Path | Existing sample NPZ path. | |
plan | PeriodicDisplacementPlan | Exact displacement plan expected by the artifact. |
Returns
PeriodicPhononSampleSet— Immutable partial or complete central-force sample collection.
Raises
TypeError— Ifplanhas an unsupported type.ValueError— If schema, inventory, dtypes, shapes, values, or identity are invalid.
write_periodic_phonon_samples
Section titled “write_periodic_phonon_samples”def write_periodic_phonon_samples(path: str | Path, plan: PeriodicDisplacementPlan, samples: PeriodicPhononSampleSet) -> PathAtomically publish a partial or complete phonon sample collection.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
path | str | Path | Previously absent destination NPZ path. | |
plan | PeriodicDisplacementPlan | Exact displacement plan bound by samples. | |
samples | PeriodicPhononSampleSet | Immutable central-force sample collection. |
Returns
Path— Resolved published path.
Raises
FileExistsError— If the destination already exists.TypeError— If plan or samples use unsupported types.ValueError— If sample and plan identities differ.