mini

mini mini petite souris



This C-program optimises (minimum or TS) variables (can be a geometry or something else) by calling a "script" (you have to make it! So it can be linked to any program!).
It can also calculate gradient, hessian matrix, frequencies.

In the commands the upper or lower case doesn't matter. However, it can be important in the variable names.

It has a restart capability.

All commands finish by an 'end'.

You have to separate words (numbers) by at least one blank space.

list of commands.

some examples.


download a copy of mini mini.tar.gz
uncompress and compile it.


gunzip mini.tar.gz
tar xvf mini.tar
cd mini
make

There are more examples in mini/examples


a small example: optimisation of water with molpro.

data
  R = 2. bohr 1
  A = 109. degree -1
end

The program minimises R (1) end maximises A (-1). You should get the linear transition state.

However, you need a script to link mini to molpro (const, the script name by default).
It must be executable. So you should use this command 'chmod u+x const' in unix.


#!/bin/ksh

echo "***,HOH sto-3g RHF
">x.inpm
cat geom>>x.inpm
echo "zmat,noorient
O1
H2,O1,R
H3,O1,R,H2,A
endz
basis=sto-3g
 int
 hf
 ">>x.inpm

 molpro.run x
grep "SCF STATE 1.1 ENERGY" x.outm|awk '{print $5}'>energ
grep "NO CONVERGE" x.outm|awk '{print 0}'>>energ
echo 1 >> energ

The variables are put in the file 'geom', and the program reads the energy in the file 'energ'.

The first part of the scrip generates an input file for molpro (until the last >> x.inpm). It's mostly the input file of molpro.

molpro.run x : execution of molpro.

extraction of the energy of the output file (x.outm, here) and add a flag (0 or 1) for the convergence.

you get:


data

 R = 2.000000000000 bohr 1
 A = 109.000000000000 degree -1




opt = 1
hess = 0
grad = 0
ene = 2
 R = 1.762380589233 bohr 1
 A = 179.999982248148 degree -1

 energie = -74.852480660000




List of commands:



examples:

  1. example: optimisation and frequencies of Cl-O
  2. example: optimisation and frequencies of H2O
  3. example: optimisation and hessian of H2O


  1. data: optimisation and frequencies of Cl-O
    fichiers
      const = const_AB
    end
    controle
      test_opt = 1
      test_ene = 0
      test_grad = 0
      test_hess = 2
      test_freq = 1
    end
    data
    x1 =  0.000000000 bohr 0
    y1 =  0.000000000 bohr 0
    z1 =  0.000000000 bohr 0
    x2 =  0.000000000 bohr 0
    y2 =  0.000000000 bohr 0
    z2 =  2.970000000 bohr 1
    end
    param
      deriv = 0.005
      conv_energie = 5.e-6
      conv_deplace = 5.e-5
      max_deplace =  0.1
    end
    masses
    15.994915
    34.968853
    end
         
    script: const_AB
    #!/bin/ksh
    
    awk '{t[NR]=$3}
    END {
    #
    Req=2.9725
    k=0.305573
    #
    #for (i=1;i<7;i++) print t[i]
     x=t[1]-t[4]
     y=t[2]-t[5]
     z=t[3]-t[6]
     r=sqrt(x*x+y*y+z*z)
     print 0.5*k*(r-Req)*(r-Req)
    }' geom >energ
    
    echo 1 >>energ
         

  2. data: optimisation and frequencies of H2O
    fichiers
      const = const_h2o_cart
    end
    controle
      test_opt = 1
      test_ene = 0
      test_grad = 0
      test_hess = 2
      test_freq = 1
    end
    cart
        na = 3
        prog = gamess
        bohr = t
        convert = f
        opt =
              0 0 0
              1 0 1
              1 0 1
    end
     O           8.0     0.0000000000        0.0000000000       -0.1344680200
     H           1.0     1.4326043750        0.0000000000        1.0670525220
     H           1.0    -1.4326043750        0.0000000000        1.0670525220
    param
      deriv = 0.01
      conv_energie = 1.e-4
      conv_deplace = 1.e-3
      max_deplace =  0.1
    end
         
    script: const_h2o_cart

    you can use one of these 2 scripts:
    - the first one use nawk unix command (or gawk). I you don't have it, use the second one.
    - the second use another program: cart.

    The hessian matrix (3*3) has been calculated in example 3.

    first script

    #!/bin/ksh
    
    
    nawk '{t[NR]=$3}
    END {
    
    # vector 1 (OH_1)
    vx1=t[1]-t[4]
    vy1=t[2]-t[5]
    vz1=t[3]-t[6]
    d1=sqrt(vx1*vx1+vy1*vy1+vz1*vz1)
    
    # vector 1 (OH_2)
    vx2=t[1]-t[7]
    vy2=t[2]-t[8]
    vz2=t[3]-t[9]
    d2=sqrt(vx2*vx2+vy2*vy2+vz2*vz2)
    
    #angle HOH
    c=(vx1*vx2+vy1*vy2+vz1*vz2)/(d1*d2)
    s=sqrt(1.0-c*c)
    angle=atan2(s,c)
    
    #print d1" "d2" "angle
    
    #hessian3*3
    h11=0.65407272
    h22=0.65407580
    h33=0.29688606
    
    h12=-0.03064230
    h13=0.03770003
    h23=0.03769997
    
    #energy (harmonic)
    r0=1.8697612
    a0=1.7458023
    
    r1=d1-r0
    r2=d2-r0
    a1=angle-a0
    
    e = 0.5*( r1*r1*h11 + r2*r2*h22 + a1*a1*h33)
    e = e + ( r1*r2*h12 + r1*a1*h13 + r2*a1*h23)
    print e
    }' geom >energ
    
    echo 1 >> energ
    

    second script

    #!/bin/ksh
    
    echo " \$lect na=3 prog='g92' convert=.false. \$end" >dat
    
    awk '{t[NR]=$3}
    END {
    print " 1 8 "t[1]" "t[2]" "t[3]
    print " 2 1 "t[4]" "t[5]" "t[6]
    print " 2 1 "t[7]" "t[8]" "t[9]}' geom >>dat
    
    
    echo " \$oper \$end
    
     \$zmat nb=3 \$end
    1
    2 1
    3 1 2
     \$fiop
     \$fini" >> dat
    
    cart geom1
    
    
    awk '{t[NR]=$2}
    END {
    
    h11=0.65407272
    h22=0.65407580
    h33=0.29688606
    
    h12=-0.03064230
    h13=0.03770003
    h23=0.03769997
    
    r0=1.8697612
    a0=1.7458023
    
    r1=t[1]-r0
    r2=t[2]-r0
    a1=t[3]*0.0174553292-a0
    
    e = 0.5*( r1*r1*h11 + r2*r2*h22 + a1*a1*h33)
    e = e + ( r1*r2*h12 + r1*a1*h13 + r2*a1*h23)
    print e
    }' geom1 >energ
    
    echo 1 >> energ
         

  3. data: optimisation of H2O and hessian matrix.
    fichiers
     const = const_h2o_h33
    end
    controle
      test_opt = 0
      i_ts_min = 0
      test_hess = 2
      test_freq = 0
    end
    data
      R1 = 2. bohr 1
      R2 = 2. bohr 1
      A  = 109. degree 1
    end
    param
      deriv = 0.01
      conv_energie = 1.e-6
      conv_deplace = 1.e-4
      max_deplace =  0.1
    end
         
    script: const_h2o_h33
    echo "***,HOH sto-3g RHF
    memory,0.5,m
    ">x.inpm
    cat geom>>x.inpm
    echo "zmat,nosym,noorient
    O1
    H2,O1,R1
    H3,O1,R2,H2,A
    endz
    basis=sto-3g
     int
     hf
    
    show[1,f25.15],energy
    
     ">>x.inpm
    
     molpro.run x
    grep "ENERGY / AU" x.outm|awk '{print $5}'>energ
    grep "NO CONVERGE" x.outm|awk '{print 0}'>>energ
    echo 1 >> energ
         


Background: Ptiluc ici (in French)