votca 2026-dev
Loading...
Searching...
No Matches
votca::xtp::qp_solver Namespace Reference

Classes

struct  Stats
struct  RootCandidate
struct  WindowDiagnostics
struct  SolverOptions
struct  CompetingRoots

Enumerations

enum class  EvalStage { Scan , Refine , Derivative , Other }

Functions

template<typename QPFunc>
auto PrefetchIfAvailable (const QPFunc &fqp, const std::vector< double > &nodes, int) -> decltype(fqp.Prefetch(nodes), void())
template<typename QPFunc>
void PrefetchIfAvailable (const QPFunc &, const std::vector< double > &, long)
template<typename Opt>
double LegacyFullWindowHalfWidth (const Opt &opt)
template<typename Opt>
double LegacyAdaptiveShellWidth (const Opt &opt)
template<typename Opt>
void NormalizeGridSearchOptions (Opt &opt)
double EffectiveAdaptiveShellWidth (const SolverOptions &opt)
double RootBracketTolerance (const SolverOptions &opt)
template<typename QPFunc>
double SolveQP_Bisection (double lowerbound, double f_lowerbound, double upperbound, double f_upperbound, const QPFunc &f, const SolverOptions &opt)
template<typename QPFunc>
double SolveQP_Brent (double lowerbound, double f_lowerbound, double upperbound, double f_upperbound, const QPFunc &f, const SolverOptions &opt)
bool AcceptRoot (const RootCandidate &cand, const SolverOptions &opt)
double ScoreRoot (const RootCandidate &cand)
const RootCandidate & SelectRoot (const std::vector< RootCandidate > &roots, const SolverOptions &opt)
CompetingRoots CheckCompetingRoots (const std::vector< RootCandidate > &roots, double chosen)
template<typename QPFunc>
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)
template<typename QPFunc>
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)
template<typename QPFunc>
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)
boost::optional< double > LinearisedRoot (double w0, double f0, double fprime)
std::string LargestResiduals (const Eigen::VectorXd &solution, const Eigen::VectorXd &input, Index first_level, Index n=5)

Enumeration Type Documentation

◆ EvalStage

Enumerator
Scan 
Refine 
Derivative 
Other 

Definition at line 52 of file qp_solver_utils.h.

Function Documentation

◆ AcceptRoot()

bool votca::xtp::qp_solver::AcceptRoot ( const RootCandidate & cand,
const SolverOptions & opt )
inline

Definition at line 371 of file qp_solver_utils.h.

◆ CheckCompetingRoots()

CompetingRoots votca::xtp::qp_solver::CheckCompetingRoots ( const std::vector< RootCandidate > & roots,
double chosen )
inline

Definition at line 427 of file qp_solver_utils.h.

◆ EffectiveAdaptiveShellWidth()

double votca::xtp::qp_solver::EffectiveAdaptiveShellWidth ( const SolverOptions & opt)
inline

Definition at line 211 of file qp_solver_utils.h.

◆ LargestResiduals()

std::string votca::xtp::qp_solver::LargestResiduals ( const Eigen::VectorXd & solution,
const Eigen::VectorXd & input,
Index first_level,
Index n = 5 )
inline

The n levels with the largest QP residual |solution - input| (largest first) as "level: input -> solution (residual)", for the evGW log. Levels are numbered from first_level.

Definition at line 882 of file qp_solver_utils.h.

◆ LegacyAdaptiveShellWidth()

template<typename Opt>
double votca::xtp::qp_solver::LegacyAdaptiveShellWidth ( const Opt & opt)
inline

Definition at line 149 of file qp_solver_utils.h.

◆ LegacyFullWindowHalfWidth()

template<typename Opt>
double votca::xtp::qp_solver::LegacyFullWindowHalfWidth ( const Opt & opt)
inline

Definition at line 141 of file qp_solver_utils.h.

◆ LinearisedRoot()

boost::optional< double > votca::xtp::qp_solver::LinearisedRoot ( double w0,
double f0,
double fprime )
inline

One Newton step of the QP equation f(w) = 0 from w0, with f0 = f(w0) and fprime = f'(w0) = dSigma_c/dw - 1: w0 - f0 / fprime = w0 + Z f0, with the quasiparticle weight Z = 1 / (1 - dSigma_c/dw). None if f' vanishes.

Definition at line 871 of file qp_solver_utils.h.

◆ NormalizeGridSearchOptions()

template<typename Opt>
void votca::xtp::qp_solver::NormalizeGridSearchOptions ( Opt & opt)
inline

Definition at line 175 of file qp_solver_utils.h.

◆ PrefetchIfAvailable() [1/2]

template<typename QPFunc>
void votca::xtp::qp_solver::PrefetchIfAvailable ( const QPFunc & ,
const std::vector< double > & ,
long  )

Definition at line 50 of file qp_solver_utils.h.

◆ PrefetchIfAvailable() [2/2]

template<typename QPFunc>
auto votca::xtp::qp_solver::PrefetchIfAvailable ( const QPFunc & fqp,
const std::vector< double > & nodes,
int  ) -> decltype(fqp.Prefetch(nodes), void())

Definition at line 45 of file qp_solver_utils.h.

◆ RefineQPInterval()

template<typename QPFunc>
boost::optional< RootCandidate > votca::xtp::qp_solver::RefineQPInterval ( double lowerbound,
double f_lowerbound,
double upperbound,
double f_upperbound,
const QPFunc & f,
double reference,
const SolverOptions & opt,
bool use_brent )

Definition at line 454 of file qp_solver_utils.h.

◆ RootBracketTolerance()

double votca::xtp::qp_solver::RootBracketTolerance ( const SolverOptions & opt)
inline

Bracket width at which the interval refinement stops if |f| has not yet dropped below g_sc_limit. Roots are accepted only with |f| <= g_sc_limit (AcceptRoot), and |f'| = 1/Z <= 1/min_accepted_Z near a root, so a root located to within this width has an acceptable residual even for the smallest accepted weight: the refinement does not throw away roots by stopping early.

Definition at line 225 of file qp_solver_utils.h.

◆ ScoreRoot()

double votca::xtp::qp_solver::ScoreRoot ( const RootCandidate & cand)
inline

Definition at line 395 of file qp_solver_utils.h.

◆ SelectRoot()

const RootCandidate & votca::xtp::qp_solver::SelectRoot ( const std::vector< RootCandidate > & roots,
const SolverOptions & opt )
inline

The accepted root to use: the largest weight (ScoreRoot), or with prefer_nearest_root the one closest to the reference. roots not empty.

Definition at line 401 of file qp_solver_utils.h.

◆ SolveQP_Bisection()

template<typename QPFunc>
double votca::xtp::qp_solver::SolveQP_Bisection ( double lowerbound,
double f_lowerbound,
double upperbound,
double f_upperbound,
const QPFunc & f,
const SolverOptions & opt )

Definition at line 230 of file qp_solver_utils.h.

◆ SolveQP_Brent()

template<typename QPFunc>
double votca::xtp::qp_solver::SolveQP_Brent ( double lowerbound,
double f_lowerbound,
double upperbound,
double f_upperbound,
const QPFunc & f,
const SolverOptions & opt )

Definition at line 267 of file qp_solver_utils.h.

◆ SolveQP_Grid_Windowed()

template<typename QPFunc>
boost::optional< double > votca::xtp::qp_solver::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 )

Definition at line 557 of file qp_solver_utils.h.

◆ SolveQP_Tracked()

template<typename QPFunc>
boost::optional< RootCandidate > votca::xtp::qp_solver::SolveQP_Tracked ( QPFunc & fqp,
double center,
double halfwidth,
double Z_previous,
double min_Z_fraction,
const SolverOptions & opt,
bool use_brent = false )

Root tracking: the root of the branch found in the previous iteration, searched only in [center - halfwidth, center + halfwidth] with the dense spacing. Returns the accepted root closest to center whose weight is at least min_Z_fraction of the previous one (the branch has not faded into a satellite); none if there is no such root, so that the caller falls back to the full search.

Definition at line 524 of file qp_solver_utils.h.