Loading...
Searching...
No Matches
projection_gauge_choice.hpp
Go to the documentation of this file.
1#pragma once
2
3/**
4 * ProjectionGaugeChoice — the projection gauge as it stands. Exact at the
5 * mesh points and only as good as the trial orbitals between them; the
6 * choice for a record that cannot support localisation, and for a caller
7 * that refused it.
8 *
9 * Its spread is still evaluated where it is defined: per-function spreads
10 * at the gauge the model actually uses are what a driver reads to judge it.
11 * The guiding centres only fix the branch of each phase; with the trial
12 * orbitals to guide by the centres come out beside them, and without, on
13 * the principal branch.
14 */
15
23
24namespace q3 {
25
27 public:
28 [[nodiscard]] WannierGauge choose(const WannierConstructionInputs& inputs,
29 const WannierSubspace& subspace) const override {
30 WannierGauge gauge;
31 gauge.frames = subspace.frames;
32 if (!inputs.spread_is_defined()) {
33 /**
34 * Omega_I is the one spread term a disentangled model has even on
35 * a mesh where the centres are undefined; the subspace iteration
36 * measured it, so it is reported.
37 */
40 return gauge;
41 }
42 const WannierInputs& record = inputs.record();
43 const bool guided = record.has_trial_orbital_centers();
44 const std::shared_ptr<const PhaseBranch> branch =
45 guided ? std::shared_ptr<const PhaseBranch>(std::make_shared<const GuidedPhaseBranch>(
47 : std::make_shared<const PrincipalPhaseBranch>();
48 const SpreadTerms terms =
49 SpreadFunctional(inputs.stencil(), inputs.number_of_wannier_functions(), branch)
50 .evaluate(inputs.overlaps_in_gauge(subspace.classification, subspace.frames));
52 terms, guided, record.trial_orbital_centers_bohr, terms.minimizable_bohr_squared());
53 return gauge;
54 }
55};
56
57} // namespace q3
WannierGauge choose(const WannierConstructionInputs &inputs, const WannierSubspace &subspace) const override
SpreadTerms evaluate(const BlochOverlaps &rotated_overlaps) const
rotated_overlaps: N x N at every (k, b), between the Wannier-gauge states at k and k+b.
const WannierInputs & record() const
The inputs as the record stores them.
const KPointStencil & stencil() const
BlochOverlaps overlaps_in_gauge(const BandClassification &classification, const std::vector< DenseMatrix< Complex > > &frames) const
Real gauge_invariant_spread_bohr_squared
Omega_I of the subspace the iteration settled on, bohr squared.
static SpreadReport evaluated_as(const SpreadTerms &terms, bool guided_by_trial_orbitals, std::vector< Vector3D > trial_orbital_centers_bohr, Real initial_minimizable_bohr_squared)
Real gauge_invariant_bohr_squared
Real minimizable_bohr_squared() const
The only part this gauge can move; what the minimiser actually descends.
SpreadReport spread
std::vector< DenseMatrix< Complex > > frames
std::vector< Vector3D > trial_orbital_centers_bohr
Definition inputs.hpp:87
bool has_trial_orbital_centers() const
Whether every trial orbital's position is known: the localiser's guiding centres.
Definition inputs.hpp:102
BandClassification classification
std::vector< DenseMatrix< Complex > > frames
DisentanglementReport report