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

#include <init.hpp>

+ Inheritance diagram for q3::NormConservingPlanewaveBasis:

Public Member Functions

 NormConservingPlanewaveBasis ()=default
 
virtual ~NormConservingPlanewaveBasis ()=default
 
const std::vector< Real > & atomic_charge_density_g (int species_type) const
 
Real bare_d_matrix_element (int species_type, int projector_a, int projector_b) const
 
int beta_angular_momentum (int species_type, int projector_index) const
 
const BetaFunctionTable & beta_function_table () const
 
const std::vector< Complex > & core_charge_density_reciprocal () const
 
const CoreChargeDensityTable & core_charge_density_table () const
 
bool has_nonlinear_core_correction () const
 
virtual void init (const Crystal &crystal_structure, const PlanewaveBasis &planewave_basis, const PseudopotentialSet &pseudopotential_set)
 
Real interpolate_beta (int species_type_index, int beta_index, Real q_value) const
 
Real interpolate_core_charge_density (int element_type, Real q_value) const
 
Real interpolate_core_charge_density_derivative (int element_type, Real q_value) const
 
Real interpolate_dbeta (int species_type_index, int beta_index, Real q_value) const
 
Real interpolate_local_potential (int element_type, Real q_value) const
 
Real interpolate_local_potential_derivative (int element_type, Real q_value) const
 
Real interpolate_rho_core (int element_type, Real q_value) const
 
virtual bool is_ultrasoft () const
 
const std::vector< Real > & local_potential_g (int species_type_index) const
 
const LocalPotentialTable & local_potential_table () const
 
int number_of_projector_channels (int species_type) const
 
int number_of_projectors (int species_type) const
 
const PlanewaveBasis & planewave_basis () const
 
int projector_angular_momentum (int species_type, int projector_index) const
 
int projector_combined_lm_index (int species_type, int projector_index) const
 
int projector_magnetic_quantum_number (int species_type, int projector_index) const
 
const ProjectorMappingTable & projector_mapping_table () const
 
int projector_to_beta_index (int species_type, int projector_index) const
 
const PseudopotentialSet & pseudopotential_set () const
 
const std::vector< Complex > & total_local_potential_g () const
 
int total_number_of_projectors () const
 

Protected Member Functions

void compute_mesh_truncation_sizes (int number_of_species_types)
 

Protected Attributes

std::vector< std::vector< Real > > atomic_charge_density_g_
 
std::unique_ptr< BetaFunctionTable > beta_function_table_
 
Real cell_volume_ {1.0}
 
CoreChargeData core_charge_data_
 
CoreChargeDensityTable core_charge_density_table_
 
std::vector< std::vector< Real > > local_potential_g_per_species_
 
LocalPotentialTable local_potential_table_
 
std::vector< int > mesh_sizes_
 
const PlanewaveBasis * planewave_basis_ptr_ = nullptr
 
ProjectorMappingTable projector_mapping_table_
 
PseudopotentialSet pseudopotential_set_
 
std::vector< Complex > total_local_potential_g_
 

Detailed Description

Definition at line 48 of file init.hpp.

Constructor & Destructor Documentation

◆ NormConservingPlanewaveBasis()

q3::NormConservingPlanewaveBasis::NormConservingPlanewaveBasis ( )
default

◆ ~NormConservingPlanewaveBasis()

virtual q3::NormConservingPlanewaveBasis::~NormConservingPlanewaveBasis ( )
virtualdefault

Member Function Documentation

◆ atomic_charge_density_g()

const std::vector< Real > & q3::NormConservingPlanewaveBasis::atomic_charge_density_g ( int  species_type) const
inline

Atomic charge density in G-space for a species (used as initial guess).

Definition at line 252 of file init.hpp.

References atomic_charge_density_g_.

◆ bare_d_matrix_element()

Real q3::NormConservingPlanewaveBasis::bare_d_matrix_element ( int  species_type,
int  projector_a,
int  projector_b 
) const
inline

Bare D-matrix element D^0_{ij} from the pseudopotential file (species-level). For norm-conserving PPs, this is the sole nonlocal coupling. For ultrasoft PPs, this is the ion-bare part before screening.

Parameters
species_typeSpecies index
projector_aBeta projector index i (radial)
projector_bBeta projector index j (radial)

Definition at line 216 of file init.hpp.

References pseudopotential_set_.

