ComQum-EXAFS

ComQum-Exafs is a combination of computational chemistry (either quantum chemistry, molecular mechanics, or QM/MM) and EXAFS refinement. This page shows how to set up such a calculation.

In fact, there are two separate approaches:

The method was originally set up by Ya-Wen Hisao, 2004-2005 and then modified by Ulf Ryde.
The method is described in:
All source files are in: /away/bio/Exafs/
All executables are linked to /away/bio/Bin or /away/bio/Bin/Linux.
An example is found in /away/bio/Exafs/Cqe_example.

How to set up a ComQum-EXAFS calculation

  1. Obtain the EXAFS data, preferably already treated with background removal, normalisation, splining, and conversion to k-space.
    The IFEFFIT program requires the k-interval to be 0.05 Å-1 for the data, so one may need to do an interpolation --- See the IFEFFIT page.
    This file is called inter*.chi below.

  2. Run the program turbo2feff to get the feff.inp file (you need to have a Turbomole calculation with coordinates to start with). Preferably, you should have first run a geometry optimisation and then a frequency calculation. turbo2feff reads force constants calculated by describe from a geo file and sets up also the spring.inp file (this will give Debye-Waller factors also).
    Consider to change the keywords TITLE, RPATH, NLEG, CRITERIA, HOLE, and DEBYE (cf. the FEFF page).
    Then, run FEFF by typing feff82
    The output will be lots of feffxxxx.dat files, which are the paths.
    The files files.dat and paths.dat give you more detailed information about the paths.

    NB: you need to have a separate directory for every absorbing atom (central metal) if you have several metals and you need to modify the feff.inp files by hand (by default the first heavy atom is given potential 0 and put first in the list). You must ensure that the scattering atom is always first in the list.

    The program swapabsorber may facilitate this renumbering of the atoms in files feff.inp and spring.inp. You just select the atoms to swap.
    The "testcriwmaxdosfit" (by Xichen Li) is used to accept the S02, the first 
    number of CRITERIA, the wmax, and the dosfit values from the
    command line arguments, and then update feff.inp & spring.inp
    and run "feff83", and finally collect the number of "WARNING"
    and the number of check0 values larger than 10%. You could just
    type "testcriwmaxdosfit -s 0.225 -c 0.1 -w 3.5 -d 0.1" or type
    "testcriwmaxdosfit -s0.225 -c0.1 -w3.5 -d0.1" or just type
    "testcriwmaxdosfit" or something in between. This utility is
    intended to be combined with the BASH for loop to get the
    impression of a series of combination of FEFF parameters.

  3. Run the program rmdegen to remove all degeneracies and set up the ComQum-EXAFS files.
    It will give you the two files comqum.dat and temp.iff.
    You need to have the control and coord file in each directory.
    The program may crash if you have ** in the file s2_em.dat. Remove them by hand.

  4. Modify the file comqum.dat file (sample file).
    You should check the atoms for which you want to calculate the gradients in the keyword $exafs_gradients (see below for an explanation); by default internal gradients are calculated for all paths shorter than 3.0 Å.
    You may change $weight_exafs and perhaps also $weight_qm.

    You man also turn on the double-sided gradients (increases the time by a factor 2 in the EXAFS calculations):
    $double_sided_gradient on
    Finally, you may change the step size for the numerical EXAFS gradients (although the default is normally OK):
    $g_step
     1.0D-6

  5. Set up the Turbomole geometry optimisation as usual (i.e. you can just copy the Turbomole files to the current directory)l.
    Always use internal or redundant coordinates (unless you will do a QM/MM calculation).

    For QM/MM-EXAFS, you need to copy the ComQum keywords from the old comqum.dat to the new one.

  6. You need the following files in your directory (or will links), besides the Turbomole files
    *chi
    feff*.dat
    comqum.dat
    temp.iff

    mkdir Gz
    mv * Gz
    cp Gz/*chi Gz/feff*.dat Gz/comqum.dat Gz/temp.iff .
    gzip Gz/*&

    or

    mkdir Cqe
    cp * Cqe
    cp Exafs/*chi Cqe
    cp Exafs/feff*.dat Cqe
    cp Exafs/
    comqum.dat Cqe
    cp Exafs/temp.iff Cqe
    rm Cqe/*inp


  7. If you intend to run with UFF, insert the following lines at the end of the control file:
    $uff
             1        -1          1 ! maxcycle,modus,nqeq
        111111                      ! iterm
      0.10D-07  0.10D-04            ! econv,gconv
          0.00  1.10                ! qtot,dfac
      0.10D+03  0.10D-04       0.30 ! epssteep,epssearch,dqmax
            25      0.10       0.00 ! mxls,dhls,ahls
          1.00      0.00       0.00 ! alpha,beta,gamma
             F         F          F ! transform,lnumhess,lm

    Change the yellow entry (qtot) so that it reflects the correct charge of the molecule.
    Then run
    uff>logu
    to get the topology file ufftopology.
    This file can now be modified before the program is run
    Finally change modus to 1 (marked in red).
    You can delete the alpha, beta, mos, auxbasis, and basis files and the corresponding keywords in control, but the $atoms keyword is still needed (for relax).

  8. It is normally wise to first run (in a separate directory)
    ridft>logd
    rdgrad>logg
    cqefixenergy>loge
    cqefixgrad>logi
    And then move to the original comqum.dat file
    $norm_scale
     0.67531351E-09 (or whatever)
    Otherwise, the first energy will be different from the following ones.

  9. Start ComQum-E by
    for QM+EXAFS
    jobexe -backup -ri -c 200
    or
    jobexe -backup -level uff -c 200
    or for QM/MM+EXAFS:
    comqume -backup -ri -c 200
    or
    comqume -backup -level uff -c 200

  10. When finished, the results are in the files energy (the first energy is the ComQum-EXAFS energy, the third is the Turbomole energy, and the fourth is chi_squared EXAFS energy) and exafse.out:
    $energy      SCF               SCFKIN            SCFPOT
         2 -4043.63646887853  4024.47271869400 -4043.63702859200 22325.04453929200
    You may remove the comment (#) before the (new)plot lines in the exafs.inp and run
    ifeffit -x exafs.inp to get the final plots (exafs.ps).

  11.  If you have problem with convergence, you may:
  1. Finally, you can remove unnecessary files by typing purtur and then gzip everything (make sure that you have backup copies of the inter*.chi and feff????.dat files, because they are deleted).


The following programs are needed for running comqume
(they are all in /away/bio/Exafs)

Current version 050425
The following utility programs can be used to set up the input

Ya-Wen's old utility programs (no longer needed):

Example of a comqum.dat file

$title
CuS2N2 complex, BP/RI, SVP, 7/4-05
$weight_exafs
 10000.0
$weight_qm
 1.0
$norm_scale
 0.25071102E-09
$exafs_gradients
 internal
 4
 1  2
 1  3
 1 27
 1 28
$g_step
 1.0D-4
$double_sided_gradient on
$exafs_paths
   256
    3    1    3                        1   1.9893000
    3    1   28                        1   1.9893000
    3    1    2                        1   2.2803000
    3    1   27                        1   2.2803000
    3    1   21                        1   2.9063000
    3    1   34                        1   2.9063000
...

    5    1    2    5   28              1   7.1367000
    5    1   27   42    3              1   7.1367000
    5    1    2    5    3              1   7.1367000
    5    1   27   42   28              1   7.1367000
$end


Alternative formats for $exafs_gradients:
  1. Cartesian
    Cartesian gradients in the three Cartesian directions (x, y, z)
    The list gives the atoms for which gradients should be calculated. It can include the absorber(s), but it is normally better to use it to correct the total sum of the forces, using the keyword correct (followed either by the atom to give the negative sum of the forces, or the number of atoms and (on the next line) a list of atoms to which the resultant (divided by #atoms)  should be added.
    $exafs_gradients
      cartesian
      4
      2  3   27   28
     correct
     1
     1

  2. Internal
    Internal gradients only along a bond.
    The two numbers are the absorber and the ligand.
    $exafs_gradients
     internal
     4
     1  2
     1  3
     1 27
     1 28
  3. Shell
    Internal gradients only along several bonds.
    The first number is the number of atoms in the shell.
    The second is the absorber.
    The final numbers are the ligand.
    The same internal gradient is added to all ligand atoms and the negative of their vector sum to the absorber in each shell.
    $exafs_gradients
      shell
     2
      2  1  2  3
      2  1 27 28
  4. Test
    Runs both shell and cartesian to check if cartesian is needed.
    The format is the same as for shell and the program decides itself for which atoms Cartesian gradients should be calculated.
    $exafs_gradients
      test
     4
      1  1  2
      1  1  3
      1  1 27
      1  1 28
Note that all atom numbers are in the order of the atoms in the control file (not in the feff.inp file).


Example of a temp.iff file

# This file was automatically generated by IffWtIn
# npath =   342 > 256
# Only 256 paths with amprat >     4.13 were included

log(exafs_grad.out)

read_data(../inter_rdb4.chi,type=raw,group=init)

kmin= 2.00,kmax=16.25,dk=2,kweight=3
rmin= 1.00,rmax= 6.00

fftf(init.2)

set s02 =    0.900
guess e0 = 2.

set del1   =    0.0000431
path(   1,feff=../feff0001.dat,s02=s02,e0=e0,sigma2=0.00494,delr=del1  ,degen= 1)

set del2   =    0.0000431
path(   2,feff=../feff0001.dat,s02=s02,e0=e0,sigma2=0.00494,delr=del2  ,degen= 1)

set del3   =   -0.0000367
path(   3,feff=../feff0002.dat,s02=s02,e0=e0,sigma2=0.00487,delr=del3  ,degen= 1)

set del4   =   -0.0000367
path(   4,feff=../feff0002.dat,s02=s02,e0=e0,sigma2=0.00487,delr=del4  ,degen= 1)

set del5   =    0.0000118
path(   5,feff=../feff0003.dat,s02=s02,e0=e0,sigma2=0.00803,delr=del5  ,degen= 1)

set del6   =    0.0000118
path(   6,feff=../feff0003.dat,s02=s02,e0=e0,sigma2=0.00803,delr=del6  ,degen= 1)

...

set del337 =   -0.5388783
path( 337,feff=../feff0098.dat,s02=s02,e0=e0,sigma2=0.02490,delr=del337,degen= 1)

set del338 =   -0.5388783
path( 338,feff=../feff0098.dat,s02=s02,e0=e0,sigma2=0.02490,delr=del338,degen= 1)


ff2chi(1-342,group=ff)

fftf(ff.chi)

feffit(chi=init.2,1-342,group=fit,kweight=3)

#newplot(device="/cps",init.r,init.chir_mag=7,,xmax=7,file="exafs.ps")
#plot(device="/cps",fit.r,fit.chir_mag,xmax=7)
#plot(charfont=2,device="/cps",title="Title")
#plot(charfont=2,device="/cps",xlabel="R(\A)",ylabel="FT Magnitude")
#newplot(init.r,init.chir_mag,xmax=7)
#plot(fit.r,fit.chir_mag,xmax=7)

show kmin, kmax, rmin, rmax
show @variables
show chi_square, chi_reduced, r_factor
show n_idp, &fit_iteration
log(close)

quit