MADNESS
0.10.1
|
Molecular optimizer derived from the QuasiNewton optimizer. More...
#include <molecular_optimizer.h>
Public Member Functions | |
MolecularOptimizer (World &world, const commandlineparser &parser, const std::shared_ptr< MolecularOptimizationTargetInterface > &tar) | |
same ctor as the QuasiNewton optimizer More... | |
bool | converged () const |
bool | converged (const Tensor< double > &displacement) const |
double | gradient_norm () const |
bool | optimize (Tensor< double > &x) |
optimize the underlying molecule More... | |
void | set_hessian (const Tensor< double > &hess) |
set an (initial) hessian More... | |
double | value () const |
Public Member Functions inherited from madness::OptimizerInterface | |
virtual | ~OptimizerInterface () |
Static Public Member Functions | |
static Tensor< double > | compute_frequencies (const Molecule &molecule, const Tensor< double > &hessian, Tensor< double > &normalmodes, const std::vector< std::string > &remove_dof={}, const bool print_hessian=false) |
returns the vibrational frequencies More... | |
static Tensor< double > | compute_reduced_mass (const Molecule &molecule, const Tensor< double > &normalmodes) |
static Tensor< double > | projector_external_dof (const Molecule &mol, const std::vector< std::string > &remove_dof) |
compute the projector to remove transl. and rot. degrees of freedom More... | |
static void | remove_external_dof (Tensor< double > &hessian, const Molecule &mol, const std::vector< std::string > &remove_dof) |
remove translational degrees of freedom from the hessian More... | |
Public Attributes | |
MolecularOptimizationParameters | parameters |
Private Member Functions | |
Tensor< double > | new_search_direction2 (const Tensor< double > &g, const Tensor< double > &hessian) const |
effectively invert the hessian and multiply with the gradient More... | |
bool | optimize_conjugate_gradients (Tensor< double > &x) |
bool | optimize_quasi_newton (Tensor< double > &x) |
Private Attributes | |
double | f =1.e10 |
double | gnorm =1.e10 |
Tensor< double > | h |
std::shared_ptr< MolecularOptimizationTargetInterface > | target |
How to update the hessian: BFGS or SR1. More... | |
Molecular optimizer derived from the QuasiNewton optimizer.
Essentially the QuasiNewton optimizer, but with the additional feature of projecting out rotational and translational degrees of freedom
|
inline |
same ctor as the QuasiNewton optimizer
|
inlinestatic |
returns the vibrational frequencies
[in] | hessian | the hessian matrix (not mass-weighted) |
[out] | normalmodes | the normal modes |
[in] | project_tr | whether to project out translation and rotation |
[in] | print_hessian | whether to print the hessian matrix |
Referenced by optimize_quasi_newton().
|
inlinestatic |
References madness::constants::atomic_mass_in_au, madness::copy(), madness::inner(), L, molecule, mu, and projector_external_dof().
|
inlinevirtual |
Implements madness::OptimizerInterface.
References gradient_norm().
Referenced by optimize_conjugate_gradients(), and optimize_quasi_newton().
|
inline |
|
inlinevirtual |
|
inlineprivate |
effectively invert the hessian and multiply with the gradient
References std::abs(), e(), madness::g, madness::MolecularOptimizationParameters::gradient_precision(), madness::inner(), parameters, madness::MolecularOptimizationParameters::printtest(), madness::syev(), and v.
Referenced by optimize_quasi_newton().
|
inlinevirtual |
optimize the underlying molecule
[in] | x | the coordinates to compute energy and gradient |
Implements madness::OptimizerInterface.
References converge(), and optimize_quasi_newton().
Referenced by main().
|
inlineprivate |
References beta, madness::MolecularOptimizationParameters::cg_method(), converged(), madness::displacement(), energy, madness::Tensor< T >::fill(), gnorm, madness::inner(), madness::MolecularOptimizationParameters::maxiter(), madness::Tensor< T >::normf(), parameters, projector_external_dof(), madness::MolecularOptimizationParameters::remove_dof(), madness::BaseTensor::size(), and target.
|
inlineprivate |
References madness::Tensor< T >::absmax(), madness::constants::au2invcm, compute_frequencies(), converged(), madness::BaseTensor::dim(), e(), f, gnorm, h, madness::QuasiNewton::hessian_update_bfgs(), madness::QuasiNewton::hessian_update_sr1(), madness::inner(), madness::QuasiNewton::line_search(), madness::MolecularOptimizationParameters::maxiter(), new_search_direction2(), madness::Tensor< T >::normf(), parameters, madness::print(), madness::MolecularOptimizationParameters::printtest(), projector_external_dof(), madness::MolecularOptimizationParameters::remove_dof(), remove_external_dof(), madness::Tensor< T >::scale(), madness::BaseTensor::size(), madness::syev(), target, madness::Tensor< T >::trace(), madness::MolecularOptimizationParameters::update(), v, and madness::MolecularOptimizationParameters::value_precision().
Referenced by optimize().
|
inlinestatic |
compute the projector to remove transl. and rot. degrees of freedom
taken from http://www.gaussian.com/g_whitepap/vib.htm I don't really understand the concept behind the projectors, but it seems to work, and it is not written down explicitly anywhere. NOTE THE ERROR IN THE FORMULAS ON THE WEBPAGE !
[in] | do_remove_dof | which dof to remove: x,y,z,Rx,Ry,Rz (transl/rot) |
References madness::_(), madness::constants::atomic_mass_in_au, madness::Molecule::center_of_mass(), e(), madness::Molecule::get_atom(), madness::Atom::get_mass_in_au(), I, madness::inner(), madness::Molecule::moment_of_inertia(), madness::Molecule::natom(), madness::detail::norm(), madness::Tensor< T >::normf(), p(), madness::print(), madness::Tensor< T >::scale(), madness::syev(), madness::commandlineparser::tolower(), madness::Molecule::translate(), madness::transpose(), v, madness::Atom::x, madness::Atom::y, and madness::Atom::z.
Referenced by madness::Nemo::compute_IR_intensities(), compute_reduced_mass(), optimize_conjugate_gradients(), optimize_quasi_newton(), and remove_external_dof().
|
inlinestatic |
remove translational degrees of freedom from the hessian
[in] | do_remove_dof | which dof to remove: x,y,z,Rx,Ry,Rz (transl/rot) |
References madness::inner(), and projector_external_dof().
Referenced by optimize_quasi_newton().
|
inline |
|
inlinevirtual |
Implements madness::OptimizerInterface.
|
private |
Referenced by optimize_quasi_newton().
|
private |
Referenced by gradient_norm(), optimize_conjugate_gradients(), and optimize_quasi_newton().
|
private |
Referenced by optimize_quasi_newton(), and set_hessian().
MolecularOptimizationParameters madness::MolecularOptimizer::parameters |
Referenced by converged(), main(), new_search_direction2(), optimize_conjugate_gradients(), and optimize_quasi_newton().
|
private |
How to update the hessian: BFGS or SR1.
Referenced by optimize_conjugate_gradients(), and optimize_quasi_newton().