Оптимизация структуры с помощью firefly

1. Подготовим молекулу этана:

In [4]:
%%bash
cd ~/Term8/Pr12/
echo "CC" > ethane.smi
obgen ethane.smi > ethane.mol 2> /dev/null

2. Построим Z-матрицу:

In [5]:
%%bash
babel -imol ethane.mol -ogzmat ethane.zmat
1 molecule converted
22 audit log messages 

3. Построим input-файл для firefly

exetyp=check (проверка корректности входного файла)
$data - полученная Z-матрица
In [6]:
%%bash
cat ethane0.inp
 $contrl runtyp=optimize exetyp=check scftyp=ROHF DFTTYP=B3LYP5 
         icharg=0 mult=0 coord=zmt nzvar=0
 $end
 $basis gbasis=n31 ngauss=6 npfunc=1 ndfunc=1 $end
!npfunc=1 ndfunc=1 diffsp=.t. $end
 $SCF FDIFF=.f. DIIS=.f. DIRSCF=.f. npunch=2 $END
 $guess guess=huckel $end

 $p2p p2p=.t. dlb=.t. $end
 $smp csmtx=.t. call64=.t. $end

 $data
 Ethane
C1
C
C  1  r2
H  1  r3  2  a3
H  1  r4  2  a4  3  d4
H  1  r5  2  a5  3  d5
H  2  r6  1  a6  3  d6
H  2  r7  1  a7  3  d7
H  2  r8  1  a8  3  d8

r2= 1.5120
r3= 1.0939
a3= 110.58
r4= 1.0949
a4= 110.52
d4= 240.05
r5= 1.0935
a5= 110.61
d5= 120.07
r6= 1.0936
a6= 110.61
d6=  59.93
r7= 1.0949
a7= 110.52
d7= 299.95
r8= 1.0938
a8= 110.58
d8= 180.03
 $end

Проверим корректность входного файла:

In [7]:
%%bash
/Z/local/bin/pcgamess2.py -n 2 -i ethane0.inp -o ethane0.check 
tail -1 ethane0.check
 EXECUTION OF FIREFLY TERMINATED NORMALLY 13:14:15 30-APR-2015    

4. Запустим оптимизацию (exetyp=run)

In [8]:
%%bash
/Z/local/bin/pcgamess2.py -n 2 -i ethane0.inp -o ethane0.gms
tail -1 ethane0.gms
 EXECUTION OF FIREFLY TERMINATED NORMALLY 13:35:42 30-APR-2015    

Посмотрим на полученные в процессе энергии:

In [9]:
%%bash
grep "FINAL" ethane0.gms
 FINAL ENERGY IS      -79.7730658153 AFTER  20 ITERATIONS
 FINAL ENERGY IS      -79.7732141839 AFTER   8 ITERATIONS
 FINAL ENERGY IS      -79.7734143028 AFTER  13 ITERATIONS
 FINAL ENERGY IS      -79.7735144647 AFTER  11 ITERATIONS
 FINAL ENERGY IS      -79.7735183270 AFTER   7 ITERATIONS
 FINAL ENERGY IS      -79.7735322080 AFTER   7 ITERATIONS
 FINAL ENERGY IS      -79.7735322554 AFTER  10 ITERATIONS

5. Построим входной файл для оптимизации во внутренних координатах

$data - финальные координаты из предыдущего прогона

$zmat - внутренние координаты (связи, плоские и двугранные углы)

In [10]:
%%bash
cat ethane1.inp
 $contrl runtyp=optimize exetyp=run scftyp=ROHF DFTTYP=B3LYP5 
         icharg=0 mult=0 nzvar=0
 $end
 $basis gbasis=n31 ngauss=6 npfunc=1 ndfunc=1 $end
!npfunc=1 ndfunc=1 diffsp=.t. $end
 $SCF FDIFF=.f. DIIS=.f. DIRSCF=.f. npunch=2 $END
 $guess guess=huckel $end
 $statpt opttol=0.000001 $end

 $zmat 
    izmat(1)=
1,  2, 1,
1,  3, 1,
1,  4, 1,
1,  5, 1,
1,  6, 2,
1,  7, 2,
1,  8, 2,
2,  3, 1,  2,
2,  4, 1,  2,
2,  5, 1,  2,
2,  6, 2,  1,
2,  7, 2,  1,
2,  8, 2,  1,
3,  4, 1,  2,  3,
3,  5, 1,  2,  3,
3,  6, 2,  1,  3,
3,  7, 2,  1,  3,
3,  8, 2,  1,  3
 $end

 $p2p p2p=.t. dlb=.t. $end
 $smp csmtx=.t. call64=.t. $end

 $data
 Ethane
C1
 C           6.0  -0.7652092059  -0.0003132738   0.0001042415
 C           6.0   0.7652094527   0.0004112639  -0.0001206562
 H           1.0  -1.1646556069   0.5294240151   0.8717167955
 H           1.0  -1.1641261738  -1.0202048789   0.0233397494
 H           1.0  -1.1649124618   0.4893662945  -0.8944943917
 H           1.0   1.1649370290  -0.4894190555   0.8943657507
 H           1.0   1.1641081601   1.0203106478  -0.0231833866
 H           1.0   1.1646489369  -0.5292369317  -0.8718129464
 $end

Запустим оптимизацию

