34 : centers_bohr_(std::move(centers_bohr)) {
35 if (centers_bohr_.empty()) {
36 throw std::invalid_argument(
"GuidedPhaseBranch: no guiding centres were given");
41 if (
static_cast<int>(centers_bohr_.size()) != number_of_wannier_functions) {
42 throw std::invalid_argument(
43 "GuidedPhaseBranch: " + std::to_string(centers_bohr_.size()) +
44 " guiding centres were given for " + std::to_string(number_of_wannier_functions) +
45 " Wannier functions");
51 const Vector3D& b_vector)
const override {
52 const Real phase = std::arg(diagonal_overlap);
54 -b_vector.
dot(centers_bohr_[
static_cast<std::size_t
>(wannier_function)]);
59 std::vector<Vector3D> centers_bohr_;
GuidedPhaseBranch(std::vector< Vector3D > centers_bohr)
centers_bohr: one per Wannier function, Cartesian, in the frame and unit of the b-vectors.
void require_serves(int number_of_wannier_functions) const override
Refuses, with std::invalid_argument, a functional of a size this branch cannot serve.
Real phase_of(const Complex &diagonal_overlap, int wannier_function, const Vector3D &b_vector) const override
std::complex< double > Complex
Real dot(const Vector3D &other) const