52 rpa_.setOutOfWindowShift(
opt_.out_of_window_shift);
66 sigma_->configure(sigma_opt);
83 <<
" Dressed 3c integrals with (1+R)^1/2 for environment screening"
92 <<
" Environment reaction field, static COH+SEX, diagonal [eV]:"
95 std::string level =
" Level";
98 }
else if (i == homo_rel + 1) {
103 << (boost::format(
" = %1$4d Sigma_reac = %2$+1.6f") % (i +
opt_.qpmin) %
108 if (homo_rel >= 0 && homo_rel + 1 <
qptotal_) {
110 << (boost::format(
" HOMO %1$+1.4f eV, LUMO %2$+1.4f eV, gap %3$+1.4f "
124 double QPgap = frequencies(
opt_.homo + 1 -
opt_.qpmin) -
125 frequencies(
opt_.homo -
opt_.qpmin);
126 return QPgap - DFTgap;
137 Eigen::SelfAdjointEigenSolver<Eigen::MatrixXd> qpdiag(
getHQP());
148 " ====== Perturbative quasiparticle energies (Hartree) ====== "))
152 << (boost::format(
" DeltaHLGap = %1$+1.6f Hartree") % shift).str()
156 std::string level =
" Level";
157 if ((i +
opt_.qpmin) ==
opt_.homo) {
159 }
else if ((i +
opt_.qpmin) ==
opt_.homo + 1) {
165 const std::string env =
167 ? (boost::format(
" S-R = %1$+1.4f") %
Sigma_reac_(i, i)).str()
171 << (boost::format(
" = %1$4d DFT = %2$+1.4f VXC = %3$+1.4f S-X = "
172 "%4$+1.4f S-C = %5$+1.4f") %
176 << env << (boost::format(
" GWA = %1$+1.4f") % gwa_energies(i)).str()
185 <<
" ====== QSGW QP state composition (dominant KS contributions) ======"
190 std::string level =
" Level";
191 if (abs_n ==
opt_.homo)
193 else if (abs_n ==
opt_.homo + 1)
198 std::vector<std::pair<double, Index>> contribs;
200 if (weights(m) >= threshold) {
201 contribs.push_back({weights(m), m +
opt_.qpmin});
204 std::sort(contribs.begin(), contribs.end(),
205 [](
const auto& a,
const auto& b) { return a.first > b.first; });
208 for (
const auto& [w, ks] : contribs) {
209 std::string ks_label;
212 else if (ks ==
opt_.homo + 1)
215 line += (boost::format(
" %1$5.1f%% KS_%2$d%3$s") % (100.0 * w) % ks %
220 << level << (boost::format(
" = %1$4d:") % abs_n).str() << line
226 const Eigen::VectorXd& seed_energies,
227 const Eigen::VectorXd& qsgw_energies)
const {
229 <<
TimeStamp() <<
" QSGW quasiparticle energies" << std::flush;
232 " ====== QSGW quasiparticle energies (Hartree) ====== "))
237 std::string level =
" Level";
238 if ((i +
opt_.qpmin) ==
opt_.homo) {
240 }
else if ((i +
opt_.qpmin) ==
opt_.homo + 1) {
245 << (boost::format(
" = %1$4d %2$s = %3$+1.6f QSGW = %4$+1.6f") %
246 (i +
opt_.qpmin) % seed_label % seed_energies(i) % qsgw_energies(i))
255 <<
TimeStamp() <<
" Full quasiparticle Hamiltonian " << std::flush;
258 " ====== Diagonalized quasiparticle energies (Hartree) "
263 std::string level =
" Level";
264 if ((i +
opt_.qpmin) ==
opt_.homo) {
266 }
else if ((i +
opt_.qpmin) ==
opt_.homo + 1) {
271 << (boost::format(
" = %1$4d PQP = %2$+1.6f DQP = %3$+1.6f ") %
272 (i +
opt_.qpmin) % gwa_energies(i) % qp_diag_energies(i))
280 const Eigen::VectorXd& dft_energies)
const {
281 Eigen::VectorXd shifted_energies = dft_energies;
282 shifted_energies.segment(
opt_.homo + 1, dft_energies.size() -
opt_.homo - 1)
283 .array() +=
opt_.shift;
284 return shifted_energies;
291 auto t =
timings_.Measure(
"exchange Sigma_x");
298 <<
TimeStamp() <<
" Calculated Hartree exchange contribution"
305 auto t =
timings_.Measure(
"reaction field Sigma_reac");
311 auto t =
timings_.Measure(
"dress Mmn for the environment");
319 <<
TimeStamp() <<
" Scissor shifting DFT energies by: " <<
opt_.shift
320 <<
" Hrt" << std::flush;
322 rpa_.setRPAInputEnergies(
323 dft_shifted_energies.segment(
opt_.rpamin,
opt_.rpamax -
opt_.rpamin + 1));
324 Eigen::VectorXd frequencies =
332 Eigen::VectorXd qp_solution = frequencies;
333 Eigen::VectorXd rpa_energies_solved =
rpa_.getRPAInputEnergies();
337 opt_.screening_update_ratio,
338 opt_.screening_update_max_inner);
339 bool rebuild_screening =
true;
342 Index mixing_iteration = 0;
343 Index n_iterations = 0;
350 bool tracking_verified =
false;
351 bool verifying =
false;
353 for (
Index i_gw = 0; i_gw <
opt_.gw_sc_max_iterations; ++i_gw) {
357 if (
opt_.reset_3c > 0 && i_gw %
opt_.reset_3c == 0 && i_gw != 0) {
358 auto t =
timings_.Measure(
"rebuild Mmn");
361 <<
TimeStamp() <<
" Rebuilding 3c integrals" << std::flush;
363 rebuild_screening =
true;
365 if (rebuild_screening) {
371 auto t =
timings_.Measure(
"screening: other");
375 sigma_->PrepareScreening();
377 screening.
Built(
rpa_.getRPAInputEnergies());
382 mixing_iteration = 0;
384 if (
const std::string summary =
sigma_->ScreeningSummary();
395 <<
TimeStamp() <<
" Calculated screening via RPA (build "
396 << screening.
builds() <<
")" << std::flush;
399 <<
TimeStamp() <<
" Solving QP equations " << std::flush;
400 const bool mix =
opt_.gw_mixing_order > 0 && mixing_iteration > 0;
405 const Eigen::VectorXd qp_input = frequencies;
407 auto t =
timings_.Measure(
"QP equations (Sigma_c diagonal)");
408 frequencies =
SolveQP(frequencies);
410 qp_solution = frequencies;
411 rpa_energies_solved =
rpa_.getRPAInputEnergies();
415 if (
opt_.gw_sc_max_iterations > 1) {
416 Eigen::VectorXd rpa_energies_old =
rpa_.getRPAInputEnergies();
418 if (
opt_.gw_mixing_order == 1) {
420 <<
"GWSC using linear mixing with alpha: " <<
opt_.gw_mixing_alpha
424 <<
"GWSC using Anderson mixing with history "
425 <<
opt_.gw_mixing_order <<
", alpha: " <<
opt_.gw_mixing_alpha
429 Eigen::VectorXd mixed_frequencies = mixing_.
MixHistory();
432 frequencies = mixed_frequencies;
439 for (
int i = 0; i < frequencies.size(); i++) {
441 <<
"... GWSC iter " << i_gw <<
" state " << i <<
" "
442 << std::setprecision(9) << frequencies(i) << std::flush;
446 <<
TimeStamp() <<
" GW_Iteration:" << i_gw
451 const double residual = (qp_solution - qp_input).cwiseAbs().maxCoeff();
453 <<
"input) max=" << residual << std::flush;
455 <<
TimeStamp() <<
" Largest QP residuals (level: input -> solution): "
460 residual,
rpa_.getRPAInputEnergies(),
opt_.gw_sc_limit, &drift);
463 <<
TimeStamp() <<
" Change since the screening was built: " << drift
464 <<
" Hrt after " << screening.
inner() <<
" iteration(s)"
469 if (verifying && roots_before.size() ==
qptotal_) {
472 std::vector<Index> moved;
475 10.0 *
opt_.gw_sc_limit) {
476 moved.push_back(l +
opt_.qpmin);
482 <<
TimeStamp() <<
" QP root tracking: the full search chose "
484 <<
"; continuing with the full search" << std::flush;
489 !tracking_verified && i_gw > 0) {
493 tracking_verified =
true;
495 rebuild_screening =
false;
498 <<
" QP root tracking converged; verifying with a full search"
500 if (i_gw <
opt_.gw_sc_max_iterations - 1) {
506 << i_gw + 1 <<
" GW iterations." << std::flush;
508 }
else if (i_gw ==
opt_.gw_sc_max_iterations - 1) {
511 <<
" WARNING! GW-self-consistency cycle not converged after "
512 <<
opt_.gw_sc_max_iterations <<
" iterations." << std::flush;
514 <<
TimeStamp() <<
" Run continues. Inspect results carefully!"
524 if (
opt_.gw_sc_max_iterations > 1) {
526 <<
TimeStamp() <<
" evGW: " << n_iterations <<
" QP iterations, "
527 << screening.
builds() <<
" screening builds ("
529 << (
opt_.qp_root_tracking
530 ?
"; root tracking solved " +
532 std::to_string(n_iterations *
qptotal_) +
533 " level solves locally"
542 auto t =
timings_.Measure(
"QP equations (Sigma_c diagonal)");
543 const Eigen::VectorXd rpa_energies_next =
rpa_.getRPAInputEnergies();
544 rpa_.setRPAInputEnergies(rpa_energies_solved);
546 rpa_.setRPAInputEnergies(rpa_energies_next);
568 n += c.competing ? 1 : 0;
574 <<
" QP level(s) with two roots of comparable weight "
575 "(second Z at least half the largest):"
581 << (boost::format(
" Level = %1$4d chosen %2$+1.6f (Z = %3$.3f), "
582 "other %4$+1.6f (Z = %5$.3f)") %
583 (i +
opt_.qpmin) % c.omega % c.Z % c.omega_alt % c.Z_alt)
590Eigen::VectorXd
GW::SolveQP(
const Eigen::VectorXd& frequencies)
const {
591 sigma_->ResetDiagEvalCounter();
593 Eigen::VectorXd env = Eigen::VectorXd::Zero(
qptotal_);
595 const Eigen::VectorXd intercepts =
599 Eigen::VectorXd frequencies_new = frequencies;
600 Eigen::Array<bool, Eigen::Dynamic, 1> converged =
601 Eigen::Array<bool, Eigen::Dynamic, 1>::Zero(
qptotal_);
604 const bool track =
opt_.qp_root_tracking;
605 const bool use_tracked =
607 Eigen::VectorXd roots_new = frequencies;
608 Eigen::VectorXd Z_new = Eigen::VectorXd::Zero(
qptotal_);
615 const double e_homo =
617 const double e_lumo = (h + 1 >= 0 && h + 1 <
qptotal_)
627 Index use_threads = 1;
630#pragma omp parallel for schedule(dynamic) num_threads(use_threads)
633 double initial_f = frequencies[gw_level];
634 double intercept = intercepts[gw_level];
635 boost::optional<double> newf;
640 auto cand =
SolveQP_Tracked(intercept, initial_f, gw_level, &local_stats);
648 if (!newf &&
opt_.qp_solver ==
"fixedpoint") {
652 frequencies_new[gw_level] = newf.value();
653 converged[gw_level] =
true;
656 newf =
SolveQP_Grid(intercept, initial_f, gw_level, &grid_stats);
657 local_stats.
Add(grid_stats);
659 frequencies_new[gw_level] = newf.value();
660 converged[gw_level] =
true;
665 local_stats.
Add(lin_stats);
667 frequencies_new[gw_level] = newf.value();
672 roots_new[gw_level] = newf.value();
676 const double d = fqp.
deriv(newf.value());
677 Z_root = (std::abs(d) > 1
e-14) ? -1.0 / d : 0.0;
679 Z_new[gw_level] = Z_root;
684 total_stats.
Add(local_stats);
699 <<
TimeStamp() <<
" QP root tracking: " << n_local <<
" of "
700 <<
qptotal_ <<
" levels solved near their previous root"
705 if (!converged.all()) {
706 std::vector<Index> states;
707 for (
Index s = 0; s < converged.size(); s++) {
716 <<
TimeStamp() <<
" Increase the grid search interval" << std::flush;
720 <<
" Sigma diagonal evaluations in SolveQP: "
721 <<
sigma_->GetDiagEvalCounter() << std::flush;
736 return frequencies_new;
740 double intercept0,
double frequency0,
Index gw_level,
746 const double halfwidth = std::clamp(4.0 * moved, 0.01, 0.1);
754 opt_.qp_root_finder ==
"brent");
755 if (stats !=
nullptr) {
765 boost::optional<double> newf = boost::none;
771 fqp.
value(frequency0, EvalStage::Other),
772 fqp.
deriv(frequency0));
774 if (stats !=
nullptr) {
781 double intercept0,
double frequency0,
Index gw_level,
double left_limit,
782 double right_limit,
bool allow_rejected_return,
QPStats* stats)
const {
801 std::vector<QPRootCandidate> accepted_roots;
802 std::vector<QPRootCandidate> rejected_roots;
804 bool use_brent =
false;
805 if (
opt_.qp_root_finder ==
"brent") {
811 &wdiag, &accepted_roots, &rejected_roots, use_brent);
816 if (!accepted_roots.empty() || !rejected_roots.empty()) {
818 <<
" Adaptive scan qplevel:" << gw_level <<
" center="
819 << std::max(left_limit, std::min(right_limit, frequency0))
828 if (stats !=
nullptr) {
832 if (!accepted_roots.empty()) {
839 if (!rejected_roots.empty() && !allow_rejected_return) {
844 <<
" Adaptive scan qplevel:" << gw_level
845 <<
" produced only rejected roots in [" << left_limit <<
", "
846 << right_limit <<
"], forcing wider retry" << std::flush;
856 double intercept0,
double frequency0,
Index gw_level,
double left_limit,
857 double right_limit,
bool allow_rejected_return,
QPStats* stats)
const {
874 const bool use_brent = (
opt_.qp_root_finder ==
"brent");
876 std::vector<QPRootCandidate> accepted_roots;
877 std::vector<QPRootCandidate> rejected_roots;
878 std::vector<std::pair<double, double>> roots;
880 if (left_limit < right_limit) {
881 double freq_prev = left_limit;
882 double targ_prev = fqp.
value(freq_prev, EvalStage::Scan);
887 const Index n_steps = std::max<Index>(
888 2,
static_cast<Index>(
889 std::ceil((right_limit - left_limit) /
opt_.qp_dense_spacing)) +
892 auto node = [&](
Index i_node) {
893 return (i_node == n_steps - 1)
895 : std::min(right_limit,
896 left_limit +
static_cast<double>(i_node) *
897 opt_.qp_dense_spacing);
901 std::vector<double> nodes;
902 for (
Index i_node = 1; i_node < n_steps; ++i_node) {
903 nodes.push_back(node(i_node));
908 for (
Index i_node = 1; i_node < n_steps; ++i_node) {
909 const double freq = node(i_node);
911 const double targ = fqp.
value(freq, EvalStage::Scan);
913 if (targ_prev * targ < 0.0) {
916 frequency0, solver_opt, use_brent);
918 roots.emplace_back(cand->omega, cand->Z);
919 if (cand->accepted) {
920 accepted_roots.push_back(*cand);
922 rejected_roots.push_back(*cand);
935 if (accepted_roots.empty() && rejected_roots.empty()) {
937 <<
" Dense scan qplevel:" << gw_level <<
" found no roots in ["
938 << left_limit <<
", " << right_limit <<
"]" << std::flush;
941 <<
" Dense scan qplevel:" << gw_level <<
" roots (omega:Z)\n\t\t";
942 for (
const auto& root : roots) {
944 << root.second <<
" ";
951 if (stats !=
nullptr) {
955 if (!accepted_roots.empty()) {
961 if (!rejected_roots.empty()) {
962 if (!allow_rejected_return) {
967 <<
" Dense scan qplevel:" << gw_level
968 <<
" produced only rejected roots in [" << left_limit <<
", "
969 << right_limit <<
"], forcing wider retry" << std::flush;
975 auto least_bad = std::max_element(
976 rejected_roots.begin(), rejected_roots.end(),
978 return qp_solver::ScoreRoot(a) < qp_solver::ScoreRoot(b);
980 return least_bad->omega;
987 double intercept0,
double frequency0,
Index gw_level,
double left_limit,
988 double right_limit,
bool allow_rejected_return,
QPStats* stats)
const {
990 if (
opt_.qp_grid_search_mode ==
"adaptive") {
992 left_limit, right_limit,
993 allow_rejected_return, stats);
996 if (
opt_.qp_grid_search_mode ==
"dense") {
998 left_limit, right_limit,
999 allow_rejected_return, stats);
1002 if (
opt_.qp_grid_search_mode ==
"adaptive_with_dense_fallback") {
1005 intercept0, frequency0, gw_level, left_limit, right_limit,
1006 allow_rejected_return, &total_stats);
1008 if (stats !=
nullptr) {
1009 *stats = total_stats;
1016 intercept0, frequency0, gw_level, left_limit, right_limit,
1017 allow_rejected_return, &dense_stats);
1018 total_stats.
Add(dense_stats);
1024 <<
" Adaptive QP scan failed for qplevel:" << gw_level
1025 <<
", retrying dense grid scan in [" << left_limit <<
", "
1026 << right_limit <<
"]" << std::flush;
1030 if (stats !=
nullptr) {
1031 *stats = total_stats;
1036 throw std::runtime_error(
"Unknown gw.qp_grid_search_mode '" +
1037 opt_.qp_grid_search_mode +
"'");
1044 const double range =
opt_.qp_full_window_half_width;
1046 const double full_left_limit = frequency0 - range;
1047 const double full_right_limit = frequency0 + range;
1049 double restricted_left_limit = full_left_limit;
1050 double restricted_right_limit = full_right_limit;
1052 bool use_restricted_window =
false;
1054 if (
opt_.qp_restrict_search) {
1055 const Index mo_level = gw_level +
opt_.qpmin;
1056 const bool is_occupied = (mo_level <=
opt_.homo);
1066 const double bound = (frequency0 < -
opt_.qp_zero_margin)
1067 ? -
opt_.qp_zero_margin
1069 restricted_right_limit = std::min(full_right_limit, bound);
1071 const double bound = (frequency0 >
opt_.qp_virtual_min_energy)
1072 ?
opt_.qp_virtual_min_energy
1074 restricted_left_limit = std::max(full_left_limit, bound);
1077 const double tol = 1
e-12;
1078 use_restricted_window =
1079 (std::abs(restricted_left_limit - full_left_limit) > tol) ||
1080 (std::abs(restricted_right_limit - full_right_limit) > tol);
1083 if (use_restricted_window && restricted_left_limit < restricted_right_limit) {
1086 restricted_left_limit, restricted_right_limit,
1097 <<
" Restricted QP search failed for qplevel:" << gw_level
1098 <<
" in window [" << restricted_left_limit <<
", "
1099 << restricted_right_limit <<
"], forcing full dense window ["
1100 << full_left_limit <<
", " << full_right_limit <<
"]" << std::flush;
1108 full_left_limit, full_right_limit,
true,
1113 full_left_limit, full_right_limit,
true, stats);
1120 boost::optional<double> newf = boost::none;
1123 opt_.g_sc_max_iterations,
opt_.g_sc_limit,
opt_.qp_solver_alpha);
1124 double freq_new = newton.
FindRoot(f, frequency0);
1128 if (stats !=
nullptr) {
1135 double epsilon)
const {
1137 bool energies_converged =
true;
1138 double diff_max = (e1 - e2).cwiseAbs().maxCoeff(&state);
1139 if (diff_max > epsilon) {
1140 energies_converged =
false;
1143 <<
" StateNo:" << state << std::flush;
1144 return energies_converged;
1148 if (!
sigma_->HasOffDiagonal()) {
1150 <<
TimeStamp() <<
" WARNING: no off-diagonal Sigma_c for sigma "
1151 <<
"integration " <<
opt_.sigma_integration
1152 <<
"; the DQP Hamiltonian has no off-diagonal correlation"
1155 const auto start = std::chrono::steady_clock::now();
1156 Eigen::VectorXd diag_backup =
Sigma_c_.diagonal();
1160 <<
TimeStamp() <<
" Sigma_c off-diagonal ("
1162 << std::chrono::duration<double>(std::chrono::steady_clock::now() - start)
1164 <<
" s" << std::flush;
1189 <<
TimeStamp() <<
" Starting QSGW self-consistency loop " << std::flush;
1193 <<
" vxc rows=" <<
vxc_.rows() <<
" cols=" <<
vxc_.cols()
1194 <<
" Sigma_x rows=" <<
Sigma_x_.rows() << std::flush;
1207 bool trimmed =
false;
1211 if (corr >
opt_.qsgw_max_virt_correction) {
1212 qsgw_qpmax =
opt_.qpmin + n - 1;
1215 <<
TimeStamp() <<
" QSGW virtual threshold: level "
1220 <<
" eV. Trimming QSGW window to [" <<
opt_.qpmin <<
","
1221 << qsgw_qpmax <<
"]." << std::flush;
1227 <<
TimeStamp() <<
" QSGW virtual threshold: all corrections within "
1229 <<
" eV. Using full window [" <<
opt_.qpmin <<
"," << qsgw_qpmax
1230 <<
"]." << std::flush;
1234 const Index qsgw_qptotal = qsgw_qpmax -
opt_.qpmin + 1;
1235 const bool window_trimmed = (qsgw_qpmax <
opt_.qpmax);
1238 if (window_trimmed) {
1242 sigma_opt.
qpmax = qsgw_qpmax;
1249 sigma_->configure(sigma_opt);
1250 Sigma_x_ = Eigen::MatrixXd::Zero(qsgw_qptotal, qsgw_qptotal);
1251 Sigma_c_ = Eigen::MatrixXd::Zero(qsgw_qptotal, qsgw_qptotal);
1254 Eigen::VectorXd e_qp = e_qp_full.head(qsgw_qptotal);
1255 qsgw_rotation_ = Eigen::MatrixXd::Identity(qsgw_qptotal, qsgw_qptotal);
1257 if (
opt_.sigma_integration ==
"cda") {
1258 throw std::runtime_error(
1259 "GW::CalculateQSGW: QSGW is not supported with the CDA sigma "
1260 "integration method. The Gaussian quadrature grid used by CDA becomes "
1261 "ill-conditioned as the QP wavefunctions rotate away from the DFT-MO "
1262 "basis, causing numerical divergence. Use sigma_integration=ppm or "
1263 "sigma_integration=exact instead.");
1265 if (
opt_.qsgw_regularization ==
"srg") {
1269 <<
" QSGW static self-energy: SRG regularization (Marie and Loos), "
1271 <<
opt_.qsgw_srg_s <<
" Ha^-2 (eta-equivalent "
1272 << std::sqrt(0.5 /
opt_.qsgw_srg_s) <<
" Ha)" << std::flush;
1277 Eigen::MatrixXd H0 = -
vxc_.topLeftCorner(qsgw_qptotal, qsgw_qptotal);
1297 std::vector<Eigen::MatrixXd> Mmn_orig(mtotal);
1298 for (
Index m = 0; m < mtotal; m++) {
1299 Mmn_orig[m] =
Mmn_[m];
1304 const Eigen::MatrixXd aux_frame_orig =
Mmn_.AuxFrame();
1314 if (
opt_.ScaHFX > 0.0) {
1315 Eigen::MatrixXd K0 =
sigma_->CalcExchangeMatrix();
1319 H0 -=
opt_.ScaHFX * K0;
1321 <<
TimeStamp() <<
" QSGW from a hybrid start: removed " <<
opt_.ScaHFX
1322 <<
" x exchange of the DFT orbitals from H0" << std::flush;
1330 <<
" WARNING: QSGW from a hybrid start with a frozen core and "
1331 "core_exchange=false: the exchange with the core stays at "
1333 <<
" x its full value, so the result depends on the starting "
1334 "functional. Use core_exchange=true."
1351 const bool hartree_screened =
opt_.qsgw_hartree_update &&
1352 opt_.qsgw_hartree_screened &&
1355 Eigen::MatrixXd J0_bare;
1356 if (
opt_.qsgw_hartree_update) {
1357 J0_bare =
sigma_->CalcHartreeMatrix();
1362 <<
TimeStamp() <<
" QSGW Hartree update with "
1363 << (hartree_screened ?
"u = v + v_reac (screened)"
1364 :
"the bare v (environment does not follow)")
1370 const Index nocc_w = homo_w + 1;
1371 const Index nvirt_w = qsgw_qptotal - nocc_w;
1372 Eigen::VectorXd sigma_reac_diag0;
1384 <<
TimeStamp() <<
" QSGW mixer: order=" <<
opt_.gw_mixing_order
1385 <<
" alpha=" <<
opt_.gw_mixing_alpha << std::flush;
1391 const Index nflat = qsgw_qptotal * qsgw_qptotal;
1392 auto diagonalise = [&](
const Eigen::VectorXd&
S,
Index iter) {
1393 const Eigen::MatrixXd
H = H0 + Eigen::Map<const Eigen::MatrixXd>(
1394 S.data(), qsgw_qptotal, qsgw_qptotal);
1395 Eigen::SelfAdjointEigenSolver<Eigen::MatrixXd> es(
H);
1396 if (es.info() != Eigen::ComputationInfo::Success) {
1397 throw std::runtime_error(
1398 "GW::CalculateQSGW: diagonalisation of H_QSGW failed at iter " +
1399 std::to_string(iter));
1404 Eigen::VectorXd S_in;
1405 bool converged =
false;
1406 for (
Index iter = 0; iter <
opt_.qsgw_max_iterations; iter++) {
1409 for (
Index m = 0; m < mtotal; m++) {
1410 Mmn_[m] = Mmn_orig[m];
1412 Mmn_.RestoreAuxFrame(aux_frame_orig);
1420 Eigen::MatrixXd sigma_reac;
1426 sigma_->PrepareScreening();
1432 const Eigen::MatrixXd Xw =
1439 Eigen::MatrixXd tilde_Sigma =
Sigma_x_;
1440 if (
opt_.qsgw_regularization ==
"srg") {
1441 tilde_Sigma +=
sigma_->CalcCorrelationSRG(e_qp,
opt_.qsgw_srg_s);
1443 tilde_Sigma +=
sigma_->CalcCorrelationOffDiag(e_qp);
1444 tilde_Sigma.diagonal() +=
sigma_->CalcCorrelationDiag(e_qp);
1446 if (sigma_reac.size() > 0) {
1447 tilde_Sigma += sigma_reac;
1450 double dj_max = 0.0;
1451 double dj_reac_max = 0.0;
1452 if (
opt_.qsgw_hartree_update) {
1455 sigma_->CalcHartreeMatrix() *
1458 dj_max = dJ_bare.cwiseAbs().maxCoeff();
1459 if (hartree_screened) {
1460 const Eigen::MatrixXd dJ =
1464 dj_reac_max = (dJ - dJ_bare).cwiseAbs().maxCoeff();
1467 tilde_Sigma += dJ_bare;
1470 if (
opt_.qsgw_hartree_update || sigma_reac.size() > 0) {
1475 if (nocc_w > 0 && nvirt_w > 0) {
1476 const Eigen::MatrixXd Uvo =
1479 Eigen::JacobiSVD<Eigen::MatrixXd>(Uvo).singularValues().maxCoeff();
1482 std::string reac_text;
1483 if (sigma_reac.size() > 0) {
1485 sigma_reac_diag0 = sigma_reac.diagonal();
1487 const Eigen::VectorXd dsr = sigma_reac.diagonal() - sigma_reac_diag0;
1488 reac_text = (boost::format(
" dSigma_reac HOMO %1$+.4f LUMO %2$+.4f "
1497 << (boost::format(
" max|dJ| %1$.4f max|dJ_reac| %2$.4f") %
1502 << (boost::format(
" eV occ-virt rotation %1$.3f deg") % angle).str()
1505 const Eigen::VectorXd S_out =
1506 Eigen::Map<const Eigen::VectorXd>(tilde_Sigma.data(), nflat);
1509 Eigen::VectorXd S_next;
1510 double residual = std::numeric_limits<double>::infinity();
1515 residual = (S_out - S_in).cwiseAbs().maxCoeff();
1522 const Eigen::SelfAdjointEigenSolver<Eigen::MatrixXd> es =
1523 diagonalise(S_next, iter);
1524 const double diff_max = (es.eigenvalues() - e_qp).cwiseAbs().maxCoeff();
1528 <<
" eV max|Sigma_out - Sigma_in| = "
1531 if (residual <
opt_.qsgw_sc_limit && diff_max <
opt_.qsgw_sc_limit) {
1533 << iter + 1 <<
" iterations." << std::flush;
1537 const Eigen::SelfAdjointEigenSolver<Eigen::MatrixXd> es_out =
1538 diagonalise(S_out, iter);
1539 e_qp = es_out.eigenvalues();
1546 e_qp = es.eigenvalues();
1552 <<
TimeStamp() <<
" WARNING: QSGW did not converge in "
1553 <<
opt_.qsgw_max_iterations <<
" iterations. Inspect results carefully."
1566 if (window_trimmed) {
1569 <<
TimeStamp() <<
" QSGW: merging converged energies [" <<
opt_.qpmin
1570 <<
"," << qsgw_qpmax <<
"] with perturbative seed energies for "
1571 << n_excluded <<
" excluded virtual(s) [" << qsgw_qpmax + 1 <<
","
1572 <<
opt_.qpmax <<
"]" << std::flush;
1576 U_full.topLeftCorner(qsgw_qptotal, qsgw_qptotal) =
qsgw_rotation_;
1582 Eigen::VectorXd e_merged = e_qp_full;
1583 e_merged.head(qsgw_qptotal) = e_qp;
1603 sigma_opt_full.
eta =
opt_.eta;
1607 sigma_->configure(sigma_opt_full);
1611 <<
TimeStamp() <<
" QSGW loop complete." << std::flush;
1616class RPAEnergyGuard {
1618 RPAEnergyGuard(
RPA& rpa,
const Eigen::VectorXd& energies)
1619 : rpa_(rpa), saved_(rpa.getRPAInputEnergies()) {
1620 if (energies.size() == saved_.size()) {
1621 rpa_.setRPAInputEnergies(energies);
1624 ~RPAEnergyGuard() { rpa_.setRPAInputEnergies(saved_); }
1625 RPAEnergyGuard(
const RPAEnergyGuard&) =
delete;
1626 RPAEnergyGuard& operator=(
const RPAEnergyGuard&) =
delete;
1630 Eigen::VectorXd saved_;
1635 double spacing)
const {
1639 Eigen::MatrixXd curves = Eigen::MatrixXd::Zero(nlev, steps);
1646 const Index chunk = std::min<Index>(std::max<Index>(steps, 1), 96);
1647 const Index nchunks = (steps + chunk - 1) / chunk;
1648#pragma omp parallel for schedule(dynamic)
1649 for (
Index task = 0; task < nlev * nchunks; task++) {
1650 const Index i = task / nchunks;
1651 const Index first = (task % nchunks) * chunk;
1652 const Index n = std::min(chunk, steps - first);
1653 const Index gw_level = levels[std::size_t(i)];
1655 Eigen::VectorXd omega(n);
1656 for (
Index k = 0; k < n; ++k) {
1658 center + (double(first + k) - (double(steps - 1) / 2.0)) * spacing;
1660 curves.block(i, first, 1, n) =
1661 sigma_->CalcCorrelationDiagElements(gw_level, omega).transpose();
1667 std::string states) {
1674 std::vector<Index> state_inds;
1677 for (
Index gw_level : parsed_states) {
1678 if (gw_level >=
opt_.qpmin && gw_level <=
opt_.qpmax) {
1679 state_inds.push_back(gw_level);
1682 std::vector<Index> levels;
1683 for (
Index s : state_inds) {
1684 levels.push_back(s -
opt_.qpmin);
1686 const Index num_states =
Index(state_inds.size());
1687 const Eigen::VectorXd intercept =
1691 auto t0 = std::chrono::steady_clock::now();
1692 const Eigen::MatrixXd curves =
SigmaCurves(levels, steps, spacing);
1694 std::chrono::duration<double>(std::chrono::steady_clock::now() - t0)
1697 <<
TimeStamp() <<
" PQP(omega) written to '" << filename
1699 << num_states * steps <<
" points, " <<
seconds <<
" s)" << std::flush;
1701 Eigen::MatrixXd mat = Eigen::MatrixXd::Zero(steps, 2 * num_states);
1702 for (
Index i = 0; i < num_states; i++) {
1703 const Index n = levels[std::size_t(i)];
1705 for (
Index k = 0; k < steps; ++k) {
1707 center + (double(k) - (double(steps - 1) / 2.0)) * spacing;
1709 mat.col(2 * i + 1) = curves.row(i).transpose().array() + intercept(n);
1714 for (
Index i = 0; i < num_states; i++) {
1715 const Index gw_level = state_inds[std::size_t(i)];
1716 out << boost::format(
"#%1$somega_%2$d\tE_QP(omega)_%2$d") %
1717 (i == 0 ?
"" :
"\t") % gw_level;
1720 boost::format numFormat(
"%+1.6f");
1721 Eigen::IOFormat matFormat(Eigen::StreamPrecision, 0,
"\t",
"\n");
1722 out << numFormat % mat.format(matFormat) << std::endl;
1727 const std::string& version) {
1728 if (!
sigma_->HasPoleForm()) {
1729 throw std::runtime_error(
1730 "gw.sigma_dump needs sigma_integrator ppm or exact");
1733 throw std::runtime_error(
1734 "GW::DumpSigma called before CalculateGWPerturbation");
1736 auto t0 = std::chrono::steady_clock::now();
1738 << dopt.
filename <<
"'" << std::flush;
1748 const double eta2 =
opt_.eta *
opt_.eta;
1763 Eigen::VectorXd nu = Eigen::VectorXd::Zero(nimag);
1764 Eigen::VectorXd nu_weights = Eigen::VectorXd::Zero(nimag);
1766 Eigen::MatrixXd J = Eigen::MatrixXd::Zero(nimag, nimag);
1767 for (
Index k = 1; k < nimag; k++) {
1768 const double kd = double(k);
1769 J(k, k - 1) = J(k - 1, k) = kd / std::sqrt(4.0 * kd * kd - 1.0);
1771 Eigen::SelfAdjointEigenSolver<Eigen::MatrixXd> es(J);
1772 for (
Index k = 0; k < nimag; k++) {
1773 const double x = es.eigenvalues()(k);
1774 const double w = 2.0 * std::pow(es.eigenvectors()(0, k), 2);
1775 nu(k) = dopt.
imag_scale * (1.0 + x) / (1.0 - x);
1776 nu_weights(k) = w * dopt.
imag_scale * 2.0 / ((1.0 - x) * (1.0 - x));
1780 const Index nbins = std::max<Index>(
1783 Eigen::VectorXd bin_edges(nbins + 1);
1784 for (
Index b = 0; b <= nbins; b++) {
1788 Eigen::VectorXd sigma_check = Eigen::VectorXd::Zero(
qptotal_);
1789 Eigen::VectorXd dsigma = Eigen::VectorXd::Zero(
qptotal_);
1790 Eigen::VectorXd d2sigma = Eigen::VectorXd::Zero(
qptotal_);
1791 Eigen::VectorXd sigma_dft = Eigen::VectorXd::Zero(
qptotal_);
1792 Eigen::MatrixXf spectral = Eigen::MatrixXf::Zero(nspec, nbins);
1793 Eigen::VectorXd weight_below = Eigen::VectorXd::Zero(nspec);
1794 Eigen::VectorXd weight_above = Eigen::VectorXd::Zero(nspec);
1795 Eigen::VectorXd weight_total = Eigen::VectorXd::Zero(nspec);
1796 Eigen::VectorXd first_moment = Eigen::VectorXd::Zero(nspec);
1797 Eigen::MatrixXd imag_re = Eigen::MatrixXd::Zero(nspec, nimag);
1798 Eigen::MatrixXd imag_im = Eigen::MatrixXd::Zero(nspec, nimag);
1800#pragma omp parallel for schedule(dynamic)
1806 const bool spec = (n < nspec);
1807 double s_qp = 0.0, d2 = 0.0, wsum = 0.0, m1 = 0.0, below = 0.0, above = 0.0;
1808 Eigen::VectorXd
hist = Eigen::VectorXd::Zero(spec ? nbins : 0);
1809 Eigen::ArrayXd re = Eigen::ArrayXd::Zero(spec ? nimag : 0);
1810 Eigen::ArrayXd im = Eigen::ArrayXd::Zero(spec ? nimag : 0);
1814 Eigen::ArrayXd z(B), a(B), x(B), x2(B), den(B), xm(B), xm2(B), ad(B);
1821 const double omega = poles.
omegas(s);
1822 const double* r = pf.
residues + B * s;
1823 for (
Index m = 0; m < B; ++m) {
1824 z(m) = poles.
energies(m) + ((m < poles.
n_occ) ? -omega : omega);
1825 a(m) = c * r[m] * r[m];
1831 s_qp += (a * x / den).sum();
1832 d2 += (a * 2.0 * x * (x2 - 3.0 * eta2) / (den.square() * den)).sum();
1837 m1 += (a * z).sum();
1838 for (
Index m = 0; m < B; ++m) {
1843 }
else if (b >=
double(nbins)) {
1852 for (
Index k = 0; k < nimag; k++) {
1853 ad = a / (xm2 + nu(k) * nu(k));
1854 re(k) += (ad * xm).sum();
1855 im(k) -= nu(k) * ad.sum();
1858 sigma_check(n) = s_qp;
1860 dsigma(n) =
sigma_->CalcCorrelationDiagElementDerivative(n, eqp);
1864 spectral.row(n) =
hist.transpose().cast<
float>();
1865 weight_below(n) = below;
1866 weight_above(n) = above;
1867 weight_total(n) = wsum;
1868 first_moment(n) = m1;
1869 imag_re.row(n) = re.matrix().transpose();
1870 imag_im.row(n) = im.matrix().transpose();
1874 const Eigen::VectorXd sigma_c =
Sigma_c_.diagonal();
1875 const double max_dev = (sigma_check - sigma_c).cwiseAbs().maxCoeff();
1878 <<
" Sigma dump: max |Sigma_c(pole sum) - Sigma_c| at the QP solution = "
1879 << max_dev <<
" Ha" << std::flush;
1880 const Eigen::VectorXd Z = (1.0 - dsigma.array()).inverse().matrix();
1885 Eigen::MatrixXf curves;
1887 std::vector<Index> all(
static_cast<std::size_t
>(
qptotal_));
1889 all[std::size_t(n)] = n;
1894 Eigen::Matrix<Index, Eigen::Dynamic, 1> levels(
qptotal_);
1895 Eigen::Matrix<Index, Eigen::Dynamic, 1> competing(
qptotal_);
1896 Eigen::VectorXd omega_alt = Eigen::VectorXd::Zero(
qptotal_);
1897 Eigen::VectorXd Z_alt = Eigen::VectorXd::Zero(
qptotal_);
1899 levels(n) = n +
opt_.qpmin;
1903 competing(n) = c.competing ? 1 : 0;
1904 omega_alt(n) = c.omega_alt;
1913 "Sigma_c,nn(w) = sum_p a_p Re[1/(w - z_p +- i eta)]; Hartree; "
1914 "levels = absolute MO indices qpmin..qpmax; per-level spectra "
1915 "and imaginary axis (z = mu + i nu) and the matrices vxc, sigma_x, "
1916 "Hqp for the first n_spec levels; sigma_c_curves(n, k) = "
1917 "Sigma_c(e_dft(n) + (k - (curve_steps-1)/2) curve_spacing) for all "
1920 w(std::string(
"2"),
"format_version");
1921 w(version,
"xtp_version");
1922 w(
opt_.sigma_integration,
"sigma_integrator");
1923 w(gw_mode,
"gw_mode");
1925 w(
opt_.qpmin,
"qpmin");
1926 w(
opt_.qpmax,
"qpmax");
1927 w(
opt_.rpamin,
"rpamin");
1928 w(
opt_.rpamax,
"rpamax");
1930 w(
opt_.ScaHFX,
"ScaHFX");
1938 w(max_dev,
"sigma_c_check_max_dev");
1940 w(levels,
"levels");
1945 w(Eigen::VectorXd(
vxc_.diagonal()),
"vxc_diag");
1946 w(Eigen::VectorXd(
Sigma_x_.diagonal()),
"sigma_x_diag");
1947 w(Eigen::VectorXd(
Sigma_reac_.diagonal()),
"sigma_reac");
1948 w(Eigen::MatrixXd(
vxc_.topLeftCorner(nspec, nspec)),
"vxc");
1949 w(Eigen::MatrixXd(
Sigma_x_.topLeftCorner(nspec, nspec)),
"sigma_x");
1950 w(Eigen::MatrixXd(
getHQP().topLeftCorner(nspec, nspec)),
"Hqp");
1953 w(sigma_c,
"sigma_c");
1954 w(dsigma,
"dsigma_c");
1955 w(d2sigma,
"d2sigma_c");
1957 w(sigma_dft,
"sigma_c_at_e_dft");
1958 w(competing,
"competing_roots");
1959 w(omega_alt,
"omega_alt");
1965 w(nu_weights,
"imag_weights");
1966 w(imag_re,
"sigma_c_imag_re");
1967 w(imag_im,
"sigma_c_imag_im");
1968 w(bin_edges,
"spectral_bin_edges");
1969 w(spectral,
"spectral_weights");
1970 w(weight_below,
"spectral_weight_below");
1971 w(weight_above,
"spectral_weight_above");
1972 w(weight_total,
"pole_weight_total");
1973 w(first_moment,
"pole_first_moment");
1977 w(curves,
"sigma_c_curves");
1983 "W_c = W - v in modes s (omegas) and in the plasmon-pole frame i "
1984 "(eigenvectors of eps^-1(0)): eps^-1_ii(i nu) - 1 = -sum_s a_is "
1985 "Omega_s/(nu^2 + Omega_s^2); frame_moments(i,k) = sum_s a_is "
1986 "Omega_s^(k-1); frame_weights = -(eps^-1(0) - 1)_ii"),
1989 w(Eigen::VectorXf(scr.
strength.cast<
float>()),
"strength");
1993 "frame_eps_inv_imag");
1997 std::chrono::duration<double>(std::chrono::steady_clock::now() - t0)
2001 <<
" levels with spectra, " << scr.
omegas.size() <<
" screening modes, "
2002 <<
seconds <<
" s" << std::flush;
Anderson mixing as convergence acceleration in SCF/fixed point problems.
void UpdateInput(const Eigen::VectorXd &newInput)
const Eigen::VectorXd MixHistory()
void UpdateOutput(const Eigen::VectorXd &newOutput)
void Configure(const Index order, const double alpha)
CheckpointWriter getWriter()
static Eigen::MatrixXd DressingMatrix(const Eigen::MatrixXd &R)
S = (1 + R)^(1/2), the dressing of the auxiliary index that turns the bare interaction into u = v + v...
double value(double frequency, EvalStage stage=EvalStage::Other) const
const QPStats & GetStats() const
double deriv(double frequency) const
boost::optional< double > SolveQP_Grid_Windowed(double intercept0, double frequency0, Index gw_level, double left_limit, double right_limit, bool allow_rejected_return=true, QPStats *stats=nullptr) const
Eigen::MatrixXd reaction_field_
void setReactionField(const Eigen::MatrixXd &R)
Screen by a static polarizable environment (embedded GW).
Eigen::SelfAdjointEigenSolver< Eigen::MatrixXd > DiagonalizeQPHamiltonian() const
void PrintGWA_Energies() const
Eigen::VectorXd tracked_change_
void DumpSigma(const sigma_dump_options &dopt, const std::string &gw_mode, const std::string &version)
Write the self-energy and screening data of the finished GW (G0W0 or evGW, ppm or exact) to a separat...
boost::optional< qp_solver::RootCandidate > SolveQP_Tracked(double intercept0, double frequency0, Index gw_level, QPStats *stats) const
void PrintQSGW_Energies(const std::string &seed_label, const Eigen::VectorXd &seed_energies, const Eigen::VectorXd &qsgw_energies) const
Print a two-column comparison of seed (G0W0 or evGW) vs converged QSGW quasiparticle energies.
void PrintCompetingRoots(Log::Level level) const
void CalculateQSGW()
Run quasiparticle self-consistent GW (QSGW).
bool Converged(const Eigen::VectorXd &e1, const Eigen::VectorXd &e2, double epsilon) const
void configure(const options &opt)
boost::optional< double > SolveQP_Grid_Windowed_Adaptive(double intercept0, double frequency0, Index gw_level, double left_limit, double right_limit, bool allow_rejected_return=true, QPStats *stats=nullptr) const
Eigen::MatrixXd SigmaCurves(const std::vector< Index > &levels, Index steps, double spacing) const
Eigen::VectorXd qp_solution_
Eigen::MatrixXd getHQP() const
Index tracked_local_total_
Eigen::VectorXd SolveQP(const Eigen::VectorXd &frequencies) const
void PrintReactionFieldShifts() const
Eigen::VectorXd rpa_energies_solved_
boost::optional< double > SolveQP_Grid_Windowed_Dense(double intercept0, double frequency0, Index gw_level, double left_limit, double right_limit, bool allow_rejected_return=true, QPStats *stats=nullptr) const
qp_solver::RootCandidate QPRootCandidate
void PrintQSGW_Composition(double threshold=0.01) const
Print the dominant DFT-KS orbital contributions to each converged QSGW quasiparticle state.
Eigen::MatrixXd Sigma_reac_
Eigen::VectorXd qsgw_seed_energies_
const Eigen::VectorXd & dft_energies_
std::unique_ptr< Sigma_base > sigma_
std::vector< qp_solver::CompetingRoots > competing_roots_
Eigen::VectorXd qsgw_final_energies_
Eigen::VectorXd getGWAResults() const
Eigen::VectorXd tracked_Z_
void DressForEnvironment()
qp_solver::WindowDiagnostics QPWindowDiagnostics
double CalcHomoLumoShift(Eigen::VectorXd frequencies) const
boost::optional< double > SolveQP_Grid(double intercept0, double frequency0, Index gw_level, QPStats *stats=nullptr) const
const Eigen::MatrixXd & vxc_
void RecordCompetingRoots(Index gw_level, const std::vector< QPRootCandidate > &roots, double chosen) const
void PrintQP_Energies(const Eigen::VectorXd &qp_diag_energies) const
void PlotSigma(std::string filename, Index steps, double spacing, std::string states)
boost::optional< double > SolveQP_FixedPoint(double intercept0, double frequency0, Index gw_level, QPStats *stats=nullptr) const
Eigen::VectorXd ScissorShift_DFTlevel(const Eigen::VectorXd &dft_energies) const
boost::optional< double > SolveQP_Linearisation(double intercept0, double frequency0, Index gw_level, QPStats *stats=nullptr) const
void CalculateGWPerturbation()
Eigen::MatrixXd qsgw_rotation_
Eigen::MatrixXd dressing_
Eigen::MatrixXd core_exchange_
ScreeningHook screening_hook_
Eigen::VectorXd tracked_root_
std::vector< Index > CreateIndexVector(const std::string &Ids) const
std::string CreateIndexString(const std::vector< Index > &indeces) const
static std::string Usage()
Newton Rapson rootfinder for 1d functions.
double FindRoot(const Func &f, double x0)
When evGW rebuilds the screening W.
void Built(const Eigen::VectorXd &energies)
W has just been built from these energies.
void Configure(Mode mode, double ratio, Index max_inner)
static std::string Name(Mode mode)
Next Decide(double residual, const Eigen::VectorXd &new_energies, double limit, double *drift_out=nullptr)
static Mode Parse(const std::string &name)
Index inner() const
QP iterations since W was last built (before the current one).
Timestamp returns the current time as a string Example: cout << TimeStamp().
#define XTP_LOG(level, log)
void Cite(const std::string &key)
marks a reference as used (thread safe; unknown keys are printed as such)
boost::optional< RootCandidate > SolveQP_Tracked(QPFunc &fqp, double center, double halfwidth, double Z_previous, double min_Z_fraction, const SolverOptions &opt, bool use_brent=false)
boost::optional< double > SolveQP_Grid_Windowed(QPFunc &fqp, double frequency0, double left_limit, double right_limit, Index gw_sc_iteration, const SolverOptions &opt, WindowDiagnostics *wdiag=nullptr, std::vector< RootCandidate > *accepted_roots_out=nullptr, std::vector< RootCandidate > *rejected_roots_out=nullptr, bool use_brent=false)
auto PrefetchIfAvailable(const QPFunc &fqp, const std::vector< double > &nodes, int) -> decltype(fqp.Prefetch(nodes), void())
std::string LargestResiduals(const Eigen::VectorXd &solution, const Eigen::VectorXd &input, Index first_level, Index n=5)
void NormalizeGridSearchOptions(Opt &opt)
boost::optional< double > LinearisedRoot(double w0, double f0, double fprime)
const RootCandidate & SelectRoot(const std::vector< RootCandidate > &roots, const SolverOptions &opt)
boost::optional< RootCandidate > RefineQPInterval(double lowerbound, double f_lowerbound, double upperbound, double f_upperbound, const QPFunc &f, double reference, const SolverOptions &opt, bool use_brent)
Charge transport classes.
Provides a means for comparing floating point numbers.
static Level current_level
Pole sums of the exact (RPA spectral) correlation self-energy.
const Eigen::VectorXd & energies
const Eigen::VectorXd & omegas
Options of DumpSigma (energies in Hartree unless noted).
Eigen::MatrixXd frame_eps_inv_imag
Eigen::VectorXd frame_weights
Eigen::MatrixXd frame_moments
std::string quadrature_scheme
double qp_adaptive_shell_width
Index qp_adaptive_shell_count
double qp_full_window_half_width
Index qp_bisection_max_iter
std::size_t sigma_repeat_calls
std::size_t sigma_scan_calls
std::size_t sigma_derivative_calls
void Add(const Stats &other)
std::size_t TotalSigmaCalls() const
std::size_t sigma_refine_calls
std::size_t sigma_other_calls
std::size_t sigma_unique_frequencies
Index first_interval_shell
Index first_accepted_shell