Skip to content

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

Open
wtpeter wants to merge 3 commits intopyscf:masterfrom
bytedance:feat/sftddft-and-gradient
Open

Refactor spin-flip TDDFT/TDA including analytic gradient#731
wtpeter wants to merge 3 commits intopyscf: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).

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

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

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

wtpeter added 3 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.
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