Skip to content

Commit d2fcf42

Browse files
SISO Code Cleanup (#220)
* 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>
1 parent 1f1b65f commit d2fcf42

1 file changed

Lines changed: 0 additions & 12 deletions

File tree

‎pyscf/siso/siso.py‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -583,9 +583,6 @@ def sanity_checks(self):
583583
if self.amf == self.mmf:
584584
raise ValueError("Exactly one of amf and mmf must be enabled")
585585

586-
if isinstance(self.mc, mcpdft.MultiStateMCPDFTSolver):
587-
self.sort_eigenstates_forlpdft()
588-
589586
expected_nroots = sum(state[0] for state in self.modelspace)
590587
solvers = getattr(self.mc.fcisolver, 'fcisolvers', None)
591588
if solvers is not None:
@@ -638,15 +635,6 @@ def sanity_checks(self):
638635
self._state_s2 = ss
639636
return self
640637

641-
def sort_eigenstates_forlpdft(self):
642-
'''
643-
Sorting the L-PDFT ci-vecs and energies accoarding to spin-states.
644-
'''
645-
ss = self.mc.fcisolver.states_spin_square(self.mc.ci, self.mc.ncas, self.mc.nelecas)[0]
646-
idx = np.argsort(ss)
647-
self.mc.ci = [self.mc.ci[i] for i in idx]
648-
self.mc.e_states = [self.mc.e_states[i] for i in idx]
649-
650638
def dump_flags(self):
651639
log = logger.Logger(self.mc.stdout, self.mc.verbose)
652640
log.note(" ")

0 commit comments

Comments
 (0)