Loading...
Searching...
No Matches
spread_minimization_result.hpp
Go to the documentation of this file.
1#pragma once
2
3/**
4 * SpreadMinimizationResult — the gauge SpreadMinimizer stopped at, the spread there,
5 * and how it stopped: converged or not, stationary or not, and by which guide.
6 */
7
8#include <vector>
9
13
14namespace q3 {
15
16struct [[nodiscard]] SpreadMinimizationResult {
17 /// One N x N unitary per k-point; post-multiplies the gauge.
18 std::vector<DenseMatrix<Complex>> gauges;
20 int iterations = 0;
21 /// Omega_D + Omega_OD before any rotation, for the log line and the report.
22 Real initial_minimizable_bohr_squared = 0.0;
23 /**
24 * Whether the minimisation ended on its own terms rather than by running
25 * out of iterations. A line search that can find no step to take is the
26 * ordinary way to arrive at a minimum, not a failure, so it counts here.
27 */
28 bool converged = false;
29 /**
30 * Whether the gauge is actually stationary. This is the stricter question
31 * and it is a separate one: a step that has collapsed produces a spread
32 * that stops changing, which satisfies any progress test ever written while
33 * the gradient is still enormous. Copper stops with a gradient a thousandth
34 * of where it began, at a real minimum; a rattled four-atom supercell stops
35 * having barely moved, with a gradient still at 80% of its initial value.
36 * Only the first has earned the phrase "maximally localized".
37 */
38 bool stationary = false;
39 /// Root-mean-square gradient per k-point where the minimisation stopped.
40 Real gradient_norm = 0.0;
41};
42
43} // namespace q3
double Real
std::vector< DenseMatrix< Complex > > gauges
One N x N unitary per k-point; post-multiplies the gauge.