chemparseplot.parse.trajectory.hdf5¶
HDF5 NEB reader for ChemGP output.
Added in version 1.2.0.
Reads neb_result.h5 (final converged path) and neb_history.h5
(per-step optimization history) produced by ChemGP’s Julia NEB optimizer.
These files contain pre-computed f_para and rxn_coord, so profile
data can be read directly without recomputing the Henkelman-Jonsson tangent.
Module Contents¶
Functions¶
Extract arrays from an HDF5 path group. |
|
Rebuild ASE Atoms from flattened positions and metadata. |
|
Read a ChemGP |
|
Read a ChemGP |
|
Convert a result HDF5 to a (5, N) profile array. |
|
Reconstruct ASE Atoms from a result HDF5 file. |
|
Convert a history HDF5 to a list of (5, N) profile arrays. |
|
Convert a history HDF5 to a landscape DataFrame. |
Data¶
API¶
- chemparseplot.parse.trajectory.hdf5.log¶
‘getLogger(…)’
- chemparseplot.parse.trajectory.hdf5._read_path_group(grp: h5py.Group) dict¶
Extract arrays from an HDF5 path group.
- Parameters:
grp – An h5py Group containing
images,energies,gradients,f_para, andrxn_coorddatasets.- Returns:
Dictionary with numpy arrays for each field.
- chemparseplot.parse.trajectory.hdf5._reconstruct_atoms(images: numpy.ndarray, atomic_numbers: numpy.ndarray | None, cell: numpy.ndarray | None, gradients: numpy.ndarray, energies: numpy.ndarray) list[ase.Atoms]¶
Rebuild ASE Atoms from flattened positions and metadata.
Each image’s positions are
(ndof,)wherendof = 3 * n_atoms. A SinglePointCalculator is attached with energy and forces (-gradients).- Parameters:
images – Array of shape
(n_images, ndof).atomic_numbers – Optional array of shape
(n_atoms,).cell – Optional array of shape
(9,)(flattened 3x3 cell).gradients – Array of shape
(n_images, ndof).energies – Array of shape
(n_images,).
- Returns:
List of ASE Atoms objects with calculators attached.
- chemparseplot.parse.trajectory.hdf5.load_neb_result(h5_file: str) dict¶
Read a ChemGP
neb_result.h5file.Added in version 1.2.0.
- Parameters:
h5_file – Path to the HDF5 result file.
- Returns:
Dictionary with keys
path(from :func:_read_path_group),convergence(dict of arrays), andmetadata(dict of scalars and optional arrays).
- chemparseplot.parse.trajectory.hdf5.load_neb_history(h5_file: str) list[dict]¶
Read a ChemGP
neb_history.h5file.Added in version 1.2.0.
- Parameters:
h5_file – Path to the HDF5 history file.
- Returns:
List of dicts (one per optimization step), sorted by step number. Each dict has the same structure as :func:
_read_path_group.
- chemparseplot.parse.trajectory.hdf5.result_to_profile_dat(h5_file: str) numpy.ndarray¶
Convert a result HDF5 to a (5, N) profile array.
Added in version 1.2.0.
Layout matches eOn
.datformat:[index, rxn_coord, energy, f_para, zeros].Reads directly from pre-computed HDF5 fields – no tangent recomputation.
- Parameters:
h5_file – Path to
neb_result.h5.- Returns:
Array of shape
(5, n_images).
- chemparseplot.parse.trajectory.hdf5.result_to_atoms_list(h5_file: str) list[ase.Atoms]¶
Reconstruct ASE Atoms from a result HDF5 file.
Added in version 1.2.0.
- Parameters:
h5_file – Path to
neb_result.h5.- Returns:
List of Atoms with SinglePointCalculators attached.
- chemparseplot.parse.trajectory.hdf5.history_to_profile_dats(h5_file: str) list[numpy.ndarray]¶
Convert a history HDF5 to a list of (5, N) profile arrays.
Added in version 1.2.0.
One array per optimization step, sorted by step number.
- Parameters:
h5_file – Path to
neb_history.h5.- Returns:
List of arrays, each of shape
(5, n_images).
- chemparseplot.parse.trajectory.hdf5.history_to_landscape_df(h5_file: str, ira_kmax: float = 1.8)¶
Convert a history HDF5 to a landscape DataFrame.
Added in version 1.2.0.
Reconstructs Atoms per step for RMSD coordinates, uses pre-computed
f_parafor synthetic gradients.- Parameters:
h5_file – Path to
neb_history.h5.ira_kmax – kmax factor for IRA alignment.
- Returns:
Polars DataFrame with columns
[r, p, grad_r, grad_p, z, step].