SIRIUS 7.5.0
Electronic structure library and applications
Public Member Functions | Private Member Functions | Private Attributes | List of all members
sirius::K_point_set Class Reference

Set of k-points. More...

#include <k_point_set.hpp>

Public Member Functions

 K_point_set (Simulation_context &ctx__)
 Create empty k-point set. More...
 
 K_point_set (Simulation_context &ctx__, r3::vector< int > k_grid__, r3::vector< int > k_shift__, int use_symmetry__)
 Create a regular mesh of k-points. More...
 
 K_point_set (Simulation_context &ctx__, std::vector< std::array< double, 3 > > vec__)
 Create k-point set from a list of vectors. More...
 
 K_point_set (Simulation_context &ctx__, std::initializer_list< std::array< double, 3 > > vec__)
 Create k-point set from a list of vectors. More...
 
void initialize (std::vector< int > const &counts={})
 Initialize the k-point set. More...
 
template<typename T , sync_band_t what>
void sync_band ()
 Sync band energies or occupancies between all MPI ranks. More...
 
template<typename T >
void find_band_occupancies ()
 Find Fermi energy and band occupation numbers. More...
 
void print_info ()
 Print basic info to the standard output. More...
 
void save (std::string const &name__) const
 Save k-point set to HDF5 file. More...
 
void load ()
 
double valence_eval_sum () const
 Return sum of valence eigen-values. More...
 
double entropy_sum () const
 Return entropy contribution from smearing. More...
 
auto const & spl_num_kpoints () const
 
auto const & comm () const
 
void update ()
 Update k-points after moving atoms or changing the lattice vectors. More...
 
template<typename T >
auto get_band_energies (int ik__, int ispn__) const
 Get a list of band energies for a given k-point index. More...
 
int max_num_gkvec () const
 Return maximum number of G+k vectors among all k-points. More...
 
void add_kpoint (r3::vector< double > vk__, double weight__)
 Add k-point to the set. More...
 
void add_kpoints (sddk::mdarray< double, 2 > const &kpoints__, double const *weights__)
 Add multiple k-points to the set. More...
 
template<typename T >
K_point< T > * get (int ik__) const
 
template<typename T >
K_point< T > * get (int ik__)
 
int num_kpoints () const
 Return total number of k-points. More...
 
auto spl_num_kpoints (kp_index_t::local ikloc__) const
 
double energy_fermi () const
 
void set_energy_fermi (double energy_fermi__)
 
double band_gap () const
 
int find_kpoint (r3::vector< double > vk__)
 Find index of k-point. More...
 
auto & ctx ()
 
const auto & unit_cell ()
 
fft::Gvec get_gkvec (kp_index_t::global jk__, int rank__)
 Send G+k vectors of k-point jk to a given rank. More...
 
template<>
K_point< double > * get (int ik__) const
 
template<>
K_point< float > * get (int ik__) const
 

Private Member Functions

 K_point_set (K_point_set &src)=delete
 Copy constuctor is not allowed.
 
void create_k_mesh (r3::vector< int > k_grid__, r3::vector< int > k_shift__, int use_symmetry__)
 Create regular grid of k-points. More...
 
template<typename T >
double valence_eval_sum () const
 Return sum of valence eigen-values store in Kpoint<T>. More...
 
template<typename T >
double entropy_sum () const
 Return entropy contribution from smearing store in Kpoint<T>. More...
 

Private Attributes

Simulation_contextctx_
 Context of a simulation. More...
 
std::vector< std::unique_ptr< K_point< double > > > kpoints_
 List of k-points. More...
 
splindex_chunk< kp_index_tspl_num_kpoints_
 Split index of k-points. More...
 
double energy_fermi_ {0}
 Fermi energy which is searched in find_band_occupancies(). More...
 
double band_gap_ {0}
 Band gap found by find_band_occupancies(). More...
 
bool initialized_ {false}
 

Detailed Description

Set of k-points.

Definition at line 40 of file k_point_set.hpp.

