46 : settings_(settings) {}
53 "MaximallyLocalizedGaugeChoice: localization needs the neighbour overlaps "
54 "M_mn(k,b), and this record carries none. The spread is defined through them; "
55 "without them there is nothing to minimise. Recapture the record with Q3, or ask "
56 "for control.interpolation.localization: none and accept the projection gauge.");
59 if (two_point_direction) {
64 "MaximallyLocalizedGaugeChoice: the k-mesh is " + std::to_string(grid[0]) +
"x" +
65 std::to_string(grid[1]) +
"x" + std::to_string(grid[2]) +
66 ", and the neighbour direction (" + std::to_string(step.
x) +
", " +
67 std::to_string(step.
y) +
", " + std::to_string(step.
z) +
68 ") reaches the same k-point as its opposite. The Wannier centres are "
69 "finite-difference Berry phases, which need k+b and k-b to be distinct, so "
70 "localization cannot produce meaningful centres or spreads on this mesh. Use "
71 "at least three k-points along every periodic direction, or set "
72 "control.interpolation.localization: none and accept the projection gauge.");
81 if (!has_trial_centers) {
82 log::info(
"localization: the record carries no trial-orbital centres (older format "
83 "or imported), so the projection gauge's own centres guide the phase "
84 "branches; recapture with Q3 to guide by the trial orbitals instead");
103 std::make_shared<const GuidedPhaseBranch>(
114 for (std::size_t kpoint_index = 0; kpoint_index < subspace.
frames.size(); kpoint_index++) {
116 subspace.
frames[kpoint_index],
118 localized.
gauges[kpoint_index]));
const IntegerVector3D & grid_step(int direction) const
MaximallyLocalizedGaugeChoice(SpreadMinimizationSettings settings)
WannierGauge choose(const WannierConstructionInputs &inputs, const WannierSubspace &subspace) const override
static void require_supported(const WannierConstructionInputs &inputs)
Throws WannierDiagnosticError, with the way out named, when the record cannot be localised.
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.
SpreadMinimizationResult run(const BlochOverlaps &overlaps, const SpreadFunctional &functional) const
void info(spdlog::format_string_t< Args... > fmt, Args &&... args)
DenseMatrix< Complex > multiply(MatrixOperation left_operation, const DenseMatrix< Complex > &left, MatrixOperation right_operation, const DenseMatrix< Complex > &right, Complex alpha=Complex(1.0, 0.0))
alpha * op(left) * op(right), as a new matrix of the product's shape.
@ two_point_axis
The k-mesh has an axis of two points, on which k+b and k-b coincide.
@ localization_unsupported
The record lacks the overlaps that localisation minimises.
Integer 3-vector for Miller indices / FFT grid indices.
Real gradient_norm
Root-mean-square gradient per k-point where the minimisation stopped.
Real initial_minimizable_bohr_squared
Omega_D + Omega_OD before any rotation, for the log line and the report.
std::vector< DenseMatrix< Complex > > gauges
One N x N unitary per k-point; post-multiplies the gauge.
static SpreadReport evaluated_as(const SpreadTerms &terms, bool guided_by_trial_orbitals, std::vector< Vector3D > trial_orbital_centers_bohr, Real initial_minimizable_bohr_squared)
bool localization_converged
bool localized
Whether the gauge was rotated by the spread minimiser at all.
Real localization_gradient_norm
int localization_iterations
std::vector< Vector3D > centers_bohr
One centre per Wannier function, in bohr, in the same Cartesian frame as b.
std::vector< DenseMatrix< Complex > > frames
BandClassification classification
std::vector< DenseMatrix< Complex > > frames