QR2-code

A DFT-based program for computation and analysis of the resonant Raman spectrum

QR2-code is an open-source Fortran code for computing Quantum-theory-based Resonant Raman spectrum at any given laser energy and optical geometric configuration, including single, double and defect-induced double resonant Raman, based on obtaining electron and phonon information from the Quantum ESPRESSO (QE) code and electron-phonon coupling from the EPW code. It can also analyze the Raman peak of interest and give the contribution quantitatively in terms of possible phonon mode(s) to the peak intensity. If you are only interested in the single resonant Raman spectrum, you can also choose our another code QERaman, which, as can be seen from its name, implement the Raman calculation only based on the QE package without the assistant of EPW code.

The flowchart of simulation

... The flowchart of QR2-code implementation
  • Self-consistent field calculation
  • mpirun -np Nc pw.x -i scf.in > scf.out

    A normal self-consistent field (SCF) calculation in QE to get the ground-state charge density for later phonon and Non-SCF field calculation.

  • Phonon related calculation
  • mpirun -np Nc ph.x -i ph.in > ph.out

    This calculation is to get the lattice dynamical matrices (dyn files) and phonon deformation potential in terms of a coarse q grid. These information can be collected into a save folder utilizing a python script of save.py:

    python save.py

    The save.py script can be found in the downloading materials and the data in save folder will be called in the following EPW calculation.

    mpirun -np Nc q2r.x -i q2r.in > q2r.out

    This calculation yields the interatomic force constants (IFC) which is used in the following step.

    mpirun -np 1 phonon_sort.x -i phonon_sort.in > phonon_sort.out

    This calculation is performed in a single core and upon completion, the branch-ordered phonon modes is stored in a file named phonon_sort which is needed in the double and defect-induced double resonant Raman calculation.

  • EPW calculation
  • mpirun -np Nc pw.x -npool Nc -i nscf.in > nscf.out

    In this Non-SCF calculation, The number of pool -npool has to be the same as the total number of core -np. In the standard input file, the number of electron bands should be specified which must not be lessen than the ones you want to wannierize . As we are always interested in the electron transition in the vicinity of Fermi level, some empty bands should be included.

    mpirun -np Nc epw.x -npool Nc -i epw.in > epw.out

    This calculation only implements the wannierization process, i.e. obtaining the Hamiltonian, dynamical matrix and e-ph matrix element in the Wannier basis. You can measure the quality of wannierization by checking the spreads of Wannier funtions.

  • Resonant Raman calculation
  • mpirun -np Nc epw.x -npool Nc -i raman.in > raman.out

    This Raman calculation is actually a restarting EPW calculation on the breaking point of last-step EPW performence. The restarting EPW is activated by setting epwread = .true. with the presence of five files that are from last-step EPW output: crystal.fmt, dmedata.fmt, epwdata.fmt, prefix.ukk and prefix.epmatwp. To perform resonant Raman calculations, the following new parameters need to be added in the input file of epw.in. The description about these new parameters is listed in Documentation part. In the double and defect-induced double resonant Raman cases, the phonon_sort file should also be present.

                    Raman_type = 'single', lhoph = .false.
                    Elaser = 1.71, Egamma = 0.3
                    reson_lim = .true., reson_thr = 1
                    lBE = .false., temphon = 300
                    prtdipole = .true., prtRaman = .true.
                    polar = 'all', filraman = 'qraman'
                    ei = (1.d0,0.d0), (0.d0,0.d0), (0.d0,0.d0)
                    es = (1.d0,0.d0), (0.d0,0.d0), (0.d0,0.d0)
                    Cq = 0.d0, 0.d0, 0.d0, 1.d0, 0.d0, 0.d0, 0.d0
                    ltensor = .false., qtensor_start = 1, qtensor_end = 1   
                    
  • Raman data post-processing
  • mpirun -np Nc raman_pp.x -i raman_pp.in > raman_pp.out

    The post-processing code comprises two functionalities. The first one is to obtain the Raman band (having non-zero bandwidth) by a Lorentz broadening on the basis of the Raman intensity data acquired in the last step calculation. The second one is to analyze the (defect-induced) double resonant Raman band by providing the pair of phonon modes that give rise to the Raman band. If the Raman band consists of a couple of phonon pairs, the percent contribution of each pair to the overall Raman band intensity will be given in the output.

Download and install

The current version of QR2-code is based on the latest version of QE-7.3.1, so first download QE-7.3.1 from its official website. Note that the EPW code, as a module of QE, is automatically included in the download. The QR2-code source code is available on the GitHub repository.

Unpack the QR2-code tarball and you will find four folders which are EPW-src, PHonon-PH, phonon_sort and Raman_PP. The former two folders contain files which exist in original QE package but here are modified to incorporate the functionality of resonant Raman calculation. Therefore, copy the files in EPW-src and PHonon-PH into the directory of EPW/src and PHonon/PH of QE, respectively, and replace the original ones. Now you can configure and compile QE (at least including the executables of pw.x, ph.x, q2r.x, matdyn.x and epw.x) in the same way as you usually do.

./configure CC=icc FC=ifort F77=ifort MPICC=mpiicc MPIF90=mpiifort
make -j8 pw ph
make -j8 epw

In the latter two foders (phonon_sort and Raman_PP) are isolated codes, and we strongly recommend that they are copied into the bin directory of QE for convinience, where exist all the executables of QE after the previous compilation.

The phonon_sort.f90 code in phonon_sort folder is to categorize the phonon modes in a branch-resovled way over the whole Brillouin zone (BZ), which is useful for the assignment of (defect-induced) double Raman mode, i.e. identifying the phonon mode (modes) which characterize a double Raman peak. The phonon_sort.f90 is implemented in single core, and it can be compiled by gfortran (or any other available fortran compiler) with command:

gfortran phonon_sort.f90 -o phonon_sort.x

The raman_pp.f90 code in Raman_PP folder is for Raman data postprocessing so as to generate the Raman spectrum in a Lorentz shape and also optionally analyze the Raman bands in terms of phonon modes. This code supports the parallel performance and can be compiled with following command:

mpiifort raman_pp.f90 -o raman_pp.x

By now, you have finished the installation of QR2-code, and you will get at least the following excutables in the bin directory: pw.x, ph.x, q2r.x, matdyn.x, phonon_sort.x, epw.x and raman_pp.x, which are necessary for succesfully running QR2-code.