chemparseplot.parse.projection¶
Reaction valley (s, d) projection utilities.
Extracts the 2D RMSD-plane rotation into reusable functions.
The projection maps (rmsd_a, rmsd_b) coordinates into
progress s (along the path) and deviation d (perpendicular).
For NEB paths, reference A is the reactant and B is the product. For single-ended methods, A is the initial structure and B is the final (saddle or minimum).
Implements the method from :cite:goswami2026valley.
.. versionadded:: 1.5.0
Module Contents¶
Classes¶
Orthonormal basis for the (s, d) reaction valley projection. |
Functions¶
Compute the projection basis from first/last points of the arrays. |
|
Project (rmsd_a, rmsd_b) into (s, d) reaction valley coordinates. |
|
Map (s, d) grid coordinates back to (a, b) RMSD space. |
API¶
- class chemparseplot.parse.projection.ProjectionBasis[source]¶
Orthonormal basis for the (s, d) reaction valley projection.
Attributes
a_start, b_start RMSD values of the first point (origin of the rotated frame). u_a, u_b Unit vector along the path direction in (a, b) space. v_a, v_b Unit vector perpendicular to the path (
v = rotate(u, +90deg)). path_norm Euclidean length of the path vector in (a, b) space.
- chemparseplot.parse.projection.compute_projection_basis(rmsd_a: numpy.ndarray, rmsd_b: numpy.ndarray) chemparseplot.parse.projection.ProjectionBasis[source]¶
Compute the projection basis from first/last points of the arrays.
Parameters
rmsd_a, rmsd_b RMSD distance arrays (to reference A and B respectively). The first element defines the origin; the last defines the path direction.
Returns
ProjectionBasis Frozen dataclass with the orthonormal basis vectors.
Raises
ValueError If the path has zero length (first and last points coincide in RMSD space).
- chemparseplot.parse.projection.project_to_sd(rmsd_a: numpy.ndarray, rmsd_b: numpy.ndarray, basis: chemparseplot.parse.projection.ProjectionBasis) tuple[numpy.ndarray, numpy.ndarray][source]¶
Project (rmsd_a, rmsd_b) into (s, d) reaction valley coordinates.
Parameters
rmsd_a, rmsd_b RMSD arrays to project. basis Pre-computed projection basis.
Returns
s, d Progress and deviation arrays.
- chemparseplot.parse.projection.inverse_sd_to_ab(s: numpy.ndarray, d: numpy.ndarray, basis: chemparseplot.parse.projection.ProjectionBasis) tuple[numpy.ndarray, numpy.ndarray][source]¶
Map (s, d) grid coordinates back to (a, b) RMSD space.
Used for evaluating the RBF surface on a projected grid.
Parameters
s, d Progress and deviation arrays (can be meshgrid raveled). basis Pre-computed projection basis.
Returns
rmsd_a, rmsd_b Coordinates in the original RMSD plane.