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... | |
void | plot () const |
Crude function to plot the energy and potential functionals. More... | |
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 (double rho) |
static void | munge2 (double &rho, double &sigma) |
static void | munge_der (double &rhoa, double &sigma, double &drx, double &dry, double &drz) |
static void | munge5 (double &rhoa, double &rhob, double &saa, double &sab, double &sbb) |
static void | munge5_der (double &rhoa, double &rhob, double &saa, double &sab, double &sbb, double &drax, double &dray, double &draz, double &drbx, double &drby, double &drbz) |
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... | |
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 |
change
References c_rks_vwn5__(), c_uks_vwn5__(), madness::f, L, munge(), spin_polarized, x_rks_s__(), and x_uks_s__().
Referenced by xc_functional::operator()(), and plot().
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.
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, and spin_polarized.
bool XCfunctional::is_dft | ( | ) | const |
bool XCfunctional::is_gga | ( | ) | const |
Returns true if the potential is gga (needs first derivatives)
Referenced by is_dft().
bool XCfunctional::is_lda | ( | ) | const |
bool XCfunctional::is_meta | ( | ) | const |
Returns true if the potential is meta gga (needs second derivatives ... not yet supported)
Referenced by is_dft().
|
inline |
|
inlinestaticprotected |
|
inlinestaticprotected |
References polyn().
|
inlinestaticprotected |
References polyn().
|
inlinestaticprotected |
References polyn().
|
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(), munge2(), munge5(), munge5_der(), and munge_der().
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 result += qx *funcs[i].second;
References c_rks_vwn5__(), c_uks_vwn5__(), madness::f, L, munge(), spin_polarized, x_rks_s__(), and x_uks_s__().
Referenced by xc_potential::operator()(), and plot().
|
protected |
Factor multiplying HF exchange (+1.0 gives HF)
Referenced by hf_exchange_coefficient(), initialize(), and is_lda().
|
protected |
True if the functional is spin polarized.
Referenced by exc(), initialize(), is_spin_polarized(), and vxc().