Skip to content

Commit c5d5766

Browse files
authored
fix: do not overwrite the k-point weights (#6552)
1 parent 9300a86 commit c5d5766

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

source/module_cell/klist.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ void K_Vectors::ibz_kpoint(const ModuleSymmetry::Symmetry& symm,
788788
std::vector<int> ibz2bz(this->nkstot);
789789

790790
// nkstot is the total input k-points number.
791-
const double weight = 1.0 / static_cast<double>(nkstot);
791+
double weight = 1.0 / static_cast<double>(nkstot);
792792

793793
ModuleBase::Vector3<double> kvec_rot;
794794
ModuleBase::Vector3<double> kvec_rot_k;
@@ -822,6 +822,8 @@ void K_Vectors::ibz_kpoint(const ModuleSymmetry::Symmetry& symm,
822822
// search in all k-poins.
823823
for (int i = 0; i < nkstot; ++i)
824824
{
825+
if (!is_mp) { weight = wk[i]; } // use the input weight, instead of 1/nkstot
826+
825827
// restrict to [0, 1)
826828
restrict_kpt(kvec_d[i]);
827829

0 commit comments

Comments
 (0)