QMCWavefunction Class Reference

The coefficients and parameters describing the trial wavefunction for the system. More...

#include <QMCWavefunction.h>

List of all members.

Public Member Functions

 QMCWavefunction ()
 Creates an instance of the class.
int getNumberOrbitals ()
 Gets the number of orbitals total, including ones that are not used.
int getNumberOrbitals (bool isAlpha)
 Gets the number of orbitals used.
int getNumberOrbitals (Array2D< int > &Occupation)
 Gets the number of orbitals.
int getNumberActiveOrbitals ()
 The number of active orbitals is the number actually used.
int getNumberActiveOrbitals (Array2D< int > &Occupation)
 The number of unique orbitals used in all CI determinants, for a given spin.
int getNumberBasisFunctions ()
 Gets the number of basis functions.
int getNumberElectrons (bool isAlpha)
 Gets the number of $isAlpha$ spin electrons.
int getNumberElectrons ()
 Gets the total number of electrons.
int getNumberDeterminants ()
 Gets the number of determinants in the SCF wavefunction.
int getUnusedIndicator ()
 This function indicates whether the occupation arrays use -1 or 0 to indicate an unused orbital.
void makeCoefficients (Array2D< int > &TypeOccupations, Array2D< qmcfloat > &AllCoeffs, Array2D< int > &TypeIndices, Array2D< qmcfloat > &TypeCoeffs, Array2D< int > &TypeSwaps)
 Break apart the OrbitalCoeffs array into individual AlphaCoeffs and BetaCoeffs matrices, also counting the orbital indices.
Array2D< qmcfloat > * getCoeff (bool isAlpha)
 Return a matrix with all the coefficients Since we broke apart the matrices, this is how we request them.
Array2D< int > * getOccupations (bool isAlpha)
Array2D< int > * getDeterminantSwaps (bool isAlpha)
template<class T>
void getDataForCI (int ci, bool isAlpha, Array2D< T > &from, Array2D< double > &to)
 Break apart all the orbital data into individual determinant data.
void scaleCoeffs (double factor)
 This scales all the values in the orbitals by a constant factor.
QMCWavefunction operator= (const QMCWavefunction &rhs)
 Sets two QMCWavefunction objects equal.
void read (int charge, int numberOrbitals, int numberBasisFunctions, int numberDeterminants, string functionType, string runfile)
 Loads the state of the object from a file.
int getNumberCIParameters ()
 The number of optimizable CI parameters.
int getNumberORParameters ()
 The number of optimizable orbital coefficients.
void getCIParameters (Array1D< double > &params, int shift)
 Fill the params array with the current CI parameters, starting at the shift position.
void getORParameters (Array1D< double > &params, int shift)
 Fill the params array with the current orbitals parameters, starting at the shift position.
void setCIParameters (Array1D< double > &params, int shift)
 Replace the current CI parameters with our new values.
double getCINorm ()
 The sum of the squares of the CI coefficients.
void normalizeCI ()
 Normalize the CI coefficients so that the sum of the squares of the CI coefficients = 1.0.
void setORParameters (Array1D< double > &params, int shift)
 Replace the current orbital parameters with our new values.

Public Attributes

Array2D< qmcfloatOrbitalCoeffs
 Array containing the coefficients used to construct the alpha orbitals.
Array1D< int > OR_constraints
int numORIndependent
Array1D< double > CI_coeffs
 Array containing the CI coefficients for a multideterminant wavefunction.
Array1D< int > CI_constraints
int numCIIndependent
Array2D< int > AlphaOccupation
 Array which indicates how many $\alpha$ spin electron are in each orbital for each determinant.
Array2D< int > AlphaSwaps
 A data structure indicating a series of orbital updates used to update determinant ci-1 into determinant ci.
Array2D< int > BetaOccupation
 Array which indicates how many $\beta$ spin electron are in each orbital for each determinant.
Array2D< int > BetaSwaps
 A data structure indicating a series of orbital updates used to update determinant ci-1 into determinant ci.

Private Member Functions

void sortOccupations (bool ordered)
 This function will convert the orbital occupation arrays into one of two formats.
void unlinkOrbitals ()
 This function will convert a restricted wavefunction into an unrestricted one by duplicating any orbitals that are shared between alpha and beta electrons.
void unlinkDeterminants ()
 This function will duplicate orbitals so that no same spin determinants share orbitals.

Private Attributes

int Norbitals
int Nbasisfunc
int Nalpha
int Nbeta
int Ncharge
int Nelectrons
int Ndeterminants
double factor
string trialFunctionType
int unusedIndicator
Array2D< qmcfloatAlphaCoeffs
 A matrix with all the orbital coefficients used by all determinants used by Alpha electrons.
