Loading...
Searching...
No Matches
spread_terms.hpp
Go to the documentation of this file.
1#pragma once
2
3/**
4 * SpreadTerms — Omega split into the part no gauge can change and the parts a gauge
5 * can, with the centre and the spread of every function.
6 */
7
8#include <vector>
9
11
12namespace q3 {
13
14struct [[nodiscard]] SpreadTerms {
15 Real gauge_invariant_bohr_squared = 0.0;
16 Real diagonal_bohr_squared = 0.0;
17 Real off_diagonal_bohr_squared = 0.0;
18 /// One centre per Wannier function, in bohr, in the same Cartesian frame as b.
19 std::vector<Vector3D> centers_bohr;
20 /**
21 * One spread per Wannier function, Omega_n = <r^2>_n - |<r>_n|^2 in bohr
22 * squared (MV equations 31 and 32 in finite differences: <r^2>_n is
23 * (1/N_k) sum_kb w_b [(1 - |M_nn|^2) + (Im ln M_nn)^2]). They sum to the
24 * total, which is how the split above and this one are checked against
25 * each other. The three totals say how localised the set is; these say
26 * which function is not, and a driver that has no reference bands to
27 * compare against judges a model by their spread across functions.
28 */
29 std::vector<Real> spreads_bohr_squared;
30
31 [[nodiscard]] Real total_bohr_squared() const {
32 return gauge_invariant_bohr_squared + diagonal_bohr_squared + off_diagonal_bohr_squared;
33 }
34 /// The only part this gauge can move; what the minimiser actually descends.
35 [[nodiscard]] Real minimizable_bohr_squared() const {
36 return diagonal_bohr_squared + off_diagonal_bohr_squared;
37 }
38};
39
40} // namespace q3
double Real
Real minimizable_bohr_squared() const
The only part this gauge can move; what the minimiser actually descends.
std::vector< Vector3D > centers_bohr
One centre per Wannier function, in bohr, in the same Cartesian frame as b.
Real total_bohr_squared() const
std::vector< Real > spreads_bohr_squared