#include <klist.h>
|
std::vector< ModuleBase::Vector3< double > > | kvec_c |
|
std::vector< ModuleBase::Vector3< double > > | kvec_d |
| Cartesian coordinates of k points.
|
|
std::vector< double > | wk |
| Direct coordinates of k points.
|
|
std::vector< int > | ngk |
| wk, weight of k points
|
|
std::vector< int > | isk |
| ngk, number of plane waves for each k point
|
|
int | nmp [3] ={0} |
| distinguish spin up and down k points
|
|
std::vector< int > | kl_segids |
| Number of Monhorst-Pack.
|
|
std::vector< std::map< int, ModuleBase::Vector3< double > > > | kstars |
| index of kline segment
|
|
bool | kc_done = false |
|
bool | kd_done = false |
|
Parallel_Kpoints | para_k |
| parallel for kpoints
|
|
std::vector< int > | ik2iktot |
| [nks] map ik to the global index of k points
|
|
std::vector< int > | ibz_index |
| map k points (before symmetry reduction) to irreducible k-points
|
|
|
void | renew (const int &kpoint_number) |
| Resize the k-point related vectors according to the new k-point number.
|
|
bool | read_kpoints (const UnitCell &ucell, const std::string &fn) |
| Reads the k-points from a file.
|
|
void | interpolate_k_between (std::ifstream &ifk, std::vector< ModuleBase::Vector3< double > > &kvec) |
| Adds k-points linearly between special points.
|
|
void | Monkhorst_Pack (const int *nmp_in, const double *koffset_in, const int tipo) |
| Generates k-points using the Monkhorst-Pack scheme.
|
|
double | Monkhorst_Pack_formula (const int &k_type, const double &offset, const int &n, const int &dim) |
| Calculates the coordinate of a k-point using the Monkhorst-Pack scheme.
|
|
void | normalize_wk (const int °spin) |
| Normalizes the weights of the k-points.
|
|
void | set_kup_and_kdw () |
| Sets up the k-points for spin-up and spin-down calculations.
|
|
void | cal_ik_global () |
| Gets the global index of a k-point.
|
|
|
int | nks = 0 |
| number of symmetry-reduced k points in this pool(processor, up+dw)
|
|
int | nkstot = 0 |
| number of symmetry-reduced k points in full k mesh
|
|
int | nkstot_full = 0 |
| number of k points before symmetry reduction in full k mesh
|
|
int | nspin = 0 |
|
double | koffset [3] = {0.0} |
|
std::string | k_kword |
|
int | k_nkstot = 0 |
|
bool | is_mp = false |
|
◆ K_Vectors()
◆ ~K_Vectors()
K_Vectors::~K_Vectors |
( |
| ) |
|
|
inline |
◆ cal_ik_global()
void K_Vectors::cal_ik_global |
( |
| ) |
|
|
private |
Gets the global index of a k-point.
- Returns
- this->ik2iktot[ik]
◆ get_is_mp()
bool K_Vectors::get_is_mp |
( |
| ) |
const |
|
inline |
◆ get_k_kword()
std::string K_Vectors::get_k_kword |
( |
| ) |
const |
|
inline |
◆ get_k_nkstot()
int K_Vectors::get_k_nkstot |
( |
| ) |
const |
|
inline |
◆ get_koffset()
double K_Vectors::get_koffset |
( |
const int |
i | ) |
const |
|
inline |
◆ get_nks()
int K_Vectors::get_nks |
( |
| ) |
const |
|
inline |
◆ get_nkstot()
int K_Vectors::get_nkstot |
( |
| ) |
const |
|
inline |
◆ get_nkstot_full()
int K_Vectors::get_nkstot_full |
( |
| ) |
const |
|
inline |
◆ get_nspin()
int K_Vectors::get_nspin |
( |
| ) |
const |
|
inline |
◆ interpolate_k_between()
void K_Vectors::interpolate_k_between |
( |
std::ifstream & |
ifk, |
|
|
std::vector< ModuleBase::Vector3< double > > & |
kvec |
|
) |
| |
|
private |
Adds k-points linearly between special points.
This function adds k-points linearly between special points in the Brillouin zone. The special points and the number of k-points between them are read from an input file.
- Parameters
-
ifk | The input file stream from which the special points and the number of k-points between them are read. |
kvec | A vector to store the generated k-points. |
- Returns
- void
- Note
- The function first reads the number of special points (nks_special) and the number of k-points between them (nkl) from the input file.
-
The function then recalculates the total number of k-points (nkstot) based on the number of k-points between the special points.
-
The function generates the k-points by linearly interpolating between the special points.
-
The function also assigns a segment ID to each k-point to distinguish different k-line segments.
-
The function checks that the total number of generated k-points matches the calculated total number of k-points.
-
The function checks that the size of the segment ID vector matches the total number of k-points.
◆ Monkhorst_Pack()
void K_Vectors::Monkhorst_Pack |
( |
const int * |
nmp_in, |
|
|
const double * |
koffset_in, |
|
|
const int |
tipo |
|
) |
| |
|
private |
Generates k-points using the Monkhorst-Pack scheme.
This function generates k-points in the reciprocal space using the Monkhorst-Pack scheme.
- Parameters
-
nmp_in | the number of k-points in each dimension. |
koffset_in | the offset for the k-points in each dimension. |
k_type | The type of k-point. 1 means without Gamma point, 0 means with Gamma. |
- Returns
- void
- Note
- The function assumes that the k-points are evenly distributed in the reciprocal space.
-
The function sets the weight of each k-point to be equal, so that the total weight of all k-points is 1.
-
The function sets the flag kd_done to true to indicate that the k-points have been generated.
◆ Monkhorst_Pack_formula()
double K_Vectors::Monkhorst_Pack_formula |
( |
const int & |
k_type, |
|
|
const double & |
offset, |
|
|
const int & |
n, |
|
|
const int & |
dim |
|
) |
| |
|
private |
Calculates the coordinate of a k-point using the Monkhorst-Pack scheme.
This function calculates the coordinate of a k-point in the reciprocal space using the Monkhorst-Pack scheme. The Monkhorst-Pack scheme is a method for generating k-points in the Brillouin zone.
- Parameters
-
k_type | The type of k-point. 1 means without Gamma point, 0 means with Gamma. |
offset | The offset for the k-point. |
n | The index of the k-point in the current dimension. |
dim | The total number of k-points in the current dimension. |
- Returns
- double Returns the coordinate of the k-point.
- Note
- The function assumes that the k-points are evenly distributed in the reciprocal space.
◆ normalize_wk()
void K_Vectors::normalize_wk |
( |
const int & |
degspin | ) |
|
|
private |
Normalizes the weights of the k-points.
This function normalizes the weights of the k-points so that their sum is equal to the degeneracy of spin (degspin).
- Parameters
-
degspin | The degeneracy of spin. This is 1 for non-spin-polarized calculations and 2 for spin-polarized calculations. |
- Returns
- void
- Note
- This function should only be called by the master process (MY_RANK == 0).
-
The function assumes that the sum of the weights of the k-points is greater than 0.
-
The function first normalizes the weights so that their sum is 1, and then scales them by the degeneracy of spin.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ read_kpoints()
bool K_Vectors::read_kpoints |
( |
const UnitCell & |
ucell, |
|
|
const std::string & |
fn |
|
) |
| |
|
private |
Reads the k-points from a file.
This function reads the k-points from a file specified by the filename. It supports both Cartesian and Direct coordinates, and can handle different types of k-points, including Gamma, Monkhorst-Pack, and Line mode. It also supports automatic generation of k-points file if the file does not exist.
- Parameters
-
fn | The name of the file containing the k-points. |
- Returns
- bool Returns true if the k-points are successfully read from the file, false otherwise.
- Note
- It will generate a k-points file automatically according to the global variables GAMMA_ONLY_LOCAL and KSPACING.
-
If the k-points type is neither Gamma nor Monkhorst-Pack, it will quit with a warning.
-
If the k-points type is Line mode and the symmetry flag is 1, it will quit with a warning.
-
If the number of k-points is greater than 100000, it will quit with a warning.
◆ renew()
void K_Vectors::renew |
( |
const int & |
kpoint_number | ) |
|
|
private |
Resize the k-point related vectors according to the new k-point number.
This function resizes the vectors that store the k-point information, including the Cartesian and Direct coordinates of k-points, the weights of k-points, the index of k-points, and the number of plane waves for each k-point.
- Parameters
-
kpoint_number | The new number of k-points. |
- Returns
- void
- Note
- The memory recording lines are commented out. If you want to track the memory usage, you can uncomment these lines.
◆ set()
Set up the k-points for the system.
This function sets up the k-points according to the input parameters and symmetry operations. It also treats the spin as another set of k-points.
- Parameters
-
symm | The symmetry of the system. |
k_file_name | The name of the file containing the k-points. |
nspin_in | The number of spins. |
reciprocal_vec | The reciprocal vector of the system. |
latvec | The lattice vector of the system. |
- Returns
- void
- Note
- This function will quit with a warning if something goes wrong while reading the KPOINTS file.
-
If the optimized lattice type of the reciprocal lattice cannot match the optimized real lattice, it will output a warning and suggest possible solutions.
-
Only available for nspin = 1 or 2 or 4.
◆ set_kup_and_kdw()
void K_Vectors::set_kup_and_kdw |
( |
| ) |
|
|
private |
Sets up the k-points for spin-up and spin-down calculations.
This function sets up the k-points for spin-up and spin-down calculations. If the calculation is spin-polarized (nspin = 2), the number of k-points is doubled. The first half of the k-points correspond to spin-up, and the second half correspond to spin-down. 2 for LSDA 4 for non-collinear
- Returns
- void
- Note
- For non-spin-polarized calculations (nspin = 1 or 4), the function simply sets the spin index of all k-points to 0.
-
For spin-polarized calculations (nspin = 2), the function duplicates the k-points and their weights, sets the spin index of the first half of the k-points to 0 (spin-up), and the spin index of the second half to 1 (spin-down).
-
The function also doubles the total number of k-points (nks and nkstot) for spin-polarized calculations.
-
The function prints the total number of k-points for spin-polarized calculations.
◆ set_nks()
void K_Vectors::set_nks |
( |
int |
value | ) |
|
|
inline |
◆ set_nkstot()
void K_Vectors::set_nkstot |
( |
int |
value | ) |
|
|
inline |
◆ set_nkstot_full()
void K_Vectors::set_nkstot_full |
( |
int |
value | ) |
|
|
inline |
◆ set_nspin()
void K_Vectors::set_nspin |
( |
int |
value | ) |
|
|
inline |
◆ update_use_ibz()
void K_Vectors::update_use_ibz |
( |
const int & |
nkstot_ibz, |
|
|
const std::vector< ModuleBase::Vector3< double > > & |
kvec_d_ibz, |
|
|
const std::vector< double > & |
wk_ibz |
|
) |
| |
Updates the k-points to use the irreducible Brillouin zone (IBZ).
This function updates the k-points to use the irreducible Brillouin zone (IBZ) instead of the full Brillouin zone.
- Returns
- void
- Note
- This function should only be called by the master process (MY_RANK == 0).
-
This function assumes that the number of k-points in the IBZ (nkstot_ibz) is greater than 0.
-
This function updates the total number of k-points (nkstot) to be the number of k-points in the IBZ.
-
This function resizes the vector of k-points (kvec_d) and updates its values to be the k-points in the IBZ.
-
This function also updates the weights of the k-points (wk) to be the weights in the IBZ.
-
After this function is called, the flag kd_done is set to true to indicate that the k-points have been updated, and the flag kc_done is set to false to indicate that the Cartesian coordinates of the k-points need to be recalculated.
◆ KVectorUtils::kvec_mpi_k
◆ ibz_index
std::vector<int> K_Vectors::ibz_index |
map k points (before symmetry reduction) to irreducible k-points
◆ ik2iktot
std::vector<int> K_Vectors::ik2iktot |
[nks] map ik to the global index of k points
◆ is_mp
bool K_Vectors::is_mp = false |
|
private |
◆ isk
std::vector<int> K_Vectors::isk |
ngk, number of plane waves for each k point
◆ k_kword
std::string K_Vectors::k_kword |
|
private |
◆ k_nkstot
int K_Vectors::k_nkstot = 0 |
|
private |
◆ kc_done
bool K_Vectors::kc_done = false |
◆ kd_done
bool K_Vectors::kd_done = false |
◆ kl_segids
std::vector<int> K_Vectors::kl_segids |
◆ koffset
double K_Vectors::koffset[3] = {0.0} |
|
private |
◆ kstars
index of kline segment
equal k points to each ibz-kpont, corresponding to a certain symmetry operations. dim: [iks_ibz][(isym, kvec_d)]
◆ kvec_c
◆ kvec_d
Cartesian coordinates of k points.
◆ ngk
std::vector<int> K_Vectors::ngk |
◆ nks
number of symmetry-reduced k points in this pool(processor, up+dw)
◆ nkstot
int K_Vectors::nkstot = 0 |
|
private |
number of symmetry-reduced k points in full k mesh
◆ nkstot_full
int K_Vectors::nkstot_full = 0 |
|
private |
number of k points before symmetry reduction in full k mesh
◆ nmp
int K_Vectors::nmp[3] ={0} |
distinguish spin up and down k points
◆ nspin
◆ para_k
◆ wk
std::vector<double> K_Vectors::wk |
Direct coordinates of k points.
The documentation for this class was generated from the following files:
- /home/runner/work/abacus-develop/abacus-develop/source/source_cell/klist.h
- /home/runner/work/abacus-develop/abacus-develop/source/source_cell/klist.cpp