2.2 Preparing Qbox Input Files from the XYZ file with Displaced Coordinates

In the last step, we stored normal-mode displaced coordinates into a file named enmfd_phonon.xyz. Just like example 1.2, here we have to convert xyz file into single/multiple qbox input file(s) using xyz2qbox tool.

While computing the phonon frequencies, we would also compute the EPCEs and ZPR. Therefore we need to compute band energies of a few valence and conduction bands. For that purpose we need to include virtual orbitals by specifying a non-zero nempty values. We would also require to save wavefunctions of HOMOs and LUMOs for each displaced coordinates, which can be done using qbox plot command.

For CO2, HOMO is 2-fold degenerate and their orbital/band indices are 7 and 8, while LUMO is singly degenerate with band index 9.

[1]:
%run ../../../utils/qbox_utils/xyz2qbox.py enmfd_phonon.xyz
File enmfd_phonon.xyz has 3 number of atoms in each frame and a total 19 number of frames.
No of species: 2
Present species are: 
O_species
C_species
The file enmfd_phonon.xyz is an i-PI output with pos_unit: angstrom and cell_unit: angstrom
Enter start frame number: (Default = 1)
Enter last frame number: (Default = 19)
Enter step frame: (Default = 1)
Enter qbox command for 1st iteration: (Default = '  randomize_wf, run -atomic_density 0 100 10')
Hint: more than one commands should be separated by a comma.

Enter qbox run command: (Default = '  run 0 60 10')
Hint: more than one commands should be separated by a comma.

Enter qbox plot command: (Default = ' None')
Hints:
      (1) Example: plot options filename (without .cube extension)
      (2) More than one commands should be separated by a comma.
plot -wf 7 wf7, plot -wf 8 wf8, plot -wf 9 wf9
Enter qbox spectrum command: (Default = ' None')
Hints:
      (1) Example: spectrum options filename (without .dat extension)

Do you want to save sample for each configurations (y/n)? (Default = n)
Enter filename of qbox input: (Default = qbox.i) enmfd-1.i
Enter xc: (Default = PBE)B3LYP
Enter wf_dyn: (Default = JD)
Enter ecut (Ry): (Default = 50.0)
Enter scf_tol (Ry): (Default = 1e-08) 1e-12
Enter nempty: (Default = 100) 5
Enter nspin (1/2): (Default = 1)
Enter delta_spin: (Default = None)
Enter net_charge: (Default = 0)
Enter pseudopotential: (Default = ONCV_PBE-1.0)
Warning!
Files: 
O_ONCV_PBE-1.0.xml
C_ONCV_PBE-1.0.xml
must be present in the following pseudo-potential directory.
../pseudos/

This created a qbox input file with name enmfd-1.i. Just like example 1.2, here also multiple input file can be (must for a large system) created. For that purpose the bash wrapper many_xyz2qbox.sh located at util/qbox_util folder can be used instead of running xyz2qbox.py multiple times. Let us have a look at the qbox input file enmfd-1.i. Before that let us restart the kernel to finish the file writing.

[1]:
%%bash
cat enmfd-1.i
 set xc B3LYP
 set wf_dyn JD
 set ecut  50.00
 set scf_tol 1.00e-12
 species  O_species ../pseudos/O_ONCV_PBE-1.0.xml
 species  C_species ../pseudos/C_ONCV_PBE-1.0.xml
# Frame 1/19 from enmfd_phonon.xyz#
 set cell     20.000000     0.000000     0.000000     0.000000    20.000000     0.000000     0.000000     0.000000    20.000000
 atom   O1   O_species     0.000000       0.000000       2.186665
 atom   O2   O_species     0.000000       0.000000      -2.186662
 atom   C3   C_species     0.000000       0.000000      -0.000003
 set nempty    5
 randomize_wf
 run -atomic_density 0 100 10
plot -wf 7 wf7_frame-1.cube
 plot -wf 8 wf8_frame-1.cube
 plot -wf 9 wf9_frame-1.cube
# Frame 2/19 from enmfd_phonon.xyz#
 set cell     20.000000     0.000000     0.000000     0.000000    20.000000     0.000000     0.000000     0.000000    20.000000
 move   O1   to       -0.000000      -0.000000       2.475340
 move   O2   to       -0.000000      -0.000000      -1.897987
 move   C3   to       -0.000000      -0.000000       0.288672
 run 0 60 10
plot -wf 7 wf7_frame-2.cube
 plot -wf 8 wf8_frame-2.cube
 plot -wf 9 wf9_frame-2.cube
