ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
Classes | Functions
hsolver Namespace Reference

Classes

struct  apply_eigenvalues_op
 
struct  apply_eigenvalues_op< T, base_device::DEVICE_CPU >
 
struct  calc_grad_with_block_op
 
struct  calc_grad_with_block_op< T, base_device::DEVICE_CPU >
 
struct  diag_comm_info
 
class  Diago_DavSubspace
 
class  DiagoBPCG
 A class for diagonalization using the Blocked-PCG method. More...
 
class  DiagoCG
 
class  DiagoCusolver
 
class  DiagoDavid
 A class that implements the block-Davidson algorithm for solving generalized eigenvalue problems. More...
 
class  DiagoElpa
 
class  DiagoElpaNative
 
class  DiagoIterAssist
 
class  DiagoLapack
 
class  DiagoPexsi
 
class  DiagoScalapack
 
struct  dnevx_op
 
struct  dnevx_op< T, base_device::DEVICE_CPU >
 
struct  dngv_op
 
struct  dngv_op< T, base_device::DEVICE_CPU >
 
struct  dngvd_op
 
struct  dngvd_op< T, base_device::DEVICE_CPU >
 
struct  dngvx_op
 
struct  dngvx_op< T, base_device::DEVICE_CPU >
 
class  HSolverLCAO
 
class  HSolverLIP
 
class  HSolverPW
 
class  HSolverPW_SDFT
 
struct  line_minimize_with_block_op
 
struct  line_minimize_with_block_op< T, base_device::DEVICE_CPU >
 
struct  Matrix_g
 
struct  normalize_op
 
struct  normalize_op< T, base_device::DEVICE_CPU >
 
class  PLinearTransform
 B = alpha * A * U + beta * B A and B are local matrice U can be a local matrix or a global matrix. More...
 
struct  precondition_op
 
struct  precondition_op< T, base_device::DEVICE_CPU >
 

Functions

template<typename T >
void diago_hs_para (T *h, T *s, const int lda, const int nband, typename GetTypeReal< T >::type *const ekb, T *const wfc, const MPI_Comm &comm, const int diag_subspace, const int block_size=0)
 Parallel do the generalized eigenvalue problem.
 
template void diago_hs_para< double > (double *h, double *s, const int lda, const int nband, typename GetTypeReal< double >::type *const ekb, double *const wfc, const MPI_Comm &comm, const int diag_subspace, const int block_size)
 
template void diago_hs_para< std::complex< double > > (std::complex< double > *h, std::complex< double > *s, const int lda, const int nband, typename GetTypeReal< std::complex< double > >::type *const ekb, std::complex< double > *const wfc, const MPI_Comm &comm, const int diag_subspace, const int block_size)
 
template void diago_hs_para< float > (float *h, float *s, const int lda, const int nband, typename GetTypeReal< float >::type *const ekb, float *const wfc, const MPI_Comm &comm, const int diag_subspace, const int block_size)
 
template void diago_hs_para< std::complex< float > > (std::complex< float > *h, std::complex< float > *s, const int lda, const int nband, typename GetTypeReal< std::complex< float > >::type *const ekb, std::complex< float > *const wfc, const MPI_Comm &comm, const int diag_subspace, const int block_size)
 
void pxxxgvx_ (const int *itype, const char *jobz, const char *range, const char *uplo, const int *n, double *A, const int *ia, const int *ja, const int *desca, double *B, const int *ib, const int *jb, const int *descb, const double *vl, const double *vu, const int *il, const int *iu, const double *abstol, int *m, int *nz, double *w, const double *orfac, double *Z, const int *iz, const int *jz, const int *descz, double *work, int *lwork, double *rwork, int *lrwork, int *iwork, int *liwork, int *ifail, int *iclustr, double *gap, int *info)
 Wrapper function for Scalapack's generalized eigensolver routines.
 
void pxxxgvx_ (const int *itype, const char *jobz, const char *range, const char *uplo, const int *n, std::complex< double > *A, const int *ia, const int *ja, const int *desca, std::complex< double > *B, const int *ib, const int *jb, const int *descb, const double *vl, const double *vu, const int *il, const int *iu, const double *abstol, int *m, int *nz, double *w, const double *orfac, std::complex< double > *Z, const int *iz, const int *jz, const int *descz, std::complex< double > *work, int *lwork, double *rwork, int *lrwork, int *iwork, int *liwork, int *ifail, int *iclustr, double *gap, int *info)
 
void pxxxgvx_ (const int *itype, const char *jobz, const char *range, const char *uplo, const int *n, float *A, const int *ia, const int *ja, const int *desca, float *B, const int *ib, const int *jb, const int *descb, const float *vl, const float *vu, const int *il, const int *iu, const float *abstol, int *m, int *nz, float *w, const float *orfac, float *Z, const int *iz, const int *jz, const int *descz, float *work, int *lwork, float *rwork, int *lrwork, int *iwork, int *liwork, int *ifail, int *iclustr, float *gap, int *info)
 
void pxxxgvx_ (const int *itype, const char *jobz, const char *range, const char *uplo, const int *n, std::complex< float > *A, const int *ia, const int *ja, const int *desca, std::complex< float > *B, const int *ib, const int *jb, const int *descb, const float *vl, const float *vu, const int *il, const int *iu, const float *abstol, int *m, int *nz, float *w, const float *orfac, std::complex< float > *Z, const int *iz, const int *jz, const int *descz, std::complex< float > *work, int *lwork, float *rwork, int *lrwork, int *iwork, int *liwork, int *ifail, int *iclustr, float *gap, int *info)
 
void pxxxgvx_post_processing (const int info, const std::vector< int > &ifail, const std::vector< int > &iclustr, const int M, const int NZ, const int nbands, int &degeneracy_max)
 
void get_lwork (int &lwork, std::vector< double > &work)
 
void get_lwork (int &lwork, std::vector< float > &work)
 
void get_lwork (int &lwork, std::vector< std::complex< double > > &work)
 
void get_lwork (int &lwork, std::vector< std::complex< float > > &work)
 
template<typename T >
void pxxxgvx_diag (const int *const desc, const int ncol, const int nrow, const int nbands, const T *const h_mat, const T *const s_mat, typename GetTypeReal< T >::type *const ekb, T *const wfc_2d)
 Wrapper function for Scalapack's generalized eigensolver routines: pdsygvx_, pzhegvx_, pssygvx_, pchegvx_.
 
template void pxxxgvx_diag (const int *const desc, const int ncol, const int nrow, const int nbands, const double *const h_mat, const double *const s_mat, double *const ekb, double *const wfc_2d)
 
template void pxxxgvx_diag (const int *const desc, const int ncol, const int nrow, const int nbands, const std::complex< double > *const h_mat, const std::complex< double > *const s_mat, double *const ekb, std::complex< double > *const wfc_2d)
 
template void pxxxgvx_diag (const int *const desc, const int ncol, const int nrow, const int nbands, const float *const h_mat, const float *const s_mat, float *const ekb, float *const wfc_2d)
 
template void pxxxgvx_diag (const int *const desc, const int ncol, const int nrow, const int nbands, const std::complex< float > *const h_mat, const std::complex< float > *const s_mat, float *const ekb, std::complex< float > *const wfc_2d)
 
double set_diagethr_ks (const std::string basis_type, const std::string esolver_type, const std::string calculation_in, const std::string init_chg_in, const std::string precision_flag_in, const int istep, const int iter, const double drho, const double pw_diag_thr_init, const double diag_ethr_in, const double nelec_in)
 
double set_diagethr_sdft (const std::string basis_type, const std::string esolver_type, const std::string calculation_in, const std::string init_chg_in, const int istep, const int iter, const double drho, const double pw_diag_thr_init, const double diag_ethr_in, const int nband_in, const double stoiter_ks_ne_in)
 
double reset_diag_ethr (std::ofstream &ofs_running, const std::string basis_type, const std::string esolver_type, const std::string precision_flag_in, const double hsover_error, const double drho_in, const double diag_ethr_in, const double nelec_in)
 
double cal_hsolve_error (const std::string basis_type, const std::string esolver_type, const double diag_ethr_in, const double nelec_in)
 
double get_real (const std::complex< double > &x)
 
float get_real (const std::complex< float > &x)
 
double get_real (const double &x)
 
float get_real (const float &x)
 

Detailed Description

Tested function:

Function Documentation

◆ cal_hsolve_error()

double hsolver::cal_hsolve_error ( const std::string  basis_type,
const std::string  esolver_type,
const double  diag_ethr_in,
const double  nelec_in 
)
Here is the caller graph for this function:

◆ diago_hs_para()

template<typename T >
void hsolver::diago_hs_para ( T h,
T s,
const int  lda,
const int  nband,
typename GetTypeReal< T >::type *const  ekb,
T *const  wfc,
const MPI_Comm &  comm,
const int  diag_subspace,
const int  block_size = 0 
)

Parallel do the generalized eigenvalue problem.

Template Parameters
Tdouble or std::complex<double> or float or complex<float>
Parameters
Hthe hermitian matrix H.
Sthe overlap matrix S.
ldathe leading dimension of H and S
nbandthe number of bands to be calculated
ekbto store the eigenvalues.
wfcto store the eigenvectors
commthe communicator
diag_subspacethe method to solve the generalized eigenvalue problem
block_sizethe block size in 2d block cyclic distribution if use elpa or scalapack.
Note
1. h and s should be full matrix in rank 0 of the communicator, and the other ranks is not concerned.
2. wfc is complete in rank 0, and not store in other ranks.
3. diag_subspace should be 1: by elpa, 2: by scalapack
4. block_size should be 0 or a positive integer. If it is 0, then will use a value as large as possible that is allowed
Here is the call graph for this function:
Here is the caller graph for this function:

◆ diago_hs_para< double >()

template void hsolver::diago_hs_para< double > ( double *  h,
double *  s,
const int  lda,
const int  nband,
typename GetTypeReal< double >::type *const  ekb,
double *const  wfc,
const MPI_Comm &  comm,
const int  diag_subspace,
const int  block_size 
)

◆ diago_hs_para< float >()

template void hsolver::diago_hs_para< float > ( float *  h,
float *  s,
const int  lda,
const int  nband,
typename GetTypeReal< float >::type *const  ekb,
float *const  wfc,
const MPI_Comm &  comm,
const int  diag_subspace,
const int  block_size 
)

◆ diago_hs_para< std::complex< double > >()

template void hsolver::diago_hs_para< std::complex< double > > ( std::complex< double > *  h,
std::complex< double > *  s,
const int  lda,
const int  nband,
typename GetTypeReal< std::complex< double > >::type *const  ekb,
std::complex< double > *const  wfc,
const MPI_Comm &  comm,
const int  diag_subspace,
const int  block_size 
)

◆ diago_hs_para< std::complex< float > >()

template void hsolver::diago_hs_para< std::complex< float > > ( std::complex< float > *  h,
std::complex< float > *  s,
const int  lda,
const int  nband,
typename GetTypeReal< std::complex< float > >::type *const  ekb,
std::complex< float > *const  wfc,
const MPI_Comm &  comm,
const int  diag_subspace,
const int  block_size 
)

◆ get_lwork() [1/4]

void hsolver::get_lwork ( int &  lwork,
std::vector< double > &  work 
)
Here is the caller graph for this function:

◆ get_lwork() [2/4]

void hsolver::get_lwork ( int &  lwork,
std::vector< float > &  work 
)

◆ get_lwork() [3/4]

void hsolver::get_lwork ( int &  lwork,
std::vector< std::complex< double > > &  work 
)

◆ get_lwork() [4/4]

void hsolver::get_lwork ( int &  lwork,
std::vector< std::complex< float > > &  work 
)

◆ get_real() [1/4]

double hsolver::get_real ( const double &  x)
inline

◆ get_real() [2/4]

float hsolver::get_real ( const float &  x)
inline

◆ get_real() [3/4]

double hsolver::get_real ( const std::complex< double > &  x)
inline
Here is the caller graph for this function:

◆ get_real() [4/4]

float hsolver::get_real ( const std::complex< float > &  x)
inline

◆ pxxxgvx_() [1/4]

