diff --git a/source/module_hsolver/diago_david.h b/source/module_hsolver/diago_david.h index 16bc471e2cc..4673f5ca8d1 100644 --- a/source/module_hsolver/diago_david.h +++ b/source/module_hsolver/diago_david.h @@ -30,8 +30,6 @@ class DiagoDavid : public DiagH // declare type of matrix-blockvector functions. // the function type is defined as a std::function object. - // notice that hpsi and spsi functions require - // !different! order of input and output blockvectors. /** * @brief A function type representing the HX function. * @@ -39,12 +37,12 @@ class DiagoDavid : public DiagH * For eigenvalue problem HX = λX or generalized eigenvalue problem HX = λSX, * this function computes the product of the Hamiltonian matrix H and a blockvector X. * - * @param[out] X Pointer to input blockvector of type `T*`. - * @param[in] HX Pointer to output blockvector of type `T*`. - * @param[in] neig Number of eigebpairs required. - * @param[in] dim Dimension of matrix. - * @param[in] id_start Start index of blockvector. - * @param[in] id_end End index of blockvector. + * @param[out] X Pointer to input blockvector of type `T*`. + * @param[in] HX Pointer to output blockvector of type `T*`. + * @param[in] nvec Number of eigebpairs, i.e. number of vectors in a block. + * @param[in] dim Dimension of matrix. + * @param[in] id_start Start index of blockvector. + * @param[in] id_end End index of blockvector. */ using HPsiFunc = std::function; @@ -60,6 +58,8 @@ class DiagoDavid : public DiagH * @param[in] nrow Dimension of SX: nbands * nrow. * @param[in] npw Number of plane waves. * @param[in] nbands Number of bands. + * + * @note called as spsi(in, out, dim, dim, 1) */ using SPsiFunc = std::function; diff --git a/source/module_hsolver/hsolver_pw.cpp b/source/module_hsolver/hsolver_pw.cpp index d20718b7f33..7b8e5fc0a65 100644 --- a/source/module_hsolver/hsolver_pw.cpp +++ b/source/module_hsolver/hsolver_pw.cpp @@ -323,7 +323,7 @@ void HSolverPW::hamiltSolvePsiK(hamilt::Hamilt* hm, if (this->method == "cg") { - // warp the subspace_func into a lambda function + // wrap the subspace_func into a lambda function auto ngk_pointer = psi.get_ngk_pointer(); auto subspace_func = [hm, ngk_pointer](const ct::Tensor& psi_in, ct::Tensor& psi_out) { // psi_in should be a 2D tensor: @@ -355,10 +355,10 @@ void HSolverPW::hamiltSolvePsiK(hamilt::Hamilt* hm, this->diag_iter_max, this->nproc_in_pool); - // warp the hpsi_func and spsi_func into a lambda function + // wrap the hpsi_func and spsi_func into a lambda function using ct_Device = typename ct::PsiToContainer::type; - // warp the hpsi_func and spsi_func into a lambda function + // wrap the hpsi_func and spsi_func into a lambda function auto hpsi_func = [hm, ngk_pointer](const ct::Tensor& psi_in, ct::Tensor& hpsi_out) { ModuleBase::timer::tick("DiagoCG_New", "hpsi_func"); // psi_in should be a 2D tensor: