MPQC  3.0.0-alpha
Public Member Functions | Protected Member Functions | Protected Attributes
sc::MolecularEnergy Class Reference

The MolecularEnergy abstract class inherits from the Function class. More...

#include <chemistry/molecule/energy.h>

Inheritance diagram for sc::MolecularEnergy:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 MolecularEnergy (const MolecularEnergy &)
 MolecularEnergy (const Ref< KeyVal > &)
 The KeyVal constructor.
 MolecularEnergy (StateIn &)
void save_data_state (StateOut &)
 Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR initializes them.
void set_checkpoint ()
 Set up checkpointing.
void set_checkpoint_file (const char *)
void set_checkpoint_freq (int freq)
bool if_to_checkpoint () const
 Check if need to checkpoint.
const char * checkpoint_file () const
int checkpoint_freq () const
MolecularEnergyoperator= (const MolecularEnergy &)
virtual double energy ()
 A wrapper around value();.
virtual Ref< Moleculemolecule () const
virtual RefSCDimension moldim () const
void guess_hessian (RefSymmSCMatrix &)
 Compute a quick, approximate hessian.
RefSymmSCMatrix inverse_hessian (RefSymmSCMatrix &)
int gradient_implemented () const
 Reports whether gradient is implemented either analytically or using MolecularGradient object.
int hessian_implemented () const
 Reports whether hessian is implemented either analytically or using MolecularHessian object.
void set_molhess (const Ref< MolecularHessian > &molhess)
 Use this function to provide MolecularHessian object that will be used to compute hessian.
const Ref< MolecularHessian > & molhess () const
RefSymmSCMatrix hessian ()
 Will throw if hessian_implemented() returns 0.
void set_molgrad (const Ref< MolecularGradient > &molgrad)
 Use this function to provide MolecularGradient object that will be used to compute gradient.
const Ref< MolecularGradient > & molgrad () const
RefSCVector gradient ()
 Will throw if gradient_implemented() returns 0.
void set_x (const RefSCVector &)
 Set and retrieve the coordinate values.
RefSCVector get_cartesian_x ()
 Return the cartesian coordinates.
RefSCVector get_cartesian_gradient ()
 Return the cartesian gradient.
RefSymmSCMatrix get_cartesian_hessian ()
 Return the cartesian hessian.
Ref< MolecularCoormolecularcoor ()
virtual void symmetry_changed ()
 Call this if you have changed the molecular symmetry of the molecule contained by this MolecularEnergy.
Ref< NonlinearTransformchange_coordinates ()
 An optimizer can call change coordinates periodically to give the function an opportunity to change its coordinate system.
virtual void purge ()
 This function purges any caches of data in MolecularEnergy.
const RefSCVectorelectric_field () const
 returns the electric field vector
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 print_natom_3 (double **, const char *t=0, std::ostream &o=ExEnv::out0()) const
void print_natom_3 (double *, const char *t=0, std::ostream &o=ExEnv::out0()) const
virtual void print (std::ostream &=ExEnv::out0()) const
 Print information about the object.
void set_desired_gradient_accuracy (double acc)
 These functions overload their Function counterparts.
void set_desired_hessian_accuracy (double acc)

Protected Member Functions

void failure (const char *)
virtual void set_energy (double)
 This is just a wrapper around set_value().
virtual void set_gradient (RefSCVector &)
 These are passed gradients and hessian in cartesian coordinates.
virtual void set_hessian (RefSymmSCMatrix &)
void x_to_molecule ()
void molecule_to_x ()
virtual bool nonzero_efield_supported () const
 overload this in classes that support computations in nonzero electric field
virtual bool analytic_gradient_implemented () const
 must overload this in a derived class if analytic gradient can be computed
virtual bool analytic_hessian_implemented () const
 must overload this in a derived class if analytic hessian can be computed

Protected Attributes

Ref< PointGroupinitial_pg_
int print_molecule_when_changed_

Detailed Description

The MolecularEnergy abstract class inherits from the Function class.

It computes the energy of the molecule as a function of the geometry. The coordinate system used can be either internal or cartesian.


Constructor & Destructor Documentation

sc::MolecularEnergy::MolecularEnergy ( const Ref< KeyVal > &  )

The KeyVal constructor.

molecule

A Molecule object. There is no default.

coor

A MolecularCoor object that describes the coordinates. If this is not given cartesian coordinates will be used. For convenience, two keywords needed by the MolecularCoor object are automatically provided: natom3 and matrixkit.

value_accuracy

Sets the accuracy to which values are computed. The default is 1.0e-6 atomic units.

gradient_accuracy

Sets the accuracy to which gradients are computed. The default is 1.0e-6 atomic units.

