Loading...
Searching...
No Matches
q3::paw_one_center::PawOneCenterTerms Class Reference

#include <scf_terms.hpp>

Classes

struct  BranchTotals
 

Public Member Functions

const BranchTotals & branch_totals () const
 
void build (const Crystal &crystal_structure, const PseudopotentialSet &pseudopotential_set, const XCFunctional &functional, int angular_order=0)
 
const std::vector< Real > & d_correction (int atom_index, int spin=0) const
 
Real energy () const
 Σ_a (E¹_a − Ẽ¹_a), in Rydberg.
 
bool is_active () const
 
int number_of_channels (int species_index) const
 
void update (const Crystal &crystal_structure, const Matrix< Real > &projector_overlap_coefficients, int stride)
 
void update_by_spin (const Crystal &crystal_structure, const std::vector< const Matrix< Real > * > &projector_overlap_coefficients_by_spin, int row_capacity)
 

Detailed Description

One-center energy and D correction for every atom, refreshed per SCF step.

Constructed once per calculation; update() is the per-step call. Species that are not PAW are simply absent from the context list and contribute nothing, so a mixed PAW/ultrasoft cell needs no special case.

Definition at line 107 of file scf_terms.hpp.

Member Function Documentation

◆ branch_totals()

const BranchTotals & q3::paw_one_center::PawOneCenterTerms::branch_totals ( ) const
inline

◆ build()

void q3::paw_one_center::PawOneCenterTerms::build ( const Crystal &  crystal_structure,
const PseudopotentialSet &  pseudopotential_set,
const XCFunctional &  functional,
int  angular_order = 0 
)
inline
Parameters
angular_orderdrives the Gauss(θ)×uniform(φ) grid size; must be at least the largest density L, and is set from the dataset rather than fixed here

The grid must integrate products of harmonics up to the density's own largest L (2·l_max). GGA raises the effective angular order by one because the density gradient couples neighboring angular momenta. Without the increment, a d-channel density received only 15 azimuthal points rather than 18 and its highest gradient modes could alias. The dataset still drives the order unless the caller explicitly asks for more.

The convention is prepared last because building its reference state runs the full one-center engine once, which needs every table above already in place.

Definition at line 114 of file scf_terms.hpp.

References q3::paw_one_center::ReferenceStateInputs::angular_grid, q3::paw_one_center::build_angular_grid(), q3::paw_one_center::channel_expansion_matches_projectors(), q3::paw_one_center::create_one_center_convention(), q3::paw_one_center::density_lm_count(), q3::paw_one_center::expand_channels(), q3::paw_one_center::ReferenceStateInputs::expansion, q3::paw_one_center::ReferenceStateInputs::functional, q3::paw_one_center::ReferenceStateInputs::gaunt, q3::generate_gaunt_coefficients(), q3::paw_one_center::ReferenceStateInputs::harmonic_gradients, q3::paw_one_center::ReferenceStateInputs::harmonics, q3::log::info(), q3::Crystal::number_of_atoms(), q3::paw_one_center::ReferenceStateInputs::pseudopotential, q3::XCFunctional::requires_density_gradient(), q3::PseudopotentialSet::size(), q3::paw_one_center::tabulate_harmonic_gradients(), and q3::paw_one_center::tabulate_harmonics().

Referenced by q3::PawPlanewavePseudopotentialKohnShamSCFIterator::on_charge_density_initialized().

◆ d_correction()

const std::vector< Real > & q3::paw_one_center::PawOneCenterTerms::d_correction ( int  atom_index,
int  spin = 0 
) const
inline

(D¹ − D̃¹)_Hxc for one atom in one spin channel, as a dense (nh × nh) matrix; empty if the species is not PAW.

A channel beyond what was computed falls back to channel 0, so an unpolarized update() followed by a spin-polarized read is consistent rather than out of bounds.

Definition at line 381 of file scf_terms.hpp.

◆ energy()

Real q3::paw_one_center::PawOneCenterTerms::energy ( ) const
inline

Σ_a (E¹_a − Ẽ¹_a), in Rydberg.

Definition at line 369 of file scf_terms.hpp.

Referenced by q3::PawPlanewavePseudopotentialKohnShamSCFIterator::compute_energy_components(), and update_by_spin().

◆ is_active()

bool q3::paw_one_center::PawOneCenterTerms::is_active ( ) const
inline

◆ number_of_channels()

int q3::paw_one_center::PawOneCenterTerms::number_of_channels ( int  species_index) const
inline

Definition at line 386 of file scf_terms.hpp.

Referenced by update_by_spin().

◆ update()

void q3::paw_one_center::PawOneCenterTerms::update ( const Crystal &  crystal_structure,
const Matrix< Real > &  projector_overlap_coefficients,
int  stride 
)
inline

Recompute the one-center terms from the current occupancies.

Parameters
crystal_structureatom → species map
projector_overlap_coefficientsρ_ij: [atom][i * stride + j]
striderow length of that array, which is the maximum channel count over species, not this atom's own

Definition at line 211 of file scf_terms.hpp.

References update_by_spin().

◆ update_by_spin()

void q3::paw_one_center::PawOneCenterTerms::update_by_spin ( const Crystal &  crystal_structure,
const std::vector< const Matrix< Real > * > &  projector_overlap_coefficients_by_spin,
int  row_capacity 
)
inline

The spin-polarized form: one occupancy array per channel.

Exchange-correlation is nonlinear in the spin density, so an atom's on-site XC has to see ρ↑ and ρ↓ separately rather than their sum. Passing a single array reproduces the unpolarized result exactly, which is what update above does.

Parameters
projector_overlap_coefficients_by_spinρ_ij per channel, each [atom][i * channels + j]
row_capacityallocated row length, used only to bound the read

The row stride is this atom's own channel count, not the maximum over species.

Rows are allocated max_channels² wide so a mixed cell's array is rectangular, but the accumulation writes at i * channels(atom) + j — and add_augmentation_charges reads it back the same way. Using the allocated width here instead would shear every row belonging to a species narrower than the widest one: the one-center energy and D come out wrong for a mixed-species PAW cell (SiC, NiO, any oxide) and the run still converges.

Definition at line 230 of file scf_terms.hpp.

References q3::paw_one_center::build_one_center_densities(), q3::paw_one_center::compute_one_center_energy_either_mode(), q3::paw_one_center::compute_one_center_energy_spin(), energy(), q3::Crystal::number_of_atoms(), number_of_channels(), q3::Crystal::species_type_index(), and q3::paw_one_center::OnSiteOccupancies::zeros().

Referenced by update().


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