Example: Exciton transfer integrals with FOCDFT
***********************************************

"Download ExcitonTransfer_FOCDFT.run"

   #! /bin/sh

   # FOCDFT is used to calculate exciton transfer integrals
   # for the ethylene dimer and trimer using CIS (HartreeFock with TDA).

   # First the isolated fragments are calculated.
   # Because in the final complexes the 2 or 3 ethylene molecules are the same,
   # only one fragment needs to be calculated.

   # For such a small molecule, a relatively small TZP basis set is used, which is
   # not sufficient for excitations to Rydberg-like orbitals.
   # For larger molecules a TZ2P basis set is in most cases
   # sufficient. In that case one might even consider smaller basis sets.
   # In a real application one also probably wants to calculate a higher number
   # of excitations than that are calculated in this example.
   # Next the choice of XC functional is important.
   # If FOCDFT is used for the calculation of exciton transfer
   # best is to use an XC functional that can reasonably well
   # calculate both local excitations as well as charge-transfer excitations,
   # like long range-separated functionals.

   # For analysis reasons we also do a CIS calculation
   # on the ethylene fragment.
   # In the calculation D(2h) symmetry is used.
   # The B1.u excitation will be a valence excitation, and
   # the B3.u excitation will be a Rydberg excitation.
   # Note that in D(2h) symmetry the orientation of the molecule
   # matters in what is called a B1.u or B3.u excitation, for example.


   AMS_JOBNAME=Frag $AMSBIN/ams <<eor
   System
     symmetrize
     atoms
        C       0.00000000       0.00000000      -0.66600000
        C       0.00000000       0.00000000       0.66600000
        H       0.00000000       0.92878500      -1.24030100
        H       0.00000000      -0.92878500      -1.24030100
        H       0.00000000      -0.92878500       1.24030100
        H       0.00000000       0.92878500       1.24030100
     end
   end

   Task SinglePoint

   Engine ADF
     basis
       Type TZP
       core none
     end
     xc
       hartreefock
     end
     TDA
     Excitations
       Davidson
         B1.u 1
         B3.u 1
       End
       Tolerance 1e-5
     End
   EndEngine
   eor

   # Next we calculate the full complex of the dimer.
   # The key ExcitonTransfer is used such that electronic couplings between diabetic states
   # are calculated.
   # Note that one should not use symmetry-equivalent fragments in the final complex,
   # because we want to localize orbitals on a fragment, which breaks this symmetry.
   # In the calculation C(2v) symmetry can stlll be used.

   # 'Localize OccupiedOnly' is used, which means that the calculated excitations
   # are linear combinations of single-orbital transitions from occupied orbitals
   # on one fragment to virtual orbitals on all fragments.
   # The subkey descriptors of the block key Excitations is used
   # such that the output gives information on the local or charge transfer
   # character of these excitations.
   # The two lowest localized B1 excitations will be close to the two local B1.u valence excitations
   # on either fragment. Likewise the two lowest localized A1 excitations will be close to the
   # two local B3.u Rydberg excitations on either fragment.
   # The calculated electronic couplings between states of different symmetry will be zero.


   AMS_JOBNAME=ET2_excitontransfer $AMSBIN/ams <<eor
   System
     symmetrize
     atoms
       C      0.000000    0.000000    0.000000 adf.f=Frag1
       C      1.332000    0.000000    0.000000 adf.f=Frag1
       H     -0.574301    0.000000   -0.928785 adf.f=Frag1
       H     -0.574301    0.000000    0.928785 adf.f=Frag1
       H      1.906301    0.000000    0.928785 adf.f=Frag1
       H      1.906301    0.000000   -0.928785 adf.f=Frag1
       C     -0.000000    4.000000    0.000000 adf.f=Frag2
       C      1.332000    4.000000   -0.000000 adf.f=Frag2
       H     -0.574301    4.000000    0.928785 adf.f=Frag2
       H     -0.574301    4.000000   -0.928785 adf.f=Frag2
       H      1.906301    4.000000   -0.928785 adf.f=Frag2
       H      1.906301    4.000000    0.928785 adf.f=Frag2
     end
   end

   Task SinglePoint

   Engine ADF
     fragments
        Frag1 Frag.results/adf.rkf
        Frag2 Frag.results/adf.rkf
     end
     xc
       hartreefock
     end
     TDA
     Excitations
       Davidson
         A1 2
         B1 2
       End
       Tolerance 1e-5
       descriptors
     End
     FOCDFT
     End
     ExcitonTransfer
       Localize OccupiedOnly
       fullrun false
     End
   EndEngine
   eor

   # In the output one can find the excitonic couplings between the diabetic states.
   # The calculated electronic couplings between the 2 singlet excited states
   # of A1 symmetry is approximately: 0.15 eV.
   # of B1 symmetry is approximately: 0.38 eV.
   # The calculated excitonic couplings between the 2 triplet excited states
   # of A1 symmetry is approximately: 0.10 eV.
   # of B1 symmetry is approximately: 0.027 eV.
   # Note that these states may also couple with other higher lying excited states,
   # but the most important ones are given above.

   # Excition transfer integrals can also be calculated from the energetic splitting
   # of excitation energies in the dimer, also called 'Davydov splitting',
   # where the effective excitonic coupling equals half the splitting observed.
   # This method is used in the final calculation of this example,
   # in which a standard CIS calculation is performed on the dimer.
   # For convenience the same fragments and symmetry are used as in the previous calculation.

   # If one performs the calculation
   # the calculated effective excitonic couplings between the 2 lowest singlet excited states
   # of A1 symmetry is approximately: 0.15 eV (=0.5*(7.82-7.52)).
   # of B1 symmetry is approximately: 0.36 eV (=0.5*(8.20-7.48)).
   # The calculated effective excitonic couplings between the 2 lowest triplet excited states
   # of A1 symmetry is approximately: 0.10 eV (=0.5*(7.45-7.25)).
   # of B1 symmetry is approximately: 0.026 eV (=0.5*(3.556-3.505)).
   # In this case the effective excitonic couplings are close to the
   # excitonic couplings calculated with FOCDFT. Note that with FOCDFT it is also easy
   # to calculate excitonic couplings between diabetic states of different molecules,
   # which would be more difficult if one only knows the excitations of the full complex.

   AMS_JOBNAME=ET2 $AMSBIN/ams <<eor
   System
     symmetrize
     atoms
       C      0.000000    0.000000    0.000000 adf.f=Frag1
       C      1.332000    0.000000    0.000000 adf.f=Frag1
       H     -0.574301    0.000000   -0.928785 adf.f=Frag1
       H     -0.574301    0.000000    0.928785 adf.f=Frag1
       H      1.906301    0.000000    0.928785 adf.f=Frag1
       H      1.906301    0.000000   -0.928785 adf.f=Frag1
       C     -0.000000    4.000000    0.000000 adf.f=Frag2
       C      1.332000    4.000000   -0.000000 adf.f=Frag2
       H     -0.574301    4.000000    0.928785 adf.f=Frag2
       H     -0.574301    4.000000   -0.928785 adf.f=Frag2
       H      1.906301    4.000000   -0.928785 adf.f=Frag2
       H      1.906301    4.000000    0.928785 adf.f=Frag2
     end
   end

   Task SinglePoint

   Engine ADF
     fragments
        Frag1 Frag.results/adf.rkf
        Frag2 Frag.results/adf.rkf
     end
     xc
       hartreefock
     end
     TDA
     Excitations
       Davidson
         A1 2
         B1 2
       End
       Tolerance 1e-5
       descriptors
     End
   EndEngine
   eor

   # As a final example a stacked trimer is calculated, where the distance between
   # 2 ethylene molcules is the same as in the dimer.
   # In this case only singlet-singlet excitations are calculated,
   # where the excited states have B1 symmetry.
   # The three lowest localized B1 excitations (diabetic states).
   # will be close to the three local B1.u valence excitations on each fragment.
   # The calculated excitonic coupling between two neighboring ethylenes will be close to
   # that of the dimer, whereas the excitonic coupling bewteen the ethylenes that are furthest
   # apart are, as expected, much smaller. 

   AMS_JOBNAME=ET3_excitontransfer $AMSBIN/ams <<eor
   System
     symmetrize
     atoms
       C      0.000000    0.000000    0.000000 adf.f=Frag1
       C      1.332000    0.000000    0.000000 adf.f=Frag1
       H     -0.574301    0.000000   -0.928785 adf.f=Frag1
       H     -0.574301    0.000000    0.928785 adf.f=Frag1
       H      1.906301    0.000000    0.928785 adf.f=Frag1
       H      1.906301    0.000000   -0.928785 adf.f=Frag1
       C     -0.000000    4.000000    0.000000 adf.f=Frag2
       C      1.332000    4.000000   -0.000000 adf.f=Frag2
       H     -0.574301    4.000000    0.928785 adf.f=Frag2
       H     -0.574301    4.000000   -0.928785 adf.f=Frag2
       H      1.906301    4.000000   -0.928785 adf.f=Frag2
       H      1.906301    4.000000    0.928785 adf.f=Frag2
       C      0.000000    8.000000    0.000000 adf.f=Frag3
       C      1.332000    8.000000    0.000000 adf.f=Frag3
       H     -0.574301    8.000000   -0.928785 adf.f=Frag3
       H     -0.574301    8.000000    0.928785 adf.f=Frag3
       H      1.906301    8.000000    0.928785 adf.f=Frag3
       H      1.906301    8.000000   -0.928785 adf.f=Frag3
     end
   end

   Task SinglePoint

   Engine ADF
     fragments
        Frag1 Frag.results/adf.rkf
        Frag2 Frag.results/adf.rkf
        Frag3 Frag.results/adf.rkf
     end
     xc
       hartreefock
     end
     TDA
     Excitations
       onlysing
       Davidson
         B1 1
       End
       Tolerance 1e-6
       descriptors
     End
     FOCDFT
     End
     ExcitonTransfer
       Localize OccupiedOnly
       fullrun false
     End
   EndEngine
   eor
