NBO Analysis with ADF and PLAMS

Run NBO analysis on ADF calculations by using the PLAMS ADFNBO recipe.

Downloads: Notebook | Script ?

Related documentation
../_images/adf_nbo_3_0_49f0139f.png

Initialization

from scm.plams import Settings, Molecule, view, AMSJob
from scm.plams.recipes.adfnbo import ADFNBOJob

Define molecule

# mol = Molecule("methane.xyz")
def get_molecule(input_string):
    job = AMSJob.from_input(input_string)
    return job.molecule[""]


mol = get_molecule(
    """
System
    Atoms
         C      0.000000      0.000000      0.000000
         H      0.631600      0.631600      0.631600
         H      0.631600     -0.631600     -0.631600
         H     -0.631600      0.631600     -0.631600
         H     -0.631600     -0.631600      0.631600
    End
End
"""
)

view(mol, guess_bonds=True, width=200, height=200)
image generated from notebook

Create and run job

s = Settings()
s.input.AMS.Task = "SinglePoint"
s.input.ADF.basis.type = "DZP"
s.input.ADF.xc.lda = "SCF VWN"
s.input.ADF.relativity.level = "scalar"
s.adfnbo = ["write", "spherical", "fock"]

j = ADFNBOJob(molecule=mol, settings=s)
r = j.run()
[23.03|17:31:51] JOB plamsjob STARTED
[23.03|17:31:51] JOB plamsjob RUNNING
[23.03|17:31:53] JOB plamsjob FINISHED
[23.03|17:31:53] JOB plamsjob SUCCESSFUL

See also

Python Script

#!/usr/bin/env python
# coding: utf-8

# ## Initialization

from scm.plams import Settings, Molecule, view, AMSJob
from scm.plams.recipes.adfnbo import ADFNBOJob


# ## Define molecule


# mol = Molecule("methane.xyz")
def get_molecule(input_string):
    job = AMSJob.from_input(input_string)
    return job.molecule[""]


mol = get_molecule(
    """
System
    Atoms
         C      0.000000      0.000000      0.000000
         H      0.631600      0.631600      0.631600
         H      0.631600     -0.631600     -0.631600
         H     -0.631600      0.631600     -0.631600
         H     -0.631600     -0.631600      0.631600
    End
End
"""
)

view(mol, guess_bonds=True, width=200, height=200, picture_path="picture1.png")


# ## Create and run job

s = Settings()
s.input.AMS.Task = "SinglePoint"
s.input.ADF.basis.type = "DZP"
s.input.ADF.xc.lda = "SCF VWN"
s.input.ADF.relativity.level = "scalar"
s.adfnbo = ["write", "spherical", "fock"]

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


# ## Print results

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)