Loading...
Searching...
No Matches
isolated_manifold_selection.hpp
Go to the documentation of this file.
1#pragma once
2
3/**
4 * IsolatedManifoldSelection — the band window as it stands: the bands ARE
5 * the N states, and the frame at each k-point is their projection gauge
6 * U(k) = A (A^dagger A)^(-1/2).
7 *
8 * That gauge is defined only when there are exactly as many bands as Wannier
9 * functions. With more bands, U^dagger E U is a Rayleigh quotient in a
10 * subspace chosen independently at each k, meaningful only after
11 * disentanglement has made that choice smooth across the mesh. Such inputs
12 * are refused rather than interpolated, with the two ways out named.
13 *
14 * The window is described as a classification that keeps every band and
15 * freezes none. That is not a formality: it lets the gauge choice and the
16 * Fourier step run as one code path for both selections, and a second path
17 * is where the two cases drift apart.
18 */
19
20#include <stdexcept>
21#include <string>
22
29
30namespace q3 {
31
33 public:
34 [[nodiscard]] WannierSubspace choose(const WannierConstructionInputs& inputs) const override {
35 const WannierInputs& record = inputs.record();
36 if (record.number_of_bands != record.number_of_trial_orbitals) {
37 throw std::invalid_argument(
38 "IsolatedManifoldSelection: the inputs hold " +
39 std::to_string(record.number_of_bands) + " bands and " +
40 std::to_string(record.number_of_trial_orbitals) +
41 " Wannier functions. The projection gauge on its own is defined only for an "
42 "isolated manifold with as many bands as Wannier functions. Either recompute with "
43 "number_of_bands = " +
44 std::to_string(record.number_of_trial_orbitals) + ", choose " +
45 std::to_string(record.number_of_bands) +
46 " trial orbitals, or set control.interpolation.disentanglement: projectability "
47 "to choose the subspace from this wider window.");
48 }
49 WannierSubspace subspace;
50 subspace.classification =
54 return subspace;
55 }
56};
57
58} // namespace q3
WannierSubspace choose(const WannierConstructionInputs &inputs) const override
std::vector< DenseMatrix< Complex > > compute_all(const std::vector< DenseMatrix< Complex > > &projections) const
U(k) for every k-point's projection block; a refusal names the k-point it happened at.
std::vector< DenseMatrix< Complex > > projections_restricted_to(const BandClassification &classification) const
A(k) restricted to the bands classification keeps at each k-point: kept x N, band as row.
const WannierInputs & record() const
The inputs as the record stores them.
static BandClassification every_band_kept(int number_of_kpoints, int number_of_bands)
int number_of_trial_orbitals
Definition inputs.hpp:72
BandClassification classification
std::vector< DenseMatrix< Complex > > frames