Tutorial for using the ZPVC module in VIBRAV

The intention of this is to give you a guide on how to use the ZPVC module from vibrav.zpvc.zpvc.py to run the post-processing script. Prior to using this script you should have already extracted the gradients and the property values of interest from your own calculations.

Both the gradients and property values must be saved as a CSV file with column names. The row index is preffered, but if they are not available please set the INDEX_COL option in the configuration file to 0.

The gradient file must have the column names ['fx', 'fy', 'fz', 'atom', 'file']. The property file must have the column names ['atom', 'file', PCOL], where PCOL is the name of the column set in the configuration file as PROPERTY_COLUMN.

Import the ZPVC module and the resource function

[2]:
from vibrav.base import resource
from vibrav import ZPVC

Start load the ZPVC class and initialize the configuration file options

[3]:
zpvc = ZPVC(config_file=resource('nitromal-zpvc-va.conf'))

Contents of the resource configuration file

For this example we are using the resource files in VIBRAV. We are running the script over the 6 temperatures that are specified for atom index 0. If you wish to run it for more atoms or different atoms you can change the values as a space separated list.

[4]:
with open(resource('nitromal-zpvc-va.conf'), 'r') as fn:
    print(fn.read())
DELTA_FILE                    nitromal-zpvc-delta.dat.xz
SMATRIX_FILE                  nitromal-zpvc-smatrix.dat.xz
ATOM_ORDER_FILE               nitromal-zpvc-atom_order.dat.xz
REDUCED_MASS_FILE             nitromal-zpvc-redmass.dat.xz
FREQUENCY_FILE                nitromal-zpvc-freq.dat.xz
EQCOORD_FILE                  nitromal-zpvc-eqcoord.dat.xz
PROPERTY_FILE                 nitromal-zpvc-nmr.csv.xz
GRADIENT_FILE                 nitromal-zpvc-grad.csv.xz
NUMBER_OF_MODES               39
NUMBER_OF_NUCLEI              15
PROPERTY_ATOMS                0
PROPERTY_COLUMN               isotropic
USE_RESOURCE                  1
TEMPERATURE                   0 100 200 300 400 600

Run the ZPVC script

This will write output files to the zpvc-outputs directory. In there you would find the files - kqiii (Force constants) - kqijj (Anharmonic force constants) - results (Compact ZPVC result table) - vibrational-average (Verbose table with the contribution from each vibrational mode)

[5]:
zpvc.zpvc()

Compact ZPVC result table

[6]:
zpvc.zpvc_results
[6]:
property zpvc zpva tot_anharm tot_curva temp atom frame
0 13.932882 -2.887802 11.045080 -3.748377 0.860575 0.0 0 0
1 13.932882 -2.804743 11.128138 -3.678383 0.873640 100.0 0 1
2 13.932882 -2.648282 11.284599 -3.570384 0.922102 200.0 0 2
3 13.932882 -2.483916 11.448966 -3.475751 0.991835 300.0 0 3
4 13.932882 -2.313385 11.619497 -3.387663 1.074278 400.0 0 4
5 13.932882 -1.979968 11.952914 -3.245975 1.266007 600.0 0 5

Verbose table with the contribution from each vibrational mode

[7]:
zpvc.vib_average.groupby('frame').get_group(0)
[7]:
frequency num_frequency freqdx anharm curva sum temp atom frame
0 85.0284 85.571391 0 0.000000 0.007649 0.007649 0.0 0 0
1 89.3751 89.760862 1 -0.000000 -0.001816 -0.001816 0.0 0 0
2 146.1814 146.510047 2 -0.000000 0.022266 0.022266 0.0 0 0
3 217.6824 219.140605 3 -0.000000 0.001199 0.001199 0.0 0 0
4 320.8656 321.743460 4 -1.079300 0.076429 -1.002872 0.0 0 0
5 354.5547 354.832345 5 -0.171530 0.010393 -0.161137 0.0 0 0
6 401.8652 402.000544 6 0.000964 0.002991 0.003955 0.0 0 0
7 418.5204 422.712045 7 0.000000 -0.012716 -0.012716 0.0 0 0
8 425.1060 425.219670 8 -0.102758 0.009911 -0.092847 0.0 0 0
9 433.7701 437.743208 9 0.000000 -0.022071 -0.022071 0.0 0 0
10 461.1199 461.749783 10 -0.314054 0.074176 -0.239878 0.0 0 0
11 485.3209 485.295588 11 0.000522 0.003446 0.003968 0.0 0 0
12 609.5199 609.703735 12 -0.090530 0.009844 -0.080687 0.0 0 0
13 666.6248 667.988175 13 0.000000 -0.002926 -0.002926 0.0 0 0
14 685.1025 686.454375 14 -0.000000 -0.006440 -0.006440 0.0 0 0
15 703.9068 704.192029 15 -0.362860 0.028033 -0.334827 0.0 0 0
16 714.8914 721.796521 16 0.000000 0.002550 0.002550 0.0 0 0
17 725.8531 726.215692 17 0.000000 -0.005967 -0.005967 0.0 0 0
18 762.7554 763.192008 18 -0.000000 -0.005501 -0.005501 0.0 0 0
19 846.2045 846.453447 19 -0.003575 -0.000841 -0.004416 0.0 0 0
20 1075.3188 1075.611537 20 -0.018814 0.004701 -0.014112 0.0 0 0
21 1094.5938 1094.958031 21 -0.032282 0.005943 -0.026339 0.0 0 0
22 1107.2629 1107.158513 22 0.000000 0.046784 0.046784 0.0 0 0
23 1161.5631 1161.775254 23 -0.011198 0.002291 -0.008907 0.0 0 0
24 1174.0458 1174.253942 24 -0.020984 0.009741 -0.011243 0.0 0 0
25 1265.5979 1267.509984 25 -0.531411 0.183772 -0.347639 0.0 0 0
26 1316.6681 1317.803575 26 -0.003551 0.002776 -0.000775 0.0 0 0
27 1395.3206 1395.593777 27 -0.001487 0.003657 0.002170 0.0 0 0
28 1452.1272 1452.201891 28 -0.002516 -0.001166 -0.003682 0.0 0 0
29 1555.7496 1555.896942 29 0.000756 -0.000758 -0.000002 0.0 0 0
30 1575.8570 1575.960809 30 0.003893 -0.001330 0.002563 0.0 0 0
31 1598.3631 1598.402330 31 -0.003270 -0.012490 -0.015761 0.0 0 0
32 1631.1443 1631.812795 32 -0.039127 0.011868 -0.027259 0.0 0 0
33 1710.9460 1710.984060 33 -0.054030 0.009701 -0.044329 0.0 0 0
34 2255.7412 2264.139335 34 -0.906408 0.403475 -0.502933 0.0 0 0
35 3520.1806 3524.347173 35 -0.000387 0.000993 0.000606 0.0 0 0
36 3541.9146 3546.035369 36 -0.002419 -0.000220 -0.002639 0.0 0 0
37 3686.9440 3691.868870 37 -0.001406 0.000354 -0.001052 0.0 0 0
38 3696.3968 3701.247556 38 -0.000614 -0.000124 -0.000738 0.0 0 0

Effective coordinates for 0 K

[8]:
zpvc.eff_coord.groupby('frame').get_group(0)
[8]:
set Z x y z symbol temp frame
atom
0 0 1 0.343242 -2.168186 0.0 H 0.0 0
1 1 1 -3.122279 -1.159822 0.0 H 0.0 0
2 2 1 -2.603661 0.536159 0.0 H 0.0 0
3 3 1 3.307589 -0.342839 0.0 H 0.0 0
4 4 1 2.390190 1.172662 0.0 H 0.0 0
5 5 6 1.315911 -0.538146 0.0 C 0.0 0
6 6 8 1.403388 -1.824836 0.0 O 0.0 0
7 7 7 2.456096 0.168373 0.0 N 0.0 0
8 8 6 -0.009395 0.061711 0.0 C 0.0 0
9 9 6 -1.142284 -0.865999 0.0 C 0.0 0
10 10 8 -0.887831 -2.122312 0.0 O 0.0 0
11 11 7 -0.187867 1.468788 0.0 N 0.0 0
12 12 8 0.810723 2.219691 0.0 O 0.0 0
13 13 8 -1.342229 1.946239 0.0 O 0.0 0
14 14 7 -2.421288 -0.456714 0.0 N 0.0 0

Effective coordinates for 400 K

[9]:
zpvc.eff_coord.groupby('frame').get_group(4)
[9]:
set Z x y z symbol temp frame
atom
60 0 1 0.324546 -2.172974 0.0 H 400.0 4
61 1 1 -3.093186 -1.146095 0.0 H 400.0 4
62 2 1 -2.591836 0.517221 0.0 H 400.0 4
63 3 1 3.273432 -0.337080 0.0 H 400.0 4
64 4 1 2.379959 1.145908 0.0 H 400.0 4
65 5 6 1.314480 -0.537211 0.0 C 400.0 4
66 6 8 1.408057 -1.808342 0.0 O 400.0 4
67 7 7 2.441279 0.159619 0.0 N 400.0 4
68 8 6 -0.009746 0.058632 0.0 C 400.0 4
69 9 6 -1.138246 -0.862980 0.0 C 400.0 4
70 10 8 -0.893001 -2.113332 0.0 O 400.0 4
71 11 7 -0.188065 1.468863 0.0 N 400.0 4
72 12 8 0.788211 2.207521 0.0 O 400.0 4
73 13 8 -1.317471 1.944574 0.0 O 400.0 4
74 14 7 -2.408603 -0.459850 0.0 N 400.0 4
[ ]: