rgpycrumbs.eon.pimd_centroid¶
Centroid and ring-polymer spread from a PIMD bead trajectory.
Added in version 1.12.0.
A path-integral molecular dynamics run carries P replicas (beads) of every
atom. This collapses them to one con frame per sampled step: the positions
are the centroid over the beads, and the readcon spreads section holds
each atom’s root-mean-square displacement from that centroid along x, y and
z in Angstrom.
Inputs, either of which may be CPMD TRAJECTORY text (step index, x, y, z,
vx, vy, vz per atom, positions in bohr, velocities ignored) or extended xyz
(positions in Angstrom); the format is read from the first line:
several files, one per replica, with the same number of frames and atoms;
one file whose frames hold P x N atoms, replica-major, with
--replicas P.
The trajectory carries no cell, masses or fixed flags. --reference (a
con file, first frame) supplies symbols, masses, cell and fixed flags;
otherwise --symbols (a whitespace-separated list, or xyz symbols) and
--cell supply what the frames need.
--time-average averages the centroid over the sampled frames and writes
one frame. Its spread combines the imaginary-time spread (rms over frames of
the bead spread) and the thermal spread (rms of the centroid about its
average) in quadrature, which equals the rms of all beads in all frames about
the time-averaged centroid. Both parts are in the frame metadata as
spread_imaginary_time_rms and spread_thermal_rms, rms over atoms and
components in Angstrom.
Attributes¶
Functions¶
|
|
|
Frames |
|
Frames |
|
Positions |
|
Bead positions |
|
Centroid and per-component rms spread, both |
|
Average over frames. |
|
|
|
Per-atom symbol, mass, fixed flags plus cell and angles. |
|
readcon frames, one per row of positions |
|
Positions, spreads and per-frame metadata from bead positions. |
|
Write the bead centroid and spread of TRAJECTORIES as a con file. |
Module Contents¶
- rgpycrumbs.eon.pimd_centroid._is_xyz(path: pathlib.Path) bool[source]¶
- rgpycrumbs.eon.pimd_centroid.read_xyz(path: pathlib.Path) tuple[numpy.ndarray, list[str]][source]¶
Frames
(n_frames, n_atoms, 3)in Angstrom and the symbols.
- rgpycrumbs.eon.pimd_centroid.read_cpmd_trajectory(path: pathlib.Path) numpy.ndarray[source]¶
Frames
(n_frames, n_atoms, 3)in Angstrom from aTRAJECTORY.A frame is a run of consecutive rows with one step index.
- rgpycrumbs.eon.pimd_centroid.read_trajectory(path: pathlib.Path) tuple[numpy.ndarray, list[str] | None][source]¶
Positions
(n_frames, n_atoms, 3)in Angstrom, plus xyz symbols.
- rgpycrumbs.eon.pimd_centroid.load_replicas(paths: list[pathlib.Path], replicas: int | None = None) tuple[numpy.ndarray, list[str] | None][source]¶
Bead positions
(P, n_frames, n_atoms, 3)in Angstrom and symbols.One path splits its frames replica-major into replicas beads; several paths are one replica each.
- rgpycrumbs.eon.pimd_centroid.centroid_spread(beads: numpy.ndarray) tuple[numpy.ndarray, numpy.ndarray][source]¶
Centroid and per-component rms spread, both
(n_frames, n_atoms, 3).
- rgpycrumbs.eon.pimd_centroid.time_average(centroid: numpy.ndarray, spread: numpy.ndarray) tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray, numpy.ndarray][source]¶
Average over frames.
Returns the mean centroid, the total spread, and its imaginary-time and thermal parts, each
(n_atoms, 3).
- rgpycrumbs.eon.pimd_centroid._rms(a: numpy.ndarray) float[source]¶
- rgpycrumbs.eon.pimd_centroid._template(reference, symbols, cell, n_atoms)[source]¶
Per-atom symbol, mass, fixed flags plus cell and angles.
- rgpycrumbs.eon.pimd_centroid.build_frames(positions: numpy.ndarray, spreads: numpy.ndarray, metadata: list[dict], *, reference=None, symbols=None, cell=None)[source]¶
readcon frames, one per row of positions
(F, N, 3).
- rgpycrumbs.eon.pimd_centroid.collapse(beads: numpy.ndarray, *, every: int = 1, average: bool = False) tuple[numpy.ndarray, numpy.ndarray, list[dict]][source]¶
Positions, spreads and per-frame metadata from bead positions.