Example: BSSE correction

Download BSSE.run

This example shows how to calculate the basis set superposition error for the interaction of CO with H2. In this shell script we loop over progressively better basis sets.

#!/bin/bash


for bas in DZ TZ2P QZ4P
do

core=Large


$ADFBIN/band <<EOF

Atoms
C 0 0 0
O 2.13 0 0
H 0 0 6
H 1.5 0 6
End


BasisDefaults
  BasisType $bas
  Core $core
End


end input

EOF

ECOH2=`$ADFBIN/adfreport  RUNKF -r 'Bond energies%final bond energy'`

rm RUNKF

$ADFBIN/band <<EOF

Atoms
H 0 0 6
H 1.5 0 6
End


BasisDefaults
  BasisType $bas
  Core $core
End


end input

EOF

EH2=`$ADFBIN/adfreport  RUNKF -r 'Bond energies%final bond energy'`


rm RUNKF

$ADFBIN/band <<EOF

Atoms
Gh.C 0 0 0
Gh.O 2.13 0 0
H 0 0 6
H 1.5 0 6
End


BasisDefaults
  BasisType $bas
  Core $core
End


end input

EOF

EH2_GHOST_CO=`$ADFBIN/adfreport  RUNKF -r 'Bond energies%final bond energy'`



rm RUNKF

$ADFBIN/band <<EOF

Atoms
C 0 0 0
O 2.13 0 0
End


BasisDefaults
  BasisType $bas
  Core $core
End


end input

EOF

ECO=`$ADFBIN/adfreport  RUNKF -r 'Bond energies%final bond energy'`

rm RUNKF

$ADFBIN/band <<EOF

Atoms
C 0 0 0
O 2.13 0 0
Gh.H 0 0 6
Gh.H 1.5 0 6
End


BasisDefaults
  BasisType $bas
  Core $core
End


end input

EOF

ECO_GHOST_H2=`$ADFBIN/adfreport  RUNKF -r 'Bond energies%final bond energy'`

rm RUNKF

EV=27.212
echo "Start report"
echo "basis set: $bas"
echo "H2 + CO : $ECOH2"
echo "H2 : $EH2"
echo "H2 (with ghost CO) : $EH2_GHOST_CO"
echo "CO : $ECO"
echo "CO (with ghost H2) : $ECO_GHOST_H2"
BSSEEV=`$ADFBIN/startpython -c "print ( $EH2 - $EH2_GHOST_CO + $ECO - $ECO_GHOST_H2 ) *$EV"`
echo "BSSE correction: $BSSEEV (eV)"
BOND1EV=`$ADFBIN/startpython -c "print ( $ECOH2 - $EH2 - $ECO ) *$EV"`
BOND2EV=`$ADFBIN/startpython -c "print $BOND1EV + $BSSEEV"`
echo "Bond energy: $BOND1EV (eV)"
echo "Bond energy + BSSE: $BOND2EV (eV)"
echo "End report"

done