QMCSCFJastrow Class Reference

This class calculates the value of the wavefunction, its first two derivatives, and any other properties which are calculated from the wavefunction (local energy, etc. More...

#include <QMCSCFJastrow.h>

Inheritance diagram for QMCSCFJastrow:

QMCFunctions

List of all members.

Public Member Functions

 QMCSCFJastrow ()
 Creates a new instance of the class.
 QMCSCFJastrow (QMCInput *input, QMCHartreeFock *HF)
 Creates a new instance of the class and initializes it with the data controlling the QMC calculation.
 QMCSCFJastrow (QMCInput *input)
 Creates a new instance of the class and initializes it with the data controlling the QMC calculation.
 QMCSCFJastrow (const QMCSCFJastrow &rhs)
 Creates a new instance of the class that is identical to another instance of QMCSCFJastrow.
 ~QMCSCFJastrow ()
 Deallocates all memory used by the object.
void initialize (QMCInput *input, QMCHartreeFock *HF)
 Initializes the object with the data controlling the QMC calculation.
void evaluate (Array2D< double > &X, QMCWalkerData &data)
 Evaluates all of the calculated properties at X and places the calculated data into the QMCWalkerData struct provided.
void evaluate (Array1D< QMCWalkerData * > &walkerData, Array1D< Array2D< double > * > &xData, int num)
void operator= (const QMCSCFJastrow &rhs)
 Sets two QMCSCFJastrow objects equal.

Protected Attributes

QMCInputInput
int nalpha
int nbeta

Private Member Functions

void calculate_Psi_quantities ()
 This function processes the results from a QMCSlater.
void update_SCF ()
void calculate_CorrelatedSampling (Array1D< QMCWalkerData * > &walkerData, Array1D< Array2D< double > * > &xData, int num)
 This must be called after calculate_Psi_quantities.
void calculate_Modified_Grad_PsiRatio ()
 This function continues to process results from a QMCSlater calculation.
void calculate_JastrowDerivatives (int &ai)
 Calculate the derivative of the energy with respect to parameters in the Jastrow.
void calculate_CIDerivatives (int &ai)
 Calculate the derivative of the energy with respect to the CI coefficients.
void calculate_OrbitalDerivatives (int &ai)
 Calculate the derivative of the energy with respect to parameters in the orbitals.
void checkParameterDerivatives ()
 Call this function to print out the parameter derivatives and then exit.
QMCDouble getPsi ()
 Gets the value of the wavefunction at the last evaluated electronic configuration.
double getLocalEnergy ()
 Gets the local energy at the last evaluated electronic configuration.
double getKineticEnergy ()
 Gets the kinetic energy at the last evaluated electronic configuration.
double getPotentialEnergy (int whichWalker)
 Gets the potential energy at the last evaluated electronic configuration.
double getEnergyEE (int whichWalker)
double getEnergyNE (int whichWalker)
void calculate_E_Local (int whichWalker)
 Calculate the local energy.
bool isSingular (int whichWalker)
 Returns true if the last evaluated electronic configuration gives a singular Slater matrix and false otherwise.

Private Attributes

QMCWalkerDatawd
Array2D< double > * x
int iWalker
QMCSlater Alpha
 Corresponding to QMCFunction's ability to process several walkers simultaneously, each QMCSlater object is able to do the same in analogous fashion.
QMCSlater Beta
QMCJastrow Jastrow
QMCPotential_Energy PE
QMCNuclearForces nf
QMCDouble Psi
double Laplacian_PsiRatio
double E_Local
Array1D< double > termPR
 These next several peices of data are the intermediary data used to calculate psi and the energy.
double ** term_AlphaGrad
double ** term_BetaGrad
Array1D< double > * alphaPsi
Array3D< double > * alphaGrad
Array1D< double > * alphaLaplacian
Array1D< double > * betaPsi
Array3D< double > * betaGrad
Array1D< double > * betaLaplacian
Array2D< double > * JastrowGrad


Detailed Description

This class calculates the value of the wavefunction, its first two derivatives, and any other properties which are calculated from the wavefunction (local energy, etc.

).

The wavefunction is assumed to be of the form

\[ \Psi_{QMC} = J\sum_{i}D_{\uparrow,i}D_{\downarrow,i} \]

where

\[ J=exp(\sum{u_{i,j}(r_{i,j})}) \]

is a Jastrow type correlation function, and $D_{\uparrow}$ and $D_{\downarrow}$ are Slater determinants for the up and down electrons respectively.

It has now been modified to treat several configurations simultaneously. The point of this is so that a QMCSlater has more of a SIMD nature than it had previously, and that if benefits can be derived by multiplying several matricies simultaneously, it is now much easier to do so. This change anticipates GPU (and similiar architecture...) modifications.

Definition at line 57 of file QMCSCFJastrow.h.


Constructor & Destructor Documentation

QMCSCFJastrow::QMCSCFJastrow (  ) 

Creates a new instance of the class.

Definition at line 15 of file QMCSCFJastrow.cpp.

References QMCFunctions::nalpha, QMCFunctions::nbeta, wd, and x.

QMCSCFJastrow::QMCSCFJastrow ( QMCInput input,
QMCHartreeFock HF 
)

Creates a new instance of the class and initializes it with the data controlling the QMC calculation.

Parameters:
input input data for the calculation
HF object for calculating mean field potential

Definition at line 23 of file QMCSCFJastrow.cpp.

References initialize().

QMCSCFJastrow::QMCSCFJastrow ( QMCInput input  ) 

Creates a new instance of the class and initializes it with the data controlling the QMC calculation.

Parameters:
input input data for the calculation

Definition at line 28 of file QMCSCFJastrow.cpp.

References initialize().

QMCSCFJastrow::QMCSCFJastrow ( const QMCSCFJastrow rhs  ) 

Creates a new instance of the class that is identical to another instance of QMCSCFJastrow.

Parameters:
rhs object to make a copy of

Definition at line 34 of file QMCSCFJastrow.cpp.

QMCSCFJastrow::~QMCSCFJastrow (  ) 

Deallocates all memory used by the object.

Definition at line 39 of file QMCSCFJastrow.cpp.


Member Function Documentation

void QMCSCFJastrow::initialize ( QMCInput input,
QMCHartreeFock HF 
)

void QMCSCFJastrow::evaluate ( Array2D< double > &  X,
QMCWalkerData data 
) [virtual]

Evaluates all of the calculated properties at X and places the calculated data into the QMCWalkerData struct provided.

Two overloaded functions are provided, one of them processes a array of parameters, the other processes just one (useful during a QMCWalker's initialization)

Parameters:
X $3N$ dimensional configuration of electrons represented by a $N \times 3$ matrix
data all the data that a QMCWalker should require if true, the walkerData.configOutput will be given its info

Implements QMCFunctions.

Definition at line 184 of file QMCSCFJastrow.cpp.

void QMCSCFJastrow::evaluate ( Array1D< QMCWalkerData * > &  walkerData,
Array1D< Array2D< double > * > &  xData,
int  num 
) [virtual]

void QMCSCFJastrow::operator= ( const QMCSCFJastrow rhs  ) 

Sets two QMCSCFJastrow objects equal.

Parameters:
rhs object to set this object equal to

Definition at line 43 of file QMCSCFJastrow.cpp.

References Alpha, Beta, E_Local, QMCFunctions::Input, Jastrow, Laplacian_PsiRatio, QMCFunctions::nalpha, QMCFunctions::nbeta, PE, and Psi.

void QMCSCFJastrow::calculate_Psi_quantities (  )  [private]

void QMCSCFJastrow::update_SCF (  )  [private]

void QMCSCFJastrow::calculate_CorrelatedSampling ( Array1D< QMCWalkerData * > &  walkerData,
Array1D< Array2D< double > * > &  xData,
int  num 
) [private, virtual]

void QMCSCFJastrow::calculate_Modified_Grad_PsiRatio (  )  [private]

void QMCSCFJastrow::calculate_JastrowDerivatives ( int &  ai  )  [private]

Calculate the derivative of the energy with respect to parameters in the Jastrow.

Parameters:
ai the index where to start putting derivatives for this type

Definition at line 472 of file QMCSCFJastrow.cpp.

References QMCWalkerData::D_x, QMCJastrow::get_p2_xa_ln(), QMCJastrow::get_p3_xxa_ln(), QMCJastrow::get_p_a_ln(), QMCWavefunction::getNumberElectrons(), QMCJastrowParameters::getNumberJWParameters(), QMCFunctions::Input, iWalker, Jastrow, QMCInput::JP, QMCWalkerData::p3_xxa, QMCWalkerData::rp_a, QMCWalkerData::U_x, wd, and QMCInput::WF.

Referenced by calculate_Psi_quantities().

void QMCSCFJastrow::calculate_CIDerivatives ( int &  ai  )  [private]

void QMCSCFJastrow::calculate_OrbitalDerivatives ( int &  ai  )  [private]

void QMCSCFJastrow::checkParameterDerivatives (  )  [private]

Call this function to print out the parameter derivatives and then exit.

The derivatives will be formatted in a way that it's easy to check them in a spreadsheet.

To use this, uncomment the function call. Run the program and copy/paste the output into a spreadsheet. Change one of the parameters in the input file by a small amount "h". Rerun the program with the modified input file, and copy this data into your spreadsheet. Use the spreadsheet to calculate ( f(x+h) - f(x) ) / h and verify that this quantity matches the derivative the program calculated.

The derivatives should match to a relative error of at least 1e-5, depending on the magnitude of h. If h is too small, then the quality of your derivative is going to suffer from poor output precision. If h is too large, then quality is going to suffer from the derivative approximation formula.

Definition at line 694 of file QMCSCFJastrow.cpp.

References QMCFlags::calculate_Derivatives, QMCInput::flags, QMCInput::getAIParameters(), QMCInput::getNumberAIParameters(), globalInput, QMCFunctions::Input, QMCFlags::iseed, QMCWalkerData::localEnergy, QMCWalkerData::p3_xxa, QMCInput::printAIParameters(), QMCInput::printAISummary(), Psi, QMCWalkerData::psi, QMCWalkerData::rp_a, and wd.

QMCDouble QMCSCFJastrow::getPsi (  )  [inline, private]

Gets the value of the wavefunction at the last evaluated electronic configuration.

The returned value is not normalized to one.

Returns:
wavefunction value

Definition at line 248 of file QMCSCFJastrow.h.

References Psi.

Referenced by evaluate().

double QMCSCFJastrow::getLocalEnergy (  )  [inline, private]

Gets the local energy at the last evaluated electronic configuration.

E_L &=& -{1}{2}{^2 (D e^{U})}{D e^{U}} + V \ &=&

  • {1}{2} [{^2 D}{D} +2 ( { D}{D} ) U + U U + ^2 U ] + V

Returns:
local energy

Definition at line 266 of file QMCSCFJastrow.h.

References E_Local.

Referenced by evaluate().

double QMCSCFJastrow::getKineticEnergy (  )  [inline, private]

Gets the kinetic energy at the last evaluated electronic configuration.

Returns:
kinetic energy.

Definition at line 276 of file QMCSCFJastrow.h.

References Laplacian_PsiRatio.

Referenced by evaluate().

double QMCSCFJastrow::getPotentialEnergy ( int  whichWalker  )  [inline, private]

Gets the potential energy at the last evaluated electronic configuration.

Parameters:
which indicates which walker
Returns:
potential energy.

Definition at line 286 of file QMCSCFJastrow.h.

References QMCPotential_Energy::getEnergy(), and PE.

Referenced by evaluate().

double QMCSCFJastrow::getEnergyEE ( int  whichWalker  )  [inline, private]

Definition at line 291 of file QMCSCFJastrow.h.

References QMCPotential_Energy::getEnergyEE(), and PE.

Referenced by evaluate().

double QMCSCFJastrow::getEnergyNE ( int  whichWalker  )  [inline, private]

Definition at line 296 of file QMCSCFJastrow.h.

References QMCPotential_Energy::getEnergyNE(), and PE.

Referenced by evaluate().

void QMCSCFJastrow::calculate_E_Local ( int  whichWalker  )  [inline, private]

Calculate the local energy.

must calculate Laplacian_PsiRatio before calling this

Parameters:
which indicates which walker

Definition at line 306 of file QMCSCFJastrow.h.

References E_Local, QMCPotential_Energy::getEnergy(), Laplacian_PsiRatio, and PE.

Referenced by evaluate().

bool QMCSCFJastrow::isSingular ( int  whichWalker  )  [private]

Returns true if the last evaluated electronic configuration gives a singular Slater matrix and false otherwise.

Parameters:
walker indicate which QMCWalker we are interested in
Returns:
true if the Slater matrix is singular and false otherwise

Definition at line 463 of file QMCSCFJastrow.cpp.

References Alpha, Beta, and QMCSlater::isSingular().

Referenced by evaluate().


Member Data Documentation

Array2D<double>* QMCSCFJastrow::x [private]

Definition at line 126 of file QMCSCFJastrow.h.

Referenced by calculate_CorrelatedSampling(), evaluate(), initialize(), and QMCSCFJastrow().

int QMCSCFJastrow::iWalker [private]

Corresponding to QMCFunction's ability to process several walkers simultaneously, each QMCSlater object is able to do the same in analogous fashion.

Definition at line 134 of file QMCSCFJastrow.h.

Referenced by calculate_CorrelatedSampling(), calculate_OrbitalDerivatives(), calculate_Psi_quantities(), evaluate(), initialize(), isSingular(), and operator=().

Definition at line 137 of file QMCSCFJastrow.h.

Referenced by evaluate(), and initialize().

double QMCSCFJastrow::E_Local [private]

Definition at line 143 of file QMCSCFJastrow.h.

Referenced by calculate_E_Local(), getLocalEnergy(), and operator=().

Array1D<double> QMCSCFJastrow::termPR [private]

These next several peices of data are the intermediary data used to calculate psi and the energy.

Since they are likely to be needed by the parameter derivative functions, we need to make them available outside the function that assigns them.

Definition at line 153 of file QMCSCFJastrow.h.

Referenced by calculate_CIDerivatives(), calculate_OrbitalDerivatives(), and update_SCF().

double** QMCSCFJastrow::term_AlphaGrad [private]

double** QMCSCFJastrow::term_BetaGrad [private]

Array1D<double>* QMCSCFJastrow::alphaPsi [private]

Array3D<double>* QMCSCFJastrow::alphaGrad [private]

Definition at line 159 of file QMCSCFJastrow.h.

Referenced by calculate_CorrelatedSampling(), and calculate_Psi_quantities().

Array1D<double>* QMCSCFJastrow::betaPsi [private]

Array3D<double>* QMCSCFJastrow::betaGrad [private]

Definition at line 163 of file QMCSCFJastrow.h.

Referenced by calculate_CorrelatedSampling(), and calculate_Psi_quantities().

Array2D<double>* QMCSCFJastrow::JastrowGrad [private]

Definition at line 165 of file QMCSCFJastrow.h.

QMCInput* QMCFunctions::Input [protected, inherited]

int QMCFunctions::nalpha [protected, inherited]

int QMCFunctions::nbeta [protected, inherited]


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

Generated on Sat Jul 5 16:14:06 2008 for QMcBeaver by  doxygen 1.5.6