MADNESS 0.10.1
madness::NuclearCorrelationFactor Class Referenceabstract

ABC for the nuclear correlation factors. More...

#include <correlationfactor.h>

Inheritance diagram for madness::NuclearCorrelationFactor:
Collaboration diagram for madness::NuclearCorrelationFactor:

Classes

class  R_functor
class  RX_functor
 compute the derivative of R wrt the displacement of atom A, coord axis More...
class  square_times_V_derivative_functor
class  square_times_V_functor
class  U1_atomic_functor
 U1 functor for a specific atom. More...
class  U1_dot_U1_functor
 functor for a local U1 dot U1 potential More...
class  U1_functor
 functor for the local part of the U1 potential – NOTE THE SIGN More...
class  U1X_functor
 compute the derivative of U1 wrt the displacement of atom A, coord axis More...
class  U2_atomic_functor
 U2 functor for a specific atom. More...
class  U2_functor
class  U2X_functor
 compute the derivative of U2 wrt the displacement of atom A More...
class  U3_atomic_functor
 U3 functor for a specific atom. More...
class  U3_functor
class  U3X_functor
 compute the derivative of U3 wrt the displacement of atom A, coord axis More...

Public Types

enum  corrfactype {
  None , GradientalGaussSlater , GaussSlater , LinearSlater ,
  Polynomial , Slater , poly4erfc , Two ,
  Adhoc
}
typedef std::shared_ptr< FunctionFunctorInterface< double, 3 > > functorT

Public Member Functions

 NuclearCorrelationFactor (World &world, const Molecule &mol)
 ctor
virtual ~NuclearCorrelationFactor ()
 virtual destructor
const std::vector< size_t > & all_atoms () const
 indices of all atoms
virtual real_function_3d apply_U (const real_function_3d &rhs) const
 apply the regularized potential U_nuc on a given function rhs
std::vector< size_t > atoms_near (const double *x, const double *y, const double *z, const int npts) const
 atoms whose screening sphere meets the bounding sphere of a set of points
coord_3d dsmoothed_unitvec (const coord_3d &xyz, const int axis, double smoothing=0.0) const
 derivative of smoothed unit vector wrt the electronic coordinate
virtual real_function_3d function () const
 return the nuclear correlation factor
void initialize (const double vtol1)
 initialize the regularized potentials U1 and U2
virtual real_function_3d inverse () const
 return the inverse nuclear correlation factor
virtual double screening_radius (const double) const
 distance from nucleus A beyond which its contributions to the functors are negligible
coord_3d smoothed_unitvec (const coord_3d &xyz, double smoothing=0.0) const
 smoothed unit vector for the computation of the U1 potential
virtual real_function_3d square () const
 return the square of the nuclear correlation factor
virtual real_function_3d square_times_V_derivative (const int iatom, const int axis) const
virtual double Sr_div_S (const double &r, const double &Z) const =0
virtual double Srr_div_S (const double &r, const double &Z) const =0
virtual double Srrr_div_S (const double &r, const double &Z) const =0
virtual corrfactype type () const =0
virtual const real_function_3d U1 (const int axis) const
 return the U1 term of the correlation function
std::vector< real_function_3d > U1vec () const
 return the U1 functions in a vector
virtual const real_function_3d U2 () const
 return the U2 term of the correlation function
virtual double U2X_spherical (const double &r, const double &Z, const double &rcut) const
 derivative of the U2 potential wrt nuclear coordinate X (spherical part)

Static Public Attributes

static constexpr int ncf_special_level =15
 projection depth of the factor's functions at the nuclei

Protected Attributes

std::vector< real_function_3d > U1_function
 the three components of the U1 potential
real_function_3d U2_function
 the purely local U2 potential, having absorbed the nuclear pot V_nuc

Private Member Functions

virtual double S (const double &r, const double &Z) const =0
 the correlation factor S wrt a given atom
virtual coord_3d Sp (const coord_3d &vr1A, const double &Z) const =0
 the partial derivative of correlation factor S' wrt the cartesian coordinates
virtual double Spp_div_S (const double &r, const double &Z) const =0
 the regularized potential wrt a given atom wrt the cartesian coordinate

Private Attributes

std::vector< size_t > all_atoms_
double eprec
 smoothing of the potential/step function
const Molecule & molecule
 the molecule
double vtol
 the threshold for initial projection
World & world
 the world

Detailed Description

ABC for the nuclear correlation factors.

Member Typedef Documentation

◆ functorT

typedef std::shared_ptr< FunctionFunctorInterface<double,3> > madness::NuclearCorrelationFactor::functorT

