Abstract base class for XC functionals. More...
#include <init.hpp>
Inheritance diagram for q3::XCFunctional:Public Member Functions | |
| virtual | ~XCFunctional ()=default |
| virtual void | compute (const std::vector< Real > &density, std::vector< Real > &xc_potential, std::vector< Real > &xc_energy_density) const =0 |
| Compute XC potential and energy density (LDA interface, unpolarized). | |
| virtual void | compute_exchange_correlation_kernel (const std::vector< Real > &density, std::vector< Real > &exchange_correlation_kernel) const |
| virtual void | compute_fxc_spin (const std::vector< Real > &density_up, const std::vector< Real > &density_down, std::vector< Real > &fxc_uu, std::vector< Real > &fxc_ud, std::vector< Real > &fxc_dd) const |
| virtual void | compute_gradient_corrected (const std::vector< Real > &density, const std::vector< Real > &gradient_density_squared, std::vector< Real > &xc_potential, std::vector< Real > &gradient_correction_density, std::vector< Real > &xc_energy_density) const |
| virtual void | compute_gradient_corrected_spin (const std::vector< Real > &density_up, const std::vector< Real > &density_down, const std::vector< Real > &grho2_uu, const std::vector< Real > &grho2_ud, const std::vector< Real > &grho2_dd, std::vector< Real > &xc_potential_up, std::vector< Real > &xc_potential_down, std::vector< Real > &gradient_correction_up_up, std::vector< Real > &gradient_correction_up_down, std::vector< Real > &gradient_correction_down_down, std::vector< Real > &xc_energy_density) const |
| virtual void | compute_spin (const std::vector< Real > &density_up, const std::vector< Real > &density_down, std::vector< Real > &xc_potential_up, std::vector< Real > &xc_potential_down, std::vector< Real > &xc_energy_density) const |
| virtual std::string | name () const =0 |
| virtual int | number_of_spin_components () const |
| virtual bool | requires_density_gradient () const |
| Whether this is a GGA functional (needs gradients). | |
|
virtualdefault |
|
pure virtual |
Compute XC potential and energy density (LDA interface, unpolarized).
Implemented in q3::XC_LibXC.
Referenced by compute_exchange_correlation_kernel(), q3::paw_one_center::compute_one_center_xc(), and q3::LocalDensityExchangeCorrelationPotentialCalculator::evaluate_unpolarized().
|
inlinevirtual |
Compute spin-resolved XC kernel for LSDA.
Definition at line 172 of file init.hpp.
References compute_spin().
|
inlinevirtual |
Compute XC potential and energy density (GGA interface, unpolarized). gradient_density_squared[i] = |∇ρ|² at grid point i.
This default body is refused rather than reached: a GGA calculation using a functional that did not override compute_gradient_corrected() would silently fall back to LDA, producing numerically wrong results with no error.
Reimplemented in q3::XC_LibXC.
Definition at line 84 of file init.hpp.
Referenced by q3::paw_one_center::compute_one_center_xc_gradient_corrected(), and q3::GradientCorrectedExchangeCorrelationPotentialCalculator::evaluate_unpolarized().
|
inlinevirtual |
Compute XC potential and energy density (GGA interface, spin-polarized). grho2_uu = |∇ρ↑|², grho2_ud = ∇ρ↑·∇ρ↓, grho2_dd = |∇ρ↓|²
This default body is refused rather than reached: a spin-polarized GGA calculation using a functional that did not override compute_gradient_corrected_spin() would silently produce wrong physics.
Reimplemented in q3::XC_LibXC.
Definition at line 110 of file init.hpp.
Referenced by q3::paw_one_center::compute_one_center_xc_gradient_corrected_spin(), and q3::GradientCorrectedExchangeCorrelationPotentialCalculator::evaluate_spin_polarized().
|
inlinevirtual |
Compute XC potential and energy density (LDA interface, spin-polarized). density_up/density_down are spin-up/spin-down densities. xc_potential_up/xc_potential_down are the spin-resolved XC potentials. xc_energy_density is the XC energy density (per unit volume, evaluated at total density).
This default body is refused rather than reached: a spin-polarized calculation using a functional that did not override compute_spin() would silently produce wrong physics (LDA-unpolarized result for a spin-polarized input).
Reimplemented in q3::XC_LibXC.
Definition at line 38 of file init.hpp.
Referenced by compute_fxc_spin(), q3::paw_one_center::compute_one_center_xc_spin(), and q3::LocalDensityExchangeCorrelationPotentialCalculator::evaluate_spin_polarized().
|
pure virtual |
Implemented in q3::XC_LibXC.
|
inlinevirtual |
The spin mode this functional was constructed for: 1 or 2.
A LibXC handle is initialized once for a fixed mode and cannot be used in the other — a polarized handle driven through compute() misreads the interleaved (ρ↑, ρ↓) array it expects, and returns numbers that are finite, plausible and wrong. Callers that pick between the unpolarized and spin-polarized routines must branch on this rather than on how many densities they happen to hold.
Reimplemented in q3::XC_LibXC.
|
inlinevirtual |
Whether this is a GGA functional (needs gradients).
Reimplemented in q3::XC_LibXC.
Definition at line 62 of file init.hpp.
Referenced by q3::paw_one_center::PawOneCenterTerms::build(), q3::create_exchange_correlation_gradient_stress_calculator(), and q3::create_exchange_correlation_potential_calculator().