ZnO (Quantum ESPRESSO)

From HPC Wiki
Jump to:navigation Jump to:search

This example shows how to create Infrared and Raman spectra of solid ZnO-Wurtzite, which are computed using the following three steps:

  • Perform Self Consistent Field (SCF) calculation with pw.x
  • Calculate the vibrational frequencies (normal modes/phonons) with ph.x
  • Extract the phonon information from ph.x output using dynmat.x

Initial Setup

We need to complete the initial setup tutorial first, to be sure that the GNU Compiler Collection, and Open MPI will be used for our simulations.

Important
The initial setup must be completed before continuing.

Prepare Example Directory

First, make sure we are at the root of our home directory

user $cd

Now, make an example directory, and copy the ZnO example directory into it.

user $mkdir examples
user $cp -r /home/bgo/shared/examples/qe/ZnO examples/
user $cd examples/ZnO
user $ls
O.pw-mt_fhi.UPF  README  Zn.pw-mt_fhi.UPF  zno.dm.qei  zno.ph.qei  zno.scf.qei

We also need a script to submit the job to the cluster. Lets start with the Quantum ESPRESSO sample script in /home/bgo/shared/samples by copying it to our new ZnO example directory.

user $cp /home/bgo/shared/samples/torque-qe.sh .
user $ls
O.pw-mt_fhi.UPF  Zn.pw-mt_fhi.UPF  zno.dm.qei  zno.scf.qei
README           torque-qe.sh      zno.ph.qei

The torque-qe.sh script should look something like this:

FILE torque-qe.sh
#PBS -l walltime=10:00:00,nodes=1:ppn=16
##PBS -M EmailAddress
##PBS -m bae
#PBS -q default
#PBS -N Jobname
#PBS -o myoutput.txt
#PBS -j oe

QE_MODULE=pw.x

. $(which qe-config)

# The input file must have a '.qei' extension (e.g., mysimulation.qei).
INPUTFILE=mysimulation

doQE


The submission script we just copied has default settings that have to be modified for this simulation. Lucky, most of the defaults work for the ZnO simulation (1 node, 16 processes per node, etc.) and all we have to change is the name of the job, the Quantum ESPRESSO module, and the name of the input file.

Running Quantum ESPRESSO

To calculate the Infrared and Raman spectra we will use three modules of Quantum ESPRESSO: pw.x, to perform a self consistent field calculation; ph.x, to calculate the vibrational frequencies; and dynmat.x, to extract the phonon information.

Input Files

Each module of Quantum ESPRESSO requires their own input file, along with pseudopotentials that describe each atom.

Modules

The input files, one for each module, in this example are:

  • zno.scf.qei
  • zno.ph.qei
  • zno.dm.qei

All three have a qei filename extension (which stands for Quantum ESPRESSO Inputfile), and is required for the queue submission script to properly identify the input file. There is no requirement for the rest of the filename, however it is traditional to start it with the name of the material being studied (ZnO, in this example) followed by an abbreviation for the Quantum ESPRESSO module used: scf, or pw for pw.x; ph for ph.x; and dm for dynmat.x.

Pseudopotentials

Quantum ESPRESSO requires a pseudopotential for each atom in the system to be studied, for this example (ZnO) they are:

  • O.pw-mt_fhi.UPF
  • Zn.pw-mt_fhi.UPF

These files were downloaded from the Quantum ESPRESSO pseudopotentials repository.

Self Consistent Field (SCF) Calculation

For SCF calculations we need to use the pw.x Quantum ESPRESSO module.

Modify Queue Submission Script

Changing the job name to ZnO-pw, the Quantum ESPRESSO module to pw.x, and the input file to zno.scf results in a submission script that looks like this:

FILE torque-qe.sh(edited for running pw.x)
#PBS -l walltime=10:00:00,nodes=1:ppn=16
##PBS -M EmailAddress
##PBS -m bae
#PBS -q default
#PBS -N ZnO-pw
#PBS -o myoutput.txt
#PBS -j oe

QE_MODULE=pw.x

. $(which qe-config)

# The input file must have a '.qei' extension (e.g., mysimulation.qei).
INPUTFILE=zno.scf

doQE


Submit Job

The job is now ready to be sent to the cluster.

user $qsub torque-qe.sh
user $qstat
Job ID                    Name             User            Time Use S Queue
------------------------- ---------------- --------------- -------- - -----
14589.flory               ZnO-pw           user            00:00:35 R default  

The job should take about 1 minute. Check the job status with qstat to see when it is finished; when the job is no longer listed it has finished.

Check Results

When the job completes you should find the following files:

user $ls -l
total 392
-rw-r--r-- 1 user user 165332 Jan  4 11:15 O.pw-mt_fhi.UPF
-rw-r--r-- 1 user user   2113 Jan  4 11:15 README
-rw-r--r-- 1 user user 183650 Jan  4 11:15 Zn.pw-mt_fhi.UPF
-rw------- 1 user user    670 Jan  4 11:16 myoutput.txt
drwxrwxr-x 3 user user   4096 Jan  4 11:16 tmp
-rwxr-xr-x 1 user user    271 Jan  4 11:16 torque-qe.sh
-rw-r--r-- 1 user user    117 Jan  4 11:15 zno.dm.qei
-rw-r--r-- 1 user user    255 Jan  4 11:15 zno.ph.qei
-rw-rw-r-- 1 user user  12941 Jan  4 11:16 zno.scf.out
-rw-r--r-- 1 user user    720 Jan  4 11:15 zno.scf.qei

The three new items created are described here:

myoutput.txt
  • A summary of the simulation.
  • If any problem occurs trying to run the simulation, this should be the first place to look for errors.
tmp
  • A directory containing intermediate calculations which are utilized by other Quantum ESPRESSO modules.
zno.scf.out
  • The results of the SCF calculation.
  • Should be the second place to look for errors on unsuccessful runs.

For a successful run, myoutput.txt should look similar to this:

FILE myoutput.txt
-------------- qe-config (BEGIN) --------------

Start time       : Wed Jan  4 11:16:33 EST 2017

PBS_JOBID        : 14589.flory.usm.edu
Working Directory: /home/user/examples/ZnO
MPI command      : /home/bgo/shared/gnu-openmpi/bin/mpirun
QE module        : /home/bgo/shared/gnu-openmpi/bin/pw.x
QE script        : /home/user/examples/ZnO/zno.scf.qei
Processes        : 16
Controlling Node : n008.cluster.com
Nodes            : n008.cluster.com (16)

Command: mpirun  pw.x -inp "zno.scf.qei" > "zno.scf.out"

Stop  time       : Wed Jan  4 11:16:38 EST 2017

Elapsed time     : 0 days 00h 00m 05s

-------------- qe-config ( END ) --------------

Calculate the vibrational frequencies (normal modes/phonons)

Now we use the ph.x module of Quantum ESPRESSO to calculate the vibrational frequencies of ZnO.

Modify Queue Submission Script

Changing the job name to ZnO-ph, the Quantum ESPRESSO module to ph.x, and the input file to zno.ph results in a submission script that looks like this:

FILE torque-qe.sh(edited for running ph.x)
#PBS -l walltime=10:00:00,nodes=1:ppn=16
##PBS -M EmailAddress
##PBS -m bae
#PBS -q default
#PBS -N ZnO-ph
#PBS -o myoutput.txt
#PBS -j oe

QE_MODULE=ph.x

. $(which qe-config)

# The input file must have a '.qei' extension (e.g., mysimulation.qei).
INPUTFILE=zno.ph

doQE


Submit Job

Send the job to the cluster:

user $qsub torque-qe.sh
user $qstat
Job ID                    Name             User            Time Use S Queue
------------------------- ---------------- --------------- -------- - -----
14590.flory               ZnO-ph           user            00:00:35 R default  

The job should take about 5 minutes. Check the job status with qstat to see when it is finished; when the job is no longer listed it has finished.

Check Results

When the job completes you should find the following files:

user $ls -lh
total 7.7M
-rw-r--r-- 1 user user 162K Jan  4 11:20 O.pw-mt_fhi.UPF
-rw-r--r-- 1 user user 2.1K Jan  4 11:20 README
-rw-r--r-- 1 user user 180K Jan  4 11:20 Zn.pw-mt_fhi.UPF
-rw-rw-r-- 1 user user  13K Jan  4 11:26 dmat.zno
-rw-rw-r-- 1 user user 2.4M Jan  4 11:21 drho_e1
-rw-rw-r-- 1 user user 2.4M Jan  4 11:21 drho_e2
-rw-rw-r-- 1 user user 2.4M Jan  4 11:21 drho_e3
-rw------- 1 user user  667 Jan  4 11:26 myoutput.txt
drwxrwxr-x 4 user user 4.0K Jan  4 11:21 tmp
-rwxr-xr-x 1 user user  270 Jan  4 11:21 torque-qe.sh
-rw-r--r-- 1 user user  117 Jan  4 11:20 zno.dm.qei
-rw-rw-r-- 1 user user  32K Jan  4 11:26 zno.ph.out
-rw-r--r-- 1 user user  255 Jan  4 11:20 zno.ph.qei
-rw-rw-r-- 1 user user  13K Jan  4 11:20 zno.scf.out
-rw-r--r-- 1 user user  720 Jan  4 11:20 zno.scf.qei

The new items created are described here:

drho_e1, drho_e2, and drho_e3
  • Dynamical matrix and Charge density responses.
  • For more details on these files, see the manual here.
myoutput.txt
  • This file was created from the previous run, but has been overwritten by this run.
  • A summary of the simulation.
  • If any problem occurs trying to run the simulation, this should be the first place to look for errors.