# Frame 3/19 from enmfd_phonon.xyz#
 set cell     20.000000     0.000000     0.000000     0.000000    20.000000     0.000000     0.000000     0.000000    20.000000
 move   O1   to        0.000000       0.000000       1.897990
 move   O2   to        0.000000       0.000000      -2.475337
 move   C3   to        0.000000       0.000000      -0.288678
 run 0 60 10
plot -wf 7 wf7_frame-3.cube
 plot -wf 8 wf8_frame-3.cube
 plot -wf 9 wf9_frame-3.cube
# Frame 4/19 from enmfd_phonon.xyz#
 set cell     20.000000     0.000000     0.000000     0.000000    20.000000     0.000000     0.000000     0.000000    20.000000
 move   O1   to        0.000000       0.448620       2.186665
 move   O2   to       -0.000001      -0.172131      -2.186662
 move   C3   to       -0.000000       0.138244      -0.000003
 run 0 60 10
plot -wf 7 wf7_frame-4.cube
 plot -wf 8 wf8_frame-4.cube
 plot -wf 9 wf9_frame-4.cube
# Frame 5/19 from enmfd_phonon.xyz#
 set cell     20.000000     0.000000     0.000000     0.000000    20.000000     0.000000     0.000000     0.000000    20.000000
 move   O1   to       -0.000000      -0.448620       2.186665
 move   O2   to        0.000001       0.172131      -2.186662
 move   C3   to        0.000000      -0.138244      -0.000003
 run 0 60 10
plot -wf 7 wf7_frame-5.cube
 plot -wf 8 wf8_frame-5.cube
 plot -wf 9 wf9_frame-5.cube
# Frame 6/19 from enmfd_phonon.xyz#
 set cell     20.000000     0.000000     0.000000     0.000000    20.000000     0.000000     0.000000     0.000000    20.000000
 move   O1   to        0.352008      -0.000001       2.186665
 move   O2   to       -0.355089       0.000000      -2.186662
 move   C3   to       -0.001542      -0.000000      -0.000003
 run 0 60 10
plot -wf 7 wf7_frame-6.cube
 plot -wf 8 wf8_frame-6.cube
 plot -wf 9 wf9_frame-6.cube
# Frame 7/19 from enmfd_phonon.xyz#
 set cell     20.000000     0.000000     0.000000     0.000000    20.000000     0.000000     0.000000     0.000000    20.000000
 move   O1   to       -0.352008       0.000001       2.186665
 move   O2   to        0.355089      -0.000000      -2.186662
 move   C3   to        0.001542       0.000000      -0.000003
 run 0 60 10
plot -wf 7 wf7_frame-7.cube
 plot -wf 8 wf8_frame-7.cube
 plot -wf 9 wf9_frame-7.cube
# Frame 8/19 from enmfd_phonon.xyz#
 set cell     20.000000     0.000000     0.000000     0.000000    20.000000     0.000000     0.000000     0.000000    20.000000
 move   O1   to       -0.290402      -0.000001       2.186665
 move   O2   to       -0.286941       0.000001      -2.186662
 move   C3   to       -0.288672      -0.000000      -0.000003
 run 0 60 10
plot -wf 7 wf7_frame-8.cube
 plot -wf 8 wf8_frame-8.cube
 plot -wf 9 wf9_frame-8.cube
# Frame 9/19 from enmfd_phonon.xyz#
 set cell     20.000000     0.000000     0.000000     0.000000    20.000000     0.000000     0.000000     0.000000    20.000000
 move   O1   to        0.290402       0.000001       2.186665
 move   O2   to        0.286941      -0.000001      -2.186662
 move   C3   to        0.288672       0.000000      -0.000003
 run 0 60 10
plot -wf 7 wf7_frame-9.cube
 plot -wf 8 wf8_frame-9.cube
 plot -wf 9 wf9_frame-9.cube
# Frame 10/19 from enmfd_phonon.xyz#
 set cell     20.000000     0.000000     0.000000     0.000000    20.000000     0.000000     0.000000     0.000000    20.000000
 move   O1   to       -0.000000      -0.100021       2.186665
 move   O2   to        0.000000      -0.416340      -2.186662
 move   C3   to       -0.000000      -0.258181      -0.000003
 run 0 60 10
plot -wf 7 wf7_frame-10.cube
 plot -wf 8 wf8_frame-10.cube
 plot -wf 9 wf9_frame-10.cube
# Frame 11/19 from enmfd_phonon.xyz#
 set cell     20.000000     0.000000     0.000000     0.000000    20.000000     0.000000     0.000000     0.000000    20.000000
 move   O1   to        0.000000       0.100021       2.186665
 move   O2   to       -0.000000       0.416340      -2.186662
 move   C3   to        0.000000       0.258181      -0.000003
 run 0 60 10
