#include <QMCNuclearForces.h>
Public Member Functions | |
QMCNuclearForces () | |
Creates an instance of the class. | |
~QMCNuclearForces () | |
void | initialize (QMCInput *input) |
Initialize the object. | |
void | evaluate (Array1D< QMCWalkerData * > &walkerData, Array1D< Array2D< double > * > &xData, int num) |
This is the function that will be evaluated for each sampling. | |
void | evaluate (QMCWalkerData &walkerData, Array2D< double > &xData) |
This is the function that is probably only going to be called during initialization. | |
double | getTemperTerm (int nuc, int q, double r) |
void | calcCoefficients (int whichNucleus) |
As described in CCZ05, we will be using a polynomial as a part of the tempering term used to calculate the force in Eq. | |
void | waveMemorization (int whichNucleus, int numKnots, double radialCutoff) |
This function is only called when we're using the Slater modification described in Eq. | |
void | calculateNuclearContributions () |
Since the force terms that depend upon 2 nuclei don't change in a calculation, we only want to calculate them once. | |
void | getDensities (Array2D< double > &X, Array1D< qmcfloat > &densities) |
For a series of electronic coordinates, this function will calculate the density. | |
void | printCubeLengths (Array2D< double > &points) |
A debugging function. | |
void | printPoints (Array2D< double > &points) |
A debugging function. | |
void | generateCube (Array2D< double > &cube, double length) |
This will create a cube centered at the origin. | |
void | randomlyRotate (Array2D< double > &points, double scale) |
This will take the cube centered at the origin and give it a random rotation preserving the distance between the vertices as well as the center. | |
void | operator= (const QMCNuclearForces &rhs) |
Sets two QMCNuclearForces objects equal. | |
Static Public Member Functions | |
static int | getNumBins () |
This is an arbitrary choice, so it can be static. | |
Private Attributes | |
QMCInput * | Input |
QMCBasisFunction * | BF |
QMCWavefunction * | WF |
double | fittingWeightM |
This is the m parameter 'm' used in CCZ05. | |
double | numSamplesPerArea |
We want to know how many sample points per unit area on the surface of the shell to use for each knot point. | |
Array1D< int > | numPolyBasisF |
This is the basis set size 'M' from CCZ05. | |
Array2D< Array1D< double > > | basisCoeffs |
These are the coefficients c_k or a_k for the basis set. | |
Array1D< Array1D< double > > | radialPoints |
These are the knot's radial values for each nucleus. | |
Array2D< Array1D< double > > | waveValuesHF |
The memorized wavefunction as decomposed into s, px, py, and pz contributions. | |
Array2D< CubicSpline > | waveValuesHFSpline |
This is the interpolating waveValuesHF. | |
Array2D< double > | nucleusContributions |
The precalculated nucleus contributions to the force. | |
Array2D< qmcfloat > | orbitals |
Temp variable used by getDensities. | |
Array2D< qmcfloat > | Chi |
Temp variable used by getDensities. | |
CubicSpline | spliner |
Eventually, we probably want to remove this guy. |
This is essentially a port from the fortran code graciously provided by Simone Chiesa as used in S. Chiesa, D.M. Ceperley, and S. Zhang, Phys. Rev. Lett. 94, 036404 (2005)
Definition at line 29 of file QMCNuclearForces.h.
QMCNuclearForces::QMCNuclearForces | ( | ) |
QMCNuclearForces::~QMCNuclearForces | ( | ) |
Definition at line 13 of file QMCNuclearForces.cpp.
References basisCoeffs, Array1D< T >::deallocate(), Array2D< T >::deallocate(), Array2D< T >::dim1(), Array1D< T >::dim1(), Array2D< T >::dim2(), nucleusContributions, numPolyBasisF, orbitals, radialPoints, waveValuesHF, and waveValuesHFSpline.
void QMCNuclearForces::initialize | ( | QMCInput * | input | ) |
Initialize the object.
input | data input to control the calculation |
Definition at line 35 of file QMCNuclearForces.cpp.
References Array2D< T >::allocate(), Array1D< T >::allocate(), QMCMolecule::Atom_Labels, basisCoeffs, QMCInput::BF, BF, calcCoefficients(), calculateNuclearContributions(), Array1D< T >::dim1(), CubicSpline::evaluate(), fittingWeightM, QMCInput::flags, CubicSpline::getFunctionValue(), QMCMolecule::getNumberAtoms(), getTemperTerm(), CubicSpline::initializeWithFunctionValues(), Input, CubicSpline::integrate(), QMCInput::Molecule, QMCFlags::nuclear_derivatives, numPolyBasisF, numSamplesPerArea, radialPoints, spliner, waveValuesHF, waveValuesHFSpline, QMCInput::WF, and WF.
Referenced by QMCSCFJastrow::initialize().
void QMCNuclearForces::evaluate | ( | Array1D< QMCWalkerData * > & | walkerData, | |
Array1D< Array2D< double > * > & | xData, | |||
int | num | |||
) |
This is the function that will be evaluated for each sampling.
It will calculate the force for several walkers at the same time.
X | dimensional configuration of electrons represented by a matrix |
Definition at line 225 of file QMCNuclearForces.cpp.
References QMCMolecule::Atom_Labels, QMCMolecule::Atom_Positions, Array1D< T >::dim1(), QMCInput::flags, QMCMolecule::getNumberAtoms(), getNumBins(), getTemperTerm(), Input, QMCInput::Molecule, QMCFlags::nuclear_derivatives, nucleusContributions, radialPoints, and QMCMolecule::Z.
Referenced by QMCSCFJastrow::evaluate(), and evaluate().
void QMCNuclearForces::evaluate | ( | QMCWalkerData & | walkerData, | |
Array2D< double > & | xData | |||
) |
This is the function that is probably only going to be called during initialization.
X | dimensional configuration of electrons represented by a matrix |
Definition at line 168 of file QMCNuclearForces.cpp.
References Array1D< T >::deallocate(), and evaluate().
double QMCNuclearForces::getTemperTerm | ( | int | nuc, | |
int | q, | |||
double | r | |||
) |
Definition at line 179 of file QMCNuclearForces.cpp.
References basisCoeffs, Array2D< T >::dim1(), Array1D< T >::dim1(), fittingWeightM, QMCInput::flags, Input, QMCFlags::nuclear_derivatives, radialPoints, and waveValuesHFSpline.
Referenced by evaluate(), and initialize().
void QMCNuclearForces::calcCoefficients | ( | int | whichNucleus | ) |
As described in CCZ05, we will be using a polynomial as a part of the tempering term used to calculate the force in Eq.
6. This function is called as a part of the initialization and calculates the coefficients of the polynomial.
It will also call waveMemorization if we will be using Eq. 9.
Definition at line 307 of file QMCNuclearForces.cpp.
References basisCoeffs, Array2D< T >::deallocate(), Array2D< T >::determinant_and_inverse(), Array1D< T >::dim1(), fastPower(), fittingWeightM, QMCInput::flags, Array2D< T >::gemm(), CubicSpline::initializeWithFunctionValues(), Input, CubicSpline::integrate(), QMCFlags::nuclear_derivatives, numPolyBasisF, radialPoints, spliner, waveMemorization(), and waveValuesHF.
Referenced by initialize().
void QMCNuclearForces::waveMemorization | ( | int | whichNucleus, | |
int | numKnots, | |||
double | radialCutoff | |||
) |
This function is only called when we're using the Slater modification described in Eq.
9.
We want to decompose the wavefunction into s, px, py, and pz contributions. First, we choose a cutoff radius beyond which we are not interested. Then inside this sphere, we record what the contributions are for a series of radial "knot" points distributed uniformly inside the cutoff.
We then create a spline so that we can evaluate these contributions cheaply.
numKnots is the number of radial points upon which the wavefunction will be memorized.
Definition at line 476 of file QMCNuclearForces.cpp.
References Array2D< T >::allocate(), Array1D< T >::allocate(), QMCMolecule::Atom_Positions, Chi, Array2D< T >::deallocate(), Array1D< T >::deallocate(), Array2D< T >::dim1(), generateCube(), getDensities(), Input, QMCInput::Molecule, numSamplesPerArea, orbitals, radialPoints, randomlyRotate(), waveValuesHF, and waveValuesHFSpline.
Referenced by calcCoefficients().
void QMCNuclearForces::calculateNuclearContributions | ( | ) |
Since the force terms that depend upon 2 nuclei don't change in a calculation, we only want to calculate them once.
Definition at line 676 of file QMCNuclearForces.cpp.
References Array2D< T >::allocate(), QMCMolecule::Atom_Positions, QMCMolecule::getNumberAtoms(), Input, QMCInput::Molecule, nucleusContributions, and QMCMolecule::Z.
Referenced by initialize().
For a series of electronic coordinates, this function will calculate the density.
X | dimensional configuration of electrons represented by a matrix | |
densities | the array of densities calculated for each point |
Definition at line 553 of file QMCNuclearForces.cpp.
References Array1D< T >::allocate(), QMCWavefunction::AlphaOccupation, QMCWavefunction::BetaOccupation, BF, Chi, QMCWavefunction::CI_coeffs, Array2D< T >::dim1(), QMCBasisFunction::evaluateBasisFunctions(), QMCWavefunction::getNumberBasisFunctions(), QMCWavefunction::getNumberDeterminants(), QMCWavefunction::getNumberOrbitals(), QMCWavefunction::getUnusedIndicator(), Input, QMCWavefunction::OrbitalCoeffs, orbitals, QMCInput::WF, and WF.
Referenced by waveMemorization().
void QMCNuclearForces::printCubeLengths | ( | Array2D< double > & | points | ) |
A debugging function.
..
Definition at line 595 of file QMCNuclearForces.cpp.
References Array2D< T >::dim1().
void QMCNuclearForces::printPoints | ( | Array2D< double > & | points | ) |
A debugging function.
..
Definition at line 586 of file QMCNuclearForces.cpp.
References Array2D< T >::dim1().
void QMCNuclearForces::generateCube | ( | Array2D< double > & | cube, | |
double | length | |||
) |
This will create a cube centered at the origin.
The distance between any two adjacent points will be length.
Definition at line 616 of file QMCNuclearForces.cpp.
References Array2D< T >::allocate().
Referenced by waveMemorization().
void QMCNuclearForces::randomlyRotate | ( | Array2D< double > & | points, | |
double | scale | |||
) |
This will take the cube centered at the origin and give it a random rotation preserving the distance between the vertices as well as the center.
The parameter scale will then grow or shrink the cube.
Definition at line 631 of file QMCNuclearForces.cpp.
References Array2D< T >::deallocate(), Array2D< T >::dim1(), ran, and Random::unidev().
Referenced by waveMemorization().
static int QMCNuclearForces::getNumBins | ( | ) | [inline, static] |
This is an arbitrary choice, so it can be static.
It controls the resolution of our binning.
Definition at line 136 of file QMCNuclearForces.h.
Referenced by evaluate(), QMCWalker::initialize(), QMCRun::initialize(), and QMCManager::initialize().
void QMCNuclearForces::operator= | ( | const QMCNuclearForces & | rhs | ) |
QMCInput* QMCNuclearForces::Input [private] |
Definition at line 149 of file QMCNuclearForces.h.
Referenced by calcCoefficients(), calculateNuclearContributions(), evaluate(), getDensities(), getTemperTerm(), initialize(), and waveMemorization().
QMCBasisFunction* QMCNuclearForces::BF [private] |
QMCWavefunction* QMCNuclearForces::WF [private] |
double QMCNuclearForces::fittingWeightM [private] |
This is the m parameter 'm' used in CCZ05.
Definition at line 156 of file QMCNuclearForces.h.
Referenced by calcCoefficients(), getTemperTerm(), and initialize().
double QMCNuclearForces::numSamplesPerArea [private] |
We want to know how many sample points per unit area on the surface of the shell to use for each knot point.
Definition at line 162 of file QMCNuclearForces.h.
Referenced by initialize(), and waveMemorization().
Array1D<int> QMCNuclearForces::numPolyBasisF [private] |
This is the basis set size 'M' from CCZ05.
We want to permit it to be different for each atom.
Definition at line 168 of file QMCNuclearForces.h.
Referenced by calcCoefficients(), initialize(), and ~QMCNuclearForces().
Array2D< Array1D<double> > QMCNuclearForces::basisCoeffs [private] |
These are the coefficients c_k or a_k for the basis set.
Definition at line 173 of file QMCNuclearForces.h.
Referenced by calcCoefficients(), getTemperTerm(), initialize(), and ~QMCNuclearForces().
Array1D< Array1D<double> > QMCNuclearForces::radialPoints [private] |
These are the knot's radial values for each nucleus.
The last value in this array (independent of method) will be the radial cutoff 'R'.
Definition at line 179 of file QMCNuclearForces.h.
Referenced by calcCoefficients(), evaluate(), getTemperTerm(), initialize(), waveMemorization(), and ~QMCNuclearForces().
Array2D< Array1D<double> > QMCNuclearForces::waveValuesHF [private] |
The memorized wavefunction as decomposed into s, px, py, and pz contributions.
Definition at line 185 of file QMCNuclearForces.h.
Referenced by calcCoefficients(), initialize(), waveMemorization(), and ~QMCNuclearForces().
Array2D< CubicSpline > QMCNuclearForces::waveValuesHFSpline [private] |
This is the interpolating waveValuesHF.
Definition at line 190 of file QMCNuclearForces.h.
Referenced by getTemperTerm(), initialize(), waveMemorization(), and ~QMCNuclearForces().
Array2D<double> QMCNuclearForces::nucleusContributions [private] |
The precalculated nucleus contributions to the force.
Definition at line 195 of file QMCNuclearForces.h.
Referenced by calculateNuclearContributions(), evaluate(), and ~QMCNuclearForces().
Array2D<qmcfloat> QMCNuclearForces::orbitals [private] |
Temp variable used by getDensities.
Definition at line 200 of file QMCNuclearForces.h.
Referenced by getDensities(), waveMemorization(), and ~QMCNuclearForces().
Array2D<qmcfloat> QMCNuclearForces::Chi [private] |
Temp variable used by getDensities.
Definition at line 205 of file QMCNuclearForces.h.
Referenced by getDensities(), and waveMemorization().
CubicSpline QMCNuclearForces::spliner [private] |
Eventually, we probably want to remove this guy.
Definition at line 210 of file QMCNuclearForces.h.
Referenced by calcCoefficients(), and initialize().