QMCEquilibrationArray Class Reference

This class contains an array of QMCExtendedProprties objects, where the ith element starts collecting statistics on the (2^i)th step. More...

#include <QMCEquilibrationArray.h>

List of all members.

Public Member Functions

 QMCEquilibrationArray ()
 Creates a zeroed out instance of the class.
void zeroOut ()
 Sets all of the data in the object to zero.
void setCalcDensity (bool calcDensity, int nbasisfunctions)
 Tells the object if basis function densities are being calculated.
void setCalcForces (bool calcForces, int dim1, int dim2)
 Tells the object if basis function densities are being calculated.
void newSample (QMCProperties *timeStepProperties, double totalWeight, int nWalkers)
 Adds a new data sample to the live objects in the array and updates decorr_objects if necessary.
QMCPropertieschooseDecorrObject ()
 Gets the element of the array that has the lowest variance for the total energy and updates the current_index.
StopwatchgetPropagationStopwatch ()
 Gets the propagation stopwatch for the element of the array with the lowest variance for the total energy.
StopwatchgetEquilibrationStopwatch ()
 Gets the equilibration stopwatch for the element of the array with the lowest variance for the total energy.
void startTimers ()
 Starts the propagation stopwatches in the active elements of the array and the equilibration stopwatches in the inactive elements.
void stopTimers ()
 Stops the timers.
void toXML (ostream &strm)
 Writes the state of the object to an XML stream.
bool readXML (istream &strm)
 Reads the state of the object from an XML stream.

Private Member Functions

int getDecorrObjectIndex ()
 Returns the index of the element of the array with the lowest variance for the total energy.
long power (int a, int b)
 Returns a^b.

Private Attributes

QMCExtendedProperties Eq_Array [EQ]
 The array of QMCExtendedProperties objects.
QMCExtendedProperties ZeroProperties
 This object has no samples in it.
int decorr_objects
 The number of active objects in the array.
bool calc_density
 True if basis function density is being calculated.
int nBasisFunc
 Only has a value if calc_density = true.
bool calc_forces
 True if nuclear forces are being calculated.
Array2D< double > ten_thousand_samples
 This array stores the expectation value and standard deviation of each object after it has been active for 10000 samples.
int over_ten_thousand


Detailed Description

This class contains an array of QMCExtendedProprties objects, where the ith element starts collecting statistics on the (2^i)th step.

The object with the lowest variance in the energy is the one with the optimal number of equilibration steps.

Definition at line 18 of file QMCEquilibrationArray.h.


Constructor & Destructor Documentation

QMCEquilibrationArray::QMCEquilibrationArray (  ) 

Creates a zeroed out instance of the class.

Definition at line 5 of file QMCEquilibrationArray.cpp.

References Array2D< T >::allocate(), calc_density, EQ, nBasisFunc, over_ten_thousand, ten_thousand_samples, and zeroOut().


Member Function Documentation

int QMCEquilibrationArray::getDecorrObjectIndex (  )  [private]

Returns the index of the element of the array with the lowest variance for the total energy.

Returns:
index of the element with the lowest variance for the energy.

Definition at line 94 of file QMCEquilibrationArray.cpp.

References QMCProperties::energy, Eq_Array, QMCProperty::getAverage(), QMCProperty::getBlockStandardDeviation(), QMCExtendedProperties::getProperties(), over_ten_thousand, and ten_thousand_samples.

Referenced by chooseDecorrObject(), getEquilibrationStopwatch(), and getPropagationStopwatch().

long QMCEquilibrationArray::power ( int  a,
int  b 
) [private]

Returns a^b.

This function had to be included because some compilers don't allow pow to be called with two integer arguments.

Parameters:
a base.
b power.
Returns:
a^b.

Definition at line 248 of file QMCEquilibrationArray.cpp.

Referenced by newSample(), and readXML().

void QMCEquilibrationArray::zeroOut (  ) 

void QMCEquilibrationArray::setCalcDensity ( bool  calcDensity,
int  nbasisfunctions 
)

Tells the object if basis function densities are being calculated.

Definition at line 27 of file QMCEquilibrationArray.cpp.

References calc_density, EQ, and nBasisFunc.

Referenced by QMCRun::initialize().

void QMCEquilibrationArray::setCalcForces ( bool  calcForces,
int  dim1,
int  dim2 
)

Tells the object if basis function densities are being calculated.

Definition at line 40 of file QMCEquilibrationArray.cpp.

References calc_forces, and EQ.

Referenced by QMCRun::initialize().

void QMCEquilibrationArray::newSample ( QMCProperties timeStepProperties,
double  totalWeight,
int  nWalkers 
)

Adds a new data sample to the live objects in the array and updates decorr_objects if necessary.

Parameters:
timeStepProperties new sample.
totalWeight total weight of the new sample.
nWalkers number of walkers that generated the sample.

Definition at line 53 of file QMCEquilibrationArray.cpp.

References decorr_objects, QMCProperties::energy, Eq_Array, QMCProperty::getAverage(), QMCProperty::getBlockStandardDeviation(), QMCExtendedProperties::getProperties(), over_ten_thousand, power(), QMCExtendedProperties::setStartingStep(), and ten_thousand_samples.

Referenced by QMCRun::calculateObservables().

QMCProperties * QMCEquilibrationArray::chooseDecorrObject (  ) 

Gets the element of the array that has the lowest variance for the total energy and updates the current_index.

Returns:
the element of the array with the lowest variance for the energy.

Definition at line 83 of file QMCEquilibrationArray.cpp.

References Eq_Array, getDecorrObjectIndex(), QMCExtendedProperties::getProperties(), and ZeroProperties.

Referenced by QMCRun::getProperties().

Stopwatch * QMCEquilibrationArray::getPropagationStopwatch (  ) 

Gets the propagation stopwatch for the element of the array with the lowest variance for the total energy.

Returns:
the propagation stopwatch for the element of the array with the lowest variance for the energy.

Definition at line 128 of file QMCEquilibrationArray.cpp.

References Eq_Array, getDecorrObjectIndex(), QMCExtendedProperties::getPropagationStopwatch(), and ZeroProperties.

Referenced by QMCRun::getPropagationStopwatch(), startTimers(), and stopTimers().

Stopwatch * QMCEquilibrationArray::getEquilibrationStopwatch (  ) 

Gets the equilibration stopwatch for the element of the array with the lowest variance for the total energy.

Returns:
the equilibration stopwatch for the element of the array with the lowest variance for the energy.

Definition at line 137 of file QMCEquilibrationArray.cpp.

References Eq_Array, getDecorrObjectIndex(), QMCExtendedProperties::getEquilibrationStopwatch(), and ZeroProperties.

Referenced by QMCRun::getEquilibrationStopwatch(), startTimers(), and stopTimers().

void QMCEquilibrationArray::startTimers (  ) 

Starts the propagation stopwatches in the active elements of the array and the equilibration stopwatches in the inactive elements.

Definition at line 146 of file QMCEquilibrationArray.cpp.

References decorr_objects, EQ, Eq_Array, QMCExtendedProperties::getEquilibrationStopwatch(), getEquilibrationStopwatch(), getPropagationStopwatch(), Stopwatch::start(), and ZeroProperties.

Referenced by QMCRun::startTimers().

void QMCEquilibrationArray::stopTimers (  ) 

void QMCEquilibrationArray::toXML ( ostream &  strm  ) 

Writes the state of the object to an XML stream.

Parameters:
strm stream to write data to.

Definition at line 168 of file QMCEquilibrationArray.cpp.

References decorr_objects, Eq_Array, over_ten_thousand, and ten_thousand_samples.

Referenced by QMCRun::toXML().

bool QMCEquilibrationArray::readXML ( istream &  strm  ) 

Reads the state of the object from an XML stream.

Parameters:
strm stream to read data from.
Returns:
whether the read was successful

Definition at line 183 of file QMCEquilibrationArray.cpp.

References decorr_objects, EQ, Eq_Array, over_ten_thousand, power(), QMCExtendedProperties::setStartingStep(), ten_thousand_samples, QMCExtendedProperties::zeroOut(), and ZeroProperties.

Referenced by QMCRun::readXML().


Member Data Documentation

This object has no samples in it.

It is returned if the algorithm doesn't think any of the objects are equilibrated yet.

Definition at line 31 of file QMCEquilibrationArray.h.

Referenced by chooseDecorrObject(), getEquilibrationStopwatch(), getPropagationStopwatch(), readXML(), startTimers(), stopTimers(), and zeroOut().

The number of active objects in the array.

Definition at line 36 of file QMCEquilibrationArray.h.

Referenced by newSample(), readXML(), startTimers(), toXML(), and zeroOut().

True if basis function density is being calculated.

Definition at line 57 of file QMCEquilibrationArray.h.

Referenced by QMCEquilibrationArray(), and setCalcDensity().

Only has a value if calc_density = true.

Definition at line 62 of file QMCEquilibrationArray.h.

Referenced by QMCEquilibrationArray(), and setCalcDensity().

True if nuclear forces are being calculated.

Definition at line 67 of file QMCEquilibrationArray.h.

Referenced by setCalcForces().

This array stores the expectation value and standard deviation of each object after it has been active for 10000 samples.

Definition at line 73 of file QMCEquilibrationArray.h.

Referenced by getDecorrObjectIndex(), newSample(), QMCEquilibrationArray(), readXML(), toXML(), and zeroOut().


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

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