chemparseplot.plot.optimization¶
Visualization functions for optimization trajectories.
Provides 2D landscape and 1D profile plots for single-ended methods (dimer/saddle search, minimization) using the generalized (s, d) reaction valley projection.
The key semantic difference from NEB plots:
s = optimization progress (toward saddle or minimum)
d = lateral deviation (wasted sideways motion)
.. versionadded:: 1.5.0
Module Contents¶
Functions¶
Plot 2D landscape for an optimization trajectory. |
|
Plot energy (and optionally eigenvalue) vs iteration. |
|
Plot convergence metrics from a trajectory DataFrame. |
|
Plot how the dimer mode aligns with the final mode over iterations. |
Data¶
API¶
- chemparseplot.plot.optimization.log¶
‘getLogger(…)’
- chemparseplot.plot.optimization._LABELS¶
None
- chemparseplot.plot.optimization.plot_optimization_landscape(ax, rmsd_a: numpy.ndarray, rmsd_b: numpy.ndarray, grad_a: numpy.ndarray, grad_b: numpy.ndarray, z_data: numpy.ndarray, *, label_mode: str = 'optimization', project_path: bool = True, method: str = 'grad_matern', cmap: str = 'viridis', z_label: str = 'Energy (eV)', **surface_kwargs) Any¶
Plot 2D landscape for an optimization trajectory.
Wraps :func:
plot_landscape_surfaceand :func:plot_landscape_path_overlaywith semantically correct axis labels for single-ended methods.Parameters
ax Matplotlib axes. rmsd_a, rmsd_b RMSD distances to reference A and B. grad_a, grad_b Synthetic gradients in A and B directions. z_data Energy values for surface fitting. label_mode
"optimization"(default) or"reaction"for NEB-style labels. project_path Whether to project into (s, d) coordinates. method Surface fitting method (passed to plot_landscape_surface). cmap Colormap name. z_label Label for the colorbar. **surface_kwargs Extra keyword arguments passed to :func:plot_landscape_surface.Returns
colorbar or None
- chemparseplot.plot.optimization.plot_optimization_profile(ax, iterations: numpy.ndarray, energies: numpy.ndarray, *, eigenvalues: numpy.ndarray | None = None, ax_eigen: Any = None, color: str = '#004D40', eigen_color: str = '#FF655D') None¶
Plot energy (and optionally eigenvalue) vs iteration.
Parameters
ax Matplotlib axes for the energy profile. iterations Iteration numbers. energies Energy values per iteration. eigenvalues Eigenvalue per iteration (dimer only). Plotted on
ax_eigen. ax_eigen Secondary axes for eigenvalue subplot. Required if eigenvalues given. color Energy line color. eigen_color Eigenvalue line color.
- chemparseplot.plot.optimization.plot_convergence_panel(ax_force, ax_step, dat_df: polars.DataFrame, *, force_col: str = 'convergence', step_col: str = 'step_size', iter_col: str = 'iteration', color: str = '#004D40') None¶
Plot convergence metrics from a trajectory DataFrame.
Parameters
ax_force Axes for force/convergence metric. ax_step Axes for step size. dat_df Polars DataFrame with iteration data (from climb.dat or min.dat). force_col, step_col, iter_col Column names. color Line color.
- chemparseplot.plot.optimization.plot_dimer_mode_evolution(ax, mode_vectors: list[numpy.ndarray], *, color: str = '#004D40') None¶
Plot how the dimer mode aligns with the final mode over iterations.
Shows the dot product of each iteration’s mode vector with the final converged mode, indicating rotation convergence.
Parameters
ax Matplotlib axes. mode_vectors List of mode vectors per iteration. The last is the reference. color Line color.