plot -wf 7 wf7_frame-11.cube
 plot -wf 8 wf8_frame-11.cube
 plot -wf 9 wf9_frame-11.cube
# Frame 12/19 from enmfd_phonon.xyz#
 set cell     20.000000     0.000000     0.000000     0.000000    20.000000     0.000000     0.000000     0.000000    20.000000
 move   O1   to        0.031448       0.010314       2.186665
 move   O2   to        0.031448       0.010314      -2.186662
 move   C3   to       -0.083784      -0.027478      -0.000003
 run 0 60 10
plot -wf 7 wf7_frame-12.cube
 plot -wf 8 wf8_frame-12.cube
 plot -wf 9 wf9_frame-12.cube
# Frame 13/19 from enmfd_phonon.xyz#
 set cell     20.000000     0.000000     0.000000     0.000000    20.000000     0.000000     0.000000     0.000000    20.000000
 move   O1   to       -0.031448      -0.010314       2.186665
 move   O2   to       -0.031448      -0.010314      -2.186662
 move   C3   to        0.083784       0.027478      -0.000003
 run 0 60 10
plot -wf 7 wf7_frame-13.cube
 plot -wf 8 wf8_frame-13.cube
 plot -wf 9 wf9_frame-13.cube
# Frame 14/19 from enmfd_phonon.xyz#
 set cell     20.000000     0.000000     0.000000     0.000000    20.000000     0.000000     0.000000     0.000000    20.000000
 move   O1   to        0.010314      -0.031448       2.186665
 move   O2   to        0.010314      -0.031448      -2.186662
 move   C3   to       -0.027478       0.083784      -0.000003
 run 0 60 10
plot -wf 7 wf7_frame-14.cube
 plot -wf 8 wf8_frame-14.cube
 plot -wf 9 wf9_frame-14.cube
# Frame 15/19 from enmfd_phonon.xyz#
 set cell     20.000000     0.000000     0.000000     0.000000    20.000000     0.000000     0.000000     0.000000    20.000000
 move   O1   to       -0.010314       0.031448       2.186665
 move   O2   to       -0.010314       0.031448      -2.186662
 move   C3   to        0.027478      -0.083784      -0.000003
 run 0 60 10
plot -wf 7 wf7_frame-15.cube
 plot -wf 8 wf8_frame-15.cube
 plot -wf 9 wf9_frame-15.cube
# Frame 16/19 from enmfd_phonon.xyz#
 set cell     20.000000     0.000000     0.000000     0.000000    20.000000     0.000000     0.000000     0.000000    20.000000
 move   O1   to        0.000000       0.000000       2.216857
 move   O2   to        0.000000       0.000000      -2.216853
 move   C3   to       -0.000000      -0.000000      -0.000004
 run 0 60 10
plot -wf 7 wf7_frame-16.cube
 plot -wf 8 wf8_frame-16.cube
 plot -wf 9 wf9_frame-16.cube
# Frame 17/19 from enmfd_phonon.xyz#
 set cell     20.000000     0.000000     0.000000     0.000000    20.000000     0.000000     0.000000     0.000000    20.000000
 move   O1   to       -0.000000      -0.000000       2.156473
 move   O2   to       -0.000000      -0.000000      -2.156471
 move   C3   to        0.000000       0.000000      -0.000002
 run 0 60 10
plot -wf 7 wf7_frame-17.cube
 plot -wf 8 wf8_frame-17.cube
 plot -wf 9 wf9_frame-17.cube
# Frame 18/19 from enmfd_phonon.xyz#
 set cell     20.000000     0.000000     0.000000     0.000000    20.000000     0.000000     0.000000     0.000000    20.000000
 move   O1   to       -0.000000       0.000000       2.195700
 move   O2   to       -0.000000       0.000000      -2.177627
 move   C3   to        0.000000      -0.000000      -0.024074
 run 0 60 10
plot -wf 7 wf7_frame-18.cube
 plot -wf 8 wf8_frame-18.cube
 plot -wf 9 wf9_frame-18.cube
# Frame 19/19 from enmfd_phonon.xyz#
 set cell     20.000000     0.000000     0.000000     0.000000    20.000000     0.000000     0.000000     0.000000    20.000000
 move   O1   to        0.000000      -0.000000       2.177630
 move   O2   to        0.000000      -0.000000      -2.195697
 move   C3   to       -0.000000       0.000000       0.024068
 run 0 60 10
plot -wf 7 wf7_frame-19.cube
 plot -wf 8 wf8_frame-19.cube
 plot -wf 9 wf9_frame-19.cube

The next step is to submit those jobs and wait until all calculations finished properly. Once the calculations are finished, the obox outputs must be post-processed to compute the dynamical matrix. This will be the topic of exercise 1.2.3.

[ ]: