def KTDA(mf): from pyscf.pbc import scf if isinstance(mf, scf.uhf.UHF): if hasattr(mf, 'xc'): return uks.TDA(mf) else: return uhf.TDA(mf) else: if hasattr(mf, 'xc'): return rks.TDA(mf) else: return rhf.TDA(mf)
def TDA(mf): import numpy if numpy.abs(getattr(mf, 'kpt', 0)).max() > 1e-9: raise NotImplementedError from pyscf.pbc import scf if isinstance(mf, scf.uhf.UHF): #mf = scf.addons.convert_to_uhf(mf) if getattr(mf, 'xc', None): return uks.TDA(mf) else: return uhf.TDA(mf) else: #mf = scf.addons.convert_to_rhf(mf) if getattr(mf, 'xc', None): return rks.TDA(mf) else: return rhf.TDA(mf)