Skip to content
Closed
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
4 changes: 4 additions & 0 deletions src/geometry/force.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,10 @@ Force::add_ibs_force(K_point<double>* kp__, Hamiltonian_k<double>& Hk__, mdarray
}

for (int x = 0; x < 3; x++) {

@toxa81 toxa81 May 22, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found the issue. It's the local orbital - local orbital part of the matrix has to be zeroed, because it doesn't contribute. Correct code is:

            /* zero lo-lo block */
            for (int icol = 0; icol < kp__->num_lo_col(); icol++) {
                for (int irow = 0; irow < kp__->num_lo_row(); irow++) {
                    h1(irow + kp__->num_gkvec_row(), icol + kp__->num_gkvec_col()) = la::constant<std::complex<double>>::zero();
                    o1(irow + kp__->num_gkvec_row(), icol + kp__->num_gkvec_col()) = la::constant<std::complex<double>>::zero();
                }
            }

o1.zero();
h1.zero();

for (int igk_col = 0; igk_col < kp__->num_gkvec_col(); igk_col++) { // loop over columns
auto gvec_col = kp__->gkvec_col().gvec(gvec_index_t::local(igk_col));
for (int igk_row = 0; igk_row < kp__->num_gkvec_row(); igk_row++) { // loop over rows
Expand Down
Loading