Constructor & Destructor Documentation

◆ K_point_set() [1/4]

sirius::K_point_set::K_point_set ( Simulation_context ctx__)
inline

Create empty k-point set.

Definition at line 80 of file k_point_set.hpp.

◆ K_point_set() [2/4]

sirius::K_point_set::K_point_set ( Simulation_context ctx__,
r3::vector< int >  k_grid__,
r3::vector< int >  k_shift__,
int  use_symmetry__ 
)
inline

Create a regular mesh of k-points.

Definition at line 86 of file k_point_set.hpp.

◆ K_point_set() [3/4]

sirius::K_point_set::K_point_set ( Simulation_context ctx__,
std::vector< std::array< double, 3 > >  vec__ 
)
inline

Create k-point set from a list of vectors.

Definition at line 93 of file k_point_set.hpp.

◆ K_point_set() [4/4]

sirius::K_point_set::K_point_set ( Simulation_context ctx__,
std::initializer_list< std::array< double, 3 > >  vec__ 
)
inline

Create k-point set from a list of vectors.

Definition at line 103 of file k_point_set.hpp.

Member Function Documentation

◆ create_k_mesh()

void sirius::K_point_set::create_k_mesh ( r3::vector< int >  k_grid__,
r3::vector< int >  k_shift__,
int  use_symmetry__ 
)
private

Create regular grid of k-points.

Definition at line 90 of file k_point_set.cpp.

◆ valence_eval_sum() [1/2]

template<typename T >
double sirius::K_point_set::valence_eval_sum
private

Return sum of valence eigen-values store in Kpoint<T>.

Definition at line 450 of file k_point_set.cpp.

◆ entropy_sum() [1/2]

template<typename T >
double sirius::K_point_set::entropy_sum
private

Return entropy contribution from smearing store in Kpoint<T>.

Definition at line 487 of file k_point_set.cpp.

◆ initialize()

void sirius::K_point_set::initialize ( std::vector< int > const &  counts = {})

Initialize the k-point set.

Definition at line 133 of file k_point_set.cpp.

◆ sync_band()

template<typename T , sync_band_t what>
void sirius::K_point_set::sync_band

Sync band energies or occupancies between all MPI ranks.

Definition at line 30 of file k_point_set.cpp.

◆ find_band_occupancies()

template<typename T >
template void sirius::K_point_set::find_band_occupancies< double > ( )

Find Fermi energy and band occupation numbers.

Definition at line 276 of file k_point_set.cpp.

◆ print_info()

void sirius::K_point_set::print_info ( )

Print basic info to the standard output.

Definition at line 534 of file k_point_set.cpp.

◆ save()

void sirius::K_point_set::save ( std::string const &  name__) const

Save k-point set to HDF5 file.

Definition at line 564 of file k_point_set.cpp.

◆ load()

void sirius::K_point_set::load ( )
Todo:
check parameters of saved data in a separate function

Definition at line 586 of file k_point_set.cpp.

◆ valence_eval_sum() [2/2]

double sirius::K_point_set::valence_eval_sum ( ) const

Return sum of valence eigen-values.

Definition at line 472 of file k_point_set.cpp.

◆ entropy_sum() [2/2]

double sirius::K_point_set::entropy_sum ( ) const

Return entropy contribution from smearing.

Definition at line 520 of file k_point_set.cpp.

◆ spl_num_kpoints() [1/2]

auto const & sirius::K_point_set::spl_num_kpoints ( ) const
inline

Definition at line 133 of file k_point_set.hpp.

◆ comm()

auto const & sirius::K_point_set::comm ( ) const
inline

Definition at line 138 of file k_point_set.hpp.

◆ update()

void sirius::K_point_set::update ( )
inline

Update k-points after moving atoms or changing the lattice vectors.

Definition at line 144 of file k_point_set.hpp.

◆ get_band_energies()

template<typename T >
auto sirius::K_point_set::get_band_energies ( int  ik__,
int  ispn__ 
) const
inline

Get a list of band energies for a given k-point index.

Definition at line 157 of file k_point_set.hpp.

◆ max_num_gkvec()

int sirius::K_point_set::max_num_gkvec ( ) const
inline

Return maximum number of G+k vectors among all k-points.

Definition at line 167 of file k_point_set.hpp.

◆ add_kpoint()

void sirius::K_point_set::add_kpoint ( r3::vector< double >  vk__,
double  weight__ 
)
inline

Add k-point to the set.

Definition at line 178 of file k_point_set.hpp.

◆ add_kpoints()

void sirius::K_point_set::add_kpoints ( sddk::mdarray< double, 2 > const &  kpoints__,
double const *  weights__ 
)
inline

Add multiple k-points to the set.

Definition at line 187 of file k_point_set.hpp.

◆ get() [1/3]

template<typename T >
K_point< T > * sirius::K_point_set::get ( int  ik__)
inline

Definition at line 198 of file k_point_set.hpp.

◆ num_kpoints()

int sirius::K_point_set::num_kpoints ( ) const
inline

Return total number of k-points.

Definition at line 204 of file k_point_set.hpp.

◆ spl_num_kpoints() [2/2]

auto sirius::K_point_set::spl_num_kpoints ( kp_index_t::local  ikloc__) const
inline

Definition at line 209 of file k_point_set.hpp.

◆ energy_fermi()

double sirius::K_point_set::energy_fermi ( ) const
inline

Definition at line 214 of file k_point_set.hpp.

◆ set_energy_fermi()

void sirius::K_point_set::set_energy_fermi ( double  energy_fermi__)
inline

Definition at line 219 of file k_point_set.hpp.

◆ band_gap()

double sirius::K_point_set::band_gap ( ) const
inline

Definition at line 224 of file k_point_set.hpp.

◆ find_kpoint()

int sirius::K_point_set::find_kpoint ( r3::vector< double >  vk__)
inline

Find index of k-point.

Definition at line 230 of file k_point_set.hpp.

◆ ctx()

auto & sirius::K_point_set::ctx ( )
inline

Definition at line 240 of file k_point_set.hpp.

◆ unit_cell()

const auto & sirius::K_point_set::unit_cell ( )
inline

Definition at line 245 of file k_point_set.hpp.

◆ get_gkvec()

fft::Gvec sirius::K_point_set::get_gkvec ( kp_index_t::global  jk__,
int  rank__ 
)
inline

Send G+k vectors of k-point jk to a given rank.

Other ranks receive an empty Gvec placeholder

Definition at line 252 of file k_point_set.hpp.

◆ get() [2/3]

template<>
K_point< double > * sirius::K_point_set::get ( int  ik__) const
inline

Definition at line 1 of file k_point_set.hpp.

◆ get() [3/3]

template<>
K_point< float > * sirius::K_point_set::get ( int  ik__) const
inline

Definition at line 1 of file k_point_set.hpp.

Member Data Documentation

◆ ctx_

Simulation_context& sirius::K_point_set::ctx_
private

Context of a simulation.

Definition at line 44 of file k_point_set.hpp.

◆ kpoints_

std::vector<std::unique_ptr<K_point<double> > > sirius::K_point_set::kpoints_
private

List of k-points.

Definition at line 47 of file k_point_set.hpp.

◆ spl_num_kpoints_

splindex_chunk<kp_index_t> sirius::K_point_set::spl_num_kpoints_
private

Split index of k-points.

Definition at line 55 of file k_point_set.hpp.

◆ energy_fermi_

double sirius::K_point_set::energy_fermi_ {0}
private

Fermi energy which is searched in find_band_occupancies().

Definition at line 58 of file k_point_set.hpp.

◆ band_gap_

double sirius::K_point_set::band_gap_ {0}
private

Band gap found by find_band_occupancies().

Definition at line 61 of file k_point_set.hpp.

◆ initialized_

bool sirius::K_point_set::initialized_ {false}
private

Definition at line 69 of file k_point_set.hpp.


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