Loading...
Searching...
No Matches
init.hpp
Go to the documentation of this file.
1#pragma once
2
3/**
4 * QuantumStateInterpolator — eigenvalues at any k-point, from a model built out of a
5 * finished calculation.
6 *
7 * This is the umbrella over the interpolation METHODS. What differs between
8 * them is what got interpolated. Wannier functions interpolate a Hamiltonian
9 * in a localized basis: the k -> R transform of the coarse-mesh Bloch
10 * Hamiltonian in the projection gauge, evaluated back at any k by a Bloch
11 * sum. A Fourier fit interpolates the eigenvalues themselves, band by band,
12 * with symmetry-adapted plane waves. An optimal-basis construction
13 * interpolates the Hamiltonian in a compressed delocalized basis. Each has
14 * its own failure mode -- a gauge that needs localizing, crossings smoothed
15 * by index, a basis that grows with the band count -- and the umbrella must
16 * not hide that, which is why the method stays visible in the input and in
17 * the saved record.
18 *
19 * What they share is exactly this interface: hand over a k-point, get the
20 * eigenvalues. The band-structure and density-of-states calculators in
21 * layer 5 are written against it, so a new method reaches every consumer by
22 * implementing one class and one line in the factory beside this file.
23 *
24 * k-points are crystal (fractional) coordinates, as everywhere else in Q3.
25 * Implementations may keep scratch state (a LAPACK workspace, say) behind a
26 * const interface; none is required to be safe to share between threads,
27 * so a threaded consumer gives each thread its own instance.
28 */
29
30#include <map>
31#include <string>
32#include <vector>
33
35
36namespace q3 {
37
39 public:
40 virtual ~QuantumStateInterpolator() = default;
41
42 /// Number of eigenvalues returned per k-point.
43 [[nodiscard]] virtual int number_of_bands() const = 0;
44
45 /// Ascending eigenvalues in Rydberg at one k-point in crystal coordinates.
46 [[nodiscard]] virtual std::vector<Real> eigenvalues_at(const Vector3D& kpoint) const = 0;
47
48 /// One line for logs: the method and the size of the model.
49 [[nodiscard]] virtual std::string description() const = 0;
50
51 /**
52 * Method-specific numbers worth reporting beside the results -- a
53 * model's size, a weight identity it checked -- keyed by a name fit for a
54 * JSON report. Empty by default; a method with nothing to add adds
55 * nothing.
56 */
57 [[nodiscard]] virtual std::map<std::string, Real> diagnostics() const {
58 return {};
59 }
60};
61
62} // namespace q3
virtual int number_of_bands() const =0
Number of eigenvalues returned per k-point.
virtual std::string description() const =0
One line for logs: the method and the size of the model.
virtual std::map< std::string, Real > diagnostics() const
Definition init.hpp:57
virtual ~QuantumStateInterpolator()=default
virtual std::vector< Real > eigenvalues_at(const Vector3D &kpoint) const =0
Ascending eigenvalues in Rydberg at one k-point in crystal coordinates.