void hsolver::pxxxgvx_ ( const int *  itype,
const char *  jobz,
const char *  range,
const char *  uplo,
const int *  n,
double *  A,
const int *  ia,
const int *  ja,
const int *  desca,
double *  B,
const int *  ib,
const int *  jb,
const int *  descb,
const double *  vl,
const double *  vu,
const int *  il,
const int *  iu,
const double *  abstol,
int *  m,
int *  nz,
double *  w,
const double *  orfac,
double *  Z,
const int *  iz,
const int *  jz,
const int *  descz,
double *  work,
int *  lwork,
double *  rwork,
int *  lrwork,
int *  iwork,
int *  liwork,
int *  ifail,
int *  iclustr,
double *  gap,
int *  info 
)

Wrapper function for Scalapack's generalized eigensolver routines.

Parameters
itypeSpecifies the problem type to be solved.
jobzSpecifies whether to compute eigenvectors.
rangeSpecifies the range of eigenvalues to be found.
uploSpecifies whether the upper or lower triangular part of the matrices is referenced.
nThe order of the matrices A and B.
AThe array containing the matrix A.
iaThe row index in the global array A.
jaThe column index in the global array A.
descaThe array descriptor for the distributed matrix A.
BThe array containing the matrix B.
ibThe row index in the global array B.
jbThe column index in the global array B.
descbThe array descriptor for the distributed matrix B.
vlLower bound of the interval to be searched for eigenvalues.
vuUpper bound of the interval to be searched for eigenvalues.
ilIndex of the smallest eigenvalue to be returned.
iuIndex of the largest eigenvalue to be returned.
abstolThe absolute error tolerance for the eigenvalues.
mThe total number of eigenvalues found.
nzThe total number of eigenvalues found in the interval (vl, vu].
wThe array to store the eigenvalues.
orfacThe orthogonality factor.
ZThe array to store the eigenvectors.
izThe row index in the global array Z.
jzThe column index in the global array Z.
desczThe array descriptor for the distributed matrix Z.
workWorkspace array.
lworkThe dimension of the array work.
rworkWorkspace array (not used in this function).
lrworkThe dimension of the array rwork (not used in this function).
iworkWorkspace array.
liworkThe dimension of the array iwork.
ifailThe array to store the indices of the eigenvectors that failed to converge.
iclustrThe array to store the indices of the eigenvalue clusters.
gapThe array to store the gaps between eigenvalue clusters.
infoOutput status of the computation.
Note
for a uniform interface, rwork and lrwork are input arguments, but not used in pdsygvx_/pssygvx_
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pxxxgvx_() [2/4]

void hsolver::pxxxgvx_ ( const int *  itype,
const char *  jobz,
const char *  range,
const char *  uplo,
const int *  n,
float *  A,
const int *  ia,
const int *  ja,
const int *  desca,
float *  B,
const int *  ib,
const int *  jb,
const int *  descb,
const float *  vl,
const float *  vu,
const int *  il,
const int *  iu,
const float *  abstol,
int *  m,
int *  nz,
float *  w,
const float *  orfac,
float *  Z,
const int *  iz,
const int *  jz,
const int *  descz,
float *  work,
int *  lwork,
float *  rwork,
int *  lrwork,
int *  iwork,
int *  liwork,
int *  ifail,
int *  iclustr,
float *  gap,
int *  info 
)
Here is the call graph for this function:

◆ pxxxgvx_() [3/4]

void hsolver::pxxxgvx_ ( const int *  itype,
const char *  jobz,
const char *  range,
const char *  uplo,
const int *  n,
std::complex< double > *  A,
const int *  ia,
const int *  ja,
const int *  desca,
std::complex< double > *  B,
const int *  ib,
const int *  jb,
const int *  descb,
const double *  vl,
const double *  vu,
const int *  il,
const int *  iu,
const double *  abstol,
int *  m,
int *  nz,
double *  w,
const double *  orfac,
std::complex< double > *  Z,
const int *  iz,
const int *  jz,
const int *  descz,
std::complex< double > *  work,
int *  lwork,
double *  rwork,
int *  lrwork,
int *  iwork,
int *  liwork,
int *  ifail,
int *  iclustr,
double *  gap,
int *  info 
)
Here is the call graph for this function:

◆ pxxxgvx_() [4/4]

