29namespace paw_validation {
37 int angular_momentum_2,
38 int total_angular_momentum) {
39 if (total_angular_momentum < std::abs(angular_momentum_1 - angular_momentum_2))
41 if (total_angular_momentum > angular_momentum_1 + angular_momentum_2)
43 return (angular_momentum_1 + angular_momentum_2 + total_angular_momentum) % 2 == 0;
55 Real worst_deviation = 0.0;
57 int mesh_size = pseudopotential.
mesh_size;
59 for (
int angular_momentum = 0;
62 for (
int channel_1 = 0; channel_1 < number_of_channels; channel_1++) {
63 for (
int channel_2 = 0; channel_2 < number_of_channels; channel_2++) {
67 all_electron_2.angular_momentum,
74 std::vector<Real> integrand(mesh_size);
75 for (
int radial_index = 0; radial_index < mesh_size; radial_index++) {
77 all_electron_1.radial_values[radial_index] *
78 all_electron_2.radial_values[radial_index] -
79 pseudo_1.radial_values[radial_index] * pseudo_2.radial_values[radial_index];
80 integrand[radial_index] =
82 std::pow(pseudopotential.
radial_grid[radial_index], angular_momentum);
89 worst_deviation = std::max(worst_deviation, std::abs(computed - stored));
93 return worst_deviation;
102 Real worst_deviation = 0.0;
105 return worst_deviation;
107 for (
int channel_1 = 0; channel_1 < number_of_channels; channel_1++) {
108 for (
int channel_2 = 0; channel_2 < number_of_channels; channel_2++) {
110 Real augmentation_charge =
112 worst_deviation = std::max(worst_deviation, std::abs(monopole - augmentation_charge));
115 return worst_deviation;
128 Real worst_deviation = 0.0;
130 int mesh_size = pseudopotential.
mesh_size;
132 for (
int projector_index = 0; projector_index < number_of_channels; projector_index++) {
133 for (
int wave_index = 0; wave_index < number_of_channels; wave_index++) {
134 const auto& projector = pseudopotential.
projectors[projector_index];
136 if (projector.angular_momentum != pseudo_wave.angular_momentum)
139 std::vector<Real> integrand(mesh_size);
140 for (
int radial_index = 0; radial_index < mesh_size; radial_index++) {
141 integrand[radial_index] =
142 projector.radial_values[radial_index] * pseudo_wave.radial_values[radial_index];
146 Real expected = (projector_index == wave_index) ? 1.0 : 0.0;
147 worst_deviation = std::max(worst_deviation, std::abs(overlap - expected));
150 return worst_deviation;
160 int mesh_size = pseudopotential.
mesh_size;
162 if (core_density.empty())
165 std::vector<Real> integrand(mesh_size);
166 for (
int radial_index = 0; radial_index < mesh_size; radial_index++) {
168 integrand[radial_index] = core_density[radial_index] * radius * radius;
170 constexpr Real four_pi = 4.0 * M_PI;
183 if (potential.empty() || pseudopotential.
radial_grid.empty())
185 return -0.5 * pseudopotential.
radial_grid[0] * potential[0];
PAW pseudopotential — extends ultrasoft with one-center (on-site) data.
std::vector< PartialWave > partial_waves_pseudo
Pseudo partial waves φ̃_i(r), one per projector channel.
std::vector< PartialWave > partial_waves_all_electron
All-electron partial waves φ_i(r), one per projector channel.
PotentialLocal potential_local_all_electron
All-electron local potential (Ry); diverges as -2Z/r toward the origin.
int number_of_augmentation_angular_momenta
Number of angular-momentum channels, 2·l_max + 1.
std::vector< std::vector< std::vector< Real > > > multipole_moments
ChargeCore charge_core_all_electron
All-electron core density (distinct from the pseudized NLCC core density).
std::vector< Real > radial_grid_derivative
std::vector< Projector > projectors
std::vector< Real > radial_grid
std::vector< std::vector< Real > > augmentation_overlap_integrals
Real worst_projector_duality_deviation(const PawPseudopotential &pseudopotential)
bool is_allowed_augmentation_channel(int angular_momentum_1, int angular_momentum_2, int total_angular_momentum)
Real worst_augmentation_charge_deviation(const PawPseudopotential &pseudopotential)
Real integrated_all_electron_core_charge(const PawPseudopotential &pseudopotential)
Real nuclear_charge_from_all_electron_potential(const PawPseudopotential &pseudopotential)
Real worst_multipole_moment_deviation(const PawPseudopotential &pseudopotential)
Real simpson_rule(const std::vector< Real > &function_values, const std::vector< Real > &integration_factors, int number_of_grid_points)
std::vector< Real > radial_values
std::vector< Real > radial_values