◆ beta_angular_momentum()

int q3::NormConservingPlanewaveBasis::beta_angular_momentum ( int  species_type,
int  projector_index 
) const
inline

Angular momentum quantum number l for a specific beta projector of a species.

Definition at line 195 of file init.hpp.

References pseudopotential_set_.

Referenced by q3::UltrasoftPseudopotentialOverlapOperator::build_dense_matrix(), q3::NonlocalPseudopotentialForceCalculator::compute(), and q3::PlanewaveDirectDiagonalizer::solve().

◆ beta_function_table()

const BetaFunctionTable & q3::NormConservingPlanewaveBasis::beta_function_table ( ) const
inline

◆ compute_mesh_truncation_sizes()

void q3::NormConservingPlanewaveBasis::compute_mesh_truncation_sizes ( int  number_of_species_types)
inlineprotected

Compute mesh truncation sizes for radial integration of each species.

Definition at line 399 of file init.hpp.

References mesh_sizes_, pseudopotential_set_, q3::math::tolerances::radial_integration_truncation_radius, and q3::math::tolerances::use_radial_integration_truncation.

Referenced by init().

◆ core_charge_density_reciprocal()

const std::vector< Complex > & q3::NormConservingPlanewaveBasis::core_charge_density_reciprocal ( ) const
inline

◆ core_charge_density_table()

const CoreChargeDensityTable & q3::NormConservingPlanewaveBasis::core_charge_density_table ( ) const
inline

Access the core charge density interpolation table.

Definition at line 354 of file init.hpp.

References core_charge_density_table_.

◆ has_nonlinear_core_correction()

bool q3::NormConservingPlanewaveBasis::has_nonlinear_core_correction ( ) const
inline

◆ init()

virtual void q3::NormConservingPlanewaveBasis::init ( const Crystal &  crystal_structure,
const PlanewaveBasis &  planewave_basis,
const PseudopotentialSet &  pseudopotential_set 
)
inlinevirtual

◆ interpolate_beta()

Real q3::NormConservingPlanewaveBasis::interpolate_beta ( int  species_type_index,
int  beta_index,
Real  q_value 
) const
inline

Interpolate beta projector function β(|q|) from the pre-tabulated q-grid.

Parameters
species_type_indexSpecies index
beta_indexRadial beta projector index
q_valueWavevector magnitude |q| in atomic units (1/Bohr)

Definition at line 295 of file init.hpp.

References beta_function_table_.

◆ interpolate_core_charge_density()

Real q3::NormConservingPlanewaveBasis::interpolate_core_charge_density ( int  element_type,
Real  q_value 
) const
inline

Interpolate core charge density ρ_core(|q|) from pre-tabulated uniform q-grid. Replaces the expensive per-call radial integration with O(1) Lagrange interpolation.

Definition at line 332 of file init.hpp.

References core_charge_density_table_, and q3::CoreChargeDensityTable::interpolate().

Referenced by q3::CoreCorrectionStressTensorCalculator::compute(), and q3::CoreCorrectionForceCalculator::compute().

◆ interpolate_core_charge_density_derivative()

Real q3::NormConservingPlanewaveBasis::interpolate_core_charge_density_derivative ( int  element_type,
Real  q_value 
) const
inline

Interpolate derivative dρ_core/dq from pre-tabulated uniform q-grid.

Definition at line 339 of file init.hpp.

References core_charge_density_table_, and q3::CoreChargeDensityTable::interpolate_derivative().

Referenced by q3::CoreCorrectionStressTensorCalculator::compute().

◆ interpolate_dbeta()

Real q3::NormConservingPlanewaveBasis::interpolate_dbeta ( int  species_type_index,
int  beta_index,
Real  q_value 
) const
inline

Interpolate the derivative dβ/dq of a beta projector function. Uses 4-point Lagrange derivative interpolation.

Parameters
species_type_indexSpecies index
beta_indexRadial beta projector index
q_valueWavevector magnitude |q| in atomic units (1/Bohr)

Definition at line 307 of file init.hpp.

References beta_function_table_.

◆ interpolate_local_potential()

Real q3::NormConservingPlanewaveBasis::interpolate_local_potential ( int  element_type,
Real  q_value 
) const
inline

Interpolate local potential V_loc(|q|) from pre-tabulated uniform q-grid. Replaces the expensive per-call radial integration with O(1) Lagrange interpolation.

Definition at line 316 of file init.hpp.

References q3::LocalPotentialTable::interpolate(), and local_potential_table_.

◆ interpolate_local_potential_derivative()

Real q3::NormConservingPlanewaveBasis::interpolate_local_potential_derivative ( int  element_type,
Real  q_value 
) const
inline

Interpolate derivative dV_loc/dq from pre-tabulated uniform q-grid.

Definition at line 323 of file init.hpp.

References q3::LocalPotentialTable::interpolate_derivative(), and local_potential_table_.

Referenced by q3::LocalPseudopotentialStressTensorCalculator::compute().

◆ interpolate_rho_core()

Real q3::NormConservingPlanewaveBasis::interpolate_rho_core ( int  element_type,
Real  q_value 
) const
inline

Interpolate NLCC core charge density from pre-tabulated values. Uses 4-point Lagrange interpolation on the uniform q-grid.

Parameters
element_typeSpecies index
q_valueWavevector magnitude |q| in atomic units (1/Bohr)
Returns
Interpolated core charge density at |q|

Definition at line 277 of file init.hpp.

References core_charge_density_table_, and q3::CoreChargeDensityTable::interpolate().

◆ is_ultrasoft()

virtual bool q3::NormConservingPlanewaveBasis::is_ultrasoft ( ) const
inlinevirtual

Whether this basis uses ultrasoft pseudopotentials. Base class returns false; UltrasoftPlanewaveBasis returns true.

Reimplemented in q3::UltrasoftPlanewaveBasis.

Definition at line 373 of file init.hpp.

◆ local_potential_g()

const std::vector< Real > & q3::NormConservingPlanewaveBasis::local_potential_g ( int  species_type_index) const
inline

Return the local pseudopotential in G-space for a single species.

Parameters
species_type_indexIndex into the pseudopotential set (0-based)
Returns
V_loc(|G|) values indexed by G-vector index

Definition at line 165 of file init.hpp.

References local_potential_g_per_species_.

Referenced by q3::LocalPseudopotentialStressTensorCalculator::compute(), and q3::LocalPseudopotentialForceCalculator::compute().

◆ local_potential_table()

const LocalPotentialTable & q3::NormConservingPlanewaveBasis::local_potential_table ( ) const
inline

Access the local potential interpolation table.

Definition at line 347 of file init.hpp.

References local_potential_table_.

◆ number_of_projector_channels()

int q3::NormConservingPlanewaveBasis::number_of_projector_channels ( int  species_type) const
inline

Number of expanded projector channels for a species (sum of 2l+1 over all beta projectors, i.e. including magnetic quantum numbers).

Definition at line 203 of file init.hpp.

References q3::ProjectorMappingTable::number_of_channels(), and projector_mapping_table_.

Referenced by q3::UltrasoftPlanewaveBasis::add_augmentation_charges(), q3::PlanewaveBlochOverlapCalculator::add_augmentation_contribution(), q3::UltrasoftForceCalculator::compute(), and q3::UltrasoftPlanewaveBasis::precompute_q_functions_g().

◆ number_of_projectors()

int q3::NormConservingPlanewaveBasis::number_of_projectors ( int  species_type) const
inline

◆ planewave_basis()

const PlanewaveBasis & q3::NormConservingPlanewaveBasis::planewave_basis ( ) const
inline

Access the plane-wave basis set this PP basis was built from.

Definition at line 147 of file init.hpp.

References planewave_basis_ptr_.

Referenced by init(), q3::UltrasoftPlanewaveBasis::init(), q3::UltrasoftPlanewaveBasis::init_ultrasoft(), and q3::UltrasoftPlanewaveBasis::precompute_q_functions_g().

◆ projector_angular_momentum()

int q3::NormConservingPlanewaveBasis::projector_angular_momentum ( int  species_type,
int  projector_index 
) const
inline

Angular momentum l of an expanded projector channel.

Definition at line 237 of file init.hpp.

References q3::ProjectorMappingTable::angular_momentum(), and projector_mapping_table_.

◆ projector_combined_lm_index()

int q3::NormConservingPlanewaveBasis::projector_combined_lm_index ( int  species_type,
int  projector_index 
) const
inline

Combined (l,m) index for an expanded projector channel (QE convention: l² + offset).

Definition at line 230 of file init.hpp.

