Source code for rgpycrumbs.basetypes

import datetime
from collections import namedtuple
from dataclasses import dataclass

import numpy as np

# namedtuple for storing NEB iteration data
[docs]
[docs]
[docs] nebiter = namedtuple("nebiter", ["iteration", "nebpath"])
""" A namedtuple representing an iteration of a Nudged Elastic Band (NEB) calculation. Parameters ---------- iteration : int The iteration number of the NEB calculation. nebpath : nebpath namedtuple The data for the NEB path at this iteration. See Also -------- nebpath : Stores the normalized arclength, actual arclength, and energy data for the NEB path. """ # namedtuple for storing the NEB path data
[docs]
[docs]
[docs]
[docs] nebpath = namedtuple("nebpath", ["norm_dist", "arc_dist", "energy"])
""" A namedtuple representing the NEB path data. Parameters ---------- norm_dist : float Normalized Arclength (0 to 1), representing the progression along the reaction path. Calculated as xcoord2 = arcS[img] / arcS[nim-1]. arc_dist : float Actual Arclength at each point along the reaction path. Calculated as xcoord = arcS[img] + dx(ii). energy : float Interpolated Energy at each point, calculated using cubic polynomial interpolation. The energy is calculated using the formula: p = a*pow(dx(ii), 3.0) + b*pow(dx(ii), 2.0) + c*dx(ii) + d, where a, b, c, and d are coefficients of the cubic polynomial. Notes ----- The `nebpath` namedtuple is used within the `nebiter` namedtuple to store detailed path information for each NEB iteration. """ @dataclass
[docs] class DimerOpt:
[docs] saddle: str = "dimer"
[docs] rot: str = "lbfgs"
[docs] trans: str = "lbfgs"
@dataclass
[docs] class SpinID:
[docs] mol_id: int
[docs] spin: str
@dataclass
[docs] class MolGeom:
[docs] pos: np.array
[docs] energy: float
[docs] forces: np.array
@dataclass
[docs] class SaddleMeasure:
[docs] pes_calls: int = 0
[docs] iter_steps: int = 0
[docs] tot_time: datetime.timedelta = datetime.timedelta(0).total_seconds()
[docs] saddle_energy: float = np.nan
[docs] saddle_fmax: float = np.nan
[docs] success: bool = False
[docs] method: str = "not run"
[docs] dimer_rot: str = "n/a"
[docs] dimer_trans: str = "n/a"
[docs] init_energy: float = np.nan
[docs] barrier: float = np.nan
[docs] mol_id: int = np.nan
[docs] spin: str = "unknown"
[docs] scf: float = np.nan
[docs] termination_status: str = "not set"