Fix to IBS force.cpp#1140
Closed
mrm24 wants to merge 1 commit into
Closed
Conversation
The derivative arrays are now initialized to 0.
Collaborator
|
Dear @mrm24 |
Collaborator
|
cscs-ci run default |
toxa81
requested changes
May 22, 2026
| } | ||
|
|
||
| for (int x = 0; x < 3; x++) { | ||
|
|
Collaborator
There was a problem hiding this comment.
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();
}
}
Collaborator
|
fixed in a different MR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For LAPW+lo IBS is giving NaN in the case there in some grid configurations (if more than one process is assigned to the k-point group). See the following output of exciting with SIRIUS:


This patch solves it by initializing h1 and o1 (the derivatives) to 0 inside the Cartesian axis loop. The result looks like: