Conversation
There was a problem hiding this comment.
Pull request overview
Fixes an error in the analytic dadr (A-matrix derivative) computation for the eeqbc model in both non-periodic (0D) and periodic (3D) cases, aligning the implementation with the correct gamma-derivative terms so numerical and analytic derivatives agree under the standard test tolerance.
Changes:
- Corrected sign/indexing for effective charge-width (gamma) derivative contributions and added missing cross-atom terms in
get_damat_0dandget_damat_3d. - Updated
dadraccumulation to include contributions for all affected atoms (via the gamma derivative dependency) rather than only the interacting pair. - Simplified unit tests by removing the model-specific relaxed tolerance and comparing against
thr2uniformly.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/multicharge/model/eeqbc.f90 |
Fixes dadr gamma-derivative terms in 0D/3D and expands accumulation across atoms. |
test/unit/test_pbc.f90 |
Removes eeqbc_model-specific relaxed tolerance and uses thr2 for dadr checks. |
test/unit/test_model.f90 |
Same tolerance simplification for non-periodic dadr unit test. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
There was an error in the calculation of dadr in both the 0D and 3D case. The error was related to gamma derivatives, so hardly noticeable and partially spurious. Now all tests pass consistently.
Overall one sign error and some missing terms.