votca 2026-dev
Loading...
Searching...
No Matches
votca::xtp::ScreeningUpdate Class Reference

When evGW rebuilds the screening W. More...

#include <screening_update.h>

Public Types

enum class  Mode { Every , Adaptive }
enum class  Next { Continue , Rebuild , Converged }

Public Member Functions

void Configure (Mode mode, double ratio, Index max_inner)
Mode mode () const
void Built (const Eigen::VectorXd &energies)
 W has just been built from these energies.
Index builds () const
Index inner () const
 QP iterations since W was last built (before the current one).
Next Decide (double residual, const Eigen::VectorXd &new_energies, double limit, double *drift_out=nullptr)

Static Public Member Functions

static Mode Parse (const std::string &name)
static std::string Name (Mode mode)

Private Attributes

Mode mode_ = Mode::Every
double ratio_ = 0.25
Index max_inner_ = 10
Eigen::VectorXd built_from_
Index inner_ = 0
Index builds_ = 0

Detailed Description

When evGW rebuilds the screening W.

evGW updates the energies in G and in W. Sigma_c reads the energies in G when it is evaluated, but W only changes when the screening is rebuilt (RPA, PPM parameters or RPA pair eigenproblem), which is most of the cost of an iteration.

  • every: rebuild W in every iteration (the classic scheme);
  • adaptive: iterate G with W fixed and rebuild W once the residual of the QP solve is small against how far the energies have moved since W was built (below ratio times that drift), or after max_inner iterations. Converged when the residual is below the limit AND the energies differ from those W was built with by less than the limit, i.e. at the same evGW fixed point.

The residual is that of the fixed-point map, QP solutions minus the energies they were solved with, not the change of the mixed energies: with Anderson mixing the latter can become small while the energies are not a fixed point (stagnation).

Definition at line 56 of file screening_update.h.

Member Enumeration Documentation

◆ Mode

Enumerator
Every 
Adaptive 

Definition at line 58 of file screening_update.h.

◆ Next

Enumerator
Continue 
Rebuild 
Converged 

Definition at line 59 of file screening_update.h.

Member Function Documentation

◆ builds()

Index votca::xtp::ScreeningUpdate::builds ( ) const
inline

Definition at line 87 of file screening_update.h.

◆ Built()

void votca::xtp::ScreeningUpdate::Built ( const Eigen::VectorXd & energies)
inline

W has just been built from these energies.

Definition at line 82 of file screening_update.h.

◆ Configure()

void votca::xtp::ScreeningUpdate::Configure ( Mode mode,
double ratio,
Index max_inner )
inline

Definition at line 74 of file screening_update.h.

◆ Decide()

Next votca::xtp::ScreeningUpdate::Decide ( double residual,
const Eigen::VectorXd & new_energies,
double limit,
double * drift_out = nullptr )
inline

After a QP iteration: its residual (largest difference between the QP solutions and the energies they were solved with, i.e. before any mixing) and the energies for the next iteration. Returns what to do next and the drift since W was built (largest change of an energy).

Definition at line 95 of file screening_update.h.

◆ inner()

Index votca::xtp::ScreeningUpdate::inner ( ) const
inline

QP iterations since W was last built (before the current one).

Definition at line 89 of file screening_update.h.

◆ mode()

Mode votca::xtp::ScreeningUpdate::mode ( ) const
inline

Definition at line 79 of file screening_update.h.

◆ Name()

std::string votca::xtp::ScreeningUpdate::Name ( Mode mode)
inlinestatic

Definition at line 70 of file screening_update.h.

◆ Parse()

Mode votca::xtp::ScreeningUpdate::Parse ( const std::string & name)
inlinestatic

Definition at line 61 of file screening_update.h.

Member Data Documentation

◆ builds_

Index votca::xtp::ScreeningUpdate::builds_ = 0
private

Definition at line 121 of file screening_update.h.

◆ built_from_

Eigen::VectorXd votca::xtp::ScreeningUpdate::built_from_
private

Definition at line 119 of file screening_update.h.

◆ inner_

Index votca::xtp::ScreeningUpdate::inner_ = 0
private

Definition at line 120 of file screening_update.h.

◆ max_inner_

Index votca::xtp::ScreeningUpdate::max_inner_ = 10
private

Definition at line 118 of file screening_update.h.

◆ mode_

Mode votca::xtp::ScreeningUpdate::mode_ = Mode::Every
private

Definition at line 116 of file screening_update.h.

◆ ratio_

double votca::xtp::ScreeningUpdate::ratio_ = 0.25
private

Definition at line 117 of file screening_update.h.


The documentation for this class was generated from the following file: