5.3.3。 NBO与ADF. 一种¶

NBO 6.0是用于自然键订单分析的工具,它使用ADF计算结果。 有关NBO的更多信息,可以在相应的部分中找到 ADF手册 .

NBO analysis is performed based on a prior ADF calculation (with some special keywords) by using two separate binary executables: adfnbo and gennbo6. 在这种情况下,没有为这些二进制文件创建特殊的作业类型。 Instead of that we extend the adf. Job class in such a way that calls of adfnbo and gennbo6 are appended to the usual ADF runscript. 我们还确保初始ADF输入文件中存在所有必需的ADF关键字。 Input keywords for adfnbo are taken from myjob.settings.adfnbo. 所有这项工作都发生在 prerun(). No specialized Results subclass is defined for adf. NBOJob.


from ..interfaces.adfsuite.adf import  adf. Job
from ..core.functions import log
from ..core.settings import ig

__all__ = ['ADFNBOJob']

class  adf. NBOJob( adf. Job):

    def prerun(self):
        s = self.settings.input
        s[ig('fullfock')] = True
        s[ig('aomat2file')] = True
        s[ig('symmetry')] = 'NoSym'
        s[ig('basis')][ig('core')] = 'None'
        save = s.find_case('save')
        if save in s:
            if isinstance(s.save, str):
                s.save += ' TAPE15'
            elif isinstance(s.save, list):
                log("WARNING: 'SAVE TAPE15' could not be added to the input settings of {}. Make sure (thisjob).settings.input.save is a string or a list.".format(self.name), 1)
            s[save] = 'TAPE15'

        if isinstance(self.settings.adfnbo, list):
            adfnbo_input = self.settings.adfnbo
            adfnbo_input = ['write', 'spherical', 'fock']
            log('WARNING: (thisjob).settings.adfnbo should be a list. Using default settings: write, fock, spherical', 1)
        self.settings.runscript.post = '$ADFBIN/adfnbo <<eor\n' + '\n'.join(adfnbo_input) + '\neor\n\n$ADFBIN/gennbo6 FILE47\n'


mol = Molecule('methane.xyz')

s = Settings()
s.input.basis.type = 'DZP'
s.input.xc.lda = 'SCF VWN'
s.input.relativistic = 'scalar zora'
s.adfnbo = ['write', 'spherical', 'fock']

j =  adf. NBOJob(molecule=mol, settings=s)
r = j.run()

lines = r.get_output_chunk(begin='NATURAL BOND ORBITALS (Summary):', end='Charge unit', inc_begin=True, inc_end=True)
for line in lines: print(line)