NBO Analysis with ADF and PLAMS
*******************************

ADF Bonding Analysis

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

-[ Related documentation ]-

* ADFNBO recipe details

* ADF NBO analysis

[image]


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: image generated from notebook][image]


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


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
========


Related documentation
---------------------

* ADFNBO recipe details

* ADF NBO analysis


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)