hessian_accuracy

Sets the accuracy to which hessians are computed. The default is 1.0e-4 atomic units.

hessian

Specifies a MolecularHessian object that is used to compute the hessian. This keyword may only need to be specified. if "exact" hessian is needed but this MolecularEnergy specialization does not provide a hessian of its own.

guess_hessian

Specifies a MolecularHessian object that is used to compute a guess hessian. Guess hessians are used to improve the rate of convergence of optimizations. If this keyword is not specified, and a MolecularCoor object is given by coor, then the guess hessian is obtained from the MolecularCoor object. If neither this nor coor are given, then Function::guess_hessian is used, which returns a unit matrix.

print_molecule_when_changed

If true, then whenever the molecule's coordinates are updated they will be printed. The default is true.

checkpoint

If true, then this object will be checkpointed during its evaluation. Not all implementations of MolecularEnergy support checkpointing. The default is false.

checkpoint_file

Specifies the name of the file into which this object will be checkpointed. Default is "<inpubasename>.ckpt", where "<inputbasename>" is the name of the input file without ".in".

checkpoint_freq
Specifies how often this object to be checkpointed. Only matters for objects which are computed iteratively. Default is 1.

Member Function Documentation

virtual bool sc::MolecularEnergy::analytic_gradient_implemented ( ) const [protected, virtual]

must overload this in a derived class if analytic gradient can be computed

Returns:
true (analytic gradient is available) or false (analytic gradient is not available, default)

Reimplemented in sc::PsiUHF, sc::PsiHSOSHF, sc::PsiCLHF, sc::SumMolecularEnergy, sc::MBPT2, sc::PsiCCSD, sc::MBPT2_R12, sc::HSOSKS, sc::CLKS, sc::UKS, sc::TaylorMolecularEnergy, sc::UHF, sc::CLHF, sc::HSOSHF, sc::OSSHF, and sc::TCHF.

virtual bool sc::MolecularEnergy::analytic_hessian_implemented ( ) const [protected, virtual]

must overload this in a derived class if analytic hessian can be computed

Returns:
true (analytic hessian is available) or false (analytic hessian is not available, default)

Reimplemented in sc::SumMolecularEnergy, and sc::TaylorMolecularEnergy.

An optimizer can call change coordinates periodically to give the function an opportunity to change its coordinate system.

A return value of 0 means the coordinates were not changed. Otherwise, a transform object to the new coordinate system is return. The function object applies the transform to any objects it contains. This will obsolete the function data.

Reimplemented from sc::Function.

Reports whether gradient is implemented either analytically or using MolecularGradient object.

I don't see a need to reimplement this in a derived class

Returns:
0 (gradient cannot be computed) or 1 (gradient can be computed)

Reimplemented from sc::Function.

Reports whether hessian is implemented either analytically or using MolecularHessian object.

I don't see a need to reimplement this in a derived class

Returns:
0 (hessian cannot be computed) or 1 (hessian can be computed)

Reimplemented from sc::Function.

virtual void sc::MolecularEnergy::purge ( ) [virtual]

This function purges any caches of data in MolecularEnergy.

It is useful with MolecularEnergy objects that keep state when obsolete() is called (for example, it makes sense for SCF to keep its old eigenvector and reuse it as a guess when geometry changes). The default implementation does nothing and must be overloaded in classes which need it

Reimplemented in sc::SumMolecularEnergy, and sc::SCF.

These functions overload their Function counterparts.

If hessian/gradient objects are provided, these functions will convey desired accuracy to them.

Reimplemented from sc::Function.

virtual void sc::MolecularEnergy::set_gradient ( RefSCVector ) [protected, virtual]

These are passed gradients and hessian in cartesian coordinates.

The gradient and hessian in internal coordinates are computed.

Reimplemented from sc::Function.

Use this function to provide MolecularGradient object that will be used to compute gradient.

You can call this function with null pointer to restore the state to the original state.

Use this function to provide MolecularHessian object that will be used to compute hessian.

You can call this function with null pointer to restore the state to the original state.

virtual void sc::MolecularEnergy::symmetry_changed ( ) [virtual]

Call this if you have changed the molecular symmetry of the molecule contained by this MolecularEnergy.

Reimplemented in sc::PsiSCF, sc::Wavefunction, sc::MBPT2, sc::SCF, sc::PsiCorrWavefunction, sc::OneBodyWavefunction, sc::PsiWavefunction, sc::HSOSSCF, sc::UnrestrictedSCF, sc::CLSCF, sc::TCSCF, and sc::OSSSCF.


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

Generated at Sat Jul 7 2012 11:52:50 for MPQC 3.0.0-alpha using the documentation package Doxygen 1.8.0.