Loading...
Searching...
No Matches
init.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <memory>
4#include <string>
5
12
13namespace q3 {
14
15/**
16 * Converged SCF state for a pseudopotential plane-wave Kohn-Sham calculation.
17 *
18 * Concrete leaf of the SCFState hierarchy. Owns all converged data:
19 *
20 * - quantum_system_snapshot_: shared_ptr to the NormConservingPlanewaveKohnShamQuantumSystem
21 * at convergence. Carries both the electronic state (wavefunction coefficients, eigenvalues,
22 * occupations) and all static pseudopotential data (projectors, local potential, core charge).
23 * Shared with the iterator to avoid re-initializing the expensive pseudopotential basis.
24 *
25 * - energies_data_: the converged energy breakdown.
26 *
27 * Non-owning (iterator-owned, valid for the iterator's lifetime):
28 * - planewave_basis* (inherited from PlanewaveKohnShamSCFState)
29 * - exchange_correlation* (inherited from PlanewaveKohnShamSCFState)
30 */
32 /**
33 * Explicitly default move operations: when a base class has a deleted copy constructor
34 * the derived class's implicit move constructor is also suppressed. We must restore it.
35 */
41
42 // ─── Owned data ─────────────────────────────────────────────────────────
43
44 std::shared_ptr<NormConservingPlanewaveKohnShamQuantumSystem> quantum_system_snapshot_;
46
47 /**
48 * Projector overlap coefficients ⟨ψ|β_i⟩⟨β_j|ψ⟩ summed over bands.
49 * Empty for norm-conserving; populated for ultrasoft by the US iterator.
50 */
52 /**
53 * The same coefficients per spin channel, un-summed. Empty for an
54 * unpolarized run and for norm-conserving.
55 *
56 * Paired with `total_potential_g_by_spin`: the augmentation force and
57 * stress must contract spin channel against matching spin channel.
58 */
59 std::vector<Matrix<Real>> projector_overlap_coefficients_by_spin;
60
61 /// DFT+U (Hubbard) resolved manifolds at convergence; empty means no correction is active.
62 std::vector<HubbardManifold> hubbard_manifolds;
63 /**
64 * Converged per-spin Hubbard D-matrix, block-diagonal column-major buffers (one per spin),
65 * matching accumulate_hubbard_occupation_and_potential()'s own storage convention.
66 */
67 std::vector<std::vector<Complex>> hubbard_d_matrix_per_spin;
68 /**
69 * "atomic" or "ortho-atomic" -- see InputData::hubbard_projector_type. Meaningless when
70 * hubbard_manifolds is empty.
71 */
72 std::string hubbard_projector_type = "atomic";
73
74 // ─── Virtual accessors with covariant return types ───────────────────────
75
76 /**
77 * Return the converged pseudopotential quantum system (covariant return).
78 * Callers with the concrete type get NormConservingPlanewaveKohnShamQuantumSystem&;
79 * callers with PlanewaveKohnShamSCFState& get PlanewaveKohnShamQuantumSystem& via base.
80 */
82 quantum_system() const override {
84 }
85
86 /// Return the converged energy breakdown (covariant return).
87 [[nodiscard]] const NormConservingPlanewaveKohnShamEnergies& energies() const override {
88 return energies_data_;
89 }
90};
91
92} // namespace q3
std::vector< Matrix< Real > > projector_overlap_coefficients_by_spin
Definition init.hpp:59
const NormConservingPlanewaveKohnShamQuantumSystem & quantum_system() const override
Definition init.hpp:82
std::vector< HubbardManifold > hubbard_manifolds
DFT+U (Hubbard) resolved manifolds at convergence; empty means no correction is active.
Definition init.hpp:62
NormConservingPlanewaveKohnShamEnergies energies_data_
Definition init.hpp:45
std::shared_ptr< NormConservingPlanewaveKohnShamQuantumSystem > quantum_system_snapshot_
Definition init.hpp:44
~NormConservingPlanewaveKohnShamSCFState() override=default
const NormConservingPlanewaveKohnShamEnergies & energies() const override
Return the converged energy breakdown (covariant return).
Definition init.hpp:87
NormConservingPlanewaveKohnShamSCFState & operator=(NormConservingPlanewaveKohnShamSCFState &&)=default
std::vector< std::vector< Complex > > hubbard_d_matrix_per_spin
Definition init.hpp:67
NormConservingPlanewaveKohnShamSCFState(NormConservingPlanewaveKohnShamSCFState &&)=default