28#ifndef _chemistry_molecule_energy_h
29#define _chemistry_molecule_energy_h
33#include <math/optimize/function.h>
34#include <math/optimize/conv.h>
35#include <chemistry/molecule/molecule.h>
36#include <chemistry/molecule/coor.h>
37#include <chemistry/molecule/deriv.h>
38#ifdef MPQC_NEW_FEATURES
39#include <util/misc/xml.h>
51#ifdef MPQC_NEW_FEATURES
74 std::string ckpt_file_;
81 void failure(
const char *);
94 int print_molecule_when_changed_;
175#ifdef MPQC_NEW_FEATURES
176 virtual boost::property_tree::ptree& write_xml(boost::property_tree::ptree& parent,
const XMLWriter& writer);
181 void set_checkpoint_file(
const char*);
182 void set_checkpoint_freq(
int freq);
185 const char* checkpoint_file()
const;
186 int checkpoint_freq()
const;
216 void set_desired_hessian_accuracy(
double acc);
262 const char *t=0, std::ostream&o=
ExEnv::out0())
const;
The Convergence class is used by the optimizer to determine when an optimization is converged.
Definition conv.h:52
static std::ostream & out0()
Return an ostream that writes from node 0.
The Function class is an abstract base class that, given a set of coordinates, will compute a value a...
Definition function.h:44
void print(std::ostream &=ExEnv::out0()) const
Print the object.
MolEnergyConvergence(const Ref< KeyVal > &)
The KeyVal constructor.
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
int converged()
Return nonzero if the optimization has converged.
void get_grad(const Ref< Function > &)
Set the current gradient and displacement.
The MolecularEnergy abstract class inherits from the Function class.
Definition energy.h:54
virtual bool analytic_hessian_implemented() const
must overload this in a derived class if analytic hessian can be computed
RefSymmSCMatrix get_cartesian_hessian()
Return the cartesian hessian.
void print_natom_3(const RefSCVector &, const char *t=0, std::ostream &o=ExEnv::out0()) const
Nicely print n x 3 data that are stored in a vector.
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
void set_molhess(const Ref< MolecularHessian > &molhess)
Use this function to provide MolecularHessian object that will be used to compute hessian.
MolecularEnergy(const Ref< KeyVal > &)
The KeyVal constructor.
RefSCVector get_cartesian_x()
Return the cartesian coordinates.
RefSCVector get_cartesian_gradient()
Return the cartesian gradient.
virtual double energy()
A wrapper around value();.
void set_desired_gradient_accuracy(double acc)
These functions overload their Function counterparts.
virtual void set_gradient(RefSCVector &)
These are passed gradients and hessian in cartesian coordinates.
void guess_hessian(RefSymmSCMatrix &)
Compute a quick, approximate hessian.
void set_molgrad(const Ref< MolecularGradient > &molgrad)
Use this function to provide MolecularGradient object that will be used to compute gradient.
virtual bool nonzero_efield_supported() const
overload this in classes that support computations in nonzero electric field the default is to not su...
const RefSCVector & electric_field() const
returns the electric field vector
Definition energy.h:258
int gradient_implemented() const
Reports whether gradient is implemented either analytically or using MolecularGradient object.
virtual void purge()
This function purges any caches of data in MolecularEnergy.
RefSymmSCMatrix hessian()
Will throw if hessian_implemented() returns 0.
virtual void set_energy(double)
This is just a wrapper around set_value().
void set_checkpoint()
Set up checkpointing.
Ref< NonlinearTransform > change_coordinates()
An optimizer can call change coordinates periodically to give the function an opportunity to change i...
RefSCVector gradient()
Will throw if gradient_implemented() returns 0.
void set_x(const RefSCVector &)
Set and retrieve the coordinate values.
virtual bool analytic_gradient_implemented() const
must overload this in a derived class if analytic gradient can be computed
bool if_to_checkpoint() const
Check if need to checkpoint.
virtual void symmetry_changed()
Call this if you have changed the molecular symmetry of the molecule contained by this MolecularEnerg...
int hessian_implemented() const
Reports whether hessian is implemented either analytically or using MolecularHessian object.
virtual void print(std::ostream &=ExEnv::out0()) const
Print information about the object.
The RefSCDimension class is a smart pointer to an SCDimension specialization.
Definition dim.h:152
The RefSCVector class is a smart pointer to an SCVector specialization.
Definition matrix.h:55
The RefSymmSCMatrix class is a smart pointer to an SCSymmSCMatrix specialization.
Definition matrix.h:265
A template class that maintains references counts.
Definition ref.h:361
Restores fundamental and user-defined types from images created with StateOut.
Definition statein.h:79
Serializes fundamental and user-defined types.
Definition stateout.h:71
linear combination of MolecularEnergy objects
Definition energy.h:270
void set_x(const RefSCVector &)
Set and retrieve the coordinate values.
void purge()
This function purges any caches of data in MolecularEnergy.
int value_implemented() const
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
bool analytic_hessian_implemented() const
must overload this in a derived class if analytic hessian can be computed
bool analytic_gradient_implemented() const
must overload this in a derived class if analytic gradient can be computed
void compute()
Recompute at least the results that have compute true and are not already computed.
Definition xmlwriter.h:223
Contains all MPQC code up to version 3.
Definition mpqcin.h:14