diff --git a/cmake/FindMKL.cmake b/cmake/FindMKL.cmake index 27b46a26e8..5d8ccdcc9b 100644 --- a/cmake/FindMKL.cmake +++ b/cmake/FindMKL.cmake @@ -112,10 +112,7 @@ endif() endif() # MKL::MKL -# For compatibility with legacy libpaw_interface CMakeLists.txt -if(TARGET MKL::MKL AND NOT TARGET IntelMKL::MKL) - add_library(IntelMKL::MKL ALIAS MKL::MKL) -endif() + # In oneAPI 2022, MKL_SCALAPACK might not be linked properly if(NOT TARGET MKL::MKL_SCALAPACK) diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 071e47df17..9839f4c81e 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -53,7 +53,6 @@ For those who are interested in the source code, the following figure shows the | `-- module_pw Data structures and relevant methods for planewave involved calculations |-- source_cell The module for defining the unit cell and its operations, and reading pseudopotentials. | |-- module_neighbor The module for finding the neighbors of each atom in the unit cell. -| |-- module_paw The module for performing PAW calculations. | |-- module_symmetry The module for finding the symmetry operations of the unit cell. |-- source_estate The module for defining the electronic state and its operations. | |-- module_charge The module for calculating the charge density, charge mixing diff --git a/docs/advanced/pp_orb.md b/docs/advanced/pp_orb.md index 06a5f1292b..4cfe750096 100644 --- a/docs/advanced/pp_orb.md +++ b/docs/advanced/pp_orb.md @@ -127,7 +127,7 @@ Users can find pseudopotentials in the following links: - [Quantum ESPRESSO](https://www.quantum-espresso.org/pseudopotentials): the official website of Quantum ESPRESSO, where you can find a large number of pseudopotential files. - [Stantard Solid State Pseudopotential library](https://www.materialscloud.org/sssp): a library of **high-quality** pseudopotentials for solid-state calculations, with **a large number of tests on efficiency and precison**. - [PWmat](http://www.pwmat.com/potential-download): a website that provides a large number of pseudopotential files, various kinds of semi-core constructed pseudopotentials are included. **Several sets (with or without f-electrons/noncolinear core correction) of Lanthanide pseudopotentials are also available**. -- [THEOS](http://theossrv1.epfl.ch/Main/Pseudopotentials): PSlibrary 0.3.1, a library of pseudopotentials for DFT calculations, including ultrasoft, paw, norm-conserving both full-relativistic and scalar-relativistic pseudopotentials. +- [THEOS](http://theossrv1.epfl.ch/Main/Pseudopotentials): PSlibrary 0.3.1, a library of pseudopotentials for DFT calculations, including ultrasoft, norm-conserving both full-relativistic and scalar-relativistic pseudopotentials. - [ABACUS@USTC](https://abacus.ustc.edu.cn/pseudo/list.htm): **ABACUS official website** where you can find a large number of pseudopotential files and numerical atomic orbital files. - [BLPS](https://github.com/PrincetonUniversity/BLPSLibrary): BLPS format pseudopotential library diff --git a/python/pyabacus/src/ModuleESolver/components/diagonalizer_wrapper.hpp b/python/pyabacus/src/ModuleESolver/components/diagonalizer_wrapper.hpp index 7ed88294d3..4b22fcc53c 100644 --- a/python/pyabacus/src/ModuleESolver/components/diagonalizer_wrapper.hpp +++ b/python/pyabacus/src/ModuleESolver/components/diagonalizer_wrapper.hpp @@ -156,7 +156,6 @@ class DiagonalizerWrapper : public IDiagonalizer config_.tolerance, diag_ethr, config_.max_iterations, - config_.use_paw, comm_info ); diff --git a/python/pyabacus/src/ModuleESolver/interfaces/i_diagonalizer.hpp b/python/pyabacus/src/ModuleESolver/interfaces/i_diagonalizer.hpp index 6c5f968b39..3f626b06b3 100644 --- a/python/pyabacus/src/ModuleESolver/interfaces/i_diagonalizer.hpp +++ b/python/pyabacus/src/ModuleESolver/interfaces/i_diagonalizer.hpp @@ -58,7 +58,6 @@ struct DiagConfig double tolerance = 1e-6; ///< Convergence tolerance int max_iterations = 100; ///< Maximum iterations int dav_ndim = 4; ///< Davidson subspace dimension multiplier - bool use_paw = false; ///< Use PAW method int nproc_in_pool = 1; ///< Number of processes in pool }; diff --git a/python/pyabacus/src/hsolver/diago_adapter.hpp b/python/pyabacus/src/hsolver/diago_adapter.hpp index 2a019d0143..d57c8fd82a 100644 --- a/python/pyabacus/src/hsolver/diago_adapter.hpp +++ b/python/pyabacus/src/hsolver/diago_adapter.hpp @@ -84,7 +84,6 @@ class PyDiagoDavidAdapter double tol, std::vector& diag_ethr, int max_iter, - bool use_paw, ::hsolver::diag_comm_info comm_info) { auto hpsi_func = make_hpsi_func_fstyle(mm_op); @@ -95,7 +94,6 @@ class PyDiagoDavidAdapter nband_, nbasis_, dav_ndim, - use_paw, comm_info ); diff --git a/python/pyabacus/src/hsolver/py_diago_david.hpp b/python/pyabacus/src/hsolver/py_diago_david.hpp index 2042443dd5..40261b01b9 100644 --- a/python/pyabacus/src/hsolver/py_diago_david.hpp +++ b/python/pyabacus/src/hsolver/py_diago_david.hpp @@ -106,7 +106,6 @@ class PyDiagoDavid double tol, std::vector& diag_ethr, int max_iter, - bool use_paw, hsolver::diag_comm_info comm_info ) { auto hpsi_func = [mm_op] ( @@ -143,7 +142,6 @@ class PyDiagoDavid nband, nbasis, dav_ndim, - use_paw, comm_info ); diff --git a/python/pyabacus/src/hsolver/py_hsolver.cpp b/python/pyabacus/src/hsolver/py_hsolver.cpp index fa7a22d9bc..02f91c9441 100644 --- a/python/pyabacus/src/hsolver/py_hsolver.cpp +++ b/python/pyabacus/src/hsolver/py_hsolver.cpp @@ -145,8 +145,6 @@ void bind_hsolver(py::module& m) The tolerance vector. max_iter : int The maximum number of iterations. - use_paw : bool - Whether to use the projector augmented wave method. )pbdoc", "mm_op"_a, "precond_vec"_a, @@ -154,7 +152,6 @@ void bind_hsolver(py::module& m) "tol"_a, "diag_ethr"_a, "max_iter"_a, - "use_paw"_a, "comm_info"_a) .def("set_psi", &PyDiagoDavidAdapter::set_psi, R"pbdoc( Set the initial guess of the eigenvectors, i.e. the wave functions. diff --git a/python/pyabacus/src/pyabacus/hsolver/_hsolver.py b/python/pyabacus/src/pyabacus/hsolver/_hsolver.py index 76001720b4..fb198fc584 100644 --- a/python/pyabacus/src/pyabacus/hsolver/_hsolver.py +++ b/python/pyabacus/src/pyabacus/hsolver/_hsolver.py @@ -136,7 +136,6 @@ def davidson( tol: float = 1e-2, max_iter: int = 1000, diag_ethr: Union[List[float], None] = None, - use_paw: bool = False, # scf_type: bool = False ) -> Tuple[NDArray[np.float64], NDArray[np.complex128]]: """ A function to diagonalize a matrix using the Davidson-Subspace method. @@ -163,8 +162,6 @@ def davidson( The maximum number of iterations, by default 1000. diag_ethr : List[float] | None, optional The list of thresholds of bands, by default None. - use_paw : bool, optional - Whether to use projector augmented wave (PAW) method, by default False. Returns ------- @@ -195,7 +192,6 @@ def davidson( tol, diag_ethr, max_iter, - use_paw, comm_info ) diff --git a/source/source_esolver/esolver_ks_pw.cpp b/source/source_esolver/esolver_ks_pw.cpp index 7eccfb5d61..6714821d02 100644 --- a/source/source_esolver/esolver_ks_pw.cpp +++ b/source/source_esolver/esolver_ks_pw.cpp @@ -216,7 +216,6 @@ void ESolver_KS_PW::hamilt2rho_single(UnitCell& ucell, const int iste PARAM.inp.calculation, PARAM.inp.basis_type, PARAM.inp.ks_solver, - false, PARAM.globalv.use_uspp, PARAM.inp.nspin, hsolver::DiagoIterAssist::SCF_ITER, diff --git a/source/source_esolver/esolver_sdft_pw.cpp b/source/source_esolver/esolver_sdft_pw.cpp index 94d24550d7..02300eb3c5 100644 --- a/source/source_esolver/esolver_sdft_pw.cpp +++ b/source/source_esolver/esolver_sdft_pw.cpp @@ -158,7 +158,6 @@ void ESolver_SDFT_PW::hamilt2rho_single(UnitCell& ucell, int istep, i PARAM.inp.calculation, PARAM.inp.basis_type, PARAM.inp.ks_solver, - false, PARAM.globalv.use_uspp, PARAM.inp.nspin, hsolver::DiagoIterAssist::SCF_ITER, diff --git a/source/source_hsolver/diago_david.cpp b/source/source_hsolver/diago_david.cpp index f51c9fd54a..e1fec73546 100644 --- a/source/source_hsolver/diago_david.cpp +++ b/source/source_hsolver/diago_david.cpp @@ -16,9 +16,8 @@ DiagoDavid::DiagoDavid(const Real* precondition_in, const int nband_in, const int dim_in, const int david_ndim_in, - const bool use_paw_in, const diag_comm_info& diag_comm_in) - : nband(nband_in), dim(dim_in), nbase_x(david_ndim_in * nband_in), david_ndim(david_ndim_in), use_paw(use_paw_in), diag_comm(diag_comm_in) + : nband(nband_in), dim(dim_in), nbase_x(david_ndim_in * nband_in), david_ndim(david_ndim_in), diag_comm(diag_comm_in) { this->device = base_device::get_device_type(this->ctx); this->precondition = precondition_in; diff --git a/source/source_hsolver/diago_david.h b/source/source_hsolver/diago_david.h index 75a745d326..e9ee3a50fd 100644 --- a/source/source_hsolver/diago_david.h +++ b/source/source_hsolver/diago_david.h @@ -45,7 +45,6 @@ class DiagoDavid * @param[in] david_ndim_in Dimension of the reduced basis set of Davidson. * `david_ndim_in` * `nband_in` is the maximum allowed size of * the reduced basis set before \b restart of Davidson. - * @param[in] use_paw_in Flag indicating whether to use PAW. * @param[in] diag_comm_in Communication information for diagonalization. * * @tparam T The data type of the matrices and arrays. @@ -57,7 +56,6 @@ class DiagoDavid const int nband_in, const int dim_in, const int david_ndim_in, - const bool use_paw_in, const diag_comm_info& diag_comm_in); /** @@ -142,7 +140,6 @@ class DiagoDavid const int notconv_max = 0); // Maximum number of allowed non-converged eigenvectors private: - bool use_paw = false; int test_david = 0; diag_comm_info diag_comm; diff --git a/source/source_hsolver/hsolver_pw.cpp b/source/source_hsolver/hsolver_pw.cpp index a3574147a9..e36aac77cb 100644 --- a/source/source_hsolver/hsolver_pw.cpp +++ b/source/source_hsolver/hsolver_pw.cpp @@ -109,9 +109,7 @@ void HSolverPW::solve(hamilt::Hamilt* pHamilt, // update H(k) for each k point pHamilt->updateHk(ik); -#ifdef USE_PAW - this->paw_func_in_kloop(ik, tpiba); -#endif + // update psi pointer for each k point psi.fix_k(ik); @@ -133,9 +131,7 @@ void HSolverPW::solve(hamilt::Hamilt* pHamilt, ethr_band); } -#ifdef USE_PAW - this->call_paw_cell_set_currentk(ik); -#endif + // solve eigenvector and eigenvalue for H(k) this->hamiltSolvePsiK(pHamilt, psi, precondition, eigenvalues.data() + ik * psi.get_nbands(), this->wfc_basis->nks); @@ -156,9 +152,7 @@ void HSolverPW::solve(hamilt::Hamilt* pHamilt, // update H(k) for each k point pHamilt->updateHk(ik); -#ifdef USE_PAW - this->paw_func_in_kloop(ik, tpiba); -#endif + // update psi pointer for each k point psi.fix_k(ik); @@ -175,9 +169,7 @@ void HSolverPW::solve(hamilt::Hamilt* pHamilt, ethr_band); } -#ifdef USE_PAW - this->call_paw_cell_set_currentk(ik); -#endif + // solve eigenvector and eigenvalue for H(k) this->hamiltSolvePsiK(pHamilt, psi, precondition, eigenvalues.data() + ik * psi.get_nbands(), this->wfc_basis->nks); @@ -350,7 +342,7 @@ void HSolverPW::hamiltSolvePsiK(hamilt::Hamilt* hm, const int nband = psi.get_nbands(); /// number of eigenpairs sought const int ld_psi = psi.get_nbasis(); /// leading dimension of psi - DiagoDavid david(pre_condition.data(), nband, dim, PARAM.inp.pw_diag_ndim, this->use_paw, comm_info); + DiagoDavid david(pre_condition.data(), nband, dim, PARAM.inp.pw_diag_ndim, comm_info); // do diag and add davidson iteration counts up to avg_iter DiagoIterAssist::avg_iter += static_cast( david.diag(hpsi_func, diff --git a/source/source_hsolver/hsolver_pw.h b/source/source_hsolver/hsolver_pw.h index 2ba686063a..cecce478ec 100644 --- a/source/source_hsolver/hsolver_pw.h +++ b/source/source_hsolver/hsolver_pw.h @@ -28,7 +28,6 @@ class HSolverPW const std::string calculation_type_in, const std::string basis_type_in, const std::string method_in, - const bool use_paw_in, const bool use_uspp_in, const int nspin_in, const int scf_iter_in, @@ -37,7 +36,7 @@ class HSolverPW const bool need_subspace_in, const bool use_k_continuity_in = false) : wfc_basis(wfc_basis_in), calculation_type(calculation_type_in), basis_type(basis_type_in), method(method_in), - use_paw(use_paw_in), use_uspp(use_uspp_in), nspin(nspin_in), scf_iter(scf_iter_in), + use_uspp(use_uspp_in), nspin(nspin_in), scf_iter(scf_iter_in), diag_iter_max(diag_iter_max_in), diag_thr(diag_thr_in), need_subspace(need_subspace_in), use_k_continuity(use_k_continuity_in) {}; @@ -76,7 +75,6 @@ class HSolverPW const std::string calculation_type; const std::string basis_type; const std::string method; - const bool use_paw; const bool use_uspp; const int nspin; @@ -100,14 +98,7 @@ class HSolverPW /// @brief calculate the threshold for iterative-diagonalization for each band void cal_smooth_ethr(const double& wk, const double* wg, const double& ethr, std::vector& ethrs); -#ifdef USE_PAW - void paw_func_in_kloop(const int ik, - const double tpiba); - void call_paw_cell_set_currentk(const int ik); - - void paw_func_after_kloop(psi::Psi& psi, elecstate::ElecState* pes,const double tpiba,const int nat); -#endif // K-point continuity related members std::vector k_order; diff --git a/source/source_hsolver/hsolver_pw_sdft.h b/source/source_hsolver/hsolver_pw_sdft.h index 27ae8b57cb..a528ac57ca 100644 --- a/source/source_hsolver/hsolver_pw_sdft.h +++ b/source/source_hsolver/hsolver_pw_sdft.h @@ -20,7 +20,6 @@ class HSolverPW_SDFT : public HSolverPW const std::string calculation_type_in, const std::string basis_type_in, const std::string method_in, - const bool use_paw_in, const bool use_uspp_in, const int nspin_in, const int scf_iter_in, @@ -31,7 +30,6 @@ class HSolverPW_SDFT : public HSolverPW calculation_type_in, basis_type_in, method_in, - use_paw_in, use_uspp_in, nspin_in, scf_iter_in, diff --git a/source/source_hsolver/test/diago_david_float_test.cpp b/source/source_hsolver/test/diago_david_float_test.cpp index cba4186617..000bb1b22e 100644 --- a/source/source_hsolver/test/diago_david_float_test.cpp +++ b/source/source_hsolver/test/diago_david_float_test.cpp @@ -93,7 +93,7 @@ class DiagoDavPrepare const int dim = phi.get_current_ngk() ; const int nband = phi.get_nbands(); const int ld_psi =phi.get_nbasis(); - hsolver::DiagoDavid> dav(precondition, nband, dim, order, false, comm_info); + hsolver::DiagoDavid> dav(precondition, nband, dim, order, comm_info); hsolver::DiagoIterAssist>::PW_DIAG_NMAX = maxiter; hsolver::DiagoIterAssist>::PW_DIAG_THR = eps; diff --git a/source/source_hsolver/test/diago_david_real_test.cpp b/source/source_hsolver/test/diago_david_real_test.cpp index e0f887a573..8e0ecf35c4 100644 --- a/source/source_hsolver/test/diago_david_real_test.cpp +++ b/source/source_hsolver/test/diago_david_real_test.cpp @@ -92,7 +92,7 @@ class DiagoDavPrepare const int dim = phi.get_current_ngk(); const int nband = phi.get_nbands(); const int ld_psi = phi.get_nbasis(); - hsolver::DiagoDavid dav(precondition, nband, dim, order, false, comm_info); + hsolver::DiagoDavid dav(precondition, nband, dim, order, comm_info); hsolver::DiagoIterAssist::PW_DIAG_NMAX = maxiter; hsolver::DiagoIterAssist::PW_DIAG_THR = eps; diff --git a/source/source_hsolver/test/diago_david_test.cpp b/source/source_hsolver/test/diago_david_test.cpp index c6472ada4f..5f9de9833d 100644 --- a/source/source_hsolver/test/diago_david_test.cpp +++ b/source/source_hsolver/test/diago_david_test.cpp @@ -97,7 +97,7 @@ class DiagoDavPrepare const int dim = phi.get_current_ngk(); const int nband = phi.get_nbands(); const int ld_psi = phi.get_nbasis(); - hsolver::DiagoDavid> dav(precondition, nband, dim, order, false, comm_info); + hsolver::DiagoDavid> dav(precondition, nband, dim, order, comm_info); hsolver::DiagoIterAssist>::PW_DIAG_NMAX = maxiter; hsolver::DiagoIterAssist>::PW_DIAG_THR = eps; diff --git a/source/source_hsolver/test/hsolver_pw_sup.h b/source/source_hsolver/test/hsolver_pw_sup.h index 5f5108c627..b41196c396 100644 --- a/source/source_hsolver/test/hsolver_pw_sup.h +++ b/source/source_hsolver/test/hsolver_pw_sup.h @@ -123,9 +123,8 @@ DiagoDavid::DiagoDavid(const Real* precondition_in, const int nband_in, const int dim_in, const int david_ndim_in, - const bool use_paw_in, const diag_comm_info& diag_comm_in) - : nband(nband_in), dim(dim_in), nbase_x(david_ndim_in * nband_in), david_ndim(david_ndim_in), use_paw(use_paw_in), diag_comm(diag_comm_in) { + : nband(nband_in), dim(dim_in), nbase_x(david_ndim_in * nband_in), david_ndim(david_ndim_in), diag_comm(diag_comm_in) { this->device = base_device::get_device_type(this->ctx); this->precondition = precondition_in; diff --git a/source/source_hsolver/test/test_hsolver_sdft.cpp b/source/source_hsolver/test/test_hsolver_sdft.cpp index 7ab1464195..f2d36efd43 100644 --- a/source/source_hsolver/test/test_hsolver_sdft.cpp +++ b/source/source_hsolver/test/test_hsolver_sdft.cpp @@ -280,7 +280,6 @@ class TestHSolverPW_SDFT : public ::testing::Test "scf", "pw", "cg", - false, PARAM.sys.use_uspp, PARAM.input.nspin, hsolver::DiagoIterAssist>::SCF_ITER, diff --git a/source/source_lcao/module_lr/hsolver_lrtd.hpp b/source/source_lcao/module_lr/hsolver_lrtd.hpp index f1d3991955..4d82bc6a0a 100644 --- a/source/source_lcao/module_lr/hsolver_lrtd.hpp +++ b/source/source_lcao/module_lr/hsolver_lrtd.hpp @@ -86,7 +86,6 @@ namespace LR nband, dim, PARAM.inp.pw_diag_ndim, - false, comm_info); std::vector ethr_band(nband, diag_ethr); hsolver::DiagoIterAssist::avg_iter += static_cast(david.diag(hpsi_func, spsi_func, diff --git a/source/source_pw/module_pwdft/forces.cpp b/source/source_pw/module_pwdft/forces.cpp index f608a7f4a8..6888d89dac 100644 --- a/source/source_pw/module_pwdft/forces.cpp +++ b/source/source_pw/module_pwdft/forces.cpp @@ -49,7 +49,6 @@ void Forces::cal_force(UnitCell& ucell, ModuleBase::matrix forcecc(nat, 3); ModuleBase::matrix forcenl(nat, 3); ModuleBase::matrix forcescc(nat, 3); - ModuleBase::matrix forcepaw(nat, 3); ModuleBase::matrix forceonsite(nat, 3); // Force due to local ionic potential