Member Enumeration Documentation

◆ corrfactype

Enumerator
None 
GradientalGaussSlater 
GaussSlater 
LinearSlater 
Polynomial 
Slater 
poly4erfc 
Two 
Adhoc 

Constructor & Destructor Documentation

◆ NuclearCorrelationFactor()

madness::NuclearCorrelationFactor::NuclearCorrelationFactor ( World & world,
const Molecule & mol )
inline

ctor

Parameters
[in]worldthe world
[in]molmolecule with the sites of the nuclei

References all_atoms_, eprec, molecule, vtol, and world.

Referenced by madness::AdhocNuclearCorrelationFactor::AdhocNuclearCorrelationFactor(), madness::GaussSlater::GaussSlater(), madness::GradientalGaussSlater::GradientalGaussSlater(), madness::LinearSlater::LinearSlater(), madness::poly4erfc::poly4erfc(), madness::Polynomial< N >::Polynomial(), madness::PseudoNuclearCorrelationFactor::PseudoNuclearCorrelationFactor(), madness::NuclearCorrelationFactor::R_functor::R_functor(), madness::NuclearCorrelationFactor::RX_functor::RX_functor(), madness::NuclearCorrelationFactor::RX_functor::RX_functor(), madness::Slater::Slater(), madness::NuclearCorrelationFactor::square_times_V_derivative_functor::square_times_V_derivative_functor(), madness::NuclearCorrelationFactor::square_times_V_functor::square_times_V_functor(), madness::NuclearCorrelationFactor::U1_atomic_functor::U1_atomic_functor(), madness::NuclearCorrelationFactor::U1_dot_U1_functor::U1_dot_U1_functor(), madness::NuclearCorrelationFactor::U1_functor::U1_functor(), madness::NuclearCorrelationFactor::U1X_functor::U1X_functor(), madness::NuclearCorrelationFactor::U1X_functor::U1X_functor(), madness::NuclearCorrelationFactor::U2_atomic_functor::U2_atomic_functor(), madness::NuclearCorrelationFactor::U2_functor::U2_functor(), madness::NuclearCorrelationFactor::U2X_functor::U2X_functor(), madness::NuclearCorrelationFactor::U3_atomic_functor::U3_atomic_functor(), madness::NuclearCorrelationFactor::U3_functor::U3_functor(), and madness::NuclearCorrelationFactor::U3X_functor::U3X_functor().

◆ ~NuclearCorrelationFactor()

virtual madness::NuclearCorrelationFactor::~NuclearCorrelationFactor ( )
inlinevirtual

virtual destructor

Member Function Documentation

◆ all_atoms()

const std::vector< size_t > & madness::NuclearCorrelationFactor::all_atoms ( ) const
inline

indices of all atoms

References all_atoms_.

◆ apply_U()

virtual real_function_3d madness::NuclearCorrelationFactor::apply_U ( const real_function_3d & rhs) const
inlinevirtual

◆ atoms_near()

std::vector< size_t > madness::NuclearCorrelationFactor::atoms_near ( const double * x,
const double * y,
const double * z,
const int npts ) const
inline

atoms whose screening sphere meets the bounding sphere of a set of points

The projection hands a functor all quadrature points of one box at once; an atom screened out here is beyond its screening radius at every one of them.

References d, madness::Atom::get_coords(), lo, molecule, madness::Vector< T, N >::normf(), npts, p(), madness::Atom::q, and screening_radius().

◆ dsmoothed_unitvec()

coord_3d madness::NuclearCorrelationFactor::dsmoothed_unitvec ( const coord_3d & xyz,
const int axis,
double smoothing = 0.0 ) const
inline

derivative of smoothed unit vector wrt the electronic coordinate

note the sign change for exchanging nuclear and electronic coordinates

\‍[    \frac{\partial \vec n}{\partial x}  = -\frac{\partial \vec n}{\partial X}
\‍]

the derivative wrt x is given by

\‍[\frac{\partial\vec n}{\partial x} =
\left\{\frac{\left(r^2-x^2\right) \mathrm{erf}\left(\frac{r}{s}\right)}{r^3}
   +\frac{2 x^2 e^{-\frac{r^2}{s^2}}}{\sqrt{\pi } r^2 s},
 x y \left(\frac{2 e^{-\frac{r^2}{s^2}}}{\sqrt{\pi } r^2 s}
   -\frac{\mathrm{erf}\left(\frac{r}{s}\right)}{r^3}\right),
 x z \left(\frac{2 e^{-\frac{r^2}{s^2}}}{\sqrt{\pi } r^2 s}
   -\frac{\mathrm{erf}\left(\frac{r}{s}\right)}{r^3}\right)\right\}
\‍]

References axis, eprec, madness::Vector< T, N >::normf(), p(), madness::constants::pi, and madness::r2().

◆ function()

◆ initialize()

◆ inverse()

◆ S()

virtual double madness::NuclearCorrelationFactor::S ( const double & r,
const double & Z ) const
privatepure virtual

the correlation factor S wrt a given atom

Parameters
[in]rthe distance of the req'd coord to the nucleus
[in]Zthe nuclear charge
Returns
the nuclear correlation factor S_A(r_1A)

Implemented in madness::AdhocNuclearCorrelationFactor, madness::GaussSlater, madness::GradientalGaussSlater, madness::LinearSlater, madness::poly4erfc, madness::Polynomial< N >, madness::PseudoNuclearCorrelationFactor, and madness::Slater.

References Z.

◆ screening_radius()

virtual double madness::NuclearCorrelationFactor::screening_radius ( const double ) const
inlinevirtual

distance from nucleus A beyond which its contributions to the functors are negligible

A factor that returns a finite radius guarantees that beyond it S_A - 1 and S'_A/S_A are below ~1e-14 relative to their magnitude at the nucleus, and that S''_A/S_A equals the Coulomb tail -Z_A/r to the same accuracy. Infinite (the default) keeps every atom in every term.

Reimplemented in madness::Slater.

Referenced by atoms_near().

◆ smoothed_unitvec()

coord_3d madness::NuclearCorrelationFactor::smoothed_unitvec ( const coord_3d & xyz,
double smoothing = 0.0 ) const
inline

smoothed unit vector for the computation of the U1 potential

note the identity for exchanging nuclear and electronic coordinates (there is a sign change, unlike for the smoothed potential)

\‍[    \vec n  = \frac{\partial \rho}{\partial x} = -\frac{\partial \rho}{\partial X}
\‍]

\‍[\vec n = \left\{\frac{x \mathrm{erf}\left(\frac{r}{s}\right)}{r},
         \frac{y \mathrm{erf}\left(\frac{r}{s}\right)}{r},
         \frac{z \mathrm{erf}\left(\frac{r}{s}\right)}{r}\right\}
\‍]

References eprec, molecule, madness::Vector< T, N >::normf(), madness::constants::pi, and xi.

Referenced by madness::GaussSlater::Sp(), madness::GradientalGaussSlater::Sp(), madness::LinearSlater::Sp(), madness::poly4erfc::Sp(), madness::Polynomial< N >::Sp(), and madness::Slater::Sp().

◆ Sp()

virtual coord_3d madness::NuclearCorrelationFactor::Sp ( const coord_3d & vr1A,
const double & Z ) const
privatepure virtual

the partial derivative of correlation factor S' wrt the cartesian coordinates

Parameters
[in]vr1Athe vector of the req'd coord to the nucleus
[in]Zthe nuclear charge
Returns
the gradient of the nuclear correlation factor S'_A(r_1A)

Implemented in madness::AdhocNuclearCorrelationFactor, madness::GaussSlater, madness::GradientalGaussSlater, madness::LinearSlater, madness::poly4erfc, madness::Polynomial< N >, madness::PseudoNuclearCorrelationFactor, and madness::Slater.

References Z.

◆ Spp_div_S()

virtual double madness::NuclearCorrelationFactor::Spp_div_S ( const double & r,
const double & Z ) const
privatepure virtual

the regularized potential wrt a given atom wrt the cartesian coordinate

S" is the Cartesian Laplacian applied on the NCF. Note the difference to Srr_div_S, which is the second derivative wrt the distance rho. this is: -S"/S - Z/r

Parameters
[in]rthe distance of the req'd coord to the nucleus
[in]Zthe nuclear charge
Returns
the Laplacian of the nuclear correlation factor divided by the correlation factor minus the nuclear potential

Implemented in madness::AdhocNuclearCorrelationFactor, madness::GaussSlater, madness::GradientalGaussSlater, madness::LinearSlater, madness::poly4erfc, madness::Polynomial< N >, madness::PseudoNuclearCorrelationFactor, and madness::Slater.

References Z.

◆ square()

◆ square_times_V_derivative()

virtual real_function_3d madness::NuclearCorrelationFactor::square_times_V_derivative ( const int iatom,
const int axis ) const
inlinevirtual

return the square of the nuclear correlation factor multiplied with the derivative of the nuclear potential for the specified atom

Returns
R^2 * \frac{\partial Z_A/r_{1A}}{\partial X_A}

References axis, madness::func(), madness::FunctionFactory< T, NDIM >::functor(), molecule, ncf_special_level, R2, madness::FunctionFactory< T, NDIM >::special_level(), madness::FunctionFactory< T, NDIM >::thresh(), madness::FunctionFactory< T, NDIM >::truncate_on_project(), vtol, and world.

◆ Sr_div_S()

virtual double madness::NuclearCorrelationFactor::Sr_div_S ( const double & r,
const double & Z ) const
pure virtual

◆ Srr_div_S()

virtual double madness::NuclearCorrelationFactor::Srr_div_S ( const double & r,
const double & Z ) const
pure virtual

◆ Srrr_div_S()

virtual double madness::NuclearCorrelationFactor::Srrr_div_S ( const double & r,
const double & Z ) const
pure virtual

◆ type()

◆ U1()

virtual const real_function_3d madness::NuclearCorrelationFactor::U1 ( const int axis) const
inlinevirtual

return the U1 term of the correlation function

References axis, and U1_function.

Referenced by madness::AdhocNuclearCorrelationFactor::AdhocNuclearCorrelationFactor(), and apply_U().

◆ U1vec()

std::vector< real_function_3d > madness::NuclearCorrelationFactor::U1vec ( ) const
inline

return the U1 functions in a vector

References U1_function.

◆ U2()

virtual const real_function_3d madness::NuclearCorrelationFactor::U2 ( ) const
inlinevirtual

return the U2 term of the correlation function

Reimplemented in madness::PseudoNuclearCorrelationFactor.

References U2_function.

Referenced by madness::AdhocNuclearCorrelationFactor::AdhocNuclearCorrelationFactor(), and apply_U().

◆ U2X_spherical()

virtual double madness::NuclearCorrelationFactor::U2X_spherical ( const double & r,
const double & Z,
const double & rcut ) const
inlinevirtual

derivative of the U2 potential wrt nuclear coordinate X (spherical part)

need to reimplement this for all derived classes due to the range for r -> 0, where the singular terms cancel. With

\‍[  \rho = \left| \vec r- \vec R_A \right|
\‍]

returns the term in the parenthesis without the the derivative of rho

\‍[\frac{\partial U_2}{\partial X_A} = \frac{\partial \rho}{\partial X}
          \left(-\frac{1}{2}\frac{S''' S - S'' S'}{S^2} + \frac{1}{\rho^2}\frac{S'}{S}
          - \frac{1}{\rho} \frac{S''S - S'^2}{S^2} + \frac{Z_A}{\rho^2}\right)
\‍]

Reimplemented in madness::GaussSlater, madness::GradientalGaussSlater, madness::poly4erfc, madness::Polynomial< N >, madness::PseudoNuclearCorrelationFactor, and madness::Slater.

References MADNESS_EXCEPTION, madness::print(), rcut, world, and Z.

Member Data Documentation

◆ all_atoms_

std::vector<size_t> madness::NuclearCorrelationFactor::all_atoms_
private

◆ eprec

double madness::NuclearCorrelationFactor::eprec
private

smoothing of the potential/step function

Referenced by NuclearCorrelationFactor(), dsmoothed_unitvec(), and smoothed_unitvec().

◆ molecule

◆ ncf_special_level

int madness::NuclearCorrelationFactor::ncf_special_level =15
staticconstexpr

projection depth of the factor's functions at the nuclei

The functors' default (6) can miss the exp(-a Z r) features, of width 1/(aZ), at a loose threshold for Z above ~30: on NBr3 and PBr3 the k6 rung then starts hundreds of hartree off and never converges. 15 is what the nuclear-potential functors use (potentialmanager.h); it costs seconds per rung.

Referenced by madness::NemoBase::construct_nuclear_correlation_factor(), function(), initialize(), inverse(), square(), and square_times_V_derivative().

◆ U1_function

std::vector<real_function_3d> madness::NuclearCorrelationFactor::U1_function
protected

the three components of the U1 potential

Referenced by madness::AdhocNuclearCorrelationFactor::AdhocNuclearCorrelationFactor(), initialize(), U1(), and U1vec().

◆ U2_function

real_function_3d madness::NuclearCorrelationFactor::U2_function
protected

the purely local U2 potential, having absorbed the nuclear pot V_nuc

Referenced by madness::AdhocNuclearCorrelationFactor::AdhocNuclearCorrelationFactor(), initialize(), and U2().

◆ vtol

double madness::NuclearCorrelationFactor::vtol
private

the threshold for initial projection

Referenced by NuclearCorrelationFactor(), function(), initialize(), inverse(), square(), and square_times_V_derivative().

◆ world


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