zno.ph.out
  • The results of the phonon calculation.
  • Should be the second place to look for errors on unsuccessful runs.

Phonon Information

Now use the dynmat.x Quantum ESPRESSO module to extract the Infrared and Raman spectra data from the results of the previous two jobs.

Modify Queue Submission Script

Changing the job name to ZnO-dynmat, the Quantum ESPRESSO module to dynmat.x, and the input file to zno.dm results in a submission script that looks like this:

FILE torque-qe.sh(edited for running dynmat.x)
#PBS -l walltime=10:00:00,nodes=1:ppn=16
##PBS -M EmailAddress
##PBS -m bae
#PBS -q default
#PBS -N ZnO-dynmat
#PBS -o myoutput.txt
#PBS -j oe

QE_MODULE=dynmat.x

. $(which qe-config)

# The input file must have a '.qei' extension (e.g., mysimulation.qei).
INPUTFILE=zno.dm

doQE


Submit Job

The job is now ready to be sent to the cluster.

user $qsub torque-qe.sh
user $qstat
Job ID                    Name             User            Time Use S Queue
------------------------- ---------------- --------------- -------- - -----
14592.flory               ZnO-dynmat       user            00:00:35 R default  

The job should take less than a minute. Check the job status with qstat to see when it is finished; when the job is no longer listed it has finished.

Check Results

When the job completes you should find the following files:

user $ls -lh
total 7.7M
-rw-r--r-- 1 user user 162K Jan  4 11:27 O.pw-mt_fhi.UPF
-rw-r--r-- 1 user user 2.1K Jan  4 11:27 README
-rw-r--r-- 1 user user 180K Jan  4 11:27 Zn.pw-mt_fhi.UPF
-rw-rw-r-- 1 user user  13K Jan  4 11:27 dmat.zno
-rw-rw-r-- 1 user user 2.4M Jan  4 11:27 drho_e1
-rw-rw-r-- 1 user user 2.4M Jan  4 11:27 drho_e2
-rw-rw-r-- 1 user user 2.4M Jan  4 11:27 drho_e3
-rw------- 1 user user  675 Jan  4 11:28 myoutput.txt
drwxrwxr-x 4 user user 4.0K Jan  4 11:27 tmp
-rwxr-xr-x 1 user user  278 Jan  4 11:43 torque-qe.sh
-rw-rw-r-- 1 user user 2.4K Jan  4 11:28 zno.dm.out
-rw-r--r-- 1 user user  117 Jan  4 11:27 zno.dm.qei
-rw-rw-r-- 1 user user  32K Jan  4 11:27 zno.ph.out
-rw-r--r-- 1 user user  255 Jan  4 11:27 zno.ph.qei
-rw-rw-r-- 1 user user  13K Jan  4 11:27 zno.scf.out
-rw-r--r-- 1 user user  720 Jan  4 11:27 zno.scf.qei
-rw-rw-r-- 1 user user 3.7K Jan  4 11:28 zno_raman.axsf
-rw-rw-r-- 1 user user 2.1K Jan  4 11:28 zno_raman.mold
-rw-rw-r-- 1 user user 4.6K Jan  4 11:28 zno_raman.out

The new items created are described here:

zno_raman.axsf, zno_raman.mold, zno_raman.out
  • Phonon frequencies and normalized phonon displacements.
  • For more details on these files, see the manual here.
myoutput.txt
  • This file was created from a previous run, but has been overwritten by this run.
  • A summary of the simulation.
  • If any problem occurs trying to run the simulation, this should be the first place to look for errors.
zno.dm.out
  • The results of the phonon calculation.
  • Should be the second place to look for errors on unsuccessful runs.

Spectra Data

FILE zno.dm.out(Partial file: section containing table)
IR activities are in (D/A)^2/amu units
     Raman activities are in A^4/amu units
     multiply Raman by 0.000650 for Clausius-Mossotti correction

# mode   [cm-1]    [THz]      IR          Raman   depol.fact
    1     -0.00   -0.0000    0.0000      5406.9725    0.7500
    2     -0.00   -0.0000    0.0000      5757.6500    0.7500
    3     -0.00   -0.0000    0.0000      5688.7322    0.7499
    4     -0.00   -0.0000    0.0000       171.9037    0.4691
    5      0.00    0.0000    0.0000       554.2156    0.5434
    6      0.00    0.0000    0.0000      2358.3724    0.7367
    7    105.98    3.1773    0.1227      1281.9877    0.7500
    8    124.94    3.7456    0.0000      4603.4623    0.7500
    9    287.20    8.6100   13.4004      3428.9212    0.7500
   10    391.76   11.7446   71.1599     37311.9784    0.1040
   11    407.14   12.2057  101.4467      9438.8013    0.7500
   12    532.61   15.9672    6.1669       385.1588    0.7500