Abstract base class for all charge density mixers. More...
#include <init.hpp>
Inheritance diagram for q3::Mixer:Public Member Functions | |
| Mixer (Real mixing_parameter, int history_depth) | |
| virtual | ~Mixer ()=default |
| int | history_depth () const |
| virtual void | initialize (const MixerEnvironment &) |
| Supply the representation context the mixer needs before the first mix(). | |
| Real | last_residual_norm () const |
| virtual void | mix (const std::vector< std::vector< Real > > &input_density, std::vector< std::vector< Real > > &output_density, int number_of_spin_components)=0 |
| Real | mixing_parameter () const |
| virtual std::string | name () const =0 |
| virtual void | reset () |
Protected Attributes | |
| int | history_depth_ |
| Real | last_residual_norm_ {-1.0} |
| Real | mixing_parameter_ |
|
inline |
|
virtualdefault |
|
inline |
Definition at line 76 of file init.hpp.
References history_depth_.
|
inlinevirtual |
Supply the representation context the mixer needs before the first mix().
Reimplemented in q3::RealSpaceMixer, and q3::ReciprocalSpaceMixer.
|
inline |
Return the density residual norm (dr2) computed during the last mix() call.
Computing dr2 inside mix() avoids the FFT round-trip noise that occurs when the SCF loop independently FFTs real-space densities back to G-space. Returns -1.0 if not yet computed (callers should fall back to their own dr2).
Definition at line 87 of file init.hpp.
References last_residual_norm_.
|
pure virtual |
Mix one self-consistent field step using real-space densities.
| input_density | density used to build the potential (rho_in), per spin. |
| output_density | density from the bands (rho_out) on entry; overwritten with the mixed next-iteration density on exit, per spin. |
| number_of_spin_components | number of spin channels. |
Each mixer performs whatever internal transforms it needs (e.g. FFT to reciprocal space) so callers never branch on the mixer's space.
Implemented in q3::RealSpaceMixer, and q3::ReciprocalSpaceMixer.
|
inline |
Definition at line 73 of file init.hpp.
References mixing_parameter_.
|
pure virtual |
Implemented in q3::AndersonMixer, q3::BroydenMixer, and q3::LinearMixer.
|
inlinevirtual |
Reimplemented in q3::AndersonMixer, and q3::BroydenMixer.
|
protected |
Definition at line 93 of file init.hpp.
Referenced by history_depth(), q3::BroydenMixer::mix_in_reciprocal_space(), and q3::AndersonMixer::mix_one_component().
|
protected |
Definition at line 94 of file init.hpp.
Referenced by last_residual_norm(), q3::BroydenMixer::mix_in_reciprocal_space(), and q3::LinearMixer::mix_in_reciprocal_space().
|
protected |
Definition at line 92 of file init.hpp.
Referenced by q3::ReciprocalSpaceMixer::mix(), q3::LinearMixer::mix_in_reciprocal_space(), q3::AndersonMixer::mix_one_component(), and mixing_parameter().