SIRIUS 7.5.0
Electronic structure library and applications
Public Member Functions | Private Member Functions | Private Attributes | List of all members
vcsqnm::sqnm_space::SQNM Class Reference

Public Member Functions

 SQNM (int ndim_, int nhistx_, double alpha_)
 Construct a new SQNM::SQNM object using default parameters. More...
 
 SQNM (int ndim_, int nhistx_, double alpha_, double alpha0_, double eps_subsp_)
 Construct a new SQNM::SQNM object using custom parameters. More...
 
Eigen::VectorXd step (Eigen::VectorXd &x, double &f_of_x, Eigen::VectorXd &df_dx)
 Calculates new coordinates that are closer to local minimum that the current coordinates. This function should be used the following way: More...
 
double lower_bound ()
 Estimates a lower bound of the energy of the local minimum. More...
 

Private Member Functions

double calc_gainratio (double &f)
 
void adjust_stepsize (double &gainratio)
 
Eigen::MatrixXd calc_ovrlp ()
 

Private Attributes

int ndim
 
int nhistx
 
double eps_subsp = 1.e-3
 
double alpha0 = 1.e-2
 
std::unique_ptr< hlist_space::HistoryListxlist
 
std::unique_ptr< hlist_space::HistoryListflist
 
double alpha
 
Eigen::VectorXd dir_of_descent
 
double prev_f
 
Eigen::VectorXd prev_df_dx
 
Eigen::VectorXd expected_positions
 
Eigen::MatrixXd h_subsp
 
Eigen::MatrixXd h_evec_subsp
 
Eigen::MatrixXd h_evec
 
Eigen::VectorXd h_eval
 
Eigen::VectorXd res
 
Eigen::SelfAdjointEigenSolver< Eigen::MatrixXd > esolve
 
Eigen::VectorXd res_temp
 
int nhist = 0
 
bool estimate_step_size = false
 

Detailed Description

Definition at line 20 of file sqnm.hpp.

Constructor & Destructor Documentation

◆ SQNM() [1/2]

vcsqnm::sqnm_space::SQNM::SQNM ( int  ndim_,
int  nhistx_,
double  alpha_ 
)
inline

Construct a new SQNM::SQNM object using default parameters.

Parameters
ndim_number of dimensions of target function
nhistx_Maximal number of steps that will be stored in the history list. Use a value between 3 and 20. Must be <= than ndim_.
alpha_initial step size. default is 1.0. For systems with hard bonds (e.g. C-C) use a value between and 1.0 and 2.5 Should be approximately the inverse of the largest eigenvalue of the Hessian matrix. If alpha is negative, the inial step size is estimated using the mechanism from section 6.4 of the vc-sqnm paper: https://arxiv.org/abs/2206.07339 beta will then be equal to minus alpha. Good choices for beta are 0.1 in hartee / bohr^2 and 0.001 in eV / A^2

Definition at line 56 of file sqnm.hpp.

◆ SQNM() [2/2]

vcsqnm::sqnm_space::SQNM::SQNM ( int  ndim_,
int  nhistx_,
double  alpha_,
double  alpha0_,
double  eps_subsp_ 
)
inline

Construct a new SQNM::SQNM object using custom parameters.

Parameters
ndim_number of dimensions of target function
nhistx_Maximal number of steps that will be stored in the history list. Use a value between 3 and 20. Must be <= than ndim_.
alpha_initial step size. default is 1.0. For systems with hard bonds (e.g. C-C) use a value between and 1.0 and 2.5. Should be approximately the inverse of the largest eigenvalue of the Hessian matrix. If alpha is negative, the inial step size is estimated using the mechanism from section 6.4 of the vc-sqnm paper: https://arxiv.org/abs/2206.07339 beta will then be equal to minus alpha. Good choices for beta are 0.1 in hartee / bohr^2 and 0.001 in eV / A^2
alpha0_*
alpha0Lower limit on the step size. 1.e-2 is the default.
eps_subsp_Lower limit on linear dependencies of basis vectors in history list. Default 1.e-4.

Definition at line 86 of file sqnm.hpp.

Member Function Documentation

◆ step()

Eigen::VectorXd vcsqnm::sqnm_space::SQNM::step ( Eigen::VectorXd &  x,
double &  f_of_x,
Eigen::VectorXd &  df_dx 
)
inline

Calculates new coordinates that are closer to local minimum that the current coordinates. This function should be used the following way:

  1. calculate f(x) and the derivative.
  2. call the step function.
  3. add return value of step function to x.
  4. repeat.
Parameters
xCurrent position vector
f_of_xvalue of the target function evaluated at position x.
df_dxderivative of the target function evaluated at x.
Returns
VectorXd displacent that can be added to x in order to get new improved coordinates.

Definition at line 115 of file sqnm.hpp.

◆ lower_bound()

double vcsqnm::sqnm_space::SQNM::lower_bound ( )
inline

Estimates a lower bound of the energy of the local minimum.

Returns
double Lower bound estimate

Definition at line 245 of file sqnm.hpp.

◆ calc_gainratio()

double vcsqnm::sqnm_space::SQNM::calc_gainratio ( double &  f)
inlineprivate

Definition at line 255 of file sqnm.hpp.

◆ adjust_stepsize()

void vcsqnm::sqnm_space::SQNM::adjust_stepsize ( double &  gainratio)
inlineprivate

Definition at line 260 of file sqnm.hpp.

◆ calc_ovrlp()

Eigen::MatrixXd vcsqnm::sqnm_space::SQNM::calc_ovrlp ( )
inlineprivate

Definition at line 265 of file sqnm.hpp.

Member Data Documentation

◆ ndim

int vcsqnm::sqnm_space::SQNM::ndim
private

Definition at line 22 of file sqnm.hpp.

◆ nhistx

int vcsqnm::sqnm_space::SQNM::nhistx
private

Definition at line 23 of file sqnm.hpp.

◆ eps_subsp

double vcsqnm::sqnm_space::SQNM::eps_subsp = 1.e-3
private

Definition at line 24 of file sqnm.hpp.

◆ alpha0

double vcsqnm::sqnm_space::SQNM::alpha0 = 1.e-2
private

Definition at line 25 of file sqnm.hpp.

◆ xlist

std::unique_ptr<hlist_space::HistoryList> vcsqnm::sqnm_space::SQNM::xlist
private

Definition at line 26 of file sqnm.hpp.

◆ flist

std::unique_ptr<hlist_space::HistoryList> vcsqnm::sqnm_space::SQNM::flist
private

Definition at line 27 of file sqnm.hpp.

◆ alpha

double vcsqnm::sqnm_space::SQNM::alpha
private

Definition at line 28 of file sqnm.hpp.

◆ dir_of_descent

Eigen::VectorXd vcsqnm::sqnm_space::SQNM::dir_of_descent
private

Definition at line 29 of file sqnm.hpp.

◆ prev_f

double vcsqnm::sqnm_space::SQNM::prev_f
private

Definition at line 30 of file sqnm.hpp.

◆ prev_df_dx

Eigen::VectorXd vcsqnm::sqnm_space::SQNM::prev_df_dx
private

Definition at line 31 of file sqnm.hpp.

◆ expected_positions

Eigen::VectorXd vcsqnm::sqnm_space::SQNM::expected_positions
private

Definition at line 32 of file sqnm.hpp.

◆ h_subsp

Eigen::MatrixXd vcsqnm::sqnm_space::SQNM::h_subsp
private

Definition at line 33 of file sqnm.hpp.

◆ h_evec_subsp

Eigen::MatrixXd vcsqnm::sqnm_space::SQNM::h_evec_subsp
private

Definition at line 34 of file sqnm.hpp.

◆ h_evec

Eigen::MatrixXd vcsqnm::sqnm_space::SQNM::h_evec
private

Definition at line 35 of file sqnm.hpp.

◆ h_eval

Eigen::VectorXd vcsqnm::sqnm_space::SQNM::h_eval
private

Definition at line 36 of file sqnm.hpp.

◆ res

Eigen::VectorXd vcsqnm::sqnm_space::SQNM::res
private

Definition at line 37 of file sqnm.hpp.

◆ esolve

Eigen::SelfAdjointEigenSolver<Eigen::MatrixXd> vcsqnm::sqnm_space::SQNM::esolve
private

Definition at line 38 of file sqnm.hpp.

◆ res_temp

Eigen::VectorXd vcsqnm::sqnm_space::SQNM::res_temp
private

Definition at line 39 of file sqnm.hpp.

◆ nhist

int vcsqnm::sqnm_space::SQNM::nhist = 0
private

Definition at line 40 of file sqnm.hpp.

◆ estimate_step_size

bool vcsqnm::sqnm_space::SQNM::estimate_step_size = false
private

Definition at line 41 of file sqnm.hpp.


The documentation for this class was generated from the following file: