Skip to content

Add mio as a selectable DFTB parameter set - #65

Merged
galjos merged 1 commit into
mainfrom
mio-parameter-set
Jul 2, 2026
Merged

Add mio as a selectable DFTB parameter set#65
galjos merged 1 commit into
mainfrom
mio-parameter-set

Conversation

@galjos

@galjos galjos commented Jul 2, 2026

Copy link
Copy Markdown
Member

Adds a parameter_set selector so a run can choose between the 3ob (DFTB3) and mio (DFTB2) Slater-Koster sets, while still needing only a structure + charge (+ optional spin) — spin polarisation and constants follow from the set automatically.

What changed

  • calculator/dftbplus.py: new dftb_mio_parameters (second-order model — no ThirdOrderFull/Hubbard derivatives) and a DFTB_PARAMETER_SETS registry resolved via resolve_parameter_set(). _spin_kwargs now accepts the spin-constant table so each set supplies its own.
  • thermo/api.py, thermo/screening.py, cli/thermo.py: thread the selection through dftbplus_thermo, screen, and the CLI (thermo screen --parameter-set 3ob|mio).
  • cli/dftb_setup.py: generalise the Slater-Koster downloader — thermo setup-dftb --parameter-set mio fetches mio-1-1 from its release.

mio spin constants

mio is the LDA-based Elstner-1998 set and ships no spin constants of its own. The atomic spin constant is only weakly functional-dependent for H/C/N/O/S, and the only well-documented organic values (3ob's spinw.hsd, matching the DFTB+ manual's own H₂O example: H -0.072, O Wpp -0.028) are the authoritative choice — so mio reuses the 3ob constants. The real difference between the sets is the Hamiltonian (DFTB2 vs DFTB3).

Validation

  • Real DFTB+ end-to-end via screen(parameter_set="mio"): an OH radical runs colinear spin-polarised (DFTB2, UnpairedElectrons = 1, constants H -0.07174 / O -0.02785) and yields sensible thermochemistry; 3ob is unchanged.
  • Automatic download confirmed against the live mio-1-1 release (36 .skf files).
  • Offline suite green (188 passed); real-DFTB+ integration tests green with DFTB_PREFIX set (29 passed, 0 skips).

Introduce a `parameter_set` selector so a run can pick between the 3ob
(DFTB3) and mio (DFTB2) Slater-Koster sets while still needing only a
structure + charge (+ optional spin).

- calculator/dftbplus.py: add `dftb_mio_parameters` (second-order, no
  ThirdOrderFull/Hubbard derivatives) and a `DFTB_PARAMETER_SETS`
  registry with `resolve_parameter_set()`. `_spin_kwargs` now takes the
  spin-constant table so each set supplies its own. mio reuses the
  authoritative 3ob spin constants: mio ships none, and the atomic spin
  constant is only weakly functional-dependent for H/C/N/O/S, so the
  well-documented 3ob values (spinw.hsd, matching the DFTB+ manual's H2O
  example) are the best available choice.
- thermo/api.py, thermo/screening.py, cli/thermo.py: thread the set
  selection through `dftbplus_thermo`, `screen`, and the `screen` CLI
  (`--parameter-set 3ob|mio`).
- cli/dftb_setup.py: generalise the Slater-Koster downloader to any set;
  `setup-dftb --parameter-set mio` fetches mio-1-1 from its release.

Validated end-to-end against real DFTB+: a mio OH radical runs colinear
spin-polarised (DFTB2, UnpairedElectrons = 1) and produces sensible
thermochemistry; 3ob is unchanged.
@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.31%. Comparing base (d51d08a) to head (dc75c0b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #65      +/-   ##
==========================================
+ Coverage   96.23%   96.31%   +0.08%     
==========================================
  Files          22       22              
  Lines        1328     1358      +30     
==========================================
+ Hits         1278     1308      +30     
  Misses         50       50              
Flag Coverage Δ
unittests 96.31% <100.00%> (+0.08%) ⬆️

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.

@galjos
galjos merged commit 8441e81 into main Jul 2, 2026
3 checks passed
@galjos
galjos deleted the mio-parameter-set branch July 6, 2026 09: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.

1 participant