votca 2026-dev
Loading...
Searching...
No Matches
votca::xtp::trah Namespace Reference

Trust-region augmented-Hessian (TRAH) step for orbital rotations, after Helmich-Paris, J. Chem. Phys. 154, 164104 (2021). More...

Classes

struct  StepOptions
struct  StepResult
struct  Subspace
class  TrustRadius

Typedefs

using HessianProduct = std::function<Eigen::MatrixXd(const Eigen::MatrixXd&)>
 Hessian applied to the columns of V (n x k), returning n x k.

Functions

StepResult Step (const Eigen::VectorXd &g, const Eigen::VectorXd &diag, const HessianProduct &hessian, double trust_radius, const StepOptions &opt=StepOptions(), Subspace *subspace=nullptr)
Eigen::MatrixXd RotateOrbitals (const Eigen::MatrixXd &C, const Eigen::VectorXd &x, Index nocc)
Eigen::VectorXd OccVirt (const Eigen::MatrixXd &M, Index nocc)

Detailed Description

Trust-region augmented-Hessian (TRAH) step for orbital rotations, after Helmich-Paris, J. Chem. Phys. 154, 164104 (2021).

Shared by the closed-shell (ConvergenceAcc) and unrestricted (UKSConvergenceAcc) SCF. Orbital rotations are parametrised as C' = C exp(kappa) with kappa_ia = x_ia (i occupied, a virtual) and kappa_ai = -x_ia; the vector x is flattened as x(i * n_virt + a), with the channels of an unrestricted calculation stacked (alpha first). The caller supplies the energy gradient g = dE/dx, the action of the energy Hessian d^2E/dx dx on a block of vectors, and a positive diagonal estimate of the Hessian for preconditioning.

The step minimises the quadratic model g.x + 1/2 x.H.x within |x| <= trust radius. It is the lowest eigenvector (mu, [v0; v]) of the scaled augmented Hessian [[0, a g^T], [a g, H]], x = v / (a v0), which satisfies (H - mu) x = -g. All a are handled in one Davidson subspace: only the first row and column of the projected matrix depend on a, so searching a costs no Hessian products. a = 1 is used when its step lies inside the trust radius; otherwise a is increased until |x| lies in [lower_fraction, 1] x trust radius.

Typedef Documentation

◆ HessianProduct

using votca::xtp::trah::HessianProduct = std::function<Eigen::MatrixXd(const Eigen::MatrixXd&)>

Hessian applied to the columns of V (n x k), returning n x k.

Definition at line 85 of file trah.h.

Function Documentation

◆ OccVirt()

Eigen::VectorXd votca::xtp::trah::OccVirt ( const Eigen::MatrixXd & M,
Index nocc )

Occupied-virtual block of a matrix in the MO basis, flattened as out(i * n_virt + a) = M(i, nocc + a).

Definition at line 318 of file trah.cc.

◆ RotateOrbitals()

Eigen::MatrixXd votca::xtp::trah::RotateOrbitals ( const Eigen::MatrixXd & C,
const Eigen::VectorXd & x,
Index nocc )

C exp(kappa) for the occupied-virtual rotation x (n_occ x n_virt values, layout above), exact: with the occupied-virtual block X = U s V^T, exp(kappa) = [[1 + U (cos s - 1) U^T, U sin s V^T], [-V sin s U^T, 1 + V (cos s - 1) V^T]], evaluated from the eigendecomposition of X X^T. S-orthonormal orbitals stay S-orthonormal.

Definition at line 275 of file trah.cc.

◆ Step()

StepResult votca::xtp::trah::Step ( const Eigen::VectorXd & g,
const Eigen::VectorXd & diag,
const HessianProduct & hessian,
double trust_radius,
const StepOptions & opt = StepOptions(),
Subspace * subspace = nullptr )

Definition at line 116 of file trah.cc.