Quantum 3xplorer (Q3)
An AI-native quantum simulation engine
Loading...
Searching...
No Matches
q3::KohnShamSCFIterator Class Referenceabstract

#include <init.hpp>

+ Inheritance diagram for q3::KohnShamSCFIterator:

Classes

struct  ScfIterationRecord
 One row per SCF iteration, in order; the source for per-iteration companion outputs. More...
 

Public Member Functions

 KohnShamSCFIterator (KohnShamSCFIteratorConfig config)
 
 ~KohnShamSCFIterator () override=default
 
const std::vector< Real > & charge_density_for_spin (int spin_index) const
 
const std::vector< Complex > & charge_density_g () const
 
const std::vector< Real > & charge_density_real () const
 
Crystal & crystal_structure () const
 
virtual const KohnShamEnergies & energies () const =0
 
virtual KohnShamEnergies & energies_mutable ()=0
 
const XCFunctional & exchange_correlation () const
 
const std::vector< Complex > & exchange_correlation_potential_g () const
 
void load_charge_density (std::vector< std::vector< Real > > charge_density)
 
void load_effective_potential (std::vector< std::vector< Real > > effective_potential)
 
void offer_starting_charge_density (std::vector< std::vector< Real > > charge_density)
 
const std::vector< Real > & potential_for_spin (int spin_index) const
 
const std::vector< Real > & real_space_potential () const
 
const std::vector< ScfIterationRecord > & scf_history () const
 
Real total_energy () const override
 
const std::vector< Complex > & total_potential_g () const
 
- Public Member Functions inherited from q3::SCFIterator
 SCFIterator (SCFIteratorConfig config)
 
virtual ~SCFIterator ()=default
 
bool is_converged () const
 
int iteration () const
 
int number_of_spin_components () const
 
void run ()
 
void set_convergence_threshold (Real threshold)
 Set the SCF convergence threshold (in Ry).
 
void set_maximum_iterations (int maximum_iterations)
 Set the maximum number of SCF iterations.
 
void set_owned_crystal (Crystal crystal)
 Transfer ownership of a Crystal into this iterator.
 
const std::vector< Real > & total_energy_history_in_ry () const
 
virtual void write_checkpoints (const std::string &output_directory, const std::string &prefix) const
 

Public Attributes

KohnShamSCFIteratorConfig config_
 
std::string exchange_correlation_functional_
 
int methfessel_paxton_order_
 
Real mixing_beta_
 
int mixing_history_size_
 
std::string mixing_mode_
 
std::string mixing_preconditioning_
 
Real mixing_q0_
 
std::string smearing_
 
Real smearing_width_
 

Protected Member Functions

virtual Real compute_delta_escf_correction () const =0
 
virtual Real compute_density_residual (const std::vector< std::vector< Real > > &input_density_for_mixing) const =0
 
virtual Real compute_double_counting_correction () const =0
 
virtual void compute_energy_components ()
 
const KohnShamSCFIteratorConfig & config () const
 
virtual void construct_density_from_states ()=0
 
Real diagonalization_threshold () const
 
void finalize () override
 
void initialize () override
 Base implementation prints the SCF banner. Children call SCFIterator::initialize() last.
 
virtual void initialize_charge_density ()=0
 
virtual void initialize_representation ()=0
 
virtual void initialize_single_particle_states ()=0
 
virtual void initiate_mixer ()=0
 
virtual std::vector< std::vector< Real > > input_density_for_mixing () const =0
 
bool is_iteration_converged () const override
 
void log_iteration_energy (Real delta_energy)
 Single source of truth for the per-iteration energy/convergence log line.
 
virtual void mix_density (const std::vector< std::vector< Real > > &input_density_for_mixing)=0
 
virtual int number_of_bands () const =0
 
virtual Real number_of_electrons () const =0
 
virtual int number_of_kpoint_states () const =0
 
void perform_iteration () override
 
virtual void prepare_hamiltonian ()
 
void report_convergence () override
 
virtual void report_convergence_details ()=0
 
virtual void report_first_iteration_details ()=0
 
void report_iteration () override
 
void report_non_convergence () override
 
virtual void restore_density_at_convergence ()=0
 
virtual void set_diagonalization_tolerance (int iteration)=0
 
virtual void set_diagonalizer_tolerance (Real tolerance)=0
 
virtual void snapshot_output_density ()=0
 
virtual void solve_single_particle_states ()=0
 
virtual void symmetrize_density ()=0
 
virtual void synchronize_smooth_density_from_mixed ()
 
virtual void update_effective_potential ()=0
 
virtual void update_occupations ()=0
 
- Protected Member Functions inherited from q3::SCFIterator
virtual void iterate ()
 Main iteration loop.
 
virtual void report ()
 Report convergence or non-convergence after iterate() finishes.
 

Protected Attributes

std::vector< Complex > charge_density_g_
 
std::vector< std::vector< Real > > charge_density_real_
 
Real density_residual_ {0.0}
 
Real diagonalizer_tolerance_ {0.0}
 
std::unique_ptr< XCFunctional > exchange_correlation_
 
std::vector< Complex > exchange_correlation_potential_g_
 
bool first_iteration_rediag_done_ {false}
 
bool has_preloaded_charge_density_ {false}
 
bool has_preloaded_effective_potential_ {false}
 
std::unique_ptr< Mixer > mixer_
 
bool preloaded_charge_density_is_a_starting_guess_ {false}
 Set by offer_starting_charge_density(): a density that need not fit.
 
std::vector< std::vector< Real > > real_space_potential_
 
std::vector< ScfIterationRecord > scf_history_
 
std::unique_ptr< SmearingScheme > smearing_scheme_
 
Real total_energy_previous_ {0.0}
 
std::vector< Complex > total_potential_g_
 
std::vector< std::vector< Complex > > total_potential_g_by_spin_
 
- Protected Attributes inherited from q3::SCFIterator
Real convergence_threshold_
 
Crystal * crystal_structure_
 
bool is_converged_ {false}
 
int iteration_ {0}
 
int maximum_iterations_
 

Detailed Description

Definition at line 121 of file init.hpp.

Constructor & Destructor Documentation

◆ KohnShamSCFIterator()

q3::KohnShamSCFIterator::KohnShamSCFIterator ( KohnShamSCFIteratorConfig  config)
inlineexplicit

Validate here, where "default" has just been resolved and before any representation exists to build a preconditioner from. An unrecognized value used to fall through to a == "kerker" test further down and silently disable preconditioning: preconditioning: kerkar cost a slower run and produced no diagnostic to explain it.

Definition at line 123 of file init.hpp.

References q3::PreconditionerFactory::is_supported(), mixing_preconditioning_, and smearing_.

◆ ~KohnShamSCFIterator()

q3::KohnShamSCFIterator::~KohnShamSCFIterator ( )
overridedefault

Member Function Documentation

◆ charge_density_for_spin()

const std::vector< Real > & q3::KohnShamSCFIterator::charge_density_for_spin ( int  spin_index) const
inline

Definition at line 200 of file init.hpp.

References charge_density_real_.

◆ charge_density_g()

const std::vector< Complex > & q3::KohnShamSCFIterator::charge_density_g ( ) const
inline

Definition at line 194 of file init.hpp.

References charge_density_g_.

◆ charge_density_real()

const std::vector< Real > & q3::KohnShamSCFIterator::charge_density_real ( ) const
inline

◆ compute_delta_escf_correction()

virtual Real q3::KohnShamSCFIterator::compute_delta_escf_correction ( ) const
protectedpure virtual

Compute the first-order energy correction for evaluating E_Hartree and E_XC at the mixed density instead of the output density.

delta_escf = -Σ_r (ρ_mixed(r) - ρ_out(r)) · V_Hxc^mixed(r) · (Ω/N)

Matches QE's SCF-correction term of the same name. Must be called AFTER update_effective_potential() has been applied to the mixed density and AFTER snapshot_output_density() has saved the output density.

Implemented in q3::PlanewaveKohnShamSCFIterator.

Referenced by perform_iteration().

◆ compute_density_residual()

virtual Real q3::KohnShamSCFIterator::compute_density_residual ( const std::vector< std::vector< Real > > &  input_density_for_mixing) const
protectedpure virtual

Implemented in q3::PlanewaveKohnShamSCFIterator.

Referenced by perform_iteration().

◆ compute_double_counting_correction()

◆ compute_energy_components()

virtual void q3::KohnShamSCFIterator::compute_energy_components ( )
inlineprotectedvirtual

Compute sub-components (e.g. band energy, entropy) needed for total(). Default no-op; override in representations that compute eagerly.

Reimplemented in q3::PlanewaveKohnShamSCFIterator, and q3::PawPlanewavePseudopotentialKohnShamSCFIterator.

Definition at line 622 of file init.hpp.

Referenced by q3::PawPlanewavePseudopotentialKohnShamSCFIterator::compute_energy_components(), finalize(), and perform_iteration().

◆ config()

◆ construct_density_from_states()

virtual void q3::KohnShamSCFIterator::construct_density_from_states ( )
protectedpure virtual

◆ crystal_structure()

Crystal & q3::KohnShamSCFIterator::crystal_structure ( ) const
inline

Access the crystal structure owned or referenced by this iterator.

Definition at line 219 of file init.hpp.

References q3::SCFIterator::crystal_structure_.

Referenced by q3::PlanewavePseudopotentialKohnShamSCFIterator::accumulate_hubbard_occupation_and_potential(), q3::UltrasoftPlanewavePseudopotentialKohnShamSCFIterator::accumulate_projector_overlaps(), q3::UltrasoftPlanewavePseudopotentialKohnShamSCFIterator::add_augmentation_to_charge_density(), q3::PlanewaveKohnShamSCFIterator::build_kpoint_plane_wave_data(), q3::internal::build_wannier_interface_record(), q3::PlanewavePseudopotentialKohnShamSCFIterator::cached_symmetry_operations(), q3::capture_interpolation_record(), q3::PlanewaveKohnShamSCFIterator::compute_delta_escf_correction(), q3::PlanewaveKohnShamSCFIterator::compute_double_counting_correction(), q3::PlanewaveKohnShamSCFIterator::compute_number_of_electrons(), q3::PlanewaveKohnShamSCFIterator::construct_density_from_states(), q3::PlanewaveKohnShamSCFIterator::hartree_metric_prefactor(), q3::PlanewaveKohnShamSCFIterator::initialize_representation(), q3::PlanewavePseudopotentialKohnShamSCFIterator::initialize_single_particle_states(), q3::PlanewaveKohnShamSCFIterator::initiate_mixer(), q3::PlanewaveKohnShamSCFIterator::log_representation_summary(), q3::PlanewaveKohnShamSCFIterator::magnetization_metric_weight(), q3::PawPlanewavePseudopotentialKohnShamSCFIterator::on_charge_density_initialized(), q3::UltrasoftPlanewavePseudopotentialKohnShamSCFIterator::prepare_hamiltonian(), q3::PlanewaveKohnShamSCFIterator::report_convergence_details(), q3::UltrasoftPlanewavePseudopotentialKohnShamSCFIterator::reset_projector_overlap_coefficients(), q3::PlanewavePseudopotentialKohnShamSCFIterator::result(), q3::PlanewaveKohnShamSCFIterator::scale_loaded_charge_density_to_electron_count(), q3::PlanewavePseudopotentialKohnShamSCFIterator::setup_hubbard(), q3::PlanewavePseudopotentialKohnShamSCFIterator::solve_single_particle_states(), q3::PlanewavePseudopotentialKohnShamSCFIterator::valence_exchange_correlation_potential_g_of(), and q3::PlanewaveKohnShamSCFIterator::warn_if_total_charge_deviates().

◆ diagonalization_threshold()

Real q3::KohnShamSCFIterator::diagonalization_threshold ( ) const
inlineprotected

The eigenvalue threshold the diagonalizer runs at: the schedule's value, held at the floor below which the solvers resolve no further change.

Definition at line 301 of file init.hpp.

References diagonalizer_tolerance_, and q3::math::tolerances::minimum_eigenvalue_tolerance.

Referenced by perform_iteration(), and q3::PlanewaveKohnShamSCFIterator::set_diagonalization_tolerance().

◆ energies()

◆ energies_mutable()

◆ exchange_correlation()

const XCFunctional & q3::KohnShamSCFIterator::exchange_correlation ( ) const
inline

◆ exchange_correlation_potential_g()

const std::vector< Complex > & q3::KohnShamSCFIterator::exchange_correlation_potential_g ( ) const
inline

◆ finalize()

void q3::KohnShamSCFIterator::finalize ( )
inlineoverrideprotectedvirtual

◆ initialize()

void q3::KohnShamSCFIterator::initialize ( )
inlineoverrideprotectedvirtual

Base implementation prints the SCF banner. Children call SCFIterator::initialize() last.

Keep the atomic superposition density as the input for the first SCF iteration, matching QE's ordering — potential from the atomic superposition, then wavefunction initialization from that potential, then the SCF loop. The effective potential from the atomic density was already computed during initialize_single_particle_states(). Do NOT reconstruct density from wavefunctions here — doing so creates a nearly self-consistent wfc-based density that gives the Broyden mixer a near-zero first residual, corrupting its history and causing ~30 extra iterations.

Run state, like the two above: a second run() reports its own trajectory rather than one appended to the previous run's.

Reimplemented from q3::SCFIterator.

Definition at line 305 of file init.hpp.

References q3::MixerFactory::create(), q3::XCFunctionalFactory::create(), q3::create_smearing(), q3::log::debug(), density_residual_, exchange_correlation_, exchange_correlation_functional_, q3::SCFIterator::initialize(), initialize_charge_density(), initialize_representation(), initialize_single_particle_states(), initiate_mixer(), methfessel_paxton_order_, mixer_, mixing_beta_, mixing_history_size_, mixing_mode_, q3::SCFIterator::number_of_spin_components(), smearing_, smearing_scheme_, smearing_width_, and total_energy_previous_.

◆ initialize_charge_density()

virtual void q3::KohnShamSCFIterator::initialize_charge_density ( )
protectedpure virtual

◆ initialize_representation()

virtual void q3::KohnShamSCFIterator::initialize_representation ( )
protectedpure virtual

◆ initialize_single_particle_states()

virtual void q3::KohnShamSCFIterator::initialize_single_particle_states ( )
protectedpure virtual

◆ initiate_mixer()

virtual void q3::KohnShamSCFIterator::initiate_mixer ( )
protectedpure virtual

Implemented in q3::PlanewaveKohnShamSCFIterator.

Referenced by initialize().

◆ input_density_for_mixing()

virtual std::vector< std::vector< Real > > q3::KohnShamSCFIterator::input_density_for_mixing ( ) const
protectedpure virtual

◆ is_iteration_converged()

bool q3::KohnShamSCFIterator::is_iteration_converged ( ) const
inlineoverrideprotectedvirtual

◆ load_charge_density()

void q3::KohnShamSCFIterator::load_charge_density ( std::vector< std::vector< Real > >  charge_density)
inline

◆ load_effective_potential()

void q3::KohnShamSCFIterator::load_effective_potential ( std::vector< std::vector< Real > >  effective_potential)
inline

Load a pre-computed effective potential directly into real_space_potential_.

Used by the NSCF flavor to inject V_eff loaded from a v2 checkpoint instead of computing it from scratch via compute_effective_potential_from_density(). Must be called after iterator construction but before run().

Definition at line 230 of file init.hpp.

References has_preloaded_effective_potential_, and real_space_potential_.

◆ log_iteration_energy()

void q3::KohnShamSCFIterator::log_iteration_energy ( Real  delta_energy)
inlineprotected

Single source of truth for the per-iteration energy/convergence log line.

Recorded here rather than at the call sites so the history and the printed line can never disagree — a per-iteration output that says something different from stdout is worse than none.

Definition at line 537 of file init.hpp.

References density_residual_, energies(), q3::log::info(), q3::SCFIterator::iteration_, scf_history_, and q3::KohnShamEnergies::total().

Referenced by report_convergence(), and report_iteration().

◆ mix_density()

virtual void q3::KohnShamSCFIterator::mix_density ( const std::vector< std::vector< Real > > &  input_density_for_mixing)
protectedpure virtual

Implemented in q3::PlanewaveKohnShamSCFIterator.

Referenced by perform_iteration().

◆ number_of_bands()

virtual int q3::KohnShamSCFIterator::number_of_bands ( ) const
protectedpure virtual

◆ number_of_electrons()

virtual Real q3::KohnShamSCFIterator::number_of_electrons ( ) const
protectedpure virtual

Implemented in q3::PlanewaveKohnShamSCFIterator.

Referenced by perform_iteration().

◆ number_of_kpoint_states()

virtual int q3::KohnShamSCFIterator::number_of_kpoint_states ( ) const
protectedpure virtual

◆ offer_starting_charge_density()

void q3::KohnShamSCFIterator::offer_starting_charge_density ( std::vector< std::vector< Real > >  charge_density)
inline

Offer a density to start from, as a previous geometry's saved one is offered (startingpot = 'file'). Unlike load_charge_density(), which asks for exactly that density, an offer this run's grid cannot take is declined, and the SCF starts from overlapping atoms instead; one it can take is rescaled to this system's electron count, since the cell may have changed since it was saved.

Definition at line 249 of file init.hpp.

References charge_density_real_, has_preloaded_charge_density_, and preloaded_charge_density_is_a_starting_guess_.

◆ perform_iteration()

void q3::KohnShamSCFIterator::perform_iteration ( )
inlineoverrideprotectedvirtual
  1. Compute double-counting correction using the CURRENT potential (V_Hxc built from previous iteration's mixed density) and the NEW output density. This is the band-energy double-counting term as QE defines it: deband = -Σ ρ_out(r) · V_Hxc(r)

4a. First-iteration re-diagonalization (matching QE's SCF loop): If the density residual is smaller than the estimated diagonalization error, the eigenvalue threshold was too loose — re-diag with a tighter threshold. This is critical for avoiding the false fixed-point trap in small systems.

The error estimate is the threshold the diagonalization actually ran at, times the electron count, as in QE's electrons_scf (PW/src/electrons.f90), and only a diagonalization that ran looser than the residual now asks for is repeated. A self-consistent run's first diagonalization runs at the loose initial threshold, so this is the 1e-2 rule it always was. A non-self-consistent pass has already run at the floor: there the "tighter" threshold was 0.1 dr2 / N, 7.8e-4 Ry for silicon's two irreducible k-points, and the repeat loosened the pass it was meant to sharpen – and, seeding each k-point from the one before, left the second up to 4.4e-5 Ry off in its occupied bands.

Re-compute with tighter tolerance using the SAME potential (matching QE, which restarts the SCF step without mixing before the re-diagonalization)

  1. Update effective potential from the MIXED density (single call per iteration). This produces V_Hxc for the next iteration's Hamiltonian AND provides E_Hartree and E_XC evaluated at the mixed density.
  1. Compute delta_escf: first-order energy correction for using mixed density rather than output density in E_Hartree and E_XC. delta_escf = -Σ_r (ρ_mixed(r) - ρ_out(r)) · V_Hxc^mixed(r) (matches QE's SCF-correction term of the same name)

The total energy reported is: E = E_band + deband + E_Hartree(mixed) + E_XC(mixed)

  • E_Ewald + E_smearing(-TS) + delta_escf which gives a variational estimate using the output density. The -TS term is added by PlanewaveKohnShamEnergies::total(), not here; it is zero unless smearing is configured. Every term above is present in total(), so this line and that function must be kept in step.

Implements q3::SCFIterator.

Definition at line 344 of file init.hpp.

References compute_delta_escf_correction(), compute_density_residual(), compute_double_counting_correction(), compute_energy_components(), construct_density_from_states(), q3::log::debug(), density_residual_, diagonalization_threshold(), q3::KohnShamEnergies::double_counting_correction, energies_mutable(), first_iteration_rediag_done_, q3::log::info(), input_density_for_mixing(), q3::ProfilingCounters::instance(), is_iteration_converged(), q3::SCFIterator::iteration_, q3::ProfilingCounters::log_resident_checkpoint_debug(), q3::math::tolerances::minimum_eigenvalue_tolerance, mix_density(), mixer_, number_of_electrons(), prepare_hamiltonian(), q3::ProfilingCounters::release_unused_heap(), set_diagonalization_tolerance(), set_diagonalizer_tolerance(), snapshot_output_density(), solve_single_particle_states(), symmetrize_density(), synchronize_smooth_density_from_mixed(), update_effective_potential(), and update_occupations().

◆ potential_for_spin()

const std::vector< Real > & q3::KohnShamSCFIterator::potential_for_spin ( int  spin_index) const
inline

Definition at line 206 of file init.hpp.

References real_space_potential_.

◆ prepare_hamiltonian()

◆ real_space_potential()

const std::vector< Real > & q3::KohnShamSCFIterator::real_space_potential ( ) const
inline

Definition at line 203 of file init.hpp.

References real_space_potential_.

◆ report_convergence()

void q3::KohnShamSCFIterator::report_convergence ( )
inlineoverrideprotectedvirtual

◆ report_convergence_details()

virtual void q3::KohnShamSCFIterator::report_convergence_details ( )
protectedpure virtual

Representation-specific tail of the convergence report (eigenvalues, magnetization, final energy breakdown). Generic banner lives in report_convergence().

Implemented in q3::PlanewaveKohnShamSCFIterator, and q3::PawPlanewavePseudopotentialKohnShamSCFIterator.

Referenced by report_convergence(), and q3::PawPlanewavePseudopotentialKohnShamSCFIterator::report_convergence_details().

◆ report_first_iteration_details()

virtual void q3::KohnShamSCFIterator::report_first_iteration_details ( )
protectedpure virtual

Implemented in q3::PlanewaveKohnShamSCFIterator.

Referenced by report_iteration().

◆ report_iteration()

void q3::KohnShamSCFIterator::report_iteration ( )
inlineoverrideprotectedvirtual

◆ report_non_convergence()

void q3::KohnShamSCFIterator::report_non_convergence ( )
inlineoverrideprotectedvirtual

A non-self-consistent pass is one diagonalization by design, so stopping after it is not a failure to converge. The warning made every NSCF log read as though the run had failed.

Implements q3::SCFIterator.

Definition at line 562 of file init.hpp.

References q3::KohnShamSCFIteratorConfig::calculation, config_, energies(), q3::log::info(), q3::SCFIterator::maximum_iterations_, and q3::log::warn().

◆ restore_density_at_convergence()

virtual void q3::KohnShamSCFIterator::restore_density_at_convergence ( )
protectedpure virtual

◆ scf_history()

const std::vector< ScfIterationRecord > & q3::KohnShamSCFIterator::scf_history ( ) const
inline

Definition at line 180 of file init.hpp.

References scf_history_.

Referenced by q3::SelfConsistentFieldFlavor::run_calculation().

◆ set_diagonalization_tolerance()

virtual void q3::KohnShamSCFIterator::set_diagonalization_tolerance ( int  iteration)
protectedpure virtual

Implemented in q3::PlanewaveKohnShamSCFIterator.

Referenced by perform_iteration().

◆ set_diagonalizer_tolerance()

virtual void q3::KohnShamSCFIterator::set_diagonalizer_tolerance ( Real  tolerance)
protectedpure virtual

Implemented in q3::PlanewaveKohnShamSCFIterator.

Referenced by perform_iteration().

◆ snapshot_output_density()

virtual void q3::KohnShamSCFIterator::snapshot_output_density ( )
protectedpure virtual

◆ solve_single_particle_states()

virtual void q3::KohnShamSCFIterator::solve_single_particle_states ( )
protectedpure virtual

◆ symmetrize_density()

virtual void q3::KohnShamSCFIterator::symmetrize_density ( )
protectedpure virtual

◆ synchronize_smooth_density_from_mixed()

virtual void q3::KohnShamSCFIterator::synchronize_smooth_density_from_mixed ( )
inlineprotectedvirtual

Hook for representations that keep an auxiliary density (e.g. the smooth pre-augmentation density of ultrasoft pseudopotential_set). No-op by default.

Reimplemented in q3::UltrasoftPlanewavePseudopotentialKohnShamSCFIterator.

Definition at line 600 of file init.hpp.

Referenced by perform_iteration().

◆ total_energy()

Real q3::KohnShamSCFIterator::total_energy ( ) const
inlineoverridevirtual

◆ total_potential_g()

const std::vector< Complex > & q3::KohnShamSCFIterator::total_potential_g ( ) const
inline

Definition at line 209 of file init.hpp.

References total_potential_g_.

◆ update_effective_potential()

virtual void q3::KohnShamSCFIterator::update_effective_potential ( )
protectedpure virtual

◆ update_occupations()

virtual void q3::KohnShamSCFIterator::update_occupations ( )
protectedpure virtual

Implemented in q3::PlanewaveKohnShamSCFIterator.

Referenced by perform_iteration().

Member Data Documentation

◆ charge_density_g_

std::vector<Complex> q3::KohnShamSCFIterator::charge_density_g_
protected

◆ charge_density_real_

std::vector<std::vector<Real> > q3::KohnShamSCFIterator::charge_density_real_
protected

Definition at line 261 of file init.hpp.

Referenced by q3::UltrasoftPlanewavePseudopotentialKohnShamSCFIterator::add_augmentation_to_charge_density(), charge_density_for_spin(), charge_density_real(), q3::PlanewaveKohnShamSCFIterator::compute_delta_escf_correction(), q3::PlanewaveKohnShamSCFIterator::compute_density_residual(), q3::PlanewaveKohnShamSCFIterator::compute_double_counting_correction(), q3::PlanewaveKohnShamSCFIterator::construct_density_from_states(), q3::PlanewaveKohnShamSCFIterator::input_density_for_mixing(), q3::UltrasoftPlanewavePseudopotentialKohnShamSCFIterator::input_density_for_mixing(), load_charge_density(), q3::PlanewaveKohnShamSCFIterator::loaded_charge_density_fits_grid(), q3::PlanewaveKohnShamSCFIterator::mix_density(), offer_starting_charge_density(), q3::UltrasoftPlanewavePseudopotentialKohnShamSCFIterator::on_charge_density_initialized(), q3::PlanewaveKohnShamSCFIterator::preload_charge_density(), q3::PlanewaveKohnShamSCFIterator::report_convergence_details(), q3::PlanewaveKohnShamSCFIterator::restore_density_at_convergence(), q3::PlanewavePseudopotentialKohnShamSCFIterator::result(), q3::PlanewaveKohnShamSCFIterator::scale_loaded_charge_density_to_electron_count(), q3::PlanewaveKohnShamSCFIterator::snapshot_output_density(), q3::UltrasoftPlanewavePseudopotentialKohnShamSCFIterator::snapshot_smooth_density(), q3::PlanewaveKohnShamSCFIterator::symmetrize_density(), q3::UltrasoftPlanewavePseudopotentialKohnShamSCFIterator::symmetrize_density(), q3::UltrasoftPlanewavePseudopotentialKohnShamSCFIterator::synchronize_smooth_density_from_mixed(), q3::PlanewaveKohnShamSCFIterator::warn_if_total_charge_deviates(), and q3::PlanewavePseudopotentialKohnShamSCFIterator::write_checkpoints().

◆ config_

◆ density_residual_

Real q3::KohnShamSCFIterator::density_residual_ {0.0}
protected

◆ diagonalizer_tolerance_

Real q3::KohnShamSCFIterator::diagonalizer_tolerance_ {0.0}
protected

◆ exchange_correlation_

◆ exchange_correlation_functional_

std::string q3::KohnShamSCFIterator::exchange_correlation_functional_

Definition at line 162 of file init.hpp.

Referenced by initialize().

◆ exchange_correlation_potential_g_

std::vector<Complex> q3::KohnShamSCFIterator::exchange_correlation_potential_g_
protected

Definition at line 275 of file init.hpp.

Referenced by exchange_correlation_potential_g().

◆ first_iteration_rediag_done_

bool q3::KohnShamSCFIterator::first_iteration_rediag_done_ {false}
protected

Definition at line 294 of file init.hpp.

Referenced by perform_iteration().

◆ has_preloaded_charge_density_

bool q3::KohnShamSCFIterator::has_preloaded_charge_density_ {false}
protected

◆ has_preloaded_effective_potential_

bool q3::KohnShamSCFIterator::has_preloaded_effective_potential_ {false}
protected

True when V_eff has been injected via load_effective_potential(). When set, update_effective_potential() must not overwrite real_space_potential_.

Definition at line 281 of file init.hpp.

Referenced by load_effective_potential(), and q3::PlanewaveKohnShamSCFIterator::update_effective_potential().

◆ methfessel_paxton_order_

int q3::KohnShamSCFIterator::methfessel_paxton_order_

Definition at line 170 of file init.hpp.

Referenced by initialize().

◆ mixer_

◆ mixing_beta_

Real q3::KohnShamSCFIterator::mixing_beta_

◆ mixing_history_size_

int q3::KohnShamSCFIterator::mixing_history_size_

Definition at line 165 of file init.hpp.

Referenced by initialize().

◆ mixing_mode_

std::string q3::KohnShamSCFIterator::mixing_mode_

Definition at line 163 of file init.hpp.

Referenced by initialize().

◆ mixing_preconditioning_

std::string q3::KohnShamSCFIterator::mixing_preconditioning_

◆ mixing_q0_

Real q3::KohnShamSCFIterator::mixing_q0_

Definition at line 167 of file init.hpp.

Referenced by q3::PlanewaveKohnShamSCFIterator::initiate_mixer().

◆ preloaded_charge_density_is_a_starting_guess_

bool q3::KohnShamSCFIterator::preloaded_charge_density_is_a_starting_guess_ {false}
protected

◆ real_space_potential_

◆ scf_history_

std::vector<ScfIterationRecord> q3::KohnShamSCFIterator::scf_history_
protected

Definition at line 293 of file init.hpp.

Referenced by log_iteration_energy(), report_iteration(), and scf_history().

◆ smearing_

std::string q3::KohnShamSCFIterator::smearing_

◆ smearing_scheme_

std::unique_ptr<SmearingScheme> q3::KohnShamSCFIterator::smearing_scheme_
protected

◆ smearing_width_

Real q3::KohnShamSCFIterator::smearing_width_

◆ total_energy_previous_

Real q3::KohnShamSCFIterator::total_energy_previous_ {0.0}
protected

Definition at line 292 of file init.hpp.

Referenced by initialize(), report_convergence(), and report_iteration().

◆ total_potential_g_

◆ total_potential_g_by_spin_

std::vector<std::vector<Complex> > q3::KohnShamSCFIterator::total_potential_g_by_spin_
protected

The same potential per spin channel, un-averaged.

total_potential_g_ above is the spin average, which the nonlocal D was historically built from. That is exact for a non-magnetic cell and wrong for a magnetic one, because D_ij = D_ion + ∫v_eff·Q_ij inherits v_eff's spin dependence. Empty on paths that never filled it, in which case consumers fall back to the average.

Definition at line 274 of file init.hpp.

Referenced by q3::UltrasoftPlanewavePseudopotentialKohnShamSCFIterator::nonlocal_potentials_by_spin(), q3::PlanewavePseudopotentialKohnShamSCFIterator::result(), and q3::PlanewaveKohnShamSCFIterator::update_effective_potential().


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