Example: Electric Field, Point Charge(s): N2 and PtCO¶
#! /bin/sh
# Two illustrations of applying the very useful BASIS keyword and of application
# of an Electric Field.
# For N2, three calculations are provided: 1) a normal N2 run as a reference
# with the BASIS keyword, 2) with a homogeneous electric field, 3) with a point
# charge.
# In this example, no Create run is needed in the input file, because the first
# molecular calculation uses the BASIS keyword. If the $ADFBIN/adf script finds
# this keyword, it will first generate a new input file which will then be
# executed. The new input file will contain the required Create run for the N
# atom in this case. The proper xc functional and relativistic options will
# automatically be selected by the BASIS keyword. This includes Dirac
# calculations in case of relativistic runs. The output files is identical to
# what would have appeared if one would provide the Create runs explicitly in
# the input file. It also copies the atomic input, so that everything can be
# checked.
$ADFBIN/adf -n1 <<eor
title N2  reference for comparison with E-Field runs
  
atoms
 N  0 0 -.55
 N  0 0 +.55
end
Basis
 Type DZP
 Core Small
End
eor
mv TAPE21 N2.t21
rm logfile
$ADFBIN/adf <<eor
title N2 in a homogeneous electric field
scf
 converge 1e-8
end
  
atoms
 N  0 0 -.55
 N  0 0 +.55
end
fragments
 N  t21.N
end
  
EField 0 0 0.01
  
eor
mv TAPE21 N2_field1.t21
rm logfile
$ADFBIN/adf <<eor
title  N2 polarized by a point charge on the axis
  
PointCharges
   0 0 3.0 1.0
end
  
atoms
 N 0 0 -.55
 N 0 0 .55
end
  
Fragments
 N  t21.N
end
  
eor
mv TAPE21 N2_field2.t21
# In the second n2 run the homogeneous field is supplied with the key efield,
# used as simple key: one record, data on the same line as the keyword. The
# field strength is specified in atomic units.
# Homogeneous electric fields can be used to study the polarizability: for
# sufficiently small fields the dipole moment should respond linearly.
# For point charges, the third calculation, the block form of the key efield
# must be used. The program first tries to find data on the same line as the
# keyword (defining a homogeneous field). If this is absent, a data block is
# expected with point-charge specifications: x, y, z and q.
# The coordinates are in the same units as in the atoms block (angstrom by
# default) (but always Cartesian). Q is the charge in elementary units (+1 for a
# proton).
# Point charges can be used for instance to simulate crystal fields (Madelung
# potential).
# Note: the symmetry will be determined automatically by the program as C(lin),
# rather than D(lin), in the two runs that involve an electric field: the fields
# break the symmetry.
# For PtCO, a fairly large electric field is applied in combination with a tight
# SCF convergence criterion.
# The BASIS keyword in this example illustrates how different choices can be
# made for different atoms (in this case a frozen core for Pt):
#   Basis
#    Type DZ
#    Core None
#    Pt Pt.4d
#   END
#! /bin/sh
$ADFBIN/adf << eor
TITLE Pt-CO in electric field
ATOMS 
Pt 0 0 0 
C  0 0 1.70
O  0 0 2.85
END
Basis
 Type DZ
 Core None
 Pt Pt.4d
End
EFIELD 0 0 0.01
SCF
CONVERGE 1.0E-10
END 
BeckeGrid
 Quality good
End
eor
mv TAPE21 PtCO.t21