void hsolver::pxxxgvx_ ( const int *  itype,
const char *  jobz,
const char *  range,
const char *  uplo,
const int *  n,
std::complex< float > *  A,
const int *  ia,
const int *  ja,
const int *  desca,
std::complex< float > *  B,
const int *  ib,
const int *  jb,
const int *  descb,
const float *  vl,
const float *  vu,
const int *  il,
const int *  iu,
const float *  abstol,
int *  m,
int *  nz,
float *  w,
const float *  orfac,
std::complex< float > *  Z,
const int *  iz,
const int *  jz,
const int *  descz,
std::complex< float > *  work,
int *  lwork,
float *  rwork,
int *  lrwork,
int *  iwork,
int *  liwork,
int *  ifail,
int *  iclustr,
float *  gap,
int *  info 
)
Here is the call graph for this function:

◆ pxxxgvx_diag() [1/5]

template void hsolver::pxxxgvx_diag ( const int *const  desc,
const int  ncol,
const int  nrow,
const int  nbands,
const double *const  h_mat,
const double *const  s_mat,
double *const  ekb,
double *const  wfc_2d 
)

◆ pxxxgvx_diag() [2/5]

template void hsolver::pxxxgvx_diag ( const int *const  desc,
const int  ncol,
const int  nrow,
const int  nbands,
const float *const  h_mat,
const float *const  s_mat,
float *const  ekb,
float *const  wfc_2d 
)

◆ pxxxgvx_diag() [3/5]

template void hsolver::pxxxgvx_diag ( const int *const  desc,
const int  ncol,
const int  nrow,
const int  nbands,
const std::complex< double > *const  h_mat,
const std::complex< double > *const  s_mat,
double *const  ekb,
std::complex< double > *const  wfc_2d 
)

◆ pxxxgvx_diag() [4/5]

template void hsolver::pxxxgvx_diag ( const int *const  desc,
const int  ncol,
const int  nrow,
const int  nbands,
const std::complex< float > *const  h_mat,
const std::complex< float > *const  s_mat,
float *const  ekb,
std::complex< float > *const  wfc_2d 
)

◆ pxxxgvx_diag() [5/5]

template<typename T >
void hsolver::pxxxgvx_diag ( const int *const  desc,
const int  ncol,
const int  nrow,
const int  nbands,
const T *const  h_mat,
const T *const  s_mat,
typename GetTypeReal< T >::type *const  ekb,
T *const  wfc_2d 
)

Wrapper function for Scalapack's generalized eigensolver routines: pdsygvx_, pzhegvx_, pssygvx_, pchegvx_.

Parameters
descthe descriptor of scalapack descriptor
ncolthe number of columns of the H/S matrix in current processor
nrowthe number of rows of the H/S matrix in current processor
nbandsthe number of bands to be solved
h_matthe Hamiltonian matrix
s_matthe overlap matrix
ekbthe eigenvalues
wfc_2dthe eigenvectors in 2D block cyclic distribution
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pxxxgvx_post_processing()

void hsolver::pxxxgvx_post_processing ( const int  info,
const std::vector< int > &  ifail,
const std::vector< int > &  iclustr,
const int  M,
const int  NZ,
const int  nbands,
int &  degeneracy_max 
)
Here is the caller graph for this function:

◆ reset_diag_ethr()

double hsolver::reset_diag_ethr ( std::ofstream &  ofs_running,
const std::string  basis_type,
const std::string  esolver_type,
const std::string  precision_flag_in,
const double  hsover_error,
const double  drho_in,
const double  diag_ethr_in,
const double  nelec_in 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_diagethr_ks()

double hsolver::set_diagethr_ks ( const std::string  basis_type,
const std::string  esolver_type,
const std::string  calculation_in,
const std::string  init_chg_in,
const std::string  precision_flag_in,
const int  istep,
const int  iter,
const double  drho,
const double  pw_diag_thr_init,
const double  diag_ethr_in,
const double  nelec_in 
)
Here is the caller graph for this function:

◆ set_diagethr_sdft()

double hsolver::set_diagethr_sdft ( const std::string  basis_type,
const std::string  esolver_type,
const std::string  calculation_in,
const std::string  init_chg_in,
const int  istep,
const int  iter,
const double  drho,
const double  pw_diag_thr_init,
const double  diag_ethr_in,
const int  nband_in,
const double  stoiter_ks_ne_in 
)
Here is the caller graph for this function: