Skip to content

Fix dadr for 0D and 3D#60

Draft
lmseidler wants to merge 3 commits intomainfrom
fix/dadr
Draft

Fix dadr for 0D and 3D#60
lmseidler wants to merge 3 commits intomainfrom
fix/dadr

Conversation

@lmseidler
Copy link
Copy Markdown
Member

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.

Copilot AI review requested due to automatic review settings March 9, 2026 16:01
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_0d and get_damat_3d.
  • Updated dadr accumulation 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 thr2 uniformly.

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.

Comment thread src/multicharge/model/eeqbc.f90 Outdated
Comment thread src/multicharge/model/eeqbc.f90 Outdated
@lmseidler lmseidler marked this pull request as draft March 10, 2026 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants