MADNESS 0.10.1
|
operator class for the handling of DFT exchange-correlation functionals More...
#include <SCFOperators.h>
Classes | |
struct | expme |
simple structure to take the pointwise exponential of a function, shifted by +14 More... | |
struct | logme |
simple structure to take the pointwise logarithm of a function, shifted by +14 More... | |
Public Member Functions | |
XCOperator (World &world) | |
default ctor without information about the XC functional | |
XCOperator (World &world, const Nemo *nemo, int ispin=0) | |
ctor with a Nemo calculation, will initialize the necessary intermediates | |
XCOperator (World &world, const Nemo *scf, const real_function_3d &arho, const real_function_3d &brho, int ispin=0) | |
ctor with an Nemo calculation, will initialize the necessary intermediates | |
XCOperator (World &world, const SCF *scf, const real_function_3d &arho, const real_function_3d &brho, int ispin=0, std::string deriv="abgv") | |
ctor with an SCF calculation, will initialize the necessary intermediates | |
XCOperator (World &world, const SCF *scf, int ispin=0, std::string deriv="abgv") | |
ctor with an SCF calculation, will initialize the necessary intermediates | |
XCOperator (World &world, std::string xc_data, const bool spin_polarized, const real_function_3d &arho, const real_function_3d &brho, std::string deriv="abgv") | |
custom ctor with information about the XC functional | |
real_function_3d | apply_xc_kernel (const real_function_3d &density, const vecfuncT grad_dens_pt=vecfuncT()) const |
construct the xc kernel and apply it directly on the (response) density | |
double | compute_xc_energy () const |
compute the xc energy using the precomputed intermediates vf and delrho | |
std::string | info () const |
print some information about this operator | |
real_function_3d | make_xc_potential () const |
return the local xc potential | |
T | operator() (const Function< T, NDIM > &bra, const Function< T, NDIM > &ket) const |
compute the matrix element <bra | op | ket> | |
Function< T, NDIM > | operator() (const Function< T, NDIM > &ket) const |
apply the xc potential on an orbitals | |
Tensor< T > | operator() (const std::vector< Function< T, NDIM > > &vbra, const std::vector< Function< T, NDIM > > &vket) const |
std::vector< Function< T, NDIM > > | operator() (const std::vector< Function< T, NDIM > > &vket) const |
apply the xc potential on a set of orbitals | |
XCOperator & | set_extra_truncation (const double &fac) |
void | set_ispin (const int i) const |
set the spin state this operator is acting on | |
Public Member Functions inherited from madness::SCFOperatorBase< T, NDIM > | |
SCFOperatorBase ()=default | |
SCFOperatorBase (std::shared_ptr< MacroTaskQ > taskq) | |
virtual | ~SCFOperatorBase () |
virtual tensorT | operator() (const vecfuncT &vbra, const vecfuncT &vket) const =0 |
compute the matrix <vbra | op | vket> | |
virtual vecfuncT | operator() (const vecfuncT &vket) const =0 |
apply this operator on the argument vector of functions | |
Public Attributes | |
std::shared_ptr< XCfunctional > | xc |
interface to the actual XC functionals | |
Public Attributes inherited from madness::SCFOperatorBase< T, NDIM > | |
std::shared_ptr< MacroTaskQ > | taskq =0 |
Private Member Functions | |
bool | is_initialized () const |
check if the intermediates are initialized | |
vecfuncT | prep_xc_args (const real_function_3d &arho, const real_function_3d &brho) const |
compute the intermediates for the XC functionals | |
void | prep_xc_args_response (const real_function_3d &dens_pt, vecfuncT &xc_args, vecfuncT &ddens_pt) const |
compute the intermediates for the XC functionals | |
Private Attributes | |
std::string | dft_deriv |
which derivative operator to use | |
double | extra_truncation |
additional truncation for the densities in the XC kernel | |
int | ispin |
the XC functionals depend on the spin of the orbitals they act on | |
int | nbeta |
number of beta orbitals | |
std::shared_ptr< NuclearCorrelationFactor > | ncf |
the nuclear correlation factor, if it exists, for computing derivatives for GGA | |
World & | world |
the world | |
vecfuncT | xc_args |
functions that are need for the computation of the XC operator | |
Additional Inherited Members | |
Public Types inherited from madness::SCFOperatorBase< T, NDIM > | |
typedef Function< T, NDIM > | functionT |
typedef Tensor< T > | tensorT |
typedef std::vector< functionT > | vecfuncT |
operator class for the handling of DFT exchange-correlation functionals
|
inline |
default ctor without information about the XC functional
madness::XCOperator< T, NDIM >::XCOperator | ( | World & | world, |
std::string | xc_data, | ||
const bool | spin_polarized, | ||
const real_function_3d & | arho, | ||
const real_function_3d & | brho, | ||
std::string | deriv = "abgv" |
||
) |
custom ctor with information about the XC functional
References madness::XCOperator< T, NDIM >::nbeta, madness::Function< T, NDIM >::norm2(), madness::XCOperator< T, NDIM >::prep_xc_args(), madness::XCOperator< T, NDIM >::world, madness::XCOperator< T, NDIM >::xc, and madness::XCOperator< T, NDIM >::xc_args.
madness::XCOperator< T, NDIM >::XCOperator | ( | World & | world, |
const SCF * | scf, | ||
int | ispin = 0 , |
||
std::string | deriv = "abgv" |
||
) |
ctor with an SCF calculation, will initialize the necessary intermediates
References madness::CalculationParameters::nbeta(), madness::XCOperator< T, NDIM >::nbeta, madness::SCF::param, madness::CalculationParameters::spin_restricted(), madness::XCOperator< T, NDIM >::world, madness::CalculationParameters::xc(), and madness::XCOperator< T, NDIM >::xc.
madness::XCOperator< T, NDIM >::XCOperator | ( | World & | world, |
const Nemo * | nemo, | ||
int | ispin = 0 |
||
) |
ctor with a Nemo calculation, will initialize the necessary intermediates
madness::XCOperator< T, NDIM >::XCOperator | ( | World & | world, |
const SCF * | scf, | ||
const real_function_3d & | arho, | ||
const real_function_3d & | brho, | ||
int | ispin = 0 , |
||
std::string | deriv = "abgv" |
||
) |
ctor with an SCF calculation, will initialize the necessary intermediates
References madness::SCF::param, madness::XCOperator< T, NDIM >::prep_xc_args(), madness::CalculationParameters::spin_restricted(), madness::XCOperator< T, NDIM >::world, madness::CalculationParameters::xc(), madness::XCOperator< T, NDIM >::xc, and madness::XCOperator< T, NDIM >::xc_args.
madness::XCOperator< T, NDIM >::XCOperator | ( | World & | world, |
const Nemo * | scf, | ||
const real_function_3d & | arho, | ||
const real_function_3d & | brho, | ||
int | ispin = 0 |
||
) |
ctor with an Nemo calculation, will initialize the necessary intermediates
real_function_3d madness::XCOperator< T, NDIM >::apply_xc_kernel | ( | const real_function_3d & | dens_pt, |
const vecfuncT | grad_dens_pt = vecfuncT() |
||
) | const |
construct the xc kernel and apply it directly on the (response) density
apply the xc kernel on a perturbed density
the xc kernel is the second derivative of the xc functions wrt the density
[in] | density | the (response) density on which the kernel is applied |
cf Eq. (13) of T. Yanai, R. J. Harrison, and N. Handy, “Multiresolution quantum chemistry in multiwavelet bases: time-dependent density functional theory with asymptotically corrected potentials in local density and generalized gradient approximations,” Mol. Phys., vol. 103, no. 2, pp. 413–424, 2005.
the application of the xc kernel is (RHF only)
where the second partial derivatives are
the second partial derivatives that need to be multiplied with the density gradients
and the first derivatives that need to be multiplied with the density gradients
References madness::div(), madness::XCfunctional::is_gga(), madness::XCfunctional::is_spin_polarized(), MADNESS_ASSERT, MADNESS_EXCEPTION, madness::multi_to_multi_op_values(), op(), madness::refine_to_common_level(), madness::Function< T, NDIM >::truncate(), madness::truncate(), and xc.
double madness::XCOperator< T, NDIM >::compute_xc_energy | ( | ) | const |
compute the xc energy using the precomputed intermediates vf and delrho
References MADNESS_EXCEPTION, madness::refine_to_common_level(), madness::Function< T, NDIM >::trace(), madness::truncate(), and xc.
Referenced by madness::SCF::apply_potential(), madness::Nemo::compute_energy_regularized(), and test_XCOperator().
|
inlinevirtual |
print some information about this operator
Implements madness::SCFOperatorBase< T, NDIM >.
|
inlineprivate |
check if the intermediates are initialized
References madness::XCOperator< T, NDIM >::xc_args.
real_function_3d madness::XCOperator< T, NDIM >::make_xc_potential | ( | ) | const |
return the local xc potential
Referenced by madness::SCF::apply_potential(), madness::Nemo::compute_nemo_potentials(), and madness::Nemo::make_fock_operator().
|
inlinevirtual |
compute the matrix element <bra | op | ket>
bra | bra state |
ket | ket state |
Implements madness::SCFOperatorBase< T, NDIM >.
References MADNESS_EXCEPTION.
|
inlinevirtual |
apply the xc potential on an orbitals
Implements madness::SCFOperatorBase< T, NDIM >.
References madness::XCOperator< T, NDIM >::operator()().
|
inline |
References MADNESS_EXCEPTION.
std::vector< Function< T, NDIM > > madness::XCOperator< T, NDIM >::operator() | ( | const std::vector< Function< T, NDIM > > & | vket | ) | const |
apply the xc potential on a set of orbitals
Referenced by madness::XCOperator< T, NDIM >::operator()().
|
private |
compute the intermediates for the XC functionals
prepare xc args
[in] | arho | density of the alpha orbitals |
[in] | brho | density of the beta orbitals (necessary only if spin-polarized) |
References madness::copy(), madness::dot(), madness::XCfunctional::enum_chi_aa, madness::XCfunctional::enum_chi_ab, madness::XCfunctional::enum_chi_bb, madness::XCfunctional::enum_rhoa, madness::XCfunctional::enum_rhob, madness::XCfunctional::enum_zetaa_x, madness::XCfunctional::enum_zetaa_y, madness::XCfunctional::enum_zetaa_z, madness::XCfunctional::enum_zetab_x, madness::XCfunctional::enum_zetab_y, madness::XCfunctional::enum_zetab_z, madness::WorldGopInterface::fence(), madness::World::gop, madness::grad(), madness::grad_ble_one(), madness::grad_bspline_one(), madness::XCfunctional::is_gga(), madness::XCfunctional::is_spin_polarized(), madness::XCfunctional::number_xc_args, madness::Function< T, NDIM >::reconstruct(), madness::truncate(), madness::unary_op(), madness::Function< T, NDIM >::world(), and xc.
Referenced by madness::XCOperator< T, NDIM >::XCOperator(), and madness::XCOperator< T, NDIM >::XCOperator().
|
private |
compute the intermediates for the XC functionals
add intermediates for the response kernels to xc_args
[in] | dens_pt | perturbed densities from CPHF or TDDFT equations |
[in,out] | xc_args | vector of intermediates as described above |
[out] | ddens_pt | xyz-derivatives of dens_pt |
References madness::dot(), madness::XCfunctional::enum_ddens_ptx, madness::XCfunctional::enum_ddens_pty, madness::XCfunctional::enum_ddens_ptz, madness::XCfunctional::enum_rho_pt, madness::XCfunctional::enum_sigma_pta_div_rho, madness::XCfunctional::enum_sigma_ptb_div_rho, madness::XCfunctional::enum_zetaa_x, madness::XCfunctional::enum_zetaa_y, madness::XCfunctional::enum_zetaa_z, madness::XCfunctional::enum_zetab_x, madness::XCfunctional::enum_zetab_y, madness::XCfunctional::enum_zetab_z, madness::WorldGopInterface::fence(), madness::World::gop, madness::grad(), madness::XCfunctional::is_gga(), madness::XCfunctional::is_spin_polarized(), madness::print(), madness::truncate(), madness::Function< T, NDIM >::world(), xc, and zeta.
|
inline |
|
inline |
set the spin state this operator is acting on
References madness::XCOperator< T, NDIM >::ispin.
Referenced by test_XCOperator().
|
private |
which derivative operator to use
|
private |
additional truncation for the densities in the XC kernel
the densities in the DFT kernal are processed as their inverses, so noise in the small density regions might amplify and lead to inaccurate results. Extra truncation will tighten the truncation threshold by a specified factor, default is 0.01.
Referenced by madness::XCOperator< T, NDIM >::set_extra_truncation().
|
mutableprivate |
the XC functionals depend on the spin of the orbitals they act on
Referenced by madness::XCOperator< T, NDIM >::set_ispin().
|
private |
number of beta orbitals
Referenced by madness::XCOperator< T, NDIM >::XCOperator(), and madness::XCOperator< T, NDIM >::XCOperator().
|
private |
the nuclear correlation factor, if it exists, for computing derivatives for GGA
|
private |
std::shared_ptr<XCfunctional> madness::XCOperator< T, NDIM >::xc |
interface to the actual XC functionals
Referenced by madness::XCOperator< T, NDIM >::XCOperator(), madness::XCOperator< T, NDIM >::XCOperator(), and madness::XCOperator< T, NDIM >::XCOperator().
|
mutableprivate |
functions that are need for the computation of the XC operator
the ordering of the intermediates is fixed, but the code can handle non-initialized functions, so if e.g. no GGA is requested, all the corresponding vector components may be left empty. For the ordering of the intermediates see xcfunctional::xc_arg
Referenced by madness::XCOperator< T, NDIM >::XCOperator(), madness::XCOperator< T, NDIM >::XCOperator(), and madness::XCOperator< T, NDIM >::is_initialized().