MADNESS
version 0.9
|
Simplified interface to XC functionals. More...
#include <xcfunctional.h>
Public Member Functions | |
XCfunctional () | |
Default constructor is required. More... | |
void | initialize (const std::string &input_line, bool polarized) |
Initialize the object from the user input data. More... | |
~XCfunctional () | |
Destructor. More... | |
bool | is_lda () const |
Returns true if the potential is lda. More... | |
bool | is_gga () const |
Returns true if the potential is gga (needs first derivatives) More... | |
bool | is_meta () const |
Returns true if the potential is meta gga (needs second derivatives ... not yet supported) More... | |
bool | is_dft () const |
Returns true if there is a DFT functional (false probably means Hatree-Fock exchange only) More... | |
bool | is_spin_polarized () const |
Returns true if the functional is spin_polarized. More... | |
bool | has_fxc () const |
Returns true if the second derivative of the functional is available (not yet supported) More... | |
bool | has_kxc () const |
Returns true if the third derivative of the functional is available (not yet supported) More... | |
double | hf_exchange_coefficient () const |
Returns the value of the hf exact exchange coefficient. More... | |
madness::Tensor< double > | exc (const std::vector< madness::Tensor< double > > &t, const int ispin) const |
Computes the energy functional at given points. More... | |
madness::Tensor< double > | vxc (const std::vector< madness::Tensor< double > > &t, const int ispin, const int what) const |
Computes components of the potential (derivative of the energy functional) at np points. More... | |
madness::Tensor< double > | fxc (const std::vector< madness::Tensor< double > > &t, const int ispin, const int what) const |
void | plot () const |
Crude function to plot the energy and potential functionals. More... | |
Protected Member Functions | |
double | munge (double rho) const |
void | munge2 (double &rho, double &sigma) const |
void | munge5 (double &rhoa, double &rhob, double &saa, double &sab, double &sbb) const |
Static Protected Member Functions | |
static void | polyn (const double x, double &p, double &dpdx) |
Smoothly switches between constant (x<xmin) and linear function (x>xmax) More... | |
static double | munge_old (double rho) |
Protected Attributes | |
bool | spin_polarized |
True if the functional is spin polarized. More... | |
double | hf_coeff |
Factor multiplying HF exchange (+1.0 gives HF) More... | |
double | rhomin |
double | rhotol |
double | sigmin |
double | sigtol |
Simplified interface to XC functionals.
XCfunctional::XCfunctional | ( | ) |
Default constructor is required.
XCfunctional::~XCfunctional | ( | ) |
Destructor.
madness::Tensor< double > XCfunctional::exc | ( | const std::vector< madness::Tensor< double > > & | t, |
const int | ispin | ||
) | const |
Computes the energy functional at given points.
This uses the convention that the total energy is
Any HF exchange contribution must be separately computed.
Items in the vector argument t
are interpreted as follows
t
[0] = t
[1] = (GGA only)t
[0] = t
[1] = t
[2] = (GGA only)t
[3] = (GGA only)t
[4] = (GGA only)t | The input densities and derivatives as required by the functional |
References madness::c_rks_vwn5__(), madness::c_uks_vwn5__(), madness::f, L, munge(), spin_polarized, madness::x_rks_s__(), and madness::x_uks_s__().
Referenced by madness::xc_functional::operator()(), and plot().
madness::Tensor< double > XCfunctional::fxc | ( | const std::vector< madness::Tensor< double > > & | t, |
const int | ispin, | ||
const int | what | ||
) | const |
bool XCfunctional::has_fxc | ( | ) | const |
Returns true if the second derivative of the functional is available (not yet supported)
bool XCfunctional::has_kxc | ( | ) | const |
Returns true if the third derivative of the functional is available (not yet supported)
|
inline |
Returns the value of the hf exact exchange coefficient.
References hf_coeff.
Referenced by SCF::apply_potential(), and madness::SCF::apply_potential().
void XCfunctional::initialize | ( | const std::string & | input_line, |
bool | polarized | ||
) |
Initialize the object from the user input data.
[in] | input_line | User input line (without beginning XC keyword) |
[in] | polarized | Boolean flag indicating if the calculation is spin-polarized |
References hf_coeff, rhomin, rhotol, sigmin, sigtol, spin_polarized, and madness::transform().
Referenced by main(), and madness::SCF::SCF().
bool XCfunctional::is_dft | ( | ) | const |
Returns true if there is a DFT functional (false probably means Hatree-Fock exchange only)
References is_gga(), is_lda(), and is_meta().
Referenced by SCF::apply_potential(), madness::SCF::apply_potential(), and madness::SCF::solve().
bool XCfunctional::is_gga | ( | ) | const |
Returns true if the potential is gga (needs first derivatives)
Referenced by madness::TDA_DFT::apply_kernel(), SCF::apply_potential(), madness::SCF::apply_potential(), WSTFunctional::apply_xc(), madness::TDA_DFT::convolution_with_kernel(), madness::TDA_DFT::evaluate_derivatives(), is_dft(), madness::TDA_DFT::is_gga(), main(), madness::perturbed_vxc::operator()(), madness::apply_kernel_functor::operator()(), madness::SCF::solve(), and madness::TDA_DFT::TDA_DFT().
bool XCfunctional::is_lda | ( | ) | const |
Returns true if the potential is lda.
References hf_coeff.
Referenced by madness::TDA_DFT::convolution_with_kernel(), is_dft(), madness::perturbed_vxc::operator()(), and madness::TDA_DFT::TDA_DFT().
bool XCfunctional::is_meta | ( | ) | const |
Returns true if the potential is meta gga (needs second derivatives ... not yet supported)
Referenced by is_dft().
|
inline |
Returns true if the functional is spin_polarized.
References spin_polarized.
Referenced by SCF::apply_potential(), madness::SCF::apply_potential(), plot(), madness::SCF::solve(), and madness::TDA_DFT::TDA_DFT().
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlinestaticprotected |
References polyn().
|
inline |
Crude function to plot the energy and potential functionals.
References exc(), madness::f, is_spin_polarized(), and vxc().
|
inlinestaticprotected |
Smoothly switches between constant (x<xmin) and linear function (x>xmax)
where is the unique quintic polynomial that satisfies , , , and .
Referenced by munge_old().
madness::Tensor< double > XCfunctional::vxc | ( | const std::vector< madness::Tensor< double > > & | t, |
const int | ispin, | ||
const int | what | ||
) | const |
Computes components of the potential (derivative of the energy functional) at np points.
Any HF exchange contribution must be separately computed.
See the documenation of the exc()
method for contents of the input t
[] argument
We define with or .
For unpolarized GGA, matrix elements of the potential are
For polarized GGA, matrix elements of the potential are
Integrating the above by parts and assuming free-space or periodic boundary conditions we obtain that the local multiplicative form of the GGA potential is
Until we get a madness::Function operation that can produce multiple results we need to compute components of the functional and potential separately:
what=0
what=1
(GGA only)what=0
what=1
what=2
what=3
what=4
[in] | t | The input densities and derivatives as required by the functional |
[in] | what | Specifies which component of the potential is to be computed as described above |
what
parameter References madness::c_rks_vwn5__(), madness::c_uks_vwn5__(), madness::f, L, munge(), spin_polarized, madness::x_rks_s__(), and madness::x_uks_s__().
Referenced by madness::unperturbed_vxc::operator()(), madness::perturbed_vxc::operator()(), madness::xc_potential::operator()(), and plot().
|
protected |
Factor multiplying HF exchange (+1.0 gives HF)
Referenced by hf_exchange_coefficient(), initialize(), and is_lda().
|
protected |
Referenced by initialize(), munge(), munge2(), and munge5().
|
protected |
Referenced by initialize().
|
protected |
Referenced by initialize(), munge2(), and munge5().
|
protected |
Referenced by initialize().
|
protected |
True if the functional is spin polarized.
Referenced by exc(), initialize(), is_spin_polarized(), and vxc().