1.1.2 Preparing Qbox Input Files from the XYZ file with Displaced Coordinates
In the last step we obtained an xyz file containing all displaced coordinates. Now we would create single/multiple qbox input files. Each input files can be submitted as separate jobs to harness the many available nodes. For this example we would divide them into two jobs, the first one with 10 configurations and 2nd one with 9 configurations. To convert xyz files into qbox inputs we would use xyz2qbox tool which is available within util/qbox_tools folder of the pyepfd distribution. The xyz2qbox is a command-line tool that asks several questions (for example functional, ecuts, pseudopotentials etc.) using prompts and user has to answer them.
[1]:
%run ../../../utils/qbox_utils/xyz2qb.py fd_phonon.xyz
File fd_phonon.xyz has 3 number of atoms in each frame and a total 19 number of frames.
No of species: 2
Present species are:
C_species
O_species
The file fd_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) 10
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.
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) fd-1.i
Enter xc: (Default = PBE)B3LYP
Enter wf_dyn: (Default = JD) PSDA
Enter ecut (Ry): (Default = 50.0)
Enter scf_tol (Ry): (Default = 1e-08) 1e-12
Enter nempty: (Default = 100) 0
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:
C_ONCV_PBE-1.0.xml
O_ONCV_PBE-1.0.xml
must be present in the following pseudo-potential directory.
../pseudos/
This created a qbox input file named fd-1.i with 10 displacements. Now we similarly create another input file starting from frame 11 up to frame 19. This coul be run many times to create several input file using the bash wrapper named many_xyz2qb.sh that can be found at util/qbox_util folder. In the bash script all the default options must be set accordingly.
[4]:
quit
[1]:
%%bash
cat fd-1.i
set xc B3LYP
set wf_dyn PSDA
set ecut 50.00
set scf_tol 1.00e-12
species C_species ../pseudos/C_ONCV_PBE-1.0.xml
species O_species ../pseudos/O_ONCV_PBE-1.0.xml
# Frame 1/19 from fd_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.186664
atom O2 O_species 0.000000 0.000000 -2.186661
atom C3 C_species 0.000000 0.000000 -0.000003
randomize_wf
run -atomic_density 0 100 10
# Frame 2/19 from fd_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.005000 0.000000 2.186664
move O2 to 0.000000 0.000000 -2.186661
move C3 to 0.000000 0.000000 -0.000003
run 0 60 10
# Frame 3/19 from fd_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.005000 0.000000 2.186664
move O2 to 0.000000 0.000000 -2.186661
move C3 to 0.000000 0.000000 -0.000003
run 0 60 10
# Frame 4/19 from fd_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.005000 2.186664
move O2 to 0.000000 0.000000 -2.186661
move C3 to 0.000000 0.000000 -0.000003
run 0 60 10
# Frame 5/19 from fd_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.005000 2.186664
move O2 to 0.000000 0.000000 -2.186661
move C3 to 0.000000 0.000000 -0.000003
run 0 60 10
# Frame 6/19 from fd_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.191664
move O2 to 0.000000 0.000000 -2.186661
move C3 to 0.000000 0.000000 -0.000003
run 0 60 10
# Frame 7/19 from fd_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.181664
move O2 to 0.000000 0.000000 -2.186661
move C3 to 0.000000 0.000000 -0.000003
run 0 60 10
# Frame 8/19 from fd_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.186664
move O2 to 0.005000 0.000000 -2.186661
move C3 to 0.000000 0.000000 -0.000003
run 0 60 10
# Frame 9/19 from fd_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.186664
move O2 to -0.005000 0.000000 -2.186661
move C3 to 0.000000 0.000000 -0.000003
run 0 60 10
# Frame 10/19 from fd_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.186664
move O2 to 0.000000 0.005000 -2.186661
move C3 to 0.000000 0.000000 -0.000003
run 0 60 10
[2]:
%run ../../../utils/qbox_utils/xyz2qb.py fd_phonon.xyz
File fd_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 fd_phonon.xyz is an i-PI output with pos_unit: angstrom and cell_unit: angstrom
Enter start frame number: (Default = 1) 11
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.
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) fd-2.i
Enter xc: (Default = PBE)B3LYP
Enter wf_dyn: (Default = JD) PSDA
Enter ecut (Ry): (Default = 50.0)
Enter scf_tol (Ry): (Default = 1e-08) 1e-12
Enter nempty: (Default = 100) 0
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/
Remember to use the same prefix for each qbox job, i.e., the jobs names should be fd-1.i, fd-2.i, fd-3.i, ….. and the qbox outputs would be fd-1.r, fd-2.r, fd-3.r, … and so on. The next step is to submit those jobs and wait until all calculations finished properly.
[3]:
quit
[1]:
%%bash
cat fd-2.i
set xc B3LYP
set wf_dyn PSDA
set ecut 50.00
set scf_tol 1.00e-12
species C_species ../pseudos/C_ONCV_PBE-1.0.xml
species O_species ../pseudos/O_ONCV_PBE-1.0.xml
# Frame 11/19 from fd_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.186664
atom O2 O_species 0.000000 -0.005000 -2.186661
atom C3 C_species 0.000000 0.000000 -0.000003
randomize_wf
run -atomic_density 0 100 10
# Frame 12/19 from fd_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.186664
move O2 to 0.000000 0.000000 -2.181661
move C3 to 0.000000 0.000000 -0.000003
run 0 60 10
# Frame 13/19 from fd_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.186664
move O2 to 0.000000 0.000000 -2.191661
move C3 to 0.000000 0.000000 -0.000003
run 0 60 10
# Frame 14/19 from fd_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.186664
move O2 to 0.000000 0.000000 -2.186661
move C3 to 0.005000 0.000000 -0.000003
run 0 60 10
# Frame 15/19 from fd_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.186664
move O2 to 0.000000 0.000000 -2.186661
move C3 to -0.005000 0.000000 -0.000003
run 0 60 10
# Frame 16/19 from fd_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.186664
move O2 to 0.000000 0.000000 -2.186661
move C3 to 0.000000 0.005000 -0.000003
run 0 60 10
# Frame 17/19 from fd_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.186664
move O2 to 0.000000 0.000000 -2.186661
move C3 to 0.000000 -0.005000 -0.000003
run 0 60 10
# Frame 18/19 from fd_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.186664
move O2 to 0.000000 0.000000 -2.186661
move C3 to 0.000000 0.000000 0.004997
run 0 60 10
# Frame 19/19 from fd_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.186664
move O2 to 0.000000 0.000000 -2.186661
move C3 to 0.000000 0.000000 -0.005003
run 0 60 10