MADNESS 0.10.1
|
A Gaussian basis function used by chemistry electronic structure codes. More...
#include <gaussian.h>
Public Member Functions | |
GaussianFunction () | |
Default constructor: Make the function 0. | |
GaussianFunction (const GaussianType type, const std::array< double, 3 > ¢er, const double expcoeff) | |
Create an uncontracted Gaussian orbital (shortcut to the more general constructor for Gaussian orbitals). | |
GaussianFunction (const GaussianType type, const std::array< double, 3 > ¢er, const std::vector< double > &expcoeff, const std::vector< double > &coeff) | |
Create a Gaussian orbital (uncontracted or contracted) from quantum chemistry codes. | |
double | operator() (const madness::coord_3d &r) const |
Evaluate the Gaussian function at the specified point. | |
virtual double | operator() (const std::array< double, 3 > &x) const override |
Evaluate the Gaussian function at the specified point. | |
GaussianFunction | operator* (const double rhs) const |
Multiply the GaussianFunction by a scalar. | |
GaussianFunction | operator* (const GaussianFunction &rhs) const |
Multiply two GaussianFunctions. | |
GaussianFunction & | operator*= (const double rhs) |
Multiply the GaussianFunction by a scalar. | |
GaussianFunction & | operator*= (const GaussianFunction &rhs) |
Multiply the GaussianFunction by another. | |
GaussianFunction | operator+ (const GaussianFunction &rhs) const |
Add two GaussianFunction objects, resulting in a new one. | |
GaussianFunction & | operator+= (const GaussianFunction &rhs) |
Add a GaussianFunction to this GaussianFunction. | |
GaussianFunction | operator- () const |
Additive inverse of the GaussianFunction (deep copy). | |
GaussianFunction | operator- (const GaussianFunction &rhs) const |
Subtract a GaussianFunction from this one, returning the difference. | |
GaussianFunction & | operator-= (const GaussianFunction &rhs) |
Subtract a GaussianFunction from this one. | |
GaussianFunction | operator/ (const double rhs) const |
Divide the GaussianFunction by a scalar. | |
GaussianFunction & | operator/= (const double rhs) |
Divide the GaussianFunction by a scalar. | |
Public Member Functions inherited from slymer::BasisFunction | |
virtual | ~BasisFunction ()=default |
Public Attributes | |
std::array< double, 3 > | center |
The center of the gaussian. | |
std::vector< double > | expcoeff |
The exponent coefficients. | |
Protected Types | |
using | TermT = std::pair< double, PrimitiveGaussian > |
Helper class for storing terms in the sum of Gaussian primitives. | |
Protected Member Functions | |
void | removeSmallTerms (const double eps=1.e-6) |
Removes terms with very small linear expansion coefficients. | |
Protected Attributes | |
std::forward_list< TermT > | terms |
The list of terms in the sum of Gaussian primitives. | |
A Gaussian basis function used by chemistry electronic structure codes.
This basis function has the form
where is a quadratic function. Note that this functional form is a bit more general than that used by standard electronic structure codes; we do not require the prinicpal axes of the Gaussian function to be coincident with the x-, y-, and z-axes. This class can also hold/handle any linear combination of primitive Gaussian functions (the exponents and centers do not have to be the same).
|
protected |
Helper class for storing terms in the sum of Gaussian primitives.
|
inline |
Default constructor: Make the function 0.
slymer::GaussianFunction::GaussianFunction | ( | const GaussianType | type, |
const std::array< double, 3 > & | center, | ||
const std::vector< double > & | expcoeff, | ||
const std::vector< double > & | coeff | ||
) |
Create a Gaussian orbital (uncontracted or contracted) from quantum chemistry codes.
Both Cartesian and spherical orbitals are supported. The expcoeff and coeff parameters must be arrays. If the orbital is uncontracted, the arrays will be length 1.
All uncontracted primitive Gaussian orbitals used underneath the GaussianFunction are normalized.
invalid_argument | If a non-positive exponential coefficient is passed or if the lengths of expcoeff and coeff are not equal. |
[in] | type | The orbital type (from enum OrbitalType). |
[in] | center | The center of the Gaussian orbital. |
[in] | expcoeff | Array of coefficients in the exponents of the primitive Gaussians. |
[in] | coeff | Array of linear expansion coefficients of the primitive Gaussians. |
References center, expcoeff, removeSmallTerms(), and terms.
|
inline |
Create an uncontracted Gaussian orbital (shortcut to the more general constructor for Gaussian orbitals).
[in] | type | The orbital type (from enum OrbitalType). |
[in] | center | The center of the Gaussian orbital. |
[in] | expcoeff | The coefficient in the exponent of the primitive Gaussian. |
References expcoeff.
|
inline |
Evaluate the Gaussian function at the specified point.
[in] | x | The point. |
References operator()().
|
overridevirtual |
Evaluate the Gaussian function at the specified point.
[in] | x | The point. |
Implements slymer::BasisFunction.
References terms.
Referenced by operator()().
|
inline |
Multiply the GaussianFunction by a scalar.
[in] | rhs | The scalar multiplicative factor. |
GaussianFunction slymer::GaussianFunction::operator* | ( | const GaussianFunction & | rhs | ) | const |
Multiply two GaussianFunctions.
[in] | rhs | The right-hand GaussianFunction object. |
References removeSmallTerms(), and terms.
GaussianFunction & slymer::GaussianFunction::operator*= | ( | const double | rhs | ) |
Multiply the GaussianFunction by a scalar.
[in] | rhs | The scalar multiplicative factor. |
References removeSmallTerms(), and terms.
Referenced by operator/=().
|
inline |
Multiply the GaussianFunction by another.
[in] | rhs | The right-hand GaussianFunction object. |
References terms.
GaussianFunction slymer::GaussianFunction::operator+ | ( | const GaussianFunction & | rhs | ) | const |
Add two GaussianFunction objects, resulting in a new one.
[in] | rhs | The right-hand GaussianFunction. |
References terms.
GaussianFunction & slymer::GaussianFunction::operator+= | ( | const GaussianFunction & | rhs | ) |
Add a GaussianFunction to this GaussianFunction.
[in] | rhs | The right-hand GaussianFunction. |
References terms.
Referenced by operator-=().
GaussianFunction slymer::GaussianFunction::operator- | ( | ) | const |
Additive inverse of the GaussianFunction (deep copy).
References terms.
|
inline |
Subtract a GaussianFunction from this one, returning the difference.
[in] | rhs | The GaussianFunction to be subtracted. |
|
inline |
Subtract a GaussianFunction from this one.
[in] | rhs | The GaussianFunction to be subtracted. |
References operator+=().
|
inline |
Divide the GaussianFunction by a scalar.
[in] | rhs | The scalar factor. |
|
inline |
Divide the GaussianFunction by a scalar.
Does not check that the scalar is nonzero.
[in] | rhs | The scalar factor. |
References operator*=().
|
inlineprotected |
Removes terms with very small linear expansion coefficients.
[in] | eps | The threshold for "small". Defaults to 1.e-6. |
References std::abs(), and terms.
Referenced by GaussianFunction(), operator*(), and operator*=().
std::array<double, 3> slymer::GaussianFunction::center |
The center of the gaussian.
Referenced by GaussianFunction().
std::vector<double> slymer::GaussianFunction::expcoeff |
The exponent coefficients.
Referenced by GaussianFunction(), GaussianFunction(), and slymer::Gaussian_Functor::special_level().
|
protected |
The list of terms in the sum of Gaussian primitives.
Referenced by GaussianFunction(), operator()(), operator*(), operator*=(), operator*=(), operator+(), operator+=(), operator-(), and removeSmallTerms().