Skip to content

Refactor spin-flip TDDFT/TDA including analytic gradient and NACV#731

Merged
sunqm merged 13 commits into
pyscf:masterfrom
bytedance:feat/sftddft-and-gradient
May 8, 2026
Merged

Refactor spin-flip TDDFT/TDA including analytic gradient and NACV#731
sunqm merged 13 commits into
pyscf:masterfrom
bytedance:feat/sftddft-and-gradient

Conversation

@wtpeter
Copy link
Copy Markdown
Contributor

@wtpeter wtpeter commented Apr 9, 2026

This PR refactors the spin-flip TDDFT/TDA module with the following changes:

  • Davidson Solver: Improve stability with double Gram-Schmidt and keep all initial guess vectors in the first iteration to help convergence in tdscf._lr_eig.eigh. Add davidson_nosym1 for SF-TDDFT.

  • Core Refactor: Refactor SpinFlipTDA and SpinFlipTDDFT classes in tdscf.uhf, and add necessary post-processing functions.

  • Gradients: Refactor SF-TDDFT analytic gradients (supporting both with and without density-fitting).

  • Nonadiabatic Coupling Vectors: Add SF-TDDFT analytic NACV (supporting both with and without density-fitting).

  • Tests: Add and update tests for SF-TDDFT/TDA, their analytic gradients and NACVs.

  • Others: Improve some error messages and remove obsolete test files.

Note: Example input files are not included in this PR.

wtpeter added 4 commits April 9, 2026 14:57
- Keep all initial guess vectors in the first iteration
- Implement double Gram-Schmidt orthogonalization for better stability
- Add davidson_nosym1 diagonalizer in tdscf._lr_eig for Spin-flip TDDFT.
- Refactor SpinFlipTDA/TDDFT classes in tdscf.uhf and add post-processing.
- Update test suite: add test_sftda.py, update test_sftddft.py, and remove obsolete tests.
- Apply necessary code formatting.
- Refactor analytic gradient implementations in grad/tduks_sf.py.
- Add df/grad/tduks_sf.py to support density-fitting gradients.
- Add for SF-TDA and SF-TDDFT analytic gradient.
- Consolidate and optimize SF-TDA/TDDFT tests to reduce CI runtime.
- Improve exception messages in grad/tduks.py.
@wtpeter wtpeter force-pushed the feat/sftddft-and-gradient branch from 37a161d to 8ba86f4 Compare April 20, 2026 11:44
Comment thread gpu4pyscf/tdscf/_lr_eig.py
Comment thread gpu4pyscf/tdscf/_uhf_resp_sf.py Outdated
Comment thread gpu4pyscf/tdscf/uhf.py
Comment thread gpu4pyscf/tdscf/uhf.py Outdated
Comment thread gpu4pyscf/tdscf/uhf.py
@wtpeter wtpeter force-pushed the feat/sftddft-and-gradient branch from 1c75e71 to 6b73575 Compare April 27, 2026 08:52
@wtpeter wtpeter changed the title Refactor spin-flip TDDFT/TDA including analytic gradient Refactor spin-flip TDDFT/TDA including analytic gradient and NACV Apr 27, 2026
@wtpeter
Copy link
Copy Markdown
Contributor Author

wtpeter commented Apr 27, 2026

In the newest commits, spin-flip TDDFT NACV and its tests has been also pushed onto this branch.

Comment thread gpu4pyscf/nac/tests/test_tduks_sf_nac.py
@sunqm sunqm merged commit 61bd6b5 into pyscf:master May 8, 2026
4 checks passed
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