Loading...
Searching...
No Matches
init.hpp
Go to the documentation of this file.
1#pragma once
2
3/**
4 * PlanewaveLocalOrbitalSet — a set of localized orbitals RENDERED in the
5 * plane-wave basis at one k-point.
6 *
7 * A local orbital is an abstract object: a centre, an angular character, a
8 * radial form. This interface is what it looks like from inside the
9 * plane-wave representation -- a vector of coefficients over the k-point's
10 * G-vectors, for each orbital in the set -- which is the form every
11 * plane-wave-side consumer needs: projections <psi_nk|g>, overlaps between
12 * orbitals, the initial guess of a Wannier construction.
13 *
14 * Implementations differ only in where the orbitals come from:
15 * PlanewavePseudoAtomicOrbitalSet reads them from the pseudopotential's
16 * tabulated atomic wavefunctions, PlanewaveHydrogenicOrbitalSet places
17 * analytic s orbitals at arbitrary centres. A consumer written against this
18 * interface serves both, and any future source -- Gaussians, numerical
19 * atomic orbitals from a basis-set file -- without change. That is the
20 * point of the seam: the CHOICE of orbitals is a strategy, made once by the
21 * factory beside this file, not a branch repeated in every consumer.
22 */
23
24#include <string>
25#include <vector>
26
31
32namespace q3 {
33
35 public:
36 virtual ~PlanewaveLocalOrbitalSet() = default;
37
38 [[nodiscard]] virtual int number_of_orbitals() const = 0;
39
40 /**
41 * Render every orbital at one k-point: on return
42 * `orbitals[orbital_index][g_index]` holds the coefficient of the
43 * `g_vector_indices[g_index]`-th plane wave, so the result is stored
44 * against exactly the G-vector list the wavefunctions at that k-point
45 * use and can be contracted with them directly.
46 *
47 * Normalisation is left to the implementation; consumers that need
48 * orthonormal orbitals in a given metric orthonormalize them.
49 */
50 virtual void build(int kpoint_index,
51 int number_of_plane_waves,
52 const std::vector<int>& g_vector_indices,
53 const Crystal& crystal_structure,
54 const KPointsGrid& kpoint_grid,
55 const PlanewaveBasis& planewave_basis,
56 std::vector<std::vector<Complex>>& orbitals) const = 0;
57
58 /// One line for logs, naming the source and the count.
59 [[nodiscard]] virtual std::string description() const = 0;
60
61 /**
62 * Where each orbital sits, in crystal (fractional) coordinates, in orbital
63 * order. A localiser needs these: the branch of Im ln M_nn is fixed by
64 * choosing, for each diagonal overlap, the value nearest the one a known
65 * centre implies, and the trial orbital's own position is the one thing
66 * known about the Wannier function before anything has been minimised.
67 * Deriving a guide from the projection gauge's Berry-phase centres instead
68 * was tried and fails on exactly the structures that need guiding -- when
69 * the branches are inconsistent across k, those centres are already wrong.
70 */
71 [[nodiscard]] virtual std::vector<Vector3D> centers_crystal() const = 0;
72};
73
74} // namespace q3
virtual ~PlanewaveLocalOrbitalSet()=default
virtual int number_of_orbitals() const =0
virtual std::string description() const =0
One line for logs, naming the source and the count.
virtual void build(int kpoint_index, int number_of_plane_waves, const std::vector< int > &g_vector_indices, const Crystal &crystal_structure, const KPointsGrid &kpoint_grid, const PlanewaveBasis &planewave_basis, std::vector< std::vector< Complex > > &orbitals) const =0
virtual std::vector< Vector3D > centers_crystal() const =0