Skip to content

Conversation

@MauriceDHanisch
Copy link

@MauriceDHanisch MauriceDHanisch commented Apr 3, 2025

BUG: When using scp_mode="fock" computing the derivative of the Fock matrix with respect to atomic positions failed. This was due to the Fock matrix being disconnected from the computational graph.

FIX: The issue was resolved by triggering one additional SCF cycle, which reconnects the Fock matrix and the computational graph. Similar to #212.

TEST: A regression test was added using torch.autograd.gradcheck, which verifies that the Fock matrix is differentiable with respect to atomic positions.

  • The test fails on main, confirming the original bug.
  • It passes after the fix.
  • Note: The test required a slightly increased atol due to discrepancies observed for some molecules (due to SCF instability or small numerical gradients?).

@MauriceDHanisch MauriceDHanisch marked this pull request as ready for review April 3, 2025 23:24
from tad_mctc.autograd import dgradcheck

from dxtb import GFN1_XTB as par
from dxtb import Calculator, OutputHandler, labels

Check notice

Code scanning / CodeQL

Unused import Note test

Import of 'labels' is not used.
@codecov
Copy link

codecov bot commented Apr 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.80%. Comparing base (5170e4d) to head (9a63304).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #214      +/-   ##
==========================================
+ Coverage   85.78%   85.80%   +0.01%     
==========================================
  Files         202      202              
  Lines       10160    10160              
  Branches     1150     1150              
==========================================
+ Hits         8716     8718       +2     
+ Misses       1106     1105       -1     
+ Partials      338      337       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@MauriceDHanisch MauriceDHanisch marked this pull request as draft April 6, 2025 02:25
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.

1 participant