46 throw std::invalid_argument(
"WannierConstructionInputs: the inputs hold no k-points");
50 throw std::invalid_argument(
51 "WannierConstructionInputs: the eigenvalues and projections do not cover the "
55 for (
int axis = 0; axis < 3; axis++) {
57 throw std::invalid_argument(
58 "WannierConstructionInputs: the inputs do not state the k-point grid their "
59 "matrices were built on");
71 throw std::invalid_argument(
72 "WannierConstructionInputs: the inputs hold " + std::to_string(
number_of_kpoints) +
76 std::to_string(grid_points));
81 throw std::invalid_argument(
"WannierConstructionInputs: k-point " +
82 std::to_string(kpoint_index) +
83 " carries fewer eigenvalues than number_of_bands");
85 const std::size_t projection_elements =
89 throw std::invalid_argument(
90 "WannierConstructionInputs: the projection at k-point " +
91 std::to_string(kpoint_index) +
" holds " +
93 " elements, not number_of_bands x number_of_trial_orbitals = " +
94 std::to_string(projection_elements));
106 throw std::invalid_argument(
107 "WannierConstructionInputs: the record carries neighbour overlaps but no "
108 "neighbour directions, so nothing says which k-point each overlap reaches");
128 return stencil_.has_value();
132 throw std::logic_error(
"WannierConstructionInputs: the record carries no neighbour "
133 "directions, so it has no stencil");
139 return overlaps_.has_value();
143 throw std::logic_error(
144 "WannierConstructionInputs: the record carries no neighbour overlaps");
150 [[nodiscard]] std::vector<DenseMatrix<Complex>>
153 std::iota(every_orbital.begin(), every_orbital.end(), 0);
154 std::vector<DenseMatrix<Complex>> restricted;
155 restricted.reserve(projections_.size());
156 for (std::size_t kpoint_index = 0; kpoint_index < projections_.size(); kpoint_index++) {
157 restricted.push_back(projections_[kpoint_index].submatrix(
158 classification.
kpoints[kpoint_index].kept_bands, every_orbital));
178 return stencil_ ? stencil_->two_point_axis_direction() : std::nullopt;
193 std::optional<KPointStencil> stencil_;
194 std::optional<BlochOverlaps> overlaps_;
196 std::vector<DenseMatrix<Complex>> projections_;
BlochOverlaps transformed_by(const std::vector< DenseMatrix< Complex > > &left, const std::vector< DenseMatrix< Complex > > &right, const KPointStencil &stencil) const
left(k)^dagger M(k, b) right(k + b) at every (k, b).
BlochOverlaps restricted_to(const std::vector< KPointBandClassification > &classification, const KPointStencil &stencil) const
static KPointStencil from_grid(const std::array< int, 3 > &grid_dimensions, const std::vector< KPointNeighborDirection > &directions)
From a full grid and its neighbour shells: k + b resolved for every k and every direction.
Every k-point's verdict, and the summary of the whole.
std::vector< KPointBandClassification > kpoints