#include <QMCWalker.h>
Public Member Functions | |
QMCWalker () | |
Creates a new uninitialized instance of this class. | |
QMCWalker (const QMCWalker &rhs) | |
Creates a new instance of this class and makes it equivalent to another instance of this class. | |
~QMCWalker () | |
Deallocates the memory allocated by this object. | |
void | initialize (QMCInput *input) |
Initializes and allocates memory for the walker. | |
void | initializeWalkerPosition (QMCFunctions &QMF) |
Initializes the electronic configuration for this walker using an algorithm from QMCInitializeWalkerFactory. | |
void | initializePropagation (QMCWalkerData *&data, Array2D< double > *&R, int iteration) |
Proposes a trial walker move and accepts or rejects it. | |
void | processPropagation (QMCFunctions &QMF, bool writeConfigs) |
This function completes the processing. | |
void | calculateObservables (QMCProperties &props) |
Calculates the observables for this walker and adds them to the input QMCProperties. | |
void | calculateObservables (QMCPropertyArrays &props) |
Calculates the observables for this walker and adds them to the input QMCPropertyArrays. | |
void | calculateDerivatives (QMCPropertyArrays &props) |
This is the same as calculateObservables(QMCPropertyArrays & props), except that this is for parameter derivatives, so QMCWalker can accumulate the data directly without averaging over the time step first (unnecessary since we don't use the variance). | |
void | operator= (const QMCWalker &rhs) |
Sets two QMCWalker objects equal. | |
double | getWeight () |
Gets the weight for this walker. | |
void | setWeight (double val) |
Sets the weight for this walker. | |
double | getTrailWeight (double energy) |
Uses the formula proposed by Trail. | |
bool | isSingular () |
Determines if the trial wavefunction is singular for this walker. | |
bool | branchRecommended () |
Branching is only an efficiency consideration, so we should be able to choose not to branch at a particular spot and not change detailed balance. | |
string | ID (bool showTrial) |
This will return a string with a short identification of this walker. | |
void | branchID () |
void | newID () |
Give the walker a fresh ID -- based on a static variable. | |
void | calculateElectronDensities (double max_pair_distance, double dr, Array1D< double > &pll_spin, Array1D< double > &opp_spin, Array1D< Array1D< double > > &alpha_density, Array1D< Array1D< double > > &beta_density) |
Calculates the distance between each pair of electrons and records it in the appropriate histogram. | |
void | calculatePllCorrelationDiagram (int coord, double min, double max, Array1D< Array1D< double > > &CorrelationDiagram) |
Calculates the 2D correlation diagram for the x, y, or z coordinates of all the parallel spin pairs of electrons. | |
void | calculateOppCorrelationDiagram (int coord, double min, double max, Array1D< Array1D< double > > &CorrelationDiagram) |
Calculates the 2D correlation diagram for the x, y, or z coordinates of all the opposite spin pairs of electrons. | |
void | toXML (ostream &strm) |
Writes the state of this object to an XML stream. | |
bool | readXML (istream &strm, QMCFunctions &QMF) |
Loads the state of this object from an XML stream. | |
double | getLocalEnergyEstimator () |
Gets the value of the local energy estimator for this walker. | |
Array2D< double > * | getR () |
Gets the positions of the electrons. | |
bool | setR (Array2D< double > temp_R) |
Sets the positions of the electrons. | |
QMCWalkerData * | getWalkerData () |
Gets the walkerData for this walker. | |
void | resetFutureWalking (int whichStage, int whichBlock) |
void | resetFutureWalking () |
Static Protected Attributes | |
static long int | nextID = 0 |
We need a static variable so that we can assign unique IDs to each walker as they are created. | |
Private Types | |
enum | fwStage { ACCUM, ASYMP, DONE } |
Private Member Functions | |
void | setAcceptanceProbability (double p) |
void | createChildWalkers () |
void | calculateMoveAcceptanceProbability (double GreensRatio) |
void | acceptOrRejectMove () |
QMCDouble | moveElectrons () |
Randomly moves the electrons to their new locations and returns the Green's function for the forward move. | |
QMCDouble | moveElectronsNoImportanceSampling () |
Randomly moves the electrons to their new locations without using importance sampling. | |
QMCDouble | moveElectronsImportanceSampling () |
Randomly moves the electrons to their new locations using importance sampling. | |
QMCDouble | moveElectronsUmrigar93ImportanceSampling () |
Randomly moves the electrons to their new locations using importance sampling and the accelerated Metropolis algorithm. | |
QMCDouble | moveElectronsUmrigar93AcceleratedSampling () |
QMCDouble | calculateReverseGreensFunction () |
Calculates the reverse Green's function for the proposed move of the electrons. | |
QMCDouble | calculateReverseGreensFunctionNoImportanceSampling () |
Calculates the reverse Green's function for the proposed move of the electrons when no importance sampling is used. | |
QMCDouble | calculateReverseGreensFunctionImportanceSampling () |
Calculates the reverse Green's function for the proposed move of the electrons when importance sampling is used. | |
QMCDouble | calculateReverseGreensFunctionUmrigar93ImportanceSampling () |
Calculates the reverse Green's function for the proposed move of the electrons when umrigar93 importance sampling is used. | |
QMCDouble | calculateReverseGreensFunctionUmrigar93AcceleratedSampling () |
int | getAge () |
double | getAcceptanceProbability () |
void | reweight_walker () |
Reweight the walker after a move. | |
void | calculateObservables () |
Calculates the observables for this walker. | |
Private Attributes | |
int | iteration |
double | tr_w_ratio |
double | tr_w |
double | weight |
int | age |
int | ageMoved |
bool | locationWarned |
double | dW |
int | numWarnings |
long int | genealogy [numAncestors] |
double | localEnergy |
These energies are calculated by QMCWalker using the acceptance probability as opposed to those calculated by QMCFunction. | |
double | kineticEnergy |
double | kineticEnergy_grad |
double | potentialEnergy |
Array1D< double > | cs_Energies |
Array1D< double > | cs_Weights |
Array1D< double > | p3_xxa |
Array1D< double > | rp_a |
double | r12 |
double | r2 |
double | ir12 |
double | ir |
double | neEnergy |
double | eeEnergy |
Array1D< int > | numFWSteps |
Array2D< fwStage > | isCollectingFWResults |
Array2D< double > | fwNormalization |
Array2D< double > | fwEnergy |
Array2D< double > | fwKineticEnergy |
Array2D< double > | fwKineticEnergy_grad |
Array2D< double > | fwPotentialEnergy |
Array2D< double > | fwR12 |
Array2D< double > | fwR2 |
Array2D< double > | fwiR12 |
Array2D< double > | fwiR |
Array2D< Array2D< double > > | fwNuclearForces |
double | distanceMovedAccepted |
double | AcceptanceProbability |
QMCWalkerData | walkerData |
walkerData is meant to hold all the necessary data given by a QMCFunction to complete the iteration. | |
QMCDouble | forwardGreensFunction |
This data is simply meant to carry the forwardGreensFunction between the 2 propagate walker functions. | |
Array2D< double > | R |
double | dR2 |
QMCWalker * | TrialWalker |
QMCWalker * | OriginalWalker |
bool | move_accepted |
QMCInput * | Input |
Static Private Attributes | |
static const double | pi = 3.14159265359 |
static const int | numAncestors = 5 |
An ID and processor rank are unique identifiers for each walker. | |
static const double | maxFWAsymp = 1.0 |
This is the same as the "walker" or "psip" discussed in QMC literature.
Definition at line 34 of file QMCWalker.h.
enum QMCWalker::fwStage [private] |
QMCWalker::QMCWalker | ( | ) |
Creates a new uninitialized instance of this class.
Definition at line 21 of file QMCWalker.cpp.
References age, ageMoved, dR2, dW, numWarnings, OriginalWalker, TrialWalker, and weight.
Referenced by createChildWalkers().
QMCWalker::QMCWalker | ( | const QMCWalker & | rhs | ) |
Creates a new instance of this class and makes it equivalent to another instance of this class.
rhs | object to set this equal to. |
Definition at line 48 of file QMCWalker.cpp.
References OriginalWalker, and TrialWalker.
QMCWalker::~QMCWalker | ( | ) |
Deallocates the memory allocated by this object.
Definition at line 56 of file QMCWalker.cpp.
References Array1D< T >::clear(), cs_Energies, cs_Weights, Array1D< T >::deallocate(), Array2D< T >::deallocate(), Array2D< T >::dim1(), Array2D< T >::dim2(), fwEnergy, fwiR, fwiR12, fwKineticEnergy, fwKineticEnergy_grad, fwNormalization, fwNuclearForces, fwPotentialEnergy, fwR12, fwR2, Input, isCollectingFWResults, numFWSteps, OriginalWalker, p3_xxa, R, rp_a, and TrialWalker.
void QMCWalker::initialize | ( | QMCInput * | input | ) |
Initializes and allocates memory for the walker.
The electronic configuration for the walker is not set. To do this initializeWalkerPosition
must be used to generate a new walker, or read
must be used to read this walkers state from a stream.
input | data input to control the calculation. |
Definition at line 1680 of file QMCWalker.cpp.
References Array2D< T >::allocate(), Array2D< T >::dim1(), Array2D< T >::dim2(), QMCInput::flags, QMCFlags::future_walking, fwEnergy, fwiR, fwiR12, fwKineticEnergy, fwKineticEnergy_grad, fwNormalization, fwNuclearForces, fwPotentialEnergy, fwR12, fwR2, QMCMolecule::getNumberAtoms(), QMCWavefunction::getNumberElectrons(), QMCNuclearForces::getNumBins(), QMCWalkerData::initialize(), Input, isCollectingFWResults, QMCInput::Molecule, QMCFlags::Nbasisfunc, QMCFlags::nuclear_derivatives, numFWSteps, R, resetFutureWalking(), Array1D< T >::resize(), setAcceptanceProbability(), QMCFlags::trial_function_type, walkerData, and QMCInput::WF.
Referenced by QMCRun::randomlyInitializeWalkers(), and QMCRun::readXML().
void QMCWalker::initializeWalkerPosition | ( | QMCFunctions & | QMF | ) |
Initializes the electronic configuration for this walker using an algorithm from QMCInitializeWalkerFactory.
If a singular walker is generated, up to 100 configurations are generated until one is not singular.
Definition at line 1966 of file QMCWalker.cpp.
References QMCFunctions::evaluate(), QMCInput::flags, QMCInitializeWalkerFactory::initializeWalkerFactory(), QMCInitializeWalker::initializeWalkerPosition(), Input, isSingular(), R, setR(), QMCFlags::walker_initialization_method, and walkerData.
Referenced by processPropagation().
void QMCWalker::initializePropagation | ( | QMCWalkerData *& | data, | |
Array2D< double > *& | R, | |||
int | iteration | |||
) |
Proposes a trial walker move and accepts or rejects it.
This method has been broken into 2 parts. The first part (this function) moves the electrons and then returns pointers to the new positions along with pointers to the QMCWalkerData structs so they can be filled.
The second part is the processPropagation function in this class. See QMCRun::propagateWalkers for how the two functions work together.
The whole point of the * & (reference to pointer) is that the two parameters are pointers, and are both outputs of this function.
Another way to do this might be to pass in the actual array of pointers, and tell initializePropagation which index to assign, but this was a good exercise in understanding pointers...
(output) | data to put a pointer to this walkerData | |
(output) | R to put a pointer to this' new configuration | |
iteration | our current iteration number. If equilibrating, less than zero |
Definition at line 152 of file QMCWalker.cpp.
References createChildWalkers(), Array2D< T >::dim1(), QMCFlags::equilibration_steps, QMCInput::flags, forwardGreensFunction, globalInput, Input, moveElectrons(), QMCFlags::one_e_per_iter, OriginalWalker, R, TrialWalker, walkerData, and QMCWalkerData::whichE.
void QMCWalker::processPropagation | ( | QMCFunctions & | QMF, | |
bool | writeConfigs | |||
) |
This function completes the processing.
The forwardGreensFunction was stored and because pointers were given with a call to initializePropagation, no parameters need to be passed. This function should not be called without first calling initializePropagation.
Definition at line 173 of file QMCWalker.cpp.
References AcceptanceProbability, acceptOrRejectMove(), calculateMoveAcceptanceProbability(), calculateObservables(), calculateReverseGreensFunction(), dR2, QMCFunctions::evaluate(), QMCInput::flags, forwardGreensFunction, getWeight(), globalInput, ID(), initializeWalkerPosition(), IeeeMath::isNaN(), isSingular(), iteration, QMCSurfer::mainMenu(), move_accepted, QMCFlags::one_e_per_iter, OriginalWalker, R, reweight_walker(), TrialWalker, QMCWalkerData::updateDistances(), QMCFlags::use_surfer, walkerData, QMCWalkerData::whichE, and QMCWalkerData::writeConfigs().
void QMCWalker::calculateObservables | ( | QMCProperties & | props | ) |
Calculates the observables for this walker and adds them to the input QMCProperties.
props | properties to which this walkers current observable values are added. |
Definition at line 2254 of file QMCWalker.cpp.
References QMCProperties::acceptanceProbability, age, ageMoved, distanceMovedAccepted, QMCProperties::distanceMovedAccepted, QMCProperties::distanceMovedTrial, dR2, dW, eeEnergy, QMCProperties::eeEnergy, QMCProperties::energy, QMCFlags::energy_estimated_original, QMCFlags::equilibration_steps, QMCInput::flags, getAcceptanceProbability(), getWeight(), ID(), Input, iteration, kineticEnergy, QMCProperties::kineticEnergy, localEnergy, QMCProperties::logWeights, move_accepted, neEnergy, QMCProperties::neEnergy, QMCProperty::newSample(), QMCFlags::old_walker_acceptance_parameter, potentialEnergy, QMCProperties::potentialEnergy, QMCProperties::walkerAge, walkerData, QMCFlags::warn_verbosity, QMCProperties::weightChange, and QMCWalkerData::whichE.
void QMCWalker::calculateObservables | ( | QMCPropertyArrays & | props | ) |
Calculates the observables for this walker and adds them to the input QMCPropertyArrays.
props | properties to which this walkers current observable values are added. |
Definition at line 2344 of file QMCWalker.cpp.
References ACCUM, ASYMP, QMCFlags::calculate_bf_density, QMCWalkerData::chiDensity, QMCPropertyArrays::chiDensity, QMCPropertyArrays::cs_Energies, cs_Energies, QMCInput::cs_Parameters, cs_Weights, Array1D< T >::deallocate(), Array1D< T >::dim1(), Array2D< T >::dim1(), Array2D< T >::dim2(), DONE, QMCFlags::energy_estimated_original, QMCInput::flags, QMCFlags::future_walking, FW_iR, FW_iR12, FW_iR12_2, FW_iR_2, FW_It, FW_KE, FW_KE_2, FW_KEg, FW_KEg_2, FW_PE, FW_PE_2, FW_R12, FW_R12_2, FW_R2, FW_R2_2, FW_TE, FW_TE_2, fwEnergy, fwiR, fwiR12, fwKineticEnergy, fwKineticEnergy_grad, fwNormalization, fwNuclearForces, fwPotentialEnergy, fwR12, fwR2, QMCWavefunction::getNumberBasisFunctions(), getWeight(), globalInput, Input, ir, ir12, isCollectingFWResults, kineticEnergy, kineticEnergy_grad, localEnergy, maxFWAsymp, QMCFlags::nuclear_derivatives, QMCWalkerData::nuclearDerivatives, QMCPropertyArrays::nuclearForces, numFWSteps, potentialEnergy, QMCPropertyArrays::props, r12, r2, QMCFlags::rel_cutoff, resetFutureWalking(), walkerData, and QMCInput::WF.
void QMCWalker::calculateDerivatives | ( | QMCPropertyArrays & | props | ) |
This is the same as calculateObservables(QMCPropertyArrays & props), except that this is for parameter derivatives, so QMCWalker can accumulate the data directly without averaging over the time step first (unnecessary since we don't use the variance).
props | properties to which this walkers current observable values are added. |
Definition at line 2463 of file QMCWalker.cpp.
References QMCFlags::calculate_Derivatives, Array1D< T >::deallocate(), QMCPropertyArrays::der, Array1D< T >::dim1(), QMCFlags::energy_estimated_original, QMCInput::flags, globalInput, QMCPropertyArrays::hess, Input, localEnergy, QMCPropertyArrays::numDerHessSamples, QMCFlags::optimize_Psi_criteria, p3_xxa, QMCFlags::rel_cutoff, and rp_a.
void QMCWalker::operator= | ( | const QMCWalker & | rhs | ) |
Sets two QMCWalker objects equal.
rhs | object to set this object equal to. |
Definition at line 91 of file QMCWalker.cpp.
References AcceptanceProbability, age, ageMoved, Array1D< T >::allocate(), Array2D< T >::allocate(), cs_Energies, cs_Weights, Array1D< T >::dim1(), Array2D< T >::dim1(), Array2D< T >::dim2(), distanceMovedAccepted, dR2, eeEnergy, QMCInput::flags, fwEnergy, fwiR, fwiR12, fwKineticEnergy, fwKineticEnergy_grad, fwNormalization, fwNuclearForces, fwPotentialEnergy, fwR12, fwR2, genealogy, Array2D< T >::get(), Input, isCollectingFWResults, kineticEnergy, localEnergy, move_accepted, neEnergy, QMCFlags::nuclear_derivatives, numAncestors, numFWSteps, numWarnings, p3_xxa, potentialEnergy, R, rp_a, walkerData, and weight.
double QMCWalker::getWeight | ( | ) |
Gets the weight for this walker.
Definition at line 1996 of file QMCWalker.cpp.
References weight.
Referenced by branchRecommended(), calculateObservables(), ID(), processPropagation(), reweight_walker(), and toXML().
void QMCWalker::setWeight | ( | double | val | ) |
Sets the weight for this walker.
val | value to set the weight equal to. |
Definition at line 2001 of file QMCWalker.cpp.
References weight.
Referenced by reweight_walker().
double QMCWalker::getTrailWeight | ( | double | energy | ) |
Uses the formula proposed by Trail.
bool QMCWalker::isSingular | ( | ) |
Determines if the trial wavefunction is singular for this walker.
true
if the trial wavefunction is singular for this walker, and false
otherwise. Definition at line 2550 of file QMCWalker.cpp.
References QMCWalkerData::isSingular(), and walkerData.
Referenced by calculateMoveAcceptanceProbability(), initializeWalkerPosition(), processPropagation(), and QMCRun::randomlyInitializeWalkers().
bool QMCWalker::branchRecommended | ( | ) |
Branching is only an efficiency consideration, so we should be able to choose not to branch at a particular spot and not change detailed balance.
Presumably, if we can choose not to branch at a bad spot in the trialfunction, then we can slow any tendency for the calculation to blow up.
Definition at line 1373 of file QMCWalker.cpp.
References age, QMCFlags::branching_threshold, dW, QMCFlags::energy_estimated_original, QMCInput::flags, getWeight(), globalInput, ID(), Input, iteration, QMCWalkerData::kineticEnergy, QMCFlags::limit_branching, QMCWalkerData::localEnergy, move_accepted, QMCFlags::old_walker_acceptance_parameter, QMCWalkerData::potentialEnergy, TrialWalker, and walkerData.
string QMCWalker::ID | ( | bool | showTrial | ) |
This will return a string with a short identification of this walker.
showTrail | whether to print details for the Trial walker, or for the Original walker. |
Definition at line 1462 of file QMCWalker.cpp.
References age, dW, QMCInput::flags, genealogy, getWeight(), globalInput, Input, iteration, QMCWalkerData::kineticEnergy, QMCFlags::my_rank, numAncestors, OriginalWalker, QMCWalkerData::potentialEnergy, QMCFlags::run_type, TrialWalker, and walkerData.
Referenced by branchRecommended(), calculateMoveAcceptanceProbability(), calculateObservables(), processPropagation(), and reweight_walker().
void QMCWalker::branchID | ( | ) |
void QMCWalker::newID | ( | ) |
Give the walker a fresh ID -- based on a static variable.
The ID it gets will be unique to that processor.
Definition at line 41 of file QMCWalker.cpp.
References genealogy, nextID, and numAncestors.
Referenced by QMCRun::randomlyInitializeWalkers(), and readXML().
void QMCWalker::calculateElectronDensities | ( | double | max_pair_distance, | |
double | dr, | |||
Array1D< double > & | pll_spin, | |||
Array1D< double > & | opp_spin, | |||
Array1D< Array1D< double > > & | alpha_density, | |||
Array1D< Array1D< double > > & | beta_density | |||
) |
Calculates the distance between each pair of electrons and records it in the appropriate histogram.
This will be used to evaluate pair density functions for DFT development.
Definition at line 1739 of file QMCWalker.cpp.
References QMCMolecule::Atom_Labels, QMCMolecule::Atom_Positions, Array1D< T >::dim1(), QMCInput::flags, QMCWavefunction::getNumberElectrons(), Input, QMCInput::Molecule, QMCFlags::Natoms, QMCMolecule::NucleiTypes, R, weight, and QMCInput::WF.
void QMCWalker::calculatePllCorrelationDiagram | ( | int | coord, | |
double | min, | |||
double | max, | |||
Array1D< Array1D< double > > & | CorrelationDiagram | |||
) |
Calculates the 2D correlation diagram for the x, y, or z coordinates of all the parallel spin pairs of electrons.
coord | 0, 1, or 2 depending on which coordinate we are recording | |
min | the minimum value of the coordinate | |
max | the maximum value of the coordinate | |
CorrelationDiagram | the two dimensional histogram of values |
Definition at line 1844 of file QMCWalker.cpp.
References QMCWavefunction::getNumberElectrons(), Input, R, weight, and QMCInput::WF.
void QMCWalker::calculateOppCorrelationDiagram | ( | int | coord, | |
double | min, | |||
double | max, | |||
Array1D< Array1D< double > > & | CorrelationDiagram | |||
) |
Calculates the 2D correlation diagram for the x, y, or z coordinates of all the opposite spin pairs of electrons.
coord | 0, 1, or 2 depending on which coordinate we are recording | |
min | the minimum value of the coordinate | |
max | the maximum value of the coordinate | |
CorrelationDiagram | the two dimensional histogram of values |
Definition at line 1875 of file QMCWalker.cpp.
References QMCWavefunction::getNumberElectrons(), Input, R, weight, and QMCInput::WF.
void QMCWalker::toXML | ( | ostream & | strm | ) |
Writes the state of this object to an XML stream.
strm | XML stream |
Definition at line 1896 of file QMCWalker.cpp.
References Array2D< T >::dim1(), Array2D< T >::dim2(), getAge(), getWeight(), and R.
bool QMCWalker::readXML | ( | istream & | strm, | |
QMCFunctions & | QMF | |||
) |
Loads the state of this object from an XML stream.
The input stream must be formatted exactly like the output from toXML
because it is not intelligent.
strm | XML stream |
Definition at line 1914 of file QMCWalker.cpp.
References age, Array2D< T >::dim1(), Array2D< T >::dim2(), QMCFunctions::evaluate(), newID(), R, QMCWalkerData::updateDistances(), walkerData, and weight.
Referenced by QMCRun::readXML().
double QMCWalker::getLocalEnergyEstimator | ( | ) |
Gets the value of the local energy estimator for this walker.
Definition at line 2555 of file QMCWalker.cpp.
References localEnergy.
Array2D< double > * QMCWalker::getR | ( | ) |
Gets the positions of the electrons.
Definition at line 2021 of file QMCWalker.cpp.
References R.
Referenced by QMCRun::randomlyInitializeWalkers().
bool QMCWalker::setR | ( | Array2D< double > | temp_R | ) |
Sets the positions of the electrons.
temp_R | the positions of the electrons |
Definition at line 2026 of file QMCWalker.cpp.
References Array2D< T >::dim1(), Array2D< T >::dim2(), IeeeMath::isNaN(), R, QMCWalkerData::updateDistances(), and walkerData.
Referenced by initializeWalkerPosition(), and QMCRun::randomlyInitializeWalkers().
QMCWalkerData * QMCWalker::getWalkerData | ( | ) |
Gets the walkerData for this walker.
Definition at line 2044 of file QMCWalker.cpp.
References walkerData.
Referenced by QMCRun::randomlyInitializeWalkers().
void QMCWalker::resetFutureWalking | ( | int | whichStage, | |
int | whichBlock | |||
) |
Definition at line 2513 of file QMCWalker.cpp.
References Array2D< T >::dim1(), Array2D< T >::dim2(), QMCInput::flags, fwEnergy, fwiR, fwiR12, fwKineticEnergy, fwKineticEnergy_grad, fwNormalization, fwNuclearForces, fwPotentialEnergy, fwR12, fwR2, Input, and QMCFlags::nuclear_derivatives.
void QMCWalker::resetFutureWalking | ( | ) |
Definition at line 2537 of file QMCWalker.cpp.
References ACCUM, DONE, isCollectingFWResults, and numFWSteps.
Referenced by calculateObservables(), and initialize().
void QMCWalker::setAcceptanceProbability | ( | double | p | ) | [private] |
Definition at line 2016 of file QMCWalker.cpp.
References AcceptanceProbability.
Referenced by calculateMoveAcceptanceProbability(), and initialize().
void QMCWalker::createChildWalkers | ( | ) | [private] |
Definition at line 1647 of file QMCWalker.cpp.
References AcceptanceProbability, dR2, QMCInput::flags, globalInput, QMCFlags::one_e_per_iter, OriginalWalker, QMCWalkerData::partialCopy(), QMCWalker(), R, TrialWalker, and walkerData.
Referenced by initializePropagation().
void QMCWalker::calculateMoveAcceptanceProbability | ( | double | GreensRatio | ) | [private] |
Definition at line 1530 of file QMCWalker.cpp.
References age, QMCInput::flags, ID(), Input, IeeeMath::isNaN(), isSingular(), numWarnings, QMCFlags::old_walker_acceptance_parameter, OriginalWalker, QMCWalkerData::psi, setAcceptanceProbability(), TrialWalker, walkerData, and QMCWalkerData::zero().
Referenced by processPropagation().
void QMCWalker::acceptOrRejectMove | ( | ) | [private] |
Definition at line 1613 of file QMCWalker.cpp.
References age, ageMoved, QMCInput::flags, getAcceptanceProbability(), Input, iteration, move_accepted, QMCFlags::old_walker_acceptance_parameter, ran, TrialWalker, and Random::unidev().
Referenced by processPropagation().
QMCDouble QMCWalker::moveElectrons | ( | ) | [private] |
Randomly moves the electrons to their new locations and returns the Green's function for the forward move.
whichE | -1 to move all electrons, otherwise the index of the one electron to move. |
Definition at line 264 of file QMCWalker.cpp.
References QMCFlags::dt, QMCInput::flags, Input, moveElectronsImportanceSampling(), moveElectronsNoImportanceSampling(), moveElectronsUmrigar93AcceleratedSampling(), moveElectronsUmrigar93ImportanceSampling(), R, QMCFlags::sampling_method, QMCWalkerData::updateDistances(), and walkerData.
Referenced by initializePropagation().
QMCDouble QMCWalker::moveElectronsNoImportanceSampling | ( | ) | [private] |
Randomly moves the electrons to their new locations without using importance sampling.
whichE | -1 to move all electrons, otherwise the index of the one electron to move. |
Definition at line 293 of file QMCWalker.cpp.
References Array2D< T >::dim1(), Array2D< T >::dim2(), dR2, QMCFlags::dt, QMCInput::flags, Random::gasdev(), Input, R, ran, walkerData, and QMCWalkerData::whichE.
Referenced by moveElectrons().
QMCDouble QMCWalker::moveElectronsImportanceSampling | ( | ) | [private] |
Randomly moves the electrons to their new locations using importance sampling.
whichE | -1 to move all electrons, otherwise the index of the one electron to move. |
Definition at line 323 of file QMCWalker.cpp.
References Array2D< T >::dim1(), Array2D< T >::dim2(), dR2, QMCFlags::dt, QMCInput::flags, Random::gasdev(), Input, QMCWalkerData::modifiedGradPsiRatio, pi, R, ran, walkerData, and QMCWalkerData::whichE.
Referenced by moveElectrons().
QMCDouble QMCWalker::moveElectronsUmrigar93ImportanceSampling | ( | ) | [private] |
Randomly moves the electrons to their new locations using importance sampling and the accelerated Metropolis algorithm.
whichE | -1 to move all electrons, otherwise the index of the one electron to move. |
Definition at line 380 of file QMCWalker.cpp.
References QMCMolecule::Atom_Positions, dR2, QMCFlags::dt, QMCMolecule::findClosestNucleusIndex(), QMCInput::flags, Random::gasdev(), QMCWavefunction::getNumberElectrons(), Input, QMCWalkerData::modifiedGradPsiRatio, QMCInput::Molecule, pi, R, ran, Random::randomDistribution1(), QMCWalkerData::riA, QMCWalkerData::riA_uvec, Random::sindev(), Random::unidev(), walkerData, QMCInput::WF, QMCWalkerData::whichE, and QMCMolecule::Z.
Referenced by moveElectrons().
QMCDouble QMCWalker::moveElectronsUmrigar93AcceleratedSampling | ( | ) | [private] |
whichE | -1 to move all electrons, otherwise the index of the one electron to move. |
Definition at line 574 of file QMCWalker.cpp.
References QMCFlags::accel_delta, QMCFlags::accel_tm, age, dR2, QMCMolecule::findClosestNucleusIndex(), MathFunctions::fitU(), QMCInput::flags, QMCWavefunction::getNumberElectrons(), globalInput, Input, QMCDouble::isNotValid(), QMCWalkerData::modifiedGradPsiRatio, QMCInput::Molecule, pi, R, ran, Random::randomDistribution2(), Random::randomDistribution3(), QMCWalkerData::riA, QMCWalkerData::riA_uvec, Array1D< T >::rotate(), Random::sindev(), walkerData, QMCInput::WF, QMCWalkerData::whichE, and QMCMolecule::Z.
Referenced by moveElectrons().
QMCDouble QMCWalker::calculateReverseGreensFunction | ( | ) | [private] |
Calculates the reverse Green's function for the proposed move of the electrons.
Definition at line 704 of file QMCWalker.cpp.
References calculateReverseGreensFunctionImportanceSampling(), calculateReverseGreensFunctionNoImportanceSampling(), calculateReverseGreensFunctionUmrigar93AcceleratedSampling(), calculateReverseGreensFunctionUmrigar93ImportanceSampling(), QMCFlags::dt, QMCInput::flags, Input, and QMCFlags::sampling_method.
Referenced by processPropagation().
QMCDouble QMCWalker::calculateReverseGreensFunctionNoImportanceSampling | ( | ) | [private] |
Calculates the reverse Green's function for the proposed move of the electrons when no importance sampling is used.
Definition at line 735 of file QMCWalker.cpp.
Referenced by calculateReverseGreensFunction().
QMCDouble QMCWalker::calculateReverseGreensFunctionImportanceSampling | ( | ) | [private] |
Calculates the reverse Green's function for the proposed move of the electrons when importance sampling is used.
Definition at line 741 of file QMCWalker.cpp.
References Array2D< T >::dim1(), Array2D< T >::dim2(), QMCFlags::dt, QMCInput::flags, Input, QMCWalkerData::modifiedGradPsiRatio, OriginalWalker, pi, R, TrialWalker, and walkerData.
Referenced by calculateReverseGreensFunction().
QMCDouble QMCWalker::calculateReverseGreensFunctionUmrigar93ImportanceSampling | ( | ) | [private] |
Calculates the reverse Green's function for the proposed move of the electrons when umrigar93 importance sampling is used.
Definition at line 767 of file QMCWalker.cpp.
References QMCMolecule::Atom_Positions, QMCFlags::dt, QMCMolecule::findClosestNucleusIndex(), QMCInput::flags, QMCWavefunction::getNumberElectrons(), Input, QMCWalkerData::modifiedGradPsiRatio, QMCInput::Molecule, OriginalWalker, pi, R, QMCWalkerData::riA, QMCWalkerData::riA_uvec, TrialWalker, walkerData, QMCInput::WF, QMCWalkerData::whichE, and QMCMolecule::Z.
Referenced by calculateReverseGreensFunction().
QMCDouble QMCWalker::calculateReverseGreensFunctionUmrigar93AcceleratedSampling | ( | ) | [private] |
Definition at line 912 of file QMCWalker.cpp.
References QMCFlags::accel_delta, QMCFlags::accel_tm, age, QMCMolecule::findClosestNucleusIndex(), MathFunctions::fitU(), QMCInput::flags, QMCWavefunction::getNumberElectrons(), globalInput, Input, QMCDouble::isNotValid(), QMCWalkerData::modifiedGradPsiRatio, QMCInput::Molecule, OriginalWalker, pi, QMCWalkerData::riA, QMCWalkerData::riA_uvec, TrialWalker, walkerData, QMCInput::WF, QMCWalkerData::whichE, and QMCMolecule::Z.
Referenced by calculateReverseGreensFunction().
int QMCWalker::getAge | ( | ) | [private] |
double QMCWalker::getAcceptanceProbability | ( | ) | [private] |
Definition at line 2011 of file QMCWalker.cpp.
References AcceptanceProbability.
Referenced by acceptOrRejectMove(), calculateObservables(), and reweight_walker().
void QMCWalker::reweight_walker | ( | ) | [private] |
Reweight the walker after a move.
Definition at line 1044 of file QMCWalker.cpp.
References age, QMCFlags::branching_threshold, QMCFlags::dt_effective, dW, QMCFlags::energy_estimated, QMCFlags::energy_estimated_original, QMCFlags::energy_modification_type, QMCFlags::energy_trial, QMCFlags::equilibration_steps, QMCInput::flags, getAcceptanceProbability(), getWeight(), globalInput, QMCWalkerData::gradPsiRatio, ID(), Input, IeeeMath::isNaN(), iteration, QMCWalkerData::localEnergy, QMCWalkerData::modifiedGradPsiRatio, move_accepted, OriginalWalker, QMCFlags::rel_cutoff, QMCFlags::run_type, setWeight(), TrialWalker, QMCFlags::walker_reweighting_method, and walkerData.
Referenced by processPropagation().
void QMCWalker::calculateObservables | ( | ) | [private] |
Calculates the observables for this walker.
Definition at line 2049 of file QMCWalker.cpp.
References AcceptanceProbability, ACCUM, Array1D< T >::allocate(), QMCFlags::calculate_bf_density, QMCFlags::calculate_Derivatives, QMCWalkerData::chiDensity, cs_Energies, QMCWalkerData::cs_LocalEnergy, QMCInput::cs_Parameters, QMCWalkerData::cs_Weights, cs_Weights, Array2D< T >::dim1(), Array1D< T >::dim1(), Array2D< T >::dim2(), distanceMovedAccepted, DONE, Array2D< T >::dotAllElectrons(), dR2, QMCWalkerData::eeEnergy, eeEnergy, QMCInput::flags, QMCFlags::future_walking, fwEnergy, fwiR, fwiR12, fwKineticEnergy, fwKineticEnergy_grad, fwNormalization, fwPotentialEnergy, fwR12, fwR2, QMCWavefunction::getNumberBasisFunctions(), globalInput, QMCWalkerData::gradPsiRatio, Input, ir, ir12, isCollectingFWResults, iteration, QMCWalkerData::kineticEnergy, kineticEnergy, kineticEnergy_grad, QMCWalkerData::localEnergy, localEnergy, QMCWalkerData::neEnergy, neEnergy, QMCFlags::nuclear_derivatives, QMCWalkerData::nuclearDerivatives, OriginalWalker, QMCWalkerData::p3_xxa, p3_xxa, QMCWalkerData::potentialEnergy, potentialEnergy, QMCWalkerData::psi, R, r12, r2, QMCWalkerData::rp_a, rp_a, TrialWalker, walkerData, and QMCInput::WF.
Referenced by processPropagation().
const double QMCWalker::pi = 3.14159265359 [static, private] |
Definition at line 264 of file QMCWalker.h.
Referenced by calculateReverseGreensFunctionImportanceSampling(), calculateReverseGreensFunctionUmrigar93AcceleratedSampling(), calculateReverseGreensFunctionUmrigar93ImportanceSampling(), moveElectronsImportanceSampling(), moveElectronsUmrigar93AcceleratedSampling(), and moveElectronsUmrigar93ImportanceSampling().
int QMCWalker::iteration [private] |
Definition at line 269 of file QMCWalker.h.
Referenced by acceptOrRejectMove(), branchRecommended(), calculateObservables(), ID(), processPropagation(), and reweight_walker().
double QMCWalker::tr_w_ratio [private] |
Definition at line 271 of file QMCWalker.h.
double QMCWalker::tr_w [private] |
Definition at line 272 of file QMCWalker.h.
double QMCWalker::weight [private] |
Definition at line 273 of file QMCWalker.h.
Referenced by calculateElectronDensities(), calculateOppCorrelationDiagram(), calculatePllCorrelationDiagram(), getWeight(), operator=(), QMCWalker(), readXML(), and setWeight().
int QMCWalker::age [private] |
Definition at line 274 of file QMCWalker.h.
Referenced by acceptOrRejectMove(), branchRecommended(), calculateMoveAcceptanceProbability(), calculateObservables(), calculateReverseGreensFunctionUmrigar93AcceleratedSampling(), getAge(), ID(), moveElectronsUmrigar93AcceleratedSampling(), operator=(), QMCWalker(), readXML(), and reweight_walker().
int QMCWalker::ageMoved [private] |
Definition at line 275 of file QMCWalker.h.
Referenced by acceptOrRejectMove(), calculateObservables(), operator=(), and QMCWalker().
bool QMCWalker::locationWarned [private] |
Definition at line 276 of file QMCWalker.h.
double QMCWalker::dW [private] |
Definition at line 277 of file QMCWalker.h.
Referenced by branchRecommended(), calculateObservables(), ID(), QMCWalker(), and reweight_walker().
int QMCWalker::numWarnings [private] |
Definition at line 279 of file QMCWalker.h.
Referenced by calculateMoveAcceptanceProbability(), operator=(), and QMCWalker().
const int QMCWalker::numAncestors = 5 [static, private] |
An ID and processor rank are unique identifiers for each walker.
This array will keep track of our ID as well as some number of ancestors.
This information can help track down the source of a problem.
Definition at line 287 of file QMCWalker.h.
Referenced by branchID(), ID(), newID(), and operator=().
long int QMCWalker::genealogy[numAncestors] [private] |
Definition at line 288 of file QMCWalker.h.
Referenced by branchID(), ID(), newID(), and operator=().
double QMCWalker::localEnergy [private] |
These energies are calculated by QMCWalker using the acceptance probability as opposed to those calculated by QMCFunction.
Definition at line 294 of file QMCWalker.h.
Referenced by calculateDerivatives(), calculateObservables(), getLocalEnergyEstimator(), and operator=().
double QMCWalker::kineticEnergy [private] |
double QMCWalker::kineticEnergy_grad [private] |
double QMCWalker::potentialEnergy [private] |
Array1D<double> QMCWalker::cs_Energies [private] |
Definition at line 299 of file QMCWalker.h.
Referenced by calculateObservables(), operator=(), and ~QMCWalker().
Array1D<double> QMCWalker::cs_Weights [private] |
Definition at line 300 of file QMCWalker.h.
Referenced by calculateObservables(), operator=(), and ~QMCWalker().
Array1D<double> QMCWalker::p3_xxa [private] |
Definition at line 301 of file QMCWalker.h.
Referenced by calculateDerivatives(), calculateObservables(), operator=(), and ~QMCWalker().
Array1D<double> QMCWalker::rp_a [private] |
Definition at line 302 of file QMCWalker.h.
Referenced by calculateDerivatives(), calculateObservables(), operator=(), and ~QMCWalker().
double QMCWalker::r12 [private] |
double QMCWalker::r2 [private] |
double QMCWalker::ir12 [private] |
double QMCWalker::ir [private] |
double QMCWalker::neEnergy [private] |
double QMCWalker::eeEnergy [private] |
const double QMCWalker::maxFWAsymp = 1.0 [static, private] |
Array1D<int> QMCWalker::numFWSteps [private] |
Definition at line 314 of file QMCWalker.h.
Referenced by calculateObservables(), initialize(), operator=(), resetFutureWalking(), and ~QMCWalker().
Array2D<fwStage> QMCWalker::isCollectingFWResults [private] |
Definition at line 318 of file QMCWalker.h.
Referenced by calculateObservables(), initialize(), operator=(), resetFutureWalking(), and ~QMCWalker().
Array2D<double> QMCWalker::fwNormalization [private] |
Definition at line 333 of file QMCWalker.h.
Referenced by calculateObservables(), initialize(), operator=(), resetFutureWalking(), and ~QMCWalker().
Array2D<double> QMCWalker::fwEnergy [private] |
Definition at line 334 of file QMCWalker.h.
Referenced by calculateObservables(), initialize(), operator=(), resetFutureWalking(), and ~QMCWalker().
Array2D<double> QMCWalker::fwKineticEnergy [private] |
Definition at line 335 of file QMCWalker.h.
Referenced by calculateObservables(), initialize(), operator=(), resetFutureWalking(), and ~QMCWalker().
Array2D<double> QMCWalker::fwKineticEnergy_grad [private] |
Definition at line 336 of file QMCWalker.h.
Referenced by calculateObservables(), initialize(), operator=(), resetFutureWalking(), and ~QMCWalker().
Array2D<double> QMCWalker::fwPotentialEnergy [private] |
Definition at line 337 of file QMCWalker.h.
Referenced by calculateObservables(), initialize(), operator=(), resetFutureWalking(), and ~QMCWalker().
Array2D<double> QMCWalker::fwR12 [private] |
Definition at line 338 of file QMCWalker.h.
Referenced by calculateObservables(), initialize(), operator=(), resetFutureWalking(), and ~QMCWalker().
Array2D<double> QMCWalker::fwR2 [private] |
Definition at line 339 of file QMCWalker.h.
Referenced by calculateObservables(), initialize(), operator=(), resetFutureWalking(), and ~QMCWalker().
Array2D<double> QMCWalker::fwiR12 [private] |
Definition at line 340 of file QMCWalker.h.
Referenced by calculateObservables(), initialize(), operator=(), resetFutureWalking(), and ~QMCWalker().
Array2D<double> QMCWalker::fwiR [private] |
Definition at line 341 of file QMCWalker.h.
Referenced by calculateObservables(), initialize(), operator=(), resetFutureWalking(), and ~QMCWalker().
Array2D< Array2D<double> > QMCWalker::fwNuclearForces [private] |
Definition at line 344 of file QMCWalker.h.
Referenced by calculateObservables(), initialize(), operator=(), resetFutureWalking(), and ~QMCWalker().
double QMCWalker::distanceMovedAccepted [private] |
double QMCWalker::AcceptanceProbability [private] |
Definition at line 348 of file QMCWalker.h.
Referenced by calculateObservables(), createChildWalkers(), getAcceptanceProbability(), operator=(), processPropagation(), and setAcceptanceProbability().
QMCWalkerData QMCWalker::walkerData [private] |
walkerData is meant to hold all the necessary data given by a QMCFunction to complete the iteration.
Definition at line 354 of file QMCWalker.h.
Referenced by branchRecommended(), calculateMoveAcceptanceProbability(), calculateObservables(), calculateReverseGreensFunctionImportanceSampling(), calculateReverseGreensFunctionUmrigar93AcceleratedSampling(), calculateReverseGreensFunctionUmrigar93ImportanceSampling(), createChildWalkers(), getWalkerData(), ID(), initialize(), initializePropagation(), initializeWalkerPosition(), isSingular(), moveElectrons(), moveElectronsImportanceSampling(), moveElectronsNoImportanceSampling(), moveElectronsUmrigar93AcceleratedSampling(), moveElectronsUmrigar93ImportanceSampling(), operator=(), processPropagation(), readXML(), reweight_walker(), and setR().
QMCDouble QMCWalker::forwardGreensFunction [private] |
This data is simply meant to carry the forwardGreensFunction between the 2 propagate walker functions.
Definition at line 360 of file QMCWalker.h.
Referenced by initializePropagation(), and processPropagation().
Array2D<double> QMCWalker::R [private] |
Definition at line 362 of file QMCWalker.h.
Referenced by calculateElectronDensities(), calculateObservables(), calculateOppCorrelationDiagram(), calculatePllCorrelationDiagram(), calculateReverseGreensFunctionImportanceSampling(), calculateReverseGreensFunctionUmrigar93ImportanceSampling(), createChildWalkers(), getR(), initialize(), initializePropagation(), initializeWalkerPosition(), moveElectrons(), moveElectronsImportanceSampling(), moveElectronsNoImportanceSampling(), moveElectronsUmrigar93AcceleratedSampling(), moveElectronsUmrigar93ImportanceSampling(), operator=(), processPropagation(), readXML(), setR(), toXML(), and ~QMCWalker().
double QMCWalker::dR2 [private] |
Definition at line 365 of file QMCWalker.h.
Referenced by calculateObservables(), createChildWalkers(), moveElectronsImportanceSampling(), moveElectronsNoImportanceSampling(), moveElectronsUmrigar93AcceleratedSampling(), moveElectronsUmrigar93ImportanceSampling(), operator=(), processPropagation(), and QMCWalker().
QMCWalker* QMCWalker::TrialWalker [private] |
Definition at line 367 of file QMCWalker.h.
Referenced by acceptOrRejectMove(), branchRecommended(), calculateMoveAcceptanceProbability(), calculateObservables(), calculateReverseGreensFunctionImportanceSampling(), calculateReverseGreensFunctionUmrigar93AcceleratedSampling(), calculateReverseGreensFunctionUmrigar93ImportanceSampling(), createChildWalkers(), ID(), initializePropagation(), processPropagation(), QMCWalker(), reweight_walker(), and ~QMCWalker().
QMCWalker* QMCWalker::OriginalWalker [private] |
Definition at line 368 of file QMCWalker.h.
Referenced by calculateMoveAcceptanceProbability(), calculateObservables(), calculateReverseGreensFunctionImportanceSampling(), calculateReverseGreensFunctionUmrigar93AcceleratedSampling(), calculateReverseGreensFunctionUmrigar93ImportanceSampling(), createChildWalkers(), ID(), initializePropagation(), processPropagation(), QMCWalker(), reweight_walker(), and ~QMCWalker().
bool QMCWalker::move_accepted [private] |
Definition at line 370 of file QMCWalker.h.
Referenced by acceptOrRejectMove(), branchRecommended(), calculateObservables(), operator=(), processPropagation(), and reweight_walker().
QMCInput* QMCWalker::Input [private] |
Definition at line 372 of file QMCWalker.h.
Referenced by acceptOrRejectMove(), branchRecommended(), calculateDerivatives(), calculateElectronDensities(), calculateMoveAcceptanceProbability(), calculateObservables(), calculateOppCorrelationDiagram(), calculatePllCorrelationDiagram(), calculateReverseGreensFunction(), calculateReverseGreensFunctionImportanceSampling(), calculateReverseGreensFunctionUmrigar93AcceleratedSampling(), calculateReverseGreensFunctionUmrigar93ImportanceSampling(), ID(), initialize(), initializePropagation(), initializeWalkerPosition(), moveElectrons(), moveElectronsImportanceSampling(), moveElectronsNoImportanceSampling(), moveElectronsUmrigar93AcceleratedSampling(), moveElectronsUmrigar93ImportanceSampling(), operator=(), resetFutureWalking(), reweight_walker(), and ~QMCWalker().
long int QMCWalker::nextID = 0 [static, protected] |
We need a static variable so that we can assign unique IDs to each walker as they are created.
Definition at line 472 of file QMCWalker.h.
Referenced by branchID(), and newID().