Skip to content

Add optional D3(BJ) dispersion to the DFTB+ engine - #89

Merged
galjos merged 2 commits into
mainfrom
dftb-dispersion
Jul 7, 2026
Merged

Add optional D3(BJ) dispersion to the DFTB+ engine#89
galjos merged 2 commits into
mainfrom
dftb-dispersion

Conversation

@galjos

@galjos galjos commented Jul 7, 2026

Copy link
Copy Markdown
Member

The 3ob/mio DFTB+ Hamiltonians carry no dispersion, biasing conformer and non-covalent/redox energetics. This adds an opt-in Grimme D3(BJ) correction (default off, so existing results are unchanged), using the 3ob-recommended parameters straight from the DFTB+ manual: a1=0.5719, a2=3.6017, s6=1.0, s8=0.5883.

  • _dispersion_kwargs("d3-bj") in calculator/dftbplus.py emits the Hamiltonian_Dispersion* block
  • dispersion= on dftbplus_thermo (merged into the Geoopt/Hessian kwargs like solvation)
  • dispersion= on screen and a --dispersion d3-bj CLI flag

Requires a DFTB+ build with D3 support. Unit-tested (helper values / None / unknown-model error) and wiring-tested (screen → dftbplus_thermo, CLI parse + run_screen forward). Full patch coverage.

Closes #88

Add an opt-in Grimme D3 dispersion correction (Becke-Johnson damping) for
the DFTB+ Hamiltonian, using the 3ob-recommended parameters from the DFTB+
manual (a1=0.5719, a2=3.6017, s6=1.0, s8=0.5883). Default is no dispersion
so existing results are unchanged.

- _dispersion_kwargs helper in calculator/dftbplus.py
- dispersion argument on dftbplus_thermo (merged into the Geoopt/Hessian kwargs)
- dispersion argument on screen and a --dispersion d3-bj CLI flag

Closes #88
@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.93%. Comparing base (309ca0f) to head (f748c9b).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #89      +/-   ##
==========================================
+ Coverage   96.91%   96.93%   +0.01%     
==========================================
  Files          28       28              
  Lines        1685     1695      +10     
==========================================
+ Hits         1633     1643      +10     
  Misses         52       52              
Flag Coverage Δ
unittests 96.93% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.

Raise ValueError (not TSValueError) for an unknown dispersion model, to
match _spin_kwargs/resolve_parameter_set in the same module. Add tests
asserting dispersion is injected into both the Geoopt and Hessian steps
and absent by default.
@galjos
galjos merged commit 72239aa into main Jul 7, 2026
3 checks passed
@galjos
galjos deleted the dftb-dispersion branch July 7, 2026 09:12
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.

Add optional D3(BJ) dispersion to the DFTB+ engine

1 participant