49namespace paw_one_center {
64 [[nodiscard]]
int size()
const {
95 [[nodiscard]]
Real at(
int spin,
int first,
int second)
const {
99 Real&
at(
int spin,
int first,
int second) {
127 maximum = std::max(maximum, wave.angular_momentum);
128 int product_degree = 2 * maximum;
129 return (product_degree + 1) * (product_degree + 1);
146 std::vector<Real>(densities.
mesh_size, 0.0));
149 int number_of_channels = expansion.
size();
152 for (
int first = 0; first < number_of_channels; first++) {
153 for (
int second = 0; second < number_of_channels; second++) {
154 Real occupancy = occupancies.
at(spin, first, second);
155 if (occupancy == 0.0)
160 int lm_first = expansion.
lm_index[first];
161 int lm_second = expansion.
lm_index[second];
163 const auto& all_electron_first =
165 const auto& all_electron_second =
167 const auto& pseudo_first =
169 const auto& pseudo_second =
172 int pair_index = radial_first * number_of_radial + radial_second;
178 Real weight = occupancy * angular;
181 int angular_momentum = 0;
182 while ((angular_momentum + 1) * (angular_momentum + 1) <= lm)
185 const std::vector<Real>* augmentation =
nullptr;
193 const auto& candidate =
196 if (!candidate.empty())
197 augmentation = &candidate;
200 for (
int point = 0; point < densities.
mesh_size; point++) {
202 weight * all_electron_first[point] * all_electron_second[point];
203 Real pseudo_value = pseudo_first[point] * pseudo_second[point];
204 if (augmentation !=
nullptr)
205 pseudo_value += (*augmentation)[point];
206 densities.
pseudo[lm][point] += weight * pseudo_value;
223 int angular_momentum,
224 const std::vector<Real>& radial_grid,
225 const std::vector<Real>& radial_grid_derivative,
227 std::vector<Real> integrand(mesh_size);
228 for (
int point = 0; point < mesh_size; point++) {
229 integrand[point] = density_channel[point] * std::pow(radial_grid[point], angular_momentum);
231 return simpson_rule(integrand, radial_grid_derivative, mesh_size);
236 int angular_momentum = 0;
237 while ((angular_momentum + 1) * (angular_momentum + 1) <= lm_index)
239 return angular_momentum;
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.
std::vector< std::vector< std::vector< Real > > > augmentation_function_by_angular_momentum
OneCenterDensities build_one_center_densities(const PawPseudopotential &pseudopotential, const ChannelExpansion &expansion, const OnSiteOccupancies &occupancies, const GauntCoefficientTable &gaunt, int spin)
int angular_momentum_of_lm(int lm_index)
The L of a flat lm index.
ChannelExpansion expand_channels(const PawPseudopotential &pseudopotential)
int density_lm_count(const PawPseudopotential &pseudopotential)
Number of lm channels a density needs: products of two l_max harmonics.
Real density_channel_moment(const std::vector< Real > &density_channel, int angular_momentum, const std::vector< Real > &radial_grid, const std::vector< Real > &radial_grid_derivative, int mesh_size)
int harmonic_combined_degree_order_index(int degree, int order)
Real simpson_rule(const std::vector< Real > &function_values, const std::vector< Real > &integration_factors, int number_of_grid_points)
std::vector< int > harmonic_order_sequence(int degree)
std::vector< std::vector< std::vector< Real > > > coefficients
std::vector< int > lm_index
flat (l,m) index
std::vector< int > radial_channel
index into partial_waves_*
std::vector< int > angular_momentum
l of that channel
int number_of_spin_components
std::vector< Real > values
[spin][i * nh + j], symmetric in (i, j)
static OnSiteOccupancies zeros(int number_of_channels, int number_of_spin_components=1)
Real & at(int spin, int first, int second)
int number_of_channels
expanded channel count (nh)
Real at(int spin, int first, int second) const
lm-decomposed one-center densities, r-weighted, for one spin channel.
std::vector< std::vector< Real > > all_electron
[lm][radial point]
std::vector< std::vector< Real > > pseudo
[lm][radial point], compensated