NBO Analysis with ADF and PLAMS¶
Run NBO analysis on ADF calculations by using the PLAMS ADFNBO recipe.
Initialization¶
from scm.base import ChemicalSystem
from scm.inputs import ADF, AMS
from scm.plams import Settings, view
from scm.plams.recipes.adfnbo import ADFNBOJob
Define molecule¶
# Alternatively: mol = ChemicalSystem.from_file("methane.xyz")
mol = ChemicalSystem(
"""
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)
Create and run job¶
s = Settings()
s.input = AMS(
Task="SinglePoint",
Engine=ADF(Basis={"Type": "DZP"}, XC={"LDA": "SCF VWN"}, Relativity={"Level": "Scalar"}),
)
# Settings holds the NBO post-processing options, outside the AMS input.
s.adfnbo = ["write", "spherical", "fock"]
j = ADFNBOJob(molecule=mol, settings=s)
r = j.run()
[05.11|15:28:55] JOB plamsjob STARTED
[05.11|15:28:55] JOB plamsjob RUNNING
[05.11|15:28:58] JOB plamsjob FINISHED
[05.11|15:28:58] JOB plamsjob SUCCESSFUL
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)
NATURAL BOND ORBITALS (Summary):
Principal Delocalizations
NBO Occupancy Energy (geminal,vicinal,remote)
===============================================================================
Molecular unit 1 (CH4)
------ Lewis --------------------------------------
1. CR ( 1) C 1 2.00000 -9.77904
2. BD ( 1) C 1- H 2 1.99927 -0.42240
3. BD ( 1) C 1- H 3 1.99927 -0.42240
... output trimmed ....
33. RY ( 2) H 5 0.00000 0.95619
34. RY ( 3) H 5 0.00000 0.95619
35. RY ( 4) H 5 0.00000 1.52007
-------------------------------
Total Lewis 9.99709 ( 99.9709%)
Valence non-Lewis 0.00093 ( 0.0093%)
Rydberg non-Lewis 0.00199 ( 0.0199%)
-------------------------------
Total unit 1 10.00000 (100.0000%)
Charge unit 1 0.00000
See also¶
Python Script¶
#!/usr/bin/env python
# coding: utf-8
# ## Initialization
from scm.base import ChemicalSystem
from scm.inputs import ADF, AMS
from scm.plams import Settings, view
from scm.plams.recipes.adfnbo import ADFNBOJob
# ## Define molecule
# Alternatively: mol = ChemicalSystem.from_file("methane.xyz")
mol = ChemicalSystem(
"""
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",
Engine=ADF(Basis={"Type": "DZP"}, XC={"LDA": "SCF VWN"}, Relativity={"Level": "Scalar"}),
)
# Settings holds the NBO post-processing options, outside the AMS input.
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)