### Run EPW SCF and NSCF Calculations Source: https://docs.epw-code.org/tutorials/FCC-lead Performs self-consistent (SCF) and non-self-consistent (NSCF) calculations using `pw.x` within the EPW directory. These are necessary setup steps before running the main EPW calculation for phonon linewidths and spectral functions. ```bash ../../../../bin/pw.x < scf.in >& scf.out ``` ```bash ../../../../bin/pw.x < nscf.in >& nscf.out ``` -------------------------------- ### Setup Tutorial Directory and Work Directory Source: https://docs.epw-code.org/tutorials/TutorialZG This command extracts the tutorial tarball, navigates into the exercise directory, and creates a working directory for the calculations. It assumes the tarball is in the current directory. ```bash tar -xvf tutorial.tar.gz; cd tutorial/exercise1; mkdir workdir ``` -------------------------------- ### Run Quantum Espresso Phonon Calculation (SiC Example) Source: https://docs.epw-code.org/tutorials/SiC Executes the Quantum Espresso 'pw.x' code to perform a ground-state self-consistent calculation, which is a prerequisite for phonon calculations. This step is typically performed within the 'phonons' directory of the example. ```bash cd phonons ../../../../bin/pw.x < scf.in >& scf.out & ``` -------------------------------- ### Navigate to Phonon Directory Source: https://docs.epw-code.org/tutorials/B-doped-diamond Changes the current directory to the 'phonons' subdirectory where phonon calculations will be performed. This is a standard shell command. ```shell cd phonons ``` -------------------------------- ### Install Sphinx and Piccolo Theme Source: https://docs.epw-code.org/WebsiteMaintenance Installs the necessary Python packages, Sphinx and Piccolo theme, for building the website documentation. This command should be run after activating the virtual environment. ```bash pip install sphinx pip install piccolo-theme ``` -------------------------------- ### EPW Input Structure Example Source: https://docs.epw-code.org/doc/Inputs Illustrates the general structure of an EPW input file, showing the '&inputepw' namelist and other sections. This format is crucial for configuring EPW calculations. ```fortran &inputepw … / … ``` -------------------------------- ### Calculate Phonons with Quantum Espresso (SiC Example) Source: https://docs.epw-code.org/tutorials/SiC Utilizes the 'ph.x' code from Quantum Espresso to compute the dynamical matrix and phonon frequencies. This command is executed after the initial self-consistent calculation and is run from the 'phonons' directory. ```bash ../../../../bin/ph.x < ph.in >& ph.out & ``` -------------------------------- ### Run EPW for Electron Linewidths Calculation Source: https://docs.epw-code.org/tutorials/B-doped-diamond Executes the EPW code with the configuration for electron linewidths calculation. This command uses 4 processors and an input file named `epw2.in`, redirecting the output to `epw2.out`. It involves integrating over phonon q-points. ```bash mpirun -np 4 ../../../bin/epw.x -npool 4 < epw2.in > epw2.out ``` -------------------------------- ### Download and Compile EPW v5.3.0 with Quantum-ESPRESSO Source: https://docs.epw-code.org/DownloadAndInstall This snippet outlines the installation of EPW version 5.3.0. It involves downloading Quantum-ESPRESSO version 6.6, unpacking and configuring the source code, compiling EPW, and running parallel tests. The EPW executable can be found in the 'bin' directory. ```shell wget https://gitlab.com/QEF/q-e/-/archive/qe-6.6/q-e-qe-6.6.tar.gz tar xvfz q-e-qe-6.6.tar.gz && cd q-e-qe-6.6 && ./configure make epw cd test-suite make run-tests-epw-parallel ``` -------------------------------- ### Run EPW for Phonon Linewidths Calculation Source: https://docs.epw-code.org/tutorials/B-doped-diamond Executes the EPW code to compute phonon linewidths. This command requires the number of processors (`N`) and an input file named `epw.in`. The output is redirected to `epw.out`. The calculation focuses on phonon self-energy. ```bash mpirun -np N ../../../bin/epw.x -npool N < epw.in > epw.out ``` -------------------------------- ### Download and Compile EPW v5.3.1 with Quantum-ESPRESSO Source: https://docs.epw-code.org/DownloadAndInstall This snippet explains how to install EPW version 5.3.1. It includes downloading Quantum-ESPRESSO version 6.7MaX-Release, unpacking and configuring, compiling EPW, and running parallel tests. The executable is available in the 'bin' directory. ```shell wget https://gitlab.com/QEF/q-e/-/archive/qe-6.7MaX-Release/q-e-qe-6.7MaX-Release.tar.gz tar xvfz q-e-qe-6.7MaX-Release.tar.gz && cd q-e-qe-6.7MaX-Release && ./configure make epw cd test-suite make run-tests-epw-parallel ``` -------------------------------- ### Run Quantum Espresso SCF and NSCF Calculations for EPW (SiC Example) Source: https://docs.epw-code.org/tutorials/SiC Performs the necessary self-consistent field (SCF) and non-self-consistent field (NSCF) calculations using Quantum Espresso's 'pw.x' code, which are required before running the main EPW calculation. These commands are issued from within the 'epw' directory. ```bash ../../../../bin/pw.x < scf.in >& scf.out ../../../../bin/pw.x < nscf.in >& nscf.out ``` -------------------------------- ### Setup Working Directories and Copy Input Files Source: https://docs.epw-code.org/tutorials/TutorialZG This snippet shows the shell commands to navigate to the exercise directory, create working directories, and copy necessary input files for the diffuse scattering calculation. ```shell cd ../../exercise5/; mkdir workdir; cd workdir; mkdir exact; mkdir ZG cd exact cp ../../inputs/exact/graphene.881.fc . cp ../../inputs/exact/disca.in . ``` -------------------------------- ### SBATCH Script for EPW Calculation Setup Source: https://docs.epw-code.org/tutorials/tutorial_01/index This SBATCH script configures the environment and launches a non-self-consistent calculation using pw.x. It sets up job parameters, loads modules, and prepares input files for the calculation. ```bash #!/bin/bash #SBATCH -N 1 # Total # of nodes #SBATCH --ntasks-per-node 8 #SBATCH -t 01:00:00 # Run time (hh:mm:ss) #SBATCH -A DMR23030 #SBATCH -p skx #SBATCH --reservation=NSF_Summer_School_Tue module list # Launch MPI code... export PATHQE=/work2/05193/sabyadk/stampede3/EPWSchool2024/q-e mkdir pb.save cp ../phonon/pb.save/charge-density.dat pb.save/ cp ../phonon/pb.save/data-file-schema.xml pb.save/ ibrun $PATHQE/bin/pw.x -nk 4 -in nscf.in > nscf.out ``` -------------------------------- ### Download and Compile EPW v5.6.0 with Quantum-ESPRESSO Source: https://docs.epw-code.org/DownloadAndInstall This snippet details the process for installing EPW version 5.6.0. It involves downloading the EPW tarball, unpacking and configuring the Quantum-ESPRESSO package, compiling EPW, and running the test suite. The executable is found in the 'bin' directory. ```shell tar xvfz q-e-EPWv5.6.tar.gz && cd q-e-push && ./configure make epw cd test-suite make run-tests-epw ``` -------------------------------- ### Download and Compile EPW v5.5.0 with Quantum-ESPRESSO Source: https://docs.epw-code.org/DownloadAndInstall This snippet outlines the installation of EPW version 5.5.0. It includes downloading Quantum-ESPRESSO version 7.1, unpacking and configuring it, compiling EPW, and executing parallel tests. The EPW executable is located in the 'bin' directory. ```shell wget https://gitlab.com/QEF/q-e/-/archive/qe-7.1/q-e-qe-7.1.tar.gz tar xvfz q-e-qe-7.1.tar.gz && cd q-e-qe-7.1 && ./configure make epw cd test-suite make run-tests-epw-parallel ``` -------------------------------- ### Build Website Locally with Sphinx Source: https://docs.epw-code.org/WebsiteMaintenance Builds the website locally using Sphinx. This command generates HTML output in the 'build/html' directory, allowing for local preview before deployment. It requires Sphinx to be installed. ```bash sphinx-build -b html content/ build/html ``` -------------------------------- ### Example ZG-nscf_333_0.00K.in File Content Source: https://docs.epw-code.org/tutorials/TutorialZG This snippet shows the complete content of the ZG-nscf_333_0.00K.in file after modifications, including control, system, and electron parameters, atomic species, cell parameters, atomic positions, and the new K-points specification. ```fortran &control ZG-nscf_333_0.00K.in calculation = 'nscf' restart_mode = 'from_scratch' prefix = 'ZG-0.00K-si' pseudo_dir = './' outdir = './' / &system ibrav = 0 nat = 54 ntyp = 1 ecutwfc = 20.00 nbnd = 135 nosym = .true. occupations = 'fixed' smearing = 'gaussian' degauss = 0.0D+00 / &electrons diagonalization = 'david' mixing_mode= 'plain' mixing_beta = 0.70 conv_thr = 0.1D-06 / ATOMIC_SPECIES Si 28.085 Si.pz-vbc.UPF CELL_PARAMETERS {angstrom} -8.09641133 0.00000000 8.09641133 0.00000000 8.09641133 8.09641133 -8.09641133 8.09641133 0.00000000 ATOMIC_POSITIONS {angstrom} Si -0.02610870 -0.00524574 0.02749582 Si -1.36329713 1.31619849 1.42481245 Si -2.75218400 -0.00549830 2.71681282 ... K_POINTS crystal 30 0.236650 0.022946 0.917156 1.0 0.392728 0.655175 0.471114 1.0 ... ``` -------------------------------- ### Download and Compile EPW v5.4.0 with Quantum-ESPRESSO Source: https://docs.epw-code.org/DownloadAndInstall This snippet details the installation of EPW version 5.4.0. It covers downloading Quantum-ESPRESSO version 6.8, unpacking and configuring the source, compiling EPW, and running parallel tests. The EPW executable is located within the 'bin' directory. ```shell wget https://gitlab.com/QEF/q-e/-/archive/qe-6.8/q-e-qe-6.8.tar.gz tar xvfz q-e-qe-6.8.tar.gz && cd q-e-qe-6.8 && ./configure make epw cd test-suite make run-tests-epw-parallel ``` -------------------------------- ### Fortran Spacing and Conditional Example Source: https://docs.epw-code.org/Developers Demonstrates correct spacing around commas, operators, and within conditional statements in Fortran. It includes examples of IF statements, CALLs, and array allocation/deallocation with status checks. ```fortran IF (cond) THEN CALL name(arg1, arg2, arg3) ENDIF ALLOCATE(var1(dim1, dim2), STAT = ierr) IF (ierr /= 0) CALL io_error('Error allocating var1 in subroutine_name') DO ik = 1, nkf ikk = 2 * ik - 1 ikq = 2 * ik IF ((MINVAL(ABS(var1(:, ikk) - ef)) < fsthick) .AND. (MINVAL(ABS(var1(:, ikq) - ef)) < fsthick)) THEN ENDDO DEALLOCATE(var1, STAT = ierr) IF (ierr /= 0) CALL io_error('Error deallocating var1 in subroutine_name') ``` -------------------------------- ### Launch pw.x and epw.x for Electron-Phonon Calculations Source: https://docs.epw-code.org/tutorials/tutorial_01/index This section demonstrates how to launch the `pw.x` code for an NSCF calculation and `epw.x` for electron-phonon coupling calculations using `ibrun`. It sets up necessary directories and copies input files. The `PATHQE` environment variable points to the Quantum ESPRESSO executable. ```bash export PATHQE=/work2/05193/sabyadk/stampede3/EPWSchool2024/q-e mkdir pb.save cp ../phonon/pb.save/charge-density.dat pb.save/ cp ../phonon/pb.save/data-file-schema.xml pb.save/ ibrun $PATHQE/bin/pw.x -nk 4 -in nscf.in > nscf.out ibrun $PATHQE/bin/epw.x -nk 8 -in epw1.in > epw1.out ``` -------------------------------- ### Fortran Indentation Example Source: https://docs.epw-code.org/Developers Shows the standard two-space indentation for nested loops in Fortran code. This convention enhances readability for complex control flow structures. ```fortran DO ik = 1, nkf DO imode = 1, nmodes code ENDDO ENDDO ``` -------------------------------- ### Fortran Array Allocation and Deallocation Source: https://docs.epw-code.org/Developers Provides examples for allocating and deallocating arrays in Fortran, including checking the status using 'STAT = ierr' and handling potential errors with a call to an error routine. ```fortran ALLOCATE(var1(dim1, dim2), STAT = ierr) IF (ierr /= 0) CALL errore('subroutine_name', 'Error allocating var1', 1) DEALLOCATE(var1, STAT = ierr) IF (ierr /= 0) CALL errore('subroutine_name', 'Error deallocating var1', 1) ``` -------------------------------- ### Setup Input Files for Zr Phonon Calculation Source: https://docs.epw-code.org/tutorials/TutorialZG This snippet shows the commands to navigate to the exercise directory and copy necessary input files for the Quantum ESPRESSO calculations. These files include pseudopotentials, SCF input, phonon input, and q2r/matdyn input. ```bash cd ../../exercise3/; mkdir workdir; cd workdir cp ../inputs/Zr.upf ../inputs/scf.in ../inputs/ph.in . cp ../inputs/q2r.in ../inputs/matdyn.in . ``` -------------------------------- ### Fortran Subroutine Header Example Source: https://docs.epw-code.org/Developers Demonstrates the standard header for Fortran subroutines in the EPW project. It includes module usage, implicit none declaration, argument intent specifications, and local variable declarations with descriptions. ```fortran !------------------------------------------------------------------------ SUBROUTINE name(arg1, arg2) !------------------------------------------------------------------------ !! !! Description of subroutine !! !------------------------------------------------------------------------ USE kinds, ONLY : DP USE cell_base, ONLY : at, bg, alat ! IMPLICIT NONE ! ! input variables ! INTEGER, INTENT(in) :: arg1 !! Description REAL(KIND = DP), INTENT(in) :: arg2(3, 5) !! Description ! ! Local variables ! INTEGER :: ik !! Description !------------------------------------------------------------------------ END SUBROUTINE name !------------------------------------------------------------------------ ``` -------------------------------- ### Navigate to Tutorial Directory and Extract Files Source: https://docs.epw-code.org/tutorials/tutorial_01/index This snippet demonstrates the shell commands to navigate to a scratch directory, copy a tutorial tarball, and extract its contents. It's the initial step for setting up the tutorial environment. ```bash $ cd $SCRATCH $ cp /work2/05193/sabyadk/stampede3/EPWSchool2024/tutorials/Tue.6.Lafuente.tar . $ tar -xvf Tue.6.Lafuente.tar ; cd Tue.6.Lafuente/exercise1 ``` -------------------------------- ### Fortran Variable Declaration Example Source: https://docs.epw-code.org/Developers Illustrates the correct order for declaring variables used in array declarations within Fortran. It shows an integer variable 'N' followed by a real array 'A(N)', ensuring proper type definition before array sizing. ```fortran INTEGER, INTENT(in) :: N REAL(KIND = DP), INTENT(out) :: A(N) ``` -------------------------------- ### Execute Python Script for Phonon File Management Source: https://docs.epw-code.org/tutorials/B-doped-diamond Runs a Python script named 'pp.py' to manage phonon-related files (.dyn, .dvscf, .phsave) generated by Quantum ESPRESSO. The script assists in relabeling files corresponding to different q-points and organizing them into a 'save/' folder, preparing them for EPW calculations. ```shell python pp.py ``` -------------------------------- ### Run Phonon Calculation with `pw.x` Source: https://docs.epw-code.org/tutorials/FCC-lead Executes a ground-state self-consistent run using the `pw.x` code from Quantum Espresso. This is a prerequisite for calculating phonons. It takes an input file named `scf.in` and redirects output to `scf.out`. The '&' at the end runs the process in the background. ```bash ../../../../bin/pw.x < scf.in >& scf.out & ``` -------------------------------- ### Install 'future' Library (Python 2) Source: https://docs.epw-code.org/tutorials/GaN-II Installs the 'future' library using pip, a step that may be required if running the `pp.py` script with Python 2. This library helps bridge compatibility between Python 2 and Python 3. ```bash pip install --user future ``` -------------------------------- ### Configure and Run Phonon Calculation (ph.x) Source: https://docs.epw-code.org/tutorials/TutorialZG This section details the setup and execution of a phonon calculation using ph.x. It involves copying the input file and running the calculation on a 4x4x4 q-point grid. The output includes dynamical matrices for irreducible q-points. ```bash cp ../inputs/si.ph.in . mpirun -np 4 $QE/bin/ph.x -nk 4 < si.ph.in > si.ph.out ``` -------------------------------- ### Wannier Function Centers and Spreads Output Example Source: https://docs.epw-code.org/tutorials/tutorial_01/index This snippet shows an example of the output from the Wannier90 calculation, specifically the centers and spreads of the Wannier functions. This information is crucial for understanding the localization and characteristics of the generated Wannier functions, which are used for interpolating electron-phonon coupling. ```text Wannier Function centers (cartesian, alat) and spreads (ang): ( 0.07779 0.07779 0.07779) : 2.22274 ( 0.07779 -0.07779 -0.07779) : 2.22274 ( -0.07779 0.07779 -0.07779) : 2.22274 ( -0.07779 -0.07779 0.07779) : 2.22274 ``` -------------------------------- ### Run EPW for Phonon Linewidth Calculation (SiC Example) Source: https://docs.epw-code.org/tutorials/SiC Launches the EPW code ('epw.x') to calculate the phonon linewidth (imaginary part of the phonon self-energy) and other related quantities like the Eliashberg spectral function. This requires prior SCF and non-SCF calculations and is executed from the 'epw' directory. ```bash ../../../bin/epw.x < epw.in >& epw.out ``` -------------------------------- ### Download and Compile EPW v5.4.1 with Quantum-ESPRESSO Source: https://docs.epw-code.org/DownloadAndInstall This snippet provides instructions for installing EPW version 5.4.1. It involves downloading Quantum-ESPRESSO version 7.0, unpacking and configuring the source code, compiling EPW, and running parallel tests. The compiled EPW executable is found in the 'bin' directory. ```shell wget https://gitlab.com/QEF/q-e/-/archive/qe-7.0/q-e-qe-7.0.tar.gz tar xvfz q-e-qe-7.0.tar.gz && cd q-e-qe-7.0 && ./configure make epw cd test-suite make run-tests-epw-parallel ``` -------------------------------- ### Launch MPI Code with pw.x and ph.x Source: https://docs.epw-code.org/tutorials/tutorial_01/index Launches Quantum ESPRESSO's `pw.x` for self-consistent calculations and `ph.x` for phonon calculations using MPI. It requires the `PATHQE` environment variable to be set correctly. The output is redirected to `scf.out` and `ephline.out` respectively. ```bash export PATHQE=/work2/05193/sabyadk/stampede3/EPWSchool2024/q-e ibrun $PATHQE/bin/pw.x -nk 18 -in scf.in > scf.out ibrun $PATHQE/bin/ph.x -nk 18 -in ephline.in > ephline.out ``` -------------------------------- ### Fortran Mathematical Operator Spacing Source: https://docs.epw-code.org/Developers Demonstrates the required spacing around mathematical operators in Fortran. A single space should be used between operators and operands for clarity. ```fortran a = b + i c = c / SQRT(s) ``` -------------------------------- ### Setting Up ZG Calculation Input Files Source: https://docs.epw-code.org/tutorials/TutorialZG Navigates to the ZG directory and copies necessary input files for a ZG calculation. This includes force constants, input parameters, and Q-points. ```bash cd ../ZG; cp ../../inputs/ZG/graphene.881.fc .; cp ../../inputs/ZG/ZG_strf.in . cp ../exact/qpts_strf.dat . ``` -------------------------------- ### ZG.x Input Parameters Source: https://docs.epw-code.org/doc/InputsZG This section details various logical and real-valued input parameters for the ZG.x code, controlling aspects of phonon calculations, interatomic force constants, and configuration generation. ```APIDOC ## `na_ifc` ### Description If .true., the code adds non-analytic contributions to the interatomic force constants when finite displacements are used. This implementation is similar to matdyn.x and is useful with A-SDM calculations when used with the `fd` flag. It is crucial to include this flag in matdyn.x input for phonon dispersion calculations to avoid erroneous results. ### Type LOGICAL ### Default .false. --- ## `nconfs` ### Description If greater than 1, this parameter allows the generation of `nconfs` ZG configurations for each temperature. When `nconfs` > 1, `compute_error` is automatically set to .false. ### Type INTEGER ### Default 1 --- ## `niters` ### Description Specifies the number of attempts the algorithm makes to find the optimum configuration. The algorithm explores permutations of '+' and '-' signs to minimize errors arising from couplings between modes with the same q-wavevector but different branches. This parameter is meaningful only if `compute_error` is .true. If `nconfs` > 1, then `niters` is set to `nconfs`. ### Type Integer ### Default 15000 --- ## `ph_unfold` ### Description If .true., this flag activates the phonon unfolding procedure. For phonon unfolding to be performed, `ZG_conf` must be set to .false. Additionally, if `ph_unfold` is .true., then `q_external` must also be .true. ### Type LOGICAL ### Default .false. --- ## `q_external` ### Description If .true., this parameter allows the user to specify a list of q-points in the input file. If .false., the q-point list is automatically determined by the supercell dimensions (`dim1`, `dim2`, `dim3`). When .true., the q-point list must be provided by the user after the `&input` namelist. It is generally advisable to keep this flag set to .false. unless the user has specific requirements. ### Type LOGICAL ### Default .false. --- ## `qhat_in(:)` ### Description A vector of three real entries used to specify the direction `qhat` for the non-analytic part when `dim1=dim2=dim3=1`. For instance, setting `qhat_in(1) = 0.1, qhat_in(2) = 0.0, qhat_in(3) = 0.0` accounts for LO-TO splitting along the [1 0 0] direction. ### Type REAL ### Default (0.1, 0.1, 0.1) --- ## `synch` ### Description If .true., the code applies a smooth Berry connection and aligns the signs of the modes with respect to a reference mode. Note that the sign of this reference can vary between machines, and different ZG coordinates are possible due to phase factors in mode diagonalization. Eigenvalues should remain consistent. Degeneracy is not handled by this flag. ### Type LOGICAL ### Default .false. --- ## `single_ph_displ` ### Description If .true., this flag enables the displacement of nuclei along single phonon modes. The output configurations can be used to compute electron-phonon matrix elements via direct supercell calculations. The displacement is set to zero-point by `T = 0`. This finite displacement captures the effect of the diagonal elements of `[g(q)+g(-q)]`. The output file is named `single_phonon-displacements.dat`. ### Type LOGICAL ### Default .false. --- ## `T` ### Description Specifies the temperature at which calculations are performed. `T` influences the amplitude of normal coordinates through the Bose-Einstein factor. ### Type REAL ### Default 0.00 --- ## `T_array(i)` ### Description Allows for the generation of multiple ZG configurations at different temperatures. If `nconfs` is 1, the same set of signs is used for all temperatures to ensure consistency. If `nconfs` > 1, `nconfs` ZG configurations are generated for each temperature specified in `T_array`. A maximum of 100 temperatures can be specified (e.g., `T_array(1) = 50`, ..., `T_array(100) = 1000`). ### Type REAL ### Default -1.00 --- ## `ZG_conf` ### Description Enables the construction of ZG displacements. ### Type LOGICAL ### Default .true. --- ## `ZG_strf` ### Description Enables the calculation of ZG diffuse scattering maps, as detailed in the `&strf_ZG` namelist. ### Type LOGICAL ### Default .false. --- ## Inputs for evaluating anharmonic IFCs with ZG displacements (used when ASDM = .true.) ### Description This section pertains to the input parameters required for evaluating anharmonic Interatomic Force Constants (IFCs) using Zygmund-Gyorffy (ZG) displacements, specifically when the `ASDM` (Anharmonic Self-Consistent Displacement Method) flag is set to `.true.`. ### Type Namelist Group ### Default N/A ``` -------------------------------- ### Run EPW Test Suite Source: https://docs.epw-code.org/DownloadAndInstall After compilation, this command navigates to the test-suite directory and executes the tests to verify the EPW installation. This ensures that the compiled code functions correctly. ```bash cd test-suite make run-tests-epw ``` -------------------------------- ### Fortran Declaration Order Source: https://docs.epw-code.org/Developers Presents the recommended order for declaring variables in Fortran. It specifies the sequence for different types, including INTENT and ALLOCATED variables, followed by local variables. ```Fortran CHARACTER(LEN = 256) :: var LOGICAL :: var LOGICAL, ALLOCATED :: var(:) INTEGER :: var INTEGER, ALLOCATED :: var(:) REAL(KIND = DP) :: var REAL(KIND = DP), ALLOCATED :: var(:) COMPLEX(KIND = DP) :: var COMPLEX(KIND = DP), ALLOCATED :: var(:) ```