#include <QMCBasisFunction.h>
Public Member Functions | |
QMCBasisFunction () | |
Creates an instance of the class. | |
void | initialize (QMCFlags *flags, QMCMolecule *molecule) |
Initializes the class with data input to control the calculation and provide the molecular geometry. | |
void | evaluateBasisFunctions (Array2D< double > &X, Array2D< qmcfloat > &chi_value) |
Calculates the value of the basis funcions. | |
void | angularGrid (Array2D< double > &grid, int nuc, Array2D< Array1D< double > > &angularCi) |
Psuedopotential grids all have a fixed radius from their nucleus, so we can precalculate the angular terms x^a y^b z^c at the very beginning of a run. | |
void | basisFunctionsOnGrid (Array2D< double > &grid, int nuc, Array2D< Array1D< double > > &angularCi, Array2D< qmcfloat > &chi_val) |
This evaluates the basis functions at all the grid points. | |
void | evaluateBasisFunctions (Array2D< double > &X, int start, int stop, Array2D< qmcfloat > &chi_value, Array2D< qmcfloat > &chi_grx, Array2D< qmcfloat > &chi_gry, Array2D< qmcfloat > &chi_grz, Array2D< qmcfloat > &chi_laplacian) |
Calculates the value, gradient, and Laplacian of the basis funcions. | |
void | operator= (const QMCBasisFunction &rhs) |
Sets two QMCBasisFunctions objects equal. | |
void | read (string runfile) |
Loads the state of the object from a file. | |
int | getNumberBasisFunctions (int i) |
Returns how many basis functions are located on a specific atom. | |
QMCBasisFunctionCoefficients * | getBFCoeffs (int i) |
Returns the basis function coefficients for atom i. | |
Protected Attributes | |
QMCFlags * | flags |
QMCMolecule * | Molecule |
int | N_BasisFunctions |
Array1D < QMCBasisFunctionCoefficients > | BFCoeffs |
Array containing the QMCBasisFunctionCoefficients for all the atoms. | |
Array1D< double > | Xcalc |
Array2D< int > | BFLookupTable |
Private Member Functions | |
void | initializeInterpolations () |
Initializes the interpolations for the radial components of all basis functions. | |
void | initializeInterpolation (int bfc_number, int orbital, CubicSplineWithGeometricProgressionGrid &S, int whichDerivative) |
Initializes the interpolation for the radial component of a basis function or it's derivatives. | |
Static Private Member Functions | |
static double | radialFunction (QMCBasisFunctionCoefficients &BFC, int orbital, double r_sq) |
Radial part of a basis function. | |
static double | radialFunctionFirstDerivative (QMCBasisFunctionCoefficients &BFC, int orbital, double r_sq) |
First derivative of the radial part of a basis function. | |
static double | radialFunctionSecondDerivative (QMCBasisFunctionCoefficients &BFC, int orbital, double r_sq) |
Second derivative of the radial part of a basis function. | |
Private Attributes | |
Array2D < CubicSplineWithGeometricProgressionGrid > | RadialFunctionInterpolation |
Interpolation of the radial part of a basis function. | |
Array2D < CubicSplineWithGeometricProgressionGrid > | RadialFunctionFirstDerivativeInterpolation |
Interpolation of the first derivative of the radial part of a basis function. | |
Array2D < CubicSplineWithGeometricProgressionGrid > | RadialFunctionSecondDerivativeInterpolation |
Interpolation of the second derivative of the radial part of a basis function. | |
bool | use_radial_interpolation |
Boolean flag indicating if the interpolated radial component of the basis functions should be used. | |
Friends | |
class | QMCPsiPotential |
istream & | operator>> (istream &strm, QMCBasisFunction &rhs) |
Loads the state of the object from an input stream. | |
ostream & | operator<< (ostream &strm, QMCBasisFunction &rhs) |
Writes the state of the object to an output stream. |
This contains a QMCBasisFunctionCoefficent for each atom type.
Definition at line 55 of file QMCBasisFunction.h.
QMCBasisFunction::QMCBasisFunction | ( | ) |
void QMCBasisFunction::initialize | ( | QMCFlags * | flags, | |
QMCMolecule * | molecule | |||
) |
Initializes the class with data input to control the calculation and provide the molecular geometry.
flags | input control information | |
molecule | information about the specific molecule |
Definition at line 39 of file QMCBasisFunction.cpp.
References Array1D< T >::allocate(), flags, Molecule, and Xcalc.
Referenced by QMCInput::read().
void QMCBasisFunction::evaluateBasisFunctions | ( | Array2D< double > & | X, | |
Array2D< qmcfloat > & | chi_value | |||
) |
Calculates the value of the basis funcions.
Definition at line 405 of file QMCBasisFunction.cpp.
References Array1D< T >::array(), QMCMolecule::Atom_Positions, BFCoeffs, Array2D< T >::dim1(), MathFunctions::fast_exp(), flags, Molecule, QMCFlags::Natoms, and Xcalc.
Referenced by QMCSlater::evaluate(), and QMCNuclearForces::getDensities().
void QMCBasisFunction::angularGrid | ( | Array2D< double > & | grid, | |
int | nuc, | |||
Array2D< Array1D< double > > & | angularCi | |||
) |
Psuedopotential grids all have a fixed radius from their nucleus, so we can precalculate the angular terms x^a y^b z^c at the very beginning of a run.
For basisfunctions that are not centered at the nucleus, we translate them to the nucleus, where the angular terms become: (rx-x0)^a (ry-y0)^b (rz-z0)^c
We then expand this out into a polynomial in powers of r.
It doesn't seem to be a significant performance improvement, but it seemed like a good idea.
grid | the grid of points on the unit shell | |
nuc | the nucleus index for our grid | |
angularCi | (output) the coefficients Ci of the polynomials |
Definition at line 574 of file QMCBasisFunction.cpp.
References QMCMolecule::Atom_Positions, BFCoeffs, Array1D< T >::dim1(), Array2D< T >::dim1(), flags, Molecule, N_BasisFunctions, and QMCFlags::Natoms.
Referenced by QMCPotential_Energy::initialize().
void QMCBasisFunction::basisFunctionsOnGrid | ( | Array2D< double > & | grid, | |
int | nuc, | |||
Array2D< Array1D< double > > & | angularCi, | |||
Array2D< qmcfloat > & | chi_val | |||
) |
This evaluates the basis functions at all the grid points.
It takes advantage of the precalculated angular terms.
grid | the grid of points on the unit shell | |
nuc | the nucleus index for our grid | |
angularCi | the coefficients Ci of the polynomials produced by angularGrid | |
angularCi | (output) the evaluated basis functions |
Definition at line 484 of file QMCBasisFunction.cpp.
References Array2D< T >::array(), Array1D< T >::array(), QMCMolecule::Atom_Positions, BFCoeffs, Array1D< T >::dim1(), Array2D< T >::dim1(), flags, Molecule, QMCFlags::Natoms, and Xcalc.
Referenced by QMCPotential_Energy::evaluatePsuedoPotential().
void QMCBasisFunction::evaluateBasisFunctions | ( | Array2D< double > & | X, | |
int | start, | |||
int | stop, | |||
Array2D< qmcfloat > & | chi_value, | |||
Array2D< qmcfloat > & | chi_grx, | |||
Array2D< qmcfloat > & | chi_gry, | |||
Array2D< qmcfloat > & | chi_grz, | |||
Array2D< qmcfloat > & | chi_laplacian | |||
) |
Calculates the value, gradient, and Laplacian of the basis funcions.
Definition at line 287 of file QMCBasisFunction.cpp.
References Array1D< T >::array(), QMCMolecule::Atom_Positions, BFCoeffs, flags, Molecule, QMCFlags::Natoms, and Xcalc.
void QMCBasisFunction::operator= | ( | const QMCBasisFunction & | rhs | ) |
Sets two QMCBasisFunctions objects equal.
rhs | object to set this object equal to |
Definition at line 149 of file QMCBasisFunction.cpp.
References BFCoeffs, BFLookupTable, flags, Molecule, N_BasisFunctions, RadialFunctionFirstDerivativeInterpolation, RadialFunctionInterpolation, RadialFunctionSecondDerivativeInterpolation, use_radial_interpolation, and Xcalc.
void QMCBasisFunction::read | ( | string | runfile | ) |
Loads the state of the object from a file.
runfile | file to load |
Definition at line 217 of file QMCBasisFunction.cpp.
Referenced by QMCInput::read().
int QMCBasisFunction::getNumberBasisFunctions | ( | int | i | ) |
Returns how many basis functions are located on a specific atom.
This can probably be depricated once we have a good initialization scheme and not MikesJacked one.
i | index of atom |
Definition at line 167 of file QMCBasisFunction.cpp.
References BFCoeffs.
Referenced by QMCDansWalkerInitialization::assign_electrons_to_nuclei(), QMCMikesJackedWalkerInitialization::electrons_and_radii(), and QMCElectronNucleusCusp::fitReplacementOrbitals().
QMCBasisFunctionCoefficients * QMCBasisFunction::getBFCoeffs | ( | int | i | ) |
Returns the basis function coefficients for atom i.
i | the index of the atom whose BF coefficients we want |
Definition at line 172 of file QMCBasisFunction.cpp.
References BFCoeffs.
Referenced by QMCElectronNucleusCusp::fitReplacementOrbitals().
double QMCBasisFunction::radialFunction | ( | QMCBasisFunctionCoefficients & | BFC, | |
int | orbital, | |||
double | r_sq | |||
) | [static, private] |
Radial part of a basis function.
A basis function can be factored into where is the radial portion of the basis function. The function is in terms of instead of to make it's evaluation faster. To evaluate , evaluate the function at .
Definition at line 238 of file QMCBasisFunction.cpp.
References QMCBasisFunctionCoefficients::Coeffs, and QMCBasisFunctionCoefficients::N_Gauss.
Referenced by initializeInterpolation().
double QMCBasisFunction::radialFunctionFirstDerivative | ( | QMCBasisFunctionCoefficients & | BFC, | |
int | orbital, | |||
double | r_sq | |||
) | [static, private] |
First derivative of the radial part of a basis function.
A basis function can be factored into where is the radial portion of the basis function. The function is in terms of instead of to make it's evaluation faster. To evaluate , evaluate the function at .
Definition at line 256 of file QMCBasisFunction.cpp.
References QMCBasisFunctionCoefficients::Coeffs, and QMCBasisFunctionCoefficients::N_Gauss.
Referenced by initializeInterpolation().
double QMCBasisFunction::radialFunctionSecondDerivative | ( | QMCBasisFunctionCoefficients & | BFC, | |
int | orbital, | |||
double | r_sq | |||
) | [static, private] |
Second derivative of the radial part of a basis function.
A basis function can be factored into where is the radial portion of the basis function. The function is in terms of instead of to make it's evaluation faster. To evaluate , evaluate the function at .
Definition at line 273 of file QMCBasisFunction.cpp.
References QMCBasisFunctionCoefficients::Coeffs, and QMCBasisFunctionCoefficients::N_Gauss.
Referenced by initializeInterpolation().
void QMCBasisFunction::initializeInterpolations | ( | ) | [private] |
Initializes the interpolations for the radial components of all basis functions.
Definition at line 46 of file QMCBasisFunction.cpp.
References Array2D< T >::allocate(), BFCoeffs, Array1D< T >::dim1(), flags, initializeInterpolation(), RadialFunctionFirstDerivativeInterpolation, RadialFunctionInterpolation, RadialFunctionSecondDerivativeInterpolation, QMCFlags::use_basis_function_interpolation, and use_radial_interpolation.
Referenced by operator>>().
void QMCBasisFunction::initializeInterpolation | ( | int | bfc_number, | |
int | orbital, | |||
CubicSplineWithGeometricProgressionGrid & | S, | |||
int | whichDerivative | |||
) | [private] |
Initializes the interpolation for the radial component of a basis function or it's derivatives.
S | class used to interpolate the function. | |
whichDerivative | the derivative of the radial function to calculate the interpolation for. |
Definition at line 102 of file QMCBasisFunction.cpp.
References QMCFlags::basis_function_interpolation_first_point, BFCoeffs, Array1D< T >::dim1(), flags, CubicSpline::initializeWithFunctionValues(), QMCFlags::number_basis_function_interpolation_grid_points, radialFunction(), radialFunctionFirstDerivative(), radialFunctionSecondDerivative(), and CubicSplineWithGeometricProgressionGrid::setGridParameters().
Referenced by initializeInterpolations().
friend class QMCPsiPotential [friend] |
Definition at line 58 of file QMCBasisFunction.h.
istream& operator>> | ( | istream & | strm, | |
QMCBasisFunction & | rhs | |||
) | [friend] |
Loads the state of the object from an input stream.
read in coefficients
Definition at line 177 of file QMCBasisFunction.cpp.
ostream& operator<< | ( | ostream & | strm, | |
QMCBasisFunction & | rhs | |||
) | [friend] |
Writes the state of the object to an output stream.
Definition at line 208 of file QMCBasisFunction.cpp.
QMCFlags* QMCBasisFunction::flags [protected] |
Definition at line 170 of file QMCBasisFunction.h.
Referenced by angularGrid(), basisFunctionsOnGrid(), evaluateBasisFunctions(), initialize(), initializeInterpolation(), initializeInterpolations(), operator<<(), operator=(), and operator>>().
QMCMolecule* QMCBasisFunction::Molecule [protected] |
Definition at line 171 of file QMCBasisFunction.h.
Referenced by angularGrid(), basisFunctionsOnGrid(), evaluateBasisFunctions(), initialize(), and operator=().
int QMCBasisFunction::N_BasisFunctions [protected] |
Definition at line 173 of file QMCBasisFunction.h.
Referenced by angularGrid(), operator=(), and operator>>().
Array containing the QMCBasisFunctionCoefficients for all the atoms.
Each element is for a different atom.
Definition at line 179 of file QMCBasisFunction.h.
Referenced by angularGrid(), basisFunctionsOnGrid(), QMCPsiPotential::CountGaussians(), evaluateBasisFunctions(), getBFCoeffs(), getNumberBasisFunctions(), initializeInterpolation(), initializeInterpolations(), QMCPsiPotential::LoadOrbitals(), operator<<(), operator=(), operator>>(), and QMCPsiPotential::UseWavefunction().
Array1D<double> QMCBasisFunction::Xcalc [protected] |
Definition at line 181 of file QMCBasisFunction.h.
Referenced by basisFunctionsOnGrid(), evaluateBasisFunctions(), initialize(), and operator=().
Array2D<int> QMCBasisFunction::BFLookupTable [protected] |
Array2D<CubicSplineWithGeometricProgressionGrid> QMCBasisFunction::RadialFunctionInterpolation [private] |
Interpolation of the radial part of a basis function.
A basis function can be factored into where is the radial portion of the basis function. The interpolation is in terms of instead of to make it's evaluation faster. To evaluate , evaluate the interpolation at .
Definition at line 225 of file QMCBasisFunction.h.
Referenced by initializeInterpolations(), and operator=().
Array2D<CubicSplineWithGeometricProgressionGrid> QMCBasisFunction::RadialFunctionFirstDerivativeInterpolation [private] |
Interpolation of the first derivative of the radial part of a basis function.
A basis function can be factored into where is the radial portion of the basis function. The interpolation is in terms of instead of to make it's evaluation faster. To evaluate , evaluate the interpolation at .
Definition at line 236 of file QMCBasisFunction.h.
Referenced by initializeInterpolations(), and operator=().
Array2D<CubicSplineWithGeometricProgressionGrid> QMCBasisFunction::RadialFunctionSecondDerivativeInterpolation [private] |
Interpolation of the second derivative of the radial part of a basis function.
A basis function can be factored into where is the radial portion of the basis function. The interpolation is in terms of instead of to make it's evaluation faster. To evaluate , evaluate the interpolation at .
Definition at line 247 of file QMCBasisFunction.h.
Referenced by initializeInterpolations(), and operator=().
bool QMCBasisFunction::use_radial_interpolation [private] |
Boolean flag indicating if the interpolated radial component of the basis functions should be used.
Definition at line 253 of file QMCBasisFunction.h.
Referenced by initializeInterpolations(), and operator=().