Source code for pysisyphus.tsoptimizers.RSIRFOptimizer

# [1]
#     Bofill, 1998

import numpy as np

from pysisyphus.tsoptimizers.TSHessianOptimizer import TSHessianOptimizer

[docs] class RSIRFOptimizer(TSHessianOptimizer):
[docs] def optimize(self): energy, gradient, H, eigvals, eigvecs, resetted = self.housekeeping() self.update_ts_mode(eigvals, eigvecs) self.log( "Using projection to construct image potential gradient " f"and hessian for root(s) {self.roots}." ) # Projection matrix to construct g* and H* P = np.eye(self.geometry.coords.size) for root in self.roots: trans_vec = eigvecs[:, root] P -= 2 * np.outer(trans_vec, trans_vec) H_star = eigvals_, eigvecs_ = np.linalg.eigh(H_star) # Neglect small eigenvalues eigvals_, eigvecs_ = self.filter_small_eigvals(eigvals_, eigvecs_) grad_star = step = self.get_rs_step(eigvals_, eigvecs_, grad_star, name="RS-I-RFO") self.predicted_energy_changes.append(self.rfo_model(gradient, self.H, step)) return step