Loading...
Searching...
No Matches
paw.hpp
Go to the documentation of this file.
1#pragma once
2
3/**
4 * PawBetaFunctionTable — β(q) tabulation for sets containing PAW datasets
5 * that supply their projectors in reciprocal space.
6 *
7 * Such a dataset carries no radial projector at all, so the base table's
8 * Bessel transform would integrate an empty array and tabulate zeros — the
9 * nonlocal term silently vanishing. This subclass resamples the dataset's own
10 * β(q) table instead, which is also more faithful than any radial round trip:
11 * the tabulated range ends far above every physical cutoff, while inverting a
12 * 100-point table truncates.
13 *
14 * The override is per projector and falls back to the base implementation for
15 * any species that supplies projectors radially, so mixed sets — UPF species
16 * alongside reciprocally tabulated ones — tabulate each species the way its dataset
17 * intends. This file is the one place plane-wave tabulation code is allowed
18 * to know the PAW type; everything shared stays flavor-blind (see the base
19 * class header).
20 */
21
22#include <vector>
23
27
28namespace q3 {
29
31 protected:
32 void tabulate_projector(const Pseudopotential& pseudopotential,
33 int projector_index,
34 const std::vector<Real>& q_point_values,
35 std::vector<Real>& destination) const override {
36 const auto* paw = dynamic_cast<const PawPseudopotential*>(&pseudopotential);
37 if (paw != nullptr && paw->has_reciprocal_projectors() &&
38 projector_index < static_cast<int>(paw->projectors_reciprocal.size())) {
39 resample_uniform_reciprocal_table(paw->projectors_reciprocal[projector_index],
40 paw->reciprocal_grid_spacing,
41 paw->projectors[projector_index].angular_momentum,
42 q_point_values,
43 destination);
44 return;
45 }
47 pseudopotential, projector_index, q_point_values, destination);
48 }
49};
50
51} // namespace q3
virtual void tabulate_projector(const Pseudopotential &pseudopotential, int projector_index, const std::vector< Real > &q_point_values, std::vector< Real > &destination) const
Definition init.hpp:95
void tabulate_projector(const Pseudopotential &pseudopotential, int projector_index, const std::vector< Real > &q_point_values, std::vector< Real > &destination) const override
Definition paw.hpp:32
PAW pseudopotential — extends ultrasoft with one-center (on-site) data.
Definition init.hpp:33
Base class for all pseudopotential types.
Definition init.hpp:35
void resample_uniform_reciprocal_table(const std::vector< Real > &samples, Real spacing, int angular_momentum, const std::vector< Real > &q_values, std::vector< Real > &result)