MADNESS 0.10.1
Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | List of all members
slymer::GaussianFunction Class Reference

A Gaussian basis function used by chemistry electronic structure codes. More...

#include <gaussian.h>

Inheritance diagram for slymer::GaussianFunction:
Inheritance graph
[legend]
Collaboration diagram for slymer::GaussianFunction:
Collaboration graph
[legend]

Public Member Functions

 GaussianFunction ()
 Default constructor: Make the function 0.
 
 GaussianFunction (const GaussianType type, const std::array< double, 3 > &center, 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 > &center, 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.
 
GaussianFunctionoperator*= (const double rhs)
 Multiply the GaussianFunction by a scalar.
 
GaussianFunctionoperator*= (const GaussianFunction &rhs)
 Multiply the GaussianFunction by another.
 
GaussianFunction operator+ (const GaussianFunction &rhs) const
 Add two GaussianFunction objects, resulting in a new one.
 
GaussianFunctionoperator+= (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.
 
GaussianFunctionoperator-= (const GaussianFunction &rhs)
 Subtract a GaussianFunction from this one.
 
GaussianFunction operator/ (const double rhs) const
 Divide the GaussianFunction by a scalar.
 
GaussianFunctionoperator/= (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< TermTterms
 The list of terms in the sum of Gaussian primitives.
 

Detailed Description

A Gaussian basis function used by chemistry electronic structure codes.

This basis function has the form

\[
\sum_j c_j x^{l_j} y^{m_j} z^{n_j} \exp[f_j(\vec{x})],
\]

where $f_j(\vec{x})$ 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).

Member Typedef Documentation

◆ TermT

using slymer::GaussianFunction::TermT = std::pair<double, PrimitiveGaussian>
protected

Helper class for storing terms in the sum of Gaussian primitives.

Constructor & Destructor Documentation

◆ GaussianFunction() [1/3]

slymer::GaussianFunction::GaussianFunction ( )
inline

Default constructor: Make the function 0.

◆ GaussianFunction() [2/3]

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.

Exceptions
invalid_argumentIf a non-positive exponential coefficient is passed or if the lengths of expcoeff and coeff are not equal.
Parameters
[in]typeThe orbital type (from enum OrbitalType).
[in]centerThe center of the Gaussian orbital.
[in]expcoeffArray of coefficients in the exponents of the primitive Gaussians.
[in]coeffArray of linear expansion coefficients of the primitive Gaussians.

References center, expcoeff, removeSmallTerms(), and terms.

◆ GaussianFunction() [3/3]

slymer::GaussianFunction::GaussianFunction ( const GaussianType  type,
const std::array< double, 3 > &  center,
const double  expcoeff 
)
inline

Create an uncontracted Gaussian orbital (shortcut to the more general constructor for Gaussian orbitals).

Parameters
[in]typeThe orbital type (from enum OrbitalType).
[in]centerThe center of the Gaussian orbital.
[in]expcoeffThe coefficient in the exponent of the primitive Gaussian.

References expcoeff.

Member Function Documentation

◆ operator()() [1/2]

double slymer::GaussianFunction::operator() ( const madness::coord_3d r) const
inline

Evaluate the Gaussian function at the specified point.

Parameters
[in]xThe point.
Returns
The Gaussian function evaluated at the point x.

References operator()().

◆ operator()() [2/2]

double slymer::GaussianFunction::operator() ( const std::array< double, 3 > &  x) const
overridevirtual

Evaluate the Gaussian function at the specified point.

Parameters
[in]xThe point.
Returns
The Gaussian function evaluated at the point x.

Implements slymer::BasisFunction.

References terms.

Referenced by operator()().

◆ operator*() [1/2]

GaussianFunction slymer::GaussianFunction::operator* ( const double  rhs) const
inline

Multiply the GaussianFunction by a scalar.

Parameters
[in]rhsThe scalar multiplicative factor.
Returns
The scaled GaussianFunction.

◆ operator*() [2/2]

GaussianFunction slymer::GaussianFunction::operator* ( const GaussianFunction rhs) const

Multiply two GaussianFunctions.

Parameters
[in]rhsThe right-hand GaussianFunction object.
Returns
The product.

References removeSmallTerms(), and terms.

◆ operator*=() [1/2]

GaussianFunction & slymer::GaussianFunction::operator*= ( const double  rhs)

Multiply the GaussianFunction by a scalar.

Parameters
[in]rhsThe scalar multiplicative factor.
Returns
This GaussianFunction, which has been scaled.

References removeSmallTerms(), and terms.

Referenced by operator/=().

◆ operator*=() [2/2]

GaussianFunction & slymer::GaussianFunction::operator*= ( const GaussianFunction rhs)
inline

Multiply the GaussianFunction by another.

Parameters
[in]rhsThe right-hand GaussianFunction object.
Returns
This GaussianFunction, which is now the product.

References terms.

◆ operator+()

GaussianFunction slymer::GaussianFunction::operator+ ( const GaussianFunction rhs) const

Add two GaussianFunction objects, resulting in a new one.

Parameters
[in]rhsThe right-hand GaussianFunction.
Returns
The sum of this GaussianFunction and rhs.

References terms.

◆ operator+=()

GaussianFunction & slymer::GaussianFunction::operator+= ( const GaussianFunction rhs)

Add a GaussianFunction to this GaussianFunction.

Parameters
[in]rhsThe right-hand GaussianFunction.
Returns
The sum of this GaussianFunction and rhs, stored in *this.

References terms.

Referenced by operator-=().

◆ operator-() [1/2]

GaussianFunction slymer::GaussianFunction::operator- ( ) const

Additive inverse of the GaussianFunction (deep copy).

Returns
The negated function.

References terms.

◆ operator-() [2/2]

GaussianFunction slymer::GaussianFunction::operator- ( const GaussianFunction rhs) const
inline

Subtract a GaussianFunction from this one, returning the difference.

Parameters
[in]rhsThe GaussianFunction to be subtracted.
Returns
The difference of the two GaussianFunction objects.

◆ operator-=()

GaussianFunction & slymer::GaussianFunction::operator-= ( const GaussianFunction rhs)
inline

Subtract a GaussianFunction from this one.

Parameters
[in]rhsThe GaussianFunction to be subtracted.
Returns
This GaussianFunction (the difference).

References operator+=().

◆ operator/()

GaussianFunction slymer::GaussianFunction::operator/ ( const double  rhs) const
inline

Divide the GaussianFunction by a scalar.

Parameters
[in]rhsThe scalar factor.
Returns
The scaled GaussianFunction.

◆ operator/=()

GaussianFunction & slymer::GaussianFunction::operator/= ( const double  rhs)
inline

Divide the GaussianFunction by a scalar.

Does not check that the scalar is nonzero.

Parameters
[in]rhsThe scalar factor.
Returns
This GaussianFunction, which has been scaled.

References operator*=().

◆ removeSmallTerms()

void slymer::GaussianFunction::removeSmallTerms ( const double  eps = 1.e-6)
inlineprotected

Removes terms with very small linear expansion coefficients.

Parameters
[in]epsThe threshold for "small". Defaults to 1.e-6.

References std::abs(), and terms.

Referenced by GaussianFunction(), operator*(), and operator*=().

Member Data Documentation

◆ center

std::array<double, 3> slymer::GaussianFunction::center

The center of the gaussian.

Referenced by GaussianFunction().

◆ expcoeff

std::vector<double> slymer::GaussianFunction::expcoeff

The exponent coefficients.

Referenced by GaussianFunction(), GaussianFunction(), and slymer::Gaussian_Functor::special_level().

◆ terms

std::forward_list<TermT> slymer::GaussianFunction::terms
protected

The documentation for this class was generated from the following files: