Loading...
Searching...
No Matches
q3::PlanewaveKohnShamQuantumSystem Class Reference

#include <init.hpp>

+ Inheritance diagram for q3::PlanewaveKohnShamQuantumSystem:

Public Member Functions

 PlanewaveKohnShamQuantumSystem ()=default
 
 PlanewaveKohnShamQuantumSystem (const KPointsGrid &kpoint_grid, const PlanewaveBasis &basis, int number_of_bands, int number_of_spin_components_value, Real number_of_electrons)
 
 ~PlanewaveKohnShamQuantumSystem () override=default
 
void allocate_electronic_states (const std::vector< int > &number_of_plane_waves_per_kpoint)
 
const PlanewaveBasis & basis () const
 
void copy_quantum_states_from (const QuantumSystem< PlanewaveKohnShamQuantumState > &source) override
 
Real eigenvalue (int kpoint_state_index, int band_index) const
 
Matrix< Real > eigenvalues_matrix () const
 
Real fermi_energy () const
 
const KPointsGrid & kpoint_grid () const
 
int number_of_bands () const
 
Real number_of_electrons () const
 
int number_of_kpoint_states () const
 
int number_of_occupied_bands_per_spin () const
 
int number_of_plane_waves_for_kpoint_state (int kpoint_state_index) const
 
Real occupation_by_kpoint_state_index_and_band_index (int kpoint_state_index, int band_index) const
 
Occupation occupation_configuration () const
 Return a snapshot of the current occupation configuration.
 
PlanewaveKohnShamQuantumState & quantum_state (int kpoint_state_index, int band_index)
 
const PlanewaveKohnShamQuantumState & quantum_state (int kpoint_state_index, int band_index) const
 
void set_basis (const PlanewaveBasis *basis)
 
void set_eigenvalue (int kpoint_state_index, int band_index, Real value)
 
void set_eigenvalues_from_matrix (const Matrix< Real > &eigenvalues)
 
void set_fermi_energy (Real value)
 
void set_kpoint_grid (const KPointsGrid *kpoint_grid)
 
void set_number_of_bands (int value)
 
void set_number_of_electrons (Real value)
 
void set_occupation (int kpoint_state_index, int band_index, Real value)
 
Real spin_degeneracy () const
 
Complex wavefunction (int kpoint_index, int band_index, int g_vector_index) const
 
Complex * wavefunction_band_data (int kpoint_state_index, int band_index)
 
const Complex * wavefunction_band_data (int kpoint_state_index, int band_index) const
 
- Public Member Functions inherited from q3::KohnShamQuantumSystem< PlanewaveKohnShamQuantumState >
 ~KohnShamQuantumSystem () override=default
 
- Public Member Functions inherited from q3::QuantumSystem< QuantumStateType >
virtual ~QuantumSystem ()=default
 
virtual void copy_quantum_states_from (const QuantumSystem< QuantumStateType > &source)
 
QuantumStateType & get_quantum_state_by_index (int index)
 
const QuantumStateType & get_quantum_state_by_index (int index) const
 Access a quantum state by flat index.
 
void load_quantum_system (const QuantumSystem< QuantumStateType > &system)
 
int number_of_quantum_states () const
 Number of quantum states in the system.
 

Protected Attributes

const PlanewaveBasis * basis_ = nullptr
 
Real fermi_energy_ = 0.0
 
bool is_fractionally_occupied_ = false
 
const KPointsGrid * kpoint_grid_ = nullptr
 
int number_of_bands_ = 0
 
Real number_of_electrons_ = 0.0
 
- Protected Attributes inherited from q3::QuantumSystem< QuantumStateType >
std::vector< QuantumStateType > quantum_states_
 

Additional Inherited Members

- Public Attributes inherited from q3::KohnShamQuantumSystem< PlanewaveKohnShamQuantumState >
int number_of_spin_components
 
- Public Attributes inherited from q3::QuantumSystem< QuantumStateType >
Crystal * crystal_structure {nullptr}
 
const QuantumSystem< QuantumStateType > * preloaded_quantum_system_ {nullptr}
 

Detailed Description

Planewave representation of the electronic quantum system.

Stores an array of PlanewaveKohnShamQuantumState indexed as [kpoint_state_index * number_of_bands + band_index].

Definition at line 36 of file init.hpp.

Constructor & Destructor Documentation

◆ PlanewaveKohnShamQuantumSystem() [1/2]

q3::PlanewaveKohnShamQuantumSystem::PlanewaveKohnShamQuantumSystem ( )
default

◆ ~PlanewaveKohnShamQuantumSystem()

q3::PlanewaveKohnShamQuantumSystem::~PlanewaveKohnShamQuantumSystem ( )
overridedefault

◆ PlanewaveKohnShamQuantumSystem() [2/2]

q3::PlanewaveKohnShamQuantumSystem::PlanewaveKohnShamQuantumSystem ( const KPointsGrid &  kpoint_grid,
const PlanewaveBasis &  basis,
int  number_of_bands,
int  number_of_spin_components_value,
Real  number_of_electrons 
)
inline

Member Function Documentation

◆ allocate_electronic_states()

void q3::PlanewaveKohnShamQuantumSystem::allocate_electronic_states ( const std::vector< int > &  number_of_plane_waves_per_kpoint)
inline

Allocate quantum states using per-k-point PW counts from the basis. Creates number_of_kpoint_states * number_of_bands states, each with its wavefunction sized to the appropriate number of plane waves.

Definition at line 261 of file init.hpp.

References kpoint_grid_, number_of_bands_, number_of_kpoint_states(), q3::KPointsGrid::number_of_kpoints(), and q3::QuantumSystem< QuantumStateType >::quantum_states_.

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

◆ basis()

◆ copy_quantum_states_from()

void q3::PlanewaveKohnShamQuantumSystem::copy_quantum_states_from ( const QuantumSystem< PlanewaveKohnShamQuantumState > &  source)
inlineoverride

Copy all electronic state data from another PlanewaveKohnShamQuantumSystem.

Used to populate the owned quantum_system_snapshot_ in NormConservingPlanewaveKohnShamSCFState at convergence. Copies wavefunction coefficients, eigenvalues, occupations, Fermi energy, spin configuration, and the k-point grid / basis pointers needed to interpret them. Does NOT touch PP-specific data — that must already be set up by the factory on the destination.

Definition at line 231 of file init.hpp.

References basis_, q3::QuantumSystem< QuantumStateType >::copy_quantum_states_from(), fermi_energy_, is_fractionally_occupied_, kpoint_grid_, number_of_bands_, number_of_electrons_, and q3::KohnShamQuantumSystem< PlanewaveKohnShamQuantumState >::number_of_spin_components.

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

◆ eigenvalue()

◆ eigenvalues_matrix()

Matrix< Real > q3::PlanewaveKohnShamQuantumSystem::eigenvalues_matrix ( ) const
inline

◆ fermi_energy()

Real q3::PlanewaveKohnShamQuantumSystem::fermi_energy ( ) const
inline

◆ kpoint_grid()

const KPointsGrid & q3::PlanewaveKohnShamQuantumSystem::kpoint_grid ( ) const
inline

Definition at line 80 of file init.hpp.

References kpoint_grid_.

Referenced by set_kpoint_grid().

◆ number_of_bands()

int q3::PlanewaveKohnShamQuantumSystem::number_of_bands ( ) const
inline

◆ number_of_electrons()

Real q3::PlanewaveKohnShamQuantumSystem::number_of_electrons ( ) const
inline

Definition at line 62 of file init.hpp.

References number_of_electrons_.

◆ number_of_kpoint_states()

int q3::PlanewaveKohnShamQuantumSystem::number_of_kpoint_states ( ) const
inline

◆ number_of_occupied_bands_per_spin()

int q3::PlanewaveKohnShamQuantumSystem::number_of_occupied_bands_per_spin ( ) const
inline

Each spin channel holds N/2 electrons: 2 per band when unpolarized (spin_degeneracy 2), 1 per band in LSDA where the two channels are separate k-point states. Fixed occupations therefore describe a zero-total-moment configuration; magnetized systems need smearing (per-channel electron counts then come from the common Fermi level).

Definition at line 156 of file init.hpp.

References number_of_electrons_.

Referenced by q3::PlanewaveKohnShamSCFIterator::number_of_occupied_bands_per_spin(), q3::PlanewaveKohnShamSCFState::number_of_occupied_bands_per_spin(), occupation_by_kpoint_state_index_and_band_index(), occupation_configuration(), set_occupation(), and q3::PlanewaveDavidsonDiagonalizer::solve().

◆ number_of_plane_waves_for_kpoint_state()

int q3::PlanewaveKohnShamQuantumSystem::number_of_plane_waves_for_kpoint_state ( int  kpoint_state_index) const
inline

Number of plane waves for a given k-point state.

Definition at line 283 of file init.hpp.

References number_of_bands_, and q3::QuantumSystem< QuantumStateType >::quantum_states_.

◆ occupation_by_kpoint_state_index_and_band_index()

◆ occupation_configuration()

Occupation q3::PlanewaveKohnShamQuantumSystem::occupation_configuration ( ) const
inline

◆ quantum_state() [1/2]

PlanewaveKohnShamQuantumState & q3::PlanewaveKohnShamQuantumSystem::quantum_state ( int  kpoint_state_index,
int  band_index 
)
inline

◆ quantum_state() [2/2]

const PlanewaveKohnShamQuantumState & q3::PlanewaveKohnShamQuantumSystem::quantum_state ( int  kpoint_state_index,
int  band_index 
) const
inline

◆ set_basis()

void q3::PlanewaveKohnShamQuantumSystem::set_basis ( const PlanewaveBasis *  basis)
inline

Definition at line 217 of file init.hpp.

References basis(), and basis_.

◆ set_eigenvalue()

◆ set_eigenvalues_from_matrix()

void q3::PlanewaveKohnShamQuantumSystem::set_eigenvalues_from_matrix ( const Matrix< Real > &  eigenvalues)
inline

Set all eigenvalues from a Matrix<Real>.

Definition at line 188 of file init.hpp.

References number_of_bands_, number_of_kpoint_states(), and q3::QuantumSystem< QuantumStateType >::quantum_states_.

◆ set_fermi_energy()

void q3::PlanewaveKohnShamQuantumSystem::set_fermi_energy ( Real  value)
inline

Definition at line 203 of file init.hpp.

References fermi_energy_.

◆ set_kpoint_grid()

void q3::PlanewaveKohnShamQuantumSystem::set_kpoint_grid ( const KPointsGrid *  kpoint_grid)
inline

Definition at line 214 of file init.hpp.

References kpoint_grid(), and kpoint_grid_.

◆ set_number_of_bands()

void q3::PlanewaveKohnShamQuantumSystem::set_number_of_bands ( int  value)
inline

Definition at line 208 of file init.hpp.

References number_of_bands_.

◆ set_number_of_electrons()

void q3::PlanewaveKohnShamQuantumSystem::set_number_of_electrons ( Real  value)
inline

Definition at line 211 of file init.hpp.

References number_of_electrons_.

◆ set_occupation()

void q3::PlanewaveKohnShamQuantumSystem::set_occupation ( int  kpoint_state_index,
int  band_index,
Real  value 
)
inline

◆ spin_degeneracy()

◆ wavefunction()

Complex q3::PlanewaveKohnShamQuantumSystem::wavefunction ( int  kpoint_index,
int  band_index,
int  g_vector_index 
) const
inline

◆ wavefunction_band_data() [1/2]

◆ wavefunction_band_data() [2/2]

const Complex * q3::PlanewaveKohnShamQuantumSystem::wavefunction_band_data ( int  kpoint_state_index,
int  band_index 
) const
inline

Member Data Documentation

◆ basis_

const PlanewaveBasis* q3::PlanewaveKohnShamQuantumSystem::basis_ = nullptr
protected

◆ fermi_energy_

Real q3::PlanewaveKohnShamQuantumSystem::fermi_energy_ = 0.0
protected

Definition at line 293 of file init.hpp.

Referenced by copy_quantum_states_from(), fermi_energy(), and set_fermi_energy().

◆ is_fractionally_occupied_

bool q3::PlanewaveKohnShamQuantumSystem::is_fractionally_occupied_ = false
protected

◆ kpoint_grid_

const KPointsGrid* q3::PlanewaveKohnShamQuantumSystem::kpoint_grid_ = nullptr
protected

◆ number_of_bands_

◆ number_of_electrons_

Real q3::PlanewaveKohnShamQuantumSystem::number_of_electrons_ = 0.0
protected

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