ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
|
Typedefs | |
using | TC = std::array< int, 3 > |
using | TAC = std::pair< int, TC > |
template<typename T > | |
using | TLRIX = std::map< int, std::map< TAC, std::vector< T > > > |
Functions | |
int | cal_nocc (int nelec) |
=================PHYSICS==================== | |
std::pair< ModuleBase::matrix, std::vector< std::pair< int, int > > > | set_ix_map_diagonal (bool mode, int nc, int nv) |
set the index map: ix to (ic, iv) and vice versa by diagonal traverse the c-v pairs leftdown -> rightup for mode 0, rightup -> leftdown for mode 1 | |
template<> | |
void | matsym< double > (const double *in, const int n, const Parallel_2D &pmat, double *out) |
=================ALGORITHM==================== | |
template<> | |
void | matsym< double > (double *inout, const int n, const Parallel_2D &pmat) |
template<> | |
void | matsym< std::complex< double > > (const std::complex< double > *in, const int n, const Parallel_2D &pmat, std::complex< double > *out) |
template<> | |
void | matsym< std::complex< double > > (std::complex< double > *inout, const int n, const Parallel_2D &pmat) |
void | setup_2d_division (Parallel_2D &pv, int nb, int gr, int gc) |
=================2D-block Parallel=============== | |
void | setup_2d_division (Parallel_2D &pv, int nb, int gr, int gc, const int &blacs_ctxt_in) |
void | diag_lapack (const int &n, double *mat, double *eig) |
diagonalize a hermitian matrix | |
void | diag_lapack (const int &n, std::complex< double > *mat, double *eig) |
void | diag_lapack_nh (const int &n, double *mat, std::complex< double > *eig) |
diagonalize a general matrix | |
void | diag_lapack_nh (const int &n, std::complex< double > *mat, std::complex< double > *eig) |
std::string | tolower (const std::string &str) |
=================string option==================== | |
std::string | toupper (const std::string &str) |
template<typename TCell > | |
int | cal_nelec (const TCell &ucell) |
=====================PHYSICS==================== | |
template<typename T > | |
void | _deallocate_2order_nested_ptr (T **p2, size_t size) |
=================ALGORITHM==================== | |
template<typename T > | |
void | _allocate_2order_nested_ptr (T **&p2, size_t size1, size_t size2) |
new 2d pointer | |
template<typename T > | |
ct::Tensor | newTensor (const ct::TensorShape &shape) |
template<typename T > | |
void | matsym (const T *in, const int n, T *out) |
template<typename T > | |
void | matsym (T *inout, const int n) |
calculate (A+A^T)/2 (in-place version) | |
template<typename T > | |
void | matsym (const T *in, const int n, const Parallel_2D &pmat, T *out) |
template<typename T > | |
void | matsym (T *inout, const int n, const Parallel_2D &pmat) |
template<typename T , typename Device > | |
psi::Psi< T, Device > | k1_to_bfirst_wrapper (const psi::Psi< T, Device > &psi_kfirst, int nk_in, int nbasis_in) |
psi(nk=1, nbands=nb, nk * nbasis) -> psi(nb, nk, nbasis) without memory copy | |
template<typename T , typename Device > | |
psi::Psi< T, Device > | bfirst_to_k1_wrapper (const psi::Psi< T, Device > &psi_bfirst) |
psi(nb, nk, nbasis) -> psi(nk=1, nbands=nb, nk * nbasis) without memory copy | |
template<typename T > | |
void | gather_2d_to_full (const Parallel_2D &pv, const T *submat, T *fullmat, bool col_first, int global_nrow, int global_ncol) |
gather 2d matrix to full matrix the defination of row and col is consistent with setup_2d_division | |
template<typename T , typename... Args> | |
std::unique_ptr< T > | make_unique (Args &&... args) |
double | get_conj (const double &x) |
std::complex< double > | get_conj (const std::complex< double > &x) |
template<typename T > | |
psi::Psi< T > | get_psi_spin (const psi::Psi< T > &psi_in, const int &is, const int &nk) |
get the Psi wrapper of the selected spin from the Psi object | |
void | get_DMR_real_imag_part (const elecstate::DensityMatrix< std::complex< double >, std::complex< double > > &DMR, elecstate::DensityMatrix< std::complex< double >, double > &DMR_real, const int &nat, const char &type) |
void | set_HR_real_imag_part (const hamilt::HContainer< double > &HR_real, hamilt::HContainer< std::complex< double > > &HR, const int &nat, const char &type) |
template<typename TR > | |
void | print_HR (const hamilt::HContainer< TR > &HR, const int &nat, const std::string &label, const double &threshold=1e-10) |
template<typename TK , typename TR > | |
void | print_DMR (const elecstate::DensityMatrix< TK, TR > &DMR, const int &nat, const std::string &label, const double &threshold=1e-10) |
template<typename T , typename TR > | |
void | initialize_HR (hamilt::HContainer< TR > &hR, const UnitCell &ucell, const Grid_Driver &gd, const std::vector< double > &orb_cutoff) |
template<typename T , typename TR > | |
void | initialize_DMR (elecstate::DensityMatrix< T, TR > &dm, const Parallel_Orbitals &pmat, const UnitCell &ucell, const Grid_Driver &gd, const std::vector< double > &orb_cutoff) |
template<typename TR1 , typename TR2 > | |
TR1 | dot_R_matrix (const hamilt::HContainer< TR1 > &h1, const hamilt::HContainer< TR2 > &h2, const int &nat) |
$\sum_{uvR} H1_{uv}(R) H2_{uv}(R)$ | |
template<typename T > | |
constexpr T | filter (const T &v, const double &threshold=1e-10) |
template<typename T > | |
int | read_value (std::ifstream &ifs, T *ptr, const int &size) |
template<typename T , typename... Args> | |
int | read_value (std::ifstream &ifs, T *ptr, const int &size, Args &&... args) |
template<typename T , typename... Args> | |
int | read_value (const std::string &file, T *ptr, const int &size, Args &&... args) |
template<typename T > | |
int | write_value (std::ofstream &ofs, const T *ptr, const int &size) |
template<typename T , typename... Args> | |
int | write_value (std::ofstream &ofs, const T *ptr, const int &size, Args &&... args) |
template<typename T , typename... Args> | |
int | write_value (const std::string &file, const int &prec, const T *ptr, const int &size, Args &&... args) |
template<typename T > | |
int | print_value (const T *ptr, const int &size) |
template<typename T , typename... Args> | |
int | print_value (const T *ptr, const int &size, Args &&... args) |
template<typename T > | |
void | print_psi_bandfirst (const psi::Psi< T > &psi, const std::string &label, const int &ib, const double &threshold=1e-10) |
template<typename T > | |
void | write_psi_bandfirst (const psi::Psi< T > &psi, const std::string &filename, const int &rank, const double &threshold=1e-10, const int &precision=8) |
template<typename T > | |
void | write_psi_bandfirst (const T *psi, const int &nband, const int &nk, const int &nbasis, const std::string &filename, const int &rank, const double &threshold=1e-10, const int &precision=8) |
template<typename T > | |
psi::Psi< T > | read_psi_bandfirst (const std::string &filename, const int &rank) |
template<typename T > | |
void | print_psi_kfirst (const psi::Psi< T > &psi, const std::string &label, const double &threshold=1e-10) |
template<typename T > | |
void | print_tensor (const container::Tensor &t, const std::string &label, const Parallel_2D *pmat, const double &threshold=1e-10) |
template<typename T > | |
void | print_grid_nonzero (T *rho, const int &nrxx, const int &nnz, const std::string &label, const double &threshold=1e-5) |
template<typename T > | |
void | print_CsX (const TLRIX< T > &CsX, const int nvirt, const std::string &label, const double &threshold=1e-10) |
template<typename T > | |
void | grad (const T *rhor, ModuleBase::Vector3< T > *gradrho, const ModulePW::PW_Basis &rho_basis, const double &tpiba) |
template<typename T > | |
void | grad (const std::vector< T > &rhor, std::vector< ModuleBase::Vector3< T > > &gradrho, const ModulePW::PW_Basis &rho_basis, const double &tpiba) |
template<typename T > | |
void | lapl (const T *rhor, T *lapn, const ModulePW::PW_Basis &rho_basis, const double &tpiba2) |
template<typename T > | |
void | lapl (const std::vector< T > &rhor, std::vector< T > &lapn, const ModulePW::PW_Basis &rho_basis, const double &tpiba2) |
using LR_Util::TAC = typedef std::pair<int, TC> |
using LR_Util::TC = typedef std::array<int, 3> |
using LR_Util::TLRIX = typedef std::map<int, std::map<TAC, std::vector<T> >> |
void LR_Util::_allocate_2order_nested_ptr | ( | T **& | p2, |
size_t | size1, | ||
size_t | size2 | ||
) |
new 2d pointer
new 2d pointer
T |
size1 | |
size2 |
=================ALGORITHM====================
delete 2d pointer
delete 2d pointer
T |
p2 | |
size |
psi::Psi< T, Device > LR_Util::bfirst_to_k1_wrapper | ( | const psi::Psi< T, Device > & | psi_bfirst | ) |
psi(nb, nk, nbasis) -> psi(nk=1, nbands=nb, nk * nbasis) without memory copy
int LR_Util::cal_nelec | ( | const TCell & | ucell | ) |
=====================PHYSICS====================
=================PHYSICS====================
calculate the number of electrons
TCell |
ucell |
int LR_Util::cal_nocc | ( | int | nelec | ) |
=================PHYSICS====================
calculate the number of occupied orbitals
nelec |
void LR_Util::diag_lapack | ( | const int & | n, |
double * | mat, | ||
double * | eig | ||
) |
diagonalize a hermitian matrix
=================diago-lapack====================
void LR_Util::diag_lapack | ( | const int & | n, |
std::complex< double > * | mat, | ||
double * | eig | ||
) |
void LR_Util::diag_lapack_nh | ( | const int & | n, |
double * | mat, | ||
std::complex< double > * | eig | ||
) |
diagonalize a general matrix
void LR_Util::diag_lapack_nh | ( | const int & | n, |
std::complex< double > * | mat, | ||
std::complex< double > * | eig | ||
) |
TR1 LR_Util::dot_R_matrix | ( | const hamilt::HContainer< TR1 > & | h1, |
const hamilt::HContainer< TR2 > & | h2, | ||
const int & | nat | ||
) |
$\sum_{uvR} H1_{uv}(R) H2_{uv}(R)$
|
constexpr |
void LR_Util::gather_2d_to_full | ( | const Parallel_2D & | pv, |
const T * | submat, | ||
T * | fullmat, | ||
bool | col_first, | ||
int | global_nrow, | ||
int | global_ncol | ||
) |
gather 2d matrix to full matrix the defination of row and col is consistent with setup_2d_division
|
inline |
|
inline |
void LR_Util::get_DMR_real_imag_part | ( | const elecstate::DensityMatrix< std::complex< double >, std::complex< double > > & | DMR, |
elecstate::DensityMatrix< std::complex< double >, double > & | DMR_real, | ||
const int & | nat, | ||
const char & | type | ||
) |
psi::Psi< T > LR_Util::get_psi_spin | ( | const psi::Psi< T > & | psi_in, |
const int & | is, | ||
const int & | nk | ||
) |
get the Psi wrapper of the selected spin from the Psi object
void LR_Util::grad | ( | const std::vector< T > & | rhor, |
std::vector< ModuleBase::Vector3< T > > & | gradrho, | ||
const ModulePW::PW_Basis & | rho_basis, | ||
const double & | tpiba | ||
) |
void LR_Util::grad | ( | const T * | rhor, |
ModuleBase::Vector3< T > * | gradrho, | ||
const ModulePW::PW_Basis & | rho_basis, | ||
const double & | tpiba | ||
) |
void LR_Util::initialize_DMR | ( | elecstate::DensityMatrix< T, TR > & | dm, |
const Parallel_Orbitals & | pmat, | ||
const UnitCell & | ucell, | ||
const Grid_Driver & | gd, | ||
const std::vector< double > & | orb_cutoff | ||
) |
void LR_Util::initialize_HR | ( | hamilt::HContainer< TR > & | hR, |
const UnitCell & | ucell, | ||
const Grid_Driver & | gd, | ||
const std::vector< double > & | orb_cutoff | ||
) |
psi::Psi< T, Device > LR_Util::k1_to_bfirst_wrapper | ( | const psi::Psi< T, Device > & | psi_kfirst, |
int | nk_in, | ||
int | nbasis_in | ||
) |
psi(nk=1, nbands=nb, nk * nbasis) -> psi(nb, nk, nbasis) without memory copy
===================Psi wrapper================= psi(nk=1, nbands=nb, nk * nbasis) -> psi(nb, nk, nbasis) without memory copy
void LR_Util::lapl | ( | const std::vector< T > & | rhor, |
std::vector< T > & | lapn, | ||
const ModulePW::PW_Basis & | rho_basis, | ||
const double & | tpiba2 | ||
) |
void LR_Util::lapl | ( | const T * | rhor, |
T * | lapn, | ||
const ModulePW::PW_Basis & | rho_basis, | ||
const double & | tpiba2 | ||
) |
std::unique_ptr< T > LR_Util::make_unique | ( | Args &&... | args | ) |
=================ALGORITHM==================== for lack of make_unique in c++11
void LR_Util::matsym | ( | const T * | in, |
const int | n, | ||
const Parallel_2D & | pmat, | ||
T * | out | ||
) |
================ BLAS ====================== calculate (A+A^T)/2
calculate (A+A^T)/2 (in-place version)
void LR_Util::matsym | ( | T * | inout, |
const int | n, | ||
const Parallel_2D & | pmat | ||
) |
void LR_Util::matsym< double > | ( | const double * | in, |
const int | n, | ||
const Parallel_2D & | pmat, | ||
double * | out | ||
) |
=================ALGORITHM====================
void LR_Util::matsym< double > | ( | double * | inout, |
const int | n, | ||
const Parallel_2D & | pmat | ||
) |
void LR_Util::matsym< std::complex< double > > | ( | const std::complex< double > * | in, |
const int | n, | ||
const Parallel_2D & | pmat, | ||
std::complex< double > * | out | ||
) |
void LR_Util::matsym< std::complex< double > > | ( | std::complex< double > * | inout, |
const int | n, | ||
const Parallel_2D & | pmat | ||
) |
ct::Tensor LR_Util::newTensor | ( | const ct::TensorShape & | shape | ) |
void LR_Util::print_CsX | ( | const TLRIX< T > & | CsX, |
const int | nvirt, | ||
const std::string & | label, | ||
const double & | threshold = 1e-10 |
||
) |
void LR_Util::print_DMR | ( | const elecstate::DensityMatrix< TK, TR > & | DMR, |
const int & | nat, | ||
const std::string & | label, | ||
const double & | threshold = 1e-10 |
||
) |
void LR_Util::print_grid_nonzero | ( | T * | rho, |
const int & | nrxx, | ||
const int & | nnz, | ||
const std::string & | label, | ||
const double & | threshold = 1e-5 |
||
) |
void LR_Util::print_HR | ( | const hamilt::HContainer< TR > & | HR, |
const int & | nat, | ||
const std::string & | label, | ||
const double & | threshold = 1e-10 |
||
) |
void LR_Util::print_psi_bandfirst | ( | const psi::Psi< T > & | psi, |
const std::string & | label, | ||
const int & | ib, | ||
const double & | threshold = 1e-10 |
||
) |
void LR_Util::print_psi_kfirst | ( | const psi::Psi< T > & | psi, |
const std::string & | label, | ||
const double & | threshold = 1e-10 |
||
) |
void LR_Util::print_tensor | ( | const container::Tensor & | t, |
const std::string & | label, | ||
const Parallel_2D * | pmat, | ||
const double & | threshold = 1e-10 |
||
) |
int LR_Util::print_value | ( | const T * | ptr, |
const int & | size, | ||
Args &&... | args | ||
) |
psi::Psi< T > LR_Util::read_psi_bandfirst | ( | const std::string & | filename, |
const int & | rank | ||
) |
int LR_Util::read_value | ( | const std::string & | file, |
T * | ptr, | ||
const int & | size, | ||
Args &&... | args | ||
) |
int LR_Util::read_value | ( | std::ifstream & | ifs, |
T * | ptr, | ||
const int & | size, | ||
Args &&... | args | ||
) |
void LR_Util::set_HR_real_imag_part | ( | const hamilt::HContainer< double > & | HR_real, |
hamilt::HContainer< std::complex< double > > & | HR, | ||
const int & | nat, | ||
const char & | type | ||
) |
std::pair< ModuleBase::matrix, std::vector< std::pair< int, int > > > LR_Util::set_ix_map_diagonal | ( | bool | mode, |
int | nc, | ||
int | nv | ||
) |
set the index map: ix to (ic, iv) and vice versa by diagonal traverse the c-v pairs leftdown -> rightup for mode 0, rightup -> leftdown for mode 1
mode | 0: homo-1 -> lumo first; 1: homo -> lumo+1 first |
nc | number of occupied bands |
nv | number of virtual bands |
void LR_Util::setup_2d_division | ( | Parallel_2D & | pv, |
int | nb, | ||
int | gr, | ||
int | gc | ||
) |
=================2D-block Parallel===============
void LR_Util::setup_2d_division | ( | Parallel_2D & | pv, |
int | nb, | ||
int | gr, | ||
int | gc, | ||
const int & | blacs_ctxt_in | ||
) |
std::string LR_Util::tolower | ( | const std::string & | str | ) |
=================string option====================
std::string LR_Util::toupper | ( | const std::string & | str | ) |
void LR_Util::write_psi_bandfirst | ( | const psi::Psi< T > & | psi, |
const std::string & | filename, | ||
const int & | rank, | ||
const double & | threshold = 1e-10 , |
||
const int & | precision = 8 |
||
) |
void LR_Util::write_psi_bandfirst | ( | const T * | psi, |
const int & | nband, | ||
const int & | nk, | ||
const int & | nbasis, | ||
const std::string & | filename, | ||
const int & | rank, | ||
const double & | threshold = 1e-10 , |
||
const int & | precision = 8 |
||
) |
int LR_Util::write_value | ( | const std::string & | file, |
const int & | prec, | ||
const T * | ptr, | ||
const int & | size, | ||
Args &&... | args | ||
) |
int LR_Util::write_value | ( | std::ofstream & | ofs, |
const T * | ptr, | ||
const int & | size | ||
) |