From 0c4e8c4aafbf00ef3d2ff52391d757d696747f55 Mon Sep 17 00:00:00 2001 From: maki49 <1579492865@qq.com> Date: Tue, 30 Sep 2025 14:35:52 +0800 Subject: [PATCH] fix: do not overwrite the k-point weights --- source/module_cell/klist.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/module_cell/klist.cpp b/source/module_cell/klist.cpp index 68a788c0eb..1de06ffe54 100644 --- a/source/module_cell/klist.cpp +++ b/source/module_cell/klist.cpp @@ -788,7 +788,7 @@ void K_Vectors::ibz_kpoint(const ModuleSymmetry::Symmetry& symm, std::vector ibz2bz(this->nkstot); // nkstot is the total input k-points number. - const double weight = 1.0 / static_cast(nkstot); + double weight = 1.0 / static_cast(nkstot); ModuleBase::Vector3 kvec_rot; ModuleBase::Vector3 kvec_rot_k; @@ -822,6 +822,8 @@ void K_Vectors::ibz_kpoint(const ModuleSymmetry::Symmetry& symm, // search in all k-poins. for (int i = 0; i < nkstot; ++i) { + if (!is_mp) { weight = wk[i]; } // use the input weight, instead of 1/nkstot + // restrict to [0, 1) restrict_kpt(kvec_d[i]);