Array2D< int > AlphaOrbitals
 This matrix indicates which orbitals are used by each CI.
Array2D< qmcfloatBetaCoeffs
Array2D< int > BetaOrbitals

Friends

istream & operator>> (istream &strm, QMCWavefunction &rhs)
 Loads the state of the object from an input stream.
ostream & operator<< (ostream &strm, QMCWavefunction &rhs)
 Writes the state of the object to an output stream.


Detailed Description

The coefficients and parameters describing the trial wavefunction for the system.

These are the coefficients for a wavefunction obtained through standard means (RHF, UHF, MCSCF, DFT, etc).

Definition at line 31 of file QMCWavefunction.h.


Constructor & Destructor Documentation

QMCWavefunction::QMCWavefunction (  ) 

Creates an instance of the class.

Definition at line 17 of file QMCWavefunction.cpp.

References factor, Nalpha, Nbasisfunc, Nbeta, Ncharge, Ndeterminants, Nelectrons, Norbitals, trialFunctionType, and unusedIndicator.


Member Function Documentation

void QMCWavefunction::sortOccupations ( bool  ordered  )  [private]

This function will convert the orbital occupation arrays into one of two formats.

If unordered, the original setting, then a determinant will indicate that it uses a particular orbital with a 1, and 0 otherwise.

If ordered, then a determinant will indicate that it uses a particular orbital with the index that it will show up in for that particular determinant, and -1 otherwise.

The ordered format is required for optimizing the orbitals.

When the wavefunction is printed, it will be autoamtically converted to the unordered format.

Definition at line 125 of file QMCWavefunction.cpp.

References AlphaOccupation, BetaOccupation, getUnusedIndicator(), Ndeterminants, Norbitals, and unusedIndicator.

Referenced by read().

void QMCWavefunction::unlinkOrbitals (  )  [private]

This function will convert a restricted wavefunction into an unrestricted one by duplicating any orbitals that are shared between alpha and beta electrons.

It can not be undone.

Print out the occupation arrays to clarify what this is doing.

Definition at line 157 of file QMCWavefunction.cpp.

References AlphaOccupation, BetaOccupation, Nbasisfunc, Ndeterminants, Norbitals, OrbitalCoeffs, Array2D< T >::setRows(), and unusedIndicator.

Referenced by read().

void QMCWavefunction::unlinkDeterminants (  )  [private]

This function will duplicate orbitals so that no same spin determinants share orbitals.

It can not be undone.

Print out the occupation arrays to clarify what this is doing.

Definition at line 225 of file QMCWavefunction.cpp.

References AlphaOccupation, BetaOccupation, Nbasisfunc, Ndeterminants, Norbitals, OrbitalCoeffs, Array2D< T >::setRows(), and unusedIndicator.

Referenced by read().

int QMCWavefunction::getNumberOrbitals (  ) 

int QMCWavefunction::getNumberOrbitals ( bool  isAlpha  )  [inline]

Gets the number of orbitals used.

Parameters:
alpha or beta electrons?
Returns:
number of orbitals.

Definition at line 125 of file QMCWavefunction.h.

References AlphaCoeffs, and BetaCoeffs.

int QMCWavefunction::getNumberOrbitals ( Array2D< int > &  Occupation  ) 

Gets the number of orbitals.

Parameters:
Occupation where to count orbitals
Returns:
number of orbitals.

Definition at line 36 of file QMCWavefunction.cpp.

References Array1D< T >::dim1(), Array2D< T >::dim1(), Array2D< T >::dim2(), and unusedIndicator.

int QMCWavefunction::getNumberActiveOrbitals (  ) 

The number of active orbitals is the number actually used.

This number might be useful to prevent calculating unneeded data.

Returns:
number of active orbitals.

Definition at line 56 of file QMCWavefunction.cpp.

References AlphaOccupation, BetaOccupation, Ndeterminants, Norbitals, and unusedIndicator.

Referenced by makeCoefficients(), and read().

int QMCWavefunction::getNumberActiveOrbitals ( Array2D< int > &  Occupation  ) 

The number of unique orbitals used in all CI determinants, for a given spin.

Parameters:
Occupation a spin-dependent table
Returns:
number of active orbitals.

Definition at line 75 of file QMCWavefunction.cpp.

References Ndeterminants, Norbitals, and unusedIndicator.

int QMCWavefunction::getNumberBasisFunctions (  ) 

int QMCWavefunction::getNumberElectrons ( bool  isAlpha  ) 

Gets the number of $isAlpha$ spin electrons.

Returns:
number of $isAlpha$ spin electrons.

Definition at line 96 of file QMCWavefunction.cpp.

References Nalpha, and Nbeta.

Referenced by QMCSCFJastrow::calculate_CorrelatedSampling(), QMCSCFJastrow::calculate_JastrowDerivatives(), QMCSCFJastrow::calculate_Psi_quantities(), QMCWalker::calculateElectronDensities(), QMCRun::calculateElectronDensities(), QMCWalker::calculateOppCorrelationDiagram(), QMCWalker::calculatePllCorrelationDiagram(), QMCWalker::calculateReverseGreensFunctionUmrigar93AcceleratedSampling(), QMCWalker::calculateReverseGreensFunctionUmrigar93ImportanceSampling(), QMCManager::checkMaxStepsTerminationCriteria(), QMCJastrowElectronNuclear::evaluate(), QMCPotential_Energy::evaluatePsuedoPotential(), QMCManager::gatherHistograms(), QMCWalkerData::initialize(), QMCWalker::initialize(), QMCSCFJastrow::initialize(), QMCRun::initialize(), QMCReadAndEvaluateConfigs::initialize(), QMCJastrowElectronNuclear::initialize(), QMCJastrowElectronElectron::initialize(), QMCJastrow::initialize(), QMCHartreeFock::Initialize(), QMCMikesBetterWalkerInitialization::initializeBunchOfWalkersPosition(), QMCThreeBodyCorrelationFunctionParameters::initializeThreeBodyCorrelationFunctionParameters(), QMCMikesJackedWalkerInitialization::initializeWalkerPosition(), QMCMikesBetterWalkerInitialization::initializeWalkerPosition(), QMCDansWalkerInitialization::initializeWalkerPosition(), QMCAmosBoringWalkerInitialization::initializeWalkerPosition(), QMCSurfer::interparticleDistanceMatrix(), QMCThreeBodyJastrow::jastrowOnGrid(), QMCJastrowElectronNuclear::jastrowOnGrid(), QMCJastrowElectronElectron::jastrowOnGrid(), QMCWalker::moveElectronsUmrigar93AcceleratedSampling(), QMCWalker::moveElectronsUmrigar93ImportanceSampling(), QMCMikesBetterWalkerInitialization::ObjectiveFunctionForWalkers(), QMCThreeBodyJastrow::packageDerivatives(), QMCInput::read(), QMCRun::step(), QMCSurfer::surfaceExplorer(), QMCThreeBodyCorrelationFunctionParameters::totalDerivativesToFree(), QMCThreeBodyJastrow::updateAll(), QMCJastrowElectronElectron::updateAll(), QMCRun::updateHFPotential(), QMCThreeBodyJastrow::updateOne(), QMCJastrowElectronElectron::updateOne(), and QMCManager::writeElectronDensityHistograms().

int QMCWavefunction::getNumberElectrons (  ) 

Gets the total number of electrons.

Returns:
total number of electrons.

Definition at line 104 of file QMCWavefunction.cpp.

References Nelectrons.

Referenced by read().

int QMCWavefunction::getNumberDeterminants (  ) 

int QMCWavefunction::getUnusedIndicator (  ) 

This function indicates whether the occupation arrays use -1 or 0 to indicate an unused orbital.

Definition at line 120 of file QMCWavefunction.cpp.

References unusedIndicator.

Referenced by QMCDansWalkerInitialization::assign_electrons_to_nuclei(), QMCSCFJastrow::calculate_OrbitalDerivatives(), QMCMikesJackedWalkerInitialization::electrons_and_radii(), QMCNuclearForces::getDensities(), and sortOccupations().

void QMCWavefunction::makeCoefficients ( Array2D< int > &  TypeOccupations,
Array2D< qmcfloat > &  AllCoeffs,
Array2D< int > &  TypeIndices,
Array2D< qmcfloat > &  TypeCoeffs,
Array2D< int > &  TypeSwaps 
)

Break apart the OrbitalCoeffs array into individual AlphaCoeffs and BetaCoeffs matrices, also counting the orbital indices.

Definition at line 857 of file QMCWavefunction.cpp.

References Array2D< T >::allocate(), Array1D< T >::dim1(), Array2D< T >::dim1(), getNumberActiveOrbitals(), getNumberOrbitals(), Nbasisfunc, Ndeterminants, OrbitalCoeffs, Array2D< T >::setRows(), and unusedIndicator.

Referenced by read(), and setORParameters().

Array2D< qmcfloat > * QMCWavefunction::getCoeff ( bool  isAlpha  ) 

Return a matrix with all the coefficients Since we broke apart the matrices, this is how we request them.

Definition at line 827 of file QMCWavefunction.cpp.

References AlphaCoeffs, and BetaCoeffs.

Referenced by QMCSlater::evaluate(), QMCPotential_Energy::evaluatePsuedoPotential(), QMCSlater::initialize(), and QMCPotential_Energy::initialize().

Array2D< int > * QMCWavefunction::getOccupations ( bool  isAlpha  ) 

Definition at line 837 of file QMCWavefunction.cpp.

References AlphaOrbitals, and BetaOrbitals.

Referenced by QMCSlater::calculate_DerivativeRatios().

Array2D< int > * QMCWavefunction::getDeterminantSwaps ( bool  isAlpha  ) 

Definition at line 847 of file QMCWavefunction.cpp.

References AlphaSwaps, and BetaSwaps.

Referenced by QMCSlater::calculate_DerivativeRatios().

template<class T>
void QMCWavefunction::getDataForCI ( int  ci,
bool  isAlpha,
Array2D< T > &  from,
Array2D< double > &  to 
) [inline]

Break apart all the orbital data into individual determinant data.

Will convert to double precision at this stage.

Parameters:
from the matrix representing all determinants
to the matrix where the desired determinantal data will be put

Definition at line 215 of file QMCWavefunction.h.

References AlphaOrbitals, BetaOrbitals, Array2D< T >::dim1(), Array2D< T >::dim2(), and Array2D< T >::get().

Referenced by QMCSlater::calculate_DerivativeRatios(), QMCPotential_Energy::evaluatePsuedoPotential(), and QMCSlater::update_Ds().

void QMCWavefunction::scaleCoeffs ( double  factor  ) 

This scales all the values in the orbitals by a constant factor.

Since the wavefunction does not have to be normalized in a QMC wavefunction, this will not change anything.

Numerically however, the calculation may perform better if scaled such that the value of the wavefunction is near 1.0.

Definition at line 114 of file QMCWavefunction.cpp.

References factor, and OrbitalCoeffs.

QMCWavefunction QMCWavefunction::operator= ( const QMCWavefunction rhs  ) 

Sets two QMCWavefunction objects equal.

Parameters:
rhs object to set this object equal to.

Definition at line 292 of file QMCWavefunction.cpp.

References AlphaOccupation, BetaOccupation, CI_coeffs, CI_constraints, Nalpha, Nbasisfunc, Nbeta, Ndeterminants, Nelectrons, Norbitals, numCIIndependent, OrbitalCoeffs, and trialFunctionType.

void QMCWavefunction::read ( int  charge,
int  numberOrbitals,
int  numberBasisFunctions,
int  numberDeterminants,
string  functionType,
string  runfile 
)

int QMCWavefunction::getNumberCIParameters (  ) 

int QMCWavefunction::getNumberORParameters (  ) 

The number of optimizable orbital coefficients.

Definition at line 725 of file QMCWavefunction.cpp.

References QMCInput::flags, globalInput, numORIndependent, and QMCFlags::optimize_Orbitals.

Referenced by QMCInput::getNumberAIParameters(), QMCInput::printAIParameters(), and QMCInput::printAISummary().

void QMCWavefunction::getCIParameters ( Array1D< double > &  params,
int  shift 
)

Fill the params array with the current CI parameters, starting at the shift position.

Definition at line 676 of file QMCWavefunction.cpp.

References CI_coeffs, CI_constraints, getNumberCIParameters(), and getNumberDeterminants().

Referenced by QMCInput::getAIParameters().

void QMCWavefunction::getORParameters ( Array1D< double > &  params,
int  shift 
)

Fill the params array with the current orbitals parameters, starting at the shift position.

Definition at line 733 of file QMCWavefunction.cpp.

References AlphaOccupation, BetaOccupation, QMCInput::flags, getNumberBasisFunctions(), getNumberDeterminants(), getNumberOrbitals(), globalInput, QMCFlags::optimize_Orbitals, OR_constraints, OrbitalCoeffs, and unusedIndicator.

Referenced by QMCInput::getAIParameters().

void QMCWavefunction::setCIParameters ( Array1D< double > &  params,
int  shift 
)

Replace the current CI parameters with our new values.

The shift variable tells us where in the array to look.

Definition at line 692 of file QMCWavefunction.cpp.

References CI_coeffs, CI_constraints, getNumberCIParameters(), and getNumberDeterminants().

Referenced by QMCInput::setAIParameters().

double QMCWavefunction::getCINorm (  ) 

The sum of the squares of the CI coefficients.

Definition at line 713 of file QMCWavefunction.cpp.

References CI_coeffs, and Array1D< T >::mag().

Referenced by QMCCorrelatedSamplingVMCOptimization::optimize().

void QMCWavefunction::normalizeCI (  ) 

Normalize the CI coefficients so that the sum of the squares of the CI coefficients = 1.0.

This affects nothing, except it helps humans examine the coefficients.

Definition at line 718 of file QMCWavefunction.cpp.

References CI_coeffs, Array1D< T >::mag(), and Ndeterminants.

Referenced by QMCCorrelatedSamplingVMCOptimization::optimize().

void QMCWavefunction::setORParameters ( Array1D< double > &  params,
int  shift 
)


Friends And Related Function Documentation

istream& operator>> ( istream &  strm,
QMCWavefunction rhs 
) [friend]

Loads the state of the object from an input stream.

Definition at line 310 of file QMCWavefunction.cpp.

ostream& operator<< ( ostream &  strm,
QMCWavefunction rhs 
) [friend]

Writes the state of the object to an output stream.

Definition at line 582 of file QMCWavefunction.cpp.


Member Data Documentation

int QMCWavefunction::Nalpha [private]

Definition at line 36 of file QMCWavefunction.h.

Referenced by getNumberElectrons(), operator=(), operator>>(), and QMCWavefunction().

int QMCWavefunction::Nbeta [private]

Definition at line 37 of file QMCWavefunction.h.

Referenced by getNumberElectrons(), operator=(), operator>>(), and QMCWavefunction().

int QMCWavefunction::Ncharge [private]

Definition at line 38 of file QMCWavefunction.h.

Referenced by operator>>(), QMCWavefunction(), and read().

Definition at line 39 of file QMCWavefunction.h.

Referenced by getNumberElectrons(), operator=(), operator>>(), and QMCWavefunction().

double QMCWavefunction::factor [private]

Definition at line 41 of file QMCWavefunction.h.

Referenced by QMCWavefunction(), and scaleCoeffs().

Definition at line 42 of file QMCWavefunction.h.

Referenced by operator<<(), operator=(), operator>>(), QMCWavefunction(), and read().

A matrix with all the orbital coefficients used by all determinants used by Alpha electrons.

Dimensions numActiveOrbitals x numBF

Definition at line 51 of file QMCWavefunction.h.

Referenced by getCoeff(), getNumberOrbitals(), read(), and setORParameters().

This matrix indicates which orbitals are used by each CI.

Dimensions numCI x numOrbitals

Definition at line 57 of file QMCWavefunction.h.

Referenced by getDataForCI(), getOccupations(), read(), and setORParameters().

Definition at line 59 of file QMCWavefunction.h.

Referenced by getCoeff(), getNumberOrbitals(), read(), and setORParameters().

Definition at line 60 of file QMCWavefunction.h.

Referenced by getDataForCI(), getOccupations(), read(), and setORParameters().

Array containing the coefficients used to construct the alpha orbitals.

For example, orbitals are constructed so that

\[ Orbital_{i}(x,y,z) = \sum_{j=0}^{NumberBasisFunctions-1} Coeffs_{i,j} BasisFunction_{j}(x,y,z) \]

where the the $BasisFunction_{j}(x,y,z)$ are from QMCBasisFunction. It is assumed that the ordering of the coefficients is the same as the basisfunctions in the input file. If the trial wavefunction is restricted, the alpha and beta orbitals will be identical.

Definition at line 264 of file QMCWavefunction.h.

Referenced by QMCDansWalkerInitialization::assign_electrons_to_nuclei(), QMCMikesJackedWalkerInitialization::electrons_and_radii(), QMCNuclearForces::getDensities(), getORParameters(), QMCWalkerData::initialize(), makeCoefficients(), operator<<(), operator=(), operator>>(), read(), scaleCoeffs(), setORParameters(), unlinkDeterminants(), unlinkOrbitals(), and QMCPsiPotential::UseWavefunction().

Definition at line 266 of file QMCWavefunction.h.

Referenced by getNumberORParameters(), and read().

Definition at line 273 of file QMCWavefunction.h.

Referenced by getNumberCIParameters(), operator=(), and operator>>().

A data structure indicating a series of orbital updates used to update determinant ci-1 into determinant ci.

Definition at line 286 of file QMCWavefunction.h.

Referenced by getDeterminantSwaps(), read(), and setORParameters().

A data structure indicating a series of orbital updates used to update determinant ci-1 into determinant ci.

Definition at line 300 of file QMCWavefunction.h.

Referenced by getDeterminantSwaps(), read(), and setORParameters().


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