### Build QE with CMake (CPU) Source: https://context7.com/qef/q-e/llms.txt Recommended for complex configurations. This example shows a CPU build using CMake, specifying compilers, installation prefix, and enabling Scalapack and HDF5. ```bash mkdir build && cd build # CPU build cmake -DCMAKE_Fortran_COMPILER=mpif90 \ -DCMAKE_C_COMPILER=mpicc \ -DCMAKE_INSTALL_PREFIX=/opt/qe \ -DQE_ENABLE_SCALAPACK=ON \ -DQE_ENABLE_HDF5=ON \ .. make -j8 make install # Executables in build/bin/ or /opt/qe/bin/ after install ``` -------------------------------- ### Install Quantum ESPRESSO using make Source: https://gitlab.com/qef/q-e/-/blob/develop/README.md Use this method for a quick installation on CPU-based machines. Ensure you are in the directory containing the installation files. 'make -jN' can be used for parallel compilation. ```bash ./configure [options] make all ``` -------------------------------- ### Install GUI Directories Source: https://gitlab.com/qef/q-e/-/blob/develop/GUI/CMakeLists.txt Installs the Guib, PWgui, and QE-modes directories to the share/GUI location. ```cmake install(DIRECTORY Guib PWgui QE-modes DESTINATION share/GUI USE_SOURCE_PERMISSIONS) ``` -------------------------------- ### Install README File Source: https://gitlab.com/qef/q-e/-/blob/develop/GUI/CMakeLists.txt Installs the README file to the share/GUI directory. ```cmake install(FILES README DESTINATION share/GUI) ``` -------------------------------- ### Configure QEHeat Installation Source: https://gitlab.com/qef/q-e/-/blob/develop/QEHeat/examples/README.md Run the configure script to set up the build environment for QEHeat. This is a standard step in Quantum Espresso installations. ```bash > ./configure ``` -------------------------------- ### Autopilot Example Syntax Source: https://gitlab.com/qef/q-e/-/blob/develop/CPV/Doc/autopilot_guide.md An example demonstrating how to configure dynamic parameter changes for temperature, timestep, and save interval at specific simulation steps. ```plaintext AUTOPILOT ON_STEP = 200 : tempw = 500.0 ON_STEP = 200 : dt = 3.0 ON_STEP = 250 : ISAVE = 50 ENDRULES ``` -------------------------------- ### Install Phonon Libraries and Executables Source: https://gitlab.com/qef/q-e/-/blob/develop/PHonon/CMakeLists.txt Installs the necessary phonon libraries and all defined phonon executables using the qe_install_targets macro. ```cmake qe_install_targets( # Libraries qe_phonon_ph qe_phonon_phaux qe_phonon_gamma qe_phonon_fd # Executables ${PH_EXE_TARGETS}) ``` -------------------------------- ### Install COUPLE Targets Source: https://gitlab.com/qef/q-e/-/blob/develop/COUPLE/CMakeLists.txt Installs the built targets, including the 'qe_couple' library and its associated files, to the appropriate locations based on the CMake installation prefix. ```cmake qe_install_targets(qe_couple) ``` -------------------------------- ### Example INI Configuration File Source: https://gitlab.com/qef/q-e/-/blob/develop/test-suite/testcode/docs/configuration_files.md Demonstrates the ini format for configuration files with sections and variables. ```ini [section_1] a = 2 b = test_option [section_2] v = 4.5 hello = world ``` -------------------------------- ### Install HDF5 5.10.4 Source: https://gitlab.com/qef/q-e/-/blob/develop/test-suite/buildbot/Udine_farm/README.txt Steps to download, configure, build, and install HDF5 version 5.10.4. Ensure the configure script uses the correct prefix and enables Fortran support if needed. ```bash wget https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.4/src/hdf5-1.10.4.tar.gz ./configure --prefix=/home/buildbot/local/hdf5-104-gcc102 --enable-fortran make -j 4 make install ``` -------------------------------- ### Execute Post-Installation Command Source: https://gitlab.com/qef/q-e/-/blob/develop/GUI/CMakeLists.txt Executes the 'make init' command within the PWgui directory after installation. Output and errors are suppressed. ```cmake install(CODE "execute_process( COMMAND make init WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/share/GUI/PWgui OUTPUT_QUIET ERROR_QUIET)") ``` -------------------------------- ### Install QE Targets Source: https://gitlab.com/qef/q-e/-/blob/develop/Modules/CMakeLists.txt Installs the 'qe_modules' and 'qe_modules_c' targets. This makes the built libraries available for use by other projects or for deployment. ```cmake qe_install_targets(qe_modules qe_modules_c) ``` -------------------------------- ### cppp.x Input Namelist Example Source: https://gitlab.com/qef/q-e/-/blob/develop/CPV/Doc/INPUT_CPPP.html This is an example of the &INPUTPP namelist used to configure the cppp.x utility. Specify parameters to control output, file handling, and data processing. ```fortran &INPUTPP ... cppp_input_parameter ... / ``` -------------------------------- ### Install Quantum ESPRESSO using CMake Source: https://gitlab.com/qef/q-e/-/blob/develop/README.md Recommended for versions 3.14 or later. It is strongly advised to specify Fortran and C compilers using CMAKE_Fortran_COMPILER and CMAKE_C_COMPILER. Parallel compilation is supported with 'make -jN'. The 'make install' command requires CMAKE_INSTALL_PREFIX to be set. ```bash mkdir ./build cd ./build cmake -DCMAKE_Fortran_COMPILER=mpif90 -DCMAKE_C_COMPILER=mpicc [-DCMAKE_INSTALL_PREFIX=/path/to/install] .. make [-jN] [make install] ``` -------------------------------- ### Install pp.py Script Source: https://gitlab.com/qef/q-e/-/blob/develop/EPW/CMakeLists.txt Installs the pp.py Python script to the bin directory, renaming it to epw_pp.py. ```cmake install(PROGRAMS bin/pp.py TYPE BIN RENAME epw_pp.py) ``` -------------------------------- ### Install PP targets Source: https://gitlab.com/qef/q-e/-/blob/develop/PP/CMakeLists.txt Installs the defined PP libraries and executables. This command makes the compiled targets available for use after the build process. ```cmake qe_install_targets( # Libraries qe_pp # Executables ${PP_EXE_TARGETS}) ``` -------------------------------- ### Install GWW Libraries and Executables Source: https://gitlab.com/qef/q-e/-/blob/develop/GWW/CMakeLists.txt Installs the GWW module's libraries and executables to the appropriate locations in the build system. ```cmake qe_install_targets( # Libraries qe_gww qe_gww_pw4gww qe_gww_bse qe_gww_head qe_gww_minpack qe_gww_simple qe_gww_simplebse qe_gww_simpleip # Executables ${GWW_EXE_TARGETS}) ``` -------------------------------- ### Configure Quantum ESPRESSO with Specific CUDA Details Source: https://gitlab.com/qef/q-e/-/blob/develop/README_GPU.md Example of configuring Quantum ESPRESSO using CUDA_HOME, compute capability 70, and runtime version 11.0. ```bash ./configure --with-cuda=$CUDA_HOME --with-cuda-cc=70 --with-cuda-runtime=11.0 ``` -------------------------------- ### Build QE with configure + make Source: https://context7.com/qef/q-e/llms.txt Standard CPU build using the traditional `configure` script. Ensure MPI and optional libraries like Scalapack and HDF5 are correctly specified. ```bash # Configure with MPI and optional libraries ./configure --enable-parallel \ --with-scalapack=yes \ --with-hdf5=/path/to/hdf5 \ MPIF90=mpif90 CC=mpicc make all -j8 # builds pw.x, cp.x, ph.x, pp.x, neb.x, ... # Binaries linked under bin/ ls bin/ # pw.x cp.x ph.x pp.x dos.x projwfc.x bands.x neb.x epw.x hp.x ... ``` -------------------------------- ### Data Tagging Example Source: https://gitlab.com/qef/q-e/-/blob/develop/test-suite/testcode/docs/verification.md Use a data tag to identify specific lines in output files for comparison. The first numerical entry on lines starting with the tag is validated against the benchmark. ```text [QA] Energy = 1.23456 eV ``` -------------------------------- ### Install KS Solver Targets Source: https://gitlab.com/qef/q-e/-/blob/develop/KS_Solvers/CMakeLists.txt Installs all defined KS solver libraries as targets in the build system. This makes them available for use by other parts of the project or for installation. ```cmake qe_install_targets( qe_kssolver_davidson qe_kssolver_davidsonrci qe_kssolver_cg qe_kssolver_paro qe_kssolver_dense qe_kssolver_rmmdiis qe_kssolver_direct) ``` -------------------------------- ### Install LAX Target Source: https://gitlab.com/qef/q-e/-/blob/develop/LAXlib/CMakeLists.txt Installs the LAX library target. ```cmake qe_install_targets(qe_lax) ``` -------------------------------- ### Install TDDFPT Targets Source: https://gitlab.com/qef/q-e/-/blob/develop/TDDFPT/CMakeLists.txt Installs the TDDFPT library and all defined executables. ```cmake qe_install_targets( # Libraries qe_tddfpt # Executables ${TDDFPT_EXE_TARGETS}) ``` -------------------------------- ### Install EPW Targets Source: https://gitlab.com/qef/q-e/-/blob/develop/EPW/CMakeLists.txt Installs various EPW executables and libraries to the appropriate locations. ```cmake qe_install_targets( # Libraries qe_epw # Exacutables qe_epw_exe qe_epw_nscf2supercond_exe qe_zg_exe qe_zg_disca_exe qe_zg_pp_disca_exe qe_zg_bands_unfold_exe qe_zg_pp_spctrlfn_exe qe_zg_epsilon_Gaus_exe) ``` -------------------------------- ### Set Runtime Environment Variables for QE Source: https://context7.com/qef/q-e/llms.txt This example demonstrates setting key environment variables that control the runtime behavior of Quantum ESPRESSO executables, such as scratch directory, pseudopotential location, and OpenMP thread count. ```bash # Directory for scratch/temporary files (overrides outdir in input if set) export ESPRESSO_TMPDIR=/scratch/$USER/qe_tmp # Directory to search for pseudopotential files (overrides pseudo_dir in input) export ESPRESSO_PSEUDO=/opt/pseudo/SSSP # Number of OpenMP threads per MPI rank export OMP_NUM_THREADS=2 # Example: run pw.x using env vars mkdir -p $ESPRESSO_TMPDIR mpirun -np 8 pw.x -i silicon_scf.in > silicon_scf.out ``` -------------------------------- ### Install DFT-D3 Targets Source: https://gitlab.com/qef/q-e/-/blob/develop/dft-d3/CMakeLists.txt Installs the defined DFT-D3 targets, making them available for use in other parts of the project or for deployment. ```cmake qe_install_targets(qe_dftd3) ``` -------------------------------- ### CP Simulation Input Example Source: https://gitlab.com/qef/q-e/-/blob/develop/CPV/Doc/user_guide.md Configuration for a CP simulation of a Benzene Molecule. This includes control, system, electrons, ions, and cell parameters, along with atomic species and positions. ```fortran &control title = 'Benzene Molecule', calculation = 'cp', restart_mode = 'from_scratch', ndr = 51, ndw = 51, nstep = 100, iprint = 10, isave = 100, tstress = .TRUE., tprnfor = .TRUE., dt = 5.0d0, etot_conv_thr = 1.d-9, ekin_conv_thr = 1.d-4, prefix = 'c6h6', pseudo_dir='/scratch/benzene/', outdir='/scratch/benzene/Out/' / &system ibrav = 14, celldm(1) = 16.0, celldm(2) = 1.0, celldm(3) = 0.5, celldm(4) = 0.0, celldm(5) = 0.0, celldm(6) = 0.0, nat = 12, ntyp = 2, nbnd = 15, ecutwfc = 40.0, nr1b= 10, nr2b = 10, nr3b = 10, input_dft = 'BLYP' / &electrons emass = 400.d0, emass_cutoff = 2.5d0, electron_dynamics = 'sd' / &ions ion_dynamics = 'none' / &cell cell_dynamics = 'none', press = 0.0d0, / ATOMIC_SPECIES C 12.0d0 c_blyp_gia.pp H 1.00d0 h.ps ATOMIC_POSITIONS (bohr) C 2.6 0.0 0.0 C 1.3 -1.3 0.0 C -1.3 -1.3 0.0 C -2.6 0.0 0.0 C -1.3 1.3 0.0 C 1.3 1.3 0.0 H 4.4 0.0 0.0 H 2.2 -2.2 0.0 H -2.2 -2.2 0.0 H -4.4 0.0 0.0 H -2.2 2.2 0.0 H 2.2 2.2 0.0 ``` -------------------------------- ### Run FFT Test Program Source: https://gitlab.com/qef/q-e/-/blob/develop/FFTXlib/README.md Execute the compiled FFT test program using mpirun. The example demonstrates setting parameters like energy cutoff, lattice parameter, number of bands, and number of task groups. ```bash mpirun -np 4 ./fft_test.x -ecutwfc 80 -alat 20 -nbnd 128 -ntg 4 ``` -------------------------------- ### Install LR Modules Target Source: https://gitlab.com/qef/q-e/-/blob/develop/LR_Modules/CMakeLists.txt Installs the 'qe_lr_modules' target. This makes the compiled library available for use by other parts of the project or for external linking. ```cmake qe_install_targets(qe_lr_modules) ``` -------------------------------- ### Configure fd.x Executable Source: https://gitlab.com/qef/q-e/-/blob/develop/PHonon/CMakeLists.txt Sets up the fd.x executable by defining its source file and linking required libraries for phonon calculations. ```cmake set(src_fd_x FD/fd.f90) qe_add_executable(qe_phonon_fd_exe ${src_fd_x}) set_target_properties(qe_phonon_fd_exe PROPERTIES OUTPUT_NAME fd.x) target_link_libraries(qe_phonon_fd_exe PRIVATE qe_pw qe_modules qe_phonon_fd qe_phonon_ph qe_fftx) ``` -------------------------------- ### Wannier90 Pre-processing and Interface Source: https://gitlab.com/qef/q-e/-/blob/develop/KCW/examples/example05.1/nspin4_noSOC_MAG/1_wannier/README.md Prepare for Wannierization by running the pre-processing step for Wannier90 and interfacing it with Quantum ESPRESSO's output. ```bash cd occ wannier90.x -pp wann pw2wannier90.x -in pw2wan.p2wi | tee pw2wan.p2wo ``` ```bash cd ../emp wannier90.x -pp wann pw2wannier90.x -in pw2wan.p2wi | tee pw2wan.p2wo ``` -------------------------------- ### Compile FFTXlib Test Program Source: https://gitlab.com/qef/q-e/-/blob/develop/FFTXlib/README.md Compile the test program for FFTXlib by navigating to the FFTXlib directory and running 'make TEST'. This assumes QE is already configured for parallel execution. ```bash make TEST ``` -------------------------------- ### Run ph.x for Phonon Calculation Workflow Source: https://context7.com/qef/q-e/llms.txt Executes the SCF calculation followed by the phonon calculation at the Gamma point. ```bash # Step 1: SCF mpirun -np 4 pw.x -i ch4_scf.in > ch4_scf.out # Step 2: Phonons at Gamma mpirun -np 4 ph.x -i ch4_ph.in > ch4_ph.out # Output contains phonon frequencies in cm^-1 and THz ```