Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions source/source_lcao/module_deepks/deepks_pdm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,8 @@ void DeePKS_domain::update_dmr(const std::vector<ModuleBase::Vector3<double>>& k
}
calculated_pairs.push_back(std::make_tuple(ibt1, ibt2, dR.x, dR.y, dR.z));

dm_pair.find_R(dR);
hamilt::BaseMatrix<double>* dmr_ptr = dm_pair.find_matrix(dR);
dmr_ptr->set_zero(); // must reset to zero to avoid accumulation!
const int r_index = dm_pair.find_R(dR);
dm_pair.get_HR_values(r_index).set_zero(); // must reset to zero to avoid accumulation!

for (int ik = 0; ik < dmk.size(); ik++)
{
Expand All @@ -166,11 +165,11 @@ void DeePKS_domain::update_dmr(const std::vector<ModuleBase::Vector3<double>>& k
TK* kphase_ptr = reinterpret_cast<TK*>(&kphase);
if (ModuleBase::GlobalFunc::IS_COLUMN_MAJOR_KS_SOLVER(PARAM.inp.ks_solver))
{
dm_pair.add_from_matrix(dmk[ik].data(), pv.get_row_size(), *kphase_ptr, 1);
dm_pair.add_from_matrix(r_index, dmk[ik].data(), pv.get_row_size(), *kphase_ptr, 1);
}
else
{
dm_pair.add_from_matrix(dmk[ik].data(), pv.get_col_size(), *kphase_ptr, 0);
dm_pair.add_from_matrix(r_index, dmk[ik].data(), pv.get_col_size(), *kphase_ptr, 0);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion source/source_lcao/module_gint/gint_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ void compose_hr_gint(HContainer<T>& hr_gint)
{
for (int icol = 0; icol < upper_mat->get_col_size(); ++icol)
{
lower_mat->get_value(icol, irow) = upper_ap->get_value(irow, icol);
lower_mat->get_value(icol, irow) = upper_mat->get_value(irow, icol);
}
}
}
Expand Down
Loading
Loading