Loading...
Searching...
No Matches
local_density.hpp
Go to the documentation of this file.
1#pragma once
2
3/**
4 * LocalDensityExchangeCorrelationPotentialCalculator — V_xc for functionals
5 * that depend on the density alone (LDA).
6 *
7 * A direct pass through the functional's pointwise evaluation; no gradients,
8 * so the reciprocal-space density arguments are deliberately unused. Holds no
9 * basis or crystal reference for the same reason.
10 */
11
12#include <complex>
13#include <vector>
14
18
19namespace q3 {
20
23 public:
25 const XCFunctional& exchange_correlation)
26 : exchange_correlation_(exchange_correlation) {}
27
28 void
29 evaluate_unpolarized(const std::vector<Real>& exchange_correlation_density,
30 const std::vector<Complex>& /*exchange_correlation_density_g*/,
31 std::vector<Real>& exchange_correlation_potential,
32 std::vector<Real>& exchange_correlation_energy_density) const override {
33 exchange_correlation_.compute(exchange_correlation_density,
34 exchange_correlation_potential,
35 exchange_correlation_energy_density);
36 }
37
38 void
39 evaluate_spin_polarized(const std::vector<Real>& exchange_correlation_density_up,
40 const std::vector<Real>& exchange_correlation_density_down,
41 const std::vector<Complex>& /*exchange_correlation_density_up_g*/,
42 const std::vector<Complex>& /*exchange_correlation_density_down_g*/,
43 std::vector<Real>& exchange_correlation_potential_up,
44 std::vector<Real>& exchange_correlation_potential_down,
45 std::vector<Real>& exchange_correlation_energy_density) const override {
46 exchange_correlation_.compute_spin(exchange_correlation_density_up,
47 exchange_correlation_density_down,
48 exchange_correlation_potential_up,
49 exchange_correlation_potential_down,
50 exchange_correlation_energy_density);
51 }
52
53 private:
54 const XCFunctional& exchange_correlation_;
55};
56
57} // namespace q3
void evaluate_unpolarized(const std::vector< Real > &exchange_correlation_density, const std::vector< Complex > &, std::vector< Real > &exchange_correlation_potential, std::vector< Real > &exchange_correlation_energy_density) const override
Fill V_xc and the energy density for a spin-unpolarized density.
LocalDensityExchangeCorrelationPotentialCalculator(const XCFunctional &exchange_correlation)
void evaluate_spin_polarized(const std::vector< Real > &exchange_correlation_density_up, const std::vector< Real > &exchange_correlation_density_down, const std::vector< Complex > &, const std::vector< Complex > &, std::vector< Real > &exchange_correlation_potential_up, std::vector< Real > &exchange_correlation_potential_down, std::vector< Real > &exchange_correlation_energy_density) const override
Fill per-spin V_xc and the energy density for an LSDA density pair.
Abstract base class for XC functionals.
Definition init.hpp:23
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_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
Definition init.hpp:38