64 for (
int row = 0; row < 3; row++) {
77 int number_of_bands) {
78 const std::array<int, 3>& grid_dimensions = specification.
grid;
90 log::info(
"NSCF: building the model from bands {} to {} of {}",
91 specification.
bands[0],
92 specification.
bands[1],
97 std::unique_ptr<PlanewaveLocalOrbitalSet> trial_orbitals =
103 log::info(
"NSCF: building Wannier interface matrices on the {}x{}x{} grid ({} k-points) "
109 trial_orbitals->description());
131 if (ultrasoft_system ==
nullptr) {
132 throw std::logic_error(
133 "control.interpolation: the pseudopotentials carry augmentation charges but the "
134 "quantum-system snapshot is not the ultrasoft one; the iterator factory and this "
135 "builder disagree about the run's pseudopotential type.");
137 log::info(
"NSCF: ultrasoft/PAW pseudopotentials -- including the augmentation term in "
138 "M_mn(k,b) and the S metric in A_mn(k)");
163[[nodiscard]]
inline InterpolationRecord
166 int number_of_bands) {
168 throw std::runtime_error(
169 "control.interpolation is not supported under MPI: building the model needs each "
170 "k-point's neighbours, and k-point pools hold only their own k-points, so no rank "
171 "can reach the states it would have to overlap. Nothing exchanges them across pools "
172 "yet. Run the NSCF that builds the model with a serial binary; evaluating the model "
173 "afterwards is cheap and serial anyway.");
180 if (specification.
method ==
"wannier") {
192 log::info(
"NSCF: the record holds {} bands and {} trial orbitals, so it needs a "
193 "subspace choice: evaluate it with "
194 "control.interpolation.disentanglement: projectability, or export it "
195 "(export_formats: [wannier90]) for a code that disentangles. The one-shot "
196 "projection gauge on its own needs an isolated manifold with as many bands "
197 "as Wannier functions.",
203 throw std::runtime_error(
"control.interpolation.method '" + specification.
method +
204 "' has no plane-wave builder; supported: wannier.");
const Matrix3x3 & reciprocal_lattice_vectors() const
const Matrix3x3 & lattice_vectors() const
Real lattice_parameter() const
int number_of_kpoints() const
Crystal & crystal_structure() const
const std::vector< std::vector< int > > & g_vector_indices() const
const PlanewaveKohnShamQuantumSystem & quantum_system() const
const KPointsGrid & kpoint_grid() const
const execution::PlanewaveExecutionPolicy & execution_policy() const
const PlanewaveBasis & planewave_basis() const
const NormConservingPlanewaveKohnShamQuantumSystem & norm_conserving_quantum_system() const
const PseudopotentialSet & pseudopotential_set() const
void refresh_quantum_system_snapshot()
WannierInputs build_ultrasoft(const KPointsGrid &kpoint_grid, int grid_dimension_x, int grid_dimension_y, int grid_dimension_z, int number_of_bands, const std::vector< std::vector< int > > &g_vector_indices_by_kpoint, const UltrasoftPlanewaveKohnShamQuantumSystem &quantum_system, const PlanewaveLocalOrbitalSet &trial_orbitals, const execution::PlanewaveExecutionPolicy &execution_policy, int first_band_index=0) const
WannierInputs build(const KPointsGrid &kpoint_grid, int grid_dimension_x, int grid_dimension_y, int grid_dimension_z, int number_of_bands, const std::vector< std::vector< int > > &g_vector_indices_by_kpoint, const PlanewaveKohnShamQuantumSystem &quantum_system, const PlanewaveLocalOrbitalSet &trial_orbitals, int first_band_index=0) const
bool has_augmentation_charges() const
virtual bool one_process_owns_complete_state() const =0
void record_lattice(const Crystal &crystal_structure, InterpolationRecord &record)
The crystal's lattice in the record's units: Cartesian bohr, and inverse bohr with the 2 pi.
WannierInputs build_wannier_interface_record(const InterpolationSpecification &specification, PlanewavePseudopotentialKohnShamSCFIterator &iterator, int number_of_bands)
The Wannier method's record: interface matrices on the full k-grid.
void info(spdlog::format_string_t< Args... > fmt, Args &&... args)
std::unique_ptr< PlanewaveLocalOrbitalSet > create_planewave_local_orbital_set(const Crystal &crystal_structure, const PseudopotentialSet &pseudopotential_set, const std::vector< Vector3D > &explicit_centers_crystal, Real decay_length_bohr, const std::map< std::string, std::vector< int > > &trial_shells={})
InterpolationRecord capture_interpolation_record(const InterpolationSpecification &specification, PlanewavePseudopotentialKohnShamSCFIterator &iterator, int number_of_bands)
WannierInputs wannier
Payload for method == "wannier": interface matrices on the full k-grid.
Matrix3x3 real_lattice_bohr
Rows a1, a2, a3, Cartesian, in bohr.
std::string method
The method that built the payload: "wannier".
Matrix3x3 reciprocal_lattice_inverse_bohr
Rows b1, b2, b3, Cartesian, in inverse bohr, with the 2 pi included.
Real fermi_energy_rydberg
bool has_band_selection() const
std::map< std::string, std::vector< int > > trial_shells
int first_band_index() const
0-based index of the first selected band; 0 when no range was given.
std::array< int, 2 > bands
int number_of_selected_bands() const
How many bands the range holds; 0 when no range was given.
std::string method
"" when no interpolation was asked for; otherwise the method name ("wannier").
std::array< int, 3 > grid
The full k-point grid control.kpoints_list enumerates; {0,0,0} = not stated.
Real projection_decay_bohr
Wannier: decay length of those orbitals in bohr (Wannier90's zona is 1/a).
std::vector< Vector3D > projection_centers