Skip to content

Add SF-TDDFT nonadiabatic couplings and batch caching - #210

Merged
MatthewRHermes merged 4 commits into
pyscf:masterfrom
jingjjkkyj:master
Sep 7, 2026
Merged

MatthewRHermes merged 4 commits into
pyscf:masterfrom
jingjjkkyj:master

Conversation

@jingjjkkyj

Copy link
Copy Markdown
Contributor

This PR adds analytic nonadiabatic couplings (NACs) for spin-flip TDA/TDDFT and introduces reusable caching and batch utilities for gradient/NAC calculations.

Main changes

  • Add spin-flip TDA/TDDFT nonadiabatic coupling implementation in pyscf.nac.tduks_sf.
  • Support state-pair NAC calculations with optional energy-difference scaling and electron-translation-factor corrections.
  • Reuse XC grid data, response intermediates, and J/K evaluations between gradient and NAC calculations.
  • Add regression tests comparing the new implementation with existing gradient and NAC reference values.

Add spin-flip nonadiabatic coupling support, gradient/NAC cache helpers,
batch APIs, and regression tests. Resolve Ruff and Flake8 findings.
@MatthewRHermes

MatthewRHermes commented Sep 1, 2026 •

Copy link
Copy Markdown
Collaborator

The tools folder is for very generic utilities, I/O, or API. Since you have a bunch of files with nac in the name, just put them in the nac folder instead.

Comment thread pyscf/nac/gradient_nac_cache.py
Move the batch and cache utilities under pyscf.nac, replace the module-level
cache singleton with an explicitly scoped context manager, and add focused
unit tests for cache reuse, geometry keys, isolation, and cleanup.
Comment thread pyscf/nac/__init__.py
Comment thread pyscf/nac/test/test_gradient_nac_cache.py
@MatthewRHermes
MatthewRHermes merged commit 0566d43 into pyscf:master Sep 7, 2026
6 checks passed
JangidBhavnesh pushed a commit to JangidBhavnesh/pyscf-forge that referenced this pull request Sep 18, 2026
* feat: add spin-flip TDDFT NAC and batch caching

Add spin-flip nonadiabatic coupling support, gradient/NAC cache helpers,
batch APIs, and regression tests. Resolve Ruff and Flake8 findings.

* fix: rely on the PySCF tools namespace package

* refactor: scope gradient/NAC caching to NAC package

Move the batch and cache utilities under pyscf.nac, replace the module-level
cache singleton with an explicitly scoped context manager, and add focused
unit tests for cache reuse, geometry keys, isolation, and cleanup.

* fix: preserve NAC API and validate cache correctness
MatthewRHermes pushed a commit that referenced this pull request Oct 7, 2026
* Removing the un-necessary mutation of mc object for L-PDFT

* Add SF-TDDFT nonadiabatic couplings and batch caching (#210)

* feat: add spin-flip TDDFT NAC and batch caching

Add spin-flip nonadiabatic coupling support, gradient/NAC cache helpers,
batch APIs, and regression tests. Resolve Ruff and Flake8 findings.

* fix: rely on the PySCF tools namespace package

* refactor: scope gradient/NAC caching to NAC package

Move the batch and cache utilities under pyscf.nac, replace the module-level
cache singleton with an explicitly scoped context manager, and add focused
unit tests for cache reuse, geometry keys, isolation, and cleanup.

* fix: preserve NAC API and validate cache correctness

---------

Co-authored-by: 井与 <2100011839@stu.pku.edu.cn>
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