35 const std::vector<Real>& g_vector_magnitudes,
38 int number_of_species_types =
static_cast<int>(pseudopotential_set.
size());
39 int number_of_g_vectors =
static_cast<int>(g_vector_magnitudes.size());
42 has_nonlinear_core_correction_ =
false;
43 for (
int type_index = 0; type_index < number_of_species_types; type_index++) {
45 has_nonlinear_core_correction_ =
true;
50 if (!has_nonlinear_core_correction_)
54 core_charge_density_reciprocal_.assign(number_of_g_vectors,
Complex(0.0, 0.0));
55 for (
int g_vector_index = 0; g_vector_index < number_of_g_vectors; g_vector_index++) {
56 for (
int type_index = 0; type_index < number_of_species_types; type_index++) {
59 Real q_value = g_vector_magnitudes[g_vector_index];
60 Real core_charge_density_value =
61 core_charge_density_table.
interpolate(type_index, q_value);
63 Complex structure_factor(0.0, 0.0);
64 for (
int atom_index = 0; atom_index < crystal_structure.
number_of_atoms();
69 const auto& g_vector = planewave_basis.
g_vectors()[g_vector_index];
74 core_charge_density_reciprocal_[g_vector_index] +=
75 core_charge_density_value * structure_factor / cell_volume;