ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
|
#include <atom_pair.h>
Public Member Functions | |
AtomPair (const int &atom_i_, const int &atom_j_, const Parallel_Orbitals *paraV_, T *existed_matrix=nullptr) | |
AtomPair (const int &atom_i_, const int &atom_j_, const int &rx, const int &ry, const int &rz, const Parallel_Orbitals *paraV_, T *existed_array=nullptr) | |
AtomPair (const int &atom_i_, const int &atom_j_, const ModuleBase::Vector3< int > &R_index, const Parallel_Orbitals *paraV_, T *existed_array=nullptr) | |
AtomPair (const int &atom_i, const int &atom_j, const int *row_atom_begin, const int *col_atom_begin, const int &natom, T *existed_matrix=nullptr) | |
AtomPair (const int &atom_i, const int &atom_j, const int &rx, const int &ry, const int &rz, const int *row_atom_begin, const int *col_atom_begin, const int &natom, T *existed_matrix=nullptr) | |
AtomPair (const AtomPair< T > &other, T *data_pointer=nullptr) | |
AtomPair (AtomPair &&other) noexcept | |
AtomPair (const int &atom_i_, const int &atom_j_) | |
~AtomPair () | |
void | allocate (T *data_array=nullptr, bool if_zero=false) |
allocate memory for all the BaseMatrix | |
void | set_zero () |
set values in every BaseMatrix to zero | |
int | get_begin_row () const |
get begin index of this AtomPair | |
int | get_begin_col () const |
int | get_col_size () const |
get col_size for this AtomPair | |
int | get_row_size () const |
get row_size for this AtomPair | |
int | get_atom_i () const |
get atom_i and atom_j for this AtomPair | |
int | get_atom_j () const |
void | set_size (const int &col_size_in, const int &row_size_in) |
set col_size and row_size | |
int | get_size () const |
get size = col_size * row_size | |
const Parallel_Orbitals * | get_paraV () const |
get Parallel_Orbitals pointer of this AtomPair for checking 2d-block parallel | |
void | set_paraV (const Parallel_Orbitals *paraV_in) |
set Parallel_Orbitals pointer of this AtomPair for checking 2d-block parallel | |
bool | identify (const AtomPair< T > &other) const |
use atom_i and atom_j to identify the atom-pair | |
bool | identify (const int &atom_i_, const int &atom_j_) const |
BaseMatrix< T > & | get_HR_values (int rx_in, int ry_in, int rz_in) |
get target BaseMatrix of target cell for const AtomPair, it will return a const BaseMatrix<T> object, and if not found, it will throw a error message for non-const AtomPair, it will return a BaseMatrix<T> object, and if not found, it will insert a new one and return it | |
const BaseMatrix< T > & | get_HR_values (int rx_in, int ry_in, int rz_in) const |
BaseMatrix< T > & | get_HR_values (const int &index) const |
get target BaseMatrix of index of this->values it will return a BaseMatrix<T> object, and if not found, it will throw a error message | |
ModuleBase::Vector3< int > | get_R_index (const int &index) const |
ModuleBase::Vector3< int > | get_R_index () const |
int | find_R (const int &rx_in, const int &ry_in, const int &rz_in) const |
int | find_R (const ModuleBase::Vector3< int > &R_in) const |
const BaseMatrix< T > * | find_matrix (const int &rx_in, const int &ry_in, const int &rz_in) const |
BaseMatrix< T > * | find_matrix (const int &rx_in, const int &ry_in, const int &rz_in) |
const BaseMatrix< T > * | find_matrix (const ModuleBase::Vector3< int > &R_in) const |
BaseMatrix< T > * | find_matrix (const ModuleBase::Vector3< int > &R_in) |
T & | get_value (const int &i) const |
T & | get_value (const int &row, const int &col) const |
std::tuple< std::vector< int >, T * > | get_matrix_values (int ir=-1) const |
get values of this->values[ir] for a whole matrix | |
T * | get_pointer (int ir=-1) const |
get pointer of value from a submatrix | |
void | convert_add (const BaseMatrix< T > &target, int rx_in, int ry_in, int rz_in) |
void | merge (const AtomPair< T > &other, bool skip_R=false) |
merge another AtomPair to this AtomPair | |
void | merge_to_gamma () |
merge all values in this AtomPair to one BaseMatrix with R-index (0, 0, 0) in this case, H_gamma = sum_{R} H_R will be saved in this->values[0] | |
void | add_to_matrix (std::complex< T > *hk, const int ld_hk, const std::complex< T > &kphase, const int hk_type=0) const |
Add this->value[current_R] * kphase as a block matrix of hk. | |
void | add_to_matrix (T *hk, const int ld_hk, const T &kphase, const int hk_type=0) const |
Add this->value[current_R] * kphase as a block matrix of hk. for non-collinear spin case only. | |
void | add_from_matrix (const std::complex< T > *hk, const int ld_hk, const std::complex< T > &kphase, const int hk_type=0) |
void | add_from_matrix (const T *hk, const int ld_hk, const T &kphase, const int hk_type=0) |
void | add_to_array (std::complex< T > *target_array, const std::complex< T > &kphase) const |
Add this->value[current_R] * kphase to an array. T = double or float. | |
void | add_to_array (T *target_array, const T &kphase) const |
Add this->value[current_R] * kphase to an array. for non-collinear spin case only (T = std::complex<double> or complex<float>) | |
bool | operator< (const AtomPair &other) const |
AtomPair & | operator= (const AtomPair &other) |
AtomPair & | operator= (AtomPair &&other) noexcept |
size_t | get_R_size () const |
size_t | get_memory_size () const |
get total memory size of AtomPair | |
Private Attributes | |
std::vector< ModuleBase::Vector3< int > > | R_index |
std::vector< BaseMatrix< T > > | values |
const Parallel_Orbitals * | paraV = nullptr |
int | current_R = 0 |
int | atom_i = -1 |
int | atom_j = -1 |
int | row_ap = -1 |
int | col_ap = -1 |
int | row_size = 0 |
int | col_size = 0 |
Class: AtomPair
the simplest way to use this class is: { AtomPair<T> atom_pair(atom_i, atom_j); atom_pair.set_size(row_size, col_size); const int rx = 0, ry = 0, rz = 0; auto tmp_matrix = atom_pair.get_HR_values(rx, ry, rz);
hamilt::AtomPair< T >::AtomPair | ( | const int & | atom_i_, |
const int & | atom_j_, | ||
const Parallel_Orbitals * | paraV_, | ||
T * | existed_matrix = nullptr |
||
) |
hamilt::AtomPair< T >::AtomPair | ( | const int & | atom_i_, |
const int & | atom_j_, | ||
const int & | rx, | ||
const int & | ry, | ||
const int & | rz, | ||
const Parallel_Orbitals * | paraV_, | ||
T * | existed_array = nullptr |
||
) |
hamilt::AtomPair< T >::AtomPair | ( | const int & | atom_i_, |
const int & | atom_j_, | ||
const ModuleBase::Vector3< int > & | R_index, | ||
const Parallel_Orbitals * | paraV_, | ||
T * | existed_array = nullptr |
||
) |
hamilt::AtomPair< T >::AtomPair | ( | const int & | atom_i, |
const int & | atom_j, | ||
const int * | row_atom_begin, | ||
const int * | col_atom_begin, | ||
const int & | natom, | ||
T * | existed_matrix = nullptr |
||
) |
hamilt::AtomPair< T >::AtomPair | ( | const int & | atom_i, |
const int & | atom_j, | ||
const int & | rx, | ||
const int & | ry, | ||
const int & | rz, | ||
const int * | row_atom_begin, | ||
const int * | col_atom_begin, | ||
const int & | natom, | ||
T * | existed_matrix = nullptr |
||
) |
hamilt::AtomPair< T >::AtomPair | ( | const AtomPair< T > & | other, |
T * | data_pointer = nullptr |
||
) |
|
noexcept |
hamilt::AtomPair< T >::AtomPair | ( | const int & | atom_i_, |
const int & | atom_j_ | ||
) |
hamilt::AtomPair< T >::~AtomPair | ( | ) |
void hamilt::AtomPair< T >::add_from_matrix | ( | const std::complex< T > * | hk, |
const int | ld_hk, | ||
const std::complex< T > & | kphase, | ||
const int | hk_type = 0 |
||
) |
void hamilt::AtomPair< T >::add_from_matrix | ( | const T * | hk, |
const int | ld_hk, | ||
const T & | kphase, | ||
const int | hk_type = 0 |
||
) |
void hamilt::AtomPair< T >::add_to_array | ( | std::complex< T > * | target_array, |
const std::complex< T > & | kphase | ||
) | const |
Add this->value[current_R] * kphase to an array. T = double or float.
void hamilt::AtomPair< T >::add_to_array | ( | T * | target_array, |
const T & | kphase | ||
) | const |
Add this->value[current_R] * kphase to an array. for non-collinear spin case only (T = std::complex<double> or complex<float>)
void hamilt::AtomPair< T >::add_to_matrix | ( | std::complex< T > * | hk, |
const int | ld_hk, | ||
const std::complex< T > & | kphase, | ||
const int | hk_type = 0 |
||
) | const |
Add this->value[current_R] * kphase as a block matrix of hk.
For row major dense matrix (hk_type == 0): value[current_R][i*col_size+j] -> hk[(row_ap+i) * ld_hk + col_ap + j] For column major dense matrix (hk_type == 1): value[current_R][i*col_size+j] -> hk[row_ap + i + (col_ap+j) * ld_hk] For sparse matrix (hk_type == 2): not implemented yet
hk | Pointer to the target matrix. |
ld_hk | Leading dimension of the target matrix. |
kphase | Complex scalar to be multiplied with the block matrix. |
hk_type | The type of matrix layout (default: 0). |
void hamilt::AtomPair< T >::add_to_matrix | ( | T * | hk, |
const int | ld_hk, | ||
const T & | kphase, | ||
const int | hk_type = 0 |
||
) | const |
Add this->value[current_R] * kphase as a block matrix of hk. for non-collinear spin case only.
void hamilt::AtomPair< T >::allocate | ( | T * | data_array = nullptr , |
bool | if_zero = false |
||
) |
void hamilt::AtomPair< T >::convert_add | ( | const BaseMatrix< T > & | target, |
int | rx_in, | ||
int | ry_in, | ||
int | rz_in | ||
) |
BaseMatrix< T > * hamilt::AtomPair< T >::find_matrix | ( | const int & | rx_in, |
const int & | ry_in, | ||
const int & | rz_in | ||
) |
const BaseMatrix< T > * hamilt::AtomPair< T >::find_matrix | ( | const int & | rx_in, |
const int & | ry_in, | ||
const int & | rz_in | ||
) | const |
BaseMatrix< T > * hamilt::AtomPair< T >::find_matrix | ( | const ModuleBase::Vector3< int > & | R_in | ) |
const BaseMatrix< T > * hamilt::AtomPair< T >::find_matrix | ( | const ModuleBase::Vector3< int > & | R_in | ) | const |
int hamilt::AtomPair< T >::find_R | ( | const int & | rx_in, |
const int & | ry_in, | ||
const int & | rz_in | ||
) | const |
int hamilt::AtomPair< T >::find_R | ( | const ModuleBase::Vector3< int > & | R_in | ) | const |
int hamilt::AtomPair< T >::get_atom_i | ( | ) | const |
int hamilt::AtomPair< T >::get_atom_j | ( | ) | const |
|
inline |
|
inline |
int hamilt::AtomPair< T >::get_col_size | ( | ) | const |
BaseMatrix< T > & hamilt::AtomPair< T >::get_HR_values | ( | const int & | index | ) | const |
get target BaseMatrix of index of this->values it will return a BaseMatrix<T> object, and if not found, it will throw a error message
index | index of this->values |
BaseMatrix< T > & hamilt::AtomPair< T >::get_HR_values | ( | int | rx_in, |
int | ry_in, | ||
int | rz_in | ||
) |
get target BaseMatrix of target cell for const AtomPair, it will return a const BaseMatrix<T> object, and if not found, it will throw a error message for non-const AtomPair, it will return a BaseMatrix<T> object, and if not found, it will insert a new one and return it
rx_in | x coordinate of cell |
ry_in | y coordinate of cell |
rz_in | z coordinate of cell |
const BaseMatrix< T > & hamilt::AtomPair< T >::get_HR_values | ( | int | rx_in, |
int | ry_in, | ||
int | rz_in | ||
) | const |
std::tuple< std::vector< int >, T * > hamilt::AtomPair< T >::get_matrix_values | ( | int | ir = -1 | ) | const |
get values of this->values[ir] for a whole matrix
ir | index of this->values |
size_t hamilt::AtomPair< T >::get_memory_size | ( | ) | const |
get total memory size of AtomPair
const Parallel_Orbitals * hamilt::AtomPair< T >::get_paraV | ( | ) | const |
get Parallel_Orbitals pointer of this AtomPair for checking 2d-block parallel
T * hamilt::AtomPair< T >::get_pointer | ( | int | ir = -1 | ) | const |
get pointer of value from a submatrix
ModuleBase::Vector3< int > hamilt::AtomPair< T >::get_R_index | ( | ) | const |
ModuleBase::Vector3< int > hamilt::AtomPair< T >::get_R_index | ( | const int & | index | ) | const |
|
inline |
int hamilt::AtomPair< T >::get_row_size | ( | ) | const |
|
inline |
get size = col_size * row_size
T & hamilt::AtomPair< T >::get_value | ( | const int & | i | ) | const |
T & hamilt::AtomPair< T >::get_value | ( | const int & | row, |
const int & | col | ||
) | const |
bool hamilt::AtomPair< T >::identify | ( | const AtomPair< T > & | other | ) | const |
use atom_i and atom_j to identify the atom-pair
bool hamilt::AtomPair< T >::identify | ( | const int & | atom_i_, |
const int & | atom_j_ | ||
) | const |
void hamilt::AtomPair< T >::merge | ( | const AtomPair< T > & | other, |
bool | skip_R = false |
||
) |
void hamilt::AtomPair< T >::merge_to_gamma | ( | ) |
merge all values in this AtomPair to one BaseMatrix with R-index (0, 0, 0) in this case, H_gamma = sum_{R} H_R will be saved in this->values[0]
bool hamilt::AtomPair< T >::operator< | ( | const AtomPair< T > & | other | ) | const |
|
noexcept |
AtomPair< T > & hamilt::AtomPair< T >::operator= | ( | const AtomPair< T > & | other | ) |
|
inline |
set Parallel_Orbitals pointer of this AtomPair for checking 2d-block parallel
void hamilt::AtomPair< T >::set_size | ( | const int & | col_size_in, |
const int & | row_size_in | ||
) |
set col_size and row_size
void hamilt::AtomPair< T >::set_zero | ( | ) |
set values in every BaseMatrix to zero
|
private |
|
private |
|
private |
|
private |
|
mutableprivate |
|
private |
|
private |
|
private |
|
private |
|
private |