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);
255 virtual void purge();
262 const char *t=0, std::ostream&o=
ExEnv::out0())
const;
RefSCVector get_cartesian_gradient()
Return the cartesian gradient.
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 set_molhess(const Ref< MolecularHessian > &molhess)
Use this function to provide MolecularHessian object that will be used to compute hessian.
RefSymmSCMatrix hessian()
Will throw if hessian_implemented() returns 0.
virtual void symmetry_changed()
Call this if you have changed the molecular symmetry of the molecule contained by this MolecularEnerg...
virtual bool nonzero_efield_supported() const
overload this in classes that support computations in nonzero electric field the default is to not su...
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 guess_hessian(RefSymmSCMatrix &)
Compute a quick, approximate hessian.
The RefSymmSCMatrix class is a smart pointer to an SCSymmSCMatrix specialization.
Definition: matrix.h:265
void purge()
This function purges any caches of data in MolecularEnergy.
bool if_to_checkpoint() const
Check if need to checkpoint.
int value_implemented() const
A template class that maintains references counts.
Definition: ref.h:361
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
RefSymmSCMatrix get_cartesian_hessian()
Return the cartesian hessian.
void set_x(const RefSCVector &)
Set and retrieve the coordinate values.
int converged()
Return nonzero if the optimization has converged.
The Function class is an abstract base class that, given a set of coordinates, will compute a value a...
Definition: function.h:44
const RefSCVector & electric_field() const
returns the electric field vector
Definition: energy.h:258
void compute()
Recompute at least the results that have compute true and are not already computed.
The RefSCDimension class is a smart pointer to an SCDimension specialization.
Definition: dim.h:152
virtual void print(std::ostream &=ExEnv::out0()) const
Print information about the object.
void get_grad(const Ref< Function > &)
Set the current gradient and displacement.
void set_checkpoint()
Set up checkpointing.
RefSCVector get_cartesian_x()
Return the cartesian coordinates.
virtual double energy()
A wrapper around value();.
The MolecularEnergy abstract class inherits from the Function class.
Definition: energy.h:50
bool analytic_gradient_implemented() const
must overload this in a derived class if analytic gradient can be computed
RefSCVector gradient()
Will throw if gradient_implemented() returns 0.
virtual void purge()
This function purges any caches of data in MolecularEnergy.
virtual void set_gradient(RefSCVector &)
These are passed gradients and hessian in cartesian coordinates.
void set_molgrad(const Ref< MolecularGradient > &molgrad)
Use this function to provide MolecularGradient object that will be used to compute gradient.
void set_desired_gradient_accuracy(double acc)
These functions overload their Function counterparts.
The RefSCVector class is a smart pointer to an SCVector specialization.
Definition: matrix.h:55
Definition: stateout.h:71
Definition: xmlwriter.h:215
int hessian_implemented() const
Reports whether hessian is implemented either analytically or using MolecularHessian object.
virtual void set_energy(double)
This is just a wrapper around set_value().
Ref< NonlinearTransform > change_coordinates()
An optimizer can call change coordinates periodically to give the function an opportunity to change i...
The Convergence class is used by the optimizer to determine when an optimization is converged.
Definition: conv.h:52
int gradient_implemented() const
Reports whether gradient is implemented either analytically or using MolecularGradient object.
linear combination of MolecularEnergy objects
Definition: energy.h:270
static std::ostream & out0()
Return an ostream that writes from node 0.
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
virtual bool analytic_hessian_implemented() const
must overload this in a derived class if analytic hessian can be computed
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
void print(std::ostream &=ExEnv::out0()) const
Print the object.
Contains all MPQC code up to version 3.
Definition: mpqcin.h:14
Generated at Sun Jan 26 2020 23:23:56 for MPQC
3.0.0-alpha using the documentation package Doxygen
1.8.16.