Add optional DFTB+ external backend#141
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7abfefc0b0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| except Exception: | ||
| if hasattr(mol, "grads"): | ||
| mol.grads = [flat] |
There was a problem hiding this comment.
Persist parsed DFTB+ gradients on the normal success path
When method=dftb and a gradient is requested, run_openqp_molecule only assigns mol.grads inside the exception fallback. In the normal path (NumPy + ffi.memmove succeeds), mol.grads is left unchanged, so downstream consumers that read mol.grads (for example Runner.results() in pyoqp/oqp/pyoqp.py) can see None/stale gradients even though DFTB+ returned valid forces. This silently drops gradient results from the Python-facing API for standard installs.
Useful? React with 👍 / 👎.
Summary
method=dftbenergy/gradient calculations.[dftb]input schema/config keys, DFTB+ HSD/GEN input generation, fixture-backed parsers fordetailed.outandresults.tag, and runner error handling for missing executables or parameters.sk_path/executableconfiguration.DFTB+ availability / skip behavior
dftb+or Slater-Koster files.DFTB+ executable not found...error.[dftb] sk_pathis unset or missing, the runner raises a clear parameter-directory error.sk_pathto a compatible parameter directory (for example 3ob/mio files); this branch does not vendor parameters.Validation
python3 -m unittest tests.test_dftbplus_backend -vpython3 -m py_compile pyoqp/oqp/library/dftbplus.py pyoqp/oqp/utils/input_checker.py pyoqp/oqp/library/runfunc.pygit diff --stat upstream/main...HEADNotes