예제 #1
0
파일: __init__.py 프로젝트: zwang123/pyscf
def KTDHF(mf):
    from pyscf.pbc import scf
    if hasattr(mf, 'xc'):
        raise RuntimeError('TDHF does not support DFT object %s' % mf)
    if isinstance(mf, scf.uhf.UHF):
        return uhf.TDHF(mf)
    else:
        return rhf.TDHF(mf)
예제 #2
0
def TDHF(mf):
    import numpy
    if numpy.abs(getattr(mf, 'kpt', 0)).max() > 1e-9:
        raise NotImplementedError
    from pyscf.pbc import scf
    if getattr(mf, 'xc', None):
        raise RuntimeError('TDHF does not support DFT object %s' % mf)
    if isinstance(mf, scf.uhf.UHF):
        #mf = scf.addons.convert_to_uhf(mf) # To remove newton decoration
        return uhf.TDHF(mf)
    else:
        #mf = scf.addons.convert_to_rhf(mf)
        return rhf.TDHF(mf)
예제 #3
0
def TDDFT(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 isinstance(mf, scf.hf.KohnShamDFT):
            return uks.tddft(mf)
        else:
            return uhf.TDHF(mf)
    else:
        #mf = scf.addons.convert_to_rhf(mf)
        if isinstance(mf, scf.hf.KohnShamDFT):
            return rks.tddft(mf)
        else:
            return rhf.TDHF(mf)
예제 #4
0
파일: __init__.py 프로젝트: zwang123/pyscf
def KTDDFT(mf):
    from pyscf.pbc import scf
    if isinstance(mf, scf.uhf.UHF):
        if hasattr(mf, 'xc'):
            if mf._numint.libxc.is_hybrid_xc(mf.xc):
                return uks.TDDFT(mf)
            else:
                return uks.TDDFTNoHybrid(mf)
        else:
            return uhf.TDHF(mf)
    else:
        if hasattr(mf, 'xc'):
            if mf._numint.libxc.is_hybrid_xc(mf.xc):
                return rks.TDDFT(mf)
            else:
                return rks.TDDFTNoHybrid(mf)
        else:
            return rhf.TDHF(mf)
예제 #5
0
def TDDFT(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):
            if mf._numint.libxc.is_hybrid_xc(mf.xc):
                return uks.TDDFT(mf)
            else:
                return uks.TDDFTNoHybrid(mf)
        else:
            return uhf.TDHF(mf)
    else:
        #mf = scf.addons.convert_to_rhf(mf)
        if getattr(mf, 'xc', None):
            if mf._numint.libxc.is_hybrid_xc(mf.xc):
                return rks.TDDFT(mf)
            else:
                return rks.TDDFTNoHybrid(mf)
        else:
            return rhf.TDHF(mf)