References q3::ProjectorMappingTable::combined_lm_index(), and projector_mapping_table_.

Referenced by q3::hubbard_augmentation_overlap().

◆ projector_magnetic_quantum_number()

int q3::NormConservingPlanewaveBasis::projector_magnetic_quantum_number ( int  species_type,
int  projector_index 
) const
inline

Magnetic quantum number m of an expanded projector channel.

Definition at line 244 of file init.hpp.

References q3::ProjectorMappingTable::magnetic_quantum_number(), and projector_mapping_table_.

◆ projector_mapping_table()

const ProjectorMappingTable & q3::NormConservingPlanewaveBasis::projector_mapping_table ( ) const
inline

Access the projector mapping table for expanded projector channel queries.

Definition at line 363 of file init.hpp.

References projector_mapping_table_.

Referenced by q3::UltrasoftPlanewaveEffectivePotential::compute().

◆ projector_to_beta_index()

int q3::NormConservingPlanewaveBasis::projector_to_beta_index ( int  species_type,
int  projector_index 
) const
inline

Map an expanded projector channel index back to its radial beta projector index.

Definition at line 223 of file init.hpp.

References projector_mapping_table_, and q3::ProjectorMappingTable::to_beta_index().

Referenced by q3::hubbard_augmentation_overlap().

◆ pseudopotential_set()

◆ total_local_potential_g()

const std::vector< Complex > & q3::NormConservingPlanewaveBasis::total_local_potential_g ( ) const
inline

Return the total local pseudopotential in G-space (structure-factor-weighted sum over all atoms and species).

Definition at line 173 of file init.hpp.

References total_local_potential_g_.

◆ total_number_of_projectors()

int q3::NormConservingPlanewaveBasis::total_number_of_projectors ( ) const
inline

Total number of Kleinman-Bylander projectors across all atoms (sum of projector channels per atom, accounting for angular momentum degeneracy).

Definition at line 181 of file init.hpp.

References projector_mapping_table_, and q3::ProjectorMappingTable::total_number_of_projectors().

Referenced by q3::NonlocalPseudopotentialForceCalculator::compute(), q3::GPUPlanewaveHamiltonianApplicator::prepare_kpoint(), q3::PlanewaveDavidsonDiagonalizer::solve(), and q3::PlanewaveDirectDiagonalizer::solve().

Member Data Documentation

◆ atomic_charge_density_g_

std::vector<std::vector<Real> > q3::NormConservingPlanewaveBasis::atomic_charge_density_g_
protected

Definition at line 382 of file init.hpp.

Referenced by atomic_charge_density_g(), and init().

◆ beta_function_table_

std::unique_ptr<BetaFunctionTable> q3::NormConservingPlanewaveBasis::beta_function_table_
protected

◆ cell_volume_

Real q3::NormConservingPlanewaveBasis::cell_volume_ {1.0}
protected

Definition at line 391 of file init.hpp.

Referenced by q3::UltrasoftPlanewaveBasis::init_ultrasoft().

◆ core_charge_data_

CoreChargeData q3::NormConservingPlanewaveBasis::core_charge_data_
protected

Definition at line 389 of file init.hpp.

Referenced by core_charge_density_reciprocal(), has_nonlinear_core_correction(), and init().

◆ core_charge_density_table_

CoreChargeDensityTable q3::NormConservingPlanewaveBasis::core_charge_density_table_
protected

◆ local_potential_g_per_species_

std::vector<std::vector<Real> > q3::NormConservingPlanewaveBasis::local_potential_g_per_species_
protected

Definition at line 381 of file init.hpp.

Referenced by init(), and local_potential_g().

◆ local_potential_table_

LocalPotentialTable q3::NormConservingPlanewaveBasis::local_potential_table_
protected

◆ mesh_sizes_

std::vector<int> q3::NormConservingPlanewaveBasis::mesh_sizes_
protected

◆ planewave_basis_ptr_

const PlanewaveBasis* q3::NormConservingPlanewaveBasis::planewave_basis_ptr_ = nullptr
protected

◆ projector_mapping_table_

◆ pseudopotential_set_

◆ total_local_potential_g_

std::vector<Complex> q3::NormConservingPlanewaveBasis::total_local_potential_g_
protected

Definition at line 383 of file init.hpp.

Referenced by init(), and total_local_potential_g().


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