In [12]:
%%bash
/Z/local/bin/pcgamess2.py -n 2 -i ethane1.inp -o ethane1.gms
tail -1 ethane1.gms
grep "FINAL" ethane1.gms
 EXECUTION OF FIREFLY TERMINATED NORMALLY 14:00:41 30-APR-2015    
 FINAL ENERGY IS      -79.7735322556 AFTER  22 ITERATIONS
 FINAL ENERGY IS      -79.7735322557 AFTER   3 ITERATIONS
 FINAL ENERGY IS      -79.7735322566 AFTER   3 ITERATIONS
 FINAL ENERGY IS      -79.7735322567 AFTER   2 ITERATIONS
 FINAL ENERGY IS      -79.7735322567 AFTER   2 ITERATIONS
 FINAL ENERGY IS      -79.7735322567 AFTER   2 ITERATIONS

6. Построим входной файл для рассчета гессиана

runtyp=hessian
$data - финальные координаты из предыдущего прогона
In [13]:
%%bash
cat ethane2.inp
 $contrl runtyp=hessian exetyp=run scftyp=ROHF DFTTYP=B3LYP5 
         icharg=0 mult=0 nzvar=0
 $end
 $basis gbasis=n31 ngauss=6 npfunc=1 ndfunc=1 $end
!npfunc=1 ndfunc=1 diffsp=.t. $end
 $SCF FDIFF=.f. DIIS=.f. DIRSCF=.f. npunch=2 $END
 $guess guess=huckel $end
 $statpt opttol=0.000001 $end

 $zmat 
    izmat(1)=
1,  2, 1,
1,  3, 1,
1,  4, 1,
1,  5, 1,
1,  6, 2,
1,  7, 2,
1,  8, 2,
2,  3, 1,  2,
2,  4, 1,  2,
2,  5, 1,  2,
2,  6, 2,  1,
2,  7, 2,  1,
2,  8, 2,  1,
3,  4, 1,  2,  3,
3,  5, 1,  2,  3,
3,  6, 2,  1,  3,
3,  7, 2,  1,  3,
3,  8, 2,  1,  3
 $end

 $p2p p2p=.t. dlb=.t. $end
 $smp csmtx=.t. call64=.t. $end

 $data
 Ethane
C1
 C           6.0  -0.7652080177  -0.0003210355   0.0001079270
 C           6.0   0.7652080480   0.0004029996  -0.0001256248
 H           1.0  -1.1646482761   0.5294296830   0.8717129147
 H           1.0  -1.1641285868  -1.0202162121   0.0233253084
 H           1.0  -1.1649214233   0.4893705074  -0.8944842124
 H           1.0   1.1649319746  -0.4894151339   0.8943929811
 H           1.0   1.1641224613   1.0203031495  -0.0232011458
 H           1.0   1.1646439503  -0.5292158767  -0.8718129921
 $end

Запустим оптимизацию

In [14]:
%%bash
#/Z/local/bin/pcgamess2.py -n 2 -i ethane2.inp -o ethane2.log
tail -1 ethane2.log
grep "FINAL" ethane2.log
 EXECUTION OF FIREFLY TERMINATED NORMALLY 14:08:38 30-APR-2015    
 FINAL ENERGY IS      -79.7735322565 AFTER  22 ITERATIONS
 FINAL ENERGY IS      -79.7735082862 AFTER   7 ITERATIONS
 FINAL ENERGY IS      -79.7735039294 AFTER   6 ITERATIONS
 FINAL ENERGY IS      -79.7735037892 AFTER   6 ITERATIONS
 FINAL ENERGY IS      -79.7735086114 AFTER   7 ITERATIONS
 FINAL ENERGY IS      -79.7735035665 AFTER   6 ITERATIONS
 FINAL ENERGY IS      -79.7735036984 AFTER   6 ITERATIONS
 FINAL ENERGY IS      -79.7735278476 AFTER   7 ITERATIONS
 FINAL ENERGY IS      -79.7735264715 AFTER   7 ITERATIONS
 FINAL ENERGY IS      -79.7735206989 AFTER  10 ITERATIONS
 FINAL ENERGY IS      -79.7735278587 AFTER   7 ITERATIONS
 FINAL ENERGY IS      -79.7735170712 AFTER  11 ITERATIONS
 FINAL ENERGY IS      -79.7735298912 AFTER   5 ITERATIONS
 FINAL ENERGY IS      -79.7735278381 AFTER   7 ITERATIONS
 FINAL ENERGY IS      -79.7735269620 AFTER   7 ITERATIONS
 FINAL ENERGY IS      -79.7735200520 AFTER  10 ITERATIONS
 FINAL ENERGY IS      -79.7735278243 AFTER   7 ITERATIONS
 FINAL ENERGY IS      -79.7735269791 AFTER   7 ITERATIONS
 FINAL ENERGY IS      -79.7735202143 AFTER  10 ITERATIONS
 FINAL ENERGY IS      -79.7735278473 AFTER   7 ITERATIONS
 FINAL ENERGY IS      -79.7735173335 AFTER  11 ITERATIONS
 FINAL ENERGY IS      -79.7735298713 AFTER   5 ITERATIONS
 FINAL ENERGY IS      -79.7735278240 AFTER   7 ITERATIONS
 FINAL ENERGY IS      -79.7735264551 AFTER   7 ITERATIONS
 FINAL ENERGY IS      -79.7735205519 AFTER  10 ITERATIONS

Проверим гессиан на мнимые частоты:

In [15]:
%%bash
grep FREQUENCY ethane2.log
       FREQUENCY:        32.22       13.20       12.89       12.56       12.24  
       FREQUENCY:         8.81      313.41      826.07      827.29     1004.98  
       FREQUENCY:      1224.74     1225.51     1416.96     1439.34     1515.60  
       FREQUENCY:      1516.15     1520.46     1521.15     3031.09     3042.20  
       FREQUENCY:      3088.20     3095.77     3119.74     3124.03  

Мнимых частот нет.