From c296e38a7de726b021fd91974a6c0d143f374f0a Mon Sep 17 00:00:00 2001 From: louisponet Date: Sun, 3 Sep 2023 21:20:00 +0200 Subject: [PATCH 01/14] added initial 7.2 support and fixed tests --- assets/calculations/qe7.2/INPUT_BANDS.txt | 160 + assets/calculations/qe7.2/INPUT_DOS.txt | 164 + assets/calculations/qe7.2/INPUT_HP.txt | 355 ++ assets/calculations/qe7.2/INPUT_LD1.txt | 1269 +++++ assets/calculations/qe7.2/INPUT_OSCDFT.txt | 694 +++ assets/calculations/qe7.2/INPUT_PH.txt | 997 ++++ assets/calculations/qe7.2/INPUT_PP.txt | 623 +++ assets/calculations/qe7.2/INPUT_PROJWFC.txt | 350 ++ assets/calculations/qe7.2/INPUT_PW.txt | 4819 +++++++++++++++++++ deps/asset_init.jl | 13 + src/Calculations/Calculations.jl | 2 +- src/Calculations/calculation.jl | 105 +- src/Calculations/documentation.jl | 17 +- src/Calculations/qe.jl | 253 +- src/Display/printing.jl | 2 + src/FileIO/qe.jl | 392 +- src/Structures/atom.jl | 1 + test/constant_tests.jl | 5 +- test/display_tests.jl | 18 +- test/documentation_tests.jl | 2 +- 20 files changed, 9994 insertions(+), 247 deletions(-) create mode 100644 assets/calculations/qe7.2/INPUT_BANDS.txt create mode 100644 assets/calculations/qe7.2/INPUT_DOS.txt create mode 100644 assets/calculations/qe7.2/INPUT_HP.txt create mode 100644 assets/calculations/qe7.2/INPUT_LD1.txt create mode 100644 assets/calculations/qe7.2/INPUT_OSCDFT.txt create mode 100644 assets/calculations/qe7.2/INPUT_PH.txt create mode 100644 assets/calculations/qe7.2/INPUT_PP.txt create mode 100644 assets/calculations/qe7.2/INPUT_PROJWFC.txt create mode 100644 assets/calculations/qe7.2/INPUT_PW.txt diff --git a/assets/calculations/qe7.2/INPUT_BANDS.txt b/assets/calculations/qe7.2/INPUT_BANDS.txt new file mode 100644 index 00000000..8e4e6814 --- /dev/null +++ b/assets/calculations/qe7.2/INPUT_BANDS.txt @@ -0,0 +1,160 @@ +*** FILE AUTOMATICALLY CREATED: DO NOT EDIT, CHANGES WILL BE LOST *** + +------------------------------------------------------------------------ +INPUT FILE DESCRIPTION + +Program: bands.x / PWscf / Quantum ESPRESSO (version: 7.2) +------------------------------------------------------------------------ + + +Purpose of bands.x: + Re-order bands, computes band-related properties. Currently, + re-ordering can be done with two different algorithms: + (a) by maximising the overlap with bands at previous k-point + (b) by computing symmetry properties of each wavefunction + Bands-related properties that can be computed are currently + (a) The expectation value of the spin operator on each spinor + wave-function (noncolinear case only) + (b) The expectation value of p + +The input data can be read from standard input or from file using +command-line options "bands.x -i file-name" (same syntax as for pw.x) + +Output files: +- file "filband" containing the band structure, in a format + suitable for plotting code "plotband.x" +- file "filband".rap (if "lsym" is .t.) with symmetry information, + to be read by plotting code "plotband.x" +- if ("lsigma"(i)): file "filband".i, i=1,2,3, with expectation values + of the spin operator in the noncolinear case +- file "filband".gnu with bands in eV, directly plottable using gnuplot +- file "filp" with matrix elements of p (including the nonlocal potential + contribution i*m*[V_nl,x]) + +Structure of the input data: +============================ + + &BANDS + ... + / + + + +======================================================================== +NAMELIST: &BANDS + + +-------------------------------------------------------------------- + Variable: prefix + + Type: CHARACTER + Default: 'pwscf' + Description: prefix of files saved by program pw.x + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: outdir + + Type: CHARACTER + Description: directory containing the input data, i.e. the same as in pw.x + Default: value of the ESPRESSO_TMPDIR environment variable if set; + current directory ('./') otherwise + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: filband + + Type: CHARACTER + Default: 'bands.out' + Description: file name for band output (to be read by "plotband.x") + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: spin_component + + Type: INTEGER + Description: In the lsda case select: + + 1 = spin-up + 2 = spin-down + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lsigma(i), i=1,3 + + Type: LOGICAL + Description: If true computes expectation values of the spin operator + on the spinor wave-functions (only in the noncollinear case), + writes them to a file "filband".i, i=1,2,3 + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lp + + Type: LOGICAL + Default: .false. + Description: If .true. matrix elements of the momentum operator p between + conduction and valence bands are computed and written to file + specified in "filp". + The matrix elements include the contribution from the nonlocal + potential, i*m*[V_nl, x]. In other words, the calculated matrix elements + are those of the velocity operator i*m*[H, x] times mass, not those of + the true momentum operator. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: filp + + Type: CHARACTER + Default: 'p_avg.dat' + Description: If "lp" is set to .true., file name for matrix elements of p + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lsym + + Type: LOGICAL + Default: .true. + Description: If .true. the bands are classified according to the + irreducible representations of the small group of k. + A file "filband".rap with the same format of "filband" + is written, for usage by "plotband.x" + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: no_overlap + + Type: LOGICAL + Default: .true. + Description: If .false., and if "lsym" is .false., writes the eigenvalues + in the order that maximises overlap with the neighbor k-points + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: plot_2d + + Type: LOGICAL + Default: .false. + Description: If .true. writes the eigenvalues in the output file + in a 2D format readable by gnuplot. Band ordering is not + changed. Each band is written in a different file called + filband.# with the format: + + xk, yk, energy + xk, yk, energy + .. .. .. + + energies are written in eV and xk in units 2\pi/a. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: firstk, lastk + + Type: INTEGER + Description: if "lsym"=.true. makes the symmetry analysis only for k + points between firstk to lastk + +-------------------------------------------------------------------- + +===END OF NAMELIST====================================================== + + +This file has been created by helpdoc utility on Sat Mar 18 15:50:15 CET 2023 diff --git a/assets/calculations/qe7.2/INPUT_DOS.txt b/assets/calculations/qe7.2/INPUT_DOS.txt new file mode 100644 index 00000000..b8f0b76d --- /dev/null +++ b/assets/calculations/qe7.2/INPUT_DOS.txt @@ -0,0 +1,164 @@ +*** FILE AUTOMATICALLY CREATED: DO NOT EDIT, CHANGES WILL BE LOST *** + +------------------------------------------------------------------------ +INPUT FILE DESCRIPTION + +Program: dos.x / PWscf / Quantum ESPRESSO (version: 7.2) +------------------------------------------------------------------------ + + +Purpose of dos.x: + calculates the Density of States (DOS) + (separated into up and down components for DSDA) + + +Structure of the input data: +============================ + + &DOS + ... + / + +IMPORTANT: since v.5 namelist name is &DOS and no longer &INPUTPP + + + +======================================================================== +NAMELIST: &DOS + + +-------------------------------------------------------------------- + Variable: prefix + + Type: CHARACTER + Default: 'pwscf' + Description: prefix of input file produced by pw.x + (wavefunctions are not needed) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: outdir + + Type: CHARACTER + Description: directory containing the input data, i.e. the same as in pw.x + Default: value of the ESPRESSO_TMPDIR environment variable if set; + current directory ('./') otherwise + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: bz_sum + + Type: CHARACTER + Description: + Keyword selecting the method for BZ summation. Available options are: + + 'smearing' : + integration using gaussian smearing. In fact currently + any string not related to tetrahedra defaults to smearing; + + 'tetrahedra' : + Tetrahedron method, Bloechl's version: + P.E. Bloechl, PRB 49, 16223 (1994) + Requires uniform grid of k-points, to be + automatically generated in pw.x. + + 'tetrahedra_lin' : + Original linear tetrahedron method. + To be used only as a reference; + the optimized tetrahedron method is more efficient. + + 'tetrahedra_opt' : + Optimized tetrahedron method: + see M. Kawamura, PRB 89, 094515 (2014). + Default: 'smearing' if degauss is given in input; + options read from the xml data file otherwise. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: ngauss + + Type: INTEGER + Default: 0 + Status: optional + Description: Type of gaussian broadening: + + = 0 Simple Gaussian (default) + + = 1 Methfessel-Paxton of order 1 + + = -1 "cold smearing" (Marzari-Vanderbilt-DeVita-Payne) + + =-99 Fermi-Dirac function + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: degauss + + Type: REAL + Description: gaussian broadening, Ry (not eV!) + (see below) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: Emin, Emax + + Type: REAL + Default: band extrema + Description: min, max energy (eV) for DOS plot. If unspecified, the + lower and/or upper band value, plus/minus 3 times the + value of the gaussian smearing if present, will be used. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: DeltaE + + Type: REAL + Description: energy grid step (eV) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: fildos + + Type: CHARACTER + Default: '"prefix".dos' + Description: output file containing DOS(E) + +-------------------------------------------------------------------- + +===END OF NAMELIST====================================================== + + + +:::: Notes + + + ::: Output + + The total DOS (states/eV plotted vs E in eV) is written to file "fildos" + + + + ::: Important ! + + The tetrahedron method is used if + + - the input data file has been produced by pw.x using the option + occupations='tetrahedra', AND + + - a value for degauss is not given as input to namelist &dos + + + Gaussian broadening is used in all other cases: + + - if "degauss" is set to some value in namelist &DOS, that value + (and the optional value for "ngauss") is used + + - if "degauss" is NOT set to any value in namelist &DOS, the + value of "degauss" and of "ngauss" are read from the input data + file (they will be the same used in the pw.x calculations) + + - if "degauss" is NOT set to any value in namelist &DOS, AND + there is no value of "degauss" and of "ngauss" in the input data + file, "degauss"="DeltaE" (in Ry) and "ngauss"=0 will be used + + + +This file has been created by helpdoc utility on Sat Mar 18 15:50:15 CET 2023 diff --git a/assets/calculations/qe7.2/INPUT_HP.txt b/assets/calculations/qe7.2/INPUT_HP.txt new file mode 100644 index 00000000..88cb69e8 --- /dev/null +++ b/assets/calculations/qe7.2/INPUT_HP.txt @@ -0,0 +1,355 @@ +*** FILE AUTOMATICALLY CREATED: DO NOT EDIT, CHANGES WILL BE LOST *** + +------------------------------------------------------------------------ +INPUT FILE DESCRIPTION + +Program: hp.x / PWscf / Quantum Espresso (version: 7.2) +------------------------------------------------------------------------ + + +Input data format: { } = optional, [ ] = it depends, # = comment + +Structure of the input data: +=============================================================================== + +&INPUTHP + ... +/ + + + +======================================================================== +NAMELIST: &INPUTHP + + +-------------------------------------------------------------------- + Variable: prefix + + Type: CHARACTER + Default: 'pwscf' + Description: Prepended to input/output filenames; must be the same + used in the calculation of unperturbed system. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: outdir + + Type: CHARACTER + Default: value of the ESPRESSO_TMPDIR environment variable if set; + current directory ('./') otherwise + Description: Directory containing input, output, and scratch files; + must be the same as specified in the calculation of + the unperturbed system. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: iverbosity + + Type: INTEGER + Default: 1 + Description: = 1 : minimal output + = 2 : as above + symmetry matrices, final response + matrices chi0 and chi1 and their inverse matrices, + full U matrix + = 3 : as above + various detailed info about the NSCF + calculation at k and k+q + = 4 : as above + response occupation matrices at every + iteration and for every q point in the star + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: max_seconds + + Type: REAL + Default: 1.d7 + Description: Maximum allowed run time before the job stops smoothly. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: nq1, nq2, nq3 + + Type: INTEGER + Default: 1,1,1 + Description: Parameters of the Monkhorst-Pack grid (no offset). + Same meaning as for nk1, nk2, nk3 in the input of pw.x. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: skip_equivalence_q + + Type: LOGICAL + Default: .false. + Description: If .true. then the HP code will skip the equivalence + analysis of q points, and thus the full grid of q points + will be used. Otherwise the symmetry is used to determine + equivalent q points (star of q), and then perform + calculations only for inequivalent q points. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: determine_num_pert_only + + Type: LOGICAL + Default: .false. + See: find_atpert + Description: If .true. determines the number of perturbations + (i.e. which atoms will be perturbed) and exits smoothly + without performing any calculation. For DFT+U+V, it also + determines the indices of inter-site couples. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: determine_q_mesh_only + + Type: LOGICAL + Default: .false. + See: perturb_only_atom + Description: If .true. determines the number of q points + for a given perturbed atom and exits smoothly. + This keyword can be used only if perturb_only_atom + is set to .true. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: find_atpert + + Type: INTEGER + Default: 1 + Description: Method for searching of atoms which must be perturbed. + 1 = Find how many inequivalent Hubbard atoms there are + by analyzing unperturbed occupations. + 2 = Find how many Hubbard atoms to perturb based on + how many different Hubbard atomic types there are. + Warning: atoms which have the same type but which + are inequivalent by symmetry or which have different + occupations will not be distinguished in this case + (use option 1 or 3 instead). + 3 = Find how many inequivalent Hubbard atoms + there are using symmetry. Atoms which have the + same type but are not equivalent by symmetry will + be distinguished in this case. + 4 = Perturb all Hubbard atoms (the most expensive option) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: docc_thr + + Type: REAL + Default: 5.D-5 + Description: Threshold for a comparison of unperturbed occupations + which is needed for the selection of atoms which must + be perturbed. Can be used only when "find_atpert" = 1. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: skip_type(i), i=1,ntyp + + Type: LOGICAL + Default: skip_type(i) = .false. + See: equiv_type + Description: "skip_type"(i), where i runs over types of atoms. + If "skip_type"(i)=.true. then no linear-response + calculation will be performed for the i-th atomic type: + in this case "equiv_type"(i) must be specified, otherwise + the HP code will stop. This option is useful if the + system has atoms of the same type but opposite spin + pollarizations (anti-ferromagnetic case). + This keyword cannot be used when "find_atpert" = 1. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: equiv_type(i), i=1,ntyp + + Type: INTEGER + Default: equiv_type(i) = 0 + See: skip_type + Description: "equiv_type"(i), where i runs over types of atoms. + "equiv_type"(i)=j, will make type i equivalent to type j + (useful when nspin=2). Such a merging of types is done + only at the post-processing stage. + This keyword cannot be used when "find_atpert" = 1. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: perturb_only_atom(i), i=1,ntyp + + Type: LOGICAL + Default: perturb_only_atom(i) = .false. + See: compute_hp + Description: If "perturb_only_atom"(i)=.true. then only the i-th + atom will be perturbed and considered in the run. + This variable is useful when one wants to split + the whole calculation on parts. + + Note: this variable has a higher priority than "skip_type". + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: start_q + + Type: INTEGER + Default: 1 + See: last_q, sum_pertq + Description: Computes only the q points from "start_q" to "last_q". + + IMPORTANT: "start_q" must be smaller or equal to + the total number of q points found. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: last_q + + Type: INTEGER + Default: number of q points + See: start_q, sum_pertq + Description: Computes only the q points from "start_q" to "last_q". + + IMPORTANT: "last_q" must be smaller or equal to + the total number of q points found. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: sum_pertq + + Type: LOGICAL + Default: .false. + See: start_q, last_q, perturb_only_atom + Description: If it is set to .true. then the HP code will collect + pieces of the response occupation matrices for all + q points. This variable should be used only when + "start_q", "last_q" and "perturb_only_atom" are used. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: compute_hp + + Type: LOGICAL + Default: .false. + See: perturb_only_atom + Description: If it is set to .true. then the HP code will collect + pieces of the chi0 and chi matrices (which must have + been produced in previous runs) and then compute + Hubbard parameters. The HP code will look for files + tmp_dir/HP/prefix.chi.i.dat. Note that all files + prefix.chi.i.dat (where i runs over all perturbed + atoms) must be placed in one folder tmp_dir/HP/. + "compute_hp"=.true. must be used only when the + calculation was parallelized over perturbations. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: conv_thr_chi + + Type: REAL + Default: 1.D-5 + Description: Convergence threshold for the response function chi, + which is defined as a trace of the response + occupation matrix. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: thresh_init + + Type: REAL + Default: 1.D-14 + Description: Initial threshold for the solution of the linear + system (first iteration). Needed to converge the + bare (non-interacting) response function chi0. + The specified value will be multiplied by the + number of electrons in the system. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: ethr_nscf + + Type: REAL + Default: 1.D-11 + Description: Threshold for the convergence of eigenvalues during + the iterative diagonalization of the Hamiltonian in + the non-self-consistent-field (NSCF) calculation at + k and k+q points. Note, this quantity is NOT extensive. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: niter_max + + Type: INTEGER + Default: 100 + Description: Maximum number of iterations in the iterative + solution of the linear-response Kohn-Sham equations. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: alpha_mix(i) + + Type: REAL + Default: alpha_mix(1)=0.3 + Description: Mixing parameter (for the i-th iteration) for updating + the response SCF potential using the modified Broyden + method. See: D.D. Johnson, PRB 38, 12807 (1988). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: nmix + + Type: INTEGER + Default: 4 + Description: Number of iterations used in potential mixing + using the modified Broyden method. See: + D.D. Johnson, PRB 38, 12807 (1988). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: num_neigh + + Type: INTEGER + Default: 6 + Description: Number of nearest neighbors of every Hubbard atom which + will be considered when writting Hubbard V parameters to + the file parameters.out, which can be used in the + subsequent DFT+U+V calculation. This keyword is used only + for DFT+U+V (post-processing stage). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lmin + + Type: INTEGER + Default: 2 + Description: Minimum value of the orbital quantum number of the Hubbard + atoms starting from which (and up to the maximum l in the + system) Hubbard V will be written to the file parameters.out. + "lmin" refers to the orbital quantum number of the atom + corresponding to the first site-index in Hubbard_V(:,:,:). + This keyword is used only for DFT+U+V and only + in the post-processing stage. Example: "lmin"=1 corresponds to + writing to file V between e.g. oxygen (with p states) and its + neighbors, and including V between transition metals (with d + states) and their neighbors. Instead, when "lmin"=2 only the + latter will be written to parameters.out. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rmax + + Type: REAL + Default: 100.D0 + Description: Maximum distance (in Bohr) between two atoms to search + neighbors (used only at the postprocessing step for + DFT+U+V). This keyword is useful when there + are e.g. defects in the system. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: dist_thr + + Type: REAL + Default: 6.D-4 + Description: Threshold (in Bohr) for comparing inter-atomic distances + when reconstructing the missing elements of the response + susceptibility in the post-processing step. + +-------------------------------------------------------------------- + +===END OF NAMELIST====================================================== + + +This file has been created by helpdoc utility on Sat Mar 18 12:58:29 CET 2023 diff --git a/assets/calculations/qe7.2/INPUT_LD1.txt b/assets/calculations/qe7.2/INPUT_LD1.txt new file mode 100644 index 00000000..3b6e5ea8 --- /dev/null +++ b/assets/calculations/qe7.2/INPUT_LD1.txt @@ -0,0 +1,1269 @@ +*** FILE AUTOMATICALLY CREATED: DO NOT EDIT, CHANGES WILL BE LOST *** + +------------------------------------------------------------------------ +INPUT FILE DESCRIPTION + +Program: ld1.x / / Quantum ESPRESSO (version: 7.2) +------------------------------------------------------------------------ + + +Input data cards for ld1.x program: + +Always present: + 1 namelist &input + 1.1 optional cards for all-electron calculations + +Needed for PP generation: + 2 namelist &inputp + 2.1 additional cards for PP generation + +Needed for pseudo-potential (PP) test. optional for PP generation: + 3 namelist &test + 3.1 optional cards for PP test + + + +======================================================================== +NAMELIST: &INPUT + + THIS NAMELIST IS ALWAYS NEEDED ! + + +-------------------------------------------------------------------- + Variable: title + + Type: CHARACTER + Description: A string describing the job. + Status: OPTIONAL + +-------------------------------------------------------------------- + + ///--- + EITHER: + + +-------------------------------------------------------------------- + Variable: zed + + Type: REAL + See: atom + Description: The nuclear charge (1 < zed < 100). + + IMPORTANT: + Specify either "zed" OR "atom", not both! + +-------------------------------------------------------------------- + + OR: + + +-------------------------------------------------------------------- + Variable: atom + + Type: CHARACTER + See: zed + Description: Atomic symbol: atom='H', 'He', 'Be', etc. + + IMPORTANT: + Specify either "atom" OR "zed", not both! + +-------------------------------------------------------------------- + + \\\--- + + ///--- + RADIAL GRID PARAMETERS: + + +-------------------------------------------------------------------- + Variable: xmin + + Type: REAL + See: dx + Default: -7.0 if "iswitch">1 or "rel"=0, + -8.0 otherwise + Description: Radial grid parameter. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: dx + + Type: REAL + Description: Radial grid parameter. + + The radial grid is: r(i+1) = exp(xmin+i*dx)/zed a.u. + Default: 0.0125 if "iswitch">1, + 0.008 otherwise + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rmax + + Type: REAL + Description: Outermost grid point. + Default: 100.0 a.u. + +-------------------------------------------------------------------- + + \\\--- + + +-------------------------------------------------------------------- + Variable: beta + + Type: REAL + Description: parameter for potential mixing + Default: 0.2 + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: tr2 + + Type: REAL + Description: convergence threshold for scf + Default: 1e-14 + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: iswitch + + Type: INTEGER + Description: 1 all-electron calculation + 2 PP test calculation + 3 PP generation + 4 LDA-1/2 correction, needs a previously generated PP file + Default: 1 + +-------------------------------------------------------------------- + + ///--- + PARAMETERS FOR LOGARITHMIC DERIVATIVES: + + +-------------------------------------------------------------------- + Variable: nld + + Type: INTEGER + Description: the number of logarithmic derivatives to be calculated + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rlderiv + + Type: REAL + Description: radius (a.u.) at which logarithmic derivatives are calculated + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: eminld, emaxld + + Type: REAL + Description: Energy range (min, max energy, in Ry) at which + logarithmic derivatives are calculated. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: deld + + Type: REAL + Description: Delta e (Ry) of energy for logarithmic derivatives. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rpwe + + Type: REAL + Description: radius (a.u.) at which partial wave expansions are calculated + Default: rlderiv + +-------------------------------------------------------------------- + + If the above parameters are not specified, logarithmic + derivatives and partial wave expansions are not calculated. + + \\\--- + + +-------------------------------------------------------------------- + Variable: rel + + Type: INTEGER + Description: 0 ... non relativistic calculation + 1 ... scalar relativistic calculation + 2 ... full relativistic calculation with spin-orbit + Default: 0 for Z <= 18; + 1 for Z > 18 + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lsmall + + Type: LOGICAL + Default: .false. + Description: if .true. writes on files the small component + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: max_out_wfc + + Type: INTEGER + Default: 7 + Description: Maximum number of atomic wavefunctions written in the output + file. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: noscf + + Type: LOGICAL + Default: .false. + Description: if .true. the charge is not computed. The occupations are + not used and the eigenvalues and eigenfunctions are those + of a hydrogen-like atom. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lsd + + Type: INTEGER + Description: 0 ... non spin polarized calculation + 1 ... spin-polarized calculation + + BEWARE: + not allowed if "iswitch"=3 (PP generation) or with full + relativistic calculation + Default: 0 + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: dft + + Type: CHARACTER + Description: Exchange-correlation functional. + + Examples: + 'PZ' Perdew and Zunger formula for LDA + 'PW91' Perdew and Wang GGA + 'BP' Becke and Perdew GGA + 'PBE' Perdew, Becke and Ernzerhof GGA + 'BLYP' ... + + For the complete list, see module "functionals" in ../Modules/ + The default is 'PZ' for all-electron calculations, + it is read from the PP file in a PP calculation. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: latt + + Type: INTEGER + Description: 0 ... no Latter correction + 1 ... apply Latter correction + Default: 0 + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: isic + + Type: INTEGER + Description: 0 ... no Self-interaction correction + 1 ... apply Self-interaction correction + Default: 0 + Status: only for all-electron calculation + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rytoev_fact + + Type: REAL + Default: as specified in file Modules/constants.f90 + Description: Factor used to convert Ry into eV. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: cau_fact + + Type: REAL + Default: as specified in file Modules/constants.f90 + Description: Speed of light in a.u.. + + (Be careful the default value is always used in the + relativistic exchange.) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: vdw + + Type: LOGICAL + Default: .false. + Description: If .true., the frequency dependent polarizability and van der + Waals coefficient C6 will be computed in Thomas-Fermi and + von Weizsaecker approximation(only for closed-shell ions). + Status: Gradient-corrected DFT not yet implemented. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: prefix + + Type: CHARACTER + Default: 'ld1' + Description: Prefix for file names - only for output file names + containing the orbitals, logarithmic derivatives, tests + See below for file names and the content of the file. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: verbosity + + Type: CHARACTER + Default: 'low' + Description: 'low' or 'high' + + if 'high' with "iswitch"=2,3 prints separately core and + valence contributions to the energies. Print the + frozen-core energy. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: file_charge + + Type: CHARACTER + Default: ' ' + Description: Name of the file where the code writes the all-electron + total charge. No charge is written if file_charge=' '. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: config + + Type: CHARACTER + Default: ' ' + Description: A string with the electronic configuration. + + Example: + '[Ar] 3d10 4s2 4p2.5' + + * If "lsd"=1, spin-up and spin-down state may appear twice + with the respective occupancy: 3p4 3p2 = 4 up, + 2 down. Otherwise, the Hund's rule is assumed. + + * If "rel"=2, states with jj=l-1/2 are filled first. + If a state appears twice, the first one has jj=l-1/2, + the second one jj=l+1/2 (except S states) + (Use rel_dist if you want to average the electrons + over all available states.) + + * If config='default' the code uses "zed" to set the ground + state electronic configuration for the atom. + + Negative occupancies are used to flag unbound states; + they are not actually used. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: relpert + + Type: LOGICAL + Default: .false. + Description: If .true. the relativistic corrections to the non-relativistic + Kohn-Sham energy levels ("rel"=0 .and. "lsd"=0) are computed using + first-order perturbation theory in all-electron calculations. + The corrections consist of the following terms: + E_vel: velocity (p^4) correction + E_Dar: Darwin term + E_S-O: spin-orbit coupling + The spin-orbit term vanishes for s-electron states and gives + rise to a splitting of (2*l+1)*E_S-O for the other states. + The separate contributions are printed only if verbosity='high'. + + Formulas and notation are based on the Herman-Skillman book: + F. Herman and S. Skillman, "Atomic Structure Calculations", + Prentice-Hall, Inc., Englewood Cliffs, New Jersey, 1963 + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rel_dist + + Type: CHARACTER + Default: 'energy' + Description: 'energy' or 'average' + + * if 'energy' the relativistic l-1/2 states are filled first. + + * if 'average' the electrons are uniformly distributed + among all the states with the given l. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: write_coulomb + + Type: LOGICAL + Default: .false. + Description: If .true., a fake pseudo-potential file with name X.UPF, + where X is the atomic symbol, is written. It contains + the radial grid and the wavefunctions as specified in input, + plus the info needed to build the Coulomb potential + for an all-electron calculation - for testing only. + +-------------------------------------------------------------------- + +===END OF NAMELIST====================================================== + + +======================================================================== +CARD: + + IF CONFIG IS EMPTY THE ELECTRONIC CONFIGURATION IS READ FROM + THE FOLLOWING CARDS: + + ________________________________________________________________________ + * IF rel < 2 : + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + nwf + nl(1) n(1) l(1) oc(1) isw(1) + nl(2) n(2) l(2) oc(2) isw(2) + . . . + nl(nwf) n(nwf) l(nwf) oc(nwf) isw(nwf) + + ///////////////////////////////////////// + + + * ELSE IF rel = 2 : + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + nwf + nl(1) n(1) l(1) oc(1) jj(1) + nl(2) n(2) l(2) oc(2) jj(2) + . . . + nl(nwf) n(nwf) l(nwf) oc(nwf) jj(nwf) + + ///////////////////////////////////////// + + + ENDIF + ________________________________________________________________________ + + DESCRIPTION OF ITEMS: + + +-------------------------------------------------------------------- + Variable: nwf + + Type: INTEGER + Description: number of wavefunctions + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: nl + + Type: CHARACTER + Description: wavefunction label (e.g. 1s, 2s, etc.) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: n + + Type: INTEGER + Description: principal quantum number + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: l + + Type: INTEGER + Description: angular quantum number + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: oc + + Type: REAL + Description: occupation number + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: isw + + Type: INTEGER + Description: the spin index (1-2) used only in the lsda case + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: jj + + Type: REAL + Description: The total angular momentum (0.0 is allowed for complete + shells: the codes fills 2l states with jj=l-1/2, + 2l+2 with jj=l+1/2). + +-------------------------------------------------------------------- + +===END OF CARD========================================================== + + +======================================================================== +NAMELIST: &INPUTP + + +-------------------------------------------------------------------- + Variable: zval + + Type: REAL + Default: (calculated) + Description: Valence charge. + + zval is automatically calculated from available data. + If the value of zval is provided in input, it will be + checked versus the calculated value. The only case in + which you need to explicitly provide the value of zval + for noninteger zval (i.e. half core-hole pseudo-potentials). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: pseudotype + + Type: INTEGER + Description: 1 ... norm-conserving, single-projector PP + IMPORTANT: if pseudotype=1 all calculations are done + using the SEMILOCAL form, not the separable nonlocal form + + 2 ... norm-conserving PP in separable form (obsolescent) + All calculations are done using SEPARABLE non-local form + IMPORTANT: multiple projectors allowed but not properly + implemented, use only if you know what you are doing + + 3 ... ultrasoft PP or PAW + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: file_pseudopw + + Type: CHARACTER + Status: REQUIRED + Description: File where the generated PP is written. + + * if the file name ends with "upf" or "UPF", + or in any case for spin-orbit PP (rel=2), + the file is written in UPF format; + + * if the file name ends with 'psp' it is + written in native CPMD format (this is currently + an experimental feature); otherwise it is written + in the old "NC" format if pseudotype=1, or + in the old RRKJ format if pseudotype=2 or 3 + (no default, must be specified). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: file_recon + + Type: CHARACTER + Description: File containing data needed for GIPAW reconstruction + of all-electron wavefunctions from PP results. + If you want to use additional states to perform the + reconstruction, add them at the end of the list + of all-electron states. + Default: ' ' + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lloc + + Type: INTEGER + Default: -1 + Description: Angular momentum of the local channel. + + * lloc=-1 or lloc=-2 pseudizes the all-electron potential + if lloc=-2 the original recipe of Troullier-Martins + is used (zero first and second derivatives at r=0) + * lloc>-1 uses the corresponding channel as local PP + + NB: if lloc>-1, the corresponding channel must be the last in the + list of wavefunctions appearing after the namelist &inputp + In the relativistic case, if lloc > 0 both the j=lloc-1/2 and + the j=lloc+1/2 wavefunctions must be at the end of the list. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rcloc + + Type: REAL + Status: Must be specified only if "lloc"=-1, otherwise the + corresponding value of "rcut" is used. + Description: Matching radius (a.u.) for local pseudo-potential (no default). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: nlcc + + Type: LOGICAL + Default: .false. + Description: If .true. produce a PP with the nonlinear core + correction of Louie, Froyen, and Cohen + [PRB 26, 1738 (1982)]. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: new_core_ps + + Type: LOGICAL + Default: .false. + Status: requires nlcc=.true. + Description: If .true. pseudizes the core charge with bessel functions. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rcore + + Type: REAL + Description: Matching radius (a.u.) for the smoothing of the core charge. + If not specified, the matching radius is determined + by the condition: rho_core(rcore) = 2*rho_valence(rcore) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: tm + + Type: LOGICAL + Default: .false. + Description: * .true. for Troullier-Martins pseudization [PRB 43, 1993 (1991)] + + * .false. for Rappe-Rabe-Kaxiras-Joannopoulos pseudization + [PRB 41, 1227 (1990), erratum PRB 44, 13175 (1991)] + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rho0 + + Type: REAL + Description: Charge at the origin: when the Rappe-Rabe-Kaxiras-Joannopoulos + method with 3 Bessel functions fails, specifying rho0 > 0 + may allow to override the problem (using 4 Bessel functions). + Typical values are in the order of 0.01-0.02 + Default: 0.0 + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lpaw + + Type: LOGICAL + Description: If .true. produce a PAW dataset, experimental feature + only for "pseudotype"=3 + Default: .false. + +-------------------------------------------------------------------- + + ///--- + +-------------------------------------------------------------------- + Variable: which_augfun + + Type: CHARACTER + Default: 'AE' for Vanderbilt-Ultrasoft pseudo-potentials and 'BESSEL' for PAW datasets. + Description: If different from 'AE' the augmentation functions are pseudized + before "rmatch_augfun". The pseudization options are: + + * 'PSQ' Use Bessel functions to pseudize Q + from the origin to rmatch_augfun. + + These features are available only for PAW: + + * 'BESSEL' Use Bessel functions to pseudize the Q. + * 'GAUSS' Use 2 Gaussian functions to pseudize the Q. + * 'BG' Use original Bloechl's recipe with a single gaussian. + + Note: if lpaw is true and which_augfun is set to AE real all- + electron charge will be used, which will produce extremely + hard augmentation. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rmatch_augfun + + Type: REAL + Default: 0.5 a.u. + Status: Used only if which_augfun is different from 'AE'. + Description: Pseudization radius for the augmentation functions. Presently + it has the same value for all L. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rmatch_augfun_nc + + Type: REAL + Default: .false. + Status: Used only if which_augfun is 'PSQ'. + Description: If .true. the augmentation functions are pseudized + from the origin to min(rcut(ns),rcut(ns1)) where ns + and ns1 are the two channels for that Q. In this case + rmatch_augfun is not used. + +-------------------------------------------------------------------- + + \\\--- + + +-------------------------------------------------------------------- + Variable: lsave_wfc + + Type: LOGICAL + Default: .false. if .not. lpaw, otherwise .true. + Description: Set it to .true. to save all-electron and pseudo wavefunctions + used in the pseudo-potential generation in the UPF file. Only + works for UPFv2 format. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lgipaw_reconstruction + + Type: LOGICAL + Default: .false. + Description: Set it to .true. to generate pseudo-potentials containing the + additional info required for reconstruction of all-electron + orbitals, used by GIPAW. You will typically need to specify + additional projectors beyond those used in the generation of + pseudo-potentials. You should also specify "file_recon". + + All projectors used in the reconstruction must be listed BOTH + in the test configuration after namelist &test AND in the + all-electron configuration (variable 'config', namelist &inputp, + Use negative occupancies for projectors on unbound states). The + core radii in the test configuration should be the same as in + the pseudo-potential generation section and will be used as the + radius of reconstruction. Projectors not used to generate the + pseudo-potential should have zero occupation number. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: use_paw_as_gipaw + + Type: LOGICAL + Default: .false. + Description: When generating a PAW dataset, setting this option to .true. will + save the core all-electron wavefunctions to the UPF file. + The GIPAW reconstruction to be performed using the PAW data and + projectors for the valence wavefunctions. + + In the default case, the GIPAW valence wavefunction and projectors + are independent from the PAW ones and must be then specified as + explained above in lgipaw_reconstruction. + + Setting this to .true. always implies "lgipaw_reconstruction" = .true. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: author + + Type: CHARACTER + Description: Name of the author. + Default: 'anonymous' + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: file_chi + + Type: CHARACTER + Description: file containing output PP chi functions + Default: ' ' + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: file_beta + + Type: CHARACTER + Description: file containing output PP beta functions + Default: ' ' + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: file_qvan + + Type: CHARACTER + Description: file containing output PP qvan functions + Default: ' ' + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: file_screen + + Type: CHARACTER + Description: file containing output screening potential + Default: ' ' + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: file_core + + Type: CHARACTER + Description: file containing output total and core charge + Default: ' ' + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: file_wfcaegen + + Type: CHARACTER + Description: file with the all-electron wfc for generation + Default: ' ' + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: file_wfcncgen + + Type: CHARACTER + Description: file with the norm-conserving wfc for generation + Default: ' ' + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: file_wfcusgen + + Type: CHARACTER + Description: file with the ultra-soft wfc for generation + Default: ' ' + +-------------------------------------------------------------------- + +===END OF NAMELIST====================================================== + + +======================================================================== +CARD: + + ________________________________________________________________________ + * IF rel=0 OR rel=2 : + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + nwfs + nls(1) nns(1) lls(1) ocs(1) ener(1) rcut(1) rcutus(1) jjs(1) + nls(2) nns(2) lls(2) ocs(2) ener(2) rcut(2) rcutus(2) jjs(2) + . . . + nls(nwfs) nns(nwfs) lls(nwfs) ocs(nwfs) ener(nwfs) rcut(nwfs) rcutus(nwfs) jjs(nwfs) + + ///////////////////////////////////////// + + * if "lloc">-1 the state with "lls"="lloc" must be the last + + * if "lloc">0 in the relativistic case, both states with "jjs"="lloc"-1/2 + and "jjs"="lloc"+1/2 must be the last two + + + * ELSE : + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + nwfs + nls(1) nns(1) lls(1) ocs(1) ener(1) rcut(1) rcutus(1) + nls(2) nns(2) lls(2) ocs(2) ener(2) rcut(2) rcutus(2) + . . . + nls(nwfs) nns(nwfs) lls(nwfs) ocs(nwfs) ener(nwfs) rcut(nwfs) rcutus(nwfs) + + ///////////////////////////////////////// + + + ENDIF + ________________________________________________________________________ + + DESCRIPTION OF ITEMS: + + +-------------------------------------------------------------------- + Variable: nwfs + + Type: INTEGER + Description: number of wavefunctions to be pseudized + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: nls + + Type: CHARACTER + Description: Wavefunction label (same as in the all-electron configuration). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: nns + + Type: INTEGER + Description: Principal quantum number (referred to the PSEUDOPOTENTIAL case; + nns=1 for lowest s, nns=2 for lowest p, and so on). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lls + + Type: INTEGER + Description: Angular momentum quantum number. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: ocs + + Type: REAL + Description: Occupation number (same as in the all-electron configuration). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: ener + + Type: REAL + Description: Energy (Ry) used to pseudize the corresponding state. + If 0.d0, use the one-electron energy of the all-electron state. + Do not use 0.d0 for unbound states! + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rcut + + Type: REAL + Description: Matching radius (a.u.) for norm conserving PP. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rcutus + + Type: REAL + Description: Matching radius (a.u.) for ultrasoft PP - only for pseudotype=3. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: jjs + + Type: REAL + Description: The total angular momentum (0.0 is allowed for complete shells). + +-------------------------------------------------------------------- + +===END OF CARD========================================================== + + +======================================================================== +NAMELIST: &TEST + + NEEDED ONLY IF "ISWITCH"=2 OR "ISWITCH"=4, OPTIONAL IF "ISWITCH"=3 + + +-------------------------------------------------------------------- + Variable: nconf + + Type: INTEGER + Description: the number of configurations to be tested. For "iswitch"=4 nconf=2 + Default: 1 + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: file_pseudo + + Type: CHARACTER + Status: ignored if "iswitch"=3 + Description: File containing the PP. + + * If the file name contains ".upf" or ".UPF", + the file is assumed to be in UPF format; + + * else if the file name contains ".rrkj3" or ".RRKJ3", + the old RRKJ format is first tried; + + * otherwise, the old NC format is read. + + IMPORTANT: in the latter case, all calculations are done + using the SEMILOCAL form, not the separable nonlocal form. + Use the UPF format if you want to test the separable form! + Default: ' ' + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: ecutmin, ecutmax, decut + + Type: REAL + Default: decut=5.0 Ry; ecutmin=ecutmax=0Ry + Status: specify "ecutmin" and "ecutmax" if you want to perform this test + Description: Parameters (Ry) used for test with a basis set of spherical + Bessel functions j_l(qr) . The hamiltonian at fixed scf + potential is diagonalized for various values of ecut: + "ecutmin", "ecutmin"+"decut", "ecutmin"+2*"decut" ... up to "ecutmax". + This yields an indication of convergence with the + corresponding plane-wave cutoff in solids, and shows + in an unambiguous way if there are "ghost" states + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rm + + Type: REAL + Description: Radius of the box used with spherical Bessel functions. + Default: 30 a.u. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: configts(i), i=1,nconf + + Type: CHARACTER + Description: A string array containing the test electronic configuration. + "configts"(nc), nc=1,"nconf", has the same syntax as for "config" + but only VALENCE states must be included. + If "configts"(i) is not set, the electron configuration + is read from the cards following the namelist. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lsdts(i), i=1,nconf + + Type: INTEGER + Default: 1 + See: lsd + Description: 0 or 1. It is the value of lsd used in the i-th test. + Allows to make simultaneously spin-polarized and + spin-unpolarized tests. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: frozen_core + + Type: LOGICAL + Default: .false. + Description: If .true. only the core wavefunctions of the first + configuration are calculated. The eigenvalues, orbitals + and energies of the other configurations are calculated + with the core of the first configuration. + The first configuration must be spin-unpolarized. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rcutv + + Type: REAL + Description: Cutoff distance (CUT) for the inclusion of LDA-1/2 potential. + Needed (mandatory) only if "iswitch" = 4 + Default: -1.0 + +-------------------------------------------------------------------- + +===END OF NAMELIST====================================================== + + +======================================================================== +CARD: + + IMPORTANT: THIS CARD HAS TO BE SPECIFIED FOR EACH MISSING CONFIGTS(I) + + ________________________________________________________________________ + * IF lsd=1 : + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + nwfts + elts(1) nnts(1) llts(1) octs(1) enerts(1) rcutts(1) rcutusts(1) iswts(1) + elts(2) nnts(2) llts(2) octs(2) enerts(2) rcutts(2) rcutusts(2) iswts(2) + . . . + elts(nwfts) nnts(nwfts) llts(nwfts) octs(nwfts) enerts(nwfts) rcutts(nwfts) rcutusts(nwfts) iswts(nwfts) + + ///////////////////////////////////////// + + + * ELSE IF rel=2 : + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + nwfts + elts(1) nnts(1) llts(1) octs(1) enerts(1) rcutts(1) rcutusts(1) jjts(1) + elts(2) nnts(2) llts(2) octs(2) enerts(2) rcutts(2) rcutusts(2) jjts(2) + . . . + elts(nwfts) nnts(nwfts) llts(nwfts) octs(nwfts) enerts(nwfts) rcutts(nwfts) rcutusts(nwfts) jjts(nwfts) + + ///////////////////////////////////////// + + + * ELSE : + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + nwfts + elts(1) nnts(1) llts(1) octs(1) enerts(1) rcutts(1) rcutusts(1) + elts(2) nnts(2) llts(2) octs(2) enerts(2) rcutts(2) rcutusts(2) + . . . + elts(nwfts) nnts(nwfts) llts(nwfts) octs(nwfts) enerts(nwfts) rcutts(nwfts) rcutusts(nwfts) + + ///////////////////////////////////////// + + + ENDIF + ________________________________________________________________________ + + DESCRIPTION OF ITEMS: + + +-------------------------------------------------------------------- + Variable: nwfts + + Type: INTEGER + Description: number of wavefunctions + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: elts + + Type: CHARACTER + See: nls + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: nnts + + Type: INTEGER + See: nns + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: llts + + Type: INTEGER + See: lls + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: octs + + Type: REAL + See: ocs + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: enerts + + Type: REAL + Status: not used + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rcutts + + Type: REAL + Status: not used + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rcutusts + + Type: REAL + Status: not used + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: iswts + + Type: INTEGER + Description: spin index (1 or 2, used in lsda case) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: jjts + + Type: REAL + Description: total angular momentum of the state + +-------------------------------------------------------------------- + +===END OF CARD========================================================== + + + +:::: Notes + + For PP generation you do not need to specify namelist &test, UNLESS: + + 1. you want to use a different configuration for unscreening wrt the + one used to generate the PP. This is useful for PP with semicore + states: use semicore states ONLY to produce the PP, use semicore + AND valence states (if occupied) to make the unscreening + + 2. you want to specify some more states for PAW style reconstruction of + all-electron orbitals from pseudo-orbitals + + + ::: Output files written + + * file_tests "prefix".test results of transferability test + + for each testing configuration N: + + * file_wavefunctions "prefix"N.wfc all-electron KS orbitals + * file_wavefunctionsps "prefix"Nps.wfc pseudo KS orbitals + + if lsd=1: + + * file_wavefunctions "prefix"N.wfc.up all-electron KS up orbitals + * file_wavefunctions "prefix"N.wfc.dw all-electron KS down orbitals + + if rel=2 and lsmall=.true.: + + * file_wavefunctions "prefix".wfc.small all-electron KS small component + + if parameters for logarithmic derivatives are specified: + + * file_logder "prefix"Nps.dlog all-electron logarithmic derivatives + * file_logderps "prefix"Nps.dlog pseudo logarithmic derivatives + + "N" is not present if there is just one testing configuration. + + + + ::: Recipes to reproduce old all-electron atomic results with the ld1 program + + * The Hartree results in Phys. Rev. 59, 299 (1940) or in + Phys. Rev. 59, 306 (1940) can be reproduced with: + + rel=0, + isic=1, + dft='NOX-NOC' + + * The Herman-Skillman tables can be reproduced with: + + rel=0, + isic=0, + latt=1, + dft='SL1-NOC' + + * Data on the paper Liberman, Waber, Cromer Phys. Rev. 137, A27 (1965) can be + reproduced with: + + rel=2, + isic=0, + latt=1, + dft='SL1-NOC' + + * Data on the paper S. Cohen Phys. Rev. 118, 489 (1960) can be reproduced with: + + rel=2, + isic=1, + latt=0, + dft='NOX-NOC' + + * The revised PBE described in PRL 80, 890 (1998) can be obtained with: + + isic=0 + latt=0 + dft='SLA-PW-RPB-PBC' or 'dft='revPBE' + + * The relativistic energies of closed shell atoms reported in PRB 64 235126 (2001) + can be reproduced with: + + isic=0 + latt=0 + cau_fact=137.0359895 + dft='sla-vwn' for the LDA case + dft='PBE' for the PBE case + + * The NIST results in PRA 55, 191 (1997): + + LDA: + rel=0 + dft='sla-vwn' + + LSD: + rel=0 + lsd=1 + dft='sla-vwn' + + RLDA + rel=2 + rel_dist='average' + dft='rxc-vwn' + + ScRLDA: + rel=1 + dft='rxc-vwn' + + + +This file has been created by helpdoc utility on Sat Mar 18 13:46:52 CET 2023 diff --git a/assets/calculations/qe7.2/INPUT_OSCDFT.txt b/assets/calculations/qe7.2/INPUT_OSCDFT.txt new file mode 100644 index 00000000..40f7de37 --- /dev/null +++ b/assets/calculations/qe7.2/INPUT_OSCDFT.txt @@ -0,0 +1,694 @@ +*** FILE AUTOMATICALLY CREATED: DO NOT EDIT, CHANGES WILL BE LOST *** + +------------------------------------------------------------------------ +INPUT FILE DESCRIPTION + +Program: pw.x with OS-CDFT / PWscf / Quantum ESPRESSO (version: 7.2) +------------------------------------------------------------------------ + + + +:::: ABOUT + + OS-CDFT allows control of the oxidation state of a transition metal element by + constraining the occupation numbers. + For information on the method, see ""://doi.org/10.1021/acs.jctc.9b00281 + C. Ku, P. H. L. Sit, J. Chem. Theory Comput. 2019, 15, 9, 4781-4789 + + + +:::: COMPILATION + + Using autoconf: + ./configure ... + nano make.inc # append -D__OSCDFT into DFLAGS = ... (or MANUAL_DFLAGS = ...) + make pw pp ... + + Using cmake: + cmake -DQE_ENABLE_OSCDFT=ON ... + make pw pp ... + + + +:::: USAGE + + Requires oscdft.in file, described below, in the same directory as where the pw.x command is ran. + pw.x -inp -oscdft ... + + +Input data format: { } = optional, [ ] = it depends, | = or + +Structure of the oscdft.in file: +=============================================================================== + + &OSCDFT + ... + / + + TARGET_OCCUPATION_NUMBERS + see "TARGET_OCCUPATION_NUMBERS" + + [ GAMMA_VAL + gamma_val(1) + ... + gamma_val(n_oscdft) ] + + + +======================================================================== +NAMELIST: &OSCDFT + + +-------------------------------------------------------------------- + Variable: n_oscdft + + Type: INTEGER + Status: REQUIRED + Description: Number of entries of the "TARGET_OCCUPATION_NUMBERS" card. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: get_ground_state_first + + Type: LOGICAL + Default: .FALSE. + Description: If .TRUE., perform an scf calculation to convergence before applying constraint. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: warm_up_niter + + Type: INTEGER + Default: 0 + Description: Runs warm_up_niter scf iterations first before applying constraint. + If "get_ground_state_first" is .TRUE. then scf convergence is achieved first + before running "warm_up_niter" scf iterations without applying the constraints. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: convergence_type + + Type: CHARACTER + Default: 'gradient' + Description: + The variable that is checked for convergence with the convergence threshold. + + 'multipliers' : + Converges when the change in multipliers between iterations + is less than the threshold. + + 'gradient' : + Converges when (occupation number - target occupation number) + is less than the threshold. + + 'energy' : + Converges when the change in total energy between iterations + is less than the threshold. + + 'always_false' : + Never converges (for debugging). + + 'always_true' : + Always converges (for debugging). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: iteration_type + + Type: INTEGER + Status: REQUIRED + Description: + Order of charge density and OS-CDFT multipliers optimizations. + + 0 : + OS-CDFT multipliers optimization is a micro-iteration inside + the charge density iteration. The convergence threshold of the + OS-CDFT multipliers iterations can be set to start loose at + "max_conv_thr" and gradually tighten to a minimum of "min_conv_thr" + by multiplying the threshold with "conv_thr_multiplier" after + every successful OS-CDFT multipliers iteration. A final + convergence threshold of "final_conv_thr" can also be set + to prevent the charge density iteration from converging when + the OS-CDFT convergence test is larger than "final_conv_thr". + + 1 : + Charge density optimization is a micro-iteration inside the + OS-CDFT multiplier optimization. The convergence threshold of + the OS-CDFT multipliers is set by "max_conv_thr". + "min_conv_thr", "conv_thr_multiplier", and "final_conv_thr" are + ignored. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: optimization_method + + Type: CHARACTER + Default: 'gradient descent' + Description: + Method to update the OS-CDFT multipliers. + + 'gradient descent' : + multipliers -= "min_gamma_n" + * (occupation number - target occupation number) + + 'gradient descent2' : + multipliers -= "gamma_val" * "min_gamma_n" + * (occupation number - target occupation number) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: array_convergence_func + + Type: CHARACTER + Default: 'maxval' + Description: + Specify the method of multiple values to scalar for convergence test + when "convergence_type" is either 'gradient' or 'multipliers'. + + 'maxval' : + Takes the maximum of the "convergence_type" before comparing with + threshold. + + 'norm' : + Takes the root sum squared of the "convergence_type" before + comparing with threshold. + + 'rms' : + Takes the root mean squared of the "convergence_type" before + comparing with threshold. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: max_conv_thr + + Type: DOUBLE + Default: 1.D-1 + Description: If "iteration_type" is 0, this is the starting convergence threshold. + If "iteration_type" is 1, this is the convergence threshold. + See "iteration_type" for more explanations. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: min_conv_thr + + Type: DOUBLE + Default: 1.D-3 + Description: If "iteration_type" is 0, this is the minimum convergence threshold. + If "iteration_type" is 1, this is ignored. + See "iteration_type" for more explanations. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: final_conv_thr + + Type: DOUBLE + Default: -1.D0 + Description: If "iteration_type" is 0 and "final_conv_thr" > 0.D0, the charge density + convergence is prevented when the OS-CDFT convergence test is + larger than "final_conv_thr". Otherwise, this is ignored. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: conv_thr_multiplier + + Type: DOUBLE + Default: 0.5D0 + Description: If "iteration_type" is 0, see "iteration_type" for explanations. + Otherwise, this is ignored. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: print_occupation_matrix + + Type: LOGICAL + Default: .FALSE. + Description: If .TRUE., prints the occupation matrices. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: print_occupation_eigenvectors + + Type: LOGICAL + Default: .FALSE. + Description: If .TRUE., prints the occupation eigenvectors. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: min_gamma_n + + Type: DOUBLE + Default: 1.D0 + Description: Learning rate of optimizations. See "optimization_method". + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: has_min_multiplier + + Type: LOGICAL + Default: .FALSE. + Description: If .TRUE., sets the minimum value of the OS-CDFT multipliers + to "min_multiplier". + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: min_multiplier + + Type: DOUBLE + Status: REQUIRED if "has_min_multiplier" is .TRUE. + Description: Minimum value of the OS-CDFT multipliers. + Enabled using "has_min_multiplier" + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: has_max_multiplier + + Type: LOGICAL + Default: .FALSE. + Description: If .TRUE., sets the maximum value of the OS-CDFT multipliers + to "max_multiplier". + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: max_multiplier + + Type: DOUBLE + Status: REQUIRED if "has_max_multiplier" is .TRUE. + Description: Maximum value of the OS-CDFT multipliers. + Enabled using "has_max_multiplier" + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: miniter + + Type: INTEGER + Default: 0 + Description: Minimum OS-CDFT iterations. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: maxiter + + Type: INTEGER + Default: 0 + Description: Maximum OS-CDFT iterations. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: swapping_technique + + Type: CHARACTER + Default: 'none' + Description: + See ""://doi.org/10.1021/acs.jctc.9b00281 + + 'none' : + No swapping technique. + Always chooses the occupation number in ascending order. + + 'permute' : + Chooses the occupation number associated with the + occupation eigenvector that is most similar compared + to previous iteration (using dot product) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: print_debug + + Type: LOGICAL + Default: .FALSE. + Description: If .TRUE., prints additional debug informations. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: orthogonalize_swfc + + Type: LOGICAL + Default: .FALSE. + Description: If .TRUE., uses Lowdin orthogonalized atomic orbitals. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: normalize_swfc + + Type: LOGICAL + Default: .FALSE. + Description: If .TRUE., uses Lowdin normalized atomic orbitals. + Atomic orbitals are not orthogonalized in this case. + +-------------------------------------------------------------------- + +===END OF NAMELIST====================================================== + + +======================================================================== +CARD: TARGET_OCCUPATION_NUMBERS + + SPECIFIES THE OS-CDFT CONSTRAINT TO APPLY. + ALSO ALLOWS PRINTING OF OCCUPATION MATRIX WITHOUT APPLYING OS-CDFT CONSTRAINTS. + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + TARGET_OCCUPATION_NUMBERS + applied(1) spin(1) orbital_desc(1) [ constr_idx(1) target(1) start_mul(1) { start_index(1) } ] + applied(2) spin(2) orbital_desc(2) [ constr_idx(2) target(2) start_mul(2) { start_index(2) } ] + . . . + applied(n_oscdft) spin(n_oscdft) orbital_desc(n_oscdft) [ constr_idx(n_oscdft) target(n_oscdft) start_mul(n_oscdft) { start_index(n_oscdft) } ] + + ///////////////////////////////////////// + + DESCRIPTION OF ITEMS: + + +-------------------------------------------------------------------- + Variable: applied + + Type: CHARACTER + Status: REQUIRED + Description: + T : + Applies a constraint. + + "spin", "orbital_desc", "constr_idx", "target", + and "start_mul" are requried. + "spin" is optional. + + F : + Just prints the occupation number. + + Only "spin" and "orbital_desc" are requried. + Others are ignored. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: spin + + Type: CHARACTER + Status: REQUIRED + Description: + 1, UP : + Spin up channel + + 2, DOWN : + Spin down channel + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: orbital_desc + + Type: CHARACTER + Status: REQUIRED + Description: Orbitals included in the occupation number + + Syntax of the orbital descriptor: + atom_index(manifold...)... + + Where: + atom_index = atom index in the order of ATOMIC_POSITIONS + manifold = principal and azimuthal quantum numbers + (can specify more than one manifolds) + (eg. 3d, 2s2p) + + Examples: + 5(3d) describes a 5x5 occupation matrix which includes: + - 3d orbital of atom 5. + + 3(2s2p) describes a 4x4 occupation matrix which includes: + - 2s orbital of atom 3. + - 2p orbital of atom 3. + + Additional notes: See ADDITIONAL NOTES below. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: constr_idx + + Type: VARIOUS + Status: REQUIRED if "applied"(I) == T + Description: Specifies how the constraint is applied: + + To apply a constraint on an occupation number: + Write the index of the occupation numbers, sorted in ascending order, + where the OS-CDFT constraint is applied. + See "swapping_technique". + + Example: + Apply a constraint to the 5th spin-up occupation number of + the 3d orbital of atom 2 to a target of 0.9 + &OSCDFT + n_oscdft=1 + ... + / + TARGET_OCCUPATION_NUMBERS + T UP 2(3d) 5 0.9 0.0 + + To apply a constraint on the trace of the occupation matrix: + Write trace for this variable. + "swapping_technique" is ignored when this is used. + + Example: + Apply a constraint to the trace of the spin-up occupation number of + the 3d orbital of atom 2 to a target of 3.2 + &OSCDFT + n_oscdft=1 + ... + / + TARGET_OCCUPATION_NUMBERS + T UP 2(3d) trace 3.2 0.0 + + To apply a cosntraint on the sum of occupation numbers: + sum number orbital_index row_index(1) ... row_index(number-1) + Applies constraint on orbital_index-th occupation number + of the occupation matrix. + However, the occupation number inputted to the optimization subroutines + is the sum of this orbital index along with the occupation number of + row_index(1) ... row_index(number-1) + "swapping_technique" is ignored when this is used. + + Example: + Apply a constraint to the sum of the 3rd, 4th, and 5th + occupation numbers of the 3d orbital of atom 2 to a target of 2.8 + &OSCDFT + n_oscdft=3 + ... + / + TARGET_OCCUPATION_NUMBERS + T UP 2(3d) sum 3 3 2 3 2.8 0.0 + T UP 2(3d) sum 3 4 1 3 2.8 0.0 + T UP 2(3d) sum 3 5 1 2 2.8 0.0 + + Explanation: + Row 1: Applies constraint to 3rd occupation number. However, the multiplier is + optimized until the sum of the 3rd occupation number, along with the + occupation numbers of row 2 and row 3 of the "TARGET_OCCUPATION_NUMBERS" + card equals 2.8 + Row 2: Applies constraint to 4th occupation number. However, the multiplier is + optimized until the sum of the 4th occupation number, along with the + occupation numbers of row 1 and row 3 of the "TARGET_OCCUPATION_NUMBERS" + card equals 2.8 + Row 3: Applies constraint to 5th occupation number. However, the multiplier is + optimized until the sum of the 5th occupation number, along with the + occupation numbers of row 1 and row 2 of the "TARGET_OCCUPATION_NUMBERS" + card equals 2.8 + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: target + + Type: DOUBLE + Status: REQUIRED if "applied"(I) == T + Description: The target occupation number for the constraint. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: start_mul + + Type: DOUBLE + Status: REQUIRED if "applied"(I) == T + Description: Starting value of the multiplier. + For normal operations, set this to 0.D0. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: start_index + + Type: INTEGER + Default: 1 + Description: If "iteration_type" is 0, delays the application of this + row of OS-CDFT constraint until the rest of the constraint is + converged. Otherwise, this is ignored. + + Example ("n_oscdft" = 4): + TARGET_OCCUPATION_NUMBERS + T UP 3(3d) 5 0.9 0.0 1 + T UP 4(3d) 5 0.9 0.0 1 + T UP 5(3d) 5 0.9 0.0 2 + T UP 6(3d) 5 0.9 0.0 3 + The constraints on atom 3 and 4 are applied first until convergence. + Then, the constraints on atom 3, 4, and 5 are applied until convergence. + Finally, the constraints on atom 3, 4, 5, and 6 are applied until convergence. + +-------------------------------------------------------------------- + +===END OF CARD========================================================== + + +======================================================================== +CARD: GAMMA_VAL + + CONDITIONAL CARD, USED ONLY IF "OPTIMIZATION_METHOD" == 'GRADIENT DESCENT2', IGNORED OTHERWISE ! + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + GAMMA_VAL + gamma_val(1) + gamma_val(2) + . . . + gamma_val(n_oscdft) + + ///////////////////////////////////////// + + DESCRIPTION OF ITEMS: + + +-------------------------------------------------------------------- + Variable: gamma_val + + Type: DOUBLE + Status: REQUIRED if "optimization_method" == 'gradient descent2' + Description: This sets the learning rate for each multipliers, + allowing different learning rate for each multipliers. + See "optimization_method" for more details. + +-------------------------------------------------------------------- + +===END OF CARD========================================================== + + + +:::: ADDITIONAL NOTES + + 1. The default values are the recommeded options for "convergence_type" + and "array_convergence_func" + + 2. When using diagonalization='davidson', OS-CDFT may fail with + 'S matrix not positive definite' as an error. When that occurs, + use diagonalization='cg'. + + 3. Use "iteration_type"=0 for most cases. "iteration_type"=0 is faster, + due to the ability to gradually tighten the convergence threshold. + However, "iteration_type"=1 is more robust. + + 4. "orbital_desc" in the "TARGET_OCCUPATION_NUMBERS" card: + While one "orbital_desc" can be composed of multiple atoms, + the occupation number may not be accurate. + For example, 5(3d)6(2s2p) will be accepted, however the + atomic wavefunction of atom 5 and atom 6 may not be orthogonal. + (unless "orthogonalize_swfc" is .true.) + + + +:::: ADDITIONAL EXAMPLES FOR TARGET_OCCUPATION_NUMBERS + + Input File: + &OSCDFT + n_oscdft=2 + ... + / + TARGET_OCCUPATION_NUMBERS + T UP 5(3d) 5 0.9075202 0.0 + F DOWN 5(3d) + Explanations: + Row 1: Apply a constraint on the 5th spin-up occupation number of the + 3d orbital of atom 5 to a target of 0.9075202 + Row 2: Print the occupation numbers of the spin-down occupation numbers + of the 3d orbital of atom 5 + + + Input File: + &OSCDFT + n_oscdft=2 + ... + / + TARGET_OCCUPATION_NUMBERS + F UP 1(3d) + T DOWN 1(3d) 5 0.9369434 0.0 + F UP 2(3d) + T DOWN 2(3d) 5 0.261727 0.0 + Explanations: + Row 1: Print the occupation numbers of the spin-up occupation numbers of the + 3d orbital of atom 1 + Row 2: Apply a constraint on the 5th spin-down occupation number of the + 3d orbital of atom 1 to a target of 0.9369434 + Row 3: Print the occupation numbers of the spin-up occupation numbers of the + 3d orbital of atom 2 + Row 4: Apply a constraint on the 5th spin-down occupation number of the + 3d orbital of atom 2 to a target of 0.261727 + + + Input File: + &OSCDFT + n_oscdft=7 + ... + / + TARGET_OCCUPATION_NUMBERS + T UP 9(3d) sum 4 2 2 3 4 4.0135939 0.0 + T UP 9(3d) sum 4 3 1 3 4 4.0135939 0.0 + T UP 9(3d) sum 4 4 1 2 4 4.0135939 0.0 + T UP 9(3d) sum 4 5 1 2 3 4.0135939 0.0 + F DOWN 9(3d) + F UP 16(3d) + F DOWN 16(3d) + Explanations: + Row 1-4: Apply a constraint on the sum of the 2nd, 3rd, 4th, and 5th spin-up + occupation number of the 3d orbital of atom 9 to a target of 4.0135939 + Row 5 : Print the occupation numbers of the spin-down occupation numbers of the + 3d orbital of atom 9 + Row 6 : Print the occupation numbers of the spin-up occupation numbers of the + 3d orbital of atom 16 + Row 7 : Print the occupation numbers of the spin-down occupation numbers of the + 3d orbital of atom 16 + + + Input File: + &OSCDFT + n_oscdft=7 + ... + / + TARGET_OCCUPATION_NUMBERS + F UP 9(3d) + F DOWN 9(3d) + T UP 16(3d) sum 4 2 4 5 6 4.0135939 0.0 + T UP 16(3d) sum 4 3 3 5 6 4.0135939 0.0 + T UP 16(3d) sum 4 4 3 4 6 4.0135939 0.0 + T UP 16(3d) sum 4 5 3 4 5 4.0135939 0.0 + F DOWN 16(3d) + Explanations: + Row 1 : Print the occupation numbers of the spin-up occupation numbers of the + 3d orbital of atom 9 + Row 2 : Print the occupation numbers of the spin-down occupation numbers of the + 3d orbital of atom 9 + Row 3-6: Apply a constraint on the sum of the 2nd, 3rd, 4th, and 5th spin-up + occupation number of the 3d orbital of atom 16 to a target of 4.0135939 + Row 7 : Print the occupation numbers of the spin-down occupation numbers of the + 3d orbital of atom 16 + + + Input File: + &OSCDFT + n_oscdft=7 + ... + / + TARGET_OCCUPATION_NUMBERS + T UP 39(3d) sum 4 2 2 3 4 4.0135939 0.0 + T UP 39(3d) sum 4 3 1 3 4 4.0135939 0.0 + T UP 39(3d) sum 4 4 1 2 4 4.0135939 0.0 + T UP 39(3d) sum 4 5 1 2 3 4.0135939 0.0 + T DOWN 39(3d) sum 3 3 6 7 3.0020503 0.0 + T DOWN 39(3d) sum 3 4 5 7 3.0020503 0.0 + T DOWN 39(3d) sum 3 5 5 6 3.0020503 0.0 + Explanations: + Row 1-4: Apply a constraint on the sum of the 2nd, 3rd, 4th, and 5th spin-up + occupation number of the 3d orbital of atom 39 to a target of 4.0135939 + Row 5-7: Apply a constraint on the sum of the 3rd, 4th, and 5th spin-down + occupation number of the 3d orbital of atom 39 to a target of 3.0020503 + + +This file has been created by helpdoc utility on Sat Mar 18 16:00:16 CET 2023 diff --git a/assets/calculations/qe7.2/INPUT_PH.txt b/assets/calculations/qe7.2/INPUT_PH.txt new file mode 100644 index 00000000..f0ef7dd8 --- /dev/null +++ b/assets/calculations/qe7.2/INPUT_PH.txt @@ -0,0 +1,997 @@ +*** FILE AUTOMATICALLY CREATED: DO NOT EDIT, CHANGES WILL BE LOST *** + +------------------------------------------------------------------------ +INPUT FILE DESCRIPTION + +Program: ph.x / PHonon / Quantum ESPRESSO (version: 7.2) +------------------------------------------------------------------------ + + +Input data format: { } = optional, [ ] = it depends, # = comment + +Structure of the input data: +=============================================================================== + +title_line + +&INPUTPH + ... +/ + +[ xq(1) xq(2) xq(3) ] # if "ldisp" != .true. and "qplot" != .true. + +[ nqs # if "qplot" == .true. + xq(1,i) xq(2,i) xq(3,1) nq(1) + ... + xq(1,nqs) xq(2,nqs) xq(3,nqs) nq(nqs) ] + +[ atom(1) atom(2) ... atom(nat_todo) ] # if "nat_todo" was specified + + + +======================================================================== +Line of input: + + title_line + + + DESCRIPTION OF ITEMS: + + +-------------------------------------------------------------------- + Variable: title_line + + Type: CHARACTER + Description: Title of the job, i.e., a line that is reprinted on output. + +-------------------------------------------------------------------- + +===End of line-of-input================================================= + + +======================================================================== +NAMELIST: &INPUTPH + + +-------------------------------------------------------------------- + Variable: amass(i), i=1,ntyp + + Type: REAL + Default: 0.0 + Description: Atomic mass [amu] of each atomic type. + If not specified, masses are read from data file. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: outdir + + Type: CHARACTER + Default: value of the ESPRESSO_TMPDIR environment variable if set; + current directory ('./') otherwise + Description: Directory containing input, output, and scratch files; + must be the same as specified in the calculation of + the unperturbed system. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: prefix + + Type: CHARACTER + Default: 'pwscf' + Description: Prepended to input/output filenames; must be the same + used in the calculation of unperturbed system. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: niter_ph + + Type: INTEGER + Default: maxter=100 + Description: Maximum number of iterations in a scf step. If you want + more than 100, edit variable "maxter" in PH/phcom.f90 + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: tr2_ph + + Type: REAL + Default: 1e-12 + Description: Threshold for self-consistency. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: alpha_mix(niter) + + Type: REAL + Default: alpha_mix(1)=0.7 + Description: Mixing factor (for each iteration) for updating + the scf potential: + + vnew(in) = alpha_mix*vold(out) + (1-alpha_mix)*vold(in) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: nmix_ph + + Type: INTEGER + Default: 4 + Description: Number of iterations used in potential mixing. Using a larger value (8~20) + can significantly speed up convergence, at the cost of using more memory. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: verbosity + + Type: CHARACTER + Default: 'default' + Description: + Options are: + + 'debug', 'high', 'medium' : + verbose output + + 'low', 'default', 'minimal' : + short output + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: reduce_io + + Type: LOGICAL + Default: .false. + Description: Reduce I/O to the strict minimum. + + BEWARE: If the input flag "reduce_io"=.true. was + used, it is not allowed to restart from an interrupted + run. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: max_seconds + + Type: REAL + Default: 1.d7 + Description: Maximum allowed run time before the job stops smoothly. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: dftd3_hess + + Type: CHARACTER + Default: 'prefix.hess' + Description: File where the D3 dispersion hessian matrix is read. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: fildyn + + Type: CHARACTER + Default: 'matdyn' + Description: File where the dynamical matrix is written. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: fildrho + + Type: CHARACTER + Default: ' ' + Description: File where the charge density responses are written. Note that the file + will actually be saved as ${outdir}/_ph0/${prefix}.${fildrho}1 + where ${outdir}, ${prefix} and ${fildrho} are the values of the + corresponding input variables + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: fildvscf + + Type: CHARACTER + Default: ' ' + Description: File where the the potential variation is written + (for later use in electron-phonon calculation, see also fildrho). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: epsil + + Type: LOGICAL + Default: .false. + Description: If .true. in a q=0 calculation for a non metal the + macroscopic dielectric constant of the system is + computed. Do not set "epsil" to .true. if you have a + metallic system or q/=0: the code will complain and stop. + + Note: the input value of "epsil" will be ignored if "ldisp"=.true. + (the code will automatically set "epsil" to .false. for metals, + to .true. for insulators: see routine PHonon/PH/prepare_q.f90). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lrpa + + Type: LOGICAL + Default: .false. + Description: If .true. the dielectric constant is calculated at the + RPA level with DV_xc=0. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lnoloc + + Type: LOGICAL + Default: .false. + Description: If .true. the dielectric constant is calculated without + local fields, i.e. by setting DV_H=0 and DV_xc=0. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: trans + + Type: LOGICAL + Default: .true. + Description: If .false. the phonons are not computed. + If "trans" .and. "epsil" are both .true., + the effective charges are calculated. + If "ldisp" is .true., "trans"=.false. is overridden + (except for the case of electron-phonon calculations) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lraman + + Type: LOGICAL + Default: .false. + Description: If .true. calculate non-resonant Raman coefficients + using second-order response as in: + M. Lazzeri and F. Mauri, PRL 90, 036401 (2003). + +-------------------------------------------------------------------- + + ///--- + OPTIONAL VARIABLES FOR RAMAN: + + +-------------------------------------------------------------------- + Variable: eth_rps + + Type: REAL + Default: 1.0d-9 + Description: Threshold for calculation of Pc R |psi>. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: eth_ns + + Type: REAL + Default: 1.0e-12 + Description: Threshold for non-scf wavefunction calculation. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: dek + + Type: REAL + Default: 1.0e-3 + Description: Delta_xk used for wavefunction derivation wrt k. + +-------------------------------------------------------------------- + + \\\--- + + +-------------------------------------------------------------------- + Variable: recover + + Type: LOGICAL + Default: .false. + Description: If .true. restart from an interrupted run. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: low_directory_check + + Type: LOGICAL + Default: .false. + Description: If .true. search in the phsave directory only the + quantities requested in input. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: only_init + + Type: LOGICAL + Default: .false. + Description: If .true. only the bands and other initialization quantities are calculated. + (used for GRID parallelization) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: qplot + + Type: LOGICAL + Default: .false. + Description: If .true. a list of q points is read from input. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: q2d + + Type: LOGICAL + Default: .false. + Description: If .true. three q points and relative weights are + read from input. The three q points define the rectangle + q(:,1) + l (q(:,2)-q(:,1)) + m (q(:,3)-q(:,1)) where + 0< l,m < 1. The weights are integer and those of points two + and three are the number of points in the two directions. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: q_in_band_form + + Type: LOGICAL + Default: .false. + Description: This flag is used only when qplot is .true. and q2d is + .false.. When .true. each couple of q points q(:,i+1) and + q(:,i) define the line from q(:,i) to q(:,i+1) and nq + points are generated along that line. nq is the weigth of + q(:,i). When .false. only the list of q points given as + input is calculated. The weights are not used. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: electron_phonon + + Type: CHARACTER + Default: ' ' + Description: + Options are: + + 'simple' : + Electron-phonon lambda coefficients are computed + for a given q and a grid of k-points specified by + the variables "nk1", "nk2", "nk3", "k1", "k2", "k3". + + 'interpolated' : + Electron-phonon is calculated by interpolation + over the Brillouin Zone as in M. Wierzbowska, et + al. arXiv:cond-mat/0504077 + + 'lambda_tetra' : + The electron-phonon coefficient \lambda_{q \nu} + is calculated with the optimized tetrahedron method. + + 'gamma_tetra' : + The phonon linewidth \gamma_{q \nu} is calculated + from the electron-phonon interactions + using the optimized tetrahedron method. + + 'epa' : + Electron-phonon coupling matrix elements are written + to file prefix.epa.k for further processing by program + epa.x which implements electron-phonon averaged (EPA) + approximation as described in G. Samsonidze & B. Kozinsky, + Adv. Energy Mater. 2018, 1800246 doi:10.1002/aenm.201800246 + arXiv:1511.08115 + + 'ahc' : + Quantities required for the calculation of phonon-induced + electron self-energy are computed and written to the directory + "ahc_dir". The output files can be read by postahc.x for + the calculation of electron self-energy. + Available for both metals and insulators. + "trans"=.false. is required. + + For metals only, requires gaussian smearing (except for 'ahc'). + + If "trans"=.true., the lambdas are calculated in the same + run, using the same k-point grid for phonons and lambdas. + If "trans"=.false., the lambdas are calculated using + previously saved DeltaVscf in "fildvscf", previously saved + dynamical matrix, and the present punch file. This allows + the use of a different (larger) k-point grid. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: el_ph_nsigma + + Type: INTEGER + Default: 10 + Description: The number of double-delta smearing values used in an + electron-phonon coupling calculation. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: el_ph_sigma + + Type: REAL + Default: 0.02 + Description: The spacing between double-delta smearing values used in + an electron-phonon coupling calculation. + +-------------------------------------------------------------------- + + ///--- + VARIABLES FOR "ELECTRON_PHONON" = 'AHC': + + +-------------------------------------------------------------------- + Variable: ahc_dir + + Type: CHARACTER + Default: outdir // 'ahc_dir/' + Description: Directory where the output binary files are written. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: ahc_nbnd + + Type: INTEGER + Status: REQUIRED + Description: Number of bands for which the electron self-energy is to be computed. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: ahc_nbndskip + + Type: INTEGER + Default: 0 + Description: Number of bands to exclude when computing the self-energy. Self-energy + is computed for bands with indices from "ahc_nbndskip"+1 to + "ahc_nbndskip"+"ahc_nbnd". "ahc_nbndskip"+"ahc_nbnd" cannot + exceed nbnd of the preceding SCF or NSCF calculation. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: skip_upperfan + + Type: LOGICAL + Default: .false. + Description: If .true., skip calculation of the upper Fan self-energy, which + involves solving the Sternheimer equation. + +-------------------------------------------------------------------- + + \\\--- + + +-------------------------------------------------------------------- + Variable: lshift_q + + Type: LOGICAL + Default: .false. + Description: Use a wave-vector grid displaced by half a grid step + in each direction - meaningful only when ldisp is .true. + When this option is set, the q2r.x code cannot be used. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: zeu + + Type: LOGICAL + Default: zeu="epsil" + Description: If .true. in a q=0 calculation for a non metal the + effective charges are computed from the dielectric + response. This is the default algorithm. If "epsil"=.true. + and "zeu"=.false. only the dielectric tensor is calculated. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: zue + + Type: LOGICAL + Default: .false. + Description: If .true. in a q=0 calculation for a non metal the + effective charges are computed from the phonon + density responses. This is an alternative algorithm, + different from the default one (if "trans" .and. "epsil" ) + The results should be the same within numerical noise. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: elop + + Type: LOGICAL + Default: .false. + Description: If .true. calculate electro-optic tensor. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: fpol + + Type: LOGICAL + Default: .false. + Description: If .true. calculate dynamic polarizabilities + Requires "epsil"=.true. ( experimental stage: + see example09 for calculation of methane ). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: ldisp + + Type: LOGICAL + Default: .false. + Description: If .true. the run calculates phonons for a grid of + q-points specified by "nq1", "nq2", "nq3" - for direct + calculation of the entire phonon dispersion. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: nogg + + Type: LOGICAL + Default: .false. + Description: If .true. disable the "gamma_gamma" trick used to speed + up calculations at q=0 (phonon wavevector) if the sum over + the Brillouin Zone includes k=0 only. The gamma_gamma + trick exploits symmetry and acoustic sum rule to reduce + the number of linear response calculations to the strict + minimum, as it is done in code phcg.x. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: asr + + Type: LOGICAL + Default: .false. + Description: Apply Acoustic Sum Rule to dynamical matrix, effective charges + Works only in conjunction with "gamma_gamma" tricks (see above) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: ldiag + + Type: LOGICAL + Default: .false. + Description: If .true. forces the diagonalization of the dynamical + matrix also when only a part of the dynamical matrix + has been calculated. It is used together with "start_irr" + and "last_irr". If all modes corresponding to a + given irreducible representation have been calculated, + the phonon frequencies of that representation are + correct. The others are zero or wrong. Use with care. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lqdir + + Type: LOGICAL + Default: .false. + Description: If .true. ph.x creates inside outdir a separate subdirectory + for each q vector. The flag is set to .true. when "ldisp"=.true. + and "fildvscf" /= ' ' or when an electron-phonon + calculation is performed. The induced potential is saved + separately for each q inside the subdirectories. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: search_sym + + Type: LOGICAL + Default: .true. + Description: Set it to .false. if you want to disable the mode + symmetry analysis. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: nq1, nq2, nq3 + + Type: INTEGER + Default: 0,0,0 + Description: Parameters of the Monkhorst-Pack grid (no offset) used + when "ldisp"=.true. Same meaning as for nk1, nk2, nk3 + in the input of pw.x. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: nk1, nk2, nk3, k1, k2, k3 + + Type: INTEGER + Default: 0,0,0,0,0,0 + Description: When these parameters are specified the phonon program + runs a pw non-self consistent calculation with a different + k-point grid thant that used for the charge density. + This occurs even in the Gamma case. + "nk1", "nk2", "nk3" are the parameters of the Monkhorst-Pack grid + with offset determined by "k1", "k2", "k3". + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: diagonalization + + Type: CHARACTER + Default: 'david' + Description: + Diagonalization method for the non-SCF calculations. + + 'david' : + Davidson iterative diagonalization with overlap matrix + (default). Fast, may in some rare cases fail. + + 'cg' : + Conjugate-gradient-like band-by-band diagonalization. + Slower than 'david' but uses less memory and is + (a little bit) more robust. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: read_dns_bare + + Type: LOGICAL + Default: .false. + Description: If .true. the PH code tries to read three files in the DFPT+U + calculation: dns_orth, dns_bare, d2ns_bare. + dns_orth and dns_bare are the first-order variations of + the occupation matrix, while d2ns_bare is the second-order + variation of the occupation matrix. These matrices are + computed only once during the DFPT+U calculation. However, + their calculation (especially of d2ns_bare) is computationally + expensive, this is why they are written to file and then can be + read (e.g. for restart) in order to save time. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: ldvscf_interpolate + + Type: LOGICAL + Default: .false. + Description: If .true., use Fourier interpolation of phonon potential + to compute the induced part of phonon potential at each + q point. Results of a dvscf_q2r.x run is needed. + Requires "trans" = .false.. + +-------------------------------------------------------------------- + + ///--- + OPTIONAL VARIABLES FOR DVSCF INTERPOLATION: + + +-------------------------------------------------------------------- + Variable: wpot_dir + + Type: CHARACTER + Default: outdir // 'w_pot/' + Description: Directory where the w_pot binary files are written. + Must be the same with "wpot_dir" used in dvscf_q2r.x. + The real space potential files are stored in "wpot_dir" + with names ${prefix}.wpot.irc${irc}//"1". + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: do_long_range + + Type: LOGICAL + Default: .false. + Description: If .true., add the long-range part of the potential + to the Fourier interpolated potential as in: + S. Ponce et al, J. Chem. Phys. 143, 102813 (2015). + Reads dielectric matrix and Born effective charges from + the ${wpot_dir}/tensors.dat file, written in dvscf_q2r.x. + Currently, only the dipole (Frohlich) part is implemented. + The quadrupole part is not implemented. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: do_charge_neutral + + Type: LOGICAL + Default: .false. + Description: If .true., impose charge neutrality on the Born effective + charges. Used only if "do_long_range" = .true.. + +-------------------------------------------------------------------- + + \\\--- + + ///--- + SPECIFICATION OF IRREDUCIBLE REPRESENTATION + + +-------------------------------------------------------------------- + Variable: start_irr + + Type: INTEGER + Default: 1 + See: last_irr + Description: Perform calculations only from "start_irr" to "last_irr" + irreducible representations. + + IMPORTANT: + * "start_irr" must be <= 3*nat + * do not specify "nat_todo" together with + "start_irr", "last_irr" + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: last_irr + + Type: INTEGER + Default: 3*nat + See: start_irr + Description: Perform calculations only from "start_irr" to "last_irr" + irreducible representations. + + IMPORTANT: + * "start_irr" must be <= 3*nat + * do not specify "nat_todo" together with + "start_irr", "last_irr" + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: nat_todo + + Type: INTEGER + Default: 0, i.e. displace all atoms + Description: Choose the subset of atoms to be used in the linear response + calculation: "nat_todo" atoms, specified in input (see below) + are displaced. Can be used to estimate modes for a molecule + adsorbed over a surface without performing a full fledged + calculation. Use with care, at your own risk, and be aware + that this is an approximation and may not work. + IMPORTANT: + * "nat_todo" <= nat + * if linear-response is calculated for a given atom, it + should also be done for all symmetry-equivalent atoms, + or else you will get incorrect results + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: modenum + + Type: INTEGER + Default: 0 + Description: For single-mode phonon calculation : modenum is the index of the + irreducible representation (irrep) into which the reducible + representation formed by the 3*nat atomic displacements are + decomposed in order to perform the phonon calculation. + Note that a single-mode calculation will not give you the + frequency of a single phonon mode: in general, the selected + "modenum" is not an eigenvector. What you get on output is + a column of the dynamical matrix. + +-------------------------------------------------------------------- + + \\\--- + + ///--- + Q-POINT SPECIFICATION + + +-------------------------------------------------------------------- + Variable: start_q + + Type: INTEGER + Default: 1 + See: last_q + Description: Used only when ldisp=.true.. + Computes only the q points from "start_q" to "last_q". + + IMPORTANT: + * "start_q" must be <= "nqs" (number of q points found) + * do not specify "nat_todo" together with + "start_q", "last_q" + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: last_q + + Type: INTEGER + Default: number of q points + See: start_q + Description: Used only when "ldisp"=.true.. + Computes only the q points from "start_q" to "last_q". + + IMPORTANT + * "last_q" must be <= "nqs" (number of q points) + * do not specify "nat_todo" together with + "start_q", "last_q" + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: dvscf_star + + Type: STRUCTURE + Default: disabled + Description: It contains the following components: + + dvscf_star%open (logical, default: .false.) + dvscf_star%dir (character, default: outdir//"Rotated_DVSCF" or the + ESPRESSO_FILDVSCF_DIR environment variable) + dvscf_star%ext (character, default: "dvscf") the extension to use + for the name of the output files, see below + dvscf_star%basis (character, default: "cartesian") the basis on which + the rotated dvscf will be saved + dvscf_star%pat (logical, default: false) save an optional file with the + displacement patterns and q vector for each dvscf file + + IF dvscf_star%open is .true. use symmetry to compute and store the variation + of the self-consistent potential on every q* in the star of the present q. + + The rotated dvscf will then be stored in directory dvscf_star%dir with name + prefix.dvscf_star%ext.q_name//"1". Where q_name is derived from the coordinates + of the q-point, expressed as fractions in crystalline coordinates + (notice that ph.x reads q-points in cartesian coordinates). + E.g. q_cryst= (0, 0.5, -0.25) -> q_name = "0_1o2_-1o4" + + The dvscf can be represented on a basis of cartesian 1-atom displacements + (dvscf_star%basis='cartesian') or on the basis of the modes at the rotated q-point + (dvscf_star%basis='modes'). Notice that the el-ph wannier code requires 'cartesian'. + Each dvscf file comes with a corresponding pattern file with an additional ".pat" + suffix; this file contains information about the basis and the q-point of the dvscf. + + Note: rotating dvscf can require a large amount of RAM memory and can be i/o + intensive; in its current implementation all the operations are done + on a single processor. + Note2: this feature is currently untested with image parallelisation. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: drho_star + + Type: STRUCTURE + See: dvscf_star + Default: disabled + Description: It contains the following components: + + drho_star%open (logical, default: .false.) + drho_star%dir (character, default: outdir//"Rotated_DRHO" or the + ESPRESSO_FILDRHO_DIR environment variable) + drho_star%ext (character, default: "drho") the extension to use + for the name of the output files, see below + drho_star%basis (character, default: "modes") the basis on which + the rotated drho will be saved + drho_star%pat (logical, default: true) save an optional file with the + displacement patterns and q vector for each drho file + + Like "dvscf_star", but for the perturbation of the charge density. + Notice that the defaults are different. + +-------------------------------------------------------------------- + + \\\--- + +===END OF NAMELIST====================================================== + + +________________________________________________________________________ +* IF ldisp != .true. and qplot != .true. : + + ======================================================================== + Line of input: + + xq(1) xq(2) xq(3) + + + DESCRIPTION OF ITEMS: + + +-------------------------------------------------------------------- + Variables: xq(1) xq(2) xq(3) + + Type: REAL + Description: The phonon wavevector, in units of 2pi/a0 + (a0 = lattice parameter). + Not used if "ldisp"=.true. or "qplot"=.true. + +-------------------------------------------------------------------- + + + ===End of line-of-input================================================= + + + +* ELSE IF qplot == .true. : + + SPECIFICATION OF Q POINTS WHEN "QPLOT" == .TRUE. + + ======================================================================== + CARD: + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + nqs + xq1(1) xq2(1) xq3(1) nq(1) + xq1(2) xq2(2) xq3(2) nq(2) + . . . + xq1(nqs) xq2(nqs) xq3(nqs) nq(nqs) + + ///////////////////////////////////////// + + DESCRIPTION OF ITEMS: + + +-------------------------------------------------------------------- + Variable: nqs + + Type: INTEGER + Description: Number of q points in the list. Used only if "qplot"=.true. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: xq1, xq2, xq3 + + Type: REAL + Description: q-point coordinates; used only with "ldisp"=.true. and qplot=.true. + The phonon wavevector, in units of 2pi/a0 (a0 = lattice parameter). + The meaning of these q points and their weights nq depend on the + flags q2d and q_in_band_form. (NB: nq is integer) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: nq + + Type: INTEGER + Description: The weight of the q-point; the meaning of nq depends + on the flags q2d and q_in_band_form. + +-------------------------------------------------------------------- + + ===END OF CARD========================================================== + + + +ENDIF +________________________________________________________________________ + +________________________________________________________________________ +* IF nat_todo was specified : + + ======================================================================== + Line of input: + + atom(1) atom(2) ... atom(nat_todo) + + + DESCRIPTION OF ITEMS: + + +-------------------------------------------------------------------- + Variables: atom(1) atom(2) ... atom(nat_todo) + + Type: INTEGER + Description: Contains the list of indices of atoms used in the + calculation if "nat_todo" is specified. + +-------------------------------------------------------------------- + + + ===End of line-of-input================================================= + + + +ENDIF +________________________________________________________________________ + + +:::: ADDITIONAL INFORMATION + + NB: The program ph.x writes on the tmp_dir/_ph0/{prefix}.phsave directory + a file for each representation of each q point. This file is called + dynmat.#iq.#irr.xml where #iq is the number of the q point and #irr + is the number of the representation. These files contain the + contribution to the dynamical matrix of the irr representation for the + iq point. + + If "recover"=.true. ph.x does not recalculate the + representations already saved in the tmp_dir/_ph0/{prefix}.phsave + directory. Moreover ph.x writes on the files patterns.#iq.xml in the + tmp_dir/_ph0/{prefix}.phsave directory the displacement patterns that it + is using. If "recover"=.true. ph.x does not recalculate the + displacement patterns found in the tmp_dir/_ph0/{prefix}.phsave directory. + + This mechanism allows: + + 1) To recover part of the ph.x calculation even if the recover file + or files are corrupted. You just remove the _ph0/{prefix}.recover + files from the tmp_dir directory. You can also remove all the _ph0 + files and keep only the _ph0/{prefix}.phsave directory. + + 2) To split a phonon calculation into several jobs for different + machines (or set of nodes). Each machine calculates a subset of + the representations and saves its dynmat.#iq.#irr.xml files on + its tmp_dir/_ph0/{prefix}.phsave directory. Then you collect all the + dynmat.#iq.#irr.xml files in one directory and run ph.x to + collect all the dynamical matrices and diagonalize them. + + NB: To split the q points in different machines, use the input + variables start_q and last_q. To split the irreducible + representations, use the input variables "start_irr", "last_irr". Please + note that different machines will use, in general, different + displacement patterns and it is not possible to recollect partial + dynamical matrices generated with different displacement patterns. A + calculation split into different machines will run as follows: A + preparatory run of ph.x with "start_irr"=0, "last_irr"=0 produces the sets + of displacement patterns and save them on the patterns.#iq.xml files. + These files are copied in all the tmp_dir/_ph0/{prefix}.phsave directories + of the machines where you plan to run ph.x. ph.x is run in different + machines with complementary sets of start_q, last_q, "start_irr" and + "last_irr" variables. All the files dynmat.#iq.#irr.xml are + collected on a single tmp_dir/_ph0/{prefix}.phsave directory (remember to + collect also dynmat.#iq.0.xml). A final run of ph.x in this + machine collects all the data contained in the files and diagonalizes + the dynamical matrices. This is done requesting a complete dispersion + calculation without using start_q, last_q, "start_irr", or "last_irr". + See an example in examples/GRID_example. + + On parallel machines the q point and the irreps calculations can be split + automatically using the -nimage flag. See the phonon user guide for further + information. + + +This file has been created by helpdoc utility on Sat Mar 18 19:08:12 CET 2023 diff --git a/assets/calculations/qe7.2/INPUT_PP.txt b/assets/calculations/qe7.2/INPUT_PP.txt new file mode 100644 index 00000000..ba667a82 --- /dev/null +++ b/assets/calculations/qe7.2/INPUT_PP.txt @@ -0,0 +1,623 @@ +*** FILE AUTOMATICALLY CREATED: DO NOT EDIT, CHANGES WILL BE LOST *** + +------------------------------------------------------------------------ +INPUT FILE DESCRIPTION + +Program: pp.x / PWscf / Quantum ESPRESSO (version: 7.2) +------------------------------------------------------------------------ + + +Purpose of pp.x: data analysis and plotting. + +The code performs two steps: + +(1) reads the output produced by pw.x, extracts and calculates + the desired quantity/quantities (rho, V, ...) + +(2) writes the desired quantity to file in a suitable format for + various types of plotting and various plotting programs + +The input data of this program is read from standard input +or from file and has the following format: + +NAMELIST &INPUTPP + containing the variables for step (1), followed by + +NAMELIST &PLOT + containing the variables for step (2) + +The two steps can be performed independently. In order to perform +only step (2), leave namelist &INPUTPP blank. In order to perform +only step (1), do not specify namelist &PLOT + +Intermediate results from step 1 can be saved to disk (see +variable "filplot" in &INPUTPP) and later read in step 2. +Since the file with intermediate results is formatted, it +can be safely transferred to a different machine. This +also allows plotting of a linear combination (for instance, +charge differences) by saving two intermediate files and +combining them (see variables "weight" and "filepp" in &PLOT) + +All output quantities are in ATOMIC (RYDBERG) UNITS unless +otherwise explicitly specified. +All charge densities integrate to the NUMBER of electrons +not to the total charge. +All potentials have the dimension of an energy (e*V, not V). + + + +======================================================================== +NAMELIST: &INPUTPP + + +-------------------------------------------------------------------- + Variable: prefix + + Type: CHARACTER + Description: prefix of files saved by program pw.x + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: outdir + + Type: CHARACTER + Description: directory containing the input data, i.e. the same as in pw.x + Default: value of the ESPRESSO_TMPDIR environment variable if set; + current directory ('./') otherwise + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: filplot + + Type: CHARACTER + Description: file "filplot" contains the quantity selected by plot_num + (can be saved for further processing) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: plot_num + + Type: INTEGER + Description: Selects what to save in filplot: + + 0 = electron (pseudo-)charge density + + 1 = total potential V_bare + V_H + V_xc + + 2 = local ionic potential V_bare + + 3 = local density of states at specific energy or grid of energies + (number of states per volume, in bohr^3, per energy unit, in Ry) + + 4 = local density of electronic entropy + + 5 = STM images + Tersoff and Hamann, PRB 31, 805 (1985) + + 6 = spin polarization (rho(up)-rho(down)) + + 7 = contribution of selected wavefunction(s) to the + (pseudo-)charge density. For norm-conserving PPs, + |psi|^2 (psi=selected wavefunction). Noncollinear case: + contribution of the given state to the charge or + to the magnetization along the direction indicated + by spin_component (0 = charge, 1 = x, 2 = y, 3 = z ) + + 8 = electron localization function (ELF) + + 9 = charge density minus superposition of atomic densities + + 10 = integrated local density of states (ILDOS) + from "emin" to "emax" (emin, emax in eV) + if "emax" is not specified, "emax"=E_fermi + + 11 = the V_bare + V_H potential + + 12 = the sawtooth electric field potential (if present) + + 13 = the noncollinear magnetization. + + 17 = all-electron valence charge density + can be performed for PAW calculations only + requires a very dense real-space grid! + + 18 = The exchange and correlation magnetic field in the noncollinear case + + 19 = Reduced density gradient + ( J. Chem. Theory Comput. 7, 625 (2011), doi:10.1021/ct100641a ) + Set the isosurface between 0.3 and 0.6 to plot the + non-covalent interactions (see also plot_num = 20) + + 20 = Product of the electron density (charge) and the second + eigenvalue of the electron-density Hessian matrix; + used to colorize the RDG plot (plot_num = 19) + + 21 = all-electron charge density (valence+core). + For PAW calculations only; requires a very dense real-space grid. + + 22 = kinetic energy density (for meta-GGA and XDM only) + + 123 = DORI: density overlap regions indicator + (doi: 10.1021/ct500490b) Implemented by D. Yang & Q.Liu + +-------------------------------------------------------------------- + + ________________________________________________________________________ + * IF plot_num = 0 or 9 : + + OPTIONS FOR TOTAL CHARGE (PLOT_NUM=0) + OR FOR TOTAL MINUS ATOMIC CHARGE (PLOT_NUM=9): + + +-------------------------------------------------------------------- + Variable: spin_component + + Type: INTEGER + Default: 0 + Description: 0 = total charge (default value), + 1 = spin up charge, + 2 = spin down charge. + +-------------------------------------------------------------------- + + + * ELSE IF plot_num=1 : + + OPTIONS FOR TOTAL POTENTIAL (PLOT_NUM=1): + + +-------------------------------------------------------------------- + Variable: spin_component + + Type: INTEGER + Default: 0 + Description: 0 = spin averaged potential (default value), + 1 = spin up potential, + 2 = spin down potential. + +-------------------------------------------------------------------- + + + * ELSE IF plot_num=3 : + + OPTIONS FOR LDOS (PLOT_NUM=3): + LDOS IS PLOTTED ON GRID [EMIN, EMAX] WITH SPACING DELTA_E. + + +-------------------------------------------------------------------- + Variable: emin + + Type: REAL + Default: e_fermi + Description: lower boundary of energy grid (in eV). + + Defaults to Fermi energy. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: emax + + Type: REAL + Status: OPTIONAL + Description: upper boundary of energy grid (in eV). + + Defaults to Fermi energy. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: delta_e + + Type: REAL + Default: 0.1 + Status: OPTIONAL + Description: spacing of energy grid (in eV). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: degauss_ldos + + Type: REAL + Default: degauss (converted to eV) + Status: OPTIONAL + Description: broadening of energy levels for LDOS (in eV). + + Defaults to broadening degauss specified for electronic smearing + in pw.x calculation. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: use_gauss_ldos + + Type: LOGICAL + Default: .false. + Status: OPTIONAL + Description: If .true., gaussian broadening (ngauss=0) is used for LDOS calculation. + + Defaults .false., in which case the broadening scheme + of the pw.x calculation will be used. + +-------------------------------------------------------------------- + + + * ELSE IF plot_num=5 : + + OPTIONS FOR STM IMAGES (PLOT_NUM=5): + + +-------------------------------------------------------------------- + Variable: sample_bias + + Type: REAL + Description: the bias of the sample (Ry) in stm images + +-------------------------------------------------------------------- + + + * ELSE IF plot_num=7 : + + OPTIONS FOR |PSI|^2 (PLOT_NUM=7): + + +-------------------------------------------------------------------- + Variable: kpoint(i), i=1,2 + + Type: INTEGER + Description: Unpolarized and noncollinear case: + k-point(s) to be plotted + LSDA: + k-point(s) and spin polarization to be plotted + (spin-up and spin-down correspond to different k-points!) + + To plot a single kpoint ikpt, specify kpoint=ikpt or kpoint(1)=ikpt + To plot a range of kpoints [imin, imax], specify kpoint(1)=imin and kpoint(2)=imax + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: kband(i), i=1,2 + + Type: INTEGER + Description: Band(s) to be plotted. + + To plot a single band ibnd, specify kband=ibnd or kband(1)=ibnd + To plot a range of bands [imin, imax], specify kband(1)=imin and kband(2)=imax + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lsign + + Type: LOGICAL + Description: if true and k point is Gamma, plot |psi|^2 sign(psi) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: spin_component(i), i=1,2 + + Type: INTEGER + Default: 0 + Status: OPTIONAL + Description: Noncollinear case only: + plot the contribution of the given state(s) to the charge + or to the magnetization along the direction(s) indicated + by spin_component: + 0 = charge (default), + 1 = x, + 2 = y, + 3 = z. + + Ignored in unpolarized or LSDA case + + To plot a single component ispin, specify spin_component=ispin or spin_component(1)=ispin + To plot a range of components [imin, imax], specify spin_component(1)=imin and spin_component(2)=imax + +-------------------------------------------------------------------- + + + * ELSE IF plot_num=10 : + + OPTIONS FOR ILDOS (PLOT_NUM=10): + + +-------------------------------------------------------------------- + Variable: emin + + Type: REAL + Description: lower energy boundary (in eV) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: emax + + Type: REAL + Description: upper energy boundary (in eV), + i.e. compute ILDOS from "emin" to "emax" + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: spin_component + + Type: INTEGER + Default: 0 + Description: for LSDA case only: plot the contribution to ILDOS of + 0 = spin-up + spin-down (default) + 1 = spin-up only + 2 = spin-down only + +-------------------------------------------------------------------- + + + * ELSE IF plot_num=13 : + + OPTIONS FOR NONCOLLINEAR MAGNETIZATION (PLOT_NUM=13): + + +-------------------------------------------------------------------- + Variable: spin_component + + Type: INTEGER + Default: 0 + Description: 0 = absolute value (default value) + 1 = x component of the magnetization + 2 = y component of the magnetization + 3 = z component of the magnetization + +-------------------------------------------------------------------- + + + * ELSE IF plot_num=17 : + + OPTIONS FOR RECONSTRUCTED CHARGE DENSITY (PLOT_NUM=17): + + +-------------------------------------------------------------------- + Variable: spin_component + + Type: INTEGER + Default: 0 + Description: 0 = total charge (default value), + 1 = spin up charge, + 2 = spin down charge. + +-------------------------------------------------------------------- + + + * ELSE IF plot_num=22 : + + OPTIONS FOR KINETIC ENERGY DENSITY (PLOT_NUM=22), + LSDA CASE ONLY: + + +-------------------------------------------------------------------- + Variable: spin_component + + Type: INTEGER + Default: 0 + Description: 0 = total density (default value), + 1 = spin up density, + 2 = spin down density. + +-------------------------------------------------------------------- + + + ENDIF + ________________________________________________________________________ + +===END OF NAMELIST====================================================== + + +======================================================================== +NAMELIST: &PLOT + + +-------------------------------------------------------------------- + Variable: nfile + + Type: INTEGER + Default: 1 + Status: OPTIONAL + Description: the number of data files to read + +-------------------------------------------------------------------- + + ///--- + +-------------------------------------------------------------------- + Variable: filepp(i), i=1,nfile + + Type: CHARACTER + Default: filepp(1)=filplot + Description: nfile = 1 : file containing the quantity to be plotted + nfile > 1 : see "weight" + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: weight(i), i=1,nfile + + Type: REAL + Default: weight(1)=1.0 + Description: weighing factors: assuming that rho(i) is the quantity + read from filepp(i), the quantity that will be plotted is: + + weight(1)*rho(1) + weight(2)*rho(2) + weight(3)*rho(3) + ... + +-------------------------------------------------------------------- + + BEWARE: atomic coordinates are read from the first file; + if their number is different for different files, + the first file must have the largest number of atoms + + \\\--- + + +-------------------------------------------------------------------- + Variable: iflag + + Type: INTEGER + Description: 0 = 1D plot of the spherical average + 1 = 1D plot + 2 = 2D plot + 3 = 3D plot + 4 = 2D polar plot on a sphere + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: output_format + + Type: INTEGER + Description: (ignored on 1D plot) + + 0 = format suitable for gnuplot (1D) + + 1 = obsolete format no longer supported + + 2 = format suitable for plotrho (2D) + + 3 = format suitable for XCRYSDEN (2D or user-supplied 3D region) + + 4 = obsolete format no longer supported + + 5 = format suitable for XCRYSDEN (3D, using entire FFT grid) + + 6 = format as gaussian cube file (3D) + (can be read by many programs) + + 7 = format suitable for gnuplot (2D) x, y, f(x,y) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: fileout + + Type: CHARACTER + Default: standard output + Description: name of the file to which the plot is written + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: interpolation + + Type: CHARACTER + Default: 'fourier' + Description: + Type of interpolation: + 'fourier' + + 'bspline' : + (EXPERIMENTAL) + +-------------------------------------------------------------------- + + ________________________________________________________________________ + * IF iflag = 0 or 1 : + + THE FOLLOWING VARIABLES ARE REQUIRED: + + +-------------------------------------------------------------------- + Variable: e1(i), i=1,3 + + Type: REAL + Description: 3D vector which determines the plotting line (in alat units) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: x0(i), i=1,3 + + Type: REAL + Description: 3D vector, origin of the line (in alat units) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: nx + + Type: INTEGER + Description: number of points in the line: + + rho(i) = rho( x0 + e1 * (i-1)/(nx-1) ), i=1, nx + +-------------------------------------------------------------------- + + + * ELSE IF iflag = 2 : + + THE FOLLOWING VARIABLES ARE REQUIRED: + + +-------------------------------------------------------------------- + Variables: e1(i), e2(i), i=1,3 + + Type: REAL + Description: 3D vectors which determine the plotting plane (in alat units) + + BEWARE: e1 and e2 must be orthogonal + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: x0(i), i=1,3 + + Type: REAL + Description: 3D vector, origin of the plane (in alat units) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: nx, ny + + Type: INTEGER + Description: Number of points in the plane: + + rho(i,j) = rho( x0 + e1 * (i-1)/(nx-1) + + e2 * (j-1)/(ny-1) ), i=1,nx ; j=1,ny + +-------------------------------------------------------------------- + + + * ELSE IF iflag = 3 : + + THE FOLLOWING VARIABLES ARE OPTIONAL: + + +-------------------------------------------------------------------- + Variables: e1(i), e2(i), e3(i), i=1,3 + + Type: REAL + Description: 3D vectors which determine the plotting parallelepiped + (if present, must be orthogonal) + + "e1", "e2", and "e3" are in alat units ! + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: x0(i), i=1,3 + + Type: REAL + Description: 3D vector, origin of the parallelepiped + + "x0" is in alat units ! + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: nx, ny, nz + + Type: INTEGER + Description: Number of points in the parallelepiped: + + rho(i,j,k) = rho( x0 + e1 * (i-1)/nx + + e2 * (j-1)/ny + + e3 * (k-1)/nz ), + i = 1, nx ; j = 1, ny ; k = 1, nz + + - If "output_format" = 3 (XCRYSDEN), the above variables + are used to determine the grid to plot. + + - If "output_format" = 5 (XCRYSDEN), the above variables + are ignored, the entire FFT grid is written in the + XCRYSDEN format - works for any crystal axis (VERY FAST) + + - If "e1", "e2", "e3", "x0" are present, + and "e1", "e2", "e3" are parallel to xyz + and parallel to crystal axis, a subset of the FFT + grid that approximately covers the parallelepiped + defined by "e1", "e2", "e3", "x0", is + written - untested, might be obsolete + + - Otherwise, the required 3D grid is generated from the + Fourier components (may be VERY slow) + +-------------------------------------------------------------------- + + + * ELSE IF iflag = 4 : + + THE FOLLOWING VARIABLES ARE REQUIRED: + + +-------------------------------------------------------------------- + Variable: radius + + Type: REAL + Description: Radius of the sphere (alat units), centered at (0,0,0) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: nx, ny + + Type: INTEGER + Description: Number of points in the polar plane: + + phi(i) = 2 pi * (i - 1)/(nx-1), i=1, nx + theta(j) = pi * (j - 1)/(ny-1), j=1, ny + +-------------------------------------------------------------------- + + + ENDIF + ________________________________________________________________________ + +===END OF NAMELIST====================================================== + + +This file has been created by helpdoc utility on Sat Mar 18 15:50:16 CET 2023 diff --git a/assets/calculations/qe7.2/INPUT_PROJWFC.txt b/assets/calculations/qe7.2/INPUT_PROJWFC.txt new file mode 100644 index 00000000..9f1de3d5 --- /dev/null +++ b/assets/calculations/qe7.2/INPUT_PROJWFC.txt @@ -0,0 +1,350 @@ +*** FILE AUTOMATICALLY CREATED: DO NOT EDIT, CHANGES WILL BE LOST *** + +------------------------------------------------------------------------ +INPUT FILE DESCRIPTION + +Program: projwfc.x / PWscf / Quantum ESPRESSO (version: 7.2) +------------------------------------------------------------------------ + + +Purpose of projwfc.x: + projects wavefunctions onto orthogonalized atomic wavefunctions, + calculates Lowdin charges, spilling parameter, projected DOS + (separated into up and down components for LSDA). Alternatively: + computes the local DOS(E) integrated in volumes given in input + (see "tdosinboxes") or k-resolved DOS (see "kresolveddos"). + Atomic projections are written to file "atomic_proj.xml". + +Structure of the input data: +============================ + + &PROJWFC + ... + / + + + +======================================================================== +NAMELIST: &PROJWFC + + +-------------------------------------------------------------------- + Variable: prefix + + Type: CHARACTER + Description: prefix of input file produced by pw.x (wavefunctions are needed) + Default: 'pwscf' + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: outdir + + Type: CHARACTER + Description: directory containing the input data, i.e. the same as in pw.x + Default: value of the ESPRESSO_TMPDIR environment variable if set; + current directory ('./') otherwise + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: ngauss + + Type: INTEGER + Default: 0 + Description: Type of gaussian broadening: + 0 ... Simple Gaussian (default) + 1 ... Methfessel-Paxton of order 1 + -1 ... "cold smearing" (Marzari-Vanderbilt-DeVita-Payne) + -99 ... Fermi-Dirac function + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: degauss + + Type: REAL + Default: 0.0 + Description: gaussian broadening, Ry (not eV!) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: Emin, Emax + + Type: REAL + Default: (band extrema) + Description: min & max energy (eV) for DOS plot + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: DeltaE + + Type: REAL + Description: energy grid step (eV) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lsym + + Type: LOGICAL + Default: .true. + Description: if .true. the projections are symmetrized, + the partial density of states are computed + if .false. the projections are not symmetrized, the partial + DOS can be computed only in the k-resolved case + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: diag_basis + + Type: LOGICAL + Default: .false. + Description: if .false. the projections of Kohn-Sham states are + done on the orthogonalized atomic orbitals + in the global XYZ coordinate frame. + if .true. the projections of Kohn-Sham states are + done on the orthogonalized atomic orbitals + that are rotated to the basis in which the + atomic occupation matrix is diagonal + (i.e. local XYZ coordinate frame). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: pawproj + + Type: LOGICAL + Default: .false. + Description: if .true. use PAW projectors and all-electron PAW basis + functions to calculate weight factors for the partial + densities of states. Following Bloechl, PRB 50, 17953 (1994), + Eq. (4 & 6), the weight factors thus approximate the real + charge within the augmentation sphere of each atom. + Only for PAW, not implemented in the noncolinear case. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: filpdos + + Type: CHARACTER + Description: prefix for output files containing PDOS(E) + Default: (value of "prefix" variable) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: filproj + + Type: CHARACTER + Default: (standard output) + Description: file containing the projections + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lwrite_overlaps + + Type: LOGICAL + Default: .false. + Description: if .true., the overlap matrix of the atomic orbitals + prior to orthogonalization is written to "atomic_proj.xml". + Does not work together with parallel diagonalization: + for parallel runs, use "mpirun -np N projwfc.x -nd 1 ... " + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lbinary_data + + Type: LOGICAL + Default: .false. + Description: CURRENTLY DISABLED. + if .true., write atomic projections to a binary file. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: kresolveddos + + Type: LOGICAL + Default: .false. + Description: if .true. the k-resolved DOS is computed: not summed over + all k-points but written as a function of the k-point index. + In this case all k-point weights are set to unity + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: tdosinboxes + + Type: LOGICAL + Default: .false. + Description: if .true. compute the local DOS integrated in volumes + + Volumes are defined as boxes with edges parallel to the unit cell, + containing the points of the (charge density) FFT grid included within + "irmin" and "irmax", in the three dimensions: + + from "irmin"(j,n) to "irmax"(j,n) for j=1,2,3 (n=1,"n_proj_boxes"). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: n_proj_boxes + + Type: INTEGER + Default: 1 + Description: number of boxes where the local DOS is computed + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: irmin(i,n_proj_boxes), (i,n_proj_boxes)=(1,1) ... (3,n_proj_boxes) + + Type: INTEGER + Default: 1 for each box + Description: first point of the given box + + BEWARE: "irmin" is a 2D array of the form: "irmin"(3,"n_proj_boxes") + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: irmax(i,n_proj_boxes), (i,n_proj_boxes)=(1,1) ... (3,n_proj_boxes) + + Type: INTEGER + Default: 0 for each box + Description: last point of the given box; + ( 0 stands for the last point in the FFT grid ) + + BEWARE: "irmax" is a 2D array of the form: "irmax"(3,"n_proj_boxes") + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: plotboxes + + Type: LOGICAL + Default: .false. + Description: if .true., the boxes are written in output as xsf files with + 3D datagrids, valued 1.0 inside the box volume and 0 outside + (visualize them as isosurfaces with isovalue 0.5) + +-------------------------------------------------------------------- + +===END OF NAMELIST====================================================== + + + +:::: Notes + + + ::: Format of output files + + Projections are written to standard output, and also to file + "filproj" if given as input. + + The total DOS and the sum of projected DOS are written to file + "filpdos".pdos_tot. + + * The format for the collinear, spin-unpolarized case and the + non-collinear, spin-orbit case is: + E DOS(E) PDOS(E) + ... + + * The format for the collinear, spin-polarized case is: + E DOSup(E) DOSdw(E) PDOSup(E) PDOSdw(E) + ... + + * The format for the non-collinear, non spin-orbit case is: + E DOS(E) PDOSup(E) PDOSdw(E) + ... + + In the collinear case and the non-collinear, non spin-orbit case + projected DOS are written to file "filpdos".pdos_atm#N(X)_wfc#M(l), + where N = atom number , X = atom symbol, M = wfc number, l=s,p,d,f + (one file per atomic wavefunction found in the pseudopotential file) + + * The format for the collinear, spin-unpolarized case is: + E LDOS(E) PDOS_1(E) ... PDOS_2l+1(E) + ... + where LDOS = \sum m=1,2l+1 PDOS_m(E) + and PDOS_m(E) = projected DOS on atomic wfc with component m + + * The format for the collinear, spin-polarized case and the + non-collinear, non spin-orbit case is as above with + two components for both LDOS(E) and PDOS_m(E) + + In the non-collinear, spin-orbit case (i.e. if there is at least one + fully relativistic pseudopotential) wavefunctions are projected + onto eigenstates of the total angular-momentum. + Projected DOS are written to file "filpdos".pdos_atm#N(X)_wfc#M(l_j), + where N = atom number , X = atom symbol, M = wfc number, l=s,p,d,f + and j is the value of the total angular momentum. + In this case the format is: + E LDOS(E) PDOS_1(E) ... PDOS_2j+1(E) + ... + + If "kresolveddos"=.true., the k-point index is prepended + to the formats above, e.g. (collinear, spin-unpolarized case) + ik E DOS(E) PDOS(E) + + All DOS(E) are in states/eV plotted vs E in eV + + + + ::: Orbital Order + + Order of m-components for each l in the output: + + 1, cos(phi), sin(phi), cos(2*phi), sin(2*phi), .., cos(l*phi), sin(l*phi) + + where phi is the azimuthal angle: x=r cos(theta)cos(phi), y=r cos(theta)sin(phi) + This is determined in file upflib/ylmr2.f90 that calculates spherical harmonics. + + for l=1: + 1 pz (m=0) + 2 px (real combination of m=+/-1 with cosine) + 3 py (real combination of m=+/-1 with sine) + + for l=2: + 1 dz2 (m=0) + 2 dzx (real combination of m=+/-1 with cosine) + 3 dzy (real combination of m=+/-1 with sine) + 4 dx2-y2 (real combination of m=+/-2 with cosine) + 5 dxy (real combination of m=+/-2 with sine) + + + + ::: Defining boxes for the Local DOS(E) + + Boxes are specified using the variables "irmin" and "irmax": + + FFT grid points are included from irmin(j,n) to irmax(j,n) + for j=1,2,3 and n=1,...,"n_proj_boxes" + + "irmin" and "irmax" range from 1 to nr1 or nr2 or nr3 + + Values larger than nr1/2/3 or smaller than 1 are folded + to the unit cell. + + If "irmax"<"irmin" FFT grid points are included from 1 to irmax + and from irmin to nr1/2/3. + + + + ::: Important notices + + The tetrahedron method is used if + + - the input data file has been produced by pw.x using the option + occupations='tetrahedra', AND + + - a value for degauss is not given as input to namelist &projwfc + + * Gaussian broadening is used in all other cases: + + - if "degauss" is set to some value in namelist &PROJWFC, that value + (and the optional value for ngauss) is used + + - if "degauss" is NOT set to any value in namelist &PROJWFC, the + value of "degauss" and of "ngauss" are read from the input data + file (they will be the same used in the pw.x calculations) + + - if "degauss" is NOT set to any value in namelist &PROJWFC, AND + there is no value of "degauss" and of "ngauss" in the input data + file, "degauss"="DeltaE" (in Ry) and "ngauss"=0 will be used + + + Obsolete variables, ignored: + io_choice + smoothing + + + +This file has been created by helpdoc utility on Sat Mar 18 15:50:17 CET 2023 diff --git a/assets/calculations/qe7.2/INPUT_PW.txt b/assets/calculations/qe7.2/INPUT_PW.txt new file mode 100644 index 00000000..607d9edb --- /dev/null +++ b/assets/calculations/qe7.2/INPUT_PW.txt @@ -0,0 +1,4819 @@ +*** FILE AUTOMATICALLY CREATED: DO NOT EDIT, CHANGES WILL BE LOST *** + +------------------------------------------------------------------------ +INPUT FILE DESCRIPTION + +Program: pw.x / PWscf / Quantum ESPRESSO (version: 7.2) +------------------------------------------------------------------------ + + +Input data format: { } = optional, [ ] = it depends, | = or + +All quantities whose dimensions are not explicitly specified are in +RYDBERG ATOMIC UNITS. Charge is "number" charge (i.e. not multiplied +by e); potentials are in energy units (i.e. they are multiplied by e). + +BEWARE: TABS, CRLF, ANY OTHER STRANGE CHARACTER, ARE A SOURCES OF TROUBLE +USE ONLY PLAIN ASCII TEXT FILES (CHECK THE FILE TYPE WITH UNIX COMMAND "file") + +Namelists must appear in the order given below. +Comment lines in namelists can be introduced by a "!", exactly as in +fortran code. Comments lines in cards can be introduced by +either a "!" or a "#" character in the first position of a line. +Do not start any line in cards with a "/" character. +Leave a space between card names and card options, e.g. +ATOMIC_POSITIONS (bohr), not ATOMIC_POSITIONS(bohr) + + +Structure of the input data: +=============================================================================== + +&CONTROL + ... +/ + +&SYSTEM + ... +/ + +&ELECTRONS + ... +/ + +[ &IONS + ... + / ] + +[ &CELL + ... + / ] + +[ &FCP + ... + / ] + +[ &RISM + ... + / ] + +ATOMIC_SPECIES + X Mass_X PseudoPot_X + Y Mass_Y PseudoPot_Y + Z Mass_Z PseudoPot_Z + +ATOMIC_POSITIONS { alat | bohr | angstrom | crystal | crystal_sg } + X 0.0 0.0 0.0 {if_pos(1) if_pos(2) if_pos(3)} + Y 0.5 0.0 0.0 + Z 0.0 0.2 0.2 + +K_POINTS { tpiba | automatic | crystal | gamma | tpiba_b | crystal_b | tpiba_c | crystal_c } +if (gamma) + nothing to read +if (automatic) + nk1, nk2, nk3, k1, k2, k3 +if (not automatic) + nks + xk_x, xk_y, xk_z, wk +if (tpipa_b or crystal_b in a 'bands' calculation) see Doc/brillouin_zones.pdf + +[ CELL_PARAMETERS { alat | bohr | angstrom } + v1(1) v1(2) v1(3) + v2(1) v2(2) v2(3) + v3(1) v3(2) v3(3) ] + +[ OCCUPATIONS + f_inp1(1) f_inp1(2) f_inp1(3) ... f_inp1(10) + f_inp1(11) f_inp1(12) ... f_inp1(nbnd) + [ f_inp2(1) f_inp2(2) f_inp2(3) ... f_inp2(10) + f_inp2(11) f_inp2(12) ... f_inp2(nbnd) ] ] + +[ CONSTRAINTS + nconstr { constr_tol } + constr_type(.) constr(1,.) constr(2,.) [ constr(3,.) constr(4,.) ] { constr_target(.) } ] + +[ ATOMIC_VELOCITIES + label(1) vx(1) vy(1) vz(1) + ..... + label(n) vx(n) vy(n) vz(n) ] + +[ ATOMIC_FORCES + label(1) Fx(1) Fy(1) Fz(1) + ..... + label(n) Fx(n) Fy(n) Fz(n) ] + +[ ADDITIONAL_K_POINTS + see: K_POINTS ] + +[ SOLVENTS + label(1) Density(1) Molecule(1) + label(2) Density(2) Molecule(2) + ..... + label(nsolv) Density(nsolv) Molecule(nsolv) ] + +[ HUBBARD { atomic | ortho-atomic | norm-atomic | wf | pseudo } + if (DFT+U) + U label(1)-manifold(1) u_val(1) + [ J0 label(1)-manifold(1) j0_val(1) ] + ..... + U label(n)-manifold(n) u_val(n) + [ J0 label(n)-manifold(n) j0_val(n) ] + if (DFT+U+J) + paramType(1) label(1)-manifold(1) paramValue(1) + ..... + paramType(n) label(n)-manifold(n) paramValue(n) + if (DFT+U+V) + U label(I)-manifold(I) u_val(I) + [ J0 label(I)-manifold(I) j0_val(I) ] + V label(I)-manifold(I) label(J)-manifold(J) I J v_val(I,J) + ..... + U label(N)-manifold(N) u_val(N) + [ J0 label(N)-manifold(N) j0_val(N) ] + V label(N)-manifold(N) label(M)-manifold(M) N M v_val(N,M) +] +All Hubbard parameters must be specified in eV. +manifold = 3d, 2p, 4f... +paramType = U, J, B, E2, or E3 +Check Doc/Hubbard_input.pdf for more details. + + + +======================================================================== +NAMELIST: &CONTROL + + +-------------------------------------------------------------------- + Variable: calculation + + Type: CHARACTER + Default: 'scf' + Description: + A string describing the task to be performed. Options are: + 'scf' + 'nscf' + 'bands' + 'relax' + 'md' + 'vc-relax' + 'vc-md' + + (vc = variable-cell). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: title + + Type: CHARACTER + Default: ' ' + Description: reprinted on output. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: verbosity + + Type: CHARACTER + Default: 'low' + Description: + Currently two verbosity levels are implemented: + 'high' + 'low' + + 'debug' and 'medium' have the same effect as 'high'; + 'default' and 'minimal' as 'low' + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: restart_mode + + Type: CHARACTER + Default: 'from_scratch' + Description: + Available options are: + + 'from_scratch' : + From scratch. This is the normal way to perform a PWscf calculation + + 'restart' : + From previous interrupted run. Use this switch only if you want to + continue, using the same number of processors and parallelization, + an interrupted calculation. Do not use to start a new one, or to + perform a non-scf calculations. Works only if the calculation was + cleanly stopped using variable "max_seconds", or by user request + with an "exit file" (i.e.: create a file "prefix".EXIT, in directory + "outdir"; see variables "prefix", "outdir"). The default for + "startingwfc" and "startingpot" is set to 'file'. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: wf_collect + + Type: LOGICAL + Description: OBSOLETE - NO LONGER IMPLEMENTED + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: nstep + + Type: INTEGER + Description: number of molecular-dynamics or structural optimization steps + performed in this run. If set to 0, the code performs a quick + "dry run", stopping just after initialization. This is useful + to check for input correctness and to have the summary printed. + NOTE: in MD calculations, the code will perform "nstep" steps + even if restarting from a previously interrupted calculation. + Default: 1 if "calculation" == 'scf', 'nscf', 'bands'; + 50 for the other cases + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: iprint + + Type: INTEGER + Default: write only at convergence + Description: band energies are written every iprint iterations + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: tstress + + Type: LOGICAL + Default: .false. + Description: calculate stress. It is set to .TRUE. automatically if + "calculation" == 'vc-md' or 'vc-relax' + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: tprnfor + + Type: LOGICAL + Description: calculate forces. It is set to .TRUE. automatically if + "calculation" == 'relax','md','vc-md' + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: dt + + Type: REAL + Default: 20.D0 + Description: time step for molecular dynamics, in Rydberg atomic units + (1 a.u.=4.8378 * 10^-17 s : beware, the CP code uses + Hartree atomic units, half that much!!!) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: outdir + + Type: CHARACTER + Default: value of the ESPRESSO_TMPDIR environment variable if set; + current directory ('./') otherwise + Description: input, temporary, output files are found in this directory, + see also "wfcdir" + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: wfcdir + + Type: CHARACTER + Default: same as "outdir" + Description: This directory specifies where to store files generated by + each processor (*.wfc{N}, *.igk{N}, etc.). Useful for + machines without a parallel file system: set "wfcdir" to + a local file system, while "outdir" should be a parallel + or network file system, visible to all processors. Beware: + in order to restart from interrupted runs, or to perform + further calculations using the produced data files, you + may need to copy files to "outdir". Works only for pw.x. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: prefix + + Type: CHARACTER + Default: 'pwscf' + Description: prepended to input/output filenames: + prefix.wfc, prefix.rho, etc. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lkpoint_dir + + Type: LOGICAL + Description: OBSOLETE - NO LONGER IMPLEMENTED + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: max_seconds + + Type: REAL + Default: 1.D+7, or 150 days, i.e. no time limit + Description: Jobs stops after "max_seconds" CPU time. Use this option + in conjunction with option "restart_mode" if you need to + split a job too long to complete into shorter jobs that + fit into your batch queues. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: etot_conv_thr + + Type: REAL + Default: 1.0D-4 + Description: Convergence threshold on total energy (a.u) for ionic + minimization: the convergence criterion is satisfied + when the total energy changes less than "etot_conv_thr" + between two consecutive scf steps. Note that "etot_conv_thr" + is extensive, like the total energy. + See also "forc_conv_thr" - both criteria must be satisfied + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: forc_conv_thr + + Type: REAL + Default: 1.0D-3 + Description: Convergence threshold on forces (a.u) for ionic minimization: + the convergence criterion is satisfied when all components of + all forces are smaller than "forc_conv_thr". + See also "etot_conv_thr" - both criteria must be satisfied + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: disk_io + + Type: CHARACTER + Default: see below + Description: + Specifies the amount of disk I/O activity: + (only for binary files and xml data file in data directory; + other files printed at each molecular dynamics / structural + optimization step are not controlled by this option ) + + 'high' : + save charge to disk at each SCF step, + keep wavefunctions on disk (in "distributed" format), + save mixing data as well. + Do not use this option unless you have a good reason! + It is no longer needed to specify 'high' in order to be able + to restart from an interrupted calculation (see "restart_mode") + + 'medium' : + save charge to disk at each SCF step, + keep wavefunctions on disk only if more than one k-point, + per process is present, otherwise keep them in memory; + save them to disk only at the end (in "portable" format) + + 'low' : + save charge to disk at each SCF step, + keep wavefunctions in memory (for all k-points), + save them to disk only at the end (in "portable" format). + Reduces I/O but increases memory wrt the previous cases + + 'nowf' : + save to disk only the xml data file, + never save wavefunctions and charge density + + 'none' : + do not save anything to disk + + Default is 'low' for the scf case, 'medium' otherwise. + Note that the needed RAM increases as disk I/O decreases + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: pseudo_dir + + Type: CHARACTER + Default: value of the $ESPRESSO_PSEUDO environment variable if set; + '$HOME/espresso/pseudo/' otherwise + Description: directory containing pseudopotential files + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: tefield + + Type: LOGICAL + Default: .FALSE. + Description: If .TRUE. a saw-like potential simulating an electric field + is added to the bare ionic potential. See variables "edir", + "eamp", "emaxpos", "eopreg" for the form and size of + the added potential. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: dipfield + + Type: LOGICAL + Default: .FALSE. + Description: If .TRUE. and "tefield"==.TRUE. a dipole correction is also + added to the bare ionic potential - implements the recipe + of L. Bengtsson, PRB 59, 12301 (1999). See variables "edir", + "emaxpos", "eopreg" for the form of the correction. Must + be used ONLY in a slab geometry, for surface calculations, + with the discontinuity FALLING IN THE EMPTY SPACE. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lelfield + + Type: LOGICAL + Default: .FALSE. + Description: If .TRUE. a homogeneous finite electric field described + through the modern theory of the polarization is applied. + This is different from "tefield" == .true. ! + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: nberrycyc + + Type: INTEGER + Default: 1 + Description: In the case of a finite electric field ( "lelfield" == .TRUE. ) + it defines the number of iterations for converging the + wavefunctions in the electric field Hamiltonian, for each + external iteration on the charge density + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lorbm + + Type: LOGICAL + Default: .FALSE. + Description: If .TRUE. perform orbital magnetization calculation. + If finite electric field is applied ("lelfield"==.true.) only Kubo terms are computed + [for details see New J. Phys. 12, 053032 (2010), doi:10.1088/1367-2630/12/5/053032]. + + The type of calculation is 'nscf' and should be performed on an automatically + generated uniform grid of k points. + + Works ONLY with norm-conserving pseudopotentials. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lberry + + Type: LOGICAL + Default: .FALSE. + Description: If .TRUE. perform a Berry phase calculation. + See the header of PW/src/bp_c_phase.f90 for documentation. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: gdir + + Type: INTEGER + Description: For Berry phase calculation: direction of the k-point + strings in reciprocal space. Allowed values: 1, 2, 3 + 1=first, 2=second, 3=third reciprocal lattice vector + For calculations with finite electric fields + ("lelfield"==.true.) "gdir" is the direction of the field. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: nppstr + + Type: INTEGER + Description: For Berry phase calculation: number of k-points to be + calculated along each symmetry-reduced string. + The same for calculation with finite electric fields + ("lelfield"==.true.). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: gate + + Type: LOGICAL + Default: .FALSE. + See: zgate, relaxz, block, block_1, block_2, block_height + Description: In the case of charged cells ("tot_charge" .ne. 0) setting gate = .TRUE. + represents the counter charge (i.e. -tot_charge) not by a homogeneous + background charge but with a charged plate, which is placed at "zgate" + (see below). Details of the gate potential can be found in + T. Brumme, M. Calandra, F. Mauri; PRB 89, 245406 (2014). + Note, that in systems which are not symmetric with respect to the plate, + one needs to enable the dipole correction! ("dipfield"=.true.). + Currently, symmetry can be used with gate=.true. but carefully check + that no symmetry is included which maps z to -z even if in principle one + could still use them for symmetric systems (i.e. no dipole correction). + For "nosym"=.false. verbosity is set to 'high'. + Note: this option was called "monopole" in v6.0 and 6.1 of pw.x + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: twochem + + Type: LOGICAL + Default: .FALSE. + See: nelec_cond, nbnd_cond, degauss_cond + Description: IF .TRUE. , a two chemical potential calculation for the simulation of + photoexcited systems is performed, constraining a fraction of the + electrons in the conduction manifold. + See G. Marini, M. Calandra; PRB 104, 144103 (2021). + Note: requires "occupations" to be set to 'smearing'. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lfcp + + Type: LOGICAL + Default: .FALSE. + Description: If .TRUE. perform a constant bias potential (constant-mu) calculation + for a system with ESM method. See the header of PW/src/fcp_module.f90 + for documentation. To perform the calculation, you must set a namelist FCP. + + NB: + - The total energy displayed in output includes the potentiostat + contribution (-mu*N). + - "calculation" must be 'relax' or 'md'. + - "assume_isolated" = 'esm' and "esm_bc" = 'bc2' or 'bc3' must be set + in "SYSTEM" namelist. + - ESM-RISM is also supported ("assume_isolated" = 'esm' and "esm_bc" = 'bc1' + and "trism" = .TRUE.). + - "ignore_wolfe" is always .TRUE., for BFGS. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: trism + + Type: LOGICAL + Default: .FALSE. + Description: If .TRUE. perform a 3D-RISM-SCF calculation + [for details see H.Sato et al., JCP 112, 9463 (2000), doi:10.1063/1.481564]. + The solvent's distributions are calculated by 3D-RISM, + though solute is treated as SCF. The charge density and + the atomic positions are optimized, simultaneously with + the solvents. To perform the calculation, you must set + a namelist "RISM" and a card "SOLVENTS". + + If "assume_isolated" = 'esm' and "esm_bc" = 'bc1', + Laue-RISM is calculated instead of 3D-RISM + and coupled with ESM method (i.e. ESM-RISM). + [for details see S.Nishihara and M.Otani, PRB 96, 115429 (2017)]. + + The default of "mixing_beta" is 0.2 + for both 3D-RISM and Laue-RISM. + + For structural relaxation with BFGS, + "ignore_wolfe" is always .TRUE. . + +-------------------------------------------------------------------- + +===END OF NAMELIST====================================================== + + +======================================================================== +NAMELIST: &SYSTEM + + +-------------------------------------------------------------------- + Variable: ibrav + + Type: INTEGER + Status: REQUIRED + Description: Bravais-lattice index. Optional only if space_group is set. + If ibrav /= 0, specify EITHER [ "celldm"(1)-"celldm"(6) ] + OR [ "A", "B", "C", "cosAB", "cosAC", "cosBC" ] + but NOT both. The lattice parameter "alat" is set to + alat = celldm(1) (in a.u.) or alat = A (in Angstrom); + see below for the other parameters. + For ibrav=0 specify the lattice vectors in "CELL_PARAMETERS", + optionally the lattice parameter alat = celldm(1) (in a.u.) + or = A (in Angstrom). If not specified, the lattice parameter is + taken from "CELL_PARAMETERS" + IMPORTANT NOTICE 1: + with ibrav=0 lattice vectors must be given with a sufficiently large + number of digits and with the correct symmetry, or else symmetry + detection may fail and strange problems may arise in symmetrization. + IMPORTANT NOTICE 2: + do not use celldm(1) or A as a.u. to Ang conversion factor, + use the true lattice parameters or nothing, + specify units in "CELL_PARAMETERS" and "ATOMIC_POSITIONS" + + ibrav structure celldm(2)-celldm(6) + or: b,c,cosbc,cosac,cosab + 0 free + crystal axis provided in input: see card "CELL_PARAMETERS" + + 1 cubic P (sc) + v1 = a(1,0,0), v2 = a(0,1,0), v3 = a(0,0,1) + + 2 cubic F (fcc) + v1 = (a/2)(-1,0,1), v2 = (a/2)(0,1,1), v3 = (a/2)(-1,1,0) + + 3 cubic I (bcc) + v1 = (a/2)(1,1,1), v2 = (a/2)(-1,1,1), v3 = (a/2)(-1,-1,1) + -3 cubic I (bcc), more symmetric axis: + v1 = (a/2)(-1,1,1), v2 = (a/2)(1,-1,1), v3 = (a/2)(1,1,-1) + + 4 Hexagonal and Trigonal P celldm(3)=c/a + v1 = a(1,0,0), v2 = a(-1/2,sqrt(3)/2,0), v3 = a(0,0,c/a) + + 5 Trigonal R, 3fold axis c celldm(4)=cos(gamma) + The crystallographic vectors form a three-fold star around + the z-axis, the primitive cell is a simple rhombohedron: + v1 = a(tx,-ty,tz), v2 = a(0,2ty,tz), v3 = a(-tx,-ty,tz) + where c=cos(gamma) is the cosine of the angle gamma between + any pair of crystallographic vectors, tx, ty, tz are: + tx=sqrt((1-c)/2), ty=sqrt((1-c)/6), tz=sqrt((1+2c)/3) + -5 Trigonal R, 3fold axis <111> celldm(4)=cos(gamma) + The crystallographic vectors form a three-fold star around + <111>. Defining a' = a/sqrt(3) : + v1 = a' (u,v,v), v2 = a' (v,u,v), v3 = a' (v,v,u) + where u and v are defined as + u = tz - 2*sqrt(2)*ty, v = tz + sqrt(2)*ty + and tx, ty, tz as for case ibrav=5 + Note: if you prefer x,y,z as axis in the cubic limit, + set u = tz + 2*sqrt(2)*ty, v = tz - sqrt(2)*ty + See also the note in Modules/latgen.f90 + + 6 Tetragonal P (st) celldm(3)=c/a + v1 = a(1,0,0), v2 = a(0,1,0), v3 = a(0,0,c/a) + + 7 Tetragonal I (bct) celldm(3)=c/a + v1=(a/2)(1,-1,c/a), v2=(a/2)(1,1,c/a), v3=(a/2)(-1,-1,c/a) + + 8 Orthorhombic P celldm(2)=b/a + celldm(3)=c/a + v1 = (a,0,0), v2 = (0,b,0), v3 = (0,0,c) + + 9 Orthorhombic base-centered(bco) celldm(2)=b/a + celldm(3)=c/a + v1 = (a/2, b/2,0), v2 = (-a/2,b/2,0), v3 = (0,0,c) + -9 as 9, alternate description + v1 = (a/2,-b/2,0), v2 = (a/2, b/2,0), v3 = (0,0,c) + 91 Orthorhombic one-face base-centered A-type + celldm(2)=b/a + celldm(3)=c/a + v1 = (a, 0, 0), v2 = (0,b/2,-c/2), v3 = (0,b/2,c/2) + + 10 Orthorhombic face-centered celldm(2)=b/a + celldm(3)=c/a + v1 = (a/2,0,c/2), v2 = (a/2,b/2,0), v3 = (0,b/2,c/2) + + 11 Orthorhombic body-centered celldm(2)=b/a + celldm(3)=c/a + v1=(a/2,b/2,c/2), v2=(-a/2,b/2,c/2), v3=(-a/2,-b/2,c/2) + + 12 Monoclinic P, unique axis c celldm(2)=b/a + celldm(3)=c/a, + celldm(4)=cos(ab) + v1=(a,0,0), v2=(b*cos(gamma),b*sin(gamma),0), v3 = (0,0,c) + where gamma is the angle between axis a and b. + -12 Monoclinic P, unique axis b celldm(2)=b/a + celldm(3)=c/a, + celldm(5)=cos(ac) + v1 = (a,0,0), v2 = (0,b,0), v3 = (c*cos(beta),0,c*sin(beta)) + where beta is the angle between axis a and c + + 13 Monoclinic base-centered celldm(2)=b/a + (unique axis c) celldm(3)=c/a, + celldm(4)=cos(gamma) + v1 = ( a/2, 0, -c/2), + v2 = (b*cos(gamma), b*sin(gamma), 0 ), + v3 = ( a/2, 0, c/2), + where gamma=angle between axis a and b projected on xy plane + + -13 Monoclinic base-centered celldm(2)=b/a + (unique axis b) celldm(3)=c/a, + celldm(5)=cos(beta) + v1 = ( a/2, b/2, 0), + v2 = ( -a/2, b/2, 0), + v3 = (c*cos(beta), 0, c*sin(beta)), + where beta=angle between axis a and c projected on xz plane + IMPORTANT NOTICE: until QE v.6.4.1, axis for ibrav=-13 had a + different definition: v1(old) =-v2(now), v2(old) = v1(now) + + 14 Triclinic celldm(2)= b/a, + celldm(3)= c/a, + celldm(4)= cos(bc), + celldm(5)= cos(ac), + celldm(6)= cos(ab) + v1 = (a, 0, 0), + v2 = (b*cos(gamma), b*sin(gamma), 0) + v3 = (c*cos(beta), c*(cos(alpha)-cos(beta)cos(gamma))/sin(gamma), + c*sqrt( 1 + 2*cos(alpha)cos(beta)cos(gamma) + - cos(alpha)^2-cos(beta)^2-cos(gamma)^2 )/sin(gamma) ) + where alpha is the angle between axis b and c + beta is the angle between axis a and c + gamma is the angle between axis a and b + +-------------------------------------------------------------------- + + ///--- + EITHER: + + +-------------------------------------------------------------------- + Variable: celldm(i), i=1,6 + + Type: REAL + See: ibrav + Description: Crystallographic constants - see the "ibrav" variable. + Specify either these OR "A","B","C","cosAB","cosBC","cosAC" NOT both. + Only needed values (depending on "ibrav") must be specified + alat = "celldm"(1) is the lattice parameter "a" (in BOHR) + If "ibrav"==0, only "celldm"(1) is used if present; + cell vectors are read from card "CELL_PARAMETERS" + +-------------------------------------------------------------------- + + OR: + + +-------------------------------------------------------------------- + Variables: A, B, C, cosAB, cosAC, cosBC + + Type: REAL + See: ibrav + Description: Traditional crystallographic constants: + + a,b,c in ANGSTROM + cosAB = cosine of the angle between axis a and b (gamma) + cosAC = cosine of the angle between axis a and c (beta) + cosBC = cosine of the angle between axis b and c (alpha) + + The axis are chosen according to the value of "ibrav". + Specify either these OR "celldm" but NOT both. + Only needed values (depending on "ibrav") must be specified. + + The lattice parameter alat = A (in ANGSTROM ). + + If "ibrav" == 0, only A is used if present, and + cell vectors are read from card "CELL_PARAMETERS". + +-------------------------------------------------------------------- + + \\\--- + + +-------------------------------------------------------------------- + Variable: nat + + Type: INTEGER + Status: REQUIRED + Description: number of atoms in the unit cell (ALL atoms, except if + space_group is set, in which case, INEQUIVALENT atoms) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: ntyp + + Type: INTEGER + Status: REQUIRED + Description: number of types of atoms in the unit cell + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: nbnd + + Type: INTEGER + Default: for an insulator, "nbnd" = number of valence bands + ("nbnd" = # of electrons /2); + for a metal, 20% more (minimum 4 more) + Description: Number of electronic states (bands) to be calculated. + Note that in spin-polarized calculations the number of + k-point, not the number of bands per k-point, is doubled + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: nbnd_cond + + Type: INTEGER + Default: nbnd_cond = "nbnd" - # of electrons / 2 in the collinear case; + nbnd_cond = "nbnd" - # of electrons in the noncollinear case. + Description: Number of electronic states in the conduction manifold + for a two chemical-potential calculation ("twochem"=.true.). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: tot_charge + + Type: REAL + Default: 0.0 + Description: Total charge of the system. Useful for simulations with charged cells. + By default the unit cell is assumed to be neutral (tot_charge=0). + tot_charge=+1 means one electron missing from the system, + tot_charge=-1 means one additional electron, and so on. + + In a periodic calculation a compensating jellium background is + inserted to remove divergences if the cell is not neutral. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: starting_charge(i), i=1,ntyp + + Type: REAL + Default: 0.0 + Description: starting charge on atomic type 'i', + to create starting potential with "startingpot" = 'atomic'. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: tot_magnetization + + Type: REAL + Default: -10000 [unspecified] + Description: Total majority spin charge - minority spin charge. + Used to impose a specific total electronic magnetization. + If unspecified then tot_magnetization variable is ignored and + the amount of electronic magnetization is determined during + the self-consistent cycle. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: starting_magnetization(i), i=1,ntyp + + Type: REAL + Default: 0 + Description: Starting spin polarization on atomic type 'i' in a spin + polarized (LSDA or noncollinear/spin-orbit) calculation. + For non-constrained calculations, the allowed values + range between -1 (all spins down for the valence electrons + of atom type 'i') to 1 (all spins up). + If you expect a nonzero magnetization in your ground state, + you MUST either specify a nonzero value for at least one + atomic type, or constrain the magnetization using variable + "tot_magnetization" for LSDA, "constrained_magnetization" + for noncollinear/spin-orbit calculations. If you don't, + you will get a nonmagnetic (zero magnetization) state. + In order to perform LSDA calculations for an antiferromagnetic + state, define two different atomic species corresponding to + sublattices of the same atomic type. + + NOTE 1: "starting_magnetization" is ignored in most BUT NOT ALL + cases in non-scf calculations: it is safe to keep the same + values for the scf and subsequent non-scf calculation. + + NOTE 2: If you fix the magnetization with + "tot_magnetization", do not specify "starting_magnetization". + + NOTE 3: In the noncollinear/spin-orbit case, starting with zero + starting_magnetization on all atoms imposes time reversal + symmetry. The magnetization is never calculated and is + set to zero (the internal variable domag is set to .FALSE.). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: ecutwfc + + Type: REAL + Status: REQUIRED + Description: kinetic energy cutoff (Ry) for wavefunctions + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: ecutrho + + Type: REAL + Default: 4 * "ecutwfc" + Description: Kinetic energy cutoff (Ry) for charge density and potential + For norm-conserving pseudopotential you should stick to the + default value, you can reduce it by a little but it will + introduce noise especially on forces and stress. + If there are ultrasoft PP, a larger value than the default is + often desirable (ecutrho = 8 to 12 times "ecutwfc", typically). + PAW datasets can often be used at 4*"ecutwfc", but it depends + on the shape of augmentation charge: testing is mandatory. + The use of gradient-corrected functional, especially in cells + with vacuum, or for pseudopotential without non-linear core + correction, usually requires an higher values of ecutrho + to be accurately converged. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: ecutfock + + Type: REAL + Default: ecutrho + Description: Kinetic energy cutoff (Ry) for the exact exchange operator in + EXX type calculations. By default this is the same as "ecutrho" + but in some EXX calculations, a significant speed-up can be obtained + by reducing ecutfock, at the expense of some loss in accuracy. + Must be .gt. "ecutwfc". Not implemented for stress calculation + and for US-PP and PAW pseudopotentials. + Use with care, especially in metals where it may give raise + to instabilities. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: nr1, nr2, nr3 + + Type: INTEGER + Description: Three-dimensional FFT mesh (hard grid) for charge + density (and scf potential). If not specified + the grid is calculated based on the cutoff for + charge density (see also "ecutrho") + Note: you must specify all three dimensions for this setting to + be used. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: nr1s, nr2s, nr3s + + Type: INTEGER + Description: Three-dimensional mesh for wavefunction FFT and for the smooth + part of charge density ( smooth grid ). + Coincides with "nr1", "nr2", "nr3" if "ecutrho" = 4 * ecutwfc ( default ) + Note: you must specify all three dimensions for this setting to + be used. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: nosym + + Type: LOGICAL + Default: .FALSE. + Description: if (.TRUE.) symmetry is not used. Consequences: + + - if a list of k points is provided in input, it is used + "as is": symmetry-inequivalent k-points are not generated, + and the charge density is not symmetrized; + + - if a uniform (Monkhorst-Pack) k-point grid is provided in + input, it is expanded to cover the entire Brillouin Zone, + irrespective of the crystal symmetry. + Time reversal symmetry is assumed so k and -k are considered + as equivalent unless "noinv"=.true. is specified. + + Do not use this option unless you know exactly what you want + and what you get. May be useful in the following cases: + - in low-symmetry large cells, if you cannot afford a k-point + grid with the correct symmetry + - in MD simulations + - in calculations for isolated atoms + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: nosym_evc + + Type: LOGICAL + Default: .FALSE. + Description: if (.TRUE.) symmetry is not used, and k points are + forced to have the symmetry of the Bravais lattice; + an automatically generated Monkhorst-Pack grid will contain + all points of the grid over the entire Brillouin Zone, + plus the points rotated by the symmetries of the Bravais + lattice which were not in the original grid. The same + applies if a k-point list is provided in input instead + of a Monkhorst-Pack grid. Time reversal symmetry is assumed + so k and -k are equivalent unless "noinv"=.true. is specified. + This option differs from "nosym" because it forces k-points + in all cases to have the full symmetry of the Bravais lattice + (not all uniform grids have such property!) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: noinv + + Type: LOGICAL + Default: .FALSE. + Description: if (.TRUE.) disable the usage of k => -k symmetry + (time reversal) in k-point generation + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: no_t_rev + + Type: LOGICAL + Default: .FALSE. + Description: if (.TRUE.) disable the usage of magnetic symmetry operations + that consist in a rotation + time reversal. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: force_symmorphic + + Type: LOGICAL + Default: .FALSE. + Description: if (.TRUE.) force the symmetry group to be symmorphic by disabling + symmetry operations having an associated fractionary translation + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: use_all_frac + + Type: LOGICAL + Default: .FALSE. + Description: if (.FALSE.) force real-space FFT grids to be commensurate with + fractionary translations of non-symmorphic symmetry operations, + if present (e.g.: if a fractional translation (0,0,c/4) exists, + the FFT dimension along the c axis must be multiple of 4). + if (.TRUE.) do not impose any constraints to FFT grids, even in + the presence of non-symmorphic symmetry operations. + BEWARE: use_all_frac=.TRUE. may lead to wrong results for + hybrid functionals and phonon calculations. Both cases use + symmetrization in real space that works for non-symmorphic + operations only if the real-space FFT grids are commensurate. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: occupations + + Type: CHARACTER + Description: + Available options are: + + 'smearing' : + gaussian smearing for metals; + see variables "smearing" and "degauss" + + 'tetrahedra' : + Tetrahedron method, Bloechl's version: + P.E. Bloechl, PRB 49, 16223 (1994) + Requires uniform grid of k-points, to be + automatically generated (see card "K_POINTS"). + Well suited for calculation of DOS, + less so (because not variational) for + force/optimization/dynamics calculations. + + 'tetrahedra_lin' : + Original linear tetrahedron method. + To be used only as a reference; + the optimized tetrahedron method is more efficient. + + 'tetrahedra_opt' : + Optimized tetrahedron method: + see M. Kawamura, PRB 89, 094515 (2014). + Can be used for phonon calculations as well. + + 'fixed' : + for insulators with a gap + + 'from_input' : + The occupation are read from input file, + card "OCCUPATIONS". Option valid only for a + single k-point, requires "nbnd" to be set + in input. Occupations should be consistent + with the value of "tot_charge". + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: one_atom_occupations + + Type: LOGICAL + Default: .FALSE. + Description: This flag is used for isolated atoms ("nat"=1) together with + "occupations"='from_input'. If it is .TRUE., the wavefunctions + are ordered as the atomic starting wavefunctions, independently + from their eigenvalue. The occupations indicate which atomic + states are filled. + + The order of the states is written inside the UPF pseudopotential file. + In the scalar relativistic case: + S -> l=0, m=0 + P -> l=1, z, x, y + D -> l=2, r^2-3z^2, xz, yz, xy, x^2-y^2 + + In the noncollinear magnetic case (with or without spin-orbit), + each group of states is doubled. For instance: + P -> l=1, z, x, y for spin up, l=1, z, x, y for spin down. + Up and down is relative to the direction of the starting + magnetization. + + In the case with spin-orbit and time-reversal + ("starting_magnetization"=0.0) the atomic wavefunctions are + radial functions multiplied by spin-angle functions. + For instance: + P -> l=1, j=1/2, m_j=-1/2,1/2. l=1, j=3/2, + m_j=-3/2, -1/2, 1/2, 3/2. + + In the magnetic case with spin-orbit the atomic wavefunctions + can be forced to be spin-angle functions by setting + "starting_spin_angle" to .TRUE.. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: starting_spin_angle + + Type: LOGICAL + Default: .FALSE. + Description: In the spin-orbit case when "domag"=.TRUE., by default, + the starting wavefunctions are initialized as in scalar + relativistic noncollinear case without spin-orbit. + + By setting "starting_spin_angle"=.TRUE. this behaviour can + be changed and the initial wavefunctions are radial + functions multiplied by spin-angle functions. + + When "domag"=.FALSE. the initial wavefunctions are always + radial functions multiplied by spin-angle functions + independently from this flag. + + When "lspinorb" is .FALSE. this flag is not used. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: degauss_cond + + Type: REAL + Default: 0.D0 Ry + Description: value of the gaussian spreading (Ry) for brillouin-zone + integration in the conduction manifold in a two-chemical + potential calculation ("twochem"=.true.). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: nelec_cond + + Type: REAL + Default: 0.D0 + Description: Number of electrons placed in the conduction manifold in a two-chemical + potential calculation ("twochem"=.true.). Of the total # of + electrons nelec, nelec-nelec_cond will occupy the valence + manifold and nelec_cond will be constrained in the conduction manifold. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: degauss + + Type: REAL + Default: 0.D0 Ry + Description: value of the gaussian spreading (Ry) for brillouin-zone + integration in metals. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: smearing + + Type: CHARACTER + Default: 'gaussian' + Description: + Available options are: + + 'gaussian', 'gauss' : + ordinary Gaussian spreading (Default) + + 'methfessel-paxton', 'm-p', 'mp' : + Methfessel-Paxton first-order spreading + (see PRB 40, 3616 (1989)). + + 'marzari-vanderbilt', 'cold', 'm-v', 'mv' : + Marzari-Vanderbilt-DeVita-Payne cold smearing + (see PRL 82, 3296 (1999)) + + 'fermi-dirac', 'f-d', 'fd' : + smearing with Fermi-Dirac function + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: nspin + + Type: INTEGER + Default: 1 + Description: nspin = 1 : non-polarized calculation (default) + + nspin = 2 : spin-polarized calculation, LSDA + (magnetization along z axis) + + nspin = 4 : spin-polarized calculation, noncollinear + (magnetization in generic direction) + DO NOT specify "nspin" in this case; + specify "noncolin"=.TRUE. instead + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: sic_gamma + + Type: REAL + Default: 0 + Description: Strength of the gammaDFT potential. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: pol_type + + Type: CHARACTER + Description: + Type of polaron in gammaDFT. + + 'e' : + electron polaron + + 'h' : + hole polaron + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: sic_energy + + Type: LOGICAL + Default: .false. + Description: Enable the calculation of the total energy in gammaDFT. When .true., + a preliminary calculation is performed to calculate the electron density + in the absence of the polaron. When .false., the total energy printed in + output should not be considered. For structural relaxations, it is + recommended to use .false. to avoid doubling the computational cost. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: sci_vb + + Type: REAL + Default: 0 + Description: Valence band shift (in eV) through self-consistent + scissor operator. When performing gammaDFT calculations + of polarons, the polaron level is not shifted. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: sci_cb + + Type: REAL + Default: 0 + Description: Conduction band band shift (in eV) through self-consistent + scissor operator. When performing gammaDFT calculations + of polarons, the polaron level is not shifted. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: noncolin + + Type: LOGICAL + Default: .false. + Description: if .true. the program will perform a noncollinear calculation. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: ecfixed + + Type: REAL + Default: 0.0 + See: q2sigma + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: qcutz + + Type: REAL + Default: 0.0 + See: q2sigma + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: q2sigma + + Type: REAL + Default: 0.1 + Description: ecfixed, qcutz, q2sigma: parameters for modified functional to be + used in variable-cell molecular dynamics (or in stress calculation). + "ecfixed" is the value (in Rydberg) of the constant-cutoff; + "qcutz" and "q2sigma" are the height and the width (in Rydberg) + of the energy step for reciprocal vectors whose square modulus + is greater than "ecfixed". In the kinetic energy, G^2 is + replaced by G^2 + qcutz * (1 + erf ( (G^2 - ecfixed)/q2sigma) ) + See: M. Bernasconi et al, J. Phys. Chem. Solids 56, 501 (1995), + doi:10.1016/0022-3697(94)00228-2 + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: input_dft + + Type: CHARACTER + Default: read from pseudopotential files + Description: Exchange-correlation functional: eg 'PBE', 'BLYP' etc + See Modules/funct.f90 for allowed values. + Overrides the value read from pseudopotential files. + Use with care and if you know what you are doing! + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: ace + + Type: LOGICAL + Default: true + Description: Use Adaptively Compressed Exchange operator as in + Lin Lin, J. Chem. Theory Comput. 2016, 12, 2242--2249, doi:10.1021/acs.jctc.6b00092 + + Set to false to use standard Exchange (much slower) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: exx_fraction + + Type: REAL + Default: it depends on the specified functional + Description: Fraction of EXX for hybrid functional calculations. In the case of + "input_dft"='PBE0', the default value is 0.25, while for "input_dft"='B3LYP' + the "exx_fraction" default value is 0.20. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: screening_parameter + + Type: REAL + Default: 0.106 + Description: screening_parameter for HSE like hybrid functionals. + For more information, see: + J. Chem. Phys. 118, 8207 (2003), doi:10.1063/1.1564060 + J. Chem. Phys. 124, 219906 (2006), doi:10.1063/1.2204597 + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: exxdiv_treatment + + Type: CHARACTER + Default: 'gygi-baldereschi' + Description: + Specific for EXX. It selects the kind of approach to be used + for treating the Coulomb potential divergencies at small q vectors. + + 'gygi-baldereschi' : + appropriate for cubic and quasi-cubic supercells + + 'vcut_spherical' : + appropriate for cubic and quasi-cubic supercells + + 'vcut_ws' : + appropriate for strongly anisotropic supercells, see also "ecutvcut". + + 'none' : + sets Coulomb potential at G,q=0 to 0.0 (required for GAU-PBE) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: x_gamma_extrapolation + + Type: LOGICAL + Default: .true. + Description: Specific for EXX. If .true., extrapolate the G=0 term of the + potential (see README in examples/EXX_example for more) + Set this to .false. for GAU-PBE. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: ecutvcut + + Type: REAL + Default: 0.0 Ry + See: exxdiv_treatment + Description: Reciprocal space cutoff for correcting Coulomb potential + divergencies at small q vectors. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: nqx1, nqx2, nqx3 + + Type: INTEGER + Description: Three-dimensional mesh for q (k1-k2) sampling of + the Fock operator (EXX). Can be smaller than + the number of k-points. + + Currently this defaults to the size of the k-point mesh used. + In QE =< 5.0.2 it defaulted to nqx1=nqx2=nqx3=1. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: localization_thr + + Type: REAL + Default: 0.0 + Description: Overlap threshold over which the exchange integral over a pair of localized orbitals + is included in the evaluation of EXX operator. Any value greater than 0.0 triggers + the SCDM localization and the evaluation on EXX using the localized orbitals. + Very small value of the threshold should yield the same result as the default EXX + evaluation + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: Hubbard_occ(ityp,i), (ityp,i)=(1,1) ... (ntyp,3) + + Type: REAL + Default: read from pseudopotentials + Description: Hubbard occupations is the number of electrons in the + Hubbard manifold. By default they are initialized by + reading the occupations from pseudopotentials. If specified + from the input, then the values read from the pseudopotentials + will be overwritten. + The second index of the Hubbard_occ array corresponds to the + Hubbard manifold number. It is possible to specify up to + three Hubbard manifolds per Hubbard atom. However, if you want + to specify three manifolds then the second and the third manifolds + will be considered as one effective manifold (see Doc/Hubbard_input.pdf) + + Note: Hubbard_occ cannot be used together with fully-relativistic pseudopotentials + (i.e. when noncolin=.true. and lspinorb=.true.) since this variable does not + allow to distinguish between the occupied and unoccupied channels (this is + needed when determining the atomic orbital offsets). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: Hubbard_alpha(i), i=1,ntyp + + Type: REAL + Default: 0.D0 for all species + Description: Hubbard_alpha(i) is the perturbation (on atom i, in eV) + used to compute U (and V) with the linear-response method of + Cococcioni and de Gironcoli, PRB 71, 035105 (2005) + (only for DFT+U or DFT+U+V). + + Note: Hubbard U and V can be computed using the HP code + which is based on density-functional perturbation theory, + and it gives exactly the same result as the method of + Cococcioni and de Gironcoli. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: Hubbard_beta(i), i=1,ntyp + + Type: REAL + Default: 0.D0 for all species + Description: Hubbard_beta(i) is the perturbation (on atom i, in eV) + used to compute J0 with the linear-response method of + Cococcioni and de Gironcoli, PRB 71, 035105 (2005) + (only for DFT+U or DFT+U+V). See also + PRB 84, 115108 (2011). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: starting_ns_eigenvalue(m,ispin,ityp), (m,ispin,ityp)=(1,1,1) ... (2*lmax+1,nspin or npol,ntyp) + + Type: REAL + Default: -1.d0 that means NOT SET + Description: In the first iteration of an DFT+U run it overwrites + the m-th eigenvalue of the ns occupation matrix for the + ispin component of atomic species ityp. + For the noncollinear case, the ispin index runs up to npol=2 + The value lmax is given by the maximum angular momentum + number to which the Hubbard U is applied. + Leave unchanged eigenvalues that are not set. + This is useful to suggest the desired orbital occupations + when the default choice takes another path. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: dmft + + Type: LOGICAL + Default: .FALSE. + Status: Requires compilation with hdf5 support + Description: If true, nscf calculation will exit in restart mode, scf calculation + will restart from there if DMFT updates are provided as hdf5 archive. + Scf calculation should be used only with "electron_maxstep" = 1. + "K_POINTS" have to be identical and given explicitly with "nosym". + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: dmft_prefix + + Type: CHARACTER + Default: "prefix" + Description: prepended to hdf5 archive: dmft_prefix.h5 + + DMFT update should be provided in group/dataset as: + - dft_misc_input/band_window with dimension [1, number of k-points, 2 (real + complex)] + - dft_update/delta_N with dimension [number of k-points, number of correlated orbitals, + number of correlated orbitals, 2 (real + complex)] + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: ensemble_energies + + Type: LOGICAL + Default: .false. + Description: If "ensemble_energies" = .true., an ensemble of xc energies + is calculated non-selfconsistently for perturbed + exchange-enhancement factors and LDA vs. PBE correlation + ratios after each converged electronic ground state + calculation. + + Ensemble energies can be analyzed with the 'bee' utility + included with libbeef. + + Requires linking against libbeef. + "input_dft" must be set to a BEEF-type functional + (e.g. input_dft = 'BEEF-vdW') + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: edir + + Type: INTEGER + Description: The direction of the electric field or dipole correction is + parallel to the bg(:,edir) reciprocal lattice vector, so the + potential is constant in planes defined by FFT grid points; + "edir" = 1, 2 or 3. Used only if "tefield" is .TRUE. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: emaxpos + + Type: REAL + Default: 0.5D0 + Description: Position of the maximum of the saw-like potential along crystal + axis "edir", within the unit cell (see below), 0 < emaxpos < 1 + Used only if "tefield" is .TRUE. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: eopreg + + Type: REAL + Default: 0.1D0 + Description: Zone in the unit cell where the saw-like potential decreases. + ( see below, 0 < eopreg < 1 ). Used only if "tefield" is .TRUE. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: eamp + + Type: REAL + Default: 0.001 a.u. + Description: Amplitude of the electric field, in ***Hartree*** a.u.; + 1 a.u. = 51.4220632*10^10 V/m. Used only if "tefield"==.TRUE. + The saw-like potential increases with slope "eamp" in the + region from ("emaxpos"+"eopreg"-1) to ("emaxpos"), then decreases + to 0 until ("emaxpos"+"eopreg"), in units of the crystal + vector "edir". Important: the change of slope of this + potential must be located in the empty region, or else + unphysical forces will result. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: angle1(i), i=1,ntyp + + Type: REAL + Description: The angle expressed in degrees between the initial + magnetization and the z-axis. For noncollinear calculations + only; index i runs over the atom types. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: angle2(i), i=1,ntyp + + Type: REAL + Description: The angle expressed in degrees between the projection + of the initial magnetization on x-y plane and the x-axis. + For noncollinear calculations only. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lforcet + + Type: LOGICAL + Description: When starting a non collinear calculation using an existing density + file from a collinear lsda calculation assumes previous density points in + z direction and rotates it in the direction described by "angle1" and + "angle2" variables for atomic type 1 + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: constrained_magnetization + + Type: CHARACTER + See: lambda, fixed_magnetization + Default: 'none' + Description: + Used to perform constrained calculations in magnetic systems. + Currently available choices: + + 'none' : + no constraint + + 'total' : + total magnetization is constrained by + adding a penalty functional to the total energy: + + LAMBDA * SUM_{i} ( magnetization(i) - fixed_magnetization(i) )**2 + + where the sum over i runs over the three components of + the magnetization. Lambda is a real number (see below). + Noncolinear case only. Use "tot_magnetization" for LSDA + + 'atomic' : + atomic magnetization are constrained to the defined + starting magnetization adding a penalty: + + LAMBDA * SUM_{i,itype} ( magnetic_moment(i,itype) - mcons(i,itype) )**2 + + where i runs over the cartesian components (or just z + in the collinear case) and itype over the types (1-ntype). + mcons(:,:) array is defined from starting_magnetization, + (also from angle1, angle2 in the noncollinear case). + lambda is a real number + + 'total direction' : + the angle theta of the total magnetization + with the z axis (theta = fixed_magnetization(3)) + is constrained: + + LAMBDA * ( arccos(magnetization(3)/mag_tot) - theta )**2 + + where mag_tot is the modulus of the total magnetization. + + 'atomic direction' : + not all the components of the atomic + magnetic moment are constrained but only the cosine + of angle1, and the penalty functional is: + + LAMBDA * SUM_{itype} ( mag_mom(3,itype)/mag_mom_tot - cos(angle1(ityp)) )**2 + + N.B.: symmetrization may prevent to reach the desired orientation + of the magnetization. Try not to start with very highly symmetric + configurations or use the nosym flag (only as a last remedy) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: fixed_magnetization(i), i=1,3 + + Type: REAL + See: constrained_magnetization + Default: 0.d0 + Description: total magnetization vector (x,y,z components) to be kept + fixed when "constrained_magnetization"=='total' + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lambda + + Type: REAL + See: constrained_magnetization + Default: 1.d0 + Description: parameter used for constrained_magnetization calculations + N.B.: if the scf calculation does not converge, try to reduce lambda + to obtain convergence, then restart the run with a larger lambda + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: report + + Type: INTEGER + Default: -1 + Description: determines when atomic magnetic moments are printed on output: + report = 0 never + report =-1 at the beginning of the scf and at convergence + report = N as -1, plus every N scf iterations + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lspinorb + + Type: LOGICAL + Description: if .TRUE. the noncollinear code can use a pseudopotential with + spin-orbit. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: assume_isolated + + Type: CHARACTER + Default: 'none' + Description: + Used to perform calculation assuming the system to be + isolated (a molecule or a cluster in a 3D supercell). + + Currently available choices: + + 'none' : + (default): regular periodic calculation w/o any correction. + + 'makov-payne', 'm-p', 'mp' : + the Makov-Payne correction to the + total energy is computed. An estimate of the vacuum + level is also calculated so that eigenvalues can be + properly aligned. ONLY FOR CUBIC SYSTEMS ("ibrav"=1,2,3). + Theory: G.Makov, and M.C.Payne, + "Periodic boundary conditions in ab initio + calculations" , PRB 51, 4014 (1995). + + 'martyna-tuckerman', 'm-t', 'mt' : + Martyna-Tuckerman correction + to both total energy and scf potential. Adapted from: + G.J. Martyna, and M.E. Tuckerman, + "A reciprocal space based method for treating long + range interactions in ab-initio and force-field-based + calculation in clusters", J. Chem. Phys. 110, 2810 (1999), + doi:10.1063/1.477923. + + 'esm' : + Effective Screening Medium Method. + For polarized or charged slab calculation, embeds + the simulation cell within an effective semi- + infinite medium in the perpendicular direction + (along z). Embedding regions can be vacuum or + semi-infinite metal electrodes (use "esm_bc" to + choose boundary conditions). If between two + electrodes, an optional electric field + ("esm_efield") may be applied. Method described in + M. Otani and O. Sugino, "First-principles calculations + of charged surfaces and interfaces: A plane-wave + nonrepeated slab approach", PRB 73, 115407 (2006). + + NB: + - Two dimensional (xy plane) average charge density + and electrostatic potentials are printed out to + 'prefix.esm1'. + + - Requires cell with a_3 lattice vector along z, + normal to the xy plane, with the slab centered + around z=0. + + - For bc2 with an electric field and bc3 boundary + conditions, the inversion symmetry along z-direction + is automatically eliminated. + + - In case of calculation='vc-relax', use + "cell_dofree"='2Dxy' or other parameters so that + c-vector along z-axis should not be moved. + + See "esm_bc", "esm_efield", "esm_w", "esm_nfit". + + '2D' : + Truncation of the Coulomb interaction in the z direction + for structures periodic in the x-y plane. Total energy, + forces and stresses are computed in a two-dimensional framework. + Linear-response calculations () done on top of a self-consistent + calculation with this flag will automatically be performed in + the 2D framework as well. Please refer to: + Sohier, T., Calandra, M., & Mauri, F. (2017), "Density functional + perturbation theory for gated two-dimensional heterostructures: + Theoretical developments and application to flexural phonons in graphene", + PRB, 96, 075448 (2017). + + NB: + - The length of the unit-cell along the z direction should + be larger than twice the thickness of the 2D material + (including electrons). A reasonable estimate for a + layer's thickness could be the interlayer distance in the + corresponding layered bulk material. Otherwise, + the atomic thickness + 10 bohr should be a safe estimate. + There is also a lower limit of 20 bohr imposed by the cutoff + radius used to read pseudopotentials (see read_pseudo.f90 in Modules). + + - As for ESM above, only in-plane stresses make sense and one + should use "cell_dofree"= '2Dxy' in a vc-relax calculation. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: esm_bc + + Type: CHARACTER + See: assume_isolated + Default: 'pbc' + Description: + If "assume_isolated" = 'esm', determines the boundary + conditions used for either side of the slab. + + Currently available choices: + + 'pbc' : + (default): regular periodic calculation (no ESM). + + 'bc1' : + Vacuum-slab-vacuum (open boundary conditions). + + 'bc2' : + Metal-slab-metal (dual electrode configuration). + See also "esm_efield". + + 'bc3' : + Vacuum-slab-metal + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: esm_w + + Type: REAL + See: assume_isolated + Default: 0.d0 + Description: If "assume_isolated" = 'esm', determines the position offset + [in a.u.] of the start of the effective screening region, + measured relative to the cell edge. (ESM region begins at + z = +/- [L_z/2 + esm_w] ). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: esm_efield + + Type: REAL + See: assume_isolated + Default: 0.d0 + Description: If "assume_isolated" = 'esm' and "esm_bc" = 'bc2', gives the + magnitude of the electric field [Ry/a.u.] to be applied + between semi-infinite ESM electrodes. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: esm_nfit + + Type: INTEGER + See: assume_isolated + Default: 4 + Description: If "assume_isolated" = 'esm', gives the number of z-grid points + for the polynomial fit along the cell edge. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lgcscf + + Type: LOGICAL + Default: .FALSE. + Description: If .TRUE. perform a constant bias potential (constant-mu) calculation + with Grand-Canonical SCF. (JCP 146, 114104 (2017), R.Sundararaman, et al.) + + NB: + - The total energy displayed in output includes the potentiostat + contribution (-mu*N). + - "assume_isolated" = 'esm' and "esm_bc" = 'bc2' or 'bc3' must be set + in "SYSTEM" namelist. + - ESM-RISM is also supported ("assume_isolated" = 'esm' and "esm_bc" = 'bc1' + and "trism" = .TRUE.). + - "mixing_mode" has to be 'TF' or 'local-TF', also its default is 'TF.' + - The default of "mixing_beta" is 0.1 with ESM-RISM, 0.2 without ESM-RISM. + - The default of "diago_thr_init" is 1.D-5. + - "diago_full_acc" is always .TRUE. . + - "diago_rmm_conv" is always .TRUE. . + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: gcscf_mu + + Type: REAL + Status: REQUIRED + Description: The target Fermi energy (eV) of GC-SCF. One can start + with appropriate total charge of the system by giving "tot_charge" . + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: gcscf_conv_thr + + Type: REAL + Default: 1.D-2 + Description: Convergence threshold of Fermi energy (eV) for GC-SCF. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: gcscf_beta + + Type: REAL + Default: 0.05D0 + Description: Mixing factor for GC-SCF. + Larger values are recommended, + if systems with small DOS on Fermi surface as graphite. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: vdw_corr + + Type: CHARACTER + Default: 'none' + See: london_s6, london_rcut, london_c6, london_rvdw, + dftd3_version, dftd3_threebody, ts_vdw_econv_thr, ts_vdw_isolated, xdm_a1, xdm_a2 + Description: + Type of Van der Waals correction. Allowed values: + + 'grimme-d2', 'Grimme-D2', 'DFT-D', 'dft-d' : + Semiempirical Grimme's DFT-D2. Optional variables: + "london_s6", "london_rcut", "london_c6", "london_rvdw" + S. Grimme, J. Comp. Chem. 27, 1787 (2006), doi:10.1002/jcc.20495 + V. Barone et al., J. Comp. Chem. 30, 934 (2009), doi:10.1002/jcc.21112 + + 'grimme-d3', 'Grimme-D3', 'DFT-D3', 'dft-d3' : + Semiempirical Grimme's DFT-D3. Optional variables: + "dftd3_version", "dftd3_threebody" + S. Grimme et al, J. Chem. Phys 132, 154104 (2010), doi:10.1063/1.3382344 + + 'TS', 'ts', 'ts-vdw', 'ts-vdW', 'tkatchenko-scheffler' : + Tkatchenko-Scheffler dispersion corrections with first-principle derived + C6 coefficients. + Optional variables: "ts_vdw_econv_thr", "ts_vdw_isolated" + See A. Tkatchenko and M. Scheffler, PRL 102, 073005 (2009). + + 'MBD', 'mbd', 'many-body-dispersion', 'mbd_vdw' : + Many-body dipersion (MBD) correction to long-range interactions. + Optional variables: "ts_vdw_isolated" + A. Ambrosetti, A. M. Reilly, R. A. DiStasio, A. Tkatchenko, J. Chem. Phys. 140 + 18A508 (2014). + + 'XDM', 'xdm' : + Exchange-hole dipole-moment model. Optional variables: "xdm_a1", "xdm_a2" + A. D. Becke et al., J. Chem. Phys. 127, 154108 (2007), doi:10.1063/1.2795701 + A. Otero de la Roza et al., J. Chem. Phys. 136, 174109 (2012), + doi:10.1063/1.4705760 + + Note that non-local functionals (eg vdw-DF) are NOT specified here but in "input_dft" + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: london + + Type: LOGICAL + Default: .FALSE. + Status: OBSOLESCENT, same as "vdw_corr"='DFT-D' + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: london_s6 + + Type: REAL + Default: 0.75 + Description: global scaling parameter for DFT-D. Default is good for PBE. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: london_c6(i), i=1,ntyp + + Type: REAL + Default: standard Grimme-D2 values + Description: atomic C6 coefficient of each atom type + + ( if not specified default values from S. Grimme, J. Comp. Chem. 27, 1787 (2006), + doi:10.1002/jcc.20495 are used; see file Modules/mm_dispersion.f90 ) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: london_rvdw(i), i=1,ntyp + + Type: REAL + Default: standard Grimme-D2 values + Description: atomic vdw radii of each atom type + + ( if not specified default values from S. Grimme, J. Comp. Chem. 27, 1787 (2006), + doi:10.1002/jcc.20495 are used; see file Modules/mm_dispersion.f90 ) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: london_rcut + + Type: REAL + Default: 200 + Description: cutoff radius (a.u.) for dispersion interactions + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: dftd3_version + + Type: integer + Default: 3 + Description: + Version of Grimme implementation of Grimme-D3: + + dftd3_version = 2 : + Original Grimme-D2 parametrization + + dftd3_version = 3 : + Grimme-D3 (zero damping) + + dftd3_version = 4 : + Grimme-D3 (BJ damping) + + dftd3_version = 5 : + Grimme-D3M (zero damping) + + dftd3_version = 6 : + Grimme-D3M (BJ damping) + + NOTE: not all functionals are parametrized. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: dftd3_threebody + + Type: LOGICAL + Default: TRUE + Description: Turn three-body terms in Grimme-D3 on. If .false. two-body contributions + only are computed, using two-body parameters of Grimme-D3. + If dftd3_version=2, three-body contribution is always disabled. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: ts_vdw_econv_thr + + Type: REAL + Default: 1.D-6 + Description: Optional: controls the convergence of the vdW energy (and forces). The default value + is a safe choice, likely too safe, but you do not gain much in increasing it + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: ts_vdw_isolated + + Type: LOGICAL + Default: .FALSE. + Description: Optional: set it to .TRUE. when computing the Tkatchenko-Scheffler vdW energy or the + Many-Body dispersion (MBD) energy for an isolated (non-periodic) system. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: xdm + + Type: LOGICAL + Default: .FALSE. + Status: OBSOLESCENT, same as "vdw_corr"='xdm' + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: xdm_a1 + + Type: REAL + Default: 0.6836 + Description: Damping function parameter a1 (adimensional). It is NOT necessary to give + a value if the functional is one of B86bPBE, PW86PBE, PBE, BLYP. For functionals + in this list, the coefficients are given in: + http://schooner.chem.dal.ca/wiki/XDM + A. Otero de la Roza, E. R. Johnson, J. Chem. Phys. 138, 204109 (2013), + doi:10.1063/1.4705760 + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: xdm_a2 + + Type: REAL + Default: 1.5045 + Description: Damping function parameter a2 (angstrom). It is NOT necessary to give + a value if the functional is one of B86bPBE, PW86PBE, PBE, BLYP. For functionals + in this list, the coefficients are given in: + http://schooner.chem.dal.ca/wiki/XDM + A. Otero de la Roza, E. R. Johnson, J. Chem. Phys. 138, 204109 (2013), + doi:10.1063/1.4705760 + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: space_group + + Type: INTEGER + Default: 0 + Description: The number of the space group of the crystal, as given + in the International Tables of Crystallography A (ITA). + This allows to give in input only the inequivalent atomic + positions. The positions of all the symmetry equivalent atoms + are calculated by the code. Used only when the atomic positions + are of type crystal_sg. See also "uniqueb", + "origin_choice", "rhombohedral" + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: uniqueb + + Type: LOGICAL + Default: .FALSE. + Description: Used only for monoclinic lattices. If .TRUE. the b + unique "ibrav" (-12 or -13) are used, and symmetry + equivalent positions are chosen assuming that the + twofold axis or the mirror normal is parallel to the + b axis. If .FALSE. it is parallel to the c axis. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: origin_choice + + Type: INTEGER + Default: 1 + Description: Used only for space groups that in the ITA allow + the use of two different origins. "origin_choice"=1, + means the first origin, while "origin_choice"=2 is the + second origin. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rhombohedral + + Type: LOGICAL + Default: .TRUE. + Description: Used only for rhombohedral space groups. + When .TRUE. the coordinates of the inequivalent atoms are + given with respect to the rhombohedral axes, when .FALSE. + the coordinates of the inequivalent atoms are given with + respect to the hexagonal axes. They are converted internally + to the rhombohedral axes and "ibrav"=5 is used in both cases. + +-------------------------------------------------------------------- + + ///--- + VARIABLES USED ONLY IF "GATE" = .TRUE. + + +-------------------------------------------------------------------- + Variable: zgate + + Type: REAL + Default: 0.5 + Description: used only if "gate" = .TRUE. + Specifies the position of the charged plate which represents + the counter charge in doped systems ("tot_charge" .ne. 0). + In units of the unit cell length in z direction, "zgate" in ]0,1[ + Details of the gate potential can be found in + T. Brumme, M. Calandra, F. Mauri; PRB 89, 245406 (2014). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: relaxz + + Type: LOGICAL + Default: .FALSE. + Description: used only if "gate" = .TRUE. + Allows the relaxation of the system towards the charged plate. + Use carefully and utilize either a layer of fixed atoms or a + potential barrier ("block"=.TRUE.) to avoid the atoms moving to + the position of the plate or the dipole of the dipole + correction ("dipfield"=.TRUE.). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: block + + Type: LOGICAL + Default: .FALSE. + Description: used only if "gate" = .TRUE. + Adds a potential barrier to the total potential seen by the + electrons to mimic a dielectric in field effect configuration + and/or to avoid electrons spilling into the vacuum region for + electron doping. Potential barrier is from "block_1" to "block_2" and + has a height of block_height. + If "dipfield" = .TRUE. then "eopreg" is used for a smooth increase and + decrease of the potential barrier. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: block_1 + + Type: REAL + Default: 0.45 + Description: used only if "gate" = .TRUE. and "block" = .TRUE. + lower beginning of the potential barrier, in units of the + unit cell size along z, "block_1" in ]0,1[ + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: block_2 + + Type: REAL + Default: 0.55 + Description: used only if "gate" = .TRUE. and "block" = .TRUE. + upper beginning of the potential barrier, in units of the + unit cell size along z, "block_2" in ]0,1[ + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: block_height + + Type: REAL + Default: 0.1 + Description: used only if "gate" = .TRUE. and "block" = .TRUE. + Height of the potential barrier in Rydberg. + +-------------------------------------------------------------------- + + \\\--- + + +-------------------------------------------------------------------- + Variable: nextffield + + Type: INTEGER + Default: 0 + Description: Number of activated external ionic force fields. + See Doc/ExternalForceFields.tex for further explanation and parameterizations + +-------------------------------------------------------------------- + +===END OF NAMELIST====================================================== + + +======================================================================== +NAMELIST: &ELECTRONS + + +-------------------------------------------------------------------- + Variable: electron_maxstep + + Type: INTEGER + Default: 100 + Description: maximum number of iterations in a scf step. If exact exchange is active, + this will affect the inner loops. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: exx_maxstep + + Type: INTEGER + Default: 100 + Description: maximum number of outer iterations in a scf calculation with exact exchange. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: scf_must_converge + + Type: LOGICAL + Default: .TRUE. + Description: If .false. do not stop molecular dynamics or ionic relaxation + when electron_maxstep is reached. Use with care. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: conv_thr + + Type: REAL + Default: 1.D-6 + Description: Convergence threshold for selfconsistency: + estimated energy error < conv_thr + (note that conv_thr is extensive, like the total energy). + + For non-self-consistent calculations, conv_thr is used + to set the default value of the threshold (ethr) for + iterative diagonalization: see "diago_thr_init" + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: adaptive_thr + + Type: LOGICAL + Default: .FALSE + Description: If .TRUE. this turns on the use of an adaptive "conv_thr" for + the inner scf loops when using EXX. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: conv_thr_init + + Type: REAL + Default: 1.D-3 + Description: When "adaptive_thr" = .TRUE. this is the convergence threshold + used for the first scf cycle. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: conv_thr_multi + + Type: REAL + Default: 1.D-1 + Description: When "adaptive_thr" = .TRUE. the convergence threshold for + each scf cycle is given by: + max( "conv_thr", "conv_thr_multi" * dexx ) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: mixing_mode + + Type: CHARACTER + Default: 'plain' + Description: + Available options are: + + 'plain' : + charge density Broyden mixing + + 'TF' : + as above, with simple Thomas-Fermi screening + (for highly homogeneous systems) + + 'local-TF' : + as above, with local-density-dependent TF screening + (for highly inhomogeneous systems) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: mixing_beta + + Type: REAL + Default: 0.7D0 + Description: mixing factor for self-consistency + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: mixing_ndim + + Type: INTEGER + Default: 8 + Description: number of iterations used in mixing scheme. + If you are tight with memory, you may reduce it to 4 or so. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: mixing_fixed_ns + + Type: INTEGER + Default: 0 + Description: For DFT+U : number of iterations with fixed ns ( ns is the + atomic density appearing in the Hubbard term ). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: diagonalization + + Type: CHARACTER + Default: 'david' + Description: + Available options are: + + 'david' : + Davidson iterative diagonalization with overlap matrix + (default). Fast, may in some rare cases fail. + + 'cg' : + Conjugate-gradient-like band-by-band diagonalization. + MUCH slower than 'david' but uses less memory and is + (a little bit) more robust. + + 'ppcg' : + PPCG iterative diagonalization + + 'paro', 'ParO' : + ParO iterative diagonalization + + 'rmm-davidson', 'rmm-paro' : + RMM-DIIS iterative diagonalization. + To stabilize the SCF loop + RMM-DIIS is alternated with calls to Davidson or + ParO solvers depending on the string used. + Other variables that can be used to tune the behavior of + RMM-DIIS are: "diago_rmm_ndim" and "diago_rmm_conv" + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: diago_thr_init + + Type: REAL + Description: Convergence threshold (ethr) for iterative diagonalization + (the check is on eigenvalue convergence). + + For scf calculations: default is 1.D-2 if starting from a + superposition of atomic orbitals; 1.D-5 if starting from a + charge density. During self consistency the threshold + is automatically reduced (but never below 1.D-13) when + approaching convergence. + + For non-scf calculations: default is ("conv_thr"/N elec)/10. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: diago_cg_maxiter + + Type: INTEGER + Description: For conjugate gradient diagonalization: max number of iterations + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: diago_ppcg_maxiter + + Type: INTEGER + Description: For ppcg diagonalization: max number of iterations + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: diago_david_ndim + + Type: INTEGER + Default: 2 + Description: For Davidson diagonalization: dimension of workspace + (number of wavefunction packets, at least 2 needed). + A larger value may yield a smaller number of iterations in + the algorithm but uses more memory and more CPU time in + subspace diagonalization (cdiaghg/rdiaghg). You may try + "diago_david_ndim"=4 if you are not tight on memory + and if the time spent in subspace diagonalization is small + compared to the time spent in h_psi + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: diago_rmm_ndim + + Type: INTEGER + Default: 4 + Description: For RMM-DIIS diagonalization: dimension of workspace + (number of wavefunction packets, at least 2 needed). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: diago_rmm_conv + + Type: LOGICAL + Default: .FALSE. + Description: If .TRUE., RMM-DIIS is performed up to converge. + If .FALSE., RMM-DIIS is performed only once. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: diago_gs_nblock + + Type: INTEGER + Default: 16 + Description: For RMM-DIIS diagonalization: + blocking size of Gram-Schmidt orthogonalization + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: diago_full_acc + + Type: LOGICAL + Default: .FALSE. + Description: If .TRUE. all the empty states are diagonalized at the same level + of accuracy of the occupied ones. Otherwise the empty states are + diagonalized using a larger threshold (this should not affect + total energy, forces, and other ground-state properties). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: efield + + Type: REAL + Default: 0.D0 + Description: Amplitude of the finite electric field (in Ry a.u.; + 1 a.u. = 36.3609*10^10 V/m). Used only if "lelfield"==.TRUE. + and if k-points ("K_POINTS" card) are not automatic. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: efield_cart(i), i=1,3 + + Type: REAL + Default: (0.D0, 0.D0, 0.D0) + Description: Finite electric field (in Ry a.u.=36.3609*10^10 V/m) in + cartesian axis. Used only if "lelfield"==.TRUE. and if + k-points ("K_POINTS" card) are automatic. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: efield_phase + + Type: CHARACTER + Default: 'none' + Description: + Available options are: + + 'read' : + set the zero of the electronic polarization (with "lelfield"==.true..) + to the result of a previous calculation + + 'write' : + write on disk data on electronic polarization to be read in another + calculation + + 'none' : + none of the above points + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: startingpot + + Type: CHARACTER + Description: + Available options are: + + 'atomic' : + starting potential from atomic charge superposition + (default for scf, *relax, *md) + + 'file' : + start from existing "charge-density.xml" file in the + directory specified by variables "prefix" and "outdir" + For nscf and bands calculation this is the default + and the only sensible possibility. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: startingwfc + + Type: CHARACTER + Default: 'atomic+random' + Description: + Available options are: + + 'atomic' : + Start from superposition of atomic orbitals. + If not enough atomic orbitals are available, + fill with random numbers the remaining wfcs + The scf typically starts better with this option, + but in some high-symmetry cases one can "loose" + valence states, ending up in the wrong ground state. + + 'atomic+random' : + As above, plus a superimposed "randomization" + of atomic orbitals. Prevents the "loss" of states + mentioned above. + + 'random' : + Start from random wfcs. Slower start of scf but safe. + It may also reduce memory usage in conjunction with + "diagonalization"='cg'. + + 'file' : + Start from an existing wavefunction file in the + directory specified by variables "prefix" and "outdir". + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: tqr + + Type: LOGICAL + Default: .FALSE. + Description: If .true., use a real-space algorithm for augmentation + charges of ultrasoft pseudopotentials and PAWsets. + Faster but numerically less accurate than the default + G-space algorithm. Use with care and after testing! + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: real_space + + Type: LOGICAL + Default: .FALSE. + Description: If .true., exploit real-space localization to compute + matrix elements for nonlocal projectors. Faster and in + principle better scaling than the default G-space algorithm, + but numerically less accurate, may lead to some loss of + translational invariance. Use with care and after testing! + +-------------------------------------------------------------------- + +===END OF NAMELIST====================================================== + + +======================================================================== +NAMELIST: &IONS + + REQUIRED IF "CALCULATION" == 'RELAX', 'MD', 'VC-RELAX', OR 'VC-MD' + OPTIONAL FOR "CALCULATION" == 'SCF' (ONLY "ION_POSITIONS" IS USED) + + +-------------------------------------------------------------------- + Variable: ion_positions + + Type: CHARACTER + Default: 'default' + Description: + Available options are: + + 'default' : + if restarting, use atomic positions read from the + restart file; in all other cases, use atomic + positions from standard input. + + 'from_input' : + read atomic positions from standard input, even if restarting. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: ion_velocities + + Type: CHARACTER + Default: 'default' + Description: + Initial ionic velocities. Available options are: + + 'default' : + start a new simulation from random thermalized + distribution of velocities if "tempw" is set, + with zero velocities otherwise; restart from + atomic velocities read from the restart file + + 'from_input' : + start or continue the simulation with atomic + velocities read from standard input - see card + "ATOMIC_VELOCITIES" + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: ion_dynamics + + Type: CHARACTER + Description: + Specify the type of ionic dynamics. + + For different type of calculation different possibilities are + allowed and different default values apply: + + CASE ( "calculation" == 'relax' ) + + 'bfgs' : + (default) use BFGS quasi-newton algorithm, + based on the trust radius procedure, + for structural relaxation + + 'damp' : + use damped (quick-min Verlet) + dynamics for structural relaxation + Can be used for constrained + optimisation: see "CONSTRAINTS" card + + 'fire' : + use the FIRE minimization algorithm employing the + semi-implicit Euler integration scheme + see: + Bitzek et al.,PRL, 97, 170201, (2006), doi: 10.1103/PhysRevLett.97.170201 + Guenole et al.,CMS, 175, 109584, (2020), doi: 10.1016/j.commatsci.2020.109584 + + Can be used for constrained + optimisation: see "CONSTRAINTS" card + + CASE ( "calculation" == 'md' ) + + 'verlet' : + (default) use Verlet algorithm to integrate + Newton's equation. For constrained + dynamics, see "CONSTRAINTS" card + + 'langevin' : + ion dynamics is over-damped Langevin + + 'langevin-smc' : + over-damped Langevin with Smart Monte Carlo: + see R.J. Rossky, JCP, 69, 4628 (1978), doi:10.1063/1.436415 + + CASE ( "calculation" == 'vc-relax' ) + + 'bfgs' : + (default) use BFGS quasi-newton algorithm; + "cell_dynamics" must be 'bfgs' too + + 'damp' : + use damped (Beeman) dynamics for + structural relaxation + + CASE ( "calculation" == 'vc-md' ) + + 'beeman' : + (default) use Beeman algorithm to integrate + Newton's equation + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: pot_extrapolation + + Type: CHARACTER + Default: 'atomic' + Description: + Used to extrapolate the potential from preceding ionic steps. + + 'none' : + no extrapolation + + 'atomic' : + extrapolate the potential as if it was a sum of + atomic-like orbitals + + 'first_order' : + extrapolate the potential with first-order + formula + + 'second_order' : + as above, with second order formula + + Note: 'first_order' and 'second-order' extrapolation make sense + only for molecular dynamics calculations + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: wfc_extrapolation + + Type: CHARACTER + Default: 'none' + Description: + Used to extrapolate the wavefunctions from preceding ionic steps. + + 'none' : + no extrapolation + + 'first_order' : + extrapolate the wave-functions with first-order formula. + + 'second_order' : + as above, with second order formula. + + Note: 'first_order' and 'second-order' extrapolation make sense + only for molecular dynamics calculations + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: remove_rigid_rot + + Type: LOGICAL + Default: .FALSE. + Description: This keyword is useful when simulating the dynamics and/or the + thermodynamics of an isolated system. If set to true the total + torque of the internal forces is set to zero by adding new forces + that compensate the spurious interaction with the periodic + images. This allows for the use of smaller supercells. + + BEWARE: since the potential energy is no longer consistent with + the forces (it still contains the spurious interaction with the + repeated images), the total energy is not conserved anymore. + However the dynamical and thermodynamical properties should be + in closer agreement with those of an isolated system. + Also the final energy of a structural relaxation will be higher, + but the relaxation itself should be faster. + +-------------------------------------------------------------------- + + ///--- + VARIABLES USED FOR MOLECULAR DYNAMICS + + +-------------------------------------------------------------------- + Variable: ion_temperature + + Type: CHARACTER + Default: 'not_controlled' + Description: + Available options are: + + 'rescaling' : + control ionic temperature via velocity rescaling + (first method) see parameters "tempw", "tolp", and + "nraise" (for VC-MD only). This rescaling method + is the only one currently implemented in VC-MD + + 'rescale-v' : + control ionic temperature via velocity rescaling + (second method) see parameters "tempw" and "nraise" + + 'rescale-T' : + scale temperature of the thermostat every "nraise" steps + by "delta_t", starting from "tempw". + The temperature is controlled via velocitiy rescaling. + + 'reduce-T' : + reduce temperature of the thermostat every "nraise" steps + by the (negative) value "delta_t", starting from "tempw". + If "delta_t" is positive, the target temperature is augmented. + The temperature is controlled via velocitiy rescaling. + + 'berendsen' : + control ionic temperature using "soft" velocity + rescaling - see parameters "tempw" and "nraise" + + 'andersen' : + control ionic temperature using Andersen thermostat + see parameters "tempw" and "nraise" + + 'svr' : + control ionic temperature using stochastic-velocity rescaling + (Donadio, Bussi, Parrinello, J. Chem. Phys. 126, 014101, 2007), + with parameters "tempw" and "nraise". + + 'initial' : + initialize ion velocities to temperature "tempw" + and leave uncontrolled further on + + 'not_controlled' : + (default) ionic temperature is not controlled + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: tempw + + Type: REAL + Default: 300.D0 + Description: Starting temperature (Kelvin) in MD runs + target temperature for most thermostats. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: tolp + + Type: REAL + Default: 100.D0 + Description: Tolerance for velocity rescaling. Velocities are rescaled if + the run-averaged and target temperature differ more than tolp. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: delta_t + + Type: REAL + Default: 1.D0 + Description: if "ion_temperature" == 'rescale-T' : + at each step the instantaneous temperature is multiplied + by delta_t; this is done rescaling all the velocities. + + if "ion_temperature" == 'reduce-T' : + every 'nraise' steps the instantaneous temperature is + reduced by -"delta_t" (i.e. "delta_t" < 0 is added to T) + + The instantaneous temperature is calculated at the end of + every ionic move and BEFORE rescaling. This is the temperature + reported in the main output. + + For "delta_t" < 0, the actual average rate of heating or cooling + should be roughly C*delta_t/(nraise*dt) (C=1 for an + ideal gas, C=0.5 for a harmonic solid, theorem of energy + equipartition between all quadratic degrees of freedom). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: nraise + + Type: INTEGER + Default: 1 + Description: if "ion_temperature" == 'reduce-T' : + every "nraise" steps the instantaneous temperature is + reduced by -"delta_t" (i.e. "delta_t" is added to the temperature) + + if "ion_temperature" == 'rescale-v' : + every "nraise" steps the average temperature, computed from + the last "nraise" steps, is rescaled to "tempw" + + if "ion_temperature" == 'rescaling' and "calculation" == 'vc-md' : + every "nraise" steps the instantaneous temperature + is rescaled to "tempw" + + if "ion_temperature" == 'berendsen' : + the "rise time" parameter is given in units of the time step: + tau = nraise*dt, so dt/tau = 1/nraise + + if "ion_temperature" == 'andersen' : + the "collision frequency" parameter is given as nu=1/tau + defined above, so nu*dt = 1/nraise + + if "ion_temperature" == 'svr' : + the "characteristic time" of the thermostat is set to + tau = nraise*dt + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: refold_pos + + Type: LOGICAL + Default: .FALSE. + Description: This keyword applies only in the case of molecular dynamics or + damped dynamics. If true the ions are refolded at each step into + the supercell. + +-------------------------------------------------------------------- + + \\\--- + + ///--- + KEYWORDS USED ONLY IN BFGS CALCULATIONS + + +-------------------------------------------------------------------- + Variable: upscale + + Type: REAL + Default: 100.D0 + Description: Max reduction factor for "conv_thr" during structural optimization + "conv_thr" is automatically reduced when the relaxation + approaches convergence so that forces are still accurate, + but "conv_thr" will not be reduced to less that "conv_thr" / "upscale". + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: bfgs_ndim + + Type: INTEGER + Default: 1 + Description: Number of old forces and displacements vectors used in the + PULAY mixing of the residual vectors obtained on the basis + of the inverse hessian matrix given by the BFGS algorithm. + When "bfgs_ndim" = 1, the standard quasi-Newton BFGS method is + used. + (bfgs only) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: trust_radius_max + + Type: REAL + Default: 0.8D0 + Description: Maximum ionic displacement in the structural relaxation. + (bfgs only) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: trust_radius_min + + Type: REAL + Default: 1.D-3 + Description: Minimum ionic displacement in the structural relaxation + BFGS is reset when "trust_radius" < "trust_radius_min". + (bfgs only) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: trust_radius_ini + + Type: REAL + Default: 0.5D0 + Description: Initial ionic displacement in the structural relaxation. + (bfgs only) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: w_1 + + Type: REAL + Default: 0.01D0 + See: w_2 + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: w_2 + + Type: REAL + Default: 0.5D0 + Description: Parameters used in line search based on the Wolfe conditions. + (bfgs only) + +-------------------------------------------------------------------- + + \\\--- + + ///--- + KEYWORDS USED ONLY IN THE FIRE MINIMIZATION ALGORITHM + + +-------------------------------------------------------------------- + Variable: fire_alpha_init + + Type: REAL + Default: 0.2D0 + Description: Initial value of the alpha mixing factor in the FIRE minimization scheme; + recommended values are between 0.1 and 0.3 + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: fire_falpha + + Type: REAL + Default: 0.99D0 + Description: Scaling of the alpha mixing parameter for steps with P > 0; + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: fire_nmin + + Type: INTEGER + Default: 5 + Description: Minimum number of steps with P > 0 before increase of "dt" + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: fire_f_inc + + Type: REAL + Default: 1.1D0 + Description: Factor for increasing "dt" + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: fire_f_dec + + Type: REAL + Default: 0.5D0 + Description: Factor for decreasing "dt" + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: fire_dtmax + + Type: REAL + Default: 10.D0 + Description: Determines the maximum value of "dt" in the FIRE minimization; + dtmax = fire_dtmax*"dt" + +-------------------------------------------------------------------- + + \\\--- + +===END OF NAMELIST====================================================== + + +======================================================================== +NAMELIST: &CELL + + INPUT THIS NAMELIST ONLY IF "CALCULATION" == 'VC-RELAX' OR 'VC-MD' + + +-------------------------------------------------------------------- + Variable: cell_dynamics + + Type: CHARACTER + Description: + Specify the type of dynamics for the cell. + For different type of calculation different possibilities + are allowed and different default values apply: + + CASE ( "calculation" == 'vc-relax' ) + + 'none' : + no dynamics + + 'sd' : + steepest descent ( not implemented ) + + 'damp-pr' : + damped (Beeman) dynamics of the Parrinello-Rahman extended lagrangian + + 'damp-w' : + damped (Beeman) dynamics of the new Wentzcovitch extended lagrangian + + 'bfgs' : + BFGS quasi-newton algorithm (default) + "ion_dynamics" must be 'bfgs' too + + CASE ( "calculation" == 'vc-md' ) + + 'none' : + no dynamics + + 'pr' : + (Beeman) molecular dynamics of the Parrinello-Rahman extended lagrangian + + 'w' : + (Beeman) molecular dynamics of the new Wentzcovitch extended lagrangian + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: press + + Type: REAL + Default: 0.D0 + Description: Target pressure [KBar] in a variable-cell md or relaxation run. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: wmass + + Type: REAL + Default: 0.75*Tot_Mass/pi**2 for Parrinello-Rahman MD; + 0.75*Tot_Mass/pi**2/Omega**(2/3) for Wentzcovitch MD + Description: Fictitious cell mass [amu] for variable-cell simulations + (both 'vc-md' and 'vc-relax') + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: cell_factor + + Type: REAL + Default: 2.0 for variable-cell calculations, 1.0 otherwise + Description: Used in the construction of the pseudopotential tables. + It should exceed the maximum linear contraction of the + cell during a simulation. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: press_conv_thr + + Type: REAL + Default: 0.5D0 Kbar + Description: Convergence threshold on the pressure for variable cell + relaxation ('vc-relax' : note that the other convergence + thresholds for ionic relaxation apply as well). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: cell_dofree + + Type: CHARACTER + Default: 'all' + Description: + Select which of the cell parameters should be moved: + + 'all' : + all axis and angles are moved + + 'ibrav' : + all axis and angles are moved, + but the lattice remains consistent + with the initial ibrav choice. You can use this option in combination + with any other one by specifying "ibrav+option". Please note that some + combinations do not make sense for some crystals and will guarantee that + the relax will never converge. E.g. 'ibrav+2Dxy' is not a problem for + hexagonal cells, but will never converge for cubic ones. + + 'a' : + the x component of axis 1 (v1_x) is fixed + + 'b' : + the y component of axis 2 (v2_y) is fixed + + 'c' : + the z component of axis 3 (v3_z) is fixed + + 'fixa' : + axis 1 (v1_x,v1_y,v1_z) is fixed + + 'fixb' : + axis 2 (v2_x,v2_y,v2_z) is fixed + + 'fixc' : + axis 3 (v3_x,v3_y,v3_z) is fixed + + 'x' : + only the x component of axis 1 (v1_x) is moved + + 'y' : + only the y component of axis 2 (v2_y) is moved + + 'z' : + only the z component of axis 3 (v3_z) is moved + + 'xy' : + only v1_x and v2_y are moved + + 'xz' : + only v1_x and v3_z are moved + + 'yz' : + only v2_y and v3_z are moved + + 'xyz' : + only v1_x, v2_y, v3_z are moved + + 'shape' : + all axis and angles, keeping the volume fixed + + 'volume' : + the volume changes, keeping all angles fixed (i.e. only celldm(1) changes) + + '2Dxy' : + only x and y components are allowed to change + + '2Dshape' : + as above, keeping the area in xy plane fixed + + 'epitaxial_ab' : + fix axis 1 and 2 while allowing axis 3 to move + + 'epitaxial_ac' : + fix axis 1 and 3 while allowing axis 2 to move + + 'epitaxial_bc' : + fix axis 2 and 3 while allowing axis 1 to move + + BEWARE: if axis are not orthogonal, some of these options do not + work (symmetry is broken). If you are not happy with them, + edit subroutine init_dofree in file Modules/cell_base.f90 + +-------------------------------------------------------------------- + +===END OF NAMELIST====================================================== + + +======================================================================== +NAMELIST: &FCP + + INPUT THIS NAMELIST ONLY IF "LFCP" = .TRUE. + + +-------------------------------------------------------------------- + Variable: fcp_mu + + Type: REAL + Status: REQUIRED + Description: The target Fermi energy (eV). One can start + with appropriate total charge of the system by giving "tot_charge" . + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: fcp_dynamics + + Type: CHARACTER + Description: + Specify the type of dynamics for the Fictitious Charge Particle (FCP). + + For different type of calculation different possibilities + are allowed and different default values apply: + + CASE ( "calculation" == 'relax' ) + + 'bfgs' : + (default) BFGS quasi-newton algorithm, coupling with ions relaxation + "ion_dynamics" must be 'bfgs' too + + 'newton' : + Newton-Raphson algorithm with DIIS + "ion_dynamics" must be 'damp' too + + 'damp' : + damped (quick-min Verlet) dynamics for FCP relaxation + "ion_dynamics" must be 'damp' too + + 'lm' : + Line-Minimization algorithm for FCP relaxation + "ion_dynamics" must be 'damp' too + + CASE ( "calculation" == 'md' ) + + 'velocity-verlet' : + (default) Velocity-Verlet algorithm to integrate Newton's equation. + "ion_dynamics" must be 'verlet' too + + 'verlet' : + Verlet algorithm to integrate Newton's equation. + "ion_dynamics" must be 'verlet' too + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: fcp_conv_thr + + Type: REAL + Default: 1.D-2 + Description: Convergence threshold on force (eV) for FCP relaxation. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: fcp_ndiis + + Type: INTEGER + Default: 4 + Description: Size of DIIS for FCP relaxation, + used only if "fcp_dynamics" = 'newton'. + +-------------------------------------------------------------------- + + ///--- + VARIABLES USED FOR FCP DYNAMICS. + + +-------------------------------------------------------------------- + Variable: fcp_mass + + Type: REAL + Default: 5.D+6 / (xy area) for ESM only; + 5.D+4 / (xy area) for ESM-RISM + Description: Mass of the FCP. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: fcp_velocity + + Type: REAL + Default: determined by "fcp_temperature" + Description: Initial velocity of the FCP. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: fcp_temperature + + Type: CHARACTER + Default: "ion_temperature" + Description: + Available options are: + + 'rescaling' : + control FCP's temperature via velocity rescaling + (first method) see parameters "fpc_tempw" and "fcp_tolp". + + 'rescale-v' : + control FCP's temperature via velocity rescaling + (second method) see parameters "fcp_tempw" and "fcp_nraise" + + 'rescale-T' : + control FCP's temperature via velocity rescaling + (third method) see parameter "fcp_delta_t" + + 'reduce-T' : + reduce FCP's temperature every "fcp_nraise" steps + by the (negative) value "fcp_delta_t" + + 'berendsen' : + control FCP's temperature using "soft" velocity + rescaling - see parameters "fcp_tempw" and "fcp_nraise" + + 'andersen' : + control FCP's temperature using Andersen thermostat + see parameters "fcp_tempw" and "fcp_nraise" + + 'initial' : + initialize FCP's velocities to temperature "fcp_tempw" + and leave uncontrolled further on + + 'not_controlled' : + (default) FCP's temperature is not controlled + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: fcp_tempw + + Type: REAL + Default: "tempw" + Description: Starting temperature (Kelvin) in FCP dynamics runs + target temperature for most thermostats. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: fcp_tolp + + Type: REAL + Default: "tolp" + Description: Tolerance for velocity rescaling. Velocities are rescaled if + the run-averaged and target temperature differ more than tolp. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: fcp_delta_t + + Type: REAL + Default: "delta_t" + Description: if "fcp_temperature" == 'rescale-T' : + at each step the instantaneous temperature is multiplied + by fcp_delta_t; this is done rescaling all the velocities. + + if "fcp_temperature" == 'reduce-T' : + every "fcp_nraise" steps the instantaneous temperature is + reduced by -"fcp_delta_t" (i.e. "fcp_delta_t" < 0 is added to T) + + The instantaneous temperature is calculated at the end of + FCP's move and BEFORE rescaling. This is the temperature + reported in the main output. + + For "fcp_delta_t" < 0, the actual average rate of heating or cooling + should be roughly C*fcp_delta_t/(fcp_nraise*dt) (C=1 for an + ideal gas, C=0.5 for a harmonic solid, theorem of energy + equipartition between all quadratic degrees of freedom). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: fcp_nraise + + Type: INTEGER + Default: "nraise" + Description: if "fcp_temperature" == 'reduce-T' : + every "fcp_nraise" steps the instantaneous temperature is + reduced by -"fcp_delta_t" (i.e. "fcp_delta_t" is added to the temperature) + + if "fcp_temperature" == 'rescale-v' : + every "fcp_nraise" steps the average temperature, computed from + the last "fcp_nraise" steps, is rescaled to "fcp_tempw" + + if "fcp_temperature" == 'berendsen' : + the "rise time" parameter is given in units of the time step: + tau = fcp_nraise*dt, so dt/tau = 1/fcp_nraise + + if "fcp_temperature" == 'andersen' : + the "collision frequency" parameter is given as nu=1/tau + defined above, so nu*dt = 1/fcp_nraise + +-------------------------------------------------------------------- + + \\\--- + + +-------------------------------------------------------------------- + Variable: freeze_all_atoms + + Type: LOGICAL + Default: .FALSE. + Description: If .TRUE., freeze all atoms + to perform relaxation or dynamics only with FCP. + +-------------------------------------------------------------------- + +===END OF NAMELIST====================================================== + + +======================================================================== +NAMELIST: &RISM + + INPUT THIS NAMELIST ONLY IF "TRISM" = .TRUE. + + +-------------------------------------------------------------------- + Variable: nsolv + + Type: INTEGER + Status: REQUIRED + Description: The number of solvents (i.e. molecular species) in the unit cell + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: closure + + Type: CHARACTER + Default: 'kh' + Description: + Specify the type of closure equation: + + 'kh' : + The Kovalenko and Hirata's model. + [A.Kovalenko, F.Hirata, JCP 110, 10095 (1999), doi:10.1063/1.478883] + + 'hnc' : + The HyperNetted-Chain model, which is + suitable only for solvents without charge. + [J.P.Hansen et al., Theory of simple liquids. Academic Press, London, 1990] + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: tempv + + Type: REAL + Default: 300.D0 + Description: Temperature (Kelvin) of solvents. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: ecutsolv + + Type: REAL + Default: 4 * "ecutwfc" + Description: Kinetic energy cutoff (Ry) for solvent's correlation functions. + If a solute is an isolated system or slab, you may allowed to + use default value. For a frameworked or porous solute (e.g. Zeolite, MOF), + it is desirable to apply a larger value. Solvents confined in a framework + often have a high frequency. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: solute_lj(i), i=1,ntyp + + Type: CHARACTER + Default: 'uff' + Description: + Specify the Lennard-Jones potential of solute on atomic type 'i': + + 'none' : + The Lennard-Jones potential is not specified here. + you must set "solute_epsilon" and "solute_sigma". + + 'uff' : + Universal Force Field. + [A.K.Rappe et al., JACS 144, 10024 (1992), doi:10.1021/ja00051a040] + + 'clayff' : + Clay's Force Field + [R.T.Cygan et al., JPC B 108, 1255 (2004), doi:10.1021/jp0363287] + + 'opls-aa' : + OPLS-AA (generic parameters for QM/MM) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: solute_epsilon(i), i=1,ntyp + + Type: REAL + Description: The Lennard-Jones potential of solute on atomic type 'i'. + Here, you can set the parameter 'epsilon' (kcal/mol). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: solute_sigma(i), i=1,ntyp + + Type: REAL + Description: The Lennard-Jones potential of solute on atomic type 'i'. + Here, you can set the parameter 'sigma' (Angstrom). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: starting1d + + Type: CHARACTER + Description: + 'zero' : + Starting correlation functions of 1D-RISM from zero. + ( default for scf, *relax, *md ) + + 'file' : + Start from existing "1d-rism_csvv_r.xml" file in the + directory specified by variables "prefix" and "outdir". + + 'fix' : + Read from existing "1d-rism_csvv_r.xml" file in the + directory specified by variables "prefix" and "outdir", + and never calculate 1D-RISM. + For nscf and bands calculation this is the default. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: starting3d + + Type: CHARACTER + Description: + 'zero' : + Starting correlation functions of 3D-RISM from zero. + ( default for scf, *relax, *md ) + + 'file' : + Start from existing "3d-rism_csuv_r.dat" file in the + directory specified by variables "prefix" and "outdir". + For nscf and bands calculation this is the default. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: smear1d + + Type: REAL + Default: 2.D0 + Description: Coulomb smearing radius (a.u.) for 1D-RISM. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: smear3d + + Type: REAL + Default: 2.D0 + Description: Coulomb smearing radius (a.u.) for 3D-RISM. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rism1d_maxstep + + Type: INTEGER + Default: 50000 + Description: Maximum number of iterations in a 1D-RISM step. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rism3d_maxstep + + Type: INTEGER + Default: 5000 + Description: Maximum number of iterations in a 3D-RISM step. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rism1d_conv_thr + + Type: REAL + Default: 1.D-8 + Description: Convergence threshold for 1D-RISM. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rism3d_conv_thr + + Type: REAL + Default: 1.D-5 if "lgcscf" == .FALSE.; + 5.D-6 if "lgcscf" == .TRUE. + Description: Convergence threshold for 3D-RISM. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: mdiis1d_size + + Type: INTEGER + Default: 20 + Description: Size of Modified DIIS (MDIIS) for 1D-RISM. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: mdiis3d_size + + Type: INTEGER + Default: 10 + Description: Size of Modified DIIS (MDIIS) for 3D-RISM. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: mdiis1d_step + + Type: REAL + Default: 0.5D0 + Description: Step of Modified DIIS (MDIIS) for 1D-RISM. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: mdiis3d_step + + Type: REAL + Default: 0.8D0 + Description: Step of Modified DIIS (MDIIS) for 3D-RISM. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rism1d_bond_width + + Type: REAL + Description: Gaussian width of bonds to smear intra-molecular correlation for 1D-RISM. + If 3D-RISM calculation, default is 0. + If Laue-RISM calculation, default is 2 / SQRT("ecutwfc"). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rism1d_dielectric + + Type: REAL + Default: -1.0D0 + Description: Dielectric constant for 1D-RISM. + If "rism1d_dielectric" > 0, dielectrically consistent RISM (DRISM) is performed. + + For details of DRISM, see: + J.S.Perkyns and B.M.Pettitt, CPL 1992, 190, 626, doi:10.1016/0009-2614(92)85201-K + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rism1d_molesize + + Type: REAL + Default: 2.0D0 + Description: Size of solvent molecules (a.u.) for 1D-RISM. + This is used only if "rism1d_dielectric" > 0. + If you have large molecules, you have to set ~ 20 a.u. . + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rism1d_nproc + + Type: INTEGER + Default: 128 + Description: Number of processes to calculate 1D-RISM. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rism3d_conv_level + + Type: REAL + Default: 0.1 if "laue_both_hands" == .FALSE. .AND. "lgcscf" == .FALSE.; + 0.3 if "laue_both_hands" == .FALSE. .AND. "lgcscf" == .TRUE.; + 0.5 if "laue_both_hands" == .TRUE. + Description: + Convergence level of 3D-RISM. + + 0.0 : + Convergence level is 'low'. + Convergence threshold of 3D-RISM is greater than + "rism3d_conv_thr", when estimated energy error >> "conv_thr" . + The threshold becomes "rism3d_conv_thr", when + estimated energy error is enough small. + + 0.0 0.0; + -1.0 if "laue_expand_right" <= 0.0 + Description: If positive value, set the buffering length [in a.u.] + of the solvent region on right-hand side of the unit cell. + Then correlation functions are defined inside of + [ "laue_starting_right" - "laue_buffer_right" , L_z/2 + "laue_expand_right" ]. + This is only for Laue-RISM. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: laue_buffer_left + + Type: REAL + Default: 8.0 if "laue_expand_left" > 0.0; + -1.0 if "laue_expand_left" <= 0.0 + Description: If positive value, set the buffering length [in a.u.] + of the solvent region on left-hand side of the unit cell. + Then correlation functions are defined inside of + [ -L_z/2 - "laue_expand_left" , "laue_starting_left" + "laue_buffer_left" ]. + This is only for Laue-RISM. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: laue_both_hands + + Type: LOGICAL + Default: .FALSE. + Description: If .TRUE., you can set different densities + to the solvent regions of right-hand side and left-hand side. + See "SOLVENTS" card. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: laue_wall + + Type: CHARACTER + Default: 'auto' + Description: + Set the repulsive wall with (1/r)^12 term of Lennard-Jones potential. + This is only for Laue-RISM. + + 'none' : + The repulsive wall is not defined. + + 'auto' : + The repulsive wall is defined, whose edge position is set automatically. + One does not have to set "laue_wall_z" (the edge position). + + 'manual' : + The repulsive wall is defined, whose edge position is set manually. + One have to set "laue_wall_z" (the edge position). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: laue_wall_z + + Type: REAL + Default: 0.0 + Description: Set the edge position [in a.u.] of the repulsive wall. + If "laue_expand_right" > 0.0, the repulsive wall is defined on [ -inf , "laue_wall_z" ]. + If "laue_expand_left" > 0.0, the repulsive wall is defined on [ "laue_wall_z" , inf ]. + This is only for Laue-RISM and "laue_wall" == 'manual' . + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: laue_wall_rho + + Type: REAL + Default: 0.01 + Description: The density (1/bohr^3) of the repulsive wall. + This is only for Laue-RISM and "laue_wall" /= 'none' . + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: laue_wall_epsilon + + Type: REAL + Default: 0.1 + Description: The Lennard-Jones potential of the repulsive wall. + Here, you can set the parameter 'epsilon' (kcal/mol). + This is only for Laue-RISM and "laue_wall" /= 'none' . + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: laue_wall_sigma + + Type: REAL + Default: 4.0 + Description: The Lennard-Jones potential of the repulsive wall. + Here, you can set the parameter 'sigma' (Angstrom). + This is only for Laue-RISM and "laue_wall" /= 'none' . + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: laue_wall_lj6 + + Type: LOGICAL + Default: .FALSE. + Description: If .TRUE., the attractive term -(1/r)^6 of Lennard-Jones potential is added. + This is only for Laue-RISM and "laue_wall" /= 'none' . + +-------------------------------------------------------------------- + +===END OF NAMELIST====================================================== + + +======================================================================== +CARD: ATOMIC_SPECIES + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + ATOMIC_SPECIES + X(1) Mass_X(1) PseudoPot_X(1) + X(2) Mass_X(2) PseudoPot_X(2) + . . . + X(ntyp) Mass_X(ntyp) PseudoPot_X(ntyp) + + ///////////////////////////////////////// + + DESCRIPTION OF ITEMS: + + +-------------------------------------------------------------------- + Variable: X + + Type: CHARACTER + Description: label of the atom. Acceptable syntax: + chemical symbol X (1 or 2 characters, case-insensitive) + or chemical symbol plus a number or a letter, as in + "Xn" (e.g. Fe1) or "X_*" or "X-*" (e.g. C1, C_h; + max total length cannot exceed 3 characters) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: Mass_X + + Type: REAL + Description: mass of the atomic species [amu: mass of C = 12] + Used only when performing Molecular Dynamics run + or structural optimization runs using Damped MD. + Not actually used in all other cases (but stored + in data files, so phonon calculations will use + these values unless other values are provided) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: PseudoPot_X + + Type: CHARACTER + Description: File containing PP for this species. + + The pseudopotential file is assumed to be in the new UPF format. + If it doesn't work, the pseudopotential format is determined by + the file name: + + *.vdb or *.van Vanderbilt US pseudopotential code + *.RRKJ3 Andrea Dal Corso's code (old format) + none of the above old PWscf norm-conserving format + +-------------------------------------------------------------------- + +===END OF CARD========================================================== + + +======================================================================== +CARD: ATOMIC_POSITIONS { alat | bohr | angstrom | crystal | crystal_sg } + + ________________________________________________________________________ + * IF calculation == 'bands' OR calculation == 'nscf' : + + Specified atomic positions will be IGNORED and those from the + previous scf calculation will be used instead !!! + + + * ELSE : + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + ATOMIC_POSITIONS { alat | bohr | angstrom | crystal | crystal_sg } + X(1) x(1) y(1) z(1) { if_pos(1)(1) if_pos(2)(1) if_pos(3)(1) } + X(2) x(2) y(2) z(2) { if_pos(1)(2) if_pos(2)(2) if_pos(3)(2) } + . . . + X(nat) x(nat) y(nat) z(nat) { if_pos(1)(nat) if_pos(2)(nat) if_pos(3)(nat) } + + ///////////////////////////////////////// + + + ENDIF + ________________________________________________________________________ + + DESCRIPTION OF ITEMS: + + +-------------------------------------------------------------------- + Card's flags: { alat | bohr | angstrom | crystal | crystal_sg } + + Default: (DEPRECATED) alat + Description: + Units for ATOMIC_POSITIONS: + + alat : + atomic positions are in cartesian coordinates, in + units of the lattice parameter (either celldm(1) + or A). If no option is specified, 'alat' is assumed; + not specifying units is DEPRECATED and will no + longer be allowed in the future + + bohr : + atomic positions are in cartesian coordinate, + in atomic units (i.e. Bohr radii) + + angstrom : + atomic positions are in cartesian coordinates, in Angstrom + + crystal : + atomic positions are in crystal coordinates, i.e. + in relative coordinates of the primitive lattice + vectors as defined either in card "CELL_PARAMETERS" + or via the ibrav + celldm / a,b,c... variables + + crystal_sg : + atomic positions are in crystal coordinates, i.e. + in relative coordinates of the primitive lattice. + This option differs from the previous one because + in this case only the symmetry inequivalent atoms + are given. The variable "space_group" must indicate + the space group number used to find the symmetry + equivalent atoms. The other variables that control + this option are uniqueb, origin_choice, and + rhombohedral. + +-------------------------------------------------------------------- + + + +-------------------------------------------------------------------- + Variable: X + + Type: CHARACTER + Description: label of the atom as specified in "ATOMIC_SPECIES" + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: x, y, z + + Type: REAL + Description: atomic positions + + NOTE: each atomic coordinate can also be specified as a simple algebraic expression. + To be interpreted correctly expression must NOT contain any blank + space and must NOT start with a "+" sign. The available expressions are: + + + (plus), - (minus), / (division), * (multiplication), ^ (power) + + All numerical constants included are considered as double-precision numbers; + i.e. 1/2 is 0.5, not zero. Other functions, such as sin, sqrt or exp are + not available, although sqrt can be replaced with ^(1/2). + + Example: + C 1/3 1/2*3^(-1/2) 0 + + is equivalent to + + C 0.333333 0.288675 0.000000 + + Please note that this feature is NOT supported by XCrysDen (which will + display a wrong structure, or nothing at all). + + When atomic positions are of type crystal_sg coordinates can be given + in the following four forms (Wyckoff positions): + C 1a + C 8g x + C 24m x y + C 48n x y z + The first form must be used when the Wyckoff letter determines uniquely + all three coordinates, forms 2,3,4 when the Wyckoff letter and 1,2,3 + coordinates respectively are needed. + + The forms: + C 8g x x x + C 24m x x y + are not allowed, but + C x x x + C x x y + C x y z + are correct. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: if_pos(1), if_pos(2), if_pos(3) + + Type: INTEGER + Default: 1 + Description: component i of the force for this atom is multiplied by if_pos(i), + which must be either 0 or 1. Used to keep selected atoms and/or + selected components fixed in MD dynamics or + structural optimization run. + + With crystal_sg atomic coordinates the constraints are copied in all equivalent + atoms. + +-------------------------------------------------------------------- + +===END OF CARD========================================================== + + +======================================================================== +CARD: K_POINTS { tpiba | automatic | crystal | gamma | tpiba_b | crystal_b | tpiba_c | crystal_c } + + ________________________________________________________________________ + * IF tpiba OR crystal OR tpiba_b OR crystal_b OR tpiba_c OR crystal_c : + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + K_POINTS tpiba | crystal | tpiba_b | crystal_b | tpiba_c | crystal_c + nks + xk_x(1) xk_y(1) xk_z(1) wk(1) + xk_x(2) xk_y(2) xk_z(2) wk(2) + . . . + xk_x(nks) xk_y(nks) xk_z(nks) wk(nks) + + ///////////////////////////////////////// + + + * ELSE IF automatic : + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + K_POINTS automatic + nk1 nk2 nk3 sk1 sk2 sk3 + + ///////////////////////////////////////// + + + * ELSE IF gamma : + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + K_POINTS gamma + + ///////////////////////////////////////// + + + ENDIF + ________________________________________________________________________ + + DESCRIPTION OF ITEMS: + + +-------------------------------------------------------------------- + Card's flags: { tpiba | automatic | crystal | gamma | tpiba_b | crystal_b | tpiba_c | crystal_c } + + Default: tbipa + Description: + K_POINTS options are: + + tpiba : + read k-points in cartesian coordinates, + in units of 2 pi/a (default) + + automatic : + automatically generated uniform grid of k-points, i.e, + generates ( nk1, nk2, nk3 ) grid with ( sk1, sk2, sk3 ) offset. + nk1, nk2, nk3 as in Monkhorst-Pack grids + k1, k2, k3 must be 0 ( no offset ) or 1 ( grid displaced + by half a grid step in the corresponding direction ) + BEWARE: only grids having the full symmetry of the crystal + work with tetrahedra. Some grids with offset may not work. + + crystal : + read k-points in crystal coordinates, i.e. in relative + coordinates of the reciprocal lattice vectors + + gamma : + use k = 0 (no need to list k-point specifications after card) + In this case wavefunctions can be chosen as real, + and specialized subroutines optimized for calculations + at the gamma point are used (memory and cpu requirements + are reduced by approximately one half). + + tpiba_b : + Used for band-structure plots. + See Doc/brillouin_zones.pdf for usage of BZ labels; + otherwise, k-points are in units of 2 pi/a. + nks points specify nks-1 lines in reciprocal space. + Every couple of points identifies the initial and + final point of a line. pw.x generates N intermediate + points of the line where N is the weight of the first point. + + crystal_b : + As tpiba_b, but k-points are in crystal coordinates. + See Doc/brillouin_zones.pdf for usage of BZ labels. + + tpiba_c : + Used for band-structure contour plots. + k-points are in units of 2 pi/a. nks must be 3. + 3 k-points k_0, k_1, and k_2 specify a rectangle + in reciprocal space of vertices k_0, k_1, k_2, + k_1 + k_2 - k_0: k_0 + \alpha (k_1-k_0)+ + \beta (k_2-k_0) with 0 <\alpha,\beta < 1. + The code produces a uniform mesh n1 x n2 + k points in this rectangle. n1 and n2 are + the weights of k_1 and k_2. The weight of k_0 + is not used. + + crystal_c : + As tpiba_c, but k-points are in crystal coordinates. + +-------------------------------------------------------------------- + + + +-------------------------------------------------------------------- + Variable: nks + + Type: INTEGER + Description: Number of supplied special k-points. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: xk_x, xk_y, xk_z, wk + + Type: REAL + Description: Special k-points (xk_x/y/z) in the irreducible Brillouin Zone + (IBZ) of the lattice (with all symmetries) and weights (wk) + See the literature for lists of special points and + the corresponding weights. + + If the symmetry is lower than the full symmetry + of the lattice, additional points with appropriate + weights are generated. Notice that such procedure + assumes that ONLY k-points in the IBZ are provided in input + + In a non-scf calculation, weights do not affect the results. + If you just need eigenvalues and eigenvectors (for instance, + for a band-structure plot), weights can be set to any value + (for instance all equal to 1). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: nk1, nk2, nk3 + + Type: INTEGER + Description: These parameters specify the k-point grid + (nk1 x nk2 x nk3) as in Monkhorst-Pack grids. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: sk1, sk2, sk3 + + Type: INTEGER + Description: The grid offsets; sk1, sk2, sk3 must be + 0 ( no offset ) or 1 ( grid displaced by + half a grid step in the corresponding direction ). + +-------------------------------------------------------------------- + +===END OF CARD========================================================== + + +======================================================================== +CARD: ADDITIONAL_K_POINTS { tpiba | crystal | tpiba_b | crystal_b | tpiba_c | crystal_c } + + Optional card. Adds a list of k-points with zero weight, after those used for + the scf calculation. When doing an EXX calculation and "nq1x", "nq2x" or "nq3x" are + different from one, also include the required k+q points. The main use of this + card is to do band plots with EXX. + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + ADDITIONAL_K_POINTS tpiba | crystal | tpiba_b | crystal_b | tpiba_c | crystal_c + nks_add + k_x(1) k_y(1) k_z(1) wk_(1) + k_x(2) k_y(2) k_z(2) wk_(2) + . . . + k_x(nks_add) k_y(nks_add) k_z(nks_add) wk_(nks_add) + + ///////////////////////////////////////// + + DESCRIPTION OF ITEMS: + + +-------------------------------------------------------------------- + Card's flags: { tpiba | crystal | tpiba_b | crystal_b | tpiba_c | crystal_c } + + Default: tbipa + Description: for the explanation of the K_POINTS' options, see "K_POINTS" + +-------------------------------------------------------------------- + + + +-------------------------------------------------------------------- + Variable: nks_add + + Type: INTEGER + Description: Number of supplied "additional" k-points. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: k_x, k_y, k_z, wk_ + + Type: REAL + Description: for the respective explanation, see the "xk_x", "xk_y", "xk_z", "wk" + +-------------------------------------------------------------------- + +===END OF CARD========================================================== + + +======================================================================== +CARD: CELL_PARAMETERS { alat | bohr | angstrom } + + OPTIONAL CARD, MUST BE PRESENT IF "IBRAV" == 0, MUST BE ABSENT OTHERWISE + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + CELL_PARAMETERS { alat | bohr | angstrom } + v1(1) v1(2) v1(3) + v2(1) v2(2) v2(3) + v3(1) v3(2) v3(3) + + ///////////////////////////////////////// + + DESCRIPTION OF ITEMS: + + +-------------------------------------------------------------------- + Card's flags: { alat | bohr | angstrom } + + Description: Unit for lattice vectors; options are: + + 'bohr' / 'angstrom': + lattice vectors in bohr-radii / angstrom. + In this case the lattice parameter alat = sqrt(v1*v1). + + 'alat' / nothing specified: + lattice vectors in units of the lattice parameter (either + "celldm"(1) or "A"). Not specifying units is DEPRECATED + and will not be allowed in the future. + + If neither unit nor lattice parameter are specified, + 'bohr' is assumed - DEPRECATED, will no longer be allowed + +-------------------------------------------------------------------- + + + +-------------------------------------------------------------------- + Variables: v1, v2, v3 + + Type: REAL + Description: Crystal lattice vectors (in cartesian axis): + v1(1) v1(2) v1(3) ... 1st lattice vector + v2(1) v2(2) v2(3) ... 2nd lattice vector + v3(1) v3(2) v3(3) ... 3rd lattice vector + +-------------------------------------------------------------------- + +===END OF CARD========================================================== + + +======================================================================== +CARD: CONSTRAINTS + + OPTIONAL CARD, USED FOR CONSTRAINED DYNAMICS OR CONSTRAINED OPTIMIZATIONS + (ONLY IF "ION_DYNAMICS"=='DAMP' OR 'VERLET', VARIABLE-CELL EXCEPTED) + + When this card is present the SHAKE algorithm is automatically used. + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + CONSTRAINTS + nconstr { constr_tol } + constr_type(1) constr(1)(1) constr(2)(1) [ constr(3)(1) constr(4)(1) ] { constr_target(1) } + constr_type(2) constr(1)(2) constr(2)(2) [ constr(3)(2) constr(4)(2) ] { constr_target(2) } + . . . + constr_type(nconstr) constr(1)(nconstr) constr(2)(nconstr) [ constr(3)(nconstr) constr(4)(nconstr) ] { constr_target(nconstr) } + + ///////////////////////////////////////// + + DESCRIPTION OF ITEMS: + + +-------------------------------------------------------------------- + Variable: nconstr + + Type: INTEGER + Description: Number of constraints. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: constr_tol + + Type: REAL + Description: Tolerance for keeping the constraints satisfied. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: constr_type + + Type: CHARACTER + Description: + Type of constraint : + + 'type_coord' : + constraint on global coordination-number, i.e. the + average number of atoms of type B surrounding the + atoms of type A. The coordination is defined by + using a Fermi-Dirac. + (four indexes must be specified). + + 'atom_coord' : + constraint on local coordination-number, i.e. the + average number of atoms of type A surrounding a + specific atom. The coordination is defined by + using a Fermi-Dirac. + (four indexes must be specified). + + 'distance' : + constraint on interatomic distance + (two atom indexes must be specified). + + 'planar_angle' : + constraint on planar angle + (three atom indexes must be specified). + + 'torsional_angle' : + constraint on torsional angle + (four atom indexes must be specified). + + 'bennett_proj' : + constraint on the projection onto a given direction + of the vector defined by the position of one atom + minus the center of mass of the others. + G. Roma, J.P. Crocombette: J. Nucl. Mater. 403, 32 (2010), + doi:10.1016/j.jnucmat.2010.06.001 + + 'potential_wall' : + (experimental) add a potential wall at the origin + normal to the the z-axis. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: constr(1), constr(2), constr(3), constr(4) + + Description: These variables have different meanings for different constraint types: + + 'type_coord' : + constr(1) is the first index of the atomic type involved + constr(2) is the second index of the atomic type involved + constr(3) is the cut-off radius for estimating the coordination + constr(4) is a smoothing parameter + + 'atom_coord' : + constr(1) is the atom index of the atom with constrained coordination + constr(2) is the index of the atomic type involved in the coordination + constr(3) is the cut-off radius for estimating the coordination + constr(4) is a smoothing parameter + + 'distance' : + atoms indices object of the constraint, as they appear in + the "ATOMIC_POSITIONS" card + + 'planar_angle', 'torsional_angle' : + atoms indices object of the constraint, as they appear in the + "ATOMIC_POSITIONS" card (beware the order) + + 'bennett_proj' : + constr(1) is the index of the atom whose position is constrained. + constr(2:4) are the three coordinates of the vector that specifies + the constraint direction. + 'potential_wall' : + Formula is: External force = prefac * exponent * Exp(-exponent). Force is only applied + on atoms within the cutoff. + constr(1) is the prefactor + constr(2) is the value in the exponent + constr(3) is the cutoff (in a.u.) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: constr_target + + Type: REAL + Description: Target for the constrain ( angles are specified in degrees ). + This variable is optional. + +-------------------------------------------------------------------- + +===END OF CARD========================================================== + + +======================================================================== +CARD: OCCUPATIONS + + OPTIONAL CARD, USED ONLY IF "OCCUPATIONS" == 'FROM_INPUT', IGNORED OTHERWISE ! + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + OCCUPATIONS + f_inp1(1) f_inp1(2) . . . f_inp1(nbnd) + [ f_inp2(1) f_inp2(2) . . . f_inp2(nbnd) ] + + + ///////////////////////////////////////// + + DESCRIPTION OF ITEMS: + + +-------------------------------------------------------------------- + Variable: f_inp1 + + Type: REAL + Description: Occupations of individual states (MAX 10 PER ROW). + For spin-polarized calculations, these are majority spin states. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: f_inp2 + + Type: REAL + Description: Occupations of minority spin states (MAX 10 PER ROW) + To be specified only for spin-polarized calculations. + +-------------------------------------------------------------------- + +===END OF CARD========================================================== + + +======================================================================== +CARD: ATOMIC_VELOCITIES { a.u } + + OPTIONAL CARD, READS VELOCITIES FROM STANDARD INPUT + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + ATOMIC_VELOCITIES { a.u } + V(1) vx(1) vy(1) vz(1) + V(2) vx(2) vy(2) vz(2) + . . . + V(nat) vx(nat) vy(nat) vz(nat) + + ///////////////////////////////////////// + + DESCRIPTION OF ITEMS: + + +-------------------------------------------------------------------- + Card's flags: { a.u } + + +-------------------------------------------------------------------- + + + +-------------------------------------------------------------------- + Variable: V + + Type: CHARACTER + Description: label of the atom as specified in ATOMIC_SPECIES + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: vx, vy, vz + + Type: REAL + Description: atomic velocities along x y and z direction + +-------------------------------------------------------------------- + +===END OF CARD========================================================== + + +======================================================================== +CARD: ATOMIC_FORCES + + OPTIONAL CARD USED TO SPECIFY EXTERNAL FORCES ACTING ON ATOMS. + + BEWARE: if the sum of external forces is not zero, the center of mass of + the system will move + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + ATOMIC_FORCES + X(1) fx(1) fy(1) fz(1) + X(2) fx(2) fy(2) fz(2) + . . . + X(nat) fx(nat) fy(nat) fz(nat) + + ///////////////////////////////////////// + + DESCRIPTION OF ITEMS: + + +-------------------------------------------------------------------- + Variable: X + + Type: CHARACTER + Description: label of the atom as specified in "ATOMIC_SPECIES" + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: fx, fy, fz + + Type: REAL + Description: external force on atom X (cartesian components, Ry/a.u. units) + +-------------------------------------------------------------------- + +===END OF CARD========================================================== + + +======================================================================== +CARD: SOLVENTS { 1/cell | mol/L | g/cm^3 } + + OPTIONAL CARD, USED ONLY IF "TRISM" = .TRUE., IGNORED OTHERWISE ! + + ________________________________________________________________________ + * IF laue_both_hands = .FALSE. : + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + SOLVENTS { 1/cell | mol/L | g/cm^3 } + X(1) Density(1) Molecule(1) + X(2) Density(2) Molecule(2) + . . . + X(nsolv) Density(nsolv) Molecule(nsolv) + + ///////////////////////////////////////// + + + * ELSE IF laue_both_hands = .TRUE. : + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + SOLVENTS { 1/cell | mol/L | g/cm^3 } + X(1) Density_Left(1) Density_Right(1) Molecule(1) + X(2) Density_Left(2) Density_Right(2) Molecule(2) + . . . + X(nsolv) Density_Left(nsolv) Density_Right(nsolv) Molecule(nsolv) + + ///////////////////////////////////////// + + + ENDIF + ________________________________________________________________________ + + DESCRIPTION OF ITEMS: + + +-------------------------------------------------------------------- + Card's flags: { 1/cell | mol/L | g/cm^3 } + + Description: + 1/cell : + solvent's densities are specified + as number of molecules in the unit cell. + + mol/L : + solvent's densities are specified as molar concentrations. + + g/cm^3 : + solvent's densities are in gram per cm^3. + +-------------------------------------------------------------------- + + + +-------------------------------------------------------------------- + Variable: X + + Type: CHARACTER + Description: label of the solvent molecule. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: Density + + Type: REAL + Description: density of the solvent molecule. + if not positive value is set, density is read from MOL-file. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: Molecule + + Type: CHARACTER + Description: MOL-file of the solvent molecule. + in the MOL-file, molecular structure and some other data are written. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: X + + Type: CHARACTER + Description: label of the solvent molecule. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: Density_Left + + Type: REAL + Description: density of the solvent molecule in the left-hand side. + if not positive value is set, density is read from MOL-file. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: Density_Right + + Type: REAL + Description: density of the solvent molecule in the right-hand side. + if not positive value is set, density is read from MOL-file. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: Molecule + + Type: CHARACTER + Description: MOL-file of the solvent molecule. + in the MOL-file, molecular structure and some other data are written. + +-------------------------------------------------------------------- + +===END OF CARD========================================================== + + +======================================================================== +CARD: HUBBARD atomic | ortho-atomic | norm-atomic | wf | pseudo + + ________________________________________________________________________ + * IF DFT+U : + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + HUBBARD atomic | ortho-atomic | norm-atomic | wf | pseudo + U label(1)-manifold(1) u_val(1) + [ J0 label(1)-manifold(1) j0_val(1) ] + . . . + U label(n)-manifold(n) u_val(n) + [ J0 label(n)-manifold(n) j0_val(n) ] + + ///////////////////////////////////////// + + + * ELSE IF DFT+U+J : + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + HUBBARD atomic | ortho-atomic | norm-atomic | wf | pseudo + paramType(1) label(1)-manifold(1) paramValue(1) + . . . + paramType(n) label(n)-manifold(n) paramValue(n) + + ///////////////////////////////////////// + + + * ELSE IF DFT+U+V : + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + HUBBARD atomic | ortho-atomic | norm-atomic | wf | pseudo + U label(I)-manifold(I) u_val(I) + [ J0 label(I)-manifold(I) j0_val(I) ] + V label(I)-manifold(I) label(J)-manifold(J) I J v_val(I,J) + . . . + U label(N)-manifold(N) u_val(N) + [ J0 label(N)-manifold(N) j0_val(N) ] + V label(N)-manifold(N) label(M)-manifold(M) N M v_val(N,M) + + ///////////////////////////////////////// + + + ENDIF + ________________________________________________________________________ + + DESCRIPTION OF ITEMS: + + +-------------------------------------------------------------------- + Card's flags: atomic | ortho-atomic | norm-atomic | wf | pseudo + + Description: + HUBBARD options are: + + atomic : + use atomic orbitals (read from pseudopotential) to build the + Hubbard projectors + + ortho-atomic : + use Lowdin orthogonalized atomic orbitals. This option is + recommended to be used whenever possible instead of atomic + because it allows to avoid applying Hubbard corrections twice + in the orbital overlap regions. + + norm-atomic : + Lowdin normalization of atomic orbitals. Keep in mind: + atomic orbitals are not orthogonalized in this case. + This is a "quick and dirty" trick to be used when + atomic orbitals from the pseudopotential are not + normalized (and thus produce occupation whose + value exceeds unity). + + wf : + use Wannier functions to built Hubbard projectors. + The information about the Wannier functionas are read + from file "prefix".hub that must be generated using pmw.x + (see PP/src/poormanwannier.f90 for details). + Note: these are not maximally localized Wannier functions. + (see PP/examples/example05) + + pseudo : + use the pseudopotential projectors. The charge density + outside the atomic core radii is excluded. + N.B.: for atoms with +U, a pseudopotential with the + all-electron atomic orbitals are required (i.e., + as generated by ld1.x with lsave_wfc flag). + + NB: forces and stress are currently implemented only for the + 'atomic', 'ortho-atomic', and 'pseudo' Hubbard projectors. + + Check Doc/Hubbard_input.pdf to see how to specify Hubbard parameters + U, J0, J, B, E2, E3, V in the HUBBARD card. + +-------------------------------------------------------------------- + + + +-------------------------------------------------------------------- + Variables: label(1)-manifold(1), u_val(1) + + Type: CHARACTER-LITERAL, CHARACTER, REAL + Description: Syntax: + U label-manifold u_val + + Where: + U = string constant "U"; indicates the specs for the U parameter will be given + label = label of the atom (as defined in "ATOMIC_SPECIES") + manifold = specs of the manifold (e.g., 3d, 2p...) + u_val = value of the U parameter (in eV) + + Example: + HUBBARD (ortho-atomic) + U Mn-3d 5.0 + U Ni-3d 6.0 + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: label(1)-manifold(1), j0_val(1) + + Type: CHARACTER-LITERAL, CHARACTER, REAL + Description: Remark: specs of J0 parameters are optional + + Syntax: + J0 label-manifold j0_val + + Where: + J0 = string constant "J0"; indicates the specs for the J0 parameter will be given + label = label of the atom (as defined in "ATOMIC_SPECIES") + manifold = specs of the manifold (e.g., 3d, 2p...) + j0_val = value of the J0 parameter (in eV) + + Example: + HUBBARD (ortho-atomic) + U Mn-3d 5.0 + J0 Mn-3d 1.0 + U Ni-3d 6.0 + J0 Ni-3d 1.2 + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: paramType(1), label(1)-manifold(1), paramValue(1) + + Type: CHARACTER, CHARACTER, REAL + Description: Syntax of the line: + + paramType label-manifold paramValue + + Where: + paramType = character describing the type of Hubbard parameter + allowed values: U, J and either B (for d-orbitals) or E2 and E3 (for f-orbitals) + label = label of the atom (as defined in "ATOMIC_SPECIES") + manifold = specs of the manifold (e.g., 3d, 2p...) + paramValue = value of the parameter (in eV) + + Example: + HUBBARD (ortho-atomic) + U Mn-3d 5.0 + J Mn-3d 1.0 + B Mn-3d 1.1 + U Ni-3d 6.0 + J Ni-3d 1.2 + B Ni-3d 1.3 + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: label(I)-manifold(I), u_val(I) + + Type: CHARACTER, REAL + Description: Syntax of the line: + + U label-manifold u_val + + Where: + U = string constant "U"; indicates the specs for the U parameter will be given + label = label of the atom (as defined in "ATOMIC_SPECIES") + manifold = specs of the manifold (e.g., 3d, 2p...) + u_val = value of the U parameter (in eV) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: label(I)-manifold(I), j0_val(I) + + Type: CHARACTER, REAL + Description: Remark: specs of J0 parameters are optional + + Syntax of the line: + + J0 label(I)-manifold(I) j0_val(I) + + Where: + J0 = string constant "J0"; indicates the specs for the J0 parameter will be given + label = label of the atom (as defined in "ATOMIC_SPECIES") + manifold = specs of the manifold (e.g., 3d, 2p...) + j0_val = value of the J0 parameter (in eV) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: label(I)-manifold(I), label(J)-manifold(J), I, J, v_val(I,J) + + Type: CHARACTER, CHARACTER, INTEGER, INTEGER, REAL + Description: Syntax of the line: + + V label(I)-manifold(J) label(J)-manifold(J) I J v_val(I,J) + + Where: + V = string constant "V"; indicates the specs for the V parameter will be given + label(I) = label of the atom I (as defined in "ATOMIC_SPECIES") + manifold(I) = specs of the manifold for atom I (e.g., 3d, 2p...) + label(J) = label of the atom J (as defined in "ATOMIC_SPECIES") + manifold(J) = specs of the manifold for atom J (e.g., 3d, 2p...) + I = index of the atom I + J = index of the atom J + v_val(I,J) = value of the V parameter for the atom pair I,J (in eV) + + Example: + HUBBARD (ortho-atomic) + U Co-3d 7.70 + V Co-3d O-2p 1 19 0.75 + V Co-3d O-2p 1 46 0.75 + V Co-3d O-2p 1 43 0.75 + V Co-3d O-2p 1 54 0.75 + V Co-3d O-2p 1 11 0.75 + V Co-3d O-2p 1 22 0.75 + +-------------------------------------------------------------------- + +===END OF CARD========================================================== + + +This file has been created by helpdoc utility on Sat Mar 18 16:00:16 CET 2023 diff --git a/deps/asset_init.jl b/deps/asset_init.jl index 930a296f..c88e8700 100644 --- a/deps/asset_init.jl +++ b/deps/asset_init.jl @@ -247,6 +247,19 @@ open(joinpath(@__DIR__, "qeflags.jl"), "w") do wf return write(wf, "]") end +open(joinpath(@__DIR__, "qe7.2flags.jl"), "w") do wf + write(wf, "_QE7_2INPUTINFOS() = QECalculationInfo[\n") + calculation_files = searchdir(joinpath(@__DIR__, "..", "assets", "calculations", "qe"), + "INPUT") + filepaths = joinpath.(Ref(joinpath(@__DIR__, "..", "assets", "calculations", "qe")), + calculation_files) + for _f in filepaths + exec_name = join([lowercase(splitext(split(_f, "_")[end])[1]), ".x"], "") + write_QECalculationInfo(wf, _f, 1, exec_name) + end + return write(wf, "]") +end + open(joinpath(@__DIR__, "abinitflags.jl"), "w") do wf flaglines = split.(readlines(joinpath(@__DIR__, "..", "assets", "calculations", "abinit", "calculation_variables.txt"))) diff --git a/src/Calculations/Calculations.jl b/src/Calculations/Calculations.jl index 320fb8ba..767c008d 100644 --- a/src/Calculations/Calculations.jl +++ b/src/Calculations/Calculations.jl @@ -16,5 +16,5 @@ include("documentation.jl") include("julia.jl") export Calculation, InputData -export Wannier90, QE, Abinit, Elk, Julia, set_flags! +export Wannier90, QE, QE7_2, Abinit, Elk, Julia, set_flags! end diff --git a/src/Calculations/calculation.jl b/src/Calculations/calculation.jl index 912ab624..15e382a9 100644 --- a/src/Calculations/calculation.jl +++ b/src/Calculations/calculation.jl @@ -36,6 +36,7 @@ abstract type Package end struct NoPackage <: Package end struct Wannier90 <: Package end struct QE <: Package end +struct QE7_2 <: Package end struct Abinit <: Package end struct Elk <: Package end StructTypes.StructType(::Type{<:Package}) = StructTypes.Struct() @@ -293,7 +294,7 @@ function set_flags!(c::Calculation{T}, flags...; print = true) where {T} end old_data = haskey(c, flag) ? c[flag] : "" - if eltype(c) == QE + if eltype(c) == QE || eltype(c) == QE7_2 block, _ = qe_block_variable(c, flag) if block == :error error("""Block for flag $flag could not be found, please set it manually using .flags[][$flag] = $value""") @@ -441,117 +442,19 @@ function sanitize_flags!(cs::Vector{<:Calculation}, str::Structure, name, outdir end end end - - u_ats = unique(str.atoms) - isnc = Structures.isnoncolin(str) - flags_to_set = [] - if any(x -> x.dftu.U != 0 || - x.dftu.J0 != 0.0 || - sum(x.dftu.J) != 0 || - sum(x.dftu.α) != 0, u_ats) - Jmap = map(x -> copy(x.dftu.J), u_ats) - Jdim = maximum(length.(Jmap)) - Jarr = zeros(Jdim, length(u_ats)) - for (i, J) in enumerate(Jmap) - diff = Jdim - length(J) - if diff > 0 - for d in 1:diff - push!(J, zero(eltype(J))) - end - end - Jarr[:, i] .= J - end - append!(flags_to_set, - [:Hubbard_U => map(x -> x.dftu.U, u_ats), - :Hubbard_alpha => map(x -> x.dftu.α, u_ats), - :Hubbard_beta => map(x -> x.dftu.β, u_ats), :Hubbard_J => Jarr, - :Hubbard_J0 => map(x -> x.dftu.J0, u_ats)]) - end - if !isempty(flags_to_set) || any(x -> hasflag(x, :Hubbard_parameters), cs) - push!(flags_to_set, :lda_plus_u => true) - if isnc - push!(flags_to_set, :lda_plus_u_kind => 1) - end - end - if !isempty(flags_to_set) - for c in cs - set_flags!(c, flags_to_set...; print = false) - end - else - for c in cs - for f in - (:lda_plus_u, :lda_plus_u_kind, :Hubbard_U, :Hubbard_alpha, :Hubbard_beta, - :Hubbard_J, :Hubbard_J0, :U_projection_type) - pop!(c, f, nothing) - end - end - end - - flags_to_set = [] - mags = map(x -> x.magnetization, u_ats) - starts = Float64[] - θs = Float64[] - ϕs = Float64[] - ismagcalc = isnc ? true : Structures.ismagnetic(str) || any(x->haskey(x, :tot_magnetization), cs) - if ismagcalc - if isnc || any(x -> get(x, :noncolin, false), cs) - for m in mags - tm = normalize(m) - if norm(m) == 0 - push!.((starts, θs, ϕs), 0.0) - else - θ = acos(tm[3]) * 180 / π - ϕ = atan(tm[2], tm[1]) * 180 / π - start = norm(m) - push!(θs, θ) - push!(ϕs, ϕ) - push!(starts, start) - end - end - push!(flags_to_set, :noncolin => true) - else - for m in mags - push!.((θs, ϕs), 0.0) - if norm(m) == 0 - push!(starts, 0) - else - push!(starts, sign(sum(m)) * norm(m)) - end - end - end - append!(flags_to_set, [:starting_magnetization => starts, :angle1 => θs, :angle2 => ϕs, :nspin => 2]) - end for c in cs + set_flags!(c, :prefix => name, :outdir => outdir, print=false) try - set_flags!(c, :prefix => "$name", :outdir => "$outdir"; print = false) - if ispw(c) - set_flags!(c, flags_to_set...; print = false) - if isnc - pop!(c, :nspin, nothing) - end - if isvcrelax(c) - #this is to make sure &ions and &cell are there in the calculation - !hasflag(c, :ion_dynamics) && - set_flags!(c, :ion_dynamics => "bfgs"; print = false) - !hasflag(c, :cell_dynamics) && - set_flags!(c, :cell_dynamics => "bfgs"; print = false) - end - #TODO add all the required flags - @assert hasflag(c, :calculation) "Please set the flag for calculation with name: $(name(c))" - - set_flags!(c, :pseudo_dir => "."; print = false) - end convert_flags!(c) catch @warn "Something went wrong trying to sanitize the flags for calc $(c.name)" end end - return end rm_tmp_flags!(::Calculation) = nothing -function rm_tmp_flags!(c::Calculation{QE}) +function rm_tmp_flags!(c::Union{Calculation{QE}, Calculation{QE7_2}}) pop!(c, :prefix, nothing) pop!(c, :outdir, nothing) return pop!(c, :nspin, nothing) diff --git a/src/Calculations/documentation.jl b/src/Calculations/documentation.jl index c1985725..c54acf2f 100644 --- a/src/Calculations/documentation.jl +++ b/src/Calculations/documentation.jl @@ -10,7 +10,22 @@ Returns the documentation for a given flag. """ function documentation(::Type{QE}, searchstring::AbstractString) found = Pair{String,Vector{QEFlagInfo}}[] - for calculationinfo in QECalculationInfos + for calculationinfo in QECalculationInfos[] + foundflags = QEFlagInfo[] + for fi in allflags(calculationinfo) + if occursin(searchstring, fi.description) + push!(foundflags, fi) + end + end + if !isempty(foundflags) + push!(found, calculationinfo.exec => foundflags) + end + end + return found +end +function documentation(::Type{QE7_2}, searchstring::AbstractString) + found = Pair{String,Vector{QEFlagInfo}}[] + for calculationinfo in QE7_2CalculationInfos[] foundflags = QEFlagInfo[] for fi in allflags(calculationinfo) if occursin(searchstring, fi.description) diff --git a/src/Calculations/qe.jl b/src/Calculations/qe.jl index e2e02680..cf1672c1 100644 --- a/src/Calculations/qe.jl +++ b/src/Calculations/qe.jl @@ -1,3 +1,4 @@ +const QE_CALCULATION = Union{Calculation{QE}, Calculation{QE7_2}} #QE calls these flags struct QEFlagInfo{T} name::Symbol @@ -46,42 +47,93 @@ function allflags(info::QECalculationInfo) return vcat([[i.flags for i in info.control]; [i.flags for i in info.data]]...) end -include(joinpath(DEPS_DIR, "qeflags.jl")) -const QECalculationInfos = _QEINPUTINFOS() -push!(QECalculationInfos, - QECalculationInfo("pw2wannier90.x", - [QEControlBlockInfo(:inputpp, - [QEFlagInfo{String}(:outdir, - "location of temporary output files"), - QEFlagInfo{String}(:prefix, - "pwscf filename prefix"), - QEFlagInfo{String}(:seedname, - "wannier90 calculation/output filename prefix"), - QEFlagInfo{String}(:wan_mode, - "'standalone' or 'library'"), - QEFlagInfo{String}(:spin_component, - "'none', 'up' or 'down'"), - QEFlagInfo{Bool}(:write_spn, - "Write .spn matrix elements."), - QEFlagInfo{Bool}(:write_mmn, - "compute M_mn matrix"), - QEFlagInfo{Bool}(:write_amn, - "compute A_mn matrix"), - QEFlagInfo{Bool}(:write_unk, - "write wavefunctions to file"), - QEFlagInfo{Bool}(:write_uHu, - "write the hamiltonian elements between different k-values"), - QEFlagInfo{Bool}(:wvfn_formatted, - "formatted or unformatted output for wavefunctions"), - QEFlagInfo{Bool}(:reduce_unk, - "output wavefunctions on a coarse grid to save memory")])], - QEDataBlockInfo[])) +const QECalculationInfos = Ref(QECalculationInfo[]) + +function maybe_init_QECalculationInfos() + if isempty(QECalculationInfos[]) + include(joinpath(DEPS_DIR, "qeflags.jl")) + QECalculationInfos[] = Base.invokelatest(_QEINPUTINFOS,) + push!(QECalculationInfos[], + QECalculationInfo("pw2wannier90.x", + [QEControlBlockInfo(:inputpp, + [QEFlagInfo{String}(:outdir, + "location of temporary output files"), + QEFlagInfo{String}(:prefix, + "pwscf filename prefix"), + QEFlagInfo{String}(:seedname, + "wannier90 calculation/output filename prefix"), + QEFlagInfo{String}(:wan_mode, + "'standalone' or 'library'"), + QEFlagInfo{String}(:spin_component, + "'none', 'up' or 'down'"), + QEFlagInfo{Bool}(:write_spn, + "Write .spn matrix elements."), + QEFlagInfo{Bool}(:write_mmn, + "compute M_mn matrix"), + QEFlagInfo{Bool}(:write_amn, + "compute A_mn matrix"), + QEFlagInfo{Bool}(:write_unk, + "write wavefunctions to file"), + QEFlagInfo{Bool}(:write_uHu, + "write the hamiltonian elements between different k-values"), + QEFlagInfo{Bool}(:wvfn_formatted, + "formatted or unformatted output for wavefunctions"), + QEFlagInfo{Bool}(:reduce_unk, + "output wavefunctions on a coarse grid to save memory")])], + QEDataBlockInfo[])) + end +end + +const QE7_2CalculationInfos = Ref(QECalculationInfo[]) + +function maybe_init_QE7_2CalculationInfos() + if isempty(QECalculationInfos[]) + include(joinpath(DEPS_DIR, "qe7.2flags.jl")) + QECalculationInfos[] = Base.invokelatest(_QE7_2INPUTINFOS, ) + push!(QECalculationInfos[], + QECalculationInfo("pw2wannier90.x", + [QEControlBlockInfo(:inputpp, + [QEFlagInfo{String}(:outdir, + "location of temporary output files"), + QEFlagInfo{String}(:prefix, + "pwscf filename prefix"), + QEFlagInfo{String}(:seedname, + "wannier90 calculation/output filename prefix"), + QEFlagInfo{String}(:wan_mode, + "'standalone' or 'library'"), + QEFlagInfo{String}(:spin_component, + "'none', 'up' or 'down'"), + QEFlagInfo{Bool}(:write_spn, + "Write .spn matrix elements."), + QEFlagInfo{Bool}(:write_mmn, + "compute M_mn matrix"), + QEFlagInfo{Bool}(:write_amn, + "compute A_mn matrix"), + QEFlagInfo{Bool}(:write_unk, + "write wavefunctions to file"), + QEFlagInfo{Bool}(:write_uHu, + "write the hamiltonian elements between different k-values"), + QEFlagInfo{Bool}(:wvfn_formatted, + "formatted or unformatted output for wavefunctions"), + QEFlagInfo{Bool}(:reduce_unk, + "output wavefunctions on a coarse grid to save memory")])], + QEDataBlockInfo[])) + end +end function qe_calculation_info(calculation::Calculation{QE}) - return getfirst(x -> occursin(x.exec, exec(calculation.exec)), QECalculationInfos) + maybe_init_QECalculationInfos() + return getfirst(x -> occursin(x.exec, exec(calculation.exec)), QECalculationInfos[]) end + +function qe_calculation_info(calculation::Calculation{QE7_2}) + maybe_init_QE7_2CalculationInfos() + return getfirst(x -> occursin(x.exec, exec(calculation.exec)), QE7_2CalculationInfos[]) +end + function qe_calculation_info(exec::AbstractString) - return getfirst(x -> occursin(x.exec, exec), QECalculationInfos) + maybe_init_QECalculationInfos() + return getfirst(x -> occursin(x.exec, exec), QECalculationInfos[]) end qe_calculation_flags(exec::AbstractString) = allflags(qe_calculation_info(exec)) @@ -96,7 +148,8 @@ function qe_flaginfo(calculation_info::QECalculationInfo, variable_name::Symbol) end function qe_flaginfo(variable_name::Symbol) - for info in QECalculationInfos + maybe_init_QECalculationInfos() + for info in QECalculationInfos[] var = qe_flaginfo(info, variable_name) if eltype(var) != Nothing return var @@ -115,76 +168,94 @@ function qe_block_variable(calculation_info::QECalculationInfo, variable_name) return :error, QEFlagInfo() end -function qe_flaginfo(e::Exec, varname) - for calculation_info in QECalculationInfos - if occursin(calculation_info.exec, exec(e)) - return qe_flaginfo(calculation_info, varname) +function qe7_2_block_variable(exec::AbstractString, flagname) + maybe_init_QE7_2CalculationInfos() + for calculation_info in QE7_2CalculationInfos[] + if occursin(calculation_info.exec, exec) + return qe_block_variable(calculation_info, flagname) end end - return QEFlagInfo() + return :error, QEFlagInfo() end -function qe_block_info(block_name::Symbol) - for calculation_info in QECalculationInfos - for block in [calculation_info.control; calculation_info.data] - if block.name == block_name - return block - end +function qe_block_variable(calculation::Calculation{QE}, flagname) + e = exec(calculation.exec) + if !(e ∈ QE_EXECS) + error("Calculation $calculation does not have a valid QE executable, please set it first.") + end + + maybe_init_QECalculationInfos() + for calculation_info in QECalculationInfos[] + if occursin(calculation_info.exec, e) + return qe_block_variable(calculation_info, flagname) end end + return :error, QEFlagInfo() + end +function qe_block_variable(calculation::Calculation{QE7_2}, flagname) + e = exec(calculation.exec) -function qe_all_block_flags(calculation::Calculation{QE}, block_name) - return getfirst(x -> x.name == block_name, qe_calculation_info(calculation).control).flags -end -function qe_all_block_flags(exec::AbstractString, block_name) - return getfirst(x -> x.name == block_name, qe_calculation_info(exec).control).flags -end - -function qe_block_variable(exec::AbstractString, flagname) - for calculation_info in QECalculationInfos - if occursin(calculation_info.exec, exec) + if !(e ∈ QE_EXECS) + error("Calculation $calculation does not have a valid QE executable, please set it first.") + end + maybe_init_QE7_2CalculationInfos() + for calculation_info in QE7_2CalculationInfos[] + if occursin(calculation_info.exec, e) return qe_block_variable(calculation_info, flagname) end end return :error, QEFlagInfo() + end -function qe_exec(calculation::Calculation{QE}) - if !(exec(calculation.exec) ∈ QE_EXECS) +function flagtype(calculation::Calculation{QE}, flag) + e = exec(calculation.exec) + if !(e ∈ QE_EXECS) error("Calculation $calculation does not have a valid QE executable, please set it first.") end - return calculation.exec -end - -function qe_block_variable(calculation::Calculation, flagname) - return qe_block_variable(exec(qe_exec(calculation)), flagname) + maybe_init_QECalculationInfos() + for calculation_info in QECalculationInfos[] + if occursin(calculation_info.exec, e) + return eltype(qe_flaginfo(calculation_info, flag)) + end + end + return eltype(QEFlagInfo()) end -function flagtype(calculation::Calculation{QE}, flag) - return eltype(qe_flaginfo(qe_exec(calculation), flag)) +function flagtype(calculation::Calculation{QE7_2}, flag) + e = exec(calculation.exec) + if !(e ∈ QE_EXECS) + error("Calculation $calculation does not have a valid QE executable, please set it first.") + end + maybe_init_QE7_2CalculationInfos() + for calculation_info in QE7_2CalculationInfos[] + if occursin(calculation_info.exec, e) + return eltype(qe_flaginfo(calculation_info, flag)) + end + end + return eltype(QEFlagInfo()) end -flagtype(::Type{QE}, exec, flag) = eltype(qe_flaginfo(exec, flag)) -isbands(c::Calculation{QE}) = get(c, :calculation, nothing) == "bands" -isnscf(c::Calculation{QE}) = get(c, :calculation, nothing) == "nscf" -isscf(c::Calculation{QE}) = get(c, :calculation, nothing) == "scf" -isvcrelax(c::Calculation{QE}) = get(c, :calculation, nothing) == "vc-relax" -isrelax(c::Calculation{QE}) = get(c, :calculation, nothing) == "relax" -isprojwfc(c::Calculation{QE}) = exec(c.exec) == "projwfc.x" -ishp(c::Calculation{QE}) = exec(c.exec) == "hp.x" +isbands(c::QE_CALCULATION) = get(c, :calculation, nothing) == "bands" +isnscf(c::QE_CALCULATION) = get(c, :calculation, nothing) == "nscf" +isscf(c::QE_CALCULATION) = get(c, :calculation, nothing) == "scf" +isvcrelax(c::QE_CALCULATION) = get(c, :calculation, nothing) == "vc-relax" +isrelax(c::QE_CALCULATION) = get(c, :calculation, nothing) == "relax" +isprojwfc(c::QE_CALCULATION) = exec(c.exec) == "projwfc.x" +ishp(c::QE_CALCULATION) = exec(c.exec) == "hp.x" -function ispw(c::Calculation{QE}) +function ispw(c::QE_CALCULATION) return isbands(c) || isnscf(c) || isscf(c) || isvcrelax(c) || isrelax(c) end -issoc(c::Calculation{QE}) = get(c, :lspinorb, false) +issoc(c::QE_CALCULATION) = get(c, :lspinorb, false) -function ismagnetic(c::Calculation{QE}) +function ismagnetic(c::QE_CALCULATION) return get(c, :nspin, 0.0) > 0.0 || get(c, :total_magnetization, 0.0) end -function outfiles(c::Calculation{QE}) +function outfiles(c::QE_CALCULATION) files = [c.outfile] for (is, fuzzies) in zip(("projwfc.x", "hp.x", "pp.x"), (("pdos",), ("Hubbard_parameters",), ("filplot", "fileout"))) if c.exec.exec == is @@ -194,10 +265,10 @@ function outfiles(c::Calculation{QE}) return unique(files) end -ψ_cutoff_flag(::Calculation{QE}) = :ecutwfc -ρ_cutoff_flag(::Calculation{QE}) = :ecutrho +ψ_cutoff_flag(::QE_CALCULATION) = :ecutwfc +ρ_cutoff_flag(::QE_CALCULATION) = :ecutrho -function kgrid(na, nb, nc, ::Type{QE}) +function kgrid(na, nb, nc, ::Union{Type{QE}, Type{QE7_2}}) return reshape([(a, b, c, 1 / (na * nb * nc)) for a in collect(range(0; stop = 1, length = na + 1))[1:end-1], b in collect(range(0; stop = 1, length = nb + 1))[1:end-1], @@ -205,7 +276,7 @@ function kgrid(na, nb, nc, ::Type{QE}) (na * nb * nc)) end -function set_kpoints!(c::Calculation{QE}, k_grid::NTuple{3,Int}; print = true) #nscf +function set_kpoints!(c::QE_CALCULATION, k_grid::NTuple{3,Int}; print = true) #nscf print && !isnscf(c) && (@warn "Expected calculation to be 'nscf'.\nGot $c.") d = data(c, :k_points) if d !== nothing @@ -220,7 +291,7 @@ function set_kpoints!(c::Calculation{QE}, k_grid::NTuple{3,Int}; print = true) # return c end -function set_kpoints!(c::Calculation{QE}, k_grid::NTuple{6,Int}; print = true) #scf +function set_kpoints!(c::QE_CALCULATION, k_grid::NTuple{6,Int}; print = true) #scf print && !(isscf(c) || isvcrelax(c) || isrelax(c)) && (@warn "Expected calculation to be scf, vc-relax, relax.") @@ -237,7 +308,7 @@ function set_kpoints!(c::Calculation{QE}, k_grid::NTuple{6,Int}; print = true) # return c end -function set_kpoints!(c::Calculation{QE}, k_grid::Vector{<:NTuple{4}}; print = true, +function set_kpoints!(c::QE_CALCULATION, k_grid::Vector{<:NTuple{4}}; print = true, k_option = :crystal_b) print && isbands(c) != "bands" && @@ -268,60 +339,60 @@ function set_kpoints!(c::Calculation{QE}, k_grid::Vector{<:NTuple{4}}; print = t end """ - gencalc_scf(template::Calculation{QE}, kpoints::NTuple{6, Int}, newflags...; name="scf") + gencalc_scf(template::QE_CALCULATION, kpoints::NTuple{6, Int}, newflags...; name="scf") Uses the information from the template and `supplied` kpoints to generate an scf calculation. Extra flags can be supplied which will be set for the generated calculation. """ -function gencalc_scf(template::Calculation{QE}, kpoints::NTuple{6,Int}, newflags...; +function gencalc_scf(template::QE_CALCULATION, kpoints::NTuple{6,Int}, newflags...; name = "scf") return calculation_from_kpoints(template, name, kpoints, :calculation => "scf", newflags...) end """ - gencalc_vcrelax(template::Calculation{QE}, kpoints::NTuple{6, Int}, newflags...; name="scf") + gencalc_vcrelax(template::QE_CALCULATION, kpoints::NTuple{6, Int}, newflags...; name="scf") Uses the information from the template and supplied `kpoints` to generate a vcrelax calculation. Extra flags can be supplied which will be set for the generated calculation. """ -function gencalc_vcrelax(template::Calculation{QE}, kpoints::NTuple{6,Int}, newflags...; +function gencalc_vcrelax(template::QE_CALCULATION, kpoints::NTuple{6,Int}, newflags...; name = "vcrelax") return calculation_from_kpoints(template, name, kpoints, :calculation => "vc-relax", newflags...) end """ - gencalc_bands(template::Calculation{QE}, kpoints::Vector{NTuple{4}}, newflags...; name="bands") + gencalc_bands(template::QE_CALCULATION, kpoints::Vector{NTuple{4}}, newflags...; name="bands") Uses the information from the template and supplied `kpoints` to generate a bands calculation. Extra flags can be supplied which will be set for the generated calculation. """ -function gencalc_bands(template::Calculation{QE}, kpoints::Vector{<:NTuple{4}}, newflags...; +function gencalc_bands(template::QE_CALCULATION, kpoints::Vector{<:NTuple{4}}, newflags...; name = "bands") return calculation_from_kpoints(template, name, kpoints, :calculation => "bands", newflags...) end """ - gencalc_nscf(template::Calculation{QE}, kpoints::NTuple{3, Int}, newflags...; name="nscf") + gencalc_nscf(template::QE_CALCULATION, kpoints::NTuple{3, Int}, newflags...; name="nscf") Uses the information from the template and supplied `kpoints` to generate an nscf calculation. Extra flags can be supplied which will be set for the generated calculation. """ -function gencalc_nscf(template::Calculation{QE}, kpoints::NTuple{3,Int}, newflags...; +function gencalc_nscf(template::QE_CALCULATION, kpoints::NTuple{3,Int}, newflags...; name = "nscf") return calculation_from_kpoints(template, name, kpoints, :calculation => "nscf", newflags...) end """ - gencalc_projwfc(template::Calculation{QE}, Emin, Emax, DeltaE, newflags...; name="projwfc") + gencalc_projwfc(template::QE_CALCULATION, Emin, Emax, DeltaE, newflags...; name="projwfc") Uses the information from the template and supplied `kpoints` to generate a `projwfc.x` calculation. Extra flags can be supplied which will be set for the generated calculation. """ -function gencalc_projwfc(template::Calculation{QE}, Emin, Emax, DeltaE, extraflags...; +function gencalc_projwfc(template::QE_CALCULATION, Emin, Emax, DeltaE, extraflags...; name = "projwfc") occflag = get(template, :occupations, "fixed") ngauss = 0 diff --git a/src/Display/printing.jl b/src/Display/printing.jl index f1d01ec6..4f399af3 100644 --- a/src/Display/printing.jl +++ b/src/Display/printing.jl @@ -11,6 +11,8 @@ function Base.show(io::IO, ::MIME"text/plain", block::InputData) return end +Base.show(io::IO, band::Band) = print(io, "Band($(length(band.k_points_cart)) k_points: $(band.k_points_cart[1]) -> $(band.k_points_cart[end]), eigvals: $(band.eigvals[1]) -> $(band.eigvals[end]))") + function Base.show(io::IO, ::MIME"text/plain", band::Band) show_type(io, band) string = """ diff --git a/src/FileIO/qe.jl b/src/FileIO/qe.jl index e2237fff..472f7087 100644 --- a/src/FileIO/qe.jl +++ b/src/FileIO/qe.jl @@ -551,8 +551,9 @@ function qe_parse_pw_output(str; pseudo_data = InputData(:atomic_species, :none, out[:pseudos]) tmp_flags = Dict{Symbol,Any}(:ibrav => 0) tmp_flags[:A] = out[:in_alat] + # TODO: Hubbard out[:initial_structure] = extract_structure!(tmp_flags, cell_data, - out[:atsyms], atoms_data, pseudo_data) + out[:atsyms], atoms_data, pseudo_data, nothing) # Add starting mag and DFTU if haskey(out, :starting_magnetization) for (atsym, mag) in out[:starting_magnetization] @@ -584,8 +585,9 @@ function qe_parse_pw_output(str; end cell_data = InputData(:cell_parameters, :alat, out[:cell_parameters]) atoms_data = InputData(:atomic_positions, out[:pos_option], out[:atomic_positions]) + #TODO: Hubbard out[:final_structure] = extract_structure!(tmp_flags, cell_data, - out[:atsyms], atoms_data, pseudo_data) + out[:atsyms], atoms_data, pseudo_data, nothing) # Add starting mag and DFTU if haskey(out, :starting_magnetization) for (atsym, mag) in out[:starting_magnetization] @@ -961,30 +963,34 @@ function extract_cell!(flags, cell_block) end end -function qe_DFTU(speciesid::Int, parsed_flags::Dict{Symbol,Any}) - U = 0.0 - J0 = 0.0 - J = [0.0] - α = 0.0 - β = 0.0 - if haskey(parsed_flags, :Hubbard_U) && length(parsed_flags[:Hubbard_U]) >= speciesid - U = parsed_flags[:Hubbard_U][speciesid] - end - if haskey(parsed_flags, :Hubbard_J0) && length(parsed_flags[:Hubbard_J0]) >= speciesid - J0 = parsed_flags[:Hubbard_J0][speciesid] - end - if haskey(parsed_flags, :Hubbard_J) && length(parsed_flags[:Hubbard_J]) >= speciesid - J = Float64.(parsed_flags[:Hubbard_J][:, speciesid]) - end - if haskey(parsed_flags, :Hubbard_alpha) && - length(parsed_flags[:Hubbard_alpha]) >= speciesid - α = parsed_flags[:Hubbard_alpha][speciesid] - end - if haskey(parsed_flags, :Hubbard_beta) && - length(parsed_flags[:Hubbard_beta]) >= speciesid - β = parsed_flags[:Hubbard_beta][speciesid] +function qe_DFTU(speciesid::Int, parsed_flags::Dict{Symbol,Any}, hubbard_block) + if hubbard_block === nothing + U = 0.0 + J0 = 0.0 + J = [0.0] + α = 0.0 + β = 0.0 + if haskey(parsed_flags, :Hubbard_U) && length(parsed_flags[:Hubbard_U]) >= speciesid + U = parsed_flags[:Hubbard_U][speciesid] + end + if haskey(parsed_flags, :Hubbard_J0) && length(parsed_flags[:Hubbard_J0]) >= speciesid + J0 = parsed_flags[:Hubbard_J0][speciesid] + end + if haskey(parsed_flags, :Hubbard_J) && length(parsed_flags[:Hubbard_J]) >= speciesid + J = Float64.(parsed_flags[:Hubbard_J][:, speciesid]) + end + if haskey(parsed_flags, :Hubbard_alpha) && + length(parsed_flags[:Hubbard_alpha]) >= speciesid + α = parsed_flags[:Hubbard_alpha][speciesid] + end + if haskey(parsed_flags, :Hubbard_beta) && + length(parsed_flags[:Hubbard_beta]) >= speciesid + β = parsed_flags[:Hubbard_beta][speciesid] + end + return DFTU(; U = U, J0 = J0, α = α, β = β, J = sum(J) == 0 ? [0.0] : J) + else + error("needs implementing") end - return DFTU(; U = U, J0 = J0, α = α, β = β, J = sum(J) == 0 ? [0.0] : J) end degree2π(ang) = ang / 180 * π @@ -1007,7 +1013,7 @@ function qe_magnetization(atid::Int, parsed_flags::Dict{Symbol,Any}) end end -function extract_atoms!(parsed_flags, atsyms, atom_block, pseudo_block, cell::Mat3) +function extract_atoms!(parsed_flags, atsyms, atom_block, pseudo_block, hubbard_block, cell::Mat3) atoms = Atom[] option = atom_block.option @@ -1035,19 +1041,19 @@ function extract_atoms!(parsed_flags, atsyms, atom_block, pseudo_block, cell::Ma position_cart = primv * pos, position_cryst = UnitfulAtomic.ustrip.(inv(cell) * pos), pseudo = pseudo, magnetization = qe_magnetization(speciesid, parsed_flags), - dftu = qe_DFTU(speciesid, parsed_flags))) + dftu = qe_DFTU(speciesid, parsed_flags, hubbard_block))) end return atoms end function extract_structure!(parsed_flags, cell_block, atsyms, atom_block, - pseudo_block) + pseudo_block, hubbard_block) if atom_block == nothing return nothing end cell = extract_cell!(parsed_flags, cell_block) - atoms = extract_atoms!(parsed_flags, atsyms, atom_block, pseudo_block, cell) + atoms = extract_atoms!(parsed_flags, atsyms, atom_block, pseudo_block, hubbard_block, cell) return Structure(cell, atoms) end @@ -1138,6 +1144,8 @@ function qe_parse_calculation(file) contents = split(file, "\n") end + pre_7_2=true + lines = map(contents) do l id = findfirst(isequal('!'), l) if id !== nothing @@ -1222,8 +1230,17 @@ function qe_parse_calculation(file) end sysflags = qe_parse_flags(sysblock, nat) + + i_hubbard = findcard("hubbard") + + if i_hubbard !== nothing + pre_7_2=false + error("implement hubbard block parsing") + end + + structure = extract_structure!(sysflags, (option = cell_option, data=cell), atsyms, - (option = atoms_option, data=atoms), (data=pseudos,)) + (option = atoms_option, data=atoms), (data=pseudos,), nothing) delete!.((sysflags,), (:A, :celldm_1, :celldm, :ibrav, :nat, :ntyp)) delete!.((sysflags,), [:Hubbard_U, :Hubbard_J0, :Hubbard_alpha, :Hubbard_beta, :Hubbard_J]) @@ -1253,7 +1270,7 @@ function qe_parse_calculation(file) end push!(datablocks, InputData(:k_points, k_option, k_data)) end - return (flags = allflags, data = datablocks, structure = structure) + return (flags = allflags, data = datablocks, structure = structure, pre_7_2 = pre_7_2) end function qe_writeflag(f, flag, value) @@ -1283,21 +1300,146 @@ function qe_writeflag(f, flag, value) end end +function qe_handle_hubbard_flags!(c::Calculation{QE}, str::Structure) + u_ats = unique(str.atoms) + isnc = Structures.isnoncolin(str) + flags_to_set = [] + if any(x -> x.dftu.U != 0 || + x.dftu.J0 != 0.0 || + sum(x.dftu.J) != 0 || + sum(x.dftu.α) != 0, u_ats) + Jmap = map(x -> copy(x.dftu.J), u_ats) + Jdim = maximum(length.(Jmap)) + Jarr = zeros(Jdim, length(u_ats)) + for (i, J) in enumerate(Jmap) + diff = Jdim - length(J) + if diff > 0 + for d in 1:diff + push!(J, zero(eltype(J))) + end + end + Jarr[:, i] .= J + end + append!(flags_to_set, + [:Hubbard_U => map(x -> x.dftu.U, u_ats), + :Hubbard_alpha => map(x -> x.dftu.α, u_ats), + :Hubbard_beta => map(x -> x.dftu.β, u_ats), :Hubbard_J => Jarr, + :Hubbard_J0 => map(x -> x.dftu.J0, u_ats)]) + end + if !isempty(flags_to_set) || haskey(c, :Hubbard_parameters) + push!(flags_to_set, :lda_plus_u => true) + if isnc + push!(flags_to_set, :lda_plus_u_kind => 1) + end + end + if !isempty(flags_to_set) + set_flags!(c, flags_to_set...; print = false) + else + for f in + (:lda_plus_u, :lda_plus_u_kind, :Hubbard_U, :Hubbard_alpha, :Hubbard_beta, + :Hubbard_J, :Hubbard_J0, :U_projection_type) + pop!(c, f, nothing) + end + end +end + +function qe_handle_hubbard_flags!(c::Calculation{QE7_2}, str::Structure) + u_ats = unique(str.atoms) + isnc = Structures.isnoncolin(str) + if any(x -> x.dftu.U != 0 || + x.dftu.J0 != 0.0 || + sum(x.dftu.J) != 0 || + sum(x.dftu.α) != 0, u_ats) + + set_flags!(c, :lda_plus_u => true; print = false) + if isnc + set_flags!(c, :lda_plus_u_kind => 1; print = false) + end + else + for f in + (:lda_plus_u, :lda_plus_u_kind, :Hubbard_U, :Hubbard_alpha, :Hubbard_beta, + :Hubbard_J, :Hubbard_J0, :U_projection_type) + pop!(c, f, nothing) + end + end +end + +function qe_handle_magnetism_flags!(c::Calculation, str::Structure) + u_ats = unique(str.atoms) + isnc = Structures.isnoncolin(str) + + flags_to_set = [] + mags = map(x -> x.magnetization, u_ats) + starts = Float64[] + θs = Float64[] + ϕs = Float64[] + ismagcalc = isnc ? true : Structures.ismagnetic(str) + if ismagcalc + if isnc + for m in mags + tm = normalize(m) + if norm(m) == 0 + push!.((starts, θs, ϕs), 0.0) + else + θ = acos(tm[3]) * 180 / π + ϕ = atan(tm[2], tm[1]) * 180 / π + start = norm(m) + push!(θs, θ) + push!(ϕs, ϕ) + push!(starts, start) + end + end + push!(flags_to_set, :noncolin => true) + else + for m in mags + push!.((θs, ϕs), 0.0) + if norm(m) == 0 + push!(starts, 0) + else + push!(starts, sign(sum(m)) * norm(m)) + end + end + end + append!(flags_to_set, [:starting_magnetization => starts, :angle1 => θs, :angle2 => ϕs, :nspin => 2]) + end + + set_flags!(c, flags_to_set...; print = false) + if isnc + pop!(c, :nspin, nothing) + end +end + """ write(f, calculation::Calculation{QE}, structure) Writes a string represenation to `f`. """ -function Base.write(f::IO, calculation::Calculation{QE}, structure=nothing) +function Base.write(f::IO, calculation::Calculation{T}, structure=nothing) where {T <: Union{QE, QE7_2}} cursize = f isa IOBuffer ? f.size : 0 if Calculations.hasflag(calculation, :calculation) Calculations.set_flags!(calculation, :calculation => replace(calculation[:calculation], "_" => "-"); print = false) end + if exec(calculation.exec) == "ph.x" write(f, "--\n") end + if Calculations.ispw(calculation) && structure !== nothing + qe_handle_hubbard_flags!(calculation, structure) + qe_handle_magnetism_flags!(calculation, structure) + if Calculations.isvcrelax(calculation) + #this is to make sure &ions and &cell are there in the calculation + !haskey(calculation, :ion_dynamics) && + set_flags!(calculation, :ion_dynamics => "bfgs"; print = false) + !haskey(calculation, :cell_dynamics) && + set_flags!(calculation, :cell_dynamics => "bfgs"; print = false) + end + #TODO add all the required flags + @assert haskey(calculation, :calculation) "Please set the flag for calculation with name: $(calculation.name)" + set_flags!(calculation, :pseudo_dir => "."; print = false) + end + writeflag(flag_data) = qe_writeflag(f, flag_data[1], flag_data[2]) write_dat(data) = write_data(f, data) for name in unique([[:control, :system, :electrons, :ions, :cell]; keys(calculation.flags)...]) @@ -1313,11 +1455,6 @@ function Base.write(f::IO, calculation::Calculation{QE}, structure=nothing) # write(f," A = $A\n") write(f, " nat = $nat\n") write(f, " ntyp = $ntyp\n") - elseif name == :projwfc - prefix = calculation[:prefix] - outdir = calculation[:outdir] - write(f, " prefix = $prefix\n") - write(f, " outdir = $outdir\n") end map(writeflag, [(flag, data) for (flag, data) in flags]) @@ -1377,7 +1514,7 @@ function write_data(f, data) end end -function write_structure(f, calculation::Calculation{QE}, structure) +function write_positions_cell(f, calculation::Union{Calculation{QE}, Calculation{QE7_2}}, structure) unique_at = unique(structure.atoms) write(f, "ATOMIC_SPECIES\n") write(f, @@ -1393,10 +1530,40 @@ function write_structure(f, calculation::Calculation{QE}, structure) join(map(at -> "$(at.name) $(join(at.position_cryst, " "))", structure.atoms), "\n")) write(f, "\n\n") - return end -function qe_generate_pw2wancalculation(c::Calculation{Wannier90}, nscf::Calculation{QE}) +write_structure(f, calculation::Calculation{QE}, structure) = write_positions_cell(f, calculation, structure) +function write_structure(f, calculation::Calculation{QE7_2}, structure) + write_positions_cell(f, calculation, structure) + if haskey(calculation, :lda_plus_u) + u_proj = unique(map(x->x.dftu.projection_type, filter(y -> y.dftu.U != 0 || y.dftu.J0 != 0 || y.dftu.J[1] != 0, structure.atoms))) + if length(u_proj) > 1 + @warn "Found different U proj types for different atoms, this is not supported so we use the first one: $(u_proj[1])" + end + write(f, "HUBBARD ($(u_proj[1])) \n") + for at in structure.atoms + + atsym = at.element.symbol + if at.dftu.U != 0.0 + write(f, "U $(at.name)-$(ELEMENT_TO_N[atsym])$(ELEMENT_TO_L[atsym]) $(at.dftu.U)\n") + end + if at.dftu.J0 != 0.0 + write(f, "J0 $(at.name)-$(ELEMENT_TO_N[atsym])$(ELEMENT_TO_L[atsym]) $(at.dftu.J0)\n") + end + if at.dftu.J[1] != 0.0 + write(f, "J $(at.name)-$(ELEMENT_TO_N[atsym])$(ELEMENT_TO_L[atsym]) $(at.dftu.J[1])\n") + if length(at.dftu.J) == 2 + write(f, "B $(at.name)-$(ELEMENT_TO_N[atsym])$(ELEMENT_TO_L[atsym]) $(at.dftu.J[2])\n") + else + write(f, "E2 $(at.name)-$(ELEMENT_TO_N[atsym])$(ELEMENT_TO_L[atsym]) $(at.dftu.J[2])\n") + write(f, "E3 $(at.name)-$(ELEMENT_TO_N[atsym])$(ELEMENT_TO_L[atsym]) $(at.dftu.J[3])\n") + end + end + end + end +end + +function qe_generate_pw2wancalculation(c::Calculation{Wannier90}, nscf::Union{Calculation{QE}, Calculation{QE7_2}}) flags = Dict() if haskey(nscf, :prefix) flags[:prefix] = nscf[:prefix] @@ -1428,3 +1595,148 @@ function qe_generate_pw2wancalculation(c::Calculation{Wannier90}, nscf::Calculat Calculations.set_flags!(out, flags...; print=false) return out end + +# This is to automatically set the hubbard manifold based on pre 7.2 QE. +# TODO: allow for multiple DFTU manifolds +const ELEMENT_TO_L = Dict( + :H => "s", + :K => "s", + :C => "p", + :N => "p", + :O => "p", + :As => "p", + :Sb => "p", + :Se => "p", + :Ti => "d", + :V => "d", + :Cr => "d", + :Mn => "d", + :Fe => "d", + :Co => "d", + :Ni => "d", + :Cu => "d", + :Zn => "d", + :Zr => "d", + :Nb => "d", + :Mo => "d", + :Tc => "d", + :Ru => "d", + :Rh => "d", + :Pd => "d", + :Ag => "d", + :Cd => "d", + :Hf => "d", + :Ta => "d", + :W => "d", + :Re => "d", + :Os => "d", + :Ir => "d", + :Pt => "d", + :Au => "d", + :Hg => "d", + :Sc => "d", + :Y => "d", + :La => "d", + :Ga => "d", + :In => "d", + :Ce => "f", + :Pr => "f", + :Nd => "f", + :Pm => "f", + :Sm => "f", + :Eu => "f", + :Gd => "f", + :Tb => "f", + :Dy => "f", + :Ho => "f", + :Er => "f", + :Tm => "f", + :Yb => "f", + :Lu => "f", + :Th => "f", + :Pa => "f", + :U => "f", + :Np => "f", + :Pu => "f", + :Am => "f", + :Cm => "f", + :Bk => "f", + :Cf => "f", + :Es => "f", + :Fm => "f", + :Md => "f", + :No => "f", + :Lr => "f" +) + +const ELEMENT_TO_N = Dict( + :H => 1, + :C => 2, + :N => 2, + :O => 2, + :Ti => 3, + :V => 3, + :Cr => 3, + :Mn => 3, + :Fe => 3, + :Co => 3, + :Ni => 3, + :Cu => 3, + :Zn => 3, + :Sc => 3, + :Ga => 3, + :Se => 3, + :Zr => 4, + :Nb => 4, + :Mo => 4, + :Tc => 4, + :Ru => 4, + :Rh => 4, + :Pd => 4, + :Ag => 4, + :Cd => 4, + :K => 4, + :Y => 4, + :La => 4, + :Ce => 4, + :Pr => 4, + :Nd => 4, + :Pm => 4, + :Sm => 4, + :Eu => 4, + :Gd => 4, + :Tb => 4, + :Dy => 4, + :Ho => 4, + :Er => 4, + :Tm => 4, + :Yb => 4, + :Lu => 4, + :In => 4, + :As => 4, + :Sb => 4, + :Hf => 5, + :Ta => 5, + :W => 5, + :Re => 5, + :Os => 5, + :Ir => 5, + :Pt => 5, + :Au => 5, + :Hg => 5, + :Th => 5, + :Pa => 5, + :U => 5, + :Np => 5, + :Pu => 5, + :Am => 5, + :Cm => 5, + :Bk => 5, + :Cf => 5, + :Es => 5, + :Fm => 5, + :Md => 5, + :No => 5, + :Lr => 5, +) + diff --git a/src/Structures/atom.jl b/src/Structures/atom.jl index 65e00234..30f52e8d 100644 --- a/src/Structures/atom.jl +++ b/src/Structures/atom.jl @@ -16,6 +16,7 @@ Base.@kwdef mutable struct DFTU α::Float64 = 0.0 β::Float64 = 0.0 J::Vector{Float64} = [0.0] + projection_type::String = "ortho-atomic" end function DFTU(dict::JSON3.Object) return DFTU(;dict...) diff --git a/test/constant_tests.jl b/test/constant_tests.jl index 7b683f17..453e7b85 100644 --- a/test/constant_tests.jl +++ b/test/constant_tests.jl @@ -1,5 +1,4 @@ using DFControl, Test -@test eltype(Calculations.qe_flaginfo(Exec(; path = "projwfc.x"), :calculation)) == Nothing -@test eltype(Calculations.qe_flaginfo(Exec(; path = "pw.x"), :calculation)) == - eltype(Calculations.qe_flaginfo(:calculation)) +@test Calculations.flagtype(Calculation{QE}(name = "dfd", exec = Exec(; path = "projwfc.x")), :calculation) == Nothing +@test Calculations.flagtype(Calculation{QE}(name = "dfd", exec = Exec(; path = "pw.x")), :calculation) == String diff --git a/test/display_tests.jl b/test/display_tests.jl index 035bdaf2..86c73b66 100644 --- a/test/display_tests.jl +++ b/test/display_tests.jl @@ -4,15 +4,15 @@ testjobpath = joinpath(testdir, "testassets", "test_job") @testset "Basic printing" begin job = load(test_server, Job(testjobpath)) - show(job.calculations[1]) - show(job.calculations[1].data[1]) - show(outputdata(job)["scf"][:bands][1]) - show(job.structure) - show(job.structure.atoms[1]) - show(job.structure.atoms[1].element) - show(Projection("d")) - show(DFC.Calculations._ELK_CONTROLBLOCKS()[1]) - show(DFC.Calculations._ELK_CONTROLBLOCKS()[1].flags[1]) + display(job.calculations[1]) + display(job.calculations[1].data[1]) + display(outputdata(job)["scf"][:bands][1]) + display(job.structure) + display(job.structure.atoms[1]) + display(job.structure.atoms[1].element) + display(Projection("d")) + display(DFC.Calculations._ELK_CONTROLBLOCKS()[1]) + display(DFC.Calculations._ELK_CONTROLBLOCKS()[1].flags[1]) end # @testset "html printing" begin diff --git a/test/documentation_tests.jl b/test/documentation_tests.jl index d1778d9c..39e1b60e 100644 --- a/test/documentation_tests.jl +++ b/test/documentation_tests.jl @@ -1,3 +1,3 @@ foundflags = Calculations.documentation(QE, "noncollinear") -@test length(foundflags) == 3 +@test length(foundflags) == 2 @test eltype(Calculations.documentation(QE, :electron_maxstep)) == Int From 1e54b624758239417f945142b25642f0425c8797 Mon Sep 17 00:00:00 2001 From: louisponet Date: Sun, 3 Sep 2023 21:21:00 +0200 Subject: [PATCH 02/14] prettier bands printing --- src/Display/printing.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Display/printing.jl b/src/Display/printing.jl index 4f399af3..03ea4530 100644 --- a/src/Display/printing.jl +++ b/src/Display/printing.jl @@ -11,7 +11,7 @@ function Base.show(io::IO, ::MIME"text/plain", block::InputData) return end -Base.show(io::IO, band::Band) = print(io, "Band($(length(band.k_points_cart)) k_points: $(band.k_points_cart[1]) -> $(band.k_points_cart[end]), eigvals: $(band.eigvals[1]) -> $(band.eigvals[end]))") +Base.show(io::IO, band::Band) = print(io, "Band($(length(band.k_points_cart)) k_points, eigvals: $(band.eigvals[1]) eV -> $(band.eigvals[end]) eV)") function Base.show(io::IO, ::MIME"text/plain", band::Band) show_type(io, band) From d2ab163f8eae3329ec3430db77a9033ff56ef13e Mon Sep 17 00:00:00 2001 From: louisponet Date: Sun, 3 Sep 2023 21:54:25 +0200 Subject: [PATCH 03/14] fix build --- .gitignore | 1 + deps/build.jl | 2 +- src/Calculations/calculation.jl | 9 +++++++-- src/Calculations/qe.jl | 6 +++--- src/FileIO/qe.jl | 6 ++++-- test/runtests.jl | 19 +++++++++++-------- 6 files changed, 27 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index 5eae5c6f..403b06ad 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,4 @@ deps/deps\.jl deps/spglib/ deps/elkflags\.jl +deps/qe7.2flags.jl diff --git a/deps/build.jl b/deps/build.jl index 75cf663f..71869410 100644 --- a/deps/build.jl +++ b/deps/build.jl @@ -76,6 +76,6 @@ if Sys.which("cif2cell") === nothing end end -if any(x->!ispath(joinpath(@__DIR__, x)), ("wannier90flags.jl", "qeflags.jl", "abinitflags.jl", "elkflags.jl")) +if any(x->!ispath(joinpath(@__DIR__, x)), ("wannier90flags.jl", "qeflags.jl", "abinitflags.jl", "elkflags.jl", "qe7.2flags.jl")) include("asset_init.jl") end diff --git a/src/Calculations/calculation.jl b/src/Calculations/calculation.jl index 15e382a9..f37b08da 100644 --- a/src/Calculations/calculation.jl +++ b/src/Calculations/calculation.jl @@ -90,13 +90,18 @@ function Calculation(name, flags, data, e, run, infile, return Calculation{p}(name, flags, data, e, run, infile, outfile) end -function Calculation(name, flags...; kwargs...) +function Calculation(name::String, flags::Pair{Symbol}...; kwargs...) out = Calculation(; name = name, kwargs...) set_flags!(out, flags...; print=false) return out end +function Calculation{p}(name::String, flags::Pair{Symbol}...; kwargs...) where {p} + out = Calculation{p}(; name = name, kwargs...) + set_flags!(out, flags...; print=false) + return out +end -function Calculation(template::Calculation, name, newflags...; +function Calculation(template::Calculation, name::String, newflags::Pair{Symbol}...; excs = deepcopy(template.exec), run = true, data = nothing) newflags = Dict(newflags...) diff --git a/src/Calculations/qe.jl b/src/Calculations/qe.jl index cf1672c1..440ec87e 100644 --- a/src/Calculations/qe.jl +++ b/src/Calculations/qe.jl @@ -87,10 +87,10 @@ end const QE7_2CalculationInfos = Ref(QECalculationInfo[]) function maybe_init_QE7_2CalculationInfos() - if isempty(QECalculationInfos[]) + if isempty(QE7_2CalculationInfos[]) include(joinpath(DEPS_DIR, "qe7.2flags.jl")) - QECalculationInfos[] = Base.invokelatest(_QE7_2INPUTINFOS, ) - push!(QECalculationInfos[], + QE7_2CalculationInfos[] = Base.invokelatest(_QE7_2INPUTINFOS, ) + push!(QE7_2CalculationInfos[], QECalculationInfo("pw2wannier90.x", [QEControlBlockInfo(:inputpp, [QEFlagInfo{String}(:outdir, diff --git a/src/FileIO/qe.jl b/src/FileIO/qe.jl index 472f7087..788d8a51 100644 --- a/src/FileIO/qe.jl +++ b/src/FileIO/qe.jl @@ -1536,12 +1536,13 @@ write_structure(f, calculation::Calculation{QE}, structure) = write_positions_ce function write_structure(f, calculation::Calculation{QE7_2}, structure) write_positions_cell(f, calculation, structure) if haskey(calculation, :lda_plus_u) - u_proj = unique(map(x->x.dftu.projection_type, filter(y -> y.dftu.U != 0 || y.dftu.J0 != 0 || y.dftu.J[1] != 0, structure.atoms))) + unique_at = unique(structure.atoms) + u_proj = unique(map(x->x.dftu.projection_type, filter(y -> y.dftu.U != 0 || y.dftu.J0 != 0 || y.dftu.J[1] != 0, unique_at))) if length(u_proj) > 1 @warn "Found different U proj types for different atoms, this is not supported so we use the first one: $(u_proj[1])" end write(f, "HUBBARD ($(u_proj[1])) \n") - for at in structure.atoms + for at in unique_at atsym = at.element.symbol if at.dftu.U != 0.0 @@ -1560,6 +1561,7 @@ function write_structure(f, calculation::Calculation{QE7_2}, structure) end end end + write(f, "\n\n") end end diff --git a/test/runtests.jl b/test/runtests.jl index 2b0d69ee..6dd0a96f 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -37,17 +37,20 @@ using UUIDs testdir = @__DIR__ test_server = local_server() @time begin - @testset "constants" begin - include("constant_tests.jl") - end - @testset "documenation" begin - include("documentation_tests.jl") - end + # @testset "constants" begin + # include("constant_tests.jl") + # end + # @testset "documenation" begin + # include("documentation_tests.jl") + # end @testset "Setting defaults" begin include("defaults_tests.jl") end - @testset "Job from CIF file" begin - include("jobfromcif_tests.jl") + # @testset "Job from CIF file" begin + # include("jobfromcif_tests.jl") + # end + @testset "Job from CIF file 7.2" begin + include("jobfromcif_tests_7.2.jl") end @testset "Display tests" begin include("display_tests.jl") From 5de9077556e23736f84e35db8afb8902de05b911 Mon Sep 17 00:00:00 2001 From: louisponet Date: Sun, 3 Sep 2023 21:54:39 +0200 Subject: [PATCH 04/14] added 7.2 test --- test/jobfromcif_tests_7.2.jl | 115 +++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 test/jobfromcif_tests_7.2.jl diff --git a/test/jobfromcif_tests_7.2.jl b/test/jobfromcif_tests_7.2.jl new file mode 100644 index 00000000..01bc02ac --- /dev/null +++ b/test/jobfromcif_tests_7.2.jl @@ -0,0 +1,115 @@ +using DFControl, Test, LinearAlgebra +using RemoteHPC: Exec, exec + +testdir = joinpath(dirname(dirname(pathof(DFControl))), "test") +testjobpath = joinpath(testdir, "testassets", "test_job") +@testset "initial creation" begin + if ispath(testjobpath) + rm(testjobpath, recursive=true) + end + + name = "Ni" + dir = testjobpath + bin_dir = joinpath(homedir(), "Software/qe/bin") + pw_exec = load(test_server, Exec("pw")) + pw_exec.flags["nk"] = 4 + @test !isempty(pw_exec.flags) + + str = Structure(joinpath(testdir, "testassets/Ni.cif")) + + calculations = [Calculation{QE7_2}("vcrelax", :calculation => "vc-relax", :verbosity => "high", :ion_dynamics => "bfgs", :cell_dynamics => "bfgs"; + exec = pw_exec, + data = [InputData(:k_points, :automatic, + [6, 6, 6, 1, 1, 1])]), + Calculation{QE7_2}(; name = "scf", exec = pw_exec, + flags = Dict(:control => Dict(:calculation => "scf", :verbosity => "high")), + data = [InputData(:k_points, :automatic, + [4, 4, 4, 1, 1, 1])])] + job = Job(name, str, calculations, :ecutwfc => 40.0, :occupations => "smearing", :degauss=>0.01, :conv_thr => 1e-6, :nbnd => 18; + #kwargs + dir = dir, server=test_server.name) + + + set_pseudos!(job, load(test_server, PseudoSet("test"))) + job.environment = "test" + + set_kpoints!(job["scf"], (6, 6, 6, 1, 1, 1)) + + job.structure[element(:Ni)][1].magnetization = Vec3(0,0,0.1) + job.structure[element(:Ni)][1].dftu.U = 4.0 + + push!(job, Calculations.gencalc_bands(job["scf"], Structures.high_symmetry_kpath(job.structure, 20))) + push!(job, Calculations.gencalc_nscf(job["scf"], (5,5,5))) + + push!(job, Calculations.gencalc_projwfc(job["nscf"], 2.0, 20.0, 0.1)) + + @test all(values(job[:ecutwfc]) .== 40.0) + for c in job.calculations + pop!(c, :ecutwfc, nothing) + end + + + save(job, fillexecs=false) + @test all(values(job[:ecutwfc]) .== 41.0) + @test all(values(job[:ecutrho]) .== 236.0) + @test job.version == 1 + @test length(job) == 5 + @test data(job["scf"], :k_points).data == [6,6,6,1,1,1] + @test job["nscf"].exec == pw_exec + @test exec(job["projwfc"].exec) == "projwfc.x" + @test dirname(job["projwfc"].exec.path) == dirname(pw_exec.path) + @test show(job) == nothing + job[:ecutwfc] = 40.0 + for c in job.calculations + pop!(c, :ecutrho, nothing) + end + @test all(values(job[:ecutwfc]) .== 40.0) + save(job, fillexecs=false) + job2 = load(test_server, Job(abspath(job))) + + for (c1, c2) in zip(job2.calculations, job.calculations) + @test c1 == c2 + end + @test job2.structure == job.structure +end + +refjobpath =joinpath(testdir, "testassets", "reference_job") + +@testset "reference comparison" begin + job = load(test_server, Job(testjobpath)) + + orig_job = deepcopy(job) + job.structure = Structures.create_supercell(job.structure, 1, 0, 0, make_afm = true) + + job2 = load(test_server, Job(refjobpath)) + @test job2.structure == job.structure + + for f in DFControl.Utils.searchdir(job2, ".out") + cp(f, joinpath(job, splitdir(f)[2]), force=true) + end + for f in DFControl.Utils.searchdir(job2, "dos") + cp(f, joinpath(job, splitdir(f)[2]), force=true) + end + + for a in job.structure.atoms + a.projections = [Projection("s"), Projection("p"), Projection("d")] + end + wanexec = Exec(name="wan", path=joinpath(homedir(), "Software/wannier90/wannier90.x"), parallel=false) + append!(job, Calculations.gencalc_wan(job, 0.000011, :wannier_plot => true, wanexec = wanexec)) + for (c1, c2) in zip(job2.calculations, job.calculations) + @test c1 == c2 + end + save(job, fillexecs=false) + job = load(test_server, Job(testjobpath)) + + for (c1, c2) in zip(job2.calculations, job.calculations) + @test c1 == c2 + end + save(orig_job, fillexecs=false) + for f in DFControl.Utils.searchdir(job2, ".out") + cp(f, joinpath(job, splitdir(f)[2]), force=true) + end + for f in DFControl.Utils.searchdir(job2, "dos") + cp(f, joinpath(job, splitdir(f)[2]), force=true) + end +end From 32aaeab07c57baa7a22531f260f52b1d62f89af6 Mon Sep 17 00:00:00 2001 From: louisponet Date: Sun, 3 Sep 2023 22:39:32 +0200 Subject: [PATCH 05/14] fixed tests --- src/Display/printing.jl | 2 +- src/FileIO/qe.jl | 96 +++++++++++++++++++++++-------------- test/documentation_tests.jl | 2 +- test/runtests.jl | 18 +++---- 4 files changed, 72 insertions(+), 46 deletions(-) diff --git a/src/Display/printing.jl b/src/Display/printing.jl index 03ea4530..f0fcb715 100644 --- a/src/Display/printing.jl +++ b/src/Display/printing.jl @@ -278,5 +278,5 @@ function Base.show(io::IO, ::MIME"text/plain", proj::Projection) return println(io, crayon"red", "last index: ", crayon"reset", "$(proj.last)") end -Base.show(io::IO, dftu::DFTU) = print(io, "l=$(dftu.l), U=$(dftu.U), J0=$(dftu.J0), α=$(dftu.α), β=$(dftu.β), J=$(dftu.J)") +Base.show(io::IO, dftu::DFTU) = print(io, "l=$(dftu.l), U=$(dftu.U), J0=$(dftu.J0), α=$(dftu.α), β=$(dftu.β), J=$(dftu.J), projection=$(dftu.projection_type)") diff --git a/src/FileIO/qe.jl b/src/FileIO/qe.jl index 788d8a51..d5cfce95 100644 --- a/src/FileIO/qe.jl +++ b/src/FileIO/qe.jl @@ -11,7 +11,7 @@ function cardoption(line) if length(sline) < 2 && lowercase(sline[1]) == "k_points" return :tpiba else - return Symbol(match(r"((?:[a-z][a-z0-9_]*))", sline[2]).match) + return Symbol(match(r"((?:[a-z][a-z0-9_-]*))", sline[2]).match) end end @@ -963,34 +963,30 @@ function extract_cell!(flags, cell_block) end end -function qe_DFTU(speciesid::Int, parsed_flags::Dict{Symbol,Any}, hubbard_block) - if hubbard_block === nothing - U = 0.0 - J0 = 0.0 - J = [0.0] - α = 0.0 - β = 0.0 - if haskey(parsed_flags, :Hubbard_U) && length(parsed_flags[:Hubbard_U]) >= speciesid - U = parsed_flags[:Hubbard_U][speciesid] - end - if haskey(parsed_flags, :Hubbard_J0) && length(parsed_flags[:Hubbard_J0]) >= speciesid - J0 = parsed_flags[:Hubbard_J0][speciesid] - end - if haskey(parsed_flags, :Hubbard_J) && length(parsed_flags[:Hubbard_J]) >= speciesid - J = Float64.(parsed_flags[:Hubbard_J][:, speciesid]) - end - if haskey(parsed_flags, :Hubbard_alpha) && - length(parsed_flags[:Hubbard_alpha]) >= speciesid - α = parsed_flags[:Hubbard_alpha][speciesid] - end - if haskey(parsed_flags, :Hubbard_beta) && - length(parsed_flags[:Hubbard_beta]) >= speciesid - β = parsed_flags[:Hubbard_beta][speciesid] - end - return DFTU(; U = U, J0 = J0, α = α, β = β, J = sum(J) == 0 ? [0.0] : J) - else - error("needs implementing") +function qe_DFTU(speciesid::Int, parsed_flags::Dict{Symbol,Any},) + U = 0.0 + J0 = 0.0 + J = [0.0] + α = 0.0 + β = 0.0 + if haskey(parsed_flags, :Hubbard_U) && length(parsed_flags[:Hubbard_U]) >= speciesid + U = parsed_flags[:Hubbard_U][speciesid] + end + if haskey(parsed_flags, :Hubbard_J0) && length(parsed_flags[:Hubbard_J0]) >= speciesid + J0 = parsed_flags[:Hubbard_J0][speciesid] + end + if haskey(parsed_flags, :Hubbard_J) && length(parsed_flags[:Hubbard_J]) >= speciesid + J = Float64.(parsed_flags[:Hubbard_J][:, speciesid]) end + if haskey(parsed_flags, :Hubbard_alpha) && + length(parsed_flags[:Hubbard_alpha]) >= speciesid + α = parsed_flags[:Hubbard_alpha][speciesid] + end + if haskey(parsed_flags, :Hubbard_beta) && + length(parsed_flags[:Hubbard_beta]) >= speciesid + β = parsed_flags[:Hubbard_beta][speciesid] + end + return DFTU(; U = U, J0 = J0, α = α, β = β, J = sum(J) == 0 ? [0.0] : J) end degree2π(ang) = ang / 180 * π @@ -1041,7 +1037,7 @@ function extract_atoms!(parsed_flags, atsyms, atom_block, pseudo_block, hubbard_ position_cart = primv * pos, position_cryst = UnitfulAtomic.ustrip.(inv(cell) * pos), pseudo = pseudo, magnetization = qe_magnetization(speciesid, parsed_flags), - dftu = qe_DFTU(speciesid, parsed_flags, hubbard_block))) + dftu = hubbard_block === nothing ? qe_DFTU(speciesid, parsed_flags) : hubbard_block[atsym])) end return atoms @@ -1131,6 +1127,7 @@ function qe_parse_flags(inflags, nat::Int=0) return flags end + """ qe_parse_calculation(file) @@ -1234,13 +1231,42 @@ function qe_parse_calculation(file) i_hubbard = findcard("hubbard") if i_hubbard !== nothing - pre_7_2=false - error("implement hubbard block parsing") + pre_7_2 = false + projection_type = String(cardoption(lines[i_hubbard])) + push!(used_lineids, i_hubbard) + + dftus = Dict{Symbol, DFTU}() + for k in 1:ntyp + push!(used_lineids, i_hubbard + k) + + par, atsym_manifold, sval = split(lines[i_hubbard+k]) + val = parse(Float64, sval) + + atsym = Symbol(split(atsym_manifold, "-")[1]) + + dftu = get!(dftus, atsym, DFTU()) + dftu.projection_type = projection_type + + if par == "U" + dftu.U = val + elseif par == "J0" + dftu.J0 = val + elseif par == "J" + dftu.J[1] = val + elseif par == "B" || par == "E2" + dftu.J[2] = val + elseif par == "E3" + dftu.J[3] = val + end + end + structure = extract_structure!(sysflags, (option = cell_option, data=cell), atsyms, + (option = atoms_option, data=atoms), (data=pseudos,), dftus) + + else + structure = extract_structure!(sysflags, (option = cell_option, data=cell), atsyms, + (option = atoms_option, data=atoms), (data=pseudos,), nothing) end - - structure = extract_structure!(sysflags, (option = cell_option, data=cell), atsyms, - (option = atoms_option, data=atoms), (data=pseudos,), nothing) delete!.((sysflags,), (:A, :celldm_1, :celldm, :ibrav, :nat, :ntyp)) delete!.((sysflags,), [:Hubbard_U, :Hubbard_J0, :Hubbard_alpha, :Hubbard_beta, :Hubbard_J]) @@ -1561,7 +1587,7 @@ function write_structure(f, calculation::Calculation{QE7_2}, structure) end end end - write(f, "\n\n") + write(f, "\n") end end diff --git a/test/documentation_tests.jl b/test/documentation_tests.jl index 39e1b60e..d1778d9c 100644 --- a/test/documentation_tests.jl +++ b/test/documentation_tests.jl @@ -1,3 +1,3 @@ foundflags = Calculations.documentation(QE, "noncollinear") -@test length(foundflags) == 2 +@test length(foundflags) == 3 @test eltype(Calculations.documentation(QE, :electron_maxstep)) == Int diff --git a/test/runtests.jl b/test/runtests.jl index 6dd0a96f..92737326 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -37,18 +37,18 @@ using UUIDs testdir = @__DIR__ test_server = local_server() @time begin - # @testset "constants" begin - # include("constant_tests.jl") - # end - # @testset "documenation" begin - # include("documentation_tests.jl") - # end + @testset "constants" begin + include("constant_tests.jl") + end + @testset "documenation" begin + include("documentation_tests.jl") + end @testset "Setting defaults" begin include("defaults_tests.jl") end - # @testset "Job from CIF file" begin - # include("jobfromcif_tests.jl") - # end + @testset "Job from CIF file" begin + include("jobfromcif_tests.jl") + end @testset "Job from CIF file 7.2" begin include("jobfromcif_tests_7.2.jl") end From 36918fe84bb33d2c0d3179333592f323211ed166 Mon Sep 17 00:00:00 2001 From: louisponet Date: Mon, 4 Sep 2023 09:37:20 +0200 Subject: [PATCH 06/14] added AbstractQE package --- src/Calculations/Calculations.jl | 2 +- src/Calculations/calculation.jl | 5 +-- src/Calculations/qe.jl | 53 ++++++++++++++++---------------- src/Calculations/wannier.jl | 4 +-- src/Client/job.jl | 4 +-- src/FileIO/qe.jl | 14 ++++----- src/FileIO/wannier.jl | 2 +- 7 files changed, 42 insertions(+), 42 deletions(-) diff --git a/src/Calculations/Calculations.jl b/src/Calculations/Calculations.jl index 767c008d..222d8382 100644 --- a/src/Calculations/Calculations.jl +++ b/src/Calculations/Calculations.jl @@ -16,5 +16,5 @@ include("documentation.jl") include("julia.jl") export Calculation, InputData -export Wannier90, QE, QE7_2, Abinit, Elk, Julia, set_flags! +export Wannier90, AbstractQE, QE, QE7_2, Abinit, Elk, Julia, set_flags! end diff --git a/src/Calculations/calculation.jl b/src/Calculations/calculation.jl index f37b08da..202970ea 100644 --- a/src/Calculations/calculation.jl +++ b/src/Calculations/calculation.jl @@ -35,8 +35,9 @@ StructTypes.StructType(::Type{InputData}) = StructTypes.Struct() abstract type Package end struct NoPackage <: Package end struct Wannier90 <: Package end -struct QE <: Package end -struct QE7_2 <: Package end +abstract type AbstractQE <: Package end +struct QE <: AbstractQE end +struct QE7_2 <: AbstractQE end struct Abinit <: Package end struct Elk <: Package end StructTypes.StructType(::Type{<:Package}) = StructTypes.Struct() diff --git a/src/Calculations/qe.jl b/src/Calculations/qe.jl index 440ec87e..011d3bb4 100644 --- a/src/Calculations/qe.jl +++ b/src/Calculations/qe.jl @@ -1,4 +1,3 @@ -const QE_CALCULATION = Union{Calculation{QE}, Calculation{QE7_2}} #QE calls these flags struct QEFlagInfo{T} name::Symbol @@ -237,25 +236,25 @@ function flagtype(calculation::Calculation{QE7_2}, flag) return eltype(QEFlagInfo()) end -isbands(c::QE_CALCULATION) = get(c, :calculation, nothing) == "bands" -isnscf(c::QE_CALCULATION) = get(c, :calculation, nothing) == "nscf" -isscf(c::QE_CALCULATION) = get(c, :calculation, nothing) == "scf" -isvcrelax(c::QE_CALCULATION) = get(c, :calculation, nothing) == "vc-relax" -isrelax(c::QE_CALCULATION) = get(c, :calculation, nothing) == "relax" -isprojwfc(c::QE_CALCULATION) = exec(c.exec) == "projwfc.x" -ishp(c::QE_CALCULATION) = exec(c.exec) == "hp.x" +isbands(c::Calculation{<:AbstractQE}) = get(c, :calculation, nothing) == "bands" +isnscf(c::Calculation{<:AbstractQE}) = get(c, :calculation, nothing) == "nscf" +isscf(c::Calculation{<:AbstractQE}) = get(c, :calculation, nothing) == "scf" +isvcrelax(c::Calculation{<:AbstractQE}) = get(c, :calculation, nothing) == "vc-relax" +isrelax(c::Calculation{<:AbstractQE}) = get(c, :calculation, nothing) == "relax" +isprojwfc(c::Calculation{<:AbstractQE}) = exec(c.exec) == "projwfc.x" +ishp(c::Calculation{<:AbstractQE}) = exec(c.exec) == "hp.x" -function ispw(c::QE_CALCULATION) +function ispw(c::Calculation{<:AbstractQE}) return isbands(c) || isnscf(c) || isscf(c) || isvcrelax(c) || isrelax(c) end -issoc(c::QE_CALCULATION) = get(c, :lspinorb, false) +issoc(c::Calculation{<:AbstractQE}) = get(c, :lspinorb, false) -function ismagnetic(c::QE_CALCULATION) +function ismagnetic(c::Calculation{<:AbstractQE}) return get(c, :nspin, 0.0) > 0.0 || get(c, :total_magnetization, 0.0) end -function outfiles(c::QE_CALCULATION) +function outfiles(c::Calculation{<:AbstractQE}) files = [c.outfile] for (is, fuzzies) in zip(("projwfc.x", "hp.x", "pp.x"), (("pdos",), ("Hubbard_parameters",), ("filplot", "fileout"))) if c.exec.exec == is @@ -265,8 +264,8 @@ function outfiles(c::QE_CALCULATION) return unique(files) end -ψ_cutoff_flag(::QE_CALCULATION) = :ecutwfc -ρ_cutoff_flag(::QE_CALCULATION) = :ecutrho +ψ_cutoff_flag(::Calculation{<:AbstractQE}) = :ecutwfc +ρ_cutoff_flag(::Calculation{<:AbstractQE}) = :ecutrho function kgrid(na, nb, nc, ::Union{Type{QE}, Type{QE7_2}}) return reshape([(a, b, c, 1 / (na * nb * nc)) @@ -276,7 +275,7 @@ function kgrid(na, nb, nc, ::Union{Type{QE}, Type{QE7_2}}) (na * nb * nc)) end -function set_kpoints!(c::QE_CALCULATION, k_grid::NTuple{3,Int}; print = true) #nscf +function set_kpoints!(c::Calculation{<:AbstractQE}, k_grid::NTuple{3,Int}; print = true) #nscf print && !isnscf(c) && (@warn "Expected calculation to be 'nscf'.\nGot $c.") d = data(c, :k_points) if d !== nothing @@ -291,7 +290,7 @@ function set_kpoints!(c::QE_CALCULATION, k_grid::NTuple{3,Int}; print = true) #n return c end -function set_kpoints!(c::QE_CALCULATION, k_grid::NTuple{6,Int}; print = true) #scf +function set_kpoints!(c::Calculation{<:AbstractQE}, k_grid::NTuple{6,Int}; print = true) #scf print && !(isscf(c) || isvcrelax(c) || isrelax(c)) && (@warn "Expected calculation to be scf, vc-relax, relax.") @@ -308,7 +307,7 @@ function set_kpoints!(c::QE_CALCULATION, k_grid::NTuple{6,Int}; print = true) #s return c end -function set_kpoints!(c::QE_CALCULATION, k_grid::Vector{<:NTuple{4}}; print = true, +function set_kpoints!(c::Calculation{<:AbstractQE}, k_grid::Vector{<:NTuple{4}}; print = true, k_option = :crystal_b) print && isbands(c) != "bands" && @@ -339,60 +338,60 @@ function set_kpoints!(c::QE_CALCULATION, k_grid::Vector{<:NTuple{4}}; print = tr end """ - gencalc_scf(template::QE_CALCULATION, kpoints::NTuple{6, Int}, newflags...; name="scf") + gencalc_scf(template::Calculation{<:AbstractQE}, kpoints::NTuple{6, Int}, newflags...; name="scf") Uses the information from the template and `supplied` kpoints to generate an scf calculation. Extra flags can be supplied which will be set for the generated calculation. """ -function gencalc_scf(template::QE_CALCULATION, kpoints::NTuple{6,Int}, newflags...; +function gencalc_scf(template::Calculation{<:AbstractQE}, kpoints::NTuple{6,Int}, newflags...; name = "scf") return calculation_from_kpoints(template, name, kpoints, :calculation => "scf", newflags...) end """ - gencalc_vcrelax(template::QE_CALCULATION, kpoints::NTuple{6, Int}, newflags...; name="scf") + gencalc_vcrelax(template::Calculation{<:AbstractQE}, kpoints::NTuple{6, Int}, newflags...; name="scf") Uses the information from the template and supplied `kpoints` to generate a vcrelax calculation. Extra flags can be supplied which will be set for the generated calculation. """ -function gencalc_vcrelax(template::QE_CALCULATION, kpoints::NTuple{6,Int}, newflags...; +function gencalc_vcrelax(template::Calculation{<:AbstractQE}, kpoints::NTuple{6,Int}, newflags...; name = "vcrelax") return calculation_from_kpoints(template, name, kpoints, :calculation => "vc-relax", newflags...) end """ - gencalc_bands(template::QE_CALCULATION, kpoints::Vector{NTuple{4}}, newflags...; name="bands") + gencalc_bands(template::Calculation{<:AbstractQE}, kpoints::Vector{NTuple{4}}, newflags...; name="bands") Uses the information from the template and supplied `kpoints` to generate a bands calculation. Extra flags can be supplied which will be set for the generated calculation. """ -function gencalc_bands(template::QE_CALCULATION, kpoints::Vector{<:NTuple{4}}, newflags...; +function gencalc_bands(template::Calculation{<:AbstractQE}, kpoints::Vector{<:NTuple{4}}, newflags...; name = "bands") return calculation_from_kpoints(template, name, kpoints, :calculation => "bands", newflags...) end """ - gencalc_nscf(template::QE_CALCULATION, kpoints::NTuple{3, Int}, newflags...; name="nscf") + gencalc_nscf(template::Calculation{<:AbstractQE}, kpoints::NTuple{3, Int}, newflags...; name="nscf") Uses the information from the template and supplied `kpoints` to generate an nscf calculation. Extra flags can be supplied which will be set for the generated calculation. """ -function gencalc_nscf(template::QE_CALCULATION, kpoints::NTuple{3,Int}, newflags...; +function gencalc_nscf(template::Calculation{<:AbstractQE}, kpoints::NTuple{3,Int}, newflags...; name = "nscf") return calculation_from_kpoints(template, name, kpoints, :calculation => "nscf", newflags...) end """ - gencalc_projwfc(template::QE_CALCULATION, Emin, Emax, DeltaE, newflags...; name="projwfc") + gencalc_projwfc(template::Calculation{<:AbstractQE}, Emin, Emax, DeltaE, newflags...; name="projwfc") Uses the information from the template and supplied `kpoints` to generate a `projwfc.x` calculation. Extra flags can be supplied which will be set for the generated calculation. """ -function gencalc_projwfc(template::QE_CALCULATION, Emin, Emax, DeltaE, extraflags...; +function gencalc_projwfc(template::Calculation{<:AbstractQE}, Emin, Emax, DeltaE, extraflags...; name = "projwfc") occflag = get(template, :occupations, "fixed") ngauss = 0 diff --git a/src/Calculations/wannier.jl b/src/Calculations/wannier.jl index 8f6b147a..81f46139 100644 --- a/src/Calculations/wannier.jl +++ b/src/Calculations/wannier.jl @@ -12,7 +12,7 @@ flagtype(::Calculation{Wannier90}, flag) = flagtype(Wannier90, flag) Generates a Wannier90 calculation to follow on the supplied `nscf` calculation. It uses the projections defined in the `structure`, and starts counting the required amount of bands from `Emin`. The `nscf` needs to have a valid output since it will be used in conjunction with `Emin` to find the required amount of bands and energy window for the Wannier90 calculation. """ -function gencalc_wan(nscf::Calculation{QE}, structure::Structure, bands, Emin, wanflags...; Epad = 5.0, +function gencalc_wan(nscf::Calculation{<:AbstractQE}, structure::Structure, bands, Emin, wanflags...; Epad = 5.0, wanexec = Exec(; name="wannier90", path = "wannier90.x")) projs = vcat(map(structure.atoms) do x ps = x.projections @@ -178,7 +178,7 @@ function remote_calcs(job, _calculation::Calculation{Wannier90}) nscf = getfirst(x -> Calculations.isnscf(x), job.calculations) @assert nscf !== nothing "No NSCF found to generate pw2wannier90 from." - @assert eltype(nscf) == QE "Only QE based Wannier90 jobs are supported." + @assert eltype(nscf) <: AbstractQE "Only QE based Wannier90 jobs are supported." pw2wan_exec = Exec(name = "", path=joinpath(dirname(nscf.exec.path), "pw2wannier90.x"), modules=nscf.exec.modules) diff --git a/src/Client/job.jl b/src/Client/job.jl index d48bc075..ce7ac3e1 100644 --- a/src/Client/job.jl +++ b/src/Client/job.jl @@ -43,7 +43,7 @@ function RemoteHPC.load(server::Server, j::Job) if c.structure !== nothing push!(structures, c.structure) end - push!(outcalcs, Calculation(splitext(infile)[1], c.flags, c.data, e, calc.run, infile, outfile)) + push!(outcalcs, Calculation{c.package}(splitext(infile)[1], c.flags, c.data, e, calc.run, infile, outfile)) end end if !isempty(structures) @@ -107,7 +107,7 @@ function write_calculations(job::Job; fillexecs=true) nscf = getfirst(x->Calculations.isnscf(x), job.calculations) @assert nscf !== nothing "No NSCF found to generate pw2wannier90 from." - @assert eltype(nscf) == QE "Only QE based Wannier90 jobs are supported." + @assert eltype(nscf) <: AbstractQE "Only QE based Wannier90 jobs are supported." for c in wcalcs pwcalc = FileIO.qe_generate_pw2wancalculation(c, nscf) diff --git a/src/FileIO/qe.jl b/src/FileIO/qe.jl index d5cfce95..f50128bc 100644 --- a/src/FileIO/qe.jl +++ b/src/FileIO/qe.jl @@ -1,6 +1,6 @@ import Base: parse -function readoutput(c::Calculation{QE}, files...; kwargs...) +function readoutput(c::Calculation{<:AbstractQE}, files...; kwargs...) return qe_parse_output(c, files...; kwargs...) end @@ -35,7 +35,7 @@ function qe_parse_time(str::AbstractString) return t end -function qe_parse_output(c::Calculation{QE}, files...; kwargs...) +function qe_parse_output(c::Calculation{<:AbstractQE} , files...; kwargs...) if Calculations.isprojwfc(c) return qe_parse_projwfc_output(files...) elseif Calculations.ishp(c) @@ -1296,7 +1296,7 @@ function qe_parse_calculation(file) end push!(datablocks, InputData(:k_points, k_option, k_data)) end - return (flags = allflags, data = datablocks, structure = structure, pre_7_2 = pre_7_2) + return (flags = allflags, data = datablocks, structure = structure, package = pre_7_2 ? QE : QE7_2) end function qe_writeflag(f, flag, value) @@ -1440,7 +1440,7 @@ end Writes a string represenation to `f`. """ -function Base.write(f::IO, calculation::Calculation{T}, structure=nothing) where {T <: Union{QE, QE7_2}} +function Base.write(f::IO, calculation::Calculation{T}, structure=nothing) where {T <: AbstractQE} cursize = f isa IOBuffer ? f.size : 0 if Calculations.hasflag(calculation, :calculation) Calculations.set_flags!(calculation, @@ -1526,7 +1526,7 @@ end function write_data(f, data) if typeof(data) <: Matrix writedlm(f, data) - elseif typeof(data) <: Union{String,Symbol} + elseif typeof(data) <: AbstractQE write(f, "$data\n") elseif typeof(data) <: Vector && length(data[1]) == 1 write(f, join(string.(data), " ")) @@ -1540,7 +1540,7 @@ function write_data(f, data) end end -function write_positions_cell(f, calculation::Union{Calculation{QE}, Calculation{QE7_2}}, structure) +function write_positions_cell(f, calculation::Calculation{<:AbstractQE}, structure) unique_at = unique(structure.atoms) write(f, "ATOMIC_SPECIES\n") write(f, @@ -1591,7 +1591,7 @@ function write_structure(f, calculation::Calculation{QE7_2}, structure) end end -function qe_generate_pw2wancalculation(c::Calculation{Wannier90}, nscf::Union{Calculation{QE}, Calculation{QE7_2}}) +function qe_generate_pw2wancalculation(c::Calculation{Wannier90}, nscf::Calculation{<:AbstractQE}) flags = Dict() if haskey(nscf, :prefix) flags[:prefix] = nscf[:prefix] diff --git a/src/FileIO/wannier.jl b/src/FileIO/wannier.jl index bdcbf2b0..95019921 100644 --- a/src/FileIO/wannier.jl +++ b/src/FileIO/wannier.jl @@ -204,7 +204,7 @@ function wan_parse_calculation(file) end structure = extract_structure(cell_block, atoms_block, proj_block, get(flags, :spinors, false)) - return (flags=flags, data=data, structure = structure) + return (flags=flags, data=data, structure = structure, package=Wannier90) end function wan_parse_array_value(eltyp, value_str) From 4cc341b831634d97eac576d1407fdd04d115f964 Mon Sep 17 00:00:00 2001 From: louisponet Date: Mon, 4 Sep 2023 09:41:02 +0200 Subject: [PATCH 07/14] upped version added convert to 7_2 --- Project.toml | 2 +- src/Calculations/Calculations.jl | 2 +- src/Calculations/calculation.jl | 2 -- src/Calculations/qe.jl | 2 ++ 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Project.toml b/Project.toml index c5514487..a4ed8ea6 100644 --- a/Project.toml +++ b/Project.toml @@ -2,7 +2,7 @@ name = "DFControl" uuid = "1e31e15d-4957-550d-a244-318eced754ae" authors = ["Louis Ponet "] repo = "https://github.com/louisponet/DFControl.jl.git" -version = "0.5.32" +version = "0.6.1" [deps] ANSIColoredPrinters = "a4c015fc-c6ff-483c-b24f-f7ea428134e9" diff --git a/src/Calculations/Calculations.jl b/src/Calculations/Calculations.jl index 222d8382..c082496d 100644 --- a/src/Calculations/Calculations.jl +++ b/src/Calculations/Calculations.jl @@ -16,5 +16,5 @@ include("documentation.jl") include("julia.jl") export Calculation, InputData -export Wannier90, AbstractQE, QE, QE7_2, Abinit, Elk, Julia, set_flags! +export Wannier90, AbstractQE, QE, QE7_2, Abinit, Elk, Julia, set_flags!, convert_to_7_2 end diff --git a/src/Calculations/calculation.jl b/src/Calculations/calculation.jl index 202970ea..48347ebc 100644 --- a/src/Calculations/calculation.jl +++ b/src/Calculations/calculation.jl @@ -129,11 +129,9 @@ function Calculation(dict::JSON3.Object) Calculation(dict[:name], Dict(dict[:flags]), [InputData(t) for t in dict[:data]], Exec(dict[:exec]), dict[:run], dict[:infile], dict[:outfile]) end - # Calculation() = Calculation{NoPackage}(package=NoPackage()) StructTypes.StructType(::Type{<:Calculation}) = StructTypes.Struct() - # Interface Functions isbands(c::Calculation) = false isnscf(c::Calculation) = false diff --git a/src/Calculations/qe.jl b/src/Calculations/qe.jl index 011d3bb4..0ca6a7a2 100644 --- a/src/Calculations/qe.jl +++ b/src/Calculations/qe.jl @@ -421,3 +421,5 @@ function gencalc_projwfc(template::Calculation{<:AbstractQE}, Emin, Emax, DeltaE set_flags!(out, extraflags...) return out end + +convert_to_7_2(c::Calculation{QE}) = Calculation{QE7_2}(name = c.name, flags = c.flags, data = c.data, exec=c.exec, run = c.run, infile=c.infile, outfile=c.outfile) From b132aff06fc9dbc88d6bd8c34895f7676f559376 Mon Sep 17 00:00:00 2001 From: louisponet Date: Sun, 3 Sep 2023 21:20:00 +0200 Subject: [PATCH 08/14] added initial 7.2 support and fixed tests --- assets/calculations/qe7.2/INPUT_BANDS.txt | 160 + assets/calculations/qe7.2/INPUT_DOS.txt | 164 + assets/calculations/qe7.2/INPUT_HP.txt | 355 ++ assets/calculations/qe7.2/INPUT_LD1.txt | 1269 +++++ assets/calculations/qe7.2/INPUT_OSCDFT.txt | 694 +++ assets/calculations/qe7.2/INPUT_PH.txt | 997 ++++ assets/calculations/qe7.2/INPUT_PP.txt | 623 +++ assets/calculations/qe7.2/INPUT_PROJWFC.txt | 350 ++ assets/calculations/qe7.2/INPUT_PW.txt | 4819 +++++++++++++++++++ deps/asset_init.jl | 13 + src/Calculations/Calculations.jl | 2 +- src/Calculations/calculation.jl | 105 +- src/Calculations/documentation.jl | 17 +- src/Calculations/qe.jl | 253 +- src/Display/printing.jl | 2 + src/FileIO/qe.jl | 392 +- src/Structures/atom.jl | 1 + test/constant_tests.jl | 5 +- test/display_tests.jl | 18 +- test/documentation_tests.jl | 2 +- 20 files changed, 9994 insertions(+), 247 deletions(-) create mode 100644 assets/calculations/qe7.2/INPUT_BANDS.txt create mode 100644 assets/calculations/qe7.2/INPUT_DOS.txt create mode 100644 assets/calculations/qe7.2/INPUT_HP.txt create mode 100644 assets/calculations/qe7.2/INPUT_LD1.txt create mode 100644 assets/calculations/qe7.2/INPUT_OSCDFT.txt create mode 100644 assets/calculations/qe7.2/INPUT_PH.txt create mode 100644 assets/calculations/qe7.2/INPUT_PP.txt create mode 100644 assets/calculations/qe7.2/INPUT_PROJWFC.txt create mode 100644 assets/calculations/qe7.2/INPUT_PW.txt diff --git a/assets/calculations/qe7.2/INPUT_BANDS.txt b/assets/calculations/qe7.2/INPUT_BANDS.txt new file mode 100644 index 00000000..8e4e6814 --- /dev/null +++ b/assets/calculations/qe7.2/INPUT_BANDS.txt @@ -0,0 +1,160 @@ +*** FILE AUTOMATICALLY CREATED: DO NOT EDIT, CHANGES WILL BE LOST *** + +------------------------------------------------------------------------ +INPUT FILE DESCRIPTION + +Program: bands.x / PWscf / Quantum ESPRESSO (version: 7.2) +------------------------------------------------------------------------ + + +Purpose of bands.x: + Re-order bands, computes band-related properties. Currently, + re-ordering can be done with two different algorithms: + (a) by maximising the overlap with bands at previous k-point + (b) by computing symmetry properties of each wavefunction + Bands-related properties that can be computed are currently + (a) The expectation value of the spin operator on each spinor + wave-function (noncolinear case only) + (b) The expectation value of p + +The input data can be read from standard input or from file using +command-line options "bands.x -i file-name" (same syntax as for pw.x) + +Output files: +- file "filband" containing the band structure, in a format + suitable for plotting code "plotband.x" +- file "filband".rap (if "lsym" is .t.) with symmetry information, + to be read by plotting code "plotband.x" +- if ("lsigma"(i)): file "filband".i, i=1,2,3, with expectation values + of the spin operator in the noncolinear case +- file "filband".gnu with bands in eV, directly plottable using gnuplot +- file "filp" with matrix elements of p (including the nonlocal potential + contribution i*m*[V_nl,x]) + +Structure of the input data: +============================ + + &BANDS + ... + / + + + +======================================================================== +NAMELIST: &BANDS + + +-------------------------------------------------------------------- + Variable: prefix + + Type: CHARACTER + Default: 'pwscf' + Description: prefix of files saved by program pw.x + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: outdir + + Type: CHARACTER + Description: directory containing the input data, i.e. the same as in pw.x + Default: value of the ESPRESSO_TMPDIR environment variable if set; + current directory ('./') otherwise + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: filband + + Type: CHARACTER + Default: 'bands.out' + Description: file name for band output (to be read by "plotband.x") + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: spin_component + + Type: INTEGER + Description: In the lsda case select: + + 1 = spin-up + 2 = spin-down + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lsigma(i), i=1,3 + + Type: LOGICAL + Description: If true computes expectation values of the spin operator + on the spinor wave-functions (only in the noncollinear case), + writes them to a file "filband".i, i=1,2,3 + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lp + + Type: LOGICAL + Default: .false. + Description: If .true. matrix elements of the momentum operator p between + conduction and valence bands are computed and written to file + specified in "filp". + The matrix elements include the contribution from the nonlocal + potential, i*m*[V_nl, x]. In other words, the calculated matrix elements + are those of the velocity operator i*m*[H, x] times mass, not those of + the true momentum operator. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: filp + + Type: CHARACTER + Default: 'p_avg.dat' + Description: If "lp" is set to .true., file name for matrix elements of p + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lsym + + Type: LOGICAL + Default: .true. + Description: If .true. the bands are classified according to the + irreducible representations of the small group of k. + A file "filband".rap with the same format of "filband" + is written, for usage by "plotband.x" + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: no_overlap + + Type: LOGICAL + Default: .true. + Description: If .false., and if "lsym" is .false., writes the eigenvalues + in the order that maximises overlap with the neighbor k-points + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: plot_2d + + Type: LOGICAL + Default: .false. + Description: If .true. writes the eigenvalues in the output file + in a 2D format readable by gnuplot. Band ordering is not + changed. Each band is written in a different file called + filband.# with the format: + + xk, yk, energy + xk, yk, energy + .. .. .. + + energies are written in eV and xk in units 2\pi/a. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: firstk, lastk + + Type: INTEGER + Description: if "lsym"=.true. makes the symmetry analysis only for k + points between firstk to lastk + +-------------------------------------------------------------------- + +===END OF NAMELIST====================================================== + + +This file has been created by helpdoc utility on Sat Mar 18 15:50:15 CET 2023 diff --git a/assets/calculations/qe7.2/INPUT_DOS.txt b/assets/calculations/qe7.2/INPUT_DOS.txt new file mode 100644 index 00000000..b8f0b76d --- /dev/null +++ b/assets/calculations/qe7.2/INPUT_DOS.txt @@ -0,0 +1,164 @@ +*** FILE AUTOMATICALLY CREATED: DO NOT EDIT, CHANGES WILL BE LOST *** + +------------------------------------------------------------------------ +INPUT FILE DESCRIPTION + +Program: dos.x / PWscf / Quantum ESPRESSO (version: 7.2) +------------------------------------------------------------------------ + + +Purpose of dos.x: + calculates the Density of States (DOS) + (separated into up and down components for DSDA) + + +Structure of the input data: +============================ + + &DOS + ... + / + +IMPORTANT: since v.5 namelist name is &DOS and no longer &INPUTPP + + + +======================================================================== +NAMELIST: &DOS + + +-------------------------------------------------------------------- + Variable: prefix + + Type: CHARACTER + Default: 'pwscf' + Description: prefix of input file produced by pw.x + (wavefunctions are not needed) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: outdir + + Type: CHARACTER + Description: directory containing the input data, i.e. the same as in pw.x + Default: value of the ESPRESSO_TMPDIR environment variable if set; + current directory ('./') otherwise + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: bz_sum + + Type: CHARACTER + Description: + Keyword selecting the method for BZ summation. Available options are: + + 'smearing' : + integration using gaussian smearing. In fact currently + any string not related to tetrahedra defaults to smearing; + + 'tetrahedra' : + Tetrahedron method, Bloechl's version: + P.E. Bloechl, PRB 49, 16223 (1994) + Requires uniform grid of k-points, to be + automatically generated in pw.x. + + 'tetrahedra_lin' : + Original linear tetrahedron method. + To be used only as a reference; + the optimized tetrahedron method is more efficient. + + 'tetrahedra_opt' : + Optimized tetrahedron method: + see M. Kawamura, PRB 89, 094515 (2014). + Default: 'smearing' if degauss is given in input; + options read from the xml data file otherwise. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: ngauss + + Type: INTEGER + Default: 0 + Status: optional + Description: Type of gaussian broadening: + + = 0 Simple Gaussian (default) + + = 1 Methfessel-Paxton of order 1 + + = -1 "cold smearing" (Marzari-Vanderbilt-DeVita-Payne) + + =-99 Fermi-Dirac function + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: degauss + + Type: REAL + Description: gaussian broadening, Ry (not eV!) + (see below) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: Emin, Emax + + Type: REAL + Default: band extrema + Description: min, max energy (eV) for DOS plot. If unspecified, the + lower and/or upper band value, plus/minus 3 times the + value of the gaussian smearing if present, will be used. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: DeltaE + + Type: REAL + Description: energy grid step (eV) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: fildos + + Type: CHARACTER + Default: '"prefix".dos' + Description: output file containing DOS(E) + +-------------------------------------------------------------------- + +===END OF NAMELIST====================================================== + + + +:::: Notes + + + ::: Output + + The total DOS (states/eV plotted vs E in eV) is written to file "fildos" + + + + ::: Important ! + + The tetrahedron method is used if + + - the input data file has been produced by pw.x using the option + occupations='tetrahedra', AND + + - a value for degauss is not given as input to namelist &dos + + + Gaussian broadening is used in all other cases: + + - if "degauss" is set to some value in namelist &DOS, that value + (and the optional value for "ngauss") is used + + - if "degauss" is NOT set to any value in namelist &DOS, the + value of "degauss" and of "ngauss" are read from the input data + file (they will be the same used in the pw.x calculations) + + - if "degauss" is NOT set to any value in namelist &DOS, AND + there is no value of "degauss" and of "ngauss" in the input data + file, "degauss"="DeltaE" (in Ry) and "ngauss"=0 will be used + + + +This file has been created by helpdoc utility on Sat Mar 18 15:50:15 CET 2023 diff --git a/assets/calculations/qe7.2/INPUT_HP.txt b/assets/calculations/qe7.2/INPUT_HP.txt new file mode 100644 index 00000000..88cb69e8 --- /dev/null +++ b/assets/calculations/qe7.2/INPUT_HP.txt @@ -0,0 +1,355 @@ +*** FILE AUTOMATICALLY CREATED: DO NOT EDIT, CHANGES WILL BE LOST *** + +------------------------------------------------------------------------ +INPUT FILE DESCRIPTION + +Program: hp.x / PWscf / Quantum Espresso (version: 7.2) +------------------------------------------------------------------------ + + +Input data format: { } = optional, [ ] = it depends, # = comment + +Structure of the input data: +=============================================================================== + +&INPUTHP + ... +/ + + + +======================================================================== +NAMELIST: &INPUTHP + + +-------------------------------------------------------------------- + Variable: prefix + + Type: CHARACTER + Default: 'pwscf' + Description: Prepended to input/output filenames; must be the same + used in the calculation of unperturbed system. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: outdir + + Type: CHARACTER + Default: value of the ESPRESSO_TMPDIR environment variable if set; + current directory ('./') otherwise + Description: Directory containing input, output, and scratch files; + must be the same as specified in the calculation of + the unperturbed system. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: iverbosity + + Type: INTEGER + Default: 1 + Description: = 1 : minimal output + = 2 : as above + symmetry matrices, final response + matrices chi0 and chi1 and their inverse matrices, + full U matrix + = 3 : as above + various detailed info about the NSCF + calculation at k and k+q + = 4 : as above + response occupation matrices at every + iteration and for every q point in the star + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: max_seconds + + Type: REAL + Default: 1.d7 + Description: Maximum allowed run time before the job stops smoothly. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: nq1, nq2, nq3 + + Type: INTEGER + Default: 1,1,1 + Description: Parameters of the Monkhorst-Pack grid (no offset). + Same meaning as for nk1, nk2, nk3 in the input of pw.x. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: skip_equivalence_q + + Type: LOGICAL + Default: .false. + Description: If .true. then the HP code will skip the equivalence + analysis of q points, and thus the full grid of q points + will be used. Otherwise the symmetry is used to determine + equivalent q points (star of q), and then perform + calculations only for inequivalent q points. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: determine_num_pert_only + + Type: LOGICAL + Default: .false. + See: find_atpert + Description: If .true. determines the number of perturbations + (i.e. which atoms will be perturbed) and exits smoothly + without performing any calculation. For DFT+U+V, it also + determines the indices of inter-site couples. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: determine_q_mesh_only + + Type: LOGICAL + Default: .false. + See: perturb_only_atom + Description: If .true. determines the number of q points + for a given perturbed atom and exits smoothly. + This keyword can be used only if perturb_only_atom + is set to .true. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: find_atpert + + Type: INTEGER + Default: 1 + Description: Method for searching of atoms which must be perturbed. + 1 = Find how many inequivalent Hubbard atoms there are + by analyzing unperturbed occupations. + 2 = Find how many Hubbard atoms to perturb based on + how many different Hubbard atomic types there are. + Warning: atoms which have the same type but which + are inequivalent by symmetry or which have different + occupations will not be distinguished in this case + (use option 1 or 3 instead). + 3 = Find how many inequivalent Hubbard atoms + there are using symmetry. Atoms which have the + same type but are not equivalent by symmetry will + be distinguished in this case. + 4 = Perturb all Hubbard atoms (the most expensive option) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: docc_thr + + Type: REAL + Default: 5.D-5 + Description: Threshold for a comparison of unperturbed occupations + which is needed for the selection of atoms which must + be perturbed. Can be used only when "find_atpert" = 1. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: skip_type(i), i=1,ntyp + + Type: LOGICAL + Default: skip_type(i) = .false. + See: equiv_type + Description: "skip_type"(i), where i runs over types of atoms. + If "skip_type"(i)=.true. then no linear-response + calculation will be performed for the i-th atomic type: + in this case "equiv_type"(i) must be specified, otherwise + the HP code will stop. This option is useful if the + system has atoms of the same type but opposite spin + pollarizations (anti-ferromagnetic case). + This keyword cannot be used when "find_atpert" = 1. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: equiv_type(i), i=1,ntyp + + Type: INTEGER + Default: equiv_type(i) = 0 + See: skip_type + Description: "equiv_type"(i), where i runs over types of atoms. + "equiv_type"(i)=j, will make type i equivalent to type j + (useful when nspin=2). Such a merging of types is done + only at the post-processing stage. + This keyword cannot be used when "find_atpert" = 1. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: perturb_only_atom(i), i=1,ntyp + + Type: LOGICAL + Default: perturb_only_atom(i) = .false. + See: compute_hp + Description: If "perturb_only_atom"(i)=.true. then only the i-th + atom will be perturbed and considered in the run. + This variable is useful when one wants to split + the whole calculation on parts. + + Note: this variable has a higher priority than "skip_type". + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: start_q + + Type: INTEGER + Default: 1 + See: last_q, sum_pertq + Description: Computes only the q points from "start_q" to "last_q". + + IMPORTANT: "start_q" must be smaller or equal to + the total number of q points found. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: last_q + + Type: INTEGER + Default: number of q points + See: start_q, sum_pertq + Description: Computes only the q points from "start_q" to "last_q". + + IMPORTANT: "last_q" must be smaller or equal to + the total number of q points found. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: sum_pertq + + Type: LOGICAL + Default: .false. + See: start_q, last_q, perturb_only_atom + Description: If it is set to .true. then the HP code will collect + pieces of the response occupation matrices for all + q points. This variable should be used only when + "start_q", "last_q" and "perturb_only_atom" are used. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: compute_hp + + Type: LOGICAL + Default: .false. + See: perturb_only_atom + Description: If it is set to .true. then the HP code will collect + pieces of the chi0 and chi matrices (which must have + been produced in previous runs) and then compute + Hubbard parameters. The HP code will look for files + tmp_dir/HP/prefix.chi.i.dat. Note that all files + prefix.chi.i.dat (where i runs over all perturbed + atoms) must be placed in one folder tmp_dir/HP/. + "compute_hp"=.true. must be used only when the + calculation was parallelized over perturbations. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: conv_thr_chi + + Type: REAL + Default: 1.D-5 + Description: Convergence threshold for the response function chi, + which is defined as a trace of the response + occupation matrix. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: thresh_init + + Type: REAL + Default: 1.D-14 + Description: Initial threshold for the solution of the linear + system (first iteration). Needed to converge the + bare (non-interacting) response function chi0. + The specified value will be multiplied by the + number of electrons in the system. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: ethr_nscf + + Type: REAL + Default: 1.D-11 + Description: Threshold for the convergence of eigenvalues during + the iterative diagonalization of the Hamiltonian in + the non-self-consistent-field (NSCF) calculation at + k and k+q points. Note, this quantity is NOT extensive. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: niter_max + + Type: INTEGER + Default: 100 + Description: Maximum number of iterations in the iterative + solution of the linear-response Kohn-Sham equations. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: alpha_mix(i) + + Type: REAL + Default: alpha_mix(1)=0.3 + Description: Mixing parameter (for the i-th iteration) for updating + the response SCF potential using the modified Broyden + method. See: D.D. Johnson, PRB 38, 12807 (1988). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: nmix + + Type: INTEGER + Default: 4 + Description: Number of iterations used in potential mixing + using the modified Broyden method. See: + D.D. Johnson, PRB 38, 12807 (1988). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: num_neigh + + Type: INTEGER + Default: 6 + Description: Number of nearest neighbors of every Hubbard atom which + will be considered when writting Hubbard V parameters to + the file parameters.out, which can be used in the + subsequent DFT+U+V calculation. This keyword is used only + for DFT+U+V (post-processing stage). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lmin + + Type: INTEGER + Default: 2 + Description: Minimum value of the orbital quantum number of the Hubbard + atoms starting from which (and up to the maximum l in the + system) Hubbard V will be written to the file parameters.out. + "lmin" refers to the orbital quantum number of the atom + corresponding to the first site-index in Hubbard_V(:,:,:). + This keyword is used only for DFT+U+V and only + in the post-processing stage. Example: "lmin"=1 corresponds to + writing to file V between e.g. oxygen (with p states) and its + neighbors, and including V between transition metals (with d + states) and their neighbors. Instead, when "lmin"=2 only the + latter will be written to parameters.out. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rmax + + Type: REAL + Default: 100.D0 + Description: Maximum distance (in Bohr) between two atoms to search + neighbors (used only at the postprocessing step for + DFT+U+V). This keyword is useful when there + are e.g. defects in the system. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: dist_thr + + Type: REAL + Default: 6.D-4 + Description: Threshold (in Bohr) for comparing inter-atomic distances + when reconstructing the missing elements of the response + susceptibility in the post-processing step. + +-------------------------------------------------------------------- + +===END OF NAMELIST====================================================== + + +This file has been created by helpdoc utility on Sat Mar 18 12:58:29 CET 2023 diff --git a/assets/calculations/qe7.2/INPUT_LD1.txt b/assets/calculations/qe7.2/INPUT_LD1.txt new file mode 100644 index 00000000..3b6e5ea8 --- /dev/null +++ b/assets/calculations/qe7.2/INPUT_LD1.txt @@ -0,0 +1,1269 @@ +*** FILE AUTOMATICALLY CREATED: DO NOT EDIT, CHANGES WILL BE LOST *** + +------------------------------------------------------------------------ +INPUT FILE DESCRIPTION + +Program: ld1.x / / Quantum ESPRESSO (version: 7.2) +------------------------------------------------------------------------ + + +Input data cards for ld1.x program: + +Always present: + 1 namelist &input + 1.1 optional cards for all-electron calculations + +Needed for PP generation: + 2 namelist &inputp + 2.1 additional cards for PP generation + +Needed for pseudo-potential (PP) test. optional for PP generation: + 3 namelist &test + 3.1 optional cards for PP test + + + +======================================================================== +NAMELIST: &INPUT + + THIS NAMELIST IS ALWAYS NEEDED ! + + +-------------------------------------------------------------------- + Variable: title + + Type: CHARACTER + Description: A string describing the job. + Status: OPTIONAL + +-------------------------------------------------------------------- + + ///--- + EITHER: + + +-------------------------------------------------------------------- + Variable: zed + + Type: REAL + See: atom + Description: The nuclear charge (1 < zed < 100). + + IMPORTANT: + Specify either "zed" OR "atom", not both! + +-------------------------------------------------------------------- + + OR: + + +-------------------------------------------------------------------- + Variable: atom + + Type: CHARACTER + See: zed + Description: Atomic symbol: atom='H', 'He', 'Be', etc. + + IMPORTANT: + Specify either "atom" OR "zed", not both! + +-------------------------------------------------------------------- + + \\\--- + + ///--- + RADIAL GRID PARAMETERS: + + +-------------------------------------------------------------------- + Variable: xmin + + Type: REAL + See: dx + Default: -7.0 if "iswitch">1 or "rel"=0, + -8.0 otherwise + Description: Radial grid parameter. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: dx + + Type: REAL + Description: Radial grid parameter. + + The radial grid is: r(i+1) = exp(xmin+i*dx)/zed a.u. + Default: 0.0125 if "iswitch">1, + 0.008 otherwise + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rmax + + Type: REAL + Description: Outermost grid point. + Default: 100.0 a.u. + +-------------------------------------------------------------------- + + \\\--- + + +-------------------------------------------------------------------- + Variable: beta + + Type: REAL + Description: parameter for potential mixing + Default: 0.2 + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: tr2 + + Type: REAL + Description: convergence threshold for scf + Default: 1e-14 + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: iswitch + + Type: INTEGER + Description: 1 all-electron calculation + 2 PP test calculation + 3 PP generation + 4 LDA-1/2 correction, needs a previously generated PP file + Default: 1 + +-------------------------------------------------------------------- + + ///--- + PARAMETERS FOR LOGARITHMIC DERIVATIVES: + + +-------------------------------------------------------------------- + Variable: nld + + Type: INTEGER + Description: the number of logarithmic derivatives to be calculated + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rlderiv + + Type: REAL + Description: radius (a.u.) at which logarithmic derivatives are calculated + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: eminld, emaxld + + Type: REAL + Description: Energy range (min, max energy, in Ry) at which + logarithmic derivatives are calculated. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: deld + + Type: REAL + Description: Delta e (Ry) of energy for logarithmic derivatives. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rpwe + + Type: REAL + Description: radius (a.u.) at which partial wave expansions are calculated + Default: rlderiv + +-------------------------------------------------------------------- + + If the above parameters are not specified, logarithmic + derivatives and partial wave expansions are not calculated. + + \\\--- + + +-------------------------------------------------------------------- + Variable: rel + + Type: INTEGER + Description: 0 ... non relativistic calculation + 1 ... scalar relativistic calculation + 2 ... full relativistic calculation with spin-orbit + Default: 0 for Z <= 18; + 1 for Z > 18 + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lsmall + + Type: LOGICAL + Default: .false. + Description: if .true. writes on files the small component + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: max_out_wfc + + Type: INTEGER + Default: 7 + Description: Maximum number of atomic wavefunctions written in the output + file. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: noscf + + Type: LOGICAL + Default: .false. + Description: if .true. the charge is not computed. The occupations are + not used and the eigenvalues and eigenfunctions are those + of a hydrogen-like atom. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lsd + + Type: INTEGER + Description: 0 ... non spin polarized calculation + 1 ... spin-polarized calculation + + BEWARE: + not allowed if "iswitch"=3 (PP generation) or with full + relativistic calculation + Default: 0 + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: dft + + Type: CHARACTER + Description: Exchange-correlation functional. + + Examples: + 'PZ' Perdew and Zunger formula for LDA + 'PW91' Perdew and Wang GGA + 'BP' Becke and Perdew GGA + 'PBE' Perdew, Becke and Ernzerhof GGA + 'BLYP' ... + + For the complete list, see module "functionals" in ../Modules/ + The default is 'PZ' for all-electron calculations, + it is read from the PP file in a PP calculation. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: latt + + Type: INTEGER + Description: 0 ... no Latter correction + 1 ... apply Latter correction + Default: 0 + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: isic + + Type: INTEGER + Description: 0 ... no Self-interaction correction + 1 ... apply Self-interaction correction + Default: 0 + Status: only for all-electron calculation + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rytoev_fact + + Type: REAL + Default: as specified in file Modules/constants.f90 + Description: Factor used to convert Ry into eV. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: cau_fact + + Type: REAL + Default: as specified in file Modules/constants.f90 + Description: Speed of light in a.u.. + + (Be careful the default value is always used in the + relativistic exchange.) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: vdw + + Type: LOGICAL + Default: .false. + Description: If .true., the frequency dependent polarizability and van der + Waals coefficient C6 will be computed in Thomas-Fermi and + von Weizsaecker approximation(only for closed-shell ions). + Status: Gradient-corrected DFT not yet implemented. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: prefix + + Type: CHARACTER + Default: 'ld1' + Description: Prefix for file names - only for output file names + containing the orbitals, logarithmic derivatives, tests + See below for file names and the content of the file. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: verbosity + + Type: CHARACTER + Default: 'low' + Description: 'low' or 'high' + + if 'high' with "iswitch"=2,3 prints separately core and + valence contributions to the energies. Print the + frozen-core energy. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: file_charge + + Type: CHARACTER + Default: ' ' + Description: Name of the file where the code writes the all-electron + total charge. No charge is written if file_charge=' '. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: config + + Type: CHARACTER + Default: ' ' + Description: A string with the electronic configuration. + + Example: + '[Ar] 3d10 4s2 4p2.5' + + * If "lsd"=1, spin-up and spin-down state may appear twice + with the respective occupancy: 3p4 3p2 = 4 up, + 2 down. Otherwise, the Hund's rule is assumed. + + * If "rel"=2, states with jj=l-1/2 are filled first. + If a state appears twice, the first one has jj=l-1/2, + the second one jj=l+1/2 (except S states) + (Use rel_dist if you want to average the electrons + over all available states.) + + * If config='default' the code uses "zed" to set the ground + state electronic configuration for the atom. + + Negative occupancies are used to flag unbound states; + they are not actually used. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: relpert + + Type: LOGICAL + Default: .false. + Description: If .true. the relativistic corrections to the non-relativistic + Kohn-Sham energy levels ("rel"=0 .and. "lsd"=0) are computed using + first-order perturbation theory in all-electron calculations. + The corrections consist of the following terms: + E_vel: velocity (p^4) correction + E_Dar: Darwin term + E_S-O: spin-orbit coupling + The spin-orbit term vanishes for s-electron states and gives + rise to a splitting of (2*l+1)*E_S-O for the other states. + The separate contributions are printed only if verbosity='high'. + + Formulas and notation are based on the Herman-Skillman book: + F. Herman and S. Skillman, "Atomic Structure Calculations", + Prentice-Hall, Inc., Englewood Cliffs, New Jersey, 1963 + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rel_dist + + Type: CHARACTER + Default: 'energy' + Description: 'energy' or 'average' + + * if 'energy' the relativistic l-1/2 states are filled first. + + * if 'average' the electrons are uniformly distributed + among all the states with the given l. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: write_coulomb + + Type: LOGICAL + Default: .false. + Description: If .true., a fake pseudo-potential file with name X.UPF, + where X is the atomic symbol, is written. It contains + the radial grid and the wavefunctions as specified in input, + plus the info needed to build the Coulomb potential + for an all-electron calculation - for testing only. + +-------------------------------------------------------------------- + +===END OF NAMELIST====================================================== + + +======================================================================== +CARD: + + IF CONFIG IS EMPTY THE ELECTRONIC CONFIGURATION IS READ FROM + THE FOLLOWING CARDS: + + ________________________________________________________________________ + * IF rel < 2 : + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + nwf + nl(1) n(1) l(1) oc(1) isw(1) + nl(2) n(2) l(2) oc(2) isw(2) + . . . + nl(nwf) n(nwf) l(nwf) oc(nwf) isw(nwf) + + ///////////////////////////////////////// + + + * ELSE IF rel = 2 : + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + nwf + nl(1) n(1) l(1) oc(1) jj(1) + nl(2) n(2) l(2) oc(2) jj(2) + . . . + nl(nwf) n(nwf) l(nwf) oc(nwf) jj(nwf) + + ///////////////////////////////////////// + + + ENDIF + ________________________________________________________________________ + + DESCRIPTION OF ITEMS: + + +-------------------------------------------------------------------- + Variable: nwf + + Type: INTEGER + Description: number of wavefunctions + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: nl + + Type: CHARACTER + Description: wavefunction label (e.g. 1s, 2s, etc.) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: n + + Type: INTEGER + Description: principal quantum number + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: l + + Type: INTEGER + Description: angular quantum number + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: oc + + Type: REAL + Description: occupation number + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: isw + + Type: INTEGER + Description: the spin index (1-2) used only in the lsda case + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: jj + + Type: REAL + Description: The total angular momentum (0.0 is allowed for complete + shells: the codes fills 2l states with jj=l-1/2, + 2l+2 with jj=l+1/2). + +-------------------------------------------------------------------- + +===END OF CARD========================================================== + + +======================================================================== +NAMELIST: &INPUTP + + +-------------------------------------------------------------------- + Variable: zval + + Type: REAL + Default: (calculated) + Description: Valence charge. + + zval is automatically calculated from available data. + If the value of zval is provided in input, it will be + checked versus the calculated value. The only case in + which you need to explicitly provide the value of zval + for noninteger zval (i.e. half core-hole pseudo-potentials). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: pseudotype + + Type: INTEGER + Description: 1 ... norm-conserving, single-projector PP + IMPORTANT: if pseudotype=1 all calculations are done + using the SEMILOCAL form, not the separable nonlocal form + + 2 ... norm-conserving PP in separable form (obsolescent) + All calculations are done using SEPARABLE non-local form + IMPORTANT: multiple projectors allowed but not properly + implemented, use only if you know what you are doing + + 3 ... ultrasoft PP or PAW + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: file_pseudopw + + Type: CHARACTER + Status: REQUIRED + Description: File where the generated PP is written. + + * if the file name ends with "upf" or "UPF", + or in any case for spin-orbit PP (rel=2), + the file is written in UPF format; + + * if the file name ends with 'psp' it is + written in native CPMD format (this is currently + an experimental feature); otherwise it is written + in the old "NC" format if pseudotype=1, or + in the old RRKJ format if pseudotype=2 or 3 + (no default, must be specified). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: file_recon + + Type: CHARACTER + Description: File containing data needed for GIPAW reconstruction + of all-electron wavefunctions from PP results. + If you want to use additional states to perform the + reconstruction, add them at the end of the list + of all-electron states. + Default: ' ' + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lloc + + Type: INTEGER + Default: -1 + Description: Angular momentum of the local channel. + + * lloc=-1 or lloc=-2 pseudizes the all-electron potential + if lloc=-2 the original recipe of Troullier-Martins + is used (zero first and second derivatives at r=0) + * lloc>-1 uses the corresponding channel as local PP + + NB: if lloc>-1, the corresponding channel must be the last in the + list of wavefunctions appearing after the namelist &inputp + In the relativistic case, if lloc > 0 both the j=lloc-1/2 and + the j=lloc+1/2 wavefunctions must be at the end of the list. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rcloc + + Type: REAL + Status: Must be specified only if "lloc"=-1, otherwise the + corresponding value of "rcut" is used. + Description: Matching radius (a.u.) for local pseudo-potential (no default). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: nlcc + + Type: LOGICAL + Default: .false. + Description: If .true. produce a PP with the nonlinear core + correction of Louie, Froyen, and Cohen + [PRB 26, 1738 (1982)]. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: new_core_ps + + Type: LOGICAL + Default: .false. + Status: requires nlcc=.true. + Description: If .true. pseudizes the core charge with bessel functions. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rcore + + Type: REAL + Description: Matching radius (a.u.) for the smoothing of the core charge. + If not specified, the matching radius is determined + by the condition: rho_core(rcore) = 2*rho_valence(rcore) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: tm + + Type: LOGICAL + Default: .false. + Description: * .true. for Troullier-Martins pseudization [PRB 43, 1993 (1991)] + + * .false. for Rappe-Rabe-Kaxiras-Joannopoulos pseudization + [PRB 41, 1227 (1990), erratum PRB 44, 13175 (1991)] + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rho0 + + Type: REAL + Description: Charge at the origin: when the Rappe-Rabe-Kaxiras-Joannopoulos + method with 3 Bessel functions fails, specifying rho0 > 0 + may allow to override the problem (using 4 Bessel functions). + Typical values are in the order of 0.01-0.02 + Default: 0.0 + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lpaw + + Type: LOGICAL + Description: If .true. produce a PAW dataset, experimental feature + only for "pseudotype"=3 + Default: .false. + +-------------------------------------------------------------------- + + ///--- + +-------------------------------------------------------------------- + Variable: which_augfun + + Type: CHARACTER + Default: 'AE' for Vanderbilt-Ultrasoft pseudo-potentials and 'BESSEL' for PAW datasets. + Description: If different from 'AE' the augmentation functions are pseudized + before "rmatch_augfun". The pseudization options are: + + * 'PSQ' Use Bessel functions to pseudize Q + from the origin to rmatch_augfun. + + These features are available only for PAW: + + * 'BESSEL' Use Bessel functions to pseudize the Q. + * 'GAUSS' Use 2 Gaussian functions to pseudize the Q. + * 'BG' Use original Bloechl's recipe with a single gaussian. + + Note: if lpaw is true and which_augfun is set to AE real all- + electron charge will be used, which will produce extremely + hard augmentation. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rmatch_augfun + + Type: REAL + Default: 0.5 a.u. + Status: Used only if which_augfun is different from 'AE'. + Description: Pseudization radius for the augmentation functions. Presently + it has the same value for all L. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rmatch_augfun_nc + + Type: REAL + Default: .false. + Status: Used only if which_augfun is 'PSQ'. + Description: If .true. the augmentation functions are pseudized + from the origin to min(rcut(ns),rcut(ns1)) where ns + and ns1 are the two channels for that Q. In this case + rmatch_augfun is not used. + +-------------------------------------------------------------------- + + \\\--- + + +-------------------------------------------------------------------- + Variable: lsave_wfc + + Type: LOGICAL + Default: .false. if .not. lpaw, otherwise .true. + Description: Set it to .true. to save all-electron and pseudo wavefunctions + used in the pseudo-potential generation in the UPF file. Only + works for UPFv2 format. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lgipaw_reconstruction + + Type: LOGICAL + Default: .false. + Description: Set it to .true. to generate pseudo-potentials containing the + additional info required for reconstruction of all-electron + orbitals, used by GIPAW. You will typically need to specify + additional projectors beyond those used in the generation of + pseudo-potentials. You should also specify "file_recon". + + All projectors used in the reconstruction must be listed BOTH + in the test configuration after namelist &test AND in the + all-electron configuration (variable 'config', namelist &inputp, + Use negative occupancies for projectors on unbound states). The + core radii in the test configuration should be the same as in + the pseudo-potential generation section and will be used as the + radius of reconstruction. Projectors not used to generate the + pseudo-potential should have zero occupation number. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: use_paw_as_gipaw + + Type: LOGICAL + Default: .false. + Description: When generating a PAW dataset, setting this option to .true. will + save the core all-electron wavefunctions to the UPF file. + The GIPAW reconstruction to be performed using the PAW data and + projectors for the valence wavefunctions. + + In the default case, the GIPAW valence wavefunction and projectors + are independent from the PAW ones and must be then specified as + explained above in lgipaw_reconstruction. + + Setting this to .true. always implies "lgipaw_reconstruction" = .true. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: author + + Type: CHARACTER + Description: Name of the author. + Default: 'anonymous' + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: file_chi + + Type: CHARACTER + Description: file containing output PP chi functions + Default: ' ' + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: file_beta + + Type: CHARACTER + Description: file containing output PP beta functions + Default: ' ' + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: file_qvan + + Type: CHARACTER + Description: file containing output PP qvan functions + Default: ' ' + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: file_screen + + Type: CHARACTER + Description: file containing output screening potential + Default: ' ' + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: file_core + + Type: CHARACTER + Description: file containing output total and core charge + Default: ' ' + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: file_wfcaegen + + Type: CHARACTER + Description: file with the all-electron wfc for generation + Default: ' ' + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: file_wfcncgen + + Type: CHARACTER + Description: file with the norm-conserving wfc for generation + Default: ' ' + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: file_wfcusgen + + Type: CHARACTER + Description: file with the ultra-soft wfc for generation + Default: ' ' + +-------------------------------------------------------------------- + +===END OF NAMELIST====================================================== + + +======================================================================== +CARD: + + ________________________________________________________________________ + * IF rel=0 OR rel=2 : + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + nwfs + nls(1) nns(1) lls(1) ocs(1) ener(1) rcut(1) rcutus(1) jjs(1) + nls(2) nns(2) lls(2) ocs(2) ener(2) rcut(2) rcutus(2) jjs(2) + . . . + nls(nwfs) nns(nwfs) lls(nwfs) ocs(nwfs) ener(nwfs) rcut(nwfs) rcutus(nwfs) jjs(nwfs) + + ///////////////////////////////////////// + + * if "lloc">-1 the state with "lls"="lloc" must be the last + + * if "lloc">0 in the relativistic case, both states with "jjs"="lloc"-1/2 + and "jjs"="lloc"+1/2 must be the last two + + + * ELSE : + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + nwfs + nls(1) nns(1) lls(1) ocs(1) ener(1) rcut(1) rcutus(1) + nls(2) nns(2) lls(2) ocs(2) ener(2) rcut(2) rcutus(2) + . . . + nls(nwfs) nns(nwfs) lls(nwfs) ocs(nwfs) ener(nwfs) rcut(nwfs) rcutus(nwfs) + + ///////////////////////////////////////// + + + ENDIF + ________________________________________________________________________ + + DESCRIPTION OF ITEMS: + + +-------------------------------------------------------------------- + Variable: nwfs + + Type: INTEGER + Description: number of wavefunctions to be pseudized + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: nls + + Type: CHARACTER + Description: Wavefunction label (same as in the all-electron configuration). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: nns + + Type: INTEGER + Description: Principal quantum number (referred to the PSEUDOPOTENTIAL case; + nns=1 for lowest s, nns=2 for lowest p, and so on). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lls + + Type: INTEGER + Description: Angular momentum quantum number. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: ocs + + Type: REAL + Description: Occupation number (same as in the all-electron configuration). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: ener + + Type: REAL + Description: Energy (Ry) used to pseudize the corresponding state. + If 0.d0, use the one-electron energy of the all-electron state. + Do not use 0.d0 for unbound states! + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rcut + + Type: REAL + Description: Matching radius (a.u.) for norm conserving PP. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rcutus + + Type: REAL + Description: Matching radius (a.u.) for ultrasoft PP - only for pseudotype=3. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: jjs + + Type: REAL + Description: The total angular momentum (0.0 is allowed for complete shells). + +-------------------------------------------------------------------- + +===END OF CARD========================================================== + + +======================================================================== +NAMELIST: &TEST + + NEEDED ONLY IF "ISWITCH"=2 OR "ISWITCH"=4, OPTIONAL IF "ISWITCH"=3 + + +-------------------------------------------------------------------- + Variable: nconf + + Type: INTEGER + Description: the number of configurations to be tested. For "iswitch"=4 nconf=2 + Default: 1 + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: file_pseudo + + Type: CHARACTER + Status: ignored if "iswitch"=3 + Description: File containing the PP. + + * If the file name contains ".upf" or ".UPF", + the file is assumed to be in UPF format; + + * else if the file name contains ".rrkj3" or ".RRKJ3", + the old RRKJ format is first tried; + + * otherwise, the old NC format is read. + + IMPORTANT: in the latter case, all calculations are done + using the SEMILOCAL form, not the separable nonlocal form. + Use the UPF format if you want to test the separable form! + Default: ' ' + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: ecutmin, ecutmax, decut + + Type: REAL + Default: decut=5.0 Ry; ecutmin=ecutmax=0Ry + Status: specify "ecutmin" and "ecutmax" if you want to perform this test + Description: Parameters (Ry) used for test with a basis set of spherical + Bessel functions j_l(qr) . The hamiltonian at fixed scf + potential is diagonalized for various values of ecut: + "ecutmin", "ecutmin"+"decut", "ecutmin"+2*"decut" ... up to "ecutmax". + This yields an indication of convergence with the + corresponding plane-wave cutoff in solids, and shows + in an unambiguous way if there are "ghost" states + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rm + + Type: REAL + Description: Radius of the box used with spherical Bessel functions. + Default: 30 a.u. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: configts(i), i=1,nconf + + Type: CHARACTER + Description: A string array containing the test electronic configuration. + "configts"(nc), nc=1,"nconf", has the same syntax as for "config" + but only VALENCE states must be included. + If "configts"(i) is not set, the electron configuration + is read from the cards following the namelist. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lsdts(i), i=1,nconf + + Type: INTEGER + Default: 1 + See: lsd + Description: 0 or 1. It is the value of lsd used in the i-th test. + Allows to make simultaneously spin-polarized and + spin-unpolarized tests. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: frozen_core + + Type: LOGICAL + Default: .false. + Description: If .true. only the core wavefunctions of the first + configuration are calculated. The eigenvalues, orbitals + and energies of the other configurations are calculated + with the core of the first configuration. + The first configuration must be spin-unpolarized. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rcutv + + Type: REAL + Description: Cutoff distance (CUT) for the inclusion of LDA-1/2 potential. + Needed (mandatory) only if "iswitch" = 4 + Default: -1.0 + +-------------------------------------------------------------------- + +===END OF NAMELIST====================================================== + + +======================================================================== +CARD: + + IMPORTANT: THIS CARD HAS TO BE SPECIFIED FOR EACH MISSING CONFIGTS(I) + + ________________________________________________________________________ + * IF lsd=1 : + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + nwfts + elts(1) nnts(1) llts(1) octs(1) enerts(1) rcutts(1) rcutusts(1) iswts(1) + elts(2) nnts(2) llts(2) octs(2) enerts(2) rcutts(2) rcutusts(2) iswts(2) + . . . + elts(nwfts) nnts(nwfts) llts(nwfts) octs(nwfts) enerts(nwfts) rcutts(nwfts) rcutusts(nwfts) iswts(nwfts) + + ///////////////////////////////////////// + + + * ELSE IF rel=2 : + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + nwfts + elts(1) nnts(1) llts(1) octs(1) enerts(1) rcutts(1) rcutusts(1) jjts(1) + elts(2) nnts(2) llts(2) octs(2) enerts(2) rcutts(2) rcutusts(2) jjts(2) + . . . + elts(nwfts) nnts(nwfts) llts(nwfts) octs(nwfts) enerts(nwfts) rcutts(nwfts) rcutusts(nwfts) jjts(nwfts) + + ///////////////////////////////////////// + + + * ELSE : + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + nwfts + elts(1) nnts(1) llts(1) octs(1) enerts(1) rcutts(1) rcutusts(1) + elts(2) nnts(2) llts(2) octs(2) enerts(2) rcutts(2) rcutusts(2) + . . . + elts(nwfts) nnts(nwfts) llts(nwfts) octs(nwfts) enerts(nwfts) rcutts(nwfts) rcutusts(nwfts) + + ///////////////////////////////////////// + + + ENDIF + ________________________________________________________________________ + + DESCRIPTION OF ITEMS: + + +-------------------------------------------------------------------- + Variable: nwfts + + Type: INTEGER + Description: number of wavefunctions + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: elts + + Type: CHARACTER + See: nls + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: nnts + + Type: INTEGER + See: nns + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: llts + + Type: INTEGER + See: lls + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: octs + + Type: REAL + See: ocs + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: enerts + + Type: REAL + Status: not used + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rcutts + + Type: REAL + Status: not used + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rcutusts + + Type: REAL + Status: not used + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: iswts + + Type: INTEGER + Description: spin index (1 or 2, used in lsda case) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: jjts + + Type: REAL + Description: total angular momentum of the state + +-------------------------------------------------------------------- + +===END OF CARD========================================================== + + + +:::: Notes + + For PP generation you do not need to specify namelist &test, UNLESS: + + 1. you want to use a different configuration for unscreening wrt the + one used to generate the PP. This is useful for PP with semicore + states: use semicore states ONLY to produce the PP, use semicore + AND valence states (if occupied) to make the unscreening + + 2. you want to specify some more states for PAW style reconstruction of + all-electron orbitals from pseudo-orbitals + + + ::: Output files written + + * file_tests "prefix".test results of transferability test + + for each testing configuration N: + + * file_wavefunctions "prefix"N.wfc all-electron KS orbitals + * file_wavefunctionsps "prefix"Nps.wfc pseudo KS orbitals + + if lsd=1: + + * file_wavefunctions "prefix"N.wfc.up all-electron KS up orbitals + * file_wavefunctions "prefix"N.wfc.dw all-electron KS down orbitals + + if rel=2 and lsmall=.true.: + + * file_wavefunctions "prefix".wfc.small all-electron KS small component + + if parameters for logarithmic derivatives are specified: + + * file_logder "prefix"Nps.dlog all-electron logarithmic derivatives + * file_logderps "prefix"Nps.dlog pseudo logarithmic derivatives + + "N" is not present if there is just one testing configuration. + + + + ::: Recipes to reproduce old all-electron atomic results with the ld1 program + + * The Hartree results in Phys. Rev. 59, 299 (1940) or in + Phys. Rev. 59, 306 (1940) can be reproduced with: + + rel=0, + isic=1, + dft='NOX-NOC' + + * The Herman-Skillman tables can be reproduced with: + + rel=0, + isic=0, + latt=1, + dft='SL1-NOC' + + * Data on the paper Liberman, Waber, Cromer Phys. Rev. 137, A27 (1965) can be + reproduced with: + + rel=2, + isic=0, + latt=1, + dft='SL1-NOC' + + * Data on the paper S. Cohen Phys. Rev. 118, 489 (1960) can be reproduced with: + + rel=2, + isic=1, + latt=0, + dft='NOX-NOC' + + * The revised PBE described in PRL 80, 890 (1998) can be obtained with: + + isic=0 + latt=0 + dft='SLA-PW-RPB-PBC' or 'dft='revPBE' + + * The relativistic energies of closed shell atoms reported in PRB 64 235126 (2001) + can be reproduced with: + + isic=0 + latt=0 + cau_fact=137.0359895 + dft='sla-vwn' for the LDA case + dft='PBE' for the PBE case + + * The NIST results in PRA 55, 191 (1997): + + LDA: + rel=0 + dft='sla-vwn' + + LSD: + rel=0 + lsd=1 + dft='sla-vwn' + + RLDA + rel=2 + rel_dist='average' + dft='rxc-vwn' + + ScRLDA: + rel=1 + dft='rxc-vwn' + + + +This file has been created by helpdoc utility on Sat Mar 18 13:46:52 CET 2023 diff --git a/assets/calculations/qe7.2/INPUT_OSCDFT.txt b/assets/calculations/qe7.2/INPUT_OSCDFT.txt new file mode 100644 index 00000000..40f7de37 --- /dev/null +++ b/assets/calculations/qe7.2/INPUT_OSCDFT.txt @@ -0,0 +1,694 @@ +*** FILE AUTOMATICALLY CREATED: DO NOT EDIT, CHANGES WILL BE LOST *** + +------------------------------------------------------------------------ +INPUT FILE DESCRIPTION + +Program: pw.x with OS-CDFT / PWscf / Quantum ESPRESSO (version: 7.2) +------------------------------------------------------------------------ + + + +:::: ABOUT + + OS-CDFT allows control of the oxidation state of a transition metal element by + constraining the occupation numbers. + For information on the method, see ""://doi.org/10.1021/acs.jctc.9b00281 + C. Ku, P. H. L. Sit, J. Chem. Theory Comput. 2019, 15, 9, 4781-4789 + + + +:::: COMPILATION + + Using autoconf: + ./configure ... + nano make.inc # append -D__OSCDFT into DFLAGS = ... (or MANUAL_DFLAGS = ...) + make pw pp ... + + Using cmake: + cmake -DQE_ENABLE_OSCDFT=ON ... + make pw pp ... + + + +:::: USAGE + + Requires oscdft.in file, described below, in the same directory as where the pw.x command is ran. + pw.x -inp -oscdft ... + + +Input data format: { } = optional, [ ] = it depends, | = or + +Structure of the oscdft.in file: +=============================================================================== + + &OSCDFT + ... + / + + TARGET_OCCUPATION_NUMBERS + see "TARGET_OCCUPATION_NUMBERS" + + [ GAMMA_VAL + gamma_val(1) + ... + gamma_val(n_oscdft) ] + + + +======================================================================== +NAMELIST: &OSCDFT + + +-------------------------------------------------------------------- + Variable: n_oscdft + + Type: INTEGER + Status: REQUIRED + Description: Number of entries of the "TARGET_OCCUPATION_NUMBERS" card. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: get_ground_state_first + + Type: LOGICAL + Default: .FALSE. + Description: If .TRUE., perform an scf calculation to convergence before applying constraint. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: warm_up_niter + + Type: INTEGER + Default: 0 + Description: Runs warm_up_niter scf iterations first before applying constraint. + If "get_ground_state_first" is .TRUE. then scf convergence is achieved first + before running "warm_up_niter" scf iterations without applying the constraints. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: convergence_type + + Type: CHARACTER + Default: 'gradient' + Description: + The variable that is checked for convergence with the convergence threshold. + + 'multipliers' : + Converges when the change in multipliers between iterations + is less than the threshold. + + 'gradient' : + Converges when (occupation number - target occupation number) + is less than the threshold. + + 'energy' : + Converges when the change in total energy between iterations + is less than the threshold. + + 'always_false' : + Never converges (for debugging). + + 'always_true' : + Always converges (for debugging). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: iteration_type + + Type: INTEGER + Status: REQUIRED + Description: + Order of charge density and OS-CDFT multipliers optimizations. + + 0 : + OS-CDFT multipliers optimization is a micro-iteration inside + the charge density iteration. The convergence threshold of the + OS-CDFT multipliers iterations can be set to start loose at + "max_conv_thr" and gradually tighten to a minimum of "min_conv_thr" + by multiplying the threshold with "conv_thr_multiplier" after + every successful OS-CDFT multipliers iteration. A final + convergence threshold of "final_conv_thr" can also be set + to prevent the charge density iteration from converging when + the OS-CDFT convergence test is larger than "final_conv_thr". + + 1 : + Charge density optimization is a micro-iteration inside the + OS-CDFT multiplier optimization. The convergence threshold of + the OS-CDFT multipliers is set by "max_conv_thr". + "min_conv_thr", "conv_thr_multiplier", and "final_conv_thr" are + ignored. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: optimization_method + + Type: CHARACTER + Default: 'gradient descent' + Description: + Method to update the OS-CDFT multipliers. + + 'gradient descent' : + multipliers -= "min_gamma_n" + * (occupation number - target occupation number) + + 'gradient descent2' : + multipliers -= "gamma_val" * "min_gamma_n" + * (occupation number - target occupation number) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: array_convergence_func + + Type: CHARACTER + Default: 'maxval' + Description: + Specify the method of multiple values to scalar for convergence test + when "convergence_type" is either 'gradient' or 'multipliers'. + + 'maxval' : + Takes the maximum of the "convergence_type" before comparing with + threshold. + + 'norm' : + Takes the root sum squared of the "convergence_type" before + comparing with threshold. + + 'rms' : + Takes the root mean squared of the "convergence_type" before + comparing with threshold. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: max_conv_thr + + Type: DOUBLE + Default: 1.D-1 + Description: If "iteration_type" is 0, this is the starting convergence threshold. + If "iteration_type" is 1, this is the convergence threshold. + See "iteration_type" for more explanations. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: min_conv_thr + + Type: DOUBLE + Default: 1.D-3 + Description: If "iteration_type" is 0, this is the minimum convergence threshold. + If "iteration_type" is 1, this is ignored. + See "iteration_type" for more explanations. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: final_conv_thr + + Type: DOUBLE + Default: -1.D0 + Description: If "iteration_type" is 0 and "final_conv_thr" > 0.D0, the charge density + convergence is prevented when the OS-CDFT convergence test is + larger than "final_conv_thr". Otherwise, this is ignored. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: conv_thr_multiplier + + Type: DOUBLE + Default: 0.5D0 + Description: If "iteration_type" is 0, see "iteration_type" for explanations. + Otherwise, this is ignored. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: print_occupation_matrix + + Type: LOGICAL + Default: .FALSE. + Description: If .TRUE., prints the occupation matrices. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: print_occupation_eigenvectors + + Type: LOGICAL + Default: .FALSE. + Description: If .TRUE., prints the occupation eigenvectors. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: min_gamma_n + + Type: DOUBLE + Default: 1.D0 + Description: Learning rate of optimizations. See "optimization_method". + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: has_min_multiplier + + Type: LOGICAL + Default: .FALSE. + Description: If .TRUE., sets the minimum value of the OS-CDFT multipliers + to "min_multiplier". + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: min_multiplier + + Type: DOUBLE + Status: REQUIRED if "has_min_multiplier" is .TRUE. + Description: Minimum value of the OS-CDFT multipliers. + Enabled using "has_min_multiplier" + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: has_max_multiplier + + Type: LOGICAL + Default: .FALSE. + Description: If .TRUE., sets the maximum value of the OS-CDFT multipliers + to "max_multiplier". + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: max_multiplier + + Type: DOUBLE + Status: REQUIRED if "has_max_multiplier" is .TRUE. + Description: Maximum value of the OS-CDFT multipliers. + Enabled using "has_max_multiplier" + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: miniter + + Type: INTEGER + Default: 0 + Description: Minimum OS-CDFT iterations. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: maxiter + + Type: INTEGER + Default: 0 + Description: Maximum OS-CDFT iterations. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: swapping_technique + + Type: CHARACTER + Default: 'none' + Description: + See ""://doi.org/10.1021/acs.jctc.9b00281 + + 'none' : + No swapping technique. + Always chooses the occupation number in ascending order. + + 'permute' : + Chooses the occupation number associated with the + occupation eigenvector that is most similar compared + to previous iteration (using dot product) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: print_debug + + Type: LOGICAL + Default: .FALSE. + Description: If .TRUE., prints additional debug informations. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: orthogonalize_swfc + + Type: LOGICAL + Default: .FALSE. + Description: If .TRUE., uses Lowdin orthogonalized atomic orbitals. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: normalize_swfc + + Type: LOGICAL + Default: .FALSE. + Description: If .TRUE., uses Lowdin normalized atomic orbitals. + Atomic orbitals are not orthogonalized in this case. + +-------------------------------------------------------------------- + +===END OF NAMELIST====================================================== + + +======================================================================== +CARD: TARGET_OCCUPATION_NUMBERS + + SPECIFIES THE OS-CDFT CONSTRAINT TO APPLY. + ALSO ALLOWS PRINTING OF OCCUPATION MATRIX WITHOUT APPLYING OS-CDFT CONSTRAINTS. + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + TARGET_OCCUPATION_NUMBERS + applied(1) spin(1) orbital_desc(1) [ constr_idx(1) target(1) start_mul(1) { start_index(1) } ] + applied(2) spin(2) orbital_desc(2) [ constr_idx(2) target(2) start_mul(2) { start_index(2) } ] + . . . + applied(n_oscdft) spin(n_oscdft) orbital_desc(n_oscdft) [ constr_idx(n_oscdft) target(n_oscdft) start_mul(n_oscdft) { start_index(n_oscdft) } ] + + ///////////////////////////////////////// + + DESCRIPTION OF ITEMS: + + +-------------------------------------------------------------------- + Variable: applied + + Type: CHARACTER + Status: REQUIRED + Description: + T : + Applies a constraint. + + "spin", "orbital_desc", "constr_idx", "target", + and "start_mul" are requried. + "spin" is optional. + + F : + Just prints the occupation number. + + Only "spin" and "orbital_desc" are requried. + Others are ignored. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: spin + + Type: CHARACTER + Status: REQUIRED + Description: + 1, UP : + Spin up channel + + 2, DOWN : + Spin down channel + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: orbital_desc + + Type: CHARACTER + Status: REQUIRED + Description: Orbitals included in the occupation number + + Syntax of the orbital descriptor: + atom_index(manifold...)... + + Where: + atom_index = atom index in the order of ATOMIC_POSITIONS + manifold = principal and azimuthal quantum numbers + (can specify more than one manifolds) + (eg. 3d, 2s2p) + + Examples: + 5(3d) describes a 5x5 occupation matrix which includes: + - 3d orbital of atom 5. + + 3(2s2p) describes a 4x4 occupation matrix which includes: + - 2s orbital of atom 3. + - 2p orbital of atom 3. + + Additional notes: See ADDITIONAL NOTES below. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: constr_idx + + Type: VARIOUS + Status: REQUIRED if "applied"(I) == T + Description: Specifies how the constraint is applied: + + To apply a constraint on an occupation number: + Write the index of the occupation numbers, sorted in ascending order, + where the OS-CDFT constraint is applied. + See "swapping_technique". + + Example: + Apply a constraint to the 5th spin-up occupation number of + the 3d orbital of atom 2 to a target of 0.9 + &OSCDFT + n_oscdft=1 + ... + / + TARGET_OCCUPATION_NUMBERS + T UP 2(3d) 5 0.9 0.0 + + To apply a constraint on the trace of the occupation matrix: + Write trace for this variable. + "swapping_technique" is ignored when this is used. + + Example: + Apply a constraint to the trace of the spin-up occupation number of + the 3d orbital of atom 2 to a target of 3.2 + &OSCDFT + n_oscdft=1 + ... + / + TARGET_OCCUPATION_NUMBERS + T UP 2(3d) trace 3.2 0.0 + + To apply a cosntraint on the sum of occupation numbers: + sum number orbital_index row_index(1) ... row_index(number-1) + Applies constraint on orbital_index-th occupation number + of the occupation matrix. + However, the occupation number inputted to the optimization subroutines + is the sum of this orbital index along with the occupation number of + row_index(1) ... row_index(number-1) + "swapping_technique" is ignored when this is used. + + Example: + Apply a constraint to the sum of the 3rd, 4th, and 5th + occupation numbers of the 3d orbital of atom 2 to a target of 2.8 + &OSCDFT + n_oscdft=3 + ... + / + TARGET_OCCUPATION_NUMBERS + T UP 2(3d) sum 3 3 2 3 2.8 0.0 + T UP 2(3d) sum 3 4 1 3 2.8 0.0 + T UP 2(3d) sum 3 5 1 2 2.8 0.0 + + Explanation: + Row 1: Applies constraint to 3rd occupation number. However, the multiplier is + optimized until the sum of the 3rd occupation number, along with the + occupation numbers of row 2 and row 3 of the "TARGET_OCCUPATION_NUMBERS" + card equals 2.8 + Row 2: Applies constraint to 4th occupation number. However, the multiplier is + optimized until the sum of the 4th occupation number, along with the + occupation numbers of row 1 and row 3 of the "TARGET_OCCUPATION_NUMBERS" + card equals 2.8 + Row 3: Applies constraint to 5th occupation number. However, the multiplier is + optimized until the sum of the 5th occupation number, along with the + occupation numbers of row 1 and row 2 of the "TARGET_OCCUPATION_NUMBERS" + card equals 2.8 + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: target + + Type: DOUBLE + Status: REQUIRED if "applied"(I) == T + Description: The target occupation number for the constraint. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: start_mul + + Type: DOUBLE + Status: REQUIRED if "applied"(I) == T + Description: Starting value of the multiplier. + For normal operations, set this to 0.D0. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: start_index + + Type: INTEGER + Default: 1 + Description: If "iteration_type" is 0, delays the application of this + row of OS-CDFT constraint until the rest of the constraint is + converged. Otherwise, this is ignored. + + Example ("n_oscdft" = 4): + TARGET_OCCUPATION_NUMBERS + T UP 3(3d) 5 0.9 0.0 1 + T UP 4(3d) 5 0.9 0.0 1 + T UP 5(3d) 5 0.9 0.0 2 + T UP 6(3d) 5 0.9 0.0 3 + The constraints on atom 3 and 4 are applied first until convergence. + Then, the constraints on atom 3, 4, and 5 are applied until convergence. + Finally, the constraints on atom 3, 4, 5, and 6 are applied until convergence. + +-------------------------------------------------------------------- + +===END OF CARD========================================================== + + +======================================================================== +CARD: GAMMA_VAL + + CONDITIONAL CARD, USED ONLY IF "OPTIMIZATION_METHOD" == 'GRADIENT DESCENT2', IGNORED OTHERWISE ! + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + GAMMA_VAL + gamma_val(1) + gamma_val(2) + . . . + gamma_val(n_oscdft) + + ///////////////////////////////////////// + + DESCRIPTION OF ITEMS: + + +-------------------------------------------------------------------- + Variable: gamma_val + + Type: DOUBLE + Status: REQUIRED if "optimization_method" == 'gradient descent2' + Description: This sets the learning rate for each multipliers, + allowing different learning rate for each multipliers. + See "optimization_method" for more details. + +-------------------------------------------------------------------- + +===END OF CARD========================================================== + + + +:::: ADDITIONAL NOTES + + 1. The default values are the recommeded options for "convergence_type" + and "array_convergence_func" + + 2. When using diagonalization='davidson', OS-CDFT may fail with + 'S matrix not positive definite' as an error. When that occurs, + use diagonalization='cg'. + + 3. Use "iteration_type"=0 for most cases. "iteration_type"=0 is faster, + due to the ability to gradually tighten the convergence threshold. + However, "iteration_type"=1 is more robust. + + 4. "orbital_desc" in the "TARGET_OCCUPATION_NUMBERS" card: + While one "orbital_desc" can be composed of multiple atoms, + the occupation number may not be accurate. + For example, 5(3d)6(2s2p) will be accepted, however the + atomic wavefunction of atom 5 and atom 6 may not be orthogonal. + (unless "orthogonalize_swfc" is .true.) + + + +:::: ADDITIONAL EXAMPLES FOR TARGET_OCCUPATION_NUMBERS + + Input File: + &OSCDFT + n_oscdft=2 + ... + / + TARGET_OCCUPATION_NUMBERS + T UP 5(3d) 5 0.9075202 0.0 + F DOWN 5(3d) + Explanations: + Row 1: Apply a constraint on the 5th spin-up occupation number of the + 3d orbital of atom 5 to a target of 0.9075202 + Row 2: Print the occupation numbers of the spin-down occupation numbers + of the 3d orbital of atom 5 + + + Input File: + &OSCDFT + n_oscdft=2 + ... + / + TARGET_OCCUPATION_NUMBERS + F UP 1(3d) + T DOWN 1(3d) 5 0.9369434 0.0 + F UP 2(3d) + T DOWN 2(3d) 5 0.261727 0.0 + Explanations: + Row 1: Print the occupation numbers of the spin-up occupation numbers of the + 3d orbital of atom 1 + Row 2: Apply a constraint on the 5th spin-down occupation number of the + 3d orbital of atom 1 to a target of 0.9369434 + Row 3: Print the occupation numbers of the spin-up occupation numbers of the + 3d orbital of atom 2 + Row 4: Apply a constraint on the 5th spin-down occupation number of the + 3d orbital of atom 2 to a target of 0.261727 + + + Input File: + &OSCDFT + n_oscdft=7 + ... + / + TARGET_OCCUPATION_NUMBERS + T UP 9(3d) sum 4 2 2 3 4 4.0135939 0.0 + T UP 9(3d) sum 4 3 1 3 4 4.0135939 0.0 + T UP 9(3d) sum 4 4 1 2 4 4.0135939 0.0 + T UP 9(3d) sum 4 5 1 2 3 4.0135939 0.0 + F DOWN 9(3d) + F UP 16(3d) + F DOWN 16(3d) + Explanations: + Row 1-4: Apply a constraint on the sum of the 2nd, 3rd, 4th, and 5th spin-up + occupation number of the 3d orbital of atom 9 to a target of 4.0135939 + Row 5 : Print the occupation numbers of the spin-down occupation numbers of the + 3d orbital of atom 9 + Row 6 : Print the occupation numbers of the spin-up occupation numbers of the + 3d orbital of atom 16 + Row 7 : Print the occupation numbers of the spin-down occupation numbers of the + 3d orbital of atom 16 + + + Input File: + &OSCDFT + n_oscdft=7 + ... + / + TARGET_OCCUPATION_NUMBERS + F UP 9(3d) + F DOWN 9(3d) + T UP 16(3d) sum 4 2 4 5 6 4.0135939 0.0 + T UP 16(3d) sum 4 3 3 5 6 4.0135939 0.0 + T UP 16(3d) sum 4 4 3 4 6 4.0135939 0.0 + T UP 16(3d) sum 4 5 3 4 5 4.0135939 0.0 + F DOWN 16(3d) + Explanations: + Row 1 : Print the occupation numbers of the spin-up occupation numbers of the + 3d orbital of atom 9 + Row 2 : Print the occupation numbers of the spin-down occupation numbers of the + 3d orbital of atom 9 + Row 3-6: Apply a constraint on the sum of the 2nd, 3rd, 4th, and 5th spin-up + occupation number of the 3d orbital of atom 16 to a target of 4.0135939 + Row 7 : Print the occupation numbers of the spin-down occupation numbers of the + 3d orbital of atom 16 + + + Input File: + &OSCDFT + n_oscdft=7 + ... + / + TARGET_OCCUPATION_NUMBERS + T UP 39(3d) sum 4 2 2 3 4 4.0135939 0.0 + T UP 39(3d) sum 4 3 1 3 4 4.0135939 0.0 + T UP 39(3d) sum 4 4 1 2 4 4.0135939 0.0 + T UP 39(3d) sum 4 5 1 2 3 4.0135939 0.0 + T DOWN 39(3d) sum 3 3 6 7 3.0020503 0.0 + T DOWN 39(3d) sum 3 4 5 7 3.0020503 0.0 + T DOWN 39(3d) sum 3 5 5 6 3.0020503 0.0 + Explanations: + Row 1-4: Apply a constraint on the sum of the 2nd, 3rd, 4th, and 5th spin-up + occupation number of the 3d orbital of atom 39 to a target of 4.0135939 + Row 5-7: Apply a constraint on the sum of the 3rd, 4th, and 5th spin-down + occupation number of the 3d orbital of atom 39 to a target of 3.0020503 + + +This file has been created by helpdoc utility on Sat Mar 18 16:00:16 CET 2023 diff --git a/assets/calculations/qe7.2/INPUT_PH.txt b/assets/calculations/qe7.2/INPUT_PH.txt new file mode 100644 index 00000000..f0ef7dd8 --- /dev/null +++ b/assets/calculations/qe7.2/INPUT_PH.txt @@ -0,0 +1,997 @@ +*** FILE AUTOMATICALLY CREATED: DO NOT EDIT, CHANGES WILL BE LOST *** + +------------------------------------------------------------------------ +INPUT FILE DESCRIPTION + +Program: ph.x / PHonon / Quantum ESPRESSO (version: 7.2) +------------------------------------------------------------------------ + + +Input data format: { } = optional, [ ] = it depends, # = comment + +Structure of the input data: +=============================================================================== + +title_line + +&INPUTPH + ... +/ + +[ xq(1) xq(2) xq(3) ] # if "ldisp" != .true. and "qplot" != .true. + +[ nqs # if "qplot" == .true. + xq(1,i) xq(2,i) xq(3,1) nq(1) + ... + xq(1,nqs) xq(2,nqs) xq(3,nqs) nq(nqs) ] + +[ atom(1) atom(2) ... atom(nat_todo) ] # if "nat_todo" was specified + + + +======================================================================== +Line of input: + + title_line + + + DESCRIPTION OF ITEMS: + + +-------------------------------------------------------------------- + Variable: title_line + + Type: CHARACTER + Description: Title of the job, i.e., a line that is reprinted on output. + +-------------------------------------------------------------------- + +===End of line-of-input================================================= + + +======================================================================== +NAMELIST: &INPUTPH + + +-------------------------------------------------------------------- + Variable: amass(i), i=1,ntyp + + Type: REAL + Default: 0.0 + Description: Atomic mass [amu] of each atomic type. + If not specified, masses are read from data file. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: outdir + + Type: CHARACTER + Default: value of the ESPRESSO_TMPDIR environment variable if set; + current directory ('./') otherwise + Description: Directory containing input, output, and scratch files; + must be the same as specified in the calculation of + the unperturbed system. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: prefix + + Type: CHARACTER + Default: 'pwscf' + Description: Prepended to input/output filenames; must be the same + used in the calculation of unperturbed system. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: niter_ph + + Type: INTEGER + Default: maxter=100 + Description: Maximum number of iterations in a scf step. If you want + more than 100, edit variable "maxter" in PH/phcom.f90 + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: tr2_ph + + Type: REAL + Default: 1e-12 + Description: Threshold for self-consistency. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: alpha_mix(niter) + + Type: REAL + Default: alpha_mix(1)=0.7 + Description: Mixing factor (for each iteration) for updating + the scf potential: + + vnew(in) = alpha_mix*vold(out) + (1-alpha_mix)*vold(in) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: nmix_ph + + Type: INTEGER + Default: 4 + Description: Number of iterations used in potential mixing. Using a larger value (8~20) + can significantly speed up convergence, at the cost of using more memory. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: verbosity + + Type: CHARACTER + Default: 'default' + Description: + Options are: + + 'debug', 'high', 'medium' : + verbose output + + 'low', 'default', 'minimal' : + short output + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: reduce_io + + Type: LOGICAL + Default: .false. + Description: Reduce I/O to the strict minimum. + + BEWARE: If the input flag "reduce_io"=.true. was + used, it is not allowed to restart from an interrupted + run. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: max_seconds + + Type: REAL + Default: 1.d7 + Description: Maximum allowed run time before the job stops smoothly. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: dftd3_hess + + Type: CHARACTER + Default: 'prefix.hess' + Description: File where the D3 dispersion hessian matrix is read. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: fildyn + + Type: CHARACTER + Default: 'matdyn' + Description: File where the dynamical matrix is written. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: fildrho + + Type: CHARACTER + Default: ' ' + Description: File where the charge density responses are written. Note that the file + will actually be saved as ${outdir}/_ph0/${prefix}.${fildrho}1 + where ${outdir}, ${prefix} and ${fildrho} are the values of the + corresponding input variables + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: fildvscf + + Type: CHARACTER + Default: ' ' + Description: File where the the potential variation is written + (for later use in electron-phonon calculation, see also fildrho). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: epsil + + Type: LOGICAL + Default: .false. + Description: If .true. in a q=0 calculation for a non metal the + macroscopic dielectric constant of the system is + computed. Do not set "epsil" to .true. if you have a + metallic system or q/=0: the code will complain and stop. + + Note: the input value of "epsil" will be ignored if "ldisp"=.true. + (the code will automatically set "epsil" to .false. for metals, + to .true. for insulators: see routine PHonon/PH/prepare_q.f90). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lrpa + + Type: LOGICAL + Default: .false. + Description: If .true. the dielectric constant is calculated at the + RPA level with DV_xc=0. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lnoloc + + Type: LOGICAL + Default: .false. + Description: If .true. the dielectric constant is calculated without + local fields, i.e. by setting DV_H=0 and DV_xc=0. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: trans + + Type: LOGICAL + Default: .true. + Description: If .false. the phonons are not computed. + If "trans" .and. "epsil" are both .true., + the effective charges are calculated. + If "ldisp" is .true., "trans"=.false. is overridden + (except for the case of electron-phonon calculations) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lraman + + Type: LOGICAL + Default: .false. + Description: If .true. calculate non-resonant Raman coefficients + using second-order response as in: + M. Lazzeri and F. Mauri, PRL 90, 036401 (2003). + +-------------------------------------------------------------------- + + ///--- + OPTIONAL VARIABLES FOR RAMAN: + + +-------------------------------------------------------------------- + Variable: eth_rps + + Type: REAL + Default: 1.0d-9 + Description: Threshold for calculation of Pc R |psi>. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: eth_ns + + Type: REAL + Default: 1.0e-12 + Description: Threshold for non-scf wavefunction calculation. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: dek + + Type: REAL + Default: 1.0e-3 + Description: Delta_xk used for wavefunction derivation wrt k. + +-------------------------------------------------------------------- + + \\\--- + + +-------------------------------------------------------------------- + Variable: recover + + Type: LOGICAL + Default: .false. + Description: If .true. restart from an interrupted run. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: low_directory_check + + Type: LOGICAL + Default: .false. + Description: If .true. search in the phsave directory only the + quantities requested in input. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: only_init + + Type: LOGICAL + Default: .false. + Description: If .true. only the bands and other initialization quantities are calculated. + (used for GRID parallelization) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: qplot + + Type: LOGICAL + Default: .false. + Description: If .true. a list of q points is read from input. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: q2d + + Type: LOGICAL + Default: .false. + Description: If .true. three q points and relative weights are + read from input. The three q points define the rectangle + q(:,1) + l (q(:,2)-q(:,1)) + m (q(:,3)-q(:,1)) where + 0< l,m < 1. The weights are integer and those of points two + and three are the number of points in the two directions. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: q_in_band_form + + Type: LOGICAL + Default: .false. + Description: This flag is used only when qplot is .true. and q2d is + .false.. When .true. each couple of q points q(:,i+1) and + q(:,i) define the line from q(:,i) to q(:,i+1) and nq + points are generated along that line. nq is the weigth of + q(:,i). When .false. only the list of q points given as + input is calculated. The weights are not used. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: electron_phonon + + Type: CHARACTER + Default: ' ' + Description: + Options are: + + 'simple' : + Electron-phonon lambda coefficients are computed + for a given q and a grid of k-points specified by + the variables "nk1", "nk2", "nk3", "k1", "k2", "k3". + + 'interpolated' : + Electron-phonon is calculated by interpolation + over the Brillouin Zone as in M. Wierzbowska, et + al. arXiv:cond-mat/0504077 + + 'lambda_tetra' : + The electron-phonon coefficient \lambda_{q \nu} + is calculated with the optimized tetrahedron method. + + 'gamma_tetra' : + The phonon linewidth \gamma_{q \nu} is calculated + from the electron-phonon interactions + using the optimized tetrahedron method. + + 'epa' : + Electron-phonon coupling matrix elements are written + to file prefix.epa.k for further processing by program + epa.x which implements electron-phonon averaged (EPA) + approximation as described in G. Samsonidze & B. Kozinsky, + Adv. Energy Mater. 2018, 1800246 doi:10.1002/aenm.201800246 + arXiv:1511.08115 + + 'ahc' : + Quantities required for the calculation of phonon-induced + electron self-energy are computed and written to the directory + "ahc_dir". The output files can be read by postahc.x for + the calculation of electron self-energy. + Available for both metals and insulators. + "trans"=.false. is required. + + For metals only, requires gaussian smearing (except for 'ahc'). + + If "trans"=.true., the lambdas are calculated in the same + run, using the same k-point grid for phonons and lambdas. + If "trans"=.false., the lambdas are calculated using + previously saved DeltaVscf in "fildvscf", previously saved + dynamical matrix, and the present punch file. This allows + the use of a different (larger) k-point grid. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: el_ph_nsigma + + Type: INTEGER + Default: 10 + Description: The number of double-delta smearing values used in an + electron-phonon coupling calculation. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: el_ph_sigma + + Type: REAL + Default: 0.02 + Description: The spacing between double-delta smearing values used in + an electron-phonon coupling calculation. + +-------------------------------------------------------------------- + + ///--- + VARIABLES FOR "ELECTRON_PHONON" = 'AHC': + + +-------------------------------------------------------------------- + Variable: ahc_dir + + Type: CHARACTER + Default: outdir // 'ahc_dir/' + Description: Directory where the output binary files are written. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: ahc_nbnd + + Type: INTEGER + Status: REQUIRED + Description: Number of bands for which the electron self-energy is to be computed. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: ahc_nbndskip + + Type: INTEGER + Default: 0 + Description: Number of bands to exclude when computing the self-energy. Self-energy + is computed for bands with indices from "ahc_nbndskip"+1 to + "ahc_nbndskip"+"ahc_nbnd". "ahc_nbndskip"+"ahc_nbnd" cannot + exceed nbnd of the preceding SCF or NSCF calculation. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: skip_upperfan + + Type: LOGICAL + Default: .false. + Description: If .true., skip calculation of the upper Fan self-energy, which + involves solving the Sternheimer equation. + +-------------------------------------------------------------------- + + \\\--- + + +-------------------------------------------------------------------- + Variable: lshift_q + + Type: LOGICAL + Default: .false. + Description: Use a wave-vector grid displaced by half a grid step + in each direction - meaningful only when ldisp is .true. + When this option is set, the q2r.x code cannot be used. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: zeu + + Type: LOGICAL + Default: zeu="epsil" + Description: If .true. in a q=0 calculation for a non metal the + effective charges are computed from the dielectric + response. This is the default algorithm. If "epsil"=.true. + and "zeu"=.false. only the dielectric tensor is calculated. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: zue + + Type: LOGICAL + Default: .false. + Description: If .true. in a q=0 calculation for a non metal the + effective charges are computed from the phonon + density responses. This is an alternative algorithm, + different from the default one (if "trans" .and. "epsil" ) + The results should be the same within numerical noise. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: elop + + Type: LOGICAL + Default: .false. + Description: If .true. calculate electro-optic tensor. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: fpol + + Type: LOGICAL + Default: .false. + Description: If .true. calculate dynamic polarizabilities + Requires "epsil"=.true. ( experimental stage: + see example09 for calculation of methane ). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: ldisp + + Type: LOGICAL + Default: .false. + Description: If .true. the run calculates phonons for a grid of + q-points specified by "nq1", "nq2", "nq3" - for direct + calculation of the entire phonon dispersion. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: nogg + + Type: LOGICAL + Default: .false. + Description: If .true. disable the "gamma_gamma" trick used to speed + up calculations at q=0 (phonon wavevector) if the sum over + the Brillouin Zone includes k=0 only. The gamma_gamma + trick exploits symmetry and acoustic sum rule to reduce + the number of linear response calculations to the strict + minimum, as it is done in code phcg.x. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: asr + + Type: LOGICAL + Default: .false. + Description: Apply Acoustic Sum Rule to dynamical matrix, effective charges + Works only in conjunction with "gamma_gamma" tricks (see above) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: ldiag + + Type: LOGICAL + Default: .false. + Description: If .true. forces the diagonalization of the dynamical + matrix also when only a part of the dynamical matrix + has been calculated. It is used together with "start_irr" + and "last_irr". If all modes corresponding to a + given irreducible representation have been calculated, + the phonon frequencies of that representation are + correct. The others are zero or wrong. Use with care. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lqdir + + Type: LOGICAL + Default: .false. + Description: If .true. ph.x creates inside outdir a separate subdirectory + for each q vector. The flag is set to .true. when "ldisp"=.true. + and "fildvscf" /= ' ' or when an electron-phonon + calculation is performed. The induced potential is saved + separately for each q inside the subdirectories. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: search_sym + + Type: LOGICAL + Default: .true. + Description: Set it to .false. if you want to disable the mode + symmetry analysis. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: nq1, nq2, nq3 + + Type: INTEGER + Default: 0,0,0 + Description: Parameters of the Monkhorst-Pack grid (no offset) used + when "ldisp"=.true. Same meaning as for nk1, nk2, nk3 + in the input of pw.x. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: nk1, nk2, nk3, k1, k2, k3 + + Type: INTEGER + Default: 0,0,0,0,0,0 + Description: When these parameters are specified the phonon program + runs a pw non-self consistent calculation with a different + k-point grid thant that used for the charge density. + This occurs even in the Gamma case. + "nk1", "nk2", "nk3" are the parameters of the Monkhorst-Pack grid + with offset determined by "k1", "k2", "k3". + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: diagonalization + + Type: CHARACTER + Default: 'david' + Description: + Diagonalization method for the non-SCF calculations. + + 'david' : + Davidson iterative diagonalization with overlap matrix + (default). Fast, may in some rare cases fail. + + 'cg' : + Conjugate-gradient-like band-by-band diagonalization. + Slower than 'david' but uses less memory and is + (a little bit) more robust. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: read_dns_bare + + Type: LOGICAL + Default: .false. + Description: If .true. the PH code tries to read three files in the DFPT+U + calculation: dns_orth, dns_bare, d2ns_bare. + dns_orth and dns_bare are the first-order variations of + the occupation matrix, while d2ns_bare is the second-order + variation of the occupation matrix. These matrices are + computed only once during the DFPT+U calculation. However, + their calculation (especially of d2ns_bare) is computationally + expensive, this is why they are written to file and then can be + read (e.g. for restart) in order to save time. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: ldvscf_interpolate + + Type: LOGICAL + Default: .false. + Description: If .true., use Fourier interpolation of phonon potential + to compute the induced part of phonon potential at each + q point. Results of a dvscf_q2r.x run is needed. + Requires "trans" = .false.. + +-------------------------------------------------------------------- + + ///--- + OPTIONAL VARIABLES FOR DVSCF INTERPOLATION: + + +-------------------------------------------------------------------- + Variable: wpot_dir + + Type: CHARACTER + Default: outdir // 'w_pot/' + Description: Directory where the w_pot binary files are written. + Must be the same with "wpot_dir" used in dvscf_q2r.x. + The real space potential files are stored in "wpot_dir" + with names ${prefix}.wpot.irc${irc}//"1". + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: do_long_range + + Type: LOGICAL + Default: .false. + Description: If .true., add the long-range part of the potential + to the Fourier interpolated potential as in: + S. Ponce et al, J. Chem. Phys. 143, 102813 (2015). + Reads dielectric matrix and Born effective charges from + the ${wpot_dir}/tensors.dat file, written in dvscf_q2r.x. + Currently, only the dipole (Frohlich) part is implemented. + The quadrupole part is not implemented. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: do_charge_neutral + + Type: LOGICAL + Default: .false. + Description: If .true., impose charge neutrality on the Born effective + charges. Used only if "do_long_range" = .true.. + +-------------------------------------------------------------------- + + \\\--- + + ///--- + SPECIFICATION OF IRREDUCIBLE REPRESENTATION + + +-------------------------------------------------------------------- + Variable: start_irr + + Type: INTEGER + Default: 1 + See: last_irr + Description: Perform calculations only from "start_irr" to "last_irr" + irreducible representations. + + IMPORTANT: + * "start_irr" must be <= 3*nat + * do not specify "nat_todo" together with + "start_irr", "last_irr" + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: last_irr + + Type: INTEGER + Default: 3*nat + See: start_irr + Description: Perform calculations only from "start_irr" to "last_irr" + irreducible representations. + + IMPORTANT: + * "start_irr" must be <= 3*nat + * do not specify "nat_todo" together with + "start_irr", "last_irr" + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: nat_todo + + Type: INTEGER + Default: 0, i.e. displace all atoms + Description: Choose the subset of atoms to be used in the linear response + calculation: "nat_todo" atoms, specified in input (see below) + are displaced. Can be used to estimate modes for a molecule + adsorbed over a surface without performing a full fledged + calculation. Use with care, at your own risk, and be aware + that this is an approximation and may not work. + IMPORTANT: + * "nat_todo" <= nat + * if linear-response is calculated for a given atom, it + should also be done for all symmetry-equivalent atoms, + or else you will get incorrect results + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: modenum + + Type: INTEGER + Default: 0 + Description: For single-mode phonon calculation : modenum is the index of the + irreducible representation (irrep) into which the reducible + representation formed by the 3*nat atomic displacements are + decomposed in order to perform the phonon calculation. + Note that a single-mode calculation will not give you the + frequency of a single phonon mode: in general, the selected + "modenum" is not an eigenvector. What you get on output is + a column of the dynamical matrix. + +-------------------------------------------------------------------- + + \\\--- + + ///--- + Q-POINT SPECIFICATION + + +-------------------------------------------------------------------- + Variable: start_q + + Type: INTEGER + Default: 1 + See: last_q + Description: Used only when ldisp=.true.. + Computes only the q points from "start_q" to "last_q". + + IMPORTANT: + * "start_q" must be <= "nqs" (number of q points found) + * do not specify "nat_todo" together with + "start_q", "last_q" + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: last_q + + Type: INTEGER + Default: number of q points + See: start_q + Description: Used only when "ldisp"=.true.. + Computes only the q points from "start_q" to "last_q". + + IMPORTANT + * "last_q" must be <= "nqs" (number of q points) + * do not specify "nat_todo" together with + "start_q", "last_q" + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: dvscf_star + + Type: STRUCTURE + Default: disabled + Description: It contains the following components: + + dvscf_star%open (logical, default: .false.) + dvscf_star%dir (character, default: outdir//"Rotated_DVSCF" or the + ESPRESSO_FILDVSCF_DIR environment variable) + dvscf_star%ext (character, default: "dvscf") the extension to use + for the name of the output files, see below + dvscf_star%basis (character, default: "cartesian") the basis on which + the rotated dvscf will be saved + dvscf_star%pat (logical, default: false) save an optional file with the + displacement patterns and q vector for each dvscf file + + IF dvscf_star%open is .true. use symmetry to compute and store the variation + of the self-consistent potential on every q* in the star of the present q. + + The rotated dvscf will then be stored in directory dvscf_star%dir with name + prefix.dvscf_star%ext.q_name//"1". Where q_name is derived from the coordinates + of the q-point, expressed as fractions in crystalline coordinates + (notice that ph.x reads q-points in cartesian coordinates). + E.g. q_cryst= (0, 0.5, -0.25) -> q_name = "0_1o2_-1o4" + + The dvscf can be represented on a basis of cartesian 1-atom displacements + (dvscf_star%basis='cartesian') or on the basis of the modes at the rotated q-point + (dvscf_star%basis='modes'). Notice that the el-ph wannier code requires 'cartesian'. + Each dvscf file comes with a corresponding pattern file with an additional ".pat" + suffix; this file contains information about the basis and the q-point of the dvscf. + + Note: rotating dvscf can require a large amount of RAM memory and can be i/o + intensive; in its current implementation all the operations are done + on a single processor. + Note2: this feature is currently untested with image parallelisation. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: drho_star + + Type: STRUCTURE + See: dvscf_star + Default: disabled + Description: It contains the following components: + + drho_star%open (logical, default: .false.) + drho_star%dir (character, default: outdir//"Rotated_DRHO" or the + ESPRESSO_FILDRHO_DIR environment variable) + drho_star%ext (character, default: "drho") the extension to use + for the name of the output files, see below + drho_star%basis (character, default: "modes") the basis on which + the rotated drho will be saved + drho_star%pat (logical, default: true) save an optional file with the + displacement patterns and q vector for each drho file + + Like "dvscf_star", but for the perturbation of the charge density. + Notice that the defaults are different. + +-------------------------------------------------------------------- + + \\\--- + +===END OF NAMELIST====================================================== + + +________________________________________________________________________ +* IF ldisp != .true. and qplot != .true. : + + ======================================================================== + Line of input: + + xq(1) xq(2) xq(3) + + + DESCRIPTION OF ITEMS: + + +-------------------------------------------------------------------- + Variables: xq(1) xq(2) xq(3) + + Type: REAL + Description: The phonon wavevector, in units of 2pi/a0 + (a0 = lattice parameter). + Not used if "ldisp"=.true. or "qplot"=.true. + +-------------------------------------------------------------------- + + + ===End of line-of-input================================================= + + + +* ELSE IF qplot == .true. : + + SPECIFICATION OF Q POINTS WHEN "QPLOT" == .TRUE. + + ======================================================================== + CARD: + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + nqs + xq1(1) xq2(1) xq3(1) nq(1) + xq1(2) xq2(2) xq3(2) nq(2) + . . . + xq1(nqs) xq2(nqs) xq3(nqs) nq(nqs) + + ///////////////////////////////////////// + + DESCRIPTION OF ITEMS: + + +-------------------------------------------------------------------- + Variable: nqs + + Type: INTEGER + Description: Number of q points in the list. Used only if "qplot"=.true. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: xq1, xq2, xq3 + + Type: REAL + Description: q-point coordinates; used only with "ldisp"=.true. and qplot=.true. + The phonon wavevector, in units of 2pi/a0 (a0 = lattice parameter). + The meaning of these q points and their weights nq depend on the + flags q2d and q_in_band_form. (NB: nq is integer) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: nq + + Type: INTEGER + Description: The weight of the q-point; the meaning of nq depends + on the flags q2d and q_in_band_form. + +-------------------------------------------------------------------- + + ===END OF CARD========================================================== + + + +ENDIF +________________________________________________________________________ + +________________________________________________________________________ +* IF nat_todo was specified : + + ======================================================================== + Line of input: + + atom(1) atom(2) ... atom(nat_todo) + + + DESCRIPTION OF ITEMS: + + +-------------------------------------------------------------------- + Variables: atom(1) atom(2) ... atom(nat_todo) + + Type: INTEGER + Description: Contains the list of indices of atoms used in the + calculation if "nat_todo" is specified. + +-------------------------------------------------------------------- + + + ===End of line-of-input================================================= + + + +ENDIF +________________________________________________________________________ + + +:::: ADDITIONAL INFORMATION + + NB: The program ph.x writes on the tmp_dir/_ph0/{prefix}.phsave directory + a file for each representation of each q point. This file is called + dynmat.#iq.#irr.xml where #iq is the number of the q point and #irr + is the number of the representation. These files contain the + contribution to the dynamical matrix of the irr representation for the + iq point. + + If "recover"=.true. ph.x does not recalculate the + representations already saved in the tmp_dir/_ph0/{prefix}.phsave + directory. Moreover ph.x writes on the files patterns.#iq.xml in the + tmp_dir/_ph0/{prefix}.phsave directory the displacement patterns that it + is using. If "recover"=.true. ph.x does not recalculate the + displacement patterns found in the tmp_dir/_ph0/{prefix}.phsave directory. + + This mechanism allows: + + 1) To recover part of the ph.x calculation even if the recover file + or files are corrupted. You just remove the _ph0/{prefix}.recover + files from the tmp_dir directory. You can also remove all the _ph0 + files and keep only the _ph0/{prefix}.phsave directory. + + 2) To split a phonon calculation into several jobs for different + machines (or set of nodes). Each machine calculates a subset of + the representations and saves its dynmat.#iq.#irr.xml files on + its tmp_dir/_ph0/{prefix}.phsave directory. Then you collect all the + dynmat.#iq.#irr.xml files in one directory and run ph.x to + collect all the dynamical matrices and diagonalize them. + + NB: To split the q points in different machines, use the input + variables start_q and last_q. To split the irreducible + representations, use the input variables "start_irr", "last_irr". Please + note that different machines will use, in general, different + displacement patterns and it is not possible to recollect partial + dynamical matrices generated with different displacement patterns. A + calculation split into different machines will run as follows: A + preparatory run of ph.x with "start_irr"=0, "last_irr"=0 produces the sets + of displacement patterns and save them on the patterns.#iq.xml files. + These files are copied in all the tmp_dir/_ph0/{prefix}.phsave directories + of the machines where you plan to run ph.x. ph.x is run in different + machines with complementary sets of start_q, last_q, "start_irr" and + "last_irr" variables. All the files dynmat.#iq.#irr.xml are + collected on a single tmp_dir/_ph0/{prefix}.phsave directory (remember to + collect also dynmat.#iq.0.xml). A final run of ph.x in this + machine collects all the data contained in the files and diagonalizes + the dynamical matrices. This is done requesting a complete dispersion + calculation without using start_q, last_q, "start_irr", or "last_irr". + See an example in examples/GRID_example. + + On parallel machines the q point and the irreps calculations can be split + automatically using the -nimage flag. See the phonon user guide for further + information. + + +This file has been created by helpdoc utility on Sat Mar 18 19:08:12 CET 2023 diff --git a/assets/calculations/qe7.2/INPUT_PP.txt b/assets/calculations/qe7.2/INPUT_PP.txt new file mode 100644 index 00000000..ba667a82 --- /dev/null +++ b/assets/calculations/qe7.2/INPUT_PP.txt @@ -0,0 +1,623 @@ +*** FILE AUTOMATICALLY CREATED: DO NOT EDIT, CHANGES WILL BE LOST *** + +------------------------------------------------------------------------ +INPUT FILE DESCRIPTION + +Program: pp.x / PWscf / Quantum ESPRESSO (version: 7.2) +------------------------------------------------------------------------ + + +Purpose of pp.x: data analysis and plotting. + +The code performs two steps: + +(1) reads the output produced by pw.x, extracts and calculates + the desired quantity/quantities (rho, V, ...) + +(2) writes the desired quantity to file in a suitable format for + various types of plotting and various plotting programs + +The input data of this program is read from standard input +or from file and has the following format: + +NAMELIST &INPUTPP + containing the variables for step (1), followed by + +NAMELIST &PLOT + containing the variables for step (2) + +The two steps can be performed independently. In order to perform +only step (2), leave namelist &INPUTPP blank. In order to perform +only step (1), do not specify namelist &PLOT + +Intermediate results from step 1 can be saved to disk (see +variable "filplot" in &INPUTPP) and later read in step 2. +Since the file with intermediate results is formatted, it +can be safely transferred to a different machine. This +also allows plotting of a linear combination (for instance, +charge differences) by saving two intermediate files and +combining them (see variables "weight" and "filepp" in &PLOT) + +All output quantities are in ATOMIC (RYDBERG) UNITS unless +otherwise explicitly specified. +All charge densities integrate to the NUMBER of electrons +not to the total charge. +All potentials have the dimension of an energy (e*V, not V). + + + +======================================================================== +NAMELIST: &INPUTPP + + +-------------------------------------------------------------------- + Variable: prefix + + Type: CHARACTER + Description: prefix of files saved by program pw.x + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: outdir + + Type: CHARACTER + Description: directory containing the input data, i.e. the same as in pw.x + Default: value of the ESPRESSO_TMPDIR environment variable if set; + current directory ('./') otherwise + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: filplot + + Type: CHARACTER + Description: file "filplot" contains the quantity selected by plot_num + (can be saved for further processing) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: plot_num + + Type: INTEGER + Description: Selects what to save in filplot: + + 0 = electron (pseudo-)charge density + + 1 = total potential V_bare + V_H + V_xc + + 2 = local ionic potential V_bare + + 3 = local density of states at specific energy or grid of energies + (number of states per volume, in bohr^3, per energy unit, in Ry) + + 4 = local density of electronic entropy + + 5 = STM images + Tersoff and Hamann, PRB 31, 805 (1985) + + 6 = spin polarization (rho(up)-rho(down)) + + 7 = contribution of selected wavefunction(s) to the + (pseudo-)charge density. For norm-conserving PPs, + |psi|^2 (psi=selected wavefunction). Noncollinear case: + contribution of the given state to the charge or + to the magnetization along the direction indicated + by spin_component (0 = charge, 1 = x, 2 = y, 3 = z ) + + 8 = electron localization function (ELF) + + 9 = charge density minus superposition of atomic densities + + 10 = integrated local density of states (ILDOS) + from "emin" to "emax" (emin, emax in eV) + if "emax" is not specified, "emax"=E_fermi + + 11 = the V_bare + V_H potential + + 12 = the sawtooth electric field potential (if present) + + 13 = the noncollinear magnetization. + + 17 = all-electron valence charge density + can be performed for PAW calculations only + requires a very dense real-space grid! + + 18 = The exchange and correlation magnetic field in the noncollinear case + + 19 = Reduced density gradient + ( J. Chem. Theory Comput. 7, 625 (2011), doi:10.1021/ct100641a ) + Set the isosurface between 0.3 and 0.6 to plot the + non-covalent interactions (see also plot_num = 20) + + 20 = Product of the electron density (charge) and the second + eigenvalue of the electron-density Hessian matrix; + used to colorize the RDG plot (plot_num = 19) + + 21 = all-electron charge density (valence+core). + For PAW calculations only; requires a very dense real-space grid. + + 22 = kinetic energy density (for meta-GGA and XDM only) + + 123 = DORI: density overlap regions indicator + (doi: 10.1021/ct500490b) Implemented by D. Yang & Q.Liu + +-------------------------------------------------------------------- + + ________________________________________________________________________ + * IF plot_num = 0 or 9 : + + OPTIONS FOR TOTAL CHARGE (PLOT_NUM=0) + OR FOR TOTAL MINUS ATOMIC CHARGE (PLOT_NUM=9): + + +-------------------------------------------------------------------- + Variable: spin_component + + Type: INTEGER + Default: 0 + Description: 0 = total charge (default value), + 1 = spin up charge, + 2 = spin down charge. + +-------------------------------------------------------------------- + + + * ELSE IF plot_num=1 : + + OPTIONS FOR TOTAL POTENTIAL (PLOT_NUM=1): + + +-------------------------------------------------------------------- + Variable: spin_component + + Type: INTEGER + Default: 0 + Description: 0 = spin averaged potential (default value), + 1 = spin up potential, + 2 = spin down potential. + +-------------------------------------------------------------------- + + + * ELSE IF plot_num=3 : + + OPTIONS FOR LDOS (PLOT_NUM=3): + LDOS IS PLOTTED ON GRID [EMIN, EMAX] WITH SPACING DELTA_E. + + +-------------------------------------------------------------------- + Variable: emin + + Type: REAL + Default: e_fermi + Description: lower boundary of energy grid (in eV). + + Defaults to Fermi energy. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: emax + + Type: REAL + Status: OPTIONAL + Description: upper boundary of energy grid (in eV). + + Defaults to Fermi energy. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: delta_e + + Type: REAL + Default: 0.1 + Status: OPTIONAL + Description: spacing of energy grid (in eV). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: degauss_ldos + + Type: REAL + Default: degauss (converted to eV) + Status: OPTIONAL + Description: broadening of energy levels for LDOS (in eV). + + Defaults to broadening degauss specified for electronic smearing + in pw.x calculation. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: use_gauss_ldos + + Type: LOGICAL + Default: .false. + Status: OPTIONAL + Description: If .true., gaussian broadening (ngauss=0) is used for LDOS calculation. + + Defaults .false., in which case the broadening scheme + of the pw.x calculation will be used. + +-------------------------------------------------------------------- + + + * ELSE IF plot_num=5 : + + OPTIONS FOR STM IMAGES (PLOT_NUM=5): + + +-------------------------------------------------------------------- + Variable: sample_bias + + Type: REAL + Description: the bias of the sample (Ry) in stm images + +-------------------------------------------------------------------- + + + * ELSE IF plot_num=7 : + + OPTIONS FOR |PSI|^2 (PLOT_NUM=7): + + +-------------------------------------------------------------------- + Variable: kpoint(i), i=1,2 + + Type: INTEGER + Description: Unpolarized and noncollinear case: + k-point(s) to be plotted + LSDA: + k-point(s) and spin polarization to be plotted + (spin-up and spin-down correspond to different k-points!) + + To plot a single kpoint ikpt, specify kpoint=ikpt or kpoint(1)=ikpt + To plot a range of kpoints [imin, imax], specify kpoint(1)=imin and kpoint(2)=imax + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: kband(i), i=1,2 + + Type: INTEGER + Description: Band(s) to be plotted. + + To plot a single band ibnd, specify kband=ibnd or kband(1)=ibnd + To plot a range of bands [imin, imax], specify kband(1)=imin and kband(2)=imax + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lsign + + Type: LOGICAL + Description: if true and k point is Gamma, plot |psi|^2 sign(psi) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: spin_component(i), i=1,2 + + Type: INTEGER + Default: 0 + Status: OPTIONAL + Description: Noncollinear case only: + plot the contribution of the given state(s) to the charge + or to the magnetization along the direction(s) indicated + by spin_component: + 0 = charge (default), + 1 = x, + 2 = y, + 3 = z. + + Ignored in unpolarized or LSDA case + + To plot a single component ispin, specify spin_component=ispin or spin_component(1)=ispin + To plot a range of components [imin, imax], specify spin_component(1)=imin and spin_component(2)=imax + +-------------------------------------------------------------------- + + + * ELSE IF plot_num=10 : + + OPTIONS FOR ILDOS (PLOT_NUM=10): + + +-------------------------------------------------------------------- + Variable: emin + + Type: REAL + Description: lower energy boundary (in eV) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: emax + + Type: REAL + Description: upper energy boundary (in eV), + i.e. compute ILDOS from "emin" to "emax" + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: spin_component + + Type: INTEGER + Default: 0 + Description: for LSDA case only: plot the contribution to ILDOS of + 0 = spin-up + spin-down (default) + 1 = spin-up only + 2 = spin-down only + +-------------------------------------------------------------------- + + + * ELSE IF plot_num=13 : + + OPTIONS FOR NONCOLLINEAR MAGNETIZATION (PLOT_NUM=13): + + +-------------------------------------------------------------------- + Variable: spin_component + + Type: INTEGER + Default: 0 + Description: 0 = absolute value (default value) + 1 = x component of the magnetization + 2 = y component of the magnetization + 3 = z component of the magnetization + +-------------------------------------------------------------------- + + + * ELSE IF plot_num=17 : + + OPTIONS FOR RECONSTRUCTED CHARGE DENSITY (PLOT_NUM=17): + + +-------------------------------------------------------------------- + Variable: spin_component + + Type: INTEGER + Default: 0 + Description: 0 = total charge (default value), + 1 = spin up charge, + 2 = spin down charge. + +-------------------------------------------------------------------- + + + * ELSE IF plot_num=22 : + + OPTIONS FOR KINETIC ENERGY DENSITY (PLOT_NUM=22), + LSDA CASE ONLY: + + +-------------------------------------------------------------------- + Variable: spin_component + + Type: INTEGER + Default: 0 + Description: 0 = total density (default value), + 1 = spin up density, + 2 = spin down density. + +-------------------------------------------------------------------- + + + ENDIF + ________________________________________________________________________ + +===END OF NAMELIST====================================================== + + +======================================================================== +NAMELIST: &PLOT + + +-------------------------------------------------------------------- + Variable: nfile + + Type: INTEGER + Default: 1 + Status: OPTIONAL + Description: the number of data files to read + +-------------------------------------------------------------------- + + ///--- + +-------------------------------------------------------------------- + Variable: filepp(i), i=1,nfile + + Type: CHARACTER + Default: filepp(1)=filplot + Description: nfile = 1 : file containing the quantity to be plotted + nfile > 1 : see "weight" + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: weight(i), i=1,nfile + + Type: REAL + Default: weight(1)=1.0 + Description: weighing factors: assuming that rho(i) is the quantity + read from filepp(i), the quantity that will be plotted is: + + weight(1)*rho(1) + weight(2)*rho(2) + weight(3)*rho(3) + ... + +-------------------------------------------------------------------- + + BEWARE: atomic coordinates are read from the first file; + if their number is different for different files, + the first file must have the largest number of atoms + + \\\--- + + +-------------------------------------------------------------------- + Variable: iflag + + Type: INTEGER + Description: 0 = 1D plot of the spherical average + 1 = 1D plot + 2 = 2D plot + 3 = 3D plot + 4 = 2D polar plot on a sphere + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: output_format + + Type: INTEGER + Description: (ignored on 1D plot) + + 0 = format suitable for gnuplot (1D) + + 1 = obsolete format no longer supported + + 2 = format suitable for plotrho (2D) + + 3 = format suitable for XCRYSDEN (2D or user-supplied 3D region) + + 4 = obsolete format no longer supported + + 5 = format suitable for XCRYSDEN (3D, using entire FFT grid) + + 6 = format as gaussian cube file (3D) + (can be read by many programs) + + 7 = format suitable for gnuplot (2D) x, y, f(x,y) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: fileout + + Type: CHARACTER + Default: standard output + Description: name of the file to which the plot is written + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: interpolation + + Type: CHARACTER + Default: 'fourier' + Description: + Type of interpolation: + 'fourier' + + 'bspline' : + (EXPERIMENTAL) + +-------------------------------------------------------------------- + + ________________________________________________________________________ + * IF iflag = 0 or 1 : + + THE FOLLOWING VARIABLES ARE REQUIRED: + + +-------------------------------------------------------------------- + Variable: e1(i), i=1,3 + + Type: REAL + Description: 3D vector which determines the plotting line (in alat units) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: x0(i), i=1,3 + + Type: REAL + Description: 3D vector, origin of the line (in alat units) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: nx + + Type: INTEGER + Description: number of points in the line: + + rho(i) = rho( x0 + e1 * (i-1)/(nx-1) ), i=1, nx + +-------------------------------------------------------------------- + + + * ELSE IF iflag = 2 : + + THE FOLLOWING VARIABLES ARE REQUIRED: + + +-------------------------------------------------------------------- + Variables: e1(i), e2(i), i=1,3 + + Type: REAL + Description: 3D vectors which determine the plotting plane (in alat units) + + BEWARE: e1 and e2 must be orthogonal + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: x0(i), i=1,3 + + Type: REAL + Description: 3D vector, origin of the plane (in alat units) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: nx, ny + + Type: INTEGER + Description: Number of points in the plane: + + rho(i,j) = rho( x0 + e1 * (i-1)/(nx-1) + + e2 * (j-1)/(ny-1) ), i=1,nx ; j=1,ny + +-------------------------------------------------------------------- + + + * ELSE IF iflag = 3 : + + THE FOLLOWING VARIABLES ARE OPTIONAL: + + +-------------------------------------------------------------------- + Variables: e1(i), e2(i), e3(i), i=1,3 + + Type: REAL + Description: 3D vectors which determine the plotting parallelepiped + (if present, must be orthogonal) + + "e1", "e2", and "e3" are in alat units ! + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: x0(i), i=1,3 + + Type: REAL + Description: 3D vector, origin of the parallelepiped + + "x0" is in alat units ! + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: nx, ny, nz + + Type: INTEGER + Description: Number of points in the parallelepiped: + + rho(i,j,k) = rho( x0 + e1 * (i-1)/nx + + e2 * (j-1)/ny + + e3 * (k-1)/nz ), + i = 1, nx ; j = 1, ny ; k = 1, nz + + - If "output_format" = 3 (XCRYSDEN), the above variables + are used to determine the grid to plot. + + - If "output_format" = 5 (XCRYSDEN), the above variables + are ignored, the entire FFT grid is written in the + XCRYSDEN format - works for any crystal axis (VERY FAST) + + - If "e1", "e2", "e3", "x0" are present, + and "e1", "e2", "e3" are parallel to xyz + and parallel to crystal axis, a subset of the FFT + grid that approximately covers the parallelepiped + defined by "e1", "e2", "e3", "x0", is + written - untested, might be obsolete + + - Otherwise, the required 3D grid is generated from the + Fourier components (may be VERY slow) + +-------------------------------------------------------------------- + + + * ELSE IF iflag = 4 : + + THE FOLLOWING VARIABLES ARE REQUIRED: + + +-------------------------------------------------------------------- + Variable: radius + + Type: REAL + Description: Radius of the sphere (alat units), centered at (0,0,0) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: nx, ny + + Type: INTEGER + Description: Number of points in the polar plane: + + phi(i) = 2 pi * (i - 1)/(nx-1), i=1, nx + theta(j) = pi * (j - 1)/(ny-1), j=1, ny + +-------------------------------------------------------------------- + + + ENDIF + ________________________________________________________________________ + +===END OF NAMELIST====================================================== + + +This file has been created by helpdoc utility on Sat Mar 18 15:50:16 CET 2023 diff --git a/assets/calculations/qe7.2/INPUT_PROJWFC.txt b/assets/calculations/qe7.2/INPUT_PROJWFC.txt new file mode 100644 index 00000000..9f1de3d5 --- /dev/null +++ b/assets/calculations/qe7.2/INPUT_PROJWFC.txt @@ -0,0 +1,350 @@ +*** FILE AUTOMATICALLY CREATED: DO NOT EDIT, CHANGES WILL BE LOST *** + +------------------------------------------------------------------------ +INPUT FILE DESCRIPTION + +Program: projwfc.x / PWscf / Quantum ESPRESSO (version: 7.2) +------------------------------------------------------------------------ + + +Purpose of projwfc.x: + projects wavefunctions onto orthogonalized atomic wavefunctions, + calculates Lowdin charges, spilling parameter, projected DOS + (separated into up and down components for LSDA). Alternatively: + computes the local DOS(E) integrated in volumes given in input + (see "tdosinboxes") or k-resolved DOS (see "kresolveddos"). + Atomic projections are written to file "atomic_proj.xml". + +Structure of the input data: +============================ + + &PROJWFC + ... + / + + + +======================================================================== +NAMELIST: &PROJWFC + + +-------------------------------------------------------------------- + Variable: prefix + + Type: CHARACTER + Description: prefix of input file produced by pw.x (wavefunctions are needed) + Default: 'pwscf' + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: outdir + + Type: CHARACTER + Description: directory containing the input data, i.e. the same as in pw.x + Default: value of the ESPRESSO_TMPDIR environment variable if set; + current directory ('./') otherwise + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: ngauss + + Type: INTEGER + Default: 0 + Description: Type of gaussian broadening: + 0 ... Simple Gaussian (default) + 1 ... Methfessel-Paxton of order 1 + -1 ... "cold smearing" (Marzari-Vanderbilt-DeVita-Payne) + -99 ... Fermi-Dirac function + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: degauss + + Type: REAL + Default: 0.0 + Description: gaussian broadening, Ry (not eV!) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: Emin, Emax + + Type: REAL + Default: (band extrema) + Description: min & max energy (eV) for DOS plot + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: DeltaE + + Type: REAL + Description: energy grid step (eV) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lsym + + Type: LOGICAL + Default: .true. + Description: if .true. the projections are symmetrized, + the partial density of states are computed + if .false. the projections are not symmetrized, the partial + DOS can be computed only in the k-resolved case + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: diag_basis + + Type: LOGICAL + Default: .false. + Description: if .false. the projections of Kohn-Sham states are + done on the orthogonalized atomic orbitals + in the global XYZ coordinate frame. + if .true. the projections of Kohn-Sham states are + done on the orthogonalized atomic orbitals + that are rotated to the basis in which the + atomic occupation matrix is diagonal + (i.e. local XYZ coordinate frame). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: pawproj + + Type: LOGICAL + Default: .false. + Description: if .true. use PAW projectors and all-electron PAW basis + functions to calculate weight factors for the partial + densities of states. Following Bloechl, PRB 50, 17953 (1994), + Eq. (4 & 6), the weight factors thus approximate the real + charge within the augmentation sphere of each atom. + Only for PAW, not implemented in the noncolinear case. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: filpdos + + Type: CHARACTER + Description: prefix for output files containing PDOS(E) + Default: (value of "prefix" variable) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: filproj + + Type: CHARACTER + Default: (standard output) + Description: file containing the projections + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lwrite_overlaps + + Type: LOGICAL + Default: .false. + Description: if .true., the overlap matrix of the atomic orbitals + prior to orthogonalization is written to "atomic_proj.xml". + Does not work together with parallel diagonalization: + for parallel runs, use "mpirun -np N projwfc.x -nd 1 ... " + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lbinary_data + + Type: LOGICAL + Default: .false. + Description: CURRENTLY DISABLED. + if .true., write atomic projections to a binary file. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: kresolveddos + + Type: LOGICAL + Default: .false. + Description: if .true. the k-resolved DOS is computed: not summed over + all k-points but written as a function of the k-point index. + In this case all k-point weights are set to unity + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: tdosinboxes + + Type: LOGICAL + Default: .false. + Description: if .true. compute the local DOS integrated in volumes + + Volumes are defined as boxes with edges parallel to the unit cell, + containing the points of the (charge density) FFT grid included within + "irmin" and "irmax", in the three dimensions: + + from "irmin"(j,n) to "irmax"(j,n) for j=1,2,3 (n=1,"n_proj_boxes"). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: n_proj_boxes + + Type: INTEGER + Default: 1 + Description: number of boxes where the local DOS is computed + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: irmin(i,n_proj_boxes), (i,n_proj_boxes)=(1,1) ... (3,n_proj_boxes) + + Type: INTEGER + Default: 1 for each box + Description: first point of the given box + + BEWARE: "irmin" is a 2D array of the form: "irmin"(3,"n_proj_boxes") + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: irmax(i,n_proj_boxes), (i,n_proj_boxes)=(1,1) ... (3,n_proj_boxes) + + Type: INTEGER + Default: 0 for each box + Description: last point of the given box; + ( 0 stands for the last point in the FFT grid ) + + BEWARE: "irmax" is a 2D array of the form: "irmax"(3,"n_proj_boxes") + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: plotboxes + + Type: LOGICAL + Default: .false. + Description: if .true., the boxes are written in output as xsf files with + 3D datagrids, valued 1.0 inside the box volume and 0 outside + (visualize them as isosurfaces with isovalue 0.5) + +-------------------------------------------------------------------- + +===END OF NAMELIST====================================================== + + + +:::: Notes + + + ::: Format of output files + + Projections are written to standard output, and also to file + "filproj" if given as input. + + The total DOS and the sum of projected DOS are written to file + "filpdos".pdos_tot. + + * The format for the collinear, spin-unpolarized case and the + non-collinear, spin-orbit case is: + E DOS(E) PDOS(E) + ... + + * The format for the collinear, spin-polarized case is: + E DOSup(E) DOSdw(E) PDOSup(E) PDOSdw(E) + ... + + * The format for the non-collinear, non spin-orbit case is: + E DOS(E) PDOSup(E) PDOSdw(E) + ... + + In the collinear case and the non-collinear, non spin-orbit case + projected DOS are written to file "filpdos".pdos_atm#N(X)_wfc#M(l), + where N = atom number , X = atom symbol, M = wfc number, l=s,p,d,f + (one file per atomic wavefunction found in the pseudopotential file) + + * The format for the collinear, spin-unpolarized case is: + E LDOS(E) PDOS_1(E) ... PDOS_2l+1(E) + ... + where LDOS = \sum m=1,2l+1 PDOS_m(E) + and PDOS_m(E) = projected DOS on atomic wfc with component m + + * The format for the collinear, spin-polarized case and the + non-collinear, non spin-orbit case is as above with + two components for both LDOS(E) and PDOS_m(E) + + In the non-collinear, spin-orbit case (i.e. if there is at least one + fully relativistic pseudopotential) wavefunctions are projected + onto eigenstates of the total angular-momentum. + Projected DOS are written to file "filpdos".pdos_atm#N(X)_wfc#M(l_j), + where N = atom number , X = atom symbol, M = wfc number, l=s,p,d,f + and j is the value of the total angular momentum. + In this case the format is: + E LDOS(E) PDOS_1(E) ... PDOS_2j+1(E) + ... + + If "kresolveddos"=.true., the k-point index is prepended + to the formats above, e.g. (collinear, spin-unpolarized case) + ik E DOS(E) PDOS(E) + + All DOS(E) are in states/eV plotted vs E in eV + + + + ::: Orbital Order + + Order of m-components for each l in the output: + + 1, cos(phi), sin(phi), cos(2*phi), sin(2*phi), .., cos(l*phi), sin(l*phi) + + where phi is the azimuthal angle: x=r cos(theta)cos(phi), y=r cos(theta)sin(phi) + This is determined in file upflib/ylmr2.f90 that calculates spherical harmonics. + + for l=1: + 1 pz (m=0) + 2 px (real combination of m=+/-1 with cosine) + 3 py (real combination of m=+/-1 with sine) + + for l=2: + 1 dz2 (m=0) + 2 dzx (real combination of m=+/-1 with cosine) + 3 dzy (real combination of m=+/-1 with sine) + 4 dx2-y2 (real combination of m=+/-2 with cosine) + 5 dxy (real combination of m=+/-2 with sine) + + + + ::: Defining boxes for the Local DOS(E) + + Boxes are specified using the variables "irmin" and "irmax": + + FFT grid points are included from irmin(j,n) to irmax(j,n) + for j=1,2,3 and n=1,...,"n_proj_boxes" + + "irmin" and "irmax" range from 1 to nr1 or nr2 or nr3 + + Values larger than nr1/2/3 or smaller than 1 are folded + to the unit cell. + + If "irmax"<"irmin" FFT grid points are included from 1 to irmax + and from irmin to nr1/2/3. + + + + ::: Important notices + + The tetrahedron method is used if + + - the input data file has been produced by pw.x using the option + occupations='tetrahedra', AND + + - a value for degauss is not given as input to namelist &projwfc + + * Gaussian broadening is used in all other cases: + + - if "degauss" is set to some value in namelist &PROJWFC, that value + (and the optional value for ngauss) is used + + - if "degauss" is NOT set to any value in namelist &PROJWFC, the + value of "degauss" and of "ngauss" are read from the input data + file (they will be the same used in the pw.x calculations) + + - if "degauss" is NOT set to any value in namelist &PROJWFC, AND + there is no value of "degauss" and of "ngauss" in the input data + file, "degauss"="DeltaE" (in Ry) and "ngauss"=0 will be used + + + Obsolete variables, ignored: + io_choice + smoothing + + + +This file has been created by helpdoc utility on Sat Mar 18 15:50:17 CET 2023 diff --git a/assets/calculations/qe7.2/INPUT_PW.txt b/assets/calculations/qe7.2/INPUT_PW.txt new file mode 100644 index 00000000..607d9edb --- /dev/null +++ b/assets/calculations/qe7.2/INPUT_PW.txt @@ -0,0 +1,4819 @@ +*** FILE AUTOMATICALLY CREATED: DO NOT EDIT, CHANGES WILL BE LOST *** + +------------------------------------------------------------------------ +INPUT FILE DESCRIPTION + +Program: pw.x / PWscf / Quantum ESPRESSO (version: 7.2) +------------------------------------------------------------------------ + + +Input data format: { } = optional, [ ] = it depends, | = or + +All quantities whose dimensions are not explicitly specified are in +RYDBERG ATOMIC UNITS. Charge is "number" charge (i.e. not multiplied +by e); potentials are in energy units (i.e. they are multiplied by e). + +BEWARE: TABS, CRLF, ANY OTHER STRANGE CHARACTER, ARE A SOURCES OF TROUBLE +USE ONLY PLAIN ASCII TEXT FILES (CHECK THE FILE TYPE WITH UNIX COMMAND "file") + +Namelists must appear in the order given below. +Comment lines in namelists can be introduced by a "!", exactly as in +fortran code. Comments lines in cards can be introduced by +either a "!" or a "#" character in the first position of a line. +Do not start any line in cards with a "/" character. +Leave a space between card names and card options, e.g. +ATOMIC_POSITIONS (bohr), not ATOMIC_POSITIONS(bohr) + + +Structure of the input data: +=============================================================================== + +&CONTROL + ... +/ + +&SYSTEM + ... +/ + +&ELECTRONS + ... +/ + +[ &IONS + ... + / ] + +[ &CELL + ... + / ] + +[ &FCP + ... + / ] + +[ &RISM + ... + / ] + +ATOMIC_SPECIES + X Mass_X PseudoPot_X + Y Mass_Y PseudoPot_Y + Z Mass_Z PseudoPot_Z + +ATOMIC_POSITIONS { alat | bohr | angstrom | crystal | crystal_sg } + X 0.0 0.0 0.0 {if_pos(1) if_pos(2) if_pos(3)} + Y 0.5 0.0 0.0 + Z 0.0 0.2 0.2 + +K_POINTS { tpiba | automatic | crystal | gamma | tpiba_b | crystal_b | tpiba_c | crystal_c } +if (gamma) + nothing to read +if (automatic) + nk1, nk2, nk3, k1, k2, k3 +if (not automatic) + nks + xk_x, xk_y, xk_z, wk +if (tpipa_b or crystal_b in a 'bands' calculation) see Doc/brillouin_zones.pdf + +[ CELL_PARAMETERS { alat | bohr | angstrom } + v1(1) v1(2) v1(3) + v2(1) v2(2) v2(3) + v3(1) v3(2) v3(3) ] + +[ OCCUPATIONS + f_inp1(1) f_inp1(2) f_inp1(3) ... f_inp1(10) + f_inp1(11) f_inp1(12) ... f_inp1(nbnd) + [ f_inp2(1) f_inp2(2) f_inp2(3) ... f_inp2(10) + f_inp2(11) f_inp2(12) ... f_inp2(nbnd) ] ] + +[ CONSTRAINTS + nconstr { constr_tol } + constr_type(.) constr(1,.) constr(2,.) [ constr(3,.) constr(4,.) ] { constr_target(.) } ] + +[ ATOMIC_VELOCITIES + label(1) vx(1) vy(1) vz(1) + ..... + label(n) vx(n) vy(n) vz(n) ] + +[ ATOMIC_FORCES + label(1) Fx(1) Fy(1) Fz(1) + ..... + label(n) Fx(n) Fy(n) Fz(n) ] + +[ ADDITIONAL_K_POINTS + see: K_POINTS ] + +[ SOLVENTS + label(1) Density(1) Molecule(1) + label(2) Density(2) Molecule(2) + ..... + label(nsolv) Density(nsolv) Molecule(nsolv) ] + +[ HUBBARD { atomic | ortho-atomic | norm-atomic | wf | pseudo } + if (DFT+U) + U label(1)-manifold(1) u_val(1) + [ J0 label(1)-manifold(1) j0_val(1) ] + ..... + U label(n)-manifold(n) u_val(n) + [ J0 label(n)-manifold(n) j0_val(n) ] + if (DFT+U+J) + paramType(1) label(1)-manifold(1) paramValue(1) + ..... + paramType(n) label(n)-manifold(n) paramValue(n) + if (DFT+U+V) + U label(I)-manifold(I) u_val(I) + [ J0 label(I)-manifold(I) j0_val(I) ] + V label(I)-manifold(I) label(J)-manifold(J) I J v_val(I,J) + ..... + U label(N)-manifold(N) u_val(N) + [ J0 label(N)-manifold(N) j0_val(N) ] + V label(N)-manifold(N) label(M)-manifold(M) N M v_val(N,M) +] +All Hubbard parameters must be specified in eV. +manifold = 3d, 2p, 4f... +paramType = U, J, B, E2, or E3 +Check Doc/Hubbard_input.pdf for more details. + + + +======================================================================== +NAMELIST: &CONTROL + + +-------------------------------------------------------------------- + Variable: calculation + + Type: CHARACTER + Default: 'scf' + Description: + A string describing the task to be performed. Options are: + 'scf' + 'nscf' + 'bands' + 'relax' + 'md' + 'vc-relax' + 'vc-md' + + (vc = variable-cell). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: title + + Type: CHARACTER + Default: ' ' + Description: reprinted on output. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: verbosity + + Type: CHARACTER + Default: 'low' + Description: + Currently two verbosity levels are implemented: + 'high' + 'low' + + 'debug' and 'medium' have the same effect as 'high'; + 'default' and 'minimal' as 'low' + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: restart_mode + + Type: CHARACTER + Default: 'from_scratch' + Description: + Available options are: + + 'from_scratch' : + From scratch. This is the normal way to perform a PWscf calculation + + 'restart' : + From previous interrupted run. Use this switch only if you want to + continue, using the same number of processors and parallelization, + an interrupted calculation. Do not use to start a new one, or to + perform a non-scf calculations. Works only if the calculation was + cleanly stopped using variable "max_seconds", or by user request + with an "exit file" (i.e.: create a file "prefix".EXIT, in directory + "outdir"; see variables "prefix", "outdir"). The default for + "startingwfc" and "startingpot" is set to 'file'. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: wf_collect + + Type: LOGICAL + Description: OBSOLETE - NO LONGER IMPLEMENTED + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: nstep + + Type: INTEGER + Description: number of molecular-dynamics or structural optimization steps + performed in this run. If set to 0, the code performs a quick + "dry run", stopping just after initialization. This is useful + to check for input correctness and to have the summary printed. + NOTE: in MD calculations, the code will perform "nstep" steps + even if restarting from a previously interrupted calculation. + Default: 1 if "calculation" == 'scf', 'nscf', 'bands'; + 50 for the other cases + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: iprint + + Type: INTEGER + Default: write only at convergence + Description: band energies are written every iprint iterations + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: tstress + + Type: LOGICAL + Default: .false. + Description: calculate stress. It is set to .TRUE. automatically if + "calculation" == 'vc-md' or 'vc-relax' + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: tprnfor + + Type: LOGICAL + Description: calculate forces. It is set to .TRUE. automatically if + "calculation" == 'relax','md','vc-md' + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: dt + + Type: REAL + Default: 20.D0 + Description: time step for molecular dynamics, in Rydberg atomic units + (1 a.u.=4.8378 * 10^-17 s : beware, the CP code uses + Hartree atomic units, half that much!!!) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: outdir + + Type: CHARACTER + Default: value of the ESPRESSO_TMPDIR environment variable if set; + current directory ('./') otherwise + Description: input, temporary, output files are found in this directory, + see also "wfcdir" + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: wfcdir + + Type: CHARACTER + Default: same as "outdir" + Description: This directory specifies where to store files generated by + each processor (*.wfc{N}, *.igk{N}, etc.). Useful for + machines without a parallel file system: set "wfcdir" to + a local file system, while "outdir" should be a parallel + or network file system, visible to all processors. Beware: + in order to restart from interrupted runs, or to perform + further calculations using the produced data files, you + may need to copy files to "outdir". Works only for pw.x. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: prefix + + Type: CHARACTER + Default: 'pwscf' + Description: prepended to input/output filenames: + prefix.wfc, prefix.rho, etc. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lkpoint_dir + + Type: LOGICAL + Description: OBSOLETE - NO LONGER IMPLEMENTED + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: max_seconds + + Type: REAL + Default: 1.D+7, or 150 days, i.e. no time limit + Description: Jobs stops after "max_seconds" CPU time. Use this option + in conjunction with option "restart_mode" if you need to + split a job too long to complete into shorter jobs that + fit into your batch queues. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: etot_conv_thr + + Type: REAL + Default: 1.0D-4 + Description: Convergence threshold on total energy (a.u) for ionic + minimization: the convergence criterion is satisfied + when the total energy changes less than "etot_conv_thr" + between two consecutive scf steps. Note that "etot_conv_thr" + is extensive, like the total energy. + See also "forc_conv_thr" - both criteria must be satisfied + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: forc_conv_thr + + Type: REAL + Default: 1.0D-3 + Description: Convergence threshold on forces (a.u) for ionic minimization: + the convergence criterion is satisfied when all components of + all forces are smaller than "forc_conv_thr". + See also "etot_conv_thr" - both criteria must be satisfied + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: disk_io + + Type: CHARACTER + Default: see below + Description: + Specifies the amount of disk I/O activity: + (only for binary files and xml data file in data directory; + other files printed at each molecular dynamics / structural + optimization step are not controlled by this option ) + + 'high' : + save charge to disk at each SCF step, + keep wavefunctions on disk (in "distributed" format), + save mixing data as well. + Do not use this option unless you have a good reason! + It is no longer needed to specify 'high' in order to be able + to restart from an interrupted calculation (see "restart_mode") + + 'medium' : + save charge to disk at each SCF step, + keep wavefunctions on disk only if more than one k-point, + per process is present, otherwise keep them in memory; + save them to disk only at the end (in "portable" format) + + 'low' : + save charge to disk at each SCF step, + keep wavefunctions in memory (for all k-points), + save them to disk only at the end (in "portable" format). + Reduces I/O but increases memory wrt the previous cases + + 'nowf' : + save to disk only the xml data file, + never save wavefunctions and charge density + + 'none' : + do not save anything to disk + + Default is 'low' for the scf case, 'medium' otherwise. + Note that the needed RAM increases as disk I/O decreases + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: pseudo_dir + + Type: CHARACTER + Default: value of the $ESPRESSO_PSEUDO environment variable if set; + '$HOME/espresso/pseudo/' otherwise + Description: directory containing pseudopotential files + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: tefield + + Type: LOGICAL + Default: .FALSE. + Description: If .TRUE. a saw-like potential simulating an electric field + is added to the bare ionic potential. See variables "edir", + "eamp", "emaxpos", "eopreg" for the form and size of + the added potential. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: dipfield + + Type: LOGICAL + Default: .FALSE. + Description: If .TRUE. and "tefield"==.TRUE. a dipole correction is also + added to the bare ionic potential - implements the recipe + of L. Bengtsson, PRB 59, 12301 (1999). See variables "edir", + "emaxpos", "eopreg" for the form of the correction. Must + be used ONLY in a slab geometry, for surface calculations, + with the discontinuity FALLING IN THE EMPTY SPACE. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lelfield + + Type: LOGICAL + Default: .FALSE. + Description: If .TRUE. a homogeneous finite electric field described + through the modern theory of the polarization is applied. + This is different from "tefield" == .true. ! + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: nberrycyc + + Type: INTEGER + Default: 1 + Description: In the case of a finite electric field ( "lelfield" == .TRUE. ) + it defines the number of iterations for converging the + wavefunctions in the electric field Hamiltonian, for each + external iteration on the charge density + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lorbm + + Type: LOGICAL + Default: .FALSE. + Description: If .TRUE. perform orbital magnetization calculation. + If finite electric field is applied ("lelfield"==.true.) only Kubo terms are computed + [for details see New J. Phys. 12, 053032 (2010), doi:10.1088/1367-2630/12/5/053032]. + + The type of calculation is 'nscf' and should be performed on an automatically + generated uniform grid of k points. + + Works ONLY with norm-conserving pseudopotentials. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lberry + + Type: LOGICAL + Default: .FALSE. + Description: If .TRUE. perform a Berry phase calculation. + See the header of PW/src/bp_c_phase.f90 for documentation. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: gdir + + Type: INTEGER + Description: For Berry phase calculation: direction of the k-point + strings in reciprocal space. Allowed values: 1, 2, 3 + 1=first, 2=second, 3=third reciprocal lattice vector + For calculations with finite electric fields + ("lelfield"==.true.) "gdir" is the direction of the field. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: nppstr + + Type: INTEGER + Description: For Berry phase calculation: number of k-points to be + calculated along each symmetry-reduced string. + The same for calculation with finite electric fields + ("lelfield"==.true.). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: gate + + Type: LOGICAL + Default: .FALSE. + See: zgate, relaxz, block, block_1, block_2, block_height + Description: In the case of charged cells ("tot_charge" .ne. 0) setting gate = .TRUE. + represents the counter charge (i.e. -tot_charge) not by a homogeneous + background charge but with a charged plate, which is placed at "zgate" + (see below). Details of the gate potential can be found in + T. Brumme, M. Calandra, F. Mauri; PRB 89, 245406 (2014). + Note, that in systems which are not symmetric with respect to the plate, + one needs to enable the dipole correction! ("dipfield"=.true.). + Currently, symmetry can be used with gate=.true. but carefully check + that no symmetry is included which maps z to -z even if in principle one + could still use them for symmetric systems (i.e. no dipole correction). + For "nosym"=.false. verbosity is set to 'high'. + Note: this option was called "monopole" in v6.0 and 6.1 of pw.x + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: twochem + + Type: LOGICAL + Default: .FALSE. + See: nelec_cond, nbnd_cond, degauss_cond + Description: IF .TRUE. , a two chemical potential calculation for the simulation of + photoexcited systems is performed, constraining a fraction of the + electrons in the conduction manifold. + See G. Marini, M. Calandra; PRB 104, 144103 (2021). + Note: requires "occupations" to be set to 'smearing'. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lfcp + + Type: LOGICAL + Default: .FALSE. + Description: If .TRUE. perform a constant bias potential (constant-mu) calculation + for a system with ESM method. See the header of PW/src/fcp_module.f90 + for documentation. To perform the calculation, you must set a namelist FCP. + + NB: + - The total energy displayed in output includes the potentiostat + contribution (-mu*N). + - "calculation" must be 'relax' or 'md'. + - "assume_isolated" = 'esm' and "esm_bc" = 'bc2' or 'bc3' must be set + in "SYSTEM" namelist. + - ESM-RISM is also supported ("assume_isolated" = 'esm' and "esm_bc" = 'bc1' + and "trism" = .TRUE.). + - "ignore_wolfe" is always .TRUE., for BFGS. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: trism + + Type: LOGICAL + Default: .FALSE. + Description: If .TRUE. perform a 3D-RISM-SCF calculation + [for details see H.Sato et al., JCP 112, 9463 (2000), doi:10.1063/1.481564]. + The solvent's distributions are calculated by 3D-RISM, + though solute is treated as SCF. The charge density and + the atomic positions are optimized, simultaneously with + the solvents. To perform the calculation, you must set + a namelist "RISM" and a card "SOLVENTS". + + If "assume_isolated" = 'esm' and "esm_bc" = 'bc1', + Laue-RISM is calculated instead of 3D-RISM + and coupled with ESM method (i.e. ESM-RISM). + [for details see S.Nishihara and M.Otani, PRB 96, 115429 (2017)]. + + The default of "mixing_beta" is 0.2 + for both 3D-RISM and Laue-RISM. + + For structural relaxation with BFGS, + "ignore_wolfe" is always .TRUE. . + +-------------------------------------------------------------------- + +===END OF NAMELIST====================================================== + + +======================================================================== +NAMELIST: &SYSTEM + + +-------------------------------------------------------------------- + Variable: ibrav + + Type: INTEGER + Status: REQUIRED + Description: Bravais-lattice index. Optional only if space_group is set. + If ibrav /= 0, specify EITHER [ "celldm"(1)-"celldm"(6) ] + OR [ "A", "B", "C", "cosAB", "cosAC", "cosBC" ] + but NOT both. The lattice parameter "alat" is set to + alat = celldm(1) (in a.u.) or alat = A (in Angstrom); + see below for the other parameters. + For ibrav=0 specify the lattice vectors in "CELL_PARAMETERS", + optionally the lattice parameter alat = celldm(1) (in a.u.) + or = A (in Angstrom). If not specified, the lattice parameter is + taken from "CELL_PARAMETERS" + IMPORTANT NOTICE 1: + with ibrav=0 lattice vectors must be given with a sufficiently large + number of digits and with the correct symmetry, or else symmetry + detection may fail and strange problems may arise in symmetrization. + IMPORTANT NOTICE 2: + do not use celldm(1) or A as a.u. to Ang conversion factor, + use the true lattice parameters or nothing, + specify units in "CELL_PARAMETERS" and "ATOMIC_POSITIONS" + + ibrav structure celldm(2)-celldm(6) + or: b,c,cosbc,cosac,cosab + 0 free + crystal axis provided in input: see card "CELL_PARAMETERS" + + 1 cubic P (sc) + v1 = a(1,0,0), v2 = a(0,1,0), v3 = a(0,0,1) + + 2 cubic F (fcc) + v1 = (a/2)(-1,0,1), v2 = (a/2)(0,1,1), v3 = (a/2)(-1,1,0) + + 3 cubic I (bcc) + v1 = (a/2)(1,1,1), v2 = (a/2)(-1,1,1), v3 = (a/2)(-1,-1,1) + -3 cubic I (bcc), more symmetric axis: + v1 = (a/2)(-1,1,1), v2 = (a/2)(1,-1,1), v3 = (a/2)(1,1,-1) + + 4 Hexagonal and Trigonal P celldm(3)=c/a + v1 = a(1,0,0), v2 = a(-1/2,sqrt(3)/2,0), v3 = a(0,0,c/a) + + 5 Trigonal R, 3fold axis c celldm(4)=cos(gamma) + The crystallographic vectors form a three-fold star around + the z-axis, the primitive cell is a simple rhombohedron: + v1 = a(tx,-ty,tz), v2 = a(0,2ty,tz), v3 = a(-tx,-ty,tz) + where c=cos(gamma) is the cosine of the angle gamma between + any pair of crystallographic vectors, tx, ty, tz are: + tx=sqrt((1-c)/2), ty=sqrt((1-c)/6), tz=sqrt((1+2c)/3) + -5 Trigonal R, 3fold axis <111> celldm(4)=cos(gamma) + The crystallographic vectors form a three-fold star around + <111>. Defining a' = a/sqrt(3) : + v1 = a' (u,v,v), v2 = a' (v,u,v), v3 = a' (v,v,u) + where u and v are defined as + u = tz - 2*sqrt(2)*ty, v = tz + sqrt(2)*ty + and tx, ty, tz as for case ibrav=5 + Note: if you prefer x,y,z as axis in the cubic limit, + set u = tz + 2*sqrt(2)*ty, v = tz - sqrt(2)*ty + See also the note in Modules/latgen.f90 + + 6 Tetragonal P (st) celldm(3)=c/a + v1 = a(1,0,0), v2 = a(0,1,0), v3 = a(0,0,c/a) + + 7 Tetragonal I (bct) celldm(3)=c/a + v1=(a/2)(1,-1,c/a), v2=(a/2)(1,1,c/a), v3=(a/2)(-1,-1,c/a) + + 8 Orthorhombic P celldm(2)=b/a + celldm(3)=c/a + v1 = (a,0,0), v2 = (0,b,0), v3 = (0,0,c) + + 9 Orthorhombic base-centered(bco) celldm(2)=b/a + celldm(3)=c/a + v1 = (a/2, b/2,0), v2 = (-a/2,b/2,0), v3 = (0,0,c) + -9 as 9, alternate description + v1 = (a/2,-b/2,0), v2 = (a/2, b/2,0), v3 = (0,0,c) + 91 Orthorhombic one-face base-centered A-type + celldm(2)=b/a + celldm(3)=c/a + v1 = (a, 0, 0), v2 = (0,b/2,-c/2), v3 = (0,b/2,c/2) + + 10 Orthorhombic face-centered celldm(2)=b/a + celldm(3)=c/a + v1 = (a/2,0,c/2), v2 = (a/2,b/2,0), v3 = (0,b/2,c/2) + + 11 Orthorhombic body-centered celldm(2)=b/a + celldm(3)=c/a + v1=(a/2,b/2,c/2), v2=(-a/2,b/2,c/2), v3=(-a/2,-b/2,c/2) + + 12 Monoclinic P, unique axis c celldm(2)=b/a + celldm(3)=c/a, + celldm(4)=cos(ab) + v1=(a,0,0), v2=(b*cos(gamma),b*sin(gamma),0), v3 = (0,0,c) + where gamma is the angle between axis a and b. + -12 Monoclinic P, unique axis b celldm(2)=b/a + celldm(3)=c/a, + celldm(5)=cos(ac) + v1 = (a,0,0), v2 = (0,b,0), v3 = (c*cos(beta),0,c*sin(beta)) + where beta is the angle between axis a and c + + 13 Monoclinic base-centered celldm(2)=b/a + (unique axis c) celldm(3)=c/a, + celldm(4)=cos(gamma) + v1 = ( a/2, 0, -c/2), + v2 = (b*cos(gamma), b*sin(gamma), 0 ), + v3 = ( a/2, 0, c/2), + where gamma=angle between axis a and b projected on xy plane + + -13 Monoclinic base-centered celldm(2)=b/a + (unique axis b) celldm(3)=c/a, + celldm(5)=cos(beta) + v1 = ( a/2, b/2, 0), + v2 = ( -a/2, b/2, 0), + v3 = (c*cos(beta), 0, c*sin(beta)), + where beta=angle between axis a and c projected on xz plane + IMPORTANT NOTICE: until QE v.6.4.1, axis for ibrav=-13 had a + different definition: v1(old) =-v2(now), v2(old) = v1(now) + + 14 Triclinic celldm(2)= b/a, + celldm(3)= c/a, + celldm(4)= cos(bc), + celldm(5)= cos(ac), + celldm(6)= cos(ab) + v1 = (a, 0, 0), + v2 = (b*cos(gamma), b*sin(gamma), 0) + v3 = (c*cos(beta), c*(cos(alpha)-cos(beta)cos(gamma))/sin(gamma), + c*sqrt( 1 + 2*cos(alpha)cos(beta)cos(gamma) + - cos(alpha)^2-cos(beta)^2-cos(gamma)^2 )/sin(gamma) ) + where alpha is the angle between axis b and c + beta is the angle between axis a and c + gamma is the angle between axis a and b + +-------------------------------------------------------------------- + + ///--- + EITHER: + + +-------------------------------------------------------------------- + Variable: celldm(i), i=1,6 + + Type: REAL + See: ibrav + Description: Crystallographic constants - see the "ibrav" variable. + Specify either these OR "A","B","C","cosAB","cosBC","cosAC" NOT both. + Only needed values (depending on "ibrav") must be specified + alat = "celldm"(1) is the lattice parameter "a" (in BOHR) + If "ibrav"==0, only "celldm"(1) is used if present; + cell vectors are read from card "CELL_PARAMETERS" + +-------------------------------------------------------------------- + + OR: + + +-------------------------------------------------------------------- + Variables: A, B, C, cosAB, cosAC, cosBC + + Type: REAL + See: ibrav + Description: Traditional crystallographic constants: + + a,b,c in ANGSTROM + cosAB = cosine of the angle between axis a and b (gamma) + cosAC = cosine of the angle between axis a and c (beta) + cosBC = cosine of the angle between axis b and c (alpha) + + The axis are chosen according to the value of "ibrav". + Specify either these OR "celldm" but NOT both. + Only needed values (depending on "ibrav") must be specified. + + The lattice parameter alat = A (in ANGSTROM ). + + If "ibrav" == 0, only A is used if present, and + cell vectors are read from card "CELL_PARAMETERS". + +-------------------------------------------------------------------- + + \\\--- + + +-------------------------------------------------------------------- + Variable: nat + + Type: INTEGER + Status: REQUIRED + Description: number of atoms in the unit cell (ALL atoms, except if + space_group is set, in which case, INEQUIVALENT atoms) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: ntyp + + Type: INTEGER + Status: REQUIRED + Description: number of types of atoms in the unit cell + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: nbnd + + Type: INTEGER + Default: for an insulator, "nbnd" = number of valence bands + ("nbnd" = # of electrons /2); + for a metal, 20% more (minimum 4 more) + Description: Number of electronic states (bands) to be calculated. + Note that in spin-polarized calculations the number of + k-point, not the number of bands per k-point, is doubled + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: nbnd_cond + + Type: INTEGER + Default: nbnd_cond = "nbnd" - # of electrons / 2 in the collinear case; + nbnd_cond = "nbnd" - # of electrons in the noncollinear case. + Description: Number of electronic states in the conduction manifold + for a two chemical-potential calculation ("twochem"=.true.). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: tot_charge + + Type: REAL + Default: 0.0 + Description: Total charge of the system. Useful for simulations with charged cells. + By default the unit cell is assumed to be neutral (tot_charge=0). + tot_charge=+1 means one electron missing from the system, + tot_charge=-1 means one additional electron, and so on. + + In a periodic calculation a compensating jellium background is + inserted to remove divergences if the cell is not neutral. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: starting_charge(i), i=1,ntyp + + Type: REAL + Default: 0.0 + Description: starting charge on atomic type 'i', + to create starting potential with "startingpot" = 'atomic'. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: tot_magnetization + + Type: REAL + Default: -10000 [unspecified] + Description: Total majority spin charge - minority spin charge. + Used to impose a specific total electronic magnetization. + If unspecified then tot_magnetization variable is ignored and + the amount of electronic magnetization is determined during + the self-consistent cycle. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: starting_magnetization(i), i=1,ntyp + + Type: REAL + Default: 0 + Description: Starting spin polarization on atomic type 'i' in a spin + polarized (LSDA or noncollinear/spin-orbit) calculation. + For non-constrained calculations, the allowed values + range between -1 (all spins down for the valence electrons + of atom type 'i') to 1 (all spins up). + If you expect a nonzero magnetization in your ground state, + you MUST either specify a nonzero value for at least one + atomic type, or constrain the magnetization using variable + "tot_magnetization" for LSDA, "constrained_magnetization" + for noncollinear/spin-orbit calculations. If you don't, + you will get a nonmagnetic (zero magnetization) state. + In order to perform LSDA calculations for an antiferromagnetic + state, define two different atomic species corresponding to + sublattices of the same atomic type. + + NOTE 1: "starting_magnetization" is ignored in most BUT NOT ALL + cases in non-scf calculations: it is safe to keep the same + values for the scf and subsequent non-scf calculation. + + NOTE 2: If you fix the magnetization with + "tot_magnetization", do not specify "starting_magnetization". + + NOTE 3: In the noncollinear/spin-orbit case, starting with zero + starting_magnetization on all atoms imposes time reversal + symmetry. The magnetization is never calculated and is + set to zero (the internal variable domag is set to .FALSE.). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: ecutwfc + + Type: REAL + Status: REQUIRED + Description: kinetic energy cutoff (Ry) for wavefunctions + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: ecutrho + + Type: REAL + Default: 4 * "ecutwfc" + Description: Kinetic energy cutoff (Ry) for charge density and potential + For norm-conserving pseudopotential you should stick to the + default value, you can reduce it by a little but it will + introduce noise especially on forces and stress. + If there are ultrasoft PP, a larger value than the default is + often desirable (ecutrho = 8 to 12 times "ecutwfc", typically). + PAW datasets can often be used at 4*"ecutwfc", but it depends + on the shape of augmentation charge: testing is mandatory. + The use of gradient-corrected functional, especially in cells + with vacuum, or for pseudopotential without non-linear core + correction, usually requires an higher values of ecutrho + to be accurately converged. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: ecutfock + + Type: REAL + Default: ecutrho + Description: Kinetic energy cutoff (Ry) for the exact exchange operator in + EXX type calculations. By default this is the same as "ecutrho" + but in some EXX calculations, a significant speed-up can be obtained + by reducing ecutfock, at the expense of some loss in accuracy. + Must be .gt. "ecutwfc". Not implemented for stress calculation + and for US-PP and PAW pseudopotentials. + Use with care, especially in metals where it may give raise + to instabilities. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: nr1, nr2, nr3 + + Type: INTEGER + Description: Three-dimensional FFT mesh (hard grid) for charge + density (and scf potential). If not specified + the grid is calculated based on the cutoff for + charge density (see also "ecutrho") + Note: you must specify all three dimensions for this setting to + be used. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: nr1s, nr2s, nr3s + + Type: INTEGER + Description: Three-dimensional mesh for wavefunction FFT and for the smooth + part of charge density ( smooth grid ). + Coincides with "nr1", "nr2", "nr3" if "ecutrho" = 4 * ecutwfc ( default ) + Note: you must specify all three dimensions for this setting to + be used. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: nosym + + Type: LOGICAL + Default: .FALSE. + Description: if (.TRUE.) symmetry is not used. Consequences: + + - if a list of k points is provided in input, it is used + "as is": symmetry-inequivalent k-points are not generated, + and the charge density is not symmetrized; + + - if a uniform (Monkhorst-Pack) k-point grid is provided in + input, it is expanded to cover the entire Brillouin Zone, + irrespective of the crystal symmetry. + Time reversal symmetry is assumed so k and -k are considered + as equivalent unless "noinv"=.true. is specified. + + Do not use this option unless you know exactly what you want + and what you get. May be useful in the following cases: + - in low-symmetry large cells, if you cannot afford a k-point + grid with the correct symmetry + - in MD simulations + - in calculations for isolated atoms + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: nosym_evc + + Type: LOGICAL + Default: .FALSE. + Description: if (.TRUE.) symmetry is not used, and k points are + forced to have the symmetry of the Bravais lattice; + an automatically generated Monkhorst-Pack grid will contain + all points of the grid over the entire Brillouin Zone, + plus the points rotated by the symmetries of the Bravais + lattice which were not in the original grid. The same + applies if a k-point list is provided in input instead + of a Monkhorst-Pack grid. Time reversal symmetry is assumed + so k and -k are equivalent unless "noinv"=.true. is specified. + This option differs from "nosym" because it forces k-points + in all cases to have the full symmetry of the Bravais lattice + (not all uniform grids have such property!) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: noinv + + Type: LOGICAL + Default: .FALSE. + Description: if (.TRUE.) disable the usage of k => -k symmetry + (time reversal) in k-point generation + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: no_t_rev + + Type: LOGICAL + Default: .FALSE. + Description: if (.TRUE.) disable the usage of magnetic symmetry operations + that consist in a rotation + time reversal. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: force_symmorphic + + Type: LOGICAL + Default: .FALSE. + Description: if (.TRUE.) force the symmetry group to be symmorphic by disabling + symmetry operations having an associated fractionary translation + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: use_all_frac + + Type: LOGICAL + Default: .FALSE. + Description: if (.FALSE.) force real-space FFT grids to be commensurate with + fractionary translations of non-symmorphic symmetry operations, + if present (e.g.: if a fractional translation (0,0,c/4) exists, + the FFT dimension along the c axis must be multiple of 4). + if (.TRUE.) do not impose any constraints to FFT grids, even in + the presence of non-symmorphic symmetry operations. + BEWARE: use_all_frac=.TRUE. may lead to wrong results for + hybrid functionals and phonon calculations. Both cases use + symmetrization in real space that works for non-symmorphic + operations only if the real-space FFT grids are commensurate. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: occupations + + Type: CHARACTER + Description: + Available options are: + + 'smearing' : + gaussian smearing for metals; + see variables "smearing" and "degauss" + + 'tetrahedra' : + Tetrahedron method, Bloechl's version: + P.E. Bloechl, PRB 49, 16223 (1994) + Requires uniform grid of k-points, to be + automatically generated (see card "K_POINTS"). + Well suited for calculation of DOS, + less so (because not variational) for + force/optimization/dynamics calculations. + + 'tetrahedra_lin' : + Original linear tetrahedron method. + To be used only as a reference; + the optimized tetrahedron method is more efficient. + + 'tetrahedra_opt' : + Optimized tetrahedron method: + see M. Kawamura, PRB 89, 094515 (2014). + Can be used for phonon calculations as well. + + 'fixed' : + for insulators with a gap + + 'from_input' : + The occupation are read from input file, + card "OCCUPATIONS". Option valid only for a + single k-point, requires "nbnd" to be set + in input. Occupations should be consistent + with the value of "tot_charge". + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: one_atom_occupations + + Type: LOGICAL + Default: .FALSE. + Description: This flag is used for isolated atoms ("nat"=1) together with + "occupations"='from_input'. If it is .TRUE., the wavefunctions + are ordered as the atomic starting wavefunctions, independently + from their eigenvalue. The occupations indicate which atomic + states are filled. + + The order of the states is written inside the UPF pseudopotential file. + In the scalar relativistic case: + S -> l=0, m=0 + P -> l=1, z, x, y + D -> l=2, r^2-3z^2, xz, yz, xy, x^2-y^2 + + In the noncollinear magnetic case (with or without spin-orbit), + each group of states is doubled. For instance: + P -> l=1, z, x, y for spin up, l=1, z, x, y for spin down. + Up and down is relative to the direction of the starting + magnetization. + + In the case with spin-orbit and time-reversal + ("starting_magnetization"=0.0) the atomic wavefunctions are + radial functions multiplied by spin-angle functions. + For instance: + P -> l=1, j=1/2, m_j=-1/2,1/2. l=1, j=3/2, + m_j=-3/2, -1/2, 1/2, 3/2. + + In the magnetic case with spin-orbit the atomic wavefunctions + can be forced to be spin-angle functions by setting + "starting_spin_angle" to .TRUE.. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: starting_spin_angle + + Type: LOGICAL + Default: .FALSE. + Description: In the spin-orbit case when "domag"=.TRUE., by default, + the starting wavefunctions are initialized as in scalar + relativistic noncollinear case without spin-orbit. + + By setting "starting_spin_angle"=.TRUE. this behaviour can + be changed and the initial wavefunctions are radial + functions multiplied by spin-angle functions. + + When "domag"=.FALSE. the initial wavefunctions are always + radial functions multiplied by spin-angle functions + independently from this flag. + + When "lspinorb" is .FALSE. this flag is not used. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: degauss_cond + + Type: REAL + Default: 0.D0 Ry + Description: value of the gaussian spreading (Ry) for brillouin-zone + integration in the conduction manifold in a two-chemical + potential calculation ("twochem"=.true.). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: nelec_cond + + Type: REAL + Default: 0.D0 + Description: Number of electrons placed in the conduction manifold in a two-chemical + potential calculation ("twochem"=.true.). Of the total # of + electrons nelec, nelec-nelec_cond will occupy the valence + manifold and nelec_cond will be constrained in the conduction manifold. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: degauss + + Type: REAL + Default: 0.D0 Ry + Description: value of the gaussian spreading (Ry) for brillouin-zone + integration in metals. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: smearing + + Type: CHARACTER + Default: 'gaussian' + Description: + Available options are: + + 'gaussian', 'gauss' : + ordinary Gaussian spreading (Default) + + 'methfessel-paxton', 'm-p', 'mp' : + Methfessel-Paxton first-order spreading + (see PRB 40, 3616 (1989)). + + 'marzari-vanderbilt', 'cold', 'm-v', 'mv' : + Marzari-Vanderbilt-DeVita-Payne cold smearing + (see PRL 82, 3296 (1999)) + + 'fermi-dirac', 'f-d', 'fd' : + smearing with Fermi-Dirac function + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: nspin + + Type: INTEGER + Default: 1 + Description: nspin = 1 : non-polarized calculation (default) + + nspin = 2 : spin-polarized calculation, LSDA + (magnetization along z axis) + + nspin = 4 : spin-polarized calculation, noncollinear + (magnetization in generic direction) + DO NOT specify "nspin" in this case; + specify "noncolin"=.TRUE. instead + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: sic_gamma + + Type: REAL + Default: 0 + Description: Strength of the gammaDFT potential. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: pol_type + + Type: CHARACTER + Description: + Type of polaron in gammaDFT. + + 'e' : + electron polaron + + 'h' : + hole polaron + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: sic_energy + + Type: LOGICAL + Default: .false. + Description: Enable the calculation of the total energy in gammaDFT. When .true., + a preliminary calculation is performed to calculate the electron density + in the absence of the polaron. When .false., the total energy printed in + output should not be considered. For structural relaxations, it is + recommended to use .false. to avoid doubling the computational cost. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: sci_vb + + Type: REAL + Default: 0 + Description: Valence band shift (in eV) through self-consistent + scissor operator. When performing gammaDFT calculations + of polarons, the polaron level is not shifted. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: sci_cb + + Type: REAL + Default: 0 + Description: Conduction band band shift (in eV) through self-consistent + scissor operator. When performing gammaDFT calculations + of polarons, the polaron level is not shifted. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: noncolin + + Type: LOGICAL + Default: .false. + Description: if .true. the program will perform a noncollinear calculation. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: ecfixed + + Type: REAL + Default: 0.0 + See: q2sigma + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: qcutz + + Type: REAL + Default: 0.0 + See: q2sigma + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: q2sigma + + Type: REAL + Default: 0.1 + Description: ecfixed, qcutz, q2sigma: parameters for modified functional to be + used in variable-cell molecular dynamics (or in stress calculation). + "ecfixed" is the value (in Rydberg) of the constant-cutoff; + "qcutz" and "q2sigma" are the height and the width (in Rydberg) + of the energy step for reciprocal vectors whose square modulus + is greater than "ecfixed". In the kinetic energy, G^2 is + replaced by G^2 + qcutz * (1 + erf ( (G^2 - ecfixed)/q2sigma) ) + See: M. Bernasconi et al, J. Phys. Chem. Solids 56, 501 (1995), + doi:10.1016/0022-3697(94)00228-2 + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: input_dft + + Type: CHARACTER + Default: read from pseudopotential files + Description: Exchange-correlation functional: eg 'PBE', 'BLYP' etc + See Modules/funct.f90 for allowed values. + Overrides the value read from pseudopotential files. + Use with care and if you know what you are doing! + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: ace + + Type: LOGICAL + Default: true + Description: Use Adaptively Compressed Exchange operator as in + Lin Lin, J. Chem. Theory Comput. 2016, 12, 2242--2249, doi:10.1021/acs.jctc.6b00092 + + Set to false to use standard Exchange (much slower) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: exx_fraction + + Type: REAL + Default: it depends on the specified functional + Description: Fraction of EXX for hybrid functional calculations. In the case of + "input_dft"='PBE0', the default value is 0.25, while for "input_dft"='B3LYP' + the "exx_fraction" default value is 0.20. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: screening_parameter + + Type: REAL + Default: 0.106 + Description: screening_parameter for HSE like hybrid functionals. + For more information, see: + J. Chem. Phys. 118, 8207 (2003), doi:10.1063/1.1564060 + J. Chem. Phys. 124, 219906 (2006), doi:10.1063/1.2204597 + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: exxdiv_treatment + + Type: CHARACTER + Default: 'gygi-baldereschi' + Description: + Specific for EXX. It selects the kind of approach to be used + for treating the Coulomb potential divergencies at small q vectors. + + 'gygi-baldereschi' : + appropriate for cubic and quasi-cubic supercells + + 'vcut_spherical' : + appropriate for cubic and quasi-cubic supercells + + 'vcut_ws' : + appropriate for strongly anisotropic supercells, see also "ecutvcut". + + 'none' : + sets Coulomb potential at G,q=0 to 0.0 (required for GAU-PBE) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: x_gamma_extrapolation + + Type: LOGICAL + Default: .true. + Description: Specific for EXX. If .true., extrapolate the G=0 term of the + potential (see README in examples/EXX_example for more) + Set this to .false. for GAU-PBE. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: ecutvcut + + Type: REAL + Default: 0.0 Ry + See: exxdiv_treatment + Description: Reciprocal space cutoff for correcting Coulomb potential + divergencies at small q vectors. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: nqx1, nqx2, nqx3 + + Type: INTEGER + Description: Three-dimensional mesh for q (k1-k2) sampling of + the Fock operator (EXX). Can be smaller than + the number of k-points. + + Currently this defaults to the size of the k-point mesh used. + In QE =< 5.0.2 it defaulted to nqx1=nqx2=nqx3=1. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: localization_thr + + Type: REAL + Default: 0.0 + Description: Overlap threshold over which the exchange integral over a pair of localized orbitals + is included in the evaluation of EXX operator. Any value greater than 0.0 triggers + the SCDM localization and the evaluation on EXX using the localized orbitals. + Very small value of the threshold should yield the same result as the default EXX + evaluation + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: Hubbard_occ(ityp,i), (ityp,i)=(1,1) ... (ntyp,3) + + Type: REAL + Default: read from pseudopotentials + Description: Hubbard occupations is the number of electrons in the + Hubbard manifold. By default they are initialized by + reading the occupations from pseudopotentials. If specified + from the input, then the values read from the pseudopotentials + will be overwritten. + The second index of the Hubbard_occ array corresponds to the + Hubbard manifold number. It is possible to specify up to + three Hubbard manifolds per Hubbard atom. However, if you want + to specify three manifolds then the second and the third manifolds + will be considered as one effective manifold (see Doc/Hubbard_input.pdf) + + Note: Hubbard_occ cannot be used together with fully-relativistic pseudopotentials + (i.e. when noncolin=.true. and lspinorb=.true.) since this variable does not + allow to distinguish between the occupied and unoccupied channels (this is + needed when determining the atomic orbital offsets). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: Hubbard_alpha(i), i=1,ntyp + + Type: REAL + Default: 0.D0 for all species + Description: Hubbard_alpha(i) is the perturbation (on atom i, in eV) + used to compute U (and V) with the linear-response method of + Cococcioni and de Gironcoli, PRB 71, 035105 (2005) + (only for DFT+U or DFT+U+V). + + Note: Hubbard U and V can be computed using the HP code + which is based on density-functional perturbation theory, + and it gives exactly the same result as the method of + Cococcioni and de Gironcoli. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: Hubbard_beta(i), i=1,ntyp + + Type: REAL + Default: 0.D0 for all species + Description: Hubbard_beta(i) is the perturbation (on atom i, in eV) + used to compute J0 with the linear-response method of + Cococcioni and de Gironcoli, PRB 71, 035105 (2005) + (only for DFT+U or DFT+U+V). See also + PRB 84, 115108 (2011). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: starting_ns_eigenvalue(m,ispin,ityp), (m,ispin,ityp)=(1,1,1) ... (2*lmax+1,nspin or npol,ntyp) + + Type: REAL + Default: -1.d0 that means NOT SET + Description: In the first iteration of an DFT+U run it overwrites + the m-th eigenvalue of the ns occupation matrix for the + ispin component of atomic species ityp. + For the noncollinear case, the ispin index runs up to npol=2 + The value lmax is given by the maximum angular momentum + number to which the Hubbard U is applied. + Leave unchanged eigenvalues that are not set. + This is useful to suggest the desired orbital occupations + when the default choice takes another path. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: dmft + + Type: LOGICAL + Default: .FALSE. + Status: Requires compilation with hdf5 support + Description: If true, nscf calculation will exit in restart mode, scf calculation + will restart from there if DMFT updates are provided as hdf5 archive. + Scf calculation should be used only with "electron_maxstep" = 1. + "K_POINTS" have to be identical and given explicitly with "nosym". + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: dmft_prefix + + Type: CHARACTER + Default: "prefix" + Description: prepended to hdf5 archive: dmft_prefix.h5 + + DMFT update should be provided in group/dataset as: + - dft_misc_input/band_window with dimension [1, number of k-points, 2 (real + complex)] + - dft_update/delta_N with dimension [number of k-points, number of correlated orbitals, + number of correlated orbitals, 2 (real + complex)] + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: ensemble_energies + + Type: LOGICAL + Default: .false. + Description: If "ensemble_energies" = .true., an ensemble of xc energies + is calculated non-selfconsistently for perturbed + exchange-enhancement factors and LDA vs. PBE correlation + ratios after each converged electronic ground state + calculation. + + Ensemble energies can be analyzed with the 'bee' utility + included with libbeef. + + Requires linking against libbeef. + "input_dft" must be set to a BEEF-type functional + (e.g. input_dft = 'BEEF-vdW') + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: edir + + Type: INTEGER + Description: The direction of the electric field or dipole correction is + parallel to the bg(:,edir) reciprocal lattice vector, so the + potential is constant in planes defined by FFT grid points; + "edir" = 1, 2 or 3. Used only if "tefield" is .TRUE. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: emaxpos + + Type: REAL + Default: 0.5D0 + Description: Position of the maximum of the saw-like potential along crystal + axis "edir", within the unit cell (see below), 0 < emaxpos < 1 + Used only if "tefield" is .TRUE. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: eopreg + + Type: REAL + Default: 0.1D0 + Description: Zone in the unit cell where the saw-like potential decreases. + ( see below, 0 < eopreg < 1 ). Used only if "tefield" is .TRUE. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: eamp + + Type: REAL + Default: 0.001 a.u. + Description: Amplitude of the electric field, in ***Hartree*** a.u.; + 1 a.u. = 51.4220632*10^10 V/m. Used only if "tefield"==.TRUE. + The saw-like potential increases with slope "eamp" in the + region from ("emaxpos"+"eopreg"-1) to ("emaxpos"), then decreases + to 0 until ("emaxpos"+"eopreg"), in units of the crystal + vector "edir". Important: the change of slope of this + potential must be located in the empty region, or else + unphysical forces will result. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: angle1(i), i=1,ntyp + + Type: REAL + Description: The angle expressed in degrees between the initial + magnetization and the z-axis. For noncollinear calculations + only; index i runs over the atom types. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: angle2(i), i=1,ntyp + + Type: REAL + Description: The angle expressed in degrees between the projection + of the initial magnetization on x-y plane and the x-axis. + For noncollinear calculations only. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lforcet + + Type: LOGICAL + Description: When starting a non collinear calculation using an existing density + file from a collinear lsda calculation assumes previous density points in + z direction and rotates it in the direction described by "angle1" and + "angle2" variables for atomic type 1 + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: constrained_magnetization + + Type: CHARACTER + See: lambda, fixed_magnetization + Default: 'none' + Description: + Used to perform constrained calculations in magnetic systems. + Currently available choices: + + 'none' : + no constraint + + 'total' : + total magnetization is constrained by + adding a penalty functional to the total energy: + + LAMBDA * SUM_{i} ( magnetization(i) - fixed_magnetization(i) )**2 + + where the sum over i runs over the three components of + the magnetization. Lambda is a real number (see below). + Noncolinear case only. Use "tot_magnetization" for LSDA + + 'atomic' : + atomic magnetization are constrained to the defined + starting magnetization adding a penalty: + + LAMBDA * SUM_{i,itype} ( magnetic_moment(i,itype) - mcons(i,itype) )**2 + + where i runs over the cartesian components (or just z + in the collinear case) and itype over the types (1-ntype). + mcons(:,:) array is defined from starting_magnetization, + (also from angle1, angle2 in the noncollinear case). + lambda is a real number + + 'total direction' : + the angle theta of the total magnetization + with the z axis (theta = fixed_magnetization(3)) + is constrained: + + LAMBDA * ( arccos(magnetization(3)/mag_tot) - theta )**2 + + where mag_tot is the modulus of the total magnetization. + + 'atomic direction' : + not all the components of the atomic + magnetic moment are constrained but only the cosine + of angle1, and the penalty functional is: + + LAMBDA * SUM_{itype} ( mag_mom(3,itype)/mag_mom_tot - cos(angle1(ityp)) )**2 + + N.B.: symmetrization may prevent to reach the desired orientation + of the magnetization. Try not to start with very highly symmetric + configurations or use the nosym flag (only as a last remedy) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: fixed_magnetization(i), i=1,3 + + Type: REAL + See: constrained_magnetization + Default: 0.d0 + Description: total magnetization vector (x,y,z components) to be kept + fixed when "constrained_magnetization"=='total' + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lambda + + Type: REAL + See: constrained_magnetization + Default: 1.d0 + Description: parameter used for constrained_magnetization calculations + N.B.: if the scf calculation does not converge, try to reduce lambda + to obtain convergence, then restart the run with a larger lambda + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: report + + Type: INTEGER + Default: -1 + Description: determines when atomic magnetic moments are printed on output: + report = 0 never + report =-1 at the beginning of the scf and at convergence + report = N as -1, plus every N scf iterations + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lspinorb + + Type: LOGICAL + Description: if .TRUE. the noncollinear code can use a pseudopotential with + spin-orbit. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: assume_isolated + + Type: CHARACTER + Default: 'none' + Description: + Used to perform calculation assuming the system to be + isolated (a molecule or a cluster in a 3D supercell). + + Currently available choices: + + 'none' : + (default): regular periodic calculation w/o any correction. + + 'makov-payne', 'm-p', 'mp' : + the Makov-Payne correction to the + total energy is computed. An estimate of the vacuum + level is also calculated so that eigenvalues can be + properly aligned. ONLY FOR CUBIC SYSTEMS ("ibrav"=1,2,3). + Theory: G.Makov, and M.C.Payne, + "Periodic boundary conditions in ab initio + calculations" , PRB 51, 4014 (1995). + + 'martyna-tuckerman', 'm-t', 'mt' : + Martyna-Tuckerman correction + to both total energy and scf potential. Adapted from: + G.J. Martyna, and M.E. Tuckerman, + "A reciprocal space based method for treating long + range interactions in ab-initio and force-field-based + calculation in clusters", J. Chem. Phys. 110, 2810 (1999), + doi:10.1063/1.477923. + + 'esm' : + Effective Screening Medium Method. + For polarized or charged slab calculation, embeds + the simulation cell within an effective semi- + infinite medium in the perpendicular direction + (along z). Embedding regions can be vacuum or + semi-infinite metal electrodes (use "esm_bc" to + choose boundary conditions). If between two + electrodes, an optional electric field + ("esm_efield") may be applied. Method described in + M. Otani and O. Sugino, "First-principles calculations + of charged surfaces and interfaces: A plane-wave + nonrepeated slab approach", PRB 73, 115407 (2006). + + NB: + - Two dimensional (xy plane) average charge density + and electrostatic potentials are printed out to + 'prefix.esm1'. + + - Requires cell with a_3 lattice vector along z, + normal to the xy plane, with the slab centered + around z=0. + + - For bc2 with an electric field and bc3 boundary + conditions, the inversion symmetry along z-direction + is automatically eliminated. + + - In case of calculation='vc-relax', use + "cell_dofree"='2Dxy' or other parameters so that + c-vector along z-axis should not be moved. + + See "esm_bc", "esm_efield", "esm_w", "esm_nfit". + + '2D' : + Truncation of the Coulomb interaction in the z direction + for structures periodic in the x-y plane. Total energy, + forces and stresses are computed in a two-dimensional framework. + Linear-response calculations () done on top of a self-consistent + calculation with this flag will automatically be performed in + the 2D framework as well. Please refer to: + Sohier, T., Calandra, M., & Mauri, F. (2017), "Density functional + perturbation theory for gated two-dimensional heterostructures: + Theoretical developments and application to flexural phonons in graphene", + PRB, 96, 075448 (2017). + + NB: + - The length of the unit-cell along the z direction should + be larger than twice the thickness of the 2D material + (including electrons). A reasonable estimate for a + layer's thickness could be the interlayer distance in the + corresponding layered bulk material. Otherwise, + the atomic thickness + 10 bohr should be a safe estimate. + There is also a lower limit of 20 bohr imposed by the cutoff + radius used to read pseudopotentials (see read_pseudo.f90 in Modules). + + - As for ESM above, only in-plane stresses make sense and one + should use "cell_dofree"= '2Dxy' in a vc-relax calculation. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: esm_bc + + Type: CHARACTER + See: assume_isolated + Default: 'pbc' + Description: + If "assume_isolated" = 'esm', determines the boundary + conditions used for either side of the slab. + + Currently available choices: + + 'pbc' : + (default): regular periodic calculation (no ESM). + + 'bc1' : + Vacuum-slab-vacuum (open boundary conditions). + + 'bc2' : + Metal-slab-metal (dual electrode configuration). + See also "esm_efield". + + 'bc3' : + Vacuum-slab-metal + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: esm_w + + Type: REAL + See: assume_isolated + Default: 0.d0 + Description: If "assume_isolated" = 'esm', determines the position offset + [in a.u.] of the start of the effective screening region, + measured relative to the cell edge. (ESM region begins at + z = +/- [L_z/2 + esm_w] ). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: esm_efield + + Type: REAL + See: assume_isolated + Default: 0.d0 + Description: If "assume_isolated" = 'esm' and "esm_bc" = 'bc2', gives the + magnitude of the electric field [Ry/a.u.] to be applied + between semi-infinite ESM electrodes. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: esm_nfit + + Type: INTEGER + See: assume_isolated + Default: 4 + Description: If "assume_isolated" = 'esm', gives the number of z-grid points + for the polynomial fit along the cell edge. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: lgcscf + + Type: LOGICAL + Default: .FALSE. + Description: If .TRUE. perform a constant bias potential (constant-mu) calculation + with Grand-Canonical SCF. (JCP 146, 114104 (2017), R.Sundararaman, et al.) + + NB: + - The total energy displayed in output includes the potentiostat + contribution (-mu*N). + - "assume_isolated" = 'esm' and "esm_bc" = 'bc2' or 'bc3' must be set + in "SYSTEM" namelist. + - ESM-RISM is also supported ("assume_isolated" = 'esm' and "esm_bc" = 'bc1' + and "trism" = .TRUE.). + - "mixing_mode" has to be 'TF' or 'local-TF', also its default is 'TF.' + - The default of "mixing_beta" is 0.1 with ESM-RISM, 0.2 without ESM-RISM. + - The default of "diago_thr_init" is 1.D-5. + - "diago_full_acc" is always .TRUE. . + - "diago_rmm_conv" is always .TRUE. . + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: gcscf_mu + + Type: REAL + Status: REQUIRED + Description: The target Fermi energy (eV) of GC-SCF. One can start + with appropriate total charge of the system by giving "tot_charge" . + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: gcscf_conv_thr + + Type: REAL + Default: 1.D-2 + Description: Convergence threshold of Fermi energy (eV) for GC-SCF. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: gcscf_beta + + Type: REAL + Default: 0.05D0 + Description: Mixing factor for GC-SCF. + Larger values are recommended, + if systems with small DOS on Fermi surface as graphite. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: vdw_corr + + Type: CHARACTER + Default: 'none' + See: london_s6, london_rcut, london_c6, london_rvdw, + dftd3_version, dftd3_threebody, ts_vdw_econv_thr, ts_vdw_isolated, xdm_a1, xdm_a2 + Description: + Type of Van der Waals correction. Allowed values: + + 'grimme-d2', 'Grimme-D2', 'DFT-D', 'dft-d' : + Semiempirical Grimme's DFT-D2. Optional variables: + "london_s6", "london_rcut", "london_c6", "london_rvdw" + S. Grimme, J. Comp. Chem. 27, 1787 (2006), doi:10.1002/jcc.20495 + V. Barone et al., J. Comp. Chem. 30, 934 (2009), doi:10.1002/jcc.21112 + + 'grimme-d3', 'Grimme-D3', 'DFT-D3', 'dft-d3' : + Semiempirical Grimme's DFT-D3. Optional variables: + "dftd3_version", "dftd3_threebody" + S. Grimme et al, J. Chem. Phys 132, 154104 (2010), doi:10.1063/1.3382344 + + 'TS', 'ts', 'ts-vdw', 'ts-vdW', 'tkatchenko-scheffler' : + Tkatchenko-Scheffler dispersion corrections with first-principle derived + C6 coefficients. + Optional variables: "ts_vdw_econv_thr", "ts_vdw_isolated" + See A. Tkatchenko and M. Scheffler, PRL 102, 073005 (2009). + + 'MBD', 'mbd', 'many-body-dispersion', 'mbd_vdw' : + Many-body dipersion (MBD) correction to long-range interactions. + Optional variables: "ts_vdw_isolated" + A. Ambrosetti, A. M. Reilly, R. A. DiStasio, A. Tkatchenko, J. Chem. Phys. 140 + 18A508 (2014). + + 'XDM', 'xdm' : + Exchange-hole dipole-moment model. Optional variables: "xdm_a1", "xdm_a2" + A. D. Becke et al., J. Chem. Phys. 127, 154108 (2007), doi:10.1063/1.2795701 + A. Otero de la Roza et al., J. Chem. Phys. 136, 174109 (2012), + doi:10.1063/1.4705760 + + Note that non-local functionals (eg vdw-DF) are NOT specified here but in "input_dft" + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: london + + Type: LOGICAL + Default: .FALSE. + Status: OBSOLESCENT, same as "vdw_corr"='DFT-D' + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: london_s6 + + Type: REAL + Default: 0.75 + Description: global scaling parameter for DFT-D. Default is good for PBE. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: london_c6(i), i=1,ntyp + + Type: REAL + Default: standard Grimme-D2 values + Description: atomic C6 coefficient of each atom type + + ( if not specified default values from S. Grimme, J. Comp. Chem. 27, 1787 (2006), + doi:10.1002/jcc.20495 are used; see file Modules/mm_dispersion.f90 ) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: london_rvdw(i), i=1,ntyp + + Type: REAL + Default: standard Grimme-D2 values + Description: atomic vdw radii of each atom type + + ( if not specified default values from S. Grimme, J. Comp. Chem. 27, 1787 (2006), + doi:10.1002/jcc.20495 are used; see file Modules/mm_dispersion.f90 ) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: london_rcut + + Type: REAL + Default: 200 + Description: cutoff radius (a.u.) for dispersion interactions + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: dftd3_version + + Type: integer + Default: 3 + Description: + Version of Grimme implementation of Grimme-D3: + + dftd3_version = 2 : + Original Grimme-D2 parametrization + + dftd3_version = 3 : + Grimme-D3 (zero damping) + + dftd3_version = 4 : + Grimme-D3 (BJ damping) + + dftd3_version = 5 : + Grimme-D3M (zero damping) + + dftd3_version = 6 : + Grimme-D3M (BJ damping) + + NOTE: not all functionals are parametrized. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: dftd3_threebody + + Type: LOGICAL + Default: TRUE + Description: Turn three-body terms in Grimme-D3 on. If .false. two-body contributions + only are computed, using two-body parameters of Grimme-D3. + If dftd3_version=2, three-body contribution is always disabled. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: ts_vdw_econv_thr + + Type: REAL + Default: 1.D-6 + Description: Optional: controls the convergence of the vdW energy (and forces). The default value + is a safe choice, likely too safe, but you do not gain much in increasing it + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: ts_vdw_isolated + + Type: LOGICAL + Default: .FALSE. + Description: Optional: set it to .TRUE. when computing the Tkatchenko-Scheffler vdW energy or the + Many-Body dispersion (MBD) energy for an isolated (non-periodic) system. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: xdm + + Type: LOGICAL + Default: .FALSE. + Status: OBSOLESCENT, same as "vdw_corr"='xdm' + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: xdm_a1 + + Type: REAL + Default: 0.6836 + Description: Damping function parameter a1 (adimensional). It is NOT necessary to give + a value if the functional is one of B86bPBE, PW86PBE, PBE, BLYP. For functionals + in this list, the coefficients are given in: + http://schooner.chem.dal.ca/wiki/XDM + A. Otero de la Roza, E. R. Johnson, J. Chem. Phys. 138, 204109 (2013), + doi:10.1063/1.4705760 + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: xdm_a2 + + Type: REAL + Default: 1.5045 + Description: Damping function parameter a2 (angstrom). It is NOT necessary to give + a value if the functional is one of B86bPBE, PW86PBE, PBE, BLYP. For functionals + in this list, the coefficients are given in: + http://schooner.chem.dal.ca/wiki/XDM + A. Otero de la Roza, E. R. Johnson, J. Chem. Phys. 138, 204109 (2013), + doi:10.1063/1.4705760 + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: space_group + + Type: INTEGER + Default: 0 + Description: The number of the space group of the crystal, as given + in the International Tables of Crystallography A (ITA). + This allows to give in input only the inequivalent atomic + positions. The positions of all the symmetry equivalent atoms + are calculated by the code. Used only when the atomic positions + are of type crystal_sg. See also "uniqueb", + "origin_choice", "rhombohedral" + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: uniqueb + + Type: LOGICAL + Default: .FALSE. + Description: Used only for monoclinic lattices. If .TRUE. the b + unique "ibrav" (-12 or -13) are used, and symmetry + equivalent positions are chosen assuming that the + twofold axis or the mirror normal is parallel to the + b axis. If .FALSE. it is parallel to the c axis. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: origin_choice + + Type: INTEGER + Default: 1 + Description: Used only for space groups that in the ITA allow + the use of two different origins. "origin_choice"=1, + means the first origin, while "origin_choice"=2 is the + second origin. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rhombohedral + + Type: LOGICAL + Default: .TRUE. + Description: Used only for rhombohedral space groups. + When .TRUE. the coordinates of the inequivalent atoms are + given with respect to the rhombohedral axes, when .FALSE. + the coordinates of the inequivalent atoms are given with + respect to the hexagonal axes. They are converted internally + to the rhombohedral axes and "ibrav"=5 is used in both cases. + +-------------------------------------------------------------------- + + ///--- + VARIABLES USED ONLY IF "GATE" = .TRUE. + + +-------------------------------------------------------------------- + Variable: zgate + + Type: REAL + Default: 0.5 + Description: used only if "gate" = .TRUE. + Specifies the position of the charged plate which represents + the counter charge in doped systems ("tot_charge" .ne. 0). + In units of the unit cell length in z direction, "zgate" in ]0,1[ + Details of the gate potential can be found in + T. Brumme, M. Calandra, F. Mauri; PRB 89, 245406 (2014). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: relaxz + + Type: LOGICAL + Default: .FALSE. + Description: used only if "gate" = .TRUE. + Allows the relaxation of the system towards the charged plate. + Use carefully and utilize either a layer of fixed atoms or a + potential barrier ("block"=.TRUE.) to avoid the atoms moving to + the position of the plate or the dipole of the dipole + correction ("dipfield"=.TRUE.). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: block + + Type: LOGICAL + Default: .FALSE. + Description: used only if "gate" = .TRUE. + Adds a potential barrier to the total potential seen by the + electrons to mimic a dielectric in field effect configuration + and/or to avoid electrons spilling into the vacuum region for + electron doping. Potential barrier is from "block_1" to "block_2" and + has a height of block_height. + If "dipfield" = .TRUE. then "eopreg" is used for a smooth increase and + decrease of the potential barrier. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: block_1 + + Type: REAL + Default: 0.45 + Description: used only if "gate" = .TRUE. and "block" = .TRUE. + lower beginning of the potential barrier, in units of the + unit cell size along z, "block_1" in ]0,1[ + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: block_2 + + Type: REAL + Default: 0.55 + Description: used only if "gate" = .TRUE. and "block" = .TRUE. + upper beginning of the potential barrier, in units of the + unit cell size along z, "block_2" in ]0,1[ + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: block_height + + Type: REAL + Default: 0.1 + Description: used only if "gate" = .TRUE. and "block" = .TRUE. + Height of the potential barrier in Rydberg. + +-------------------------------------------------------------------- + + \\\--- + + +-------------------------------------------------------------------- + Variable: nextffield + + Type: INTEGER + Default: 0 + Description: Number of activated external ionic force fields. + See Doc/ExternalForceFields.tex for further explanation and parameterizations + +-------------------------------------------------------------------- + +===END OF NAMELIST====================================================== + + +======================================================================== +NAMELIST: &ELECTRONS + + +-------------------------------------------------------------------- + Variable: electron_maxstep + + Type: INTEGER + Default: 100 + Description: maximum number of iterations in a scf step. If exact exchange is active, + this will affect the inner loops. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: exx_maxstep + + Type: INTEGER + Default: 100 + Description: maximum number of outer iterations in a scf calculation with exact exchange. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: scf_must_converge + + Type: LOGICAL + Default: .TRUE. + Description: If .false. do not stop molecular dynamics or ionic relaxation + when electron_maxstep is reached. Use with care. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: conv_thr + + Type: REAL + Default: 1.D-6 + Description: Convergence threshold for selfconsistency: + estimated energy error < conv_thr + (note that conv_thr is extensive, like the total energy). + + For non-self-consistent calculations, conv_thr is used + to set the default value of the threshold (ethr) for + iterative diagonalization: see "diago_thr_init" + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: adaptive_thr + + Type: LOGICAL + Default: .FALSE + Description: If .TRUE. this turns on the use of an adaptive "conv_thr" for + the inner scf loops when using EXX. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: conv_thr_init + + Type: REAL + Default: 1.D-3 + Description: When "adaptive_thr" = .TRUE. this is the convergence threshold + used for the first scf cycle. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: conv_thr_multi + + Type: REAL + Default: 1.D-1 + Description: When "adaptive_thr" = .TRUE. the convergence threshold for + each scf cycle is given by: + max( "conv_thr", "conv_thr_multi" * dexx ) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: mixing_mode + + Type: CHARACTER + Default: 'plain' + Description: + Available options are: + + 'plain' : + charge density Broyden mixing + + 'TF' : + as above, with simple Thomas-Fermi screening + (for highly homogeneous systems) + + 'local-TF' : + as above, with local-density-dependent TF screening + (for highly inhomogeneous systems) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: mixing_beta + + Type: REAL + Default: 0.7D0 + Description: mixing factor for self-consistency + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: mixing_ndim + + Type: INTEGER + Default: 8 + Description: number of iterations used in mixing scheme. + If you are tight with memory, you may reduce it to 4 or so. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: mixing_fixed_ns + + Type: INTEGER + Default: 0 + Description: For DFT+U : number of iterations with fixed ns ( ns is the + atomic density appearing in the Hubbard term ). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: diagonalization + + Type: CHARACTER + Default: 'david' + Description: + Available options are: + + 'david' : + Davidson iterative diagonalization with overlap matrix + (default). Fast, may in some rare cases fail. + + 'cg' : + Conjugate-gradient-like band-by-band diagonalization. + MUCH slower than 'david' but uses less memory and is + (a little bit) more robust. + + 'ppcg' : + PPCG iterative diagonalization + + 'paro', 'ParO' : + ParO iterative diagonalization + + 'rmm-davidson', 'rmm-paro' : + RMM-DIIS iterative diagonalization. + To stabilize the SCF loop + RMM-DIIS is alternated with calls to Davidson or + ParO solvers depending on the string used. + Other variables that can be used to tune the behavior of + RMM-DIIS are: "diago_rmm_ndim" and "diago_rmm_conv" + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: diago_thr_init + + Type: REAL + Description: Convergence threshold (ethr) for iterative diagonalization + (the check is on eigenvalue convergence). + + For scf calculations: default is 1.D-2 if starting from a + superposition of atomic orbitals; 1.D-5 if starting from a + charge density. During self consistency the threshold + is automatically reduced (but never below 1.D-13) when + approaching convergence. + + For non-scf calculations: default is ("conv_thr"/N elec)/10. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: diago_cg_maxiter + + Type: INTEGER + Description: For conjugate gradient diagonalization: max number of iterations + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: diago_ppcg_maxiter + + Type: INTEGER + Description: For ppcg diagonalization: max number of iterations + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: diago_david_ndim + + Type: INTEGER + Default: 2 + Description: For Davidson diagonalization: dimension of workspace + (number of wavefunction packets, at least 2 needed). + A larger value may yield a smaller number of iterations in + the algorithm but uses more memory and more CPU time in + subspace diagonalization (cdiaghg/rdiaghg). You may try + "diago_david_ndim"=4 if you are not tight on memory + and if the time spent in subspace diagonalization is small + compared to the time spent in h_psi + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: diago_rmm_ndim + + Type: INTEGER + Default: 4 + Description: For RMM-DIIS diagonalization: dimension of workspace + (number of wavefunction packets, at least 2 needed). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: diago_rmm_conv + + Type: LOGICAL + Default: .FALSE. + Description: If .TRUE., RMM-DIIS is performed up to converge. + If .FALSE., RMM-DIIS is performed only once. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: diago_gs_nblock + + Type: INTEGER + Default: 16 + Description: For RMM-DIIS diagonalization: + blocking size of Gram-Schmidt orthogonalization + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: diago_full_acc + + Type: LOGICAL + Default: .FALSE. + Description: If .TRUE. all the empty states are diagonalized at the same level + of accuracy of the occupied ones. Otherwise the empty states are + diagonalized using a larger threshold (this should not affect + total energy, forces, and other ground-state properties). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: efield + + Type: REAL + Default: 0.D0 + Description: Amplitude of the finite electric field (in Ry a.u.; + 1 a.u. = 36.3609*10^10 V/m). Used only if "lelfield"==.TRUE. + and if k-points ("K_POINTS" card) are not automatic. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: efield_cart(i), i=1,3 + + Type: REAL + Default: (0.D0, 0.D0, 0.D0) + Description: Finite electric field (in Ry a.u.=36.3609*10^10 V/m) in + cartesian axis. Used only if "lelfield"==.TRUE. and if + k-points ("K_POINTS" card) are automatic. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: efield_phase + + Type: CHARACTER + Default: 'none' + Description: + Available options are: + + 'read' : + set the zero of the electronic polarization (with "lelfield"==.true..) + to the result of a previous calculation + + 'write' : + write on disk data on electronic polarization to be read in another + calculation + + 'none' : + none of the above points + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: startingpot + + Type: CHARACTER + Description: + Available options are: + + 'atomic' : + starting potential from atomic charge superposition + (default for scf, *relax, *md) + + 'file' : + start from existing "charge-density.xml" file in the + directory specified by variables "prefix" and "outdir" + For nscf and bands calculation this is the default + and the only sensible possibility. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: startingwfc + + Type: CHARACTER + Default: 'atomic+random' + Description: + Available options are: + + 'atomic' : + Start from superposition of atomic orbitals. + If not enough atomic orbitals are available, + fill with random numbers the remaining wfcs + The scf typically starts better with this option, + but in some high-symmetry cases one can "loose" + valence states, ending up in the wrong ground state. + + 'atomic+random' : + As above, plus a superimposed "randomization" + of atomic orbitals. Prevents the "loss" of states + mentioned above. + + 'random' : + Start from random wfcs. Slower start of scf but safe. + It may also reduce memory usage in conjunction with + "diagonalization"='cg'. + + 'file' : + Start from an existing wavefunction file in the + directory specified by variables "prefix" and "outdir". + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: tqr + + Type: LOGICAL + Default: .FALSE. + Description: If .true., use a real-space algorithm for augmentation + charges of ultrasoft pseudopotentials and PAWsets. + Faster but numerically less accurate than the default + G-space algorithm. Use with care and after testing! + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: real_space + + Type: LOGICAL + Default: .FALSE. + Description: If .true., exploit real-space localization to compute + matrix elements for nonlocal projectors. Faster and in + principle better scaling than the default G-space algorithm, + but numerically less accurate, may lead to some loss of + translational invariance. Use with care and after testing! + +-------------------------------------------------------------------- + +===END OF NAMELIST====================================================== + + +======================================================================== +NAMELIST: &IONS + + REQUIRED IF "CALCULATION" == 'RELAX', 'MD', 'VC-RELAX', OR 'VC-MD' + OPTIONAL FOR "CALCULATION" == 'SCF' (ONLY "ION_POSITIONS" IS USED) + + +-------------------------------------------------------------------- + Variable: ion_positions + + Type: CHARACTER + Default: 'default' + Description: + Available options are: + + 'default' : + if restarting, use atomic positions read from the + restart file; in all other cases, use atomic + positions from standard input. + + 'from_input' : + read atomic positions from standard input, even if restarting. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: ion_velocities + + Type: CHARACTER + Default: 'default' + Description: + Initial ionic velocities. Available options are: + + 'default' : + start a new simulation from random thermalized + distribution of velocities if "tempw" is set, + with zero velocities otherwise; restart from + atomic velocities read from the restart file + + 'from_input' : + start or continue the simulation with atomic + velocities read from standard input - see card + "ATOMIC_VELOCITIES" + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: ion_dynamics + + Type: CHARACTER + Description: + Specify the type of ionic dynamics. + + For different type of calculation different possibilities are + allowed and different default values apply: + + CASE ( "calculation" == 'relax' ) + + 'bfgs' : + (default) use BFGS quasi-newton algorithm, + based on the trust radius procedure, + for structural relaxation + + 'damp' : + use damped (quick-min Verlet) + dynamics for structural relaxation + Can be used for constrained + optimisation: see "CONSTRAINTS" card + + 'fire' : + use the FIRE minimization algorithm employing the + semi-implicit Euler integration scheme + see: + Bitzek et al.,PRL, 97, 170201, (2006), doi: 10.1103/PhysRevLett.97.170201 + Guenole et al.,CMS, 175, 109584, (2020), doi: 10.1016/j.commatsci.2020.109584 + + Can be used for constrained + optimisation: see "CONSTRAINTS" card + + CASE ( "calculation" == 'md' ) + + 'verlet' : + (default) use Verlet algorithm to integrate + Newton's equation. For constrained + dynamics, see "CONSTRAINTS" card + + 'langevin' : + ion dynamics is over-damped Langevin + + 'langevin-smc' : + over-damped Langevin with Smart Monte Carlo: + see R.J. Rossky, JCP, 69, 4628 (1978), doi:10.1063/1.436415 + + CASE ( "calculation" == 'vc-relax' ) + + 'bfgs' : + (default) use BFGS quasi-newton algorithm; + "cell_dynamics" must be 'bfgs' too + + 'damp' : + use damped (Beeman) dynamics for + structural relaxation + + CASE ( "calculation" == 'vc-md' ) + + 'beeman' : + (default) use Beeman algorithm to integrate + Newton's equation + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: pot_extrapolation + + Type: CHARACTER + Default: 'atomic' + Description: + Used to extrapolate the potential from preceding ionic steps. + + 'none' : + no extrapolation + + 'atomic' : + extrapolate the potential as if it was a sum of + atomic-like orbitals + + 'first_order' : + extrapolate the potential with first-order + formula + + 'second_order' : + as above, with second order formula + + Note: 'first_order' and 'second-order' extrapolation make sense + only for molecular dynamics calculations + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: wfc_extrapolation + + Type: CHARACTER + Default: 'none' + Description: + Used to extrapolate the wavefunctions from preceding ionic steps. + + 'none' : + no extrapolation + + 'first_order' : + extrapolate the wave-functions with first-order formula. + + 'second_order' : + as above, with second order formula. + + Note: 'first_order' and 'second-order' extrapolation make sense + only for molecular dynamics calculations + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: remove_rigid_rot + + Type: LOGICAL + Default: .FALSE. + Description: This keyword is useful when simulating the dynamics and/or the + thermodynamics of an isolated system. If set to true the total + torque of the internal forces is set to zero by adding new forces + that compensate the spurious interaction with the periodic + images. This allows for the use of smaller supercells. + + BEWARE: since the potential energy is no longer consistent with + the forces (it still contains the spurious interaction with the + repeated images), the total energy is not conserved anymore. + However the dynamical and thermodynamical properties should be + in closer agreement with those of an isolated system. + Also the final energy of a structural relaxation will be higher, + but the relaxation itself should be faster. + +-------------------------------------------------------------------- + + ///--- + VARIABLES USED FOR MOLECULAR DYNAMICS + + +-------------------------------------------------------------------- + Variable: ion_temperature + + Type: CHARACTER + Default: 'not_controlled' + Description: + Available options are: + + 'rescaling' : + control ionic temperature via velocity rescaling + (first method) see parameters "tempw", "tolp", and + "nraise" (for VC-MD only). This rescaling method + is the only one currently implemented in VC-MD + + 'rescale-v' : + control ionic temperature via velocity rescaling + (second method) see parameters "tempw" and "nraise" + + 'rescale-T' : + scale temperature of the thermostat every "nraise" steps + by "delta_t", starting from "tempw". + The temperature is controlled via velocitiy rescaling. + + 'reduce-T' : + reduce temperature of the thermostat every "nraise" steps + by the (negative) value "delta_t", starting from "tempw". + If "delta_t" is positive, the target temperature is augmented. + The temperature is controlled via velocitiy rescaling. + + 'berendsen' : + control ionic temperature using "soft" velocity + rescaling - see parameters "tempw" and "nraise" + + 'andersen' : + control ionic temperature using Andersen thermostat + see parameters "tempw" and "nraise" + + 'svr' : + control ionic temperature using stochastic-velocity rescaling + (Donadio, Bussi, Parrinello, J. Chem. Phys. 126, 014101, 2007), + with parameters "tempw" and "nraise". + + 'initial' : + initialize ion velocities to temperature "tempw" + and leave uncontrolled further on + + 'not_controlled' : + (default) ionic temperature is not controlled + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: tempw + + Type: REAL + Default: 300.D0 + Description: Starting temperature (Kelvin) in MD runs + target temperature for most thermostats. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: tolp + + Type: REAL + Default: 100.D0 + Description: Tolerance for velocity rescaling. Velocities are rescaled if + the run-averaged and target temperature differ more than tolp. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: delta_t + + Type: REAL + Default: 1.D0 + Description: if "ion_temperature" == 'rescale-T' : + at each step the instantaneous temperature is multiplied + by delta_t; this is done rescaling all the velocities. + + if "ion_temperature" == 'reduce-T' : + every 'nraise' steps the instantaneous temperature is + reduced by -"delta_t" (i.e. "delta_t" < 0 is added to T) + + The instantaneous temperature is calculated at the end of + every ionic move and BEFORE rescaling. This is the temperature + reported in the main output. + + For "delta_t" < 0, the actual average rate of heating or cooling + should be roughly C*delta_t/(nraise*dt) (C=1 for an + ideal gas, C=0.5 for a harmonic solid, theorem of energy + equipartition between all quadratic degrees of freedom). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: nraise + + Type: INTEGER + Default: 1 + Description: if "ion_temperature" == 'reduce-T' : + every "nraise" steps the instantaneous temperature is + reduced by -"delta_t" (i.e. "delta_t" is added to the temperature) + + if "ion_temperature" == 'rescale-v' : + every "nraise" steps the average temperature, computed from + the last "nraise" steps, is rescaled to "tempw" + + if "ion_temperature" == 'rescaling' and "calculation" == 'vc-md' : + every "nraise" steps the instantaneous temperature + is rescaled to "tempw" + + if "ion_temperature" == 'berendsen' : + the "rise time" parameter is given in units of the time step: + tau = nraise*dt, so dt/tau = 1/nraise + + if "ion_temperature" == 'andersen' : + the "collision frequency" parameter is given as nu=1/tau + defined above, so nu*dt = 1/nraise + + if "ion_temperature" == 'svr' : + the "characteristic time" of the thermostat is set to + tau = nraise*dt + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: refold_pos + + Type: LOGICAL + Default: .FALSE. + Description: This keyword applies only in the case of molecular dynamics or + damped dynamics. If true the ions are refolded at each step into + the supercell. + +-------------------------------------------------------------------- + + \\\--- + + ///--- + KEYWORDS USED ONLY IN BFGS CALCULATIONS + + +-------------------------------------------------------------------- + Variable: upscale + + Type: REAL + Default: 100.D0 + Description: Max reduction factor for "conv_thr" during structural optimization + "conv_thr" is automatically reduced when the relaxation + approaches convergence so that forces are still accurate, + but "conv_thr" will not be reduced to less that "conv_thr" / "upscale". + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: bfgs_ndim + + Type: INTEGER + Default: 1 + Description: Number of old forces and displacements vectors used in the + PULAY mixing of the residual vectors obtained on the basis + of the inverse hessian matrix given by the BFGS algorithm. + When "bfgs_ndim" = 1, the standard quasi-Newton BFGS method is + used. + (bfgs only) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: trust_radius_max + + Type: REAL + Default: 0.8D0 + Description: Maximum ionic displacement in the structural relaxation. + (bfgs only) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: trust_radius_min + + Type: REAL + Default: 1.D-3 + Description: Minimum ionic displacement in the structural relaxation + BFGS is reset when "trust_radius" < "trust_radius_min". + (bfgs only) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: trust_radius_ini + + Type: REAL + Default: 0.5D0 + Description: Initial ionic displacement in the structural relaxation. + (bfgs only) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: w_1 + + Type: REAL + Default: 0.01D0 + See: w_2 + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: w_2 + + Type: REAL + Default: 0.5D0 + Description: Parameters used in line search based on the Wolfe conditions. + (bfgs only) + +-------------------------------------------------------------------- + + \\\--- + + ///--- + KEYWORDS USED ONLY IN THE FIRE MINIMIZATION ALGORITHM + + +-------------------------------------------------------------------- + Variable: fire_alpha_init + + Type: REAL + Default: 0.2D0 + Description: Initial value of the alpha mixing factor in the FIRE minimization scheme; + recommended values are between 0.1 and 0.3 + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: fire_falpha + + Type: REAL + Default: 0.99D0 + Description: Scaling of the alpha mixing parameter for steps with P > 0; + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: fire_nmin + + Type: INTEGER + Default: 5 + Description: Minimum number of steps with P > 0 before increase of "dt" + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: fire_f_inc + + Type: REAL + Default: 1.1D0 + Description: Factor for increasing "dt" + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: fire_f_dec + + Type: REAL + Default: 0.5D0 + Description: Factor for decreasing "dt" + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: fire_dtmax + + Type: REAL + Default: 10.D0 + Description: Determines the maximum value of "dt" in the FIRE minimization; + dtmax = fire_dtmax*"dt" + +-------------------------------------------------------------------- + + \\\--- + +===END OF NAMELIST====================================================== + + +======================================================================== +NAMELIST: &CELL + + INPUT THIS NAMELIST ONLY IF "CALCULATION" == 'VC-RELAX' OR 'VC-MD' + + +-------------------------------------------------------------------- + Variable: cell_dynamics + + Type: CHARACTER + Description: + Specify the type of dynamics for the cell. + For different type of calculation different possibilities + are allowed and different default values apply: + + CASE ( "calculation" == 'vc-relax' ) + + 'none' : + no dynamics + + 'sd' : + steepest descent ( not implemented ) + + 'damp-pr' : + damped (Beeman) dynamics of the Parrinello-Rahman extended lagrangian + + 'damp-w' : + damped (Beeman) dynamics of the new Wentzcovitch extended lagrangian + + 'bfgs' : + BFGS quasi-newton algorithm (default) + "ion_dynamics" must be 'bfgs' too + + CASE ( "calculation" == 'vc-md' ) + + 'none' : + no dynamics + + 'pr' : + (Beeman) molecular dynamics of the Parrinello-Rahman extended lagrangian + + 'w' : + (Beeman) molecular dynamics of the new Wentzcovitch extended lagrangian + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: press + + Type: REAL + Default: 0.D0 + Description: Target pressure [KBar] in a variable-cell md or relaxation run. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: wmass + + Type: REAL + Default: 0.75*Tot_Mass/pi**2 for Parrinello-Rahman MD; + 0.75*Tot_Mass/pi**2/Omega**(2/3) for Wentzcovitch MD + Description: Fictitious cell mass [amu] for variable-cell simulations + (both 'vc-md' and 'vc-relax') + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: cell_factor + + Type: REAL + Default: 2.0 for variable-cell calculations, 1.0 otherwise + Description: Used in the construction of the pseudopotential tables. + It should exceed the maximum linear contraction of the + cell during a simulation. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: press_conv_thr + + Type: REAL + Default: 0.5D0 Kbar + Description: Convergence threshold on the pressure for variable cell + relaxation ('vc-relax' : note that the other convergence + thresholds for ionic relaxation apply as well). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: cell_dofree + + Type: CHARACTER + Default: 'all' + Description: + Select which of the cell parameters should be moved: + + 'all' : + all axis and angles are moved + + 'ibrav' : + all axis and angles are moved, + but the lattice remains consistent + with the initial ibrav choice. You can use this option in combination + with any other one by specifying "ibrav+option". Please note that some + combinations do not make sense for some crystals and will guarantee that + the relax will never converge. E.g. 'ibrav+2Dxy' is not a problem for + hexagonal cells, but will never converge for cubic ones. + + 'a' : + the x component of axis 1 (v1_x) is fixed + + 'b' : + the y component of axis 2 (v2_y) is fixed + + 'c' : + the z component of axis 3 (v3_z) is fixed + + 'fixa' : + axis 1 (v1_x,v1_y,v1_z) is fixed + + 'fixb' : + axis 2 (v2_x,v2_y,v2_z) is fixed + + 'fixc' : + axis 3 (v3_x,v3_y,v3_z) is fixed + + 'x' : + only the x component of axis 1 (v1_x) is moved + + 'y' : + only the y component of axis 2 (v2_y) is moved + + 'z' : + only the z component of axis 3 (v3_z) is moved + + 'xy' : + only v1_x and v2_y are moved + + 'xz' : + only v1_x and v3_z are moved + + 'yz' : + only v2_y and v3_z are moved + + 'xyz' : + only v1_x, v2_y, v3_z are moved + + 'shape' : + all axis and angles, keeping the volume fixed + + 'volume' : + the volume changes, keeping all angles fixed (i.e. only celldm(1) changes) + + '2Dxy' : + only x and y components are allowed to change + + '2Dshape' : + as above, keeping the area in xy plane fixed + + 'epitaxial_ab' : + fix axis 1 and 2 while allowing axis 3 to move + + 'epitaxial_ac' : + fix axis 1 and 3 while allowing axis 2 to move + + 'epitaxial_bc' : + fix axis 2 and 3 while allowing axis 1 to move + + BEWARE: if axis are not orthogonal, some of these options do not + work (symmetry is broken). If you are not happy with them, + edit subroutine init_dofree in file Modules/cell_base.f90 + +-------------------------------------------------------------------- + +===END OF NAMELIST====================================================== + + +======================================================================== +NAMELIST: &FCP + + INPUT THIS NAMELIST ONLY IF "LFCP" = .TRUE. + + +-------------------------------------------------------------------- + Variable: fcp_mu + + Type: REAL + Status: REQUIRED + Description: The target Fermi energy (eV). One can start + with appropriate total charge of the system by giving "tot_charge" . + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: fcp_dynamics + + Type: CHARACTER + Description: + Specify the type of dynamics for the Fictitious Charge Particle (FCP). + + For different type of calculation different possibilities + are allowed and different default values apply: + + CASE ( "calculation" == 'relax' ) + + 'bfgs' : + (default) BFGS quasi-newton algorithm, coupling with ions relaxation + "ion_dynamics" must be 'bfgs' too + + 'newton' : + Newton-Raphson algorithm with DIIS + "ion_dynamics" must be 'damp' too + + 'damp' : + damped (quick-min Verlet) dynamics for FCP relaxation + "ion_dynamics" must be 'damp' too + + 'lm' : + Line-Minimization algorithm for FCP relaxation + "ion_dynamics" must be 'damp' too + + CASE ( "calculation" == 'md' ) + + 'velocity-verlet' : + (default) Velocity-Verlet algorithm to integrate Newton's equation. + "ion_dynamics" must be 'verlet' too + + 'verlet' : + Verlet algorithm to integrate Newton's equation. + "ion_dynamics" must be 'verlet' too + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: fcp_conv_thr + + Type: REAL + Default: 1.D-2 + Description: Convergence threshold on force (eV) for FCP relaxation. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: fcp_ndiis + + Type: INTEGER + Default: 4 + Description: Size of DIIS for FCP relaxation, + used only if "fcp_dynamics" = 'newton'. + +-------------------------------------------------------------------- + + ///--- + VARIABLES USED FOR FCP DYNAMICS. + + +-------------------------------------------------------------------- + Variable: fcp_mass + + Type: REAL + Default: 5.D+6 / (xy area) for ESM only; + 5.D+4 / (xy area) for ESM-RISM + Description: Mass of the FCP. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: fcp_velocity + + Type: REAL + Default: determined by "fcp_temperature" + Description: Initial velocity of the FCP. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: fcp_temperature + + Type: CHARACTER + Default: "ion_temperature" + Description: + Available options are: + + 'rescaling' : + control FCP's temperature via velocity rescaling + (first method) see parameters "fpc_tempw" and "fcp_tolp". + + 'rescale-v' : + control FCP's temperature via velocity rescaling + (second method) see parameters "fcp_tempw" and "fcp_nraise" + + 'rescale-T' : + control FCP's temperature via velocity rescaling + (third method) see parameter "fcp_delta_t" + + 'reduce-T' : + reduce FCP's temperature every "fcp_nraise" steps + by the (negative) value "fcp_delta_t" + + 'berendsen' : + control FCP's temperature using "soft" velocity + rescaling - see parameters "fcp_tempw" and "fcp_nraise" + + 'andersen' : + control FCP's temperature using Andersen thermostat + see parameters "fcp_tempw" and "fcp_nraise" + + 'initial' : + initialize FCP's velocities to temperature "fcp_tempw" + and leave uncontrolled further on + + 'not_controlled' : + (default) FCP's temperature is not controlled + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: fcp_tempw + + Type: REAL + Default: "tempw" + Description: Starting temperature (Kelvin) in FCP dynamics runs + target temperature for most thermostats. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: fcp_tolp + + Type: REAL + Default: "tolp" + Description: Tolerance for velocity rescaling. Velocities are rescaled if + the run-averaged and target temperature differ more than tolp. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: fcp_delta_t + + Type: REAL + Default: "delta_t" + Description: if "fcp_temperature" == 'rescale-T' : + at each step the instantaneous temperature is multiplied + by fcp_delta_t; this is done rescaling all the velocities. + + if "fcp_temperature" == 'reduce-T' : + every "fcp_nraise" steps the instantaneous temperature is + reduced by -"fcp_delta_t" (i.e. "fcp_delta_t" < 0 is added to T) + + The instantaneous temperature is calculated at the end of + FCP's move and BEFORE rescaling. This is the temperature + reported in the main output. + + For "fcp_delta_t" < 0, the actual average rate of heating or cooling + should be roughly C*fcp_delta_t/(fcp_nraise*dt) (C=1 for an + ideal gas, C=0.5 for a harmonic solid, theorem of energy + equipartition between all quadratic degrees of freedom). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: fcp_nraise + + Type: INTEGER + Default: "nraise" + Description: if "fcp_temperature" == 'reduce-T' : + every "fcp_nraise" steps the instantaneous temperature is + reduced by -"fcp_delta_t" (i.e. "fcp_delta_t" is added to the temperature) + + if "fcp_temperature" == 'rescale-v' : + every "fcp_nraise" steps the average temperature, computed from + the last "fcp_nraise" steps, is rescaled to "fcp_tempw" + + if "fcp_temperature" == 'berendsen' : + the "rise time" parameter is given in units of the time step: + tau = fcp_nraise*dt, so dt/tau = 1/fcp_nraise + + if "fcp_temperature" == 'andersen' : + the "collision frequency" parameter is given as nu=1/tau + defined above, so nu*dt = 1/fcp_nraise + +-------------------------------------------------------------------- + + \\\--- + + +-------------------------------------------------------------------- + Variable: freeze_all_atoms + + Type: LOGICAL + Default: .FALSE. + Description: If .TRUE., freeze all atoms + to perform relaxation or dynamics only with FCP. + +-------------------------------------------------------------------- + +===END OF NAMELIST====================================================== + + +======================================================================== +NAMELIST: &RISM + + INPUT THIS NAMELIST ONLY IF "TRISM" = .TRUE. + + +-------------------------------------------------------------------- + Variable: nsolv + + Type: INTEGER + Status: REQUIRED + Description: The number of solvents (i.e. molecular species) in the unit cell + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: closure + + Type: CHARACTER + Default: 'kh' + Description: + Specify the type of closure equation: + + 'kh' : + The Kovalenko and Hirata's model. + [A.Kovalenko, F.Hirata, JCP 110, 10095 (1999), doi:10.1063/1.478883] + + 'hnc' : + The HyperNetted-Chain model, which is + suitable only for solvents without charge. + [J.P.Hansen et al., Theory of simple liquids. Academic Press, London, 1990] + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: tempv + + Type: REAL + Default: 300.D0 + Description: Temperature (Kelvin) of solvents. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: ecutsolv + + Type: REAL + Default: 4 * "ecutwfc" + Description: Kinetic energy cutoff (Ry) for solvent's correlation functions. + If a solute is an isolated system or slab, you may allowed to + use default value. For a frameworked or porous solute (e.g. Zeolite, MOF), + it is desirable to apply a larger value. Solvents confined in a framework + often have a high frequency. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: solute_lj(i), i=1,ntyp + + Type: CHARACTER + Default: 'uff' + Description: + Specify the Lennard-Jones potential of solute on atomic type 'i': + + 'none' : + The Lennard-Jones potential is not specified here. + you must set "solute_epsilon" and "solute_sigma". + + 'uff' : + Universal Force Field. + [A.K.Rappe et al., JACS 144, 10024 (1992), doi:10.1021/ja00051a040] + + 'clayff' : + Clay's Force Field + [R.T.Cygan et al., JPC B 108, 1255 (2004), doi:10.1021/jp0363287] + + 'opls-aa' : + OPLS-AA (generic parameters for QM/MM) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: solute_epsilon(i), i=1,ntyp + + Type: REAL + Description: The Lennard-Jones potential of solute on atomic type 'i'. + Here, you can set the parameter 'epsilon' (kcal/mol). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: solute_sigma(i), i=1,ntyp + + Type: REAL + Description: The Lennard-Jones potential of solute on atomic type 'i'. + Here, you can set the parameter 'sigma' (Angstrom). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: starting1d + + Type: CHARACTER + Description: + 'zero' : + Starting correlation functions of 1D-RISM from zero. + ( default for scf, *relax, *md ) + + 'file' : + Start from existing "1d-rism_csvv_r.xml" file in the + directory specified by variables "prefix" and "outdir". + + 'fix' : + Read from existing "1d-rism_csvv_r.xml" file in the + directory specified by variables "prefix" and "outdir", + and never calculate 1D-RISM. + For nscf and bands calculation this is the default. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: starting3d + + Type: CHARACTER + Description: + 'zero' : + Starting correlation functions of 3D-RISM from zero. + ( default for scf, *relax, *md ) + + 'file' : + Start from existing "3d-rism_csuv_r.dat" file in the + directory specified by variables "prefix" and "outdir". + For nscf and bands calculation this is the default. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: smear1d + + Type: REAL + Default: 2.D0 + Description: Coulomb smearing radius (a.u.) for 1D-RISM. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: smear3d + + Type: REAL + Default: 2.D0 + Description: Coulomb smearing radius (a.u.) for 3D-RISM. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rism1d_maxstep + + Type: INTEGER + Default: 50000 + Description: Maximum number of iterations in a 1D-RISM step. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rism3d_maxstep + + Type: INTEGER + Default: 5000 + Description: Maximum number of iterations in a 3D-RISM step. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rism1d_conv_thr + + Type: REAL + Default: 1.D-8 + Description: Convergence threshold for 1D-RISM. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rism3d_conv_thr + + Type: REAL + Default: 1.D-5 if "lgcscf" == .FALSE.; + 5.D-6 if "lgcscf" == .TRUE. + Description: Convergence threshold for 3D-RISM. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: mdiis1d_size + + Type: INTEGER + Default: 20 + Description: Size of Modified DIIS (MDIIS) for 1D-RISM. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: mdiis3d_size + + Type: INTEGER + Default: 10 + Description: Size of Modified DIIS (MDIIS) for 3D-RISM. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: mdiis1d_step + + Type: REAL + Default: 0.5D0 + Description: Step of Modified DIIS (MDIIS) for 1D-RISM. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: mdiis3d_step + + Type: REAL + Default: 0.8D0 + Description: Step of Modified DIIS (MDIIS) for 3D-RISM. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rism1d_bond_width + + Type: REAL + Description: Gaussian width of bonds to smear intra-molecular correlation for 1D-RISM. + If 3D-RISM calculation, default is 0. + If Laue-RISM calculation, default is 2 / SQRT("ecutwfc"). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rism1d_dielectric + + Type: REAL + Default: -1.0D0 + Description: Dielectric constant for 1D-RISM. + If "rism1d_dielectric" > 0, dielectrically consistent RISM (DRISM) is performed. + + For details of DRISM, see: + J.S.Perkyns and B.M.Pettitt, CPL 1992, 190, 626, doi:10.1016/0009-2614(92)85201-K + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rism1d_molesize + + Type: REAL + Default: 2.0D0 + Description: Size of solvent molecules (a.u.) for 1D-RISM. + This is used only if "rism1d_dielectric" > 0. + If you have large molecules, you have to set ~ 20 a.u. . + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rism1d_nproc + + Type: INTEGER + Default: 128 + Description: Number of processes to calculate 1D-RISM. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: rism3d_conv_level + + Type: REAL + Default: 0.1 if "laue_both_hands" == .FALSE. .AND. "lgcscf" == .FALSE.; + 0.3 if "laue_both_hands" == .FALSE. .AND. "lgcscf" == .TRUE.; + 0.5 if "laue_both_hands" == .TRUE. + Description: + Convergence level of 3D-RISM. + + 0.0 : + Convergence level is 'low'. + Convergence threshold of 3D-RISM is greater than + "rism3d_conv_thr", when estimated energy error >> "conv_thr" . + The threshold becomes "rism3d_conv_thr", when + estimated energy error is enough small. + + 0.0 0.0; + -1.0 if "laue_expand_right" <= 0.0 + Description: If positive value, set the buffering length [in a.u.] + of the solvent region on right-hand side of the unit cell. + Then correlation functions are defined inside of + [ "laue_starting_right" - "laue_buffer_right" , L_z/2 + "laue_expand_right" ]. + This is only for Laue-RISM. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: laue_buffer_left + + Type: REAL + Default: 8.0 if "laue_expand_left" > 0.0; + -1.0 if "laue_expand_left" <= 0.0 + Description: If positive value, set the buffering length [in a.u.] + of the solvent region on left-hand side of the unit cell. + Then correlation functions are defined inside of + [ -L_z/2 - "laue_expand_left" , "laue_starting_left" + "laue_buffer_left" ]. + This is only for Laue-RISM. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: laue_both_hands + + Type: LOGICAL + Default: .FALSE. + Description: If .TRUE., you can set different densities + to the solvent regions of right-hand side and left-hand side. + See "SOLVENTS" card. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: laue_wall + + Type: CHARACTER + Default: 'auto' + Description: + Set the repulsive wall with (1/r)^12 term of Lennard-Jones potential. + This is only for Laue-RISM. + + 'none' : + The repulsive wall is not defined. + + 'auto' : + The repulsive wall is defined, whose edge position is set automatically. + One does not have to set "laue_wall_z" (the edge position). + + 'manual' : + The repulsive wall is defined, whose edge position is set manually. + One have to set "laue_wall_z" (the edge position). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: laue_wall_z + + Type: REAL + Default: 0.0 + Description: Set the edge position [in a.u.] of the repulsive wall. + If "laue_expand_right" > 0.0, the repulsive wall is defined on [ -inf , "laue_wall_z" ]. + If "laue_expand_left" > 0.0, the repulsive wall is defined on [ "laue_wall_z" , inf ]. + This is only for Laue-RISM and "laue_wall" == 'manual' . + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: laue_wall_rho + + Type: REAL + Default: 0.01 + Description: The density (1/bohr^3) of the repulsive wall. + This is only for Laue-RISM and "laue_wall" /= 'none' . + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: laue_wall_epsilon + + Type: REAL + Default: 0.1 + Description: The Lennard-Jones potential of the repulsive wall. + Here, you can set the parameter 'epsilon' (kcal/mol). + This is only for Laue-RISM and "laue_wall" /= 'none' . + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: laue_wall_sigma + + Type: REAL + Default: 4.0 + Description: The Lennard-Jones potential of the repulsive wall. + Here, you can set the parameter 'sigma' (Angstrom). + This is only for Laue-RISM and "laue_wall" /= 'none' . + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: laue_wall_lj6 + + Type: LOGICAL + Default: .FALSE. + Description: If .TRUE., the attractive term -(1/r)^6 of Lennard-Jones potential is added. + This is only for Laue-RISM and "laue_wall" /= 'none' . + +-------------------------------------------------------------------- + +===END OF NAMELIST====================================================== + + +======================================================================== +CARD: ATOMIC_SPECIES + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + ATOMIC_SPECIES + X(1) Mass_X(1) PseudoPot_X(1) + X(2) Mass_X(2) PseudoPot_X(2) + . . . + X(ntyp) Mass_X(ntyp) PseudoPot_X(ntyp) + + ///////////////////////////////////////// + + DESCRIPTION OF ITEMS: + + +-------------------------------------------------------------------- + Variable: X + + Type: CHARACTER + Description: label of the atom. Acceptable syntax: + chemical symbol X (1 or 2 characters, case-insensitive) + or chemical symbol plus a number or a letter, as in + "Xn" (e.g. Fe1) or "X_*" or "X-*" (e.g. C1, C_h; + max total length cannot exceed 3 characters) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: Mass_X + + Type: REAL + Description: mass of the atomic species [amu: mass of C = 12] + Used only when performing Molecular Dynamics run + or structural optimization runs using Damped MD. + Not actually used in all other cases (but stored + in data files, so phonon calculations will use + these values unless other values are provided) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: PseudoPot_X + + Type: CHARACTER + Description: File containing PP for this species. + + The pseudopotential file is assumed to be in the new UPF format. + If it doesn't work, the pseudopotential format is determined by + the file name: + + *.vdb or *.van Vanderbilt US pseudopotential code + *.RRKJ3 Andrea Dal Corso's code (old format) + none of the above old PWscf norm-conserving format + +-------------------------------------------------------------------- + +===END OF CARD========================================================== + + +======================================================================== +CARD: ATOMIC_POSITIONS { alat | bohr | angstrom | crystal | crystal_sg } + + ________________________________________________________________________ + * IF calculation == 'bands' OR calculation == 'nscf' : + + Specified atomic positions will be IGNORED and those from the + previous scf calculation will be used instead !!! + + + * ELSE : + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + ATOMIC_POSITIONS { alat | bohr | angstrom | crystal | crystal_sg } + X(1) x(1) y(1) z(1) { if_pos(1)(1) if_pos(2)(1) if_pos(3)(1) } + X(2) x(2) y(2) z(2) { if_pos(1)(2) if_pos(2)(2) if_pos(3)(2) } + . . . + X(nat) x(nat) y(nat) z(nat) { if_pos(1)(nat) if_pos(2)(nat) if_pos(3)(nat) } + + ///////////////////////////////////////// + + + ENDIF + ________________________________________________________________________ + + DESCRIPTION OF ITEMS: + + +-------------------------------------------------------------------- + Card's flags: { alat | bohr | angstrom | crystal | crystal_sg } + + Default: (DEPRECATED) alat + Description: + Units for ATOMIC_POSITIONS: + + alat : + atomic positions are in cartesian coordinates, in + units of the lattice parameter (either celldm(1) + or A). If no option is specified, 'alat' is assumed; + not specifying units is DEPRECATED and will no + longer be allowed in the future + + bohr : + atomic positions are in cartesian coordinate, + in atomic units (i.e. Bohr radii) + + angstrom : + atomic positions are in cartesian coordinates, in Angstrom + + crystal : + atomic positions are in crystal coordinates, i.e. + in relative coordinates of the primitive lattice + vectors as defined either in card "CELL_PARAMETERS" + or via the ibrav + celldm / a,b,c... variables + + crystal_sg : + atomic positions are in crystal coordinates, i.e. + in relative coordinates of the primitive lattice. + This option differs from the previous one because + in this case only the symmetry inequivalent atoms + are given. The variable "space_group" must indicate + the space group number used to find the symmetry + equivalent atoms. The other variables that control + this option are uniqueb, origin_choice, and + rhombohedral. + +-------------------------------------------------------------------- + + + +-------------------------------------------------------------------- + Variable: X + + Type: CHARACTER + Description: label of the atom as specified in "ATOMIC_SPECIES" + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: x, y, z + + Type: REAL + Description: atomic positions + + NOTE: each atomic coordinate can also be specified as a simple algebraic expression. + To be interpreted correctly expression must NOT contain any blank + space and must NOT start with a "+" sign. The available expressions are: + + + (plus), - (minus), / (division), * (multiplication), ^ (power) + + All numerical constants included are considered as double-precision numbers; + i.e. 1/2 is 0.5, not zero. Other functions, such as sin, sqrt or exp are + not available, although sqrt can be replaced with ^(1/2). + + Example: + C 1/3 1/2*3^(-1/2) 0 + + is equivalent to + + C 0.333333 0.288675 0.000000 + + Please note that this feature is NOT supported by XCrysDen (which will + display a wrong structure, or nothing at all). + + When atomic positions are of type crystal_sg coordinates can be given + in the following four forms (Wyckoff positions): + C 1a + C 8g x + C 24m x y + C 48n x y z + The first form must be used when the Wyckoff letter determines uniquely + all three coordinates, forms 2,3,4 when the Wyckoff letter and 1,2,3 + coordinates respectively are needed. + + The forms: + C 8g x x x + C 24m x x y + are not allowed, but + C x x x + C x x y + C x y z + are correct. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: if_pos(1), if_pos(2), if_pos(3) + + Type: INTEGER + Default: 1 + Description: component i of the force for this atom is multiplied by if_pos(i), + which must be either 0 or 1. Used to keep selected atoms and/or + selected components fixed in MD dynamics or + structural optimization run. + + With crystal_sg atomic coordinates the constraints are copied in all equivalent + atoms. + +-------------------------------------------------------------------- + +===END OF CARD========================================================== + + +======================================================================== +CARD: K_POINTS { tpiba | automatic | crystal | gamma | tpiba_b | crystal_b | tpiba_c | crystal_c } + + ________________________________________________________________________ + * IF tpiba OR crystal OR tpiba_b OR crystal_b OR tpiba_c OR crystal_c : + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + K_POINTS tpiba | crystal | tpiba_b | crystal_b | tpiba_c | crystal_c + nks + xk_x(1) xk_y(1) xk_z(1) wk(1) + xk_x(2) xk_y(2) xk_z(2) wk(2) + . . . + xk_x(nks) xk_y(nks) xk_z(nks) wk(nks) + + ///////////////////////////////////////// + + + * ELSE IF automatic : + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + K_POINTS automatic + nk1 nk2 nk3 sk1 sk2 sk3 + + ///////////////////////////////////////// + + + * ELSE IF gamma : + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + K_POINTS gamma + + ///////////////////////////////////////// + + + ENDIF + ________________________________________________________________________ + + DESCRIPTION OF ITEMS: + + +-------------------------------------------------------------------- + Card's flags: { tpiba | automatic | crystal | gamma | tpiba_b | crystal_b | tpiba_c | crystal_c } + + Default: tbipa + Description: + K_POINTS options are: + + tpiba : + read k-points in cartesian coordinates, + in units of 2 pi/a (default) + + automatic : + automatically generated uniform grid of k-points, i.e, + generates ( nk1, nk2, nk3 ) grid with ( sk1, sk2, sk3 ) offset. + nk1, nk2, nk3 as in Monkhorst-Pack grids + k1, k2, k3 must be 0 ( no offset ) or 1 ( grid displaced + by half a grid step in the corresponding direction ) + BEWARE: only grids having the full symmetry of the crystal + work with tetrahedra. Some grids with offset may not work. + + crystal : + read k-points in crystal coordinates, i.e. in relative + coordinates of the reciprocal lattice vectors + + gamma : + use k = 0 (no need to list k-point specifications after card) + In this case wavefunctions can be chosen as real, + and specialized subroutines optimized for calculations + at the gamma point are used (memory and cpu requirements + are reduced by approximately one half). + + tpiba_b : + Used for band-structure plots. + See Doc/brillouin_zones.pdf for usage of BZ labels; + otherwise, k-points are in units of 2 pi/a. + nks points specify nks-1 lines in reciprocal space. + Every couple of points identifies the initial and + final point of a line. pw.x generates N intermediate + points of the line where N is the weight of the first point. + + crystal_b : + As tpiba_b, but k-points are in crystal coordinates. + See Doc/brillouin_zones.pdf for usage of BZ labels. + + tpiba_c : + Used for band-structure contour plots. + k-points are in units of 2 pi/a. nks must be 3. + 3 k-points k_0, k_1, and k_2 specify a rectangle + in reciprocal space of vertices k_0, k_1, k_2, + k_1 + k_2 - k_0: k_0 + \alpha (k_1-k_0)+ + \beta (k_2-k_0) with 0 <\alpha,\beta < 1. + The code produces a uniform mesh n1 x n2 + k points in this rectangle. n1 and n2 are + the weights of k_1 and k_2. The weight of k_0 + is not used. + + crystal_c : + As tpiba_c, but k-points are in crystal coordinates. + +-------------------------------------------------------------------- + + + +-------------------------------------------------------------------- + Variable: nks + + Type: INTEGER + Description: Number of supplied special k-points. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: xk_x, xk_y, xk_z, wk + + Type: REAL + Description: Special k-points (xk_x/y/z) in the irreducible Brillouin Zone + (IBZ) of the lattice (with all symmetries) and weights (wk) + See the literature for lists of special points and + the corresponding weights. + + If the symmetry is lower than the full symmetry + of the lattice, additional points with appropriate + weights are generated. Notice that such procedure + assumes that ONLY k-points in the IBZ are provided in input + + In a non-scf calculation, weights do not affect the results. + If you just need eigenvalues and eigenvectors (for instance, + for a band-structure plot), weights can be set to any value + (for instance all equal to 1). + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: nk1, nk2, nk3 + + Type: INTEGER + Description: These parameters specify the k-point grid + (nk1 x nk2 x nk3) as in Monkhorst-Pack grids. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: sk1, sk2, sk3 + + Type: INTEGER + Description: The grid offsets; sk1, sk2, sk3 must be + 0 ( no offset ) or 1 ( grid displaced by + half a grid step in the corresponding direction ). + +-------------------------------------------------------------------- + +===END OF CARD========================================================== + + +======================================================================== +CARD: ADDITIONAL_K_POINTS { tpiba | crystal | tpiba_b | crystal_b | tpiba_c | crystal_c } + + Optional card. Adds a list of k-points with zero weight, after those used for + the scf calculation. When doing an EXX calculation and "nq1x", "nq2x" or "nq3x" are + different from one, also include the required k+q points. The main use of this + card is to do band plots with EXX. + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + ADDITIONAL_K_POINTS tpiba | crystal | tpiba_b | crystal_b | tpiba_c | crystal_c + nks_add + k_x(1) k_y(1) k_z(1) wk_(1) + k_x(2) k_y(2) k_z(2) wk_(2) + . . . + k_x(nks_add) k_y(nks_add) k_z(nks_add) wk_(nks_add) + + ///////////////////////////////////////// + + DESCRIPTION OF ITEMS: + + +-------------------------------------------------------------------- + Card's flags: { tpiba | crystal | tpiba_b | crystal_b | tpiba_c | crystal_c } + + Default: tbipa + Description: for the explanation of the K_POINTS' options, see "K_POINTS" + +-------------------------------------------------------------------- + + + +-------------------------------------------------------------------- + Variable: nks_add + + Type: INTEGER + Description: Number of supplied "additional" k-points. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: k_x, k_y, k_z, wk_ + + Type: REAL + Description: for the respective explanation, see the "xk_x", "xk_y", "xk_z", "wk" + +-------------------------------------------------------------------- + +===END OF CARD========================================================== + + +======================================================================== +CARD: CELL_PARAMETERS { alat | bohr | angstrom } + + OPTIONAL CARD, MUST BE PRESENT IF "IBRAV" == 0, MUST BE ABSENT OTHERWISE + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + CELL_PARAMETERS { alat | bohr | angstrom } + v1(1) v1(2) v1(3) + v2(1) v2(2) v2(3) + v3(1) v3(2) v3(3) + + ///////////////////////////////////////// + + DESCRIPTION OF ITEMS: + + +-------------------------------------------------------------------- + Card's flags: { alat | bohr | angstrom } + + Description: Unit for lattice vectors; options are: + + 'bohr' / 'angstrom': + lattice vectors in bohr-radii / angstrom. + In this case the lattice parameter alat = sqrt(v1*v1). + + 'alat' / nothing specified: + lattice vectors in units of the lattice parameter (either + "celldm"(1) or "A"). Not specifying units is DEPRECATED + and will not be allowed in the future. + + If neither unit nor lattice parameter are specified, + 'bohr' is assumed - DEPRECATED, will no longer be allowed + +-------------------------------------------------------------------- + + + +-------------------------------------------------------------------- + Variables: v1, v2, v3 + + Type: REAL + Description: Crystal lattice vectors (in cartesian axis): + v1(1) v1(2) v1(3) ... 1st lattice vector + v2(1) v2(2) v2(3) ... 2nd lattice vector + v3(1) v3(2) v3(3) ... 3rd lattice vector + +-------------------------------------------------------------------- + +===END OF CARD========================================================== + + +======================================================================== +CARD: CONSTRAINTS + + OPTIONAL CARD, USED FOR CONSTRAINED DYNAMICS OR CONSTRAINED OPTIMIZATIONS + (ONLY IF "ION_DYNAMICS"=='DAMP' OR 'VERLET', VARIABLE-CELL EXCEPTED) + + When this card is present the SHAKE algorithm is automatically used. + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + CONSTRAINTS + nconstr { constr_tol } + constr_type(1) constr(1)(1) constr(2)(1) [ constr(3)(1) constr(4)(1) ] { constr_target(1) } + constr_type(2) constr(1)(2) constr(2)(2) [ constr(3)(2) constr(4)(2) ] { constr_target(2) } + . . . + constr_type(nconstr) constr(1)(nconstr) constr(2)(nconstr) [ constr(3)(nconstr) constr(4)(nconstr) ] { constr_target(nconstr) } + + ///////////////////////////////////////// + + DESCRIPTION OF ITEMS: + + +-------------------------------------------------------------------- + Variable: nconstr + + Type: INTEGER + Description: Number of constraints. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: constr_tol + + Type: REAL + Description: Tolerance for keeping the constraints satisfied. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: constr_type + + Type: CHARACTER + Description: + Type of constraint : + + 'type_coord' : + constraint on global coordination-number, i.e. the + average number of atoms of type B surrounding the + atoms of type A. The coordination is defined by + using a Fermi-Dirac. + (four indexes must be specified). + + 'atom_coord' : + constraint on local coordination-number, i.e. the + average number of atoms of type A surrounding a + specific atom. The coordination is defined by + using a Fermi-Dirac. + (four indexes must be specified). + + 'distance' : + constraint on interatomic distance + (two atom indexes must be specified). + + 'planar_angle' : + constraint on planar angle + (three atom indexes must be specified). + + 'torsional_angle' : + constraint on torsional angle + (four atom indexes must be specified). + + 'bennett_proj' : + constraint on the projection onto a given direction + of the vector defined by the position of one atom + minus the center of mass of the others. + G. Roma, J.P. Crocombette: J. Nucl. Mater. 403, 32 (2010), + doi:10.1016/j.jnucmat.2010.06.001 + + 'potential_wall' : + (experimental) add a potential wall at the origin + normal to the the z-axis. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: constr(1), constr(2), constr(3), constr(4) + + Description: These variables have different meanings for different constraint types: + + 'type_coord' : + constr(1) is the first index of the atomic type involved + constr(2) is the second index of the atomic type involved + constr(3) is the cut-off radius for estimating the coordination + constr(4) is a smoothing parameter + + 'atom_coord' : + constr(1) is the atom index of the atom with constrained coordination + constr(2) is the index of the atomic type involved in the coordination + constr(3) is the cut-off radius for estimating the coordination + constr(4) is a smoothing parameter + + 'distance' : + atoms indices object of the constraint, as they appear in + the "ATOMIC_POSITIONS" card + + 'planar_angle', 'torsional_angle' : + atoms indices object of the constraint, as they appear in the + "ATOMIC_POSITIONS" card (beware the order) + + 'bennett_proj' : + constr(1) is the index of the atom whose position is constrained. + constr(2:4) are the three coordinates of the vector that specifies + the constraint direction. + 'potential_wall' : + Formula is: External force = prefac * exponent * Exp(-exponent). Force is only applied + on atoms within the cutoff. + constr(1) is the prefactor + constr(2) is the value in the exponent + constr(3) is the cutoff (in a.u.) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: constr_target + + Type: REAL + Description: Target for the constrain ( angles are specified in degrees ). + This variable is optional. + +-------------------------------------------------------------------- + +===END OF CARD========================================================== + + +======================================================================== +CARD: OCCUPATIONS + + OPTIONAL CARD, USED ONLY IF "OCCUPATIONS" == 'FROM_INPUT', IGNORED OTHERWISE ! + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + OCCUPATIONS + f_inp1(1) f_inp1(2) . . . f_inp1(nbnd) + [ f_inp2(1) f_inp2(2) . . . f_inp2(nbnd) ] + + + ///////////////////////////////////////// + + DESCRIPTION OF ITEMS: + + +-------------------------------------------------------------------- + Variable: f_inp1 + + Type: REAL + Description: Occupations of individual states (MAX 10 PER ROW). + For spin-polarized calculations, these are majority spin states. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: f_inp2 + + Type: REAL + Description: Occupations of minority spin states (MAX 10 PER ROW) + To be specified only for spin-polarized calculations. + +-------------------------------------------------------------------- + +===END OF CARD========================================================== + + +======================================================================== +CARD: ATOMIC_VELOCITIES { a.u } + + OPTIONAL CARD, READS VELOCITIES FROM STANDARD INPUT + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + ATOMIC_VELOCITIES { a.u } + V(1) vx(1) vy(1) vz(1) + V(2) vx(2) vy(2) vz(2) + . . . + V(nat) vx(nat) vy(nat) vz(nat) + + ///////////////////////////////////////// + + DESCRIPTION OF ITEMS: + + +-------------------------------------------------------------------- + Card's flags: { a.u } + + +-------------------------------------------------------------------- + + + +-------------------------------------------------------------------- + Variable: V + + Type: CHARACTER + Description: label of the atom as specified in ATOMIC_SPECIES + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: vx, vy, vz + + Type: REAL + Description: atomic velocities along x y and z direction + +-------------------------------------------------------------------- + +===END OF CARD========================================================== + + +======================================================================== +CARD: ATOMIC_FORCES + + OPTIONAL CARD USED TO SPECIFY EXTERNAL FORCES ACTING ON ATOMS. + + BEWARE: if the sum of external forces is not zero, the center of mass of + the system will move + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + ATOMIC_FORCES + X(1) fx(1) fy(1) fz(1) + X(2) fx(2) fy(2) fz(2) + . . . + X(nat) fx(nat) fy(nat) fz(nat) + + ///////////////////////////////////////// + + DESCRIPTION OF ITEMS: + + +-------------------------------------------------------------------- + Variable: X + + Type: CHARACTER + Description: label of the atom as specified in "ATOMIC_SPECIES" + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: fx, fy, fz + + Type: REAL + Description: external force on atom X (cartesian components, Ry/a.u. units) + +-------------------------------------------------------------------- + +===END OF CARD========================================================== + + +======================================================================== +CARD: SOLVENTS { 1/cell | mol/L | g/cm^3 } + + OPTIONAL CARD, USED ONLY IF "TRISM" = .TRUE., IGNORED OTHERWISE ! + + ________________________________________________________________________ + * IF laue_both_hands = .FALSE. : + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + SOLVENTS { 1/cell | mol/L | g/cm^3 } + X(1) Density(1) Molecule(1) + X(2) Density(2) Molecule(2) + . . . + X(nsolv) Density(nsolv) Molecule(nsolv) + + ///////////////////////////////////////// + + + * ELSE IF laue_both_hands = .TRUE. : + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + SOLVENTS { 1/cell | mol/L | g/cm^3 } + X(1) Density_Left(1) Density_Right(1) Molecule(1) + X(2) Density_Left(2) Density_Right(2) Molecule(2) + . . . + X(nsolv) Density_Left(nsolv) Density_Right(nsolv) Molecule(nsolv) + + ///////////////////////////////////////// + + + ENDIF + ________________________________________________________________________ + + DESCRIPTION OF ITEMS: + + +-------------------------------------------------------------------- + Card's flags: { 1/cell | mol/L | g/cm^3 } + + Description: + 1/cell : + solvent's densities are specified + as number of molecules in the unit cell. + + mol/L : + solvent's densities are specified as molar concentrations. + + g/cm^3 : + solvent's densities are in gram per cm^3. + +-------------------------------------------------------------------- + + + +-------------------------------------------------------------------- + Variable: X + + Type: CHARACTER + Description: label of the solvent molecule. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: Density + + Type: REAL + Description: density of the solvent molecule. + if not positive value is set, density is read from MOL-file. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: Molecule + + Type: CHARACTER + Description: MOL-file of the solvent molecule. + in the MOL-file, molecular structure and some other data are written. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: X + + Type: CHARACTER + Description: label of the solvent molecule. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: Density_Left + + Type: REAL + Description: density of the solvent molecule in the left-hand side. + if not positive value is set, density is read from MOL-file. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: Density_Right + + Type: REAL + Description: density of the solvent molecule in the right-hand side. + if not positive value is set, density is read from MOL-file. + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variable: Molecule + + Type: CHARACTER + Description: MOL-file of the solvent molecule. + in the MOL-file, molecular structure and some other data are written. + +-------------------------------------------------------------------- + +===END OF CARD========================================================== + + +======================================================================== +CARD: HUBBARD atomic | ortho-atomic | norm-atomic | wf | pseudo + + ________________________________________________________________________ + * IF DFT+U : + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + HUBBARD atomic | ortho-atomic | norm-atomic | wf | pseudo + U label(1)-manifold(1) u_val(1) + [ J0 label(1)-manifold(1) j0_val(1) ] + . . . + U label(n)-manifold(n) u_val(n) + [ J0 label(n)-manifold(n) j0_val(n) ] + + ///////////////////////////////////////// + + + * ELSE IF DFT+U+J : + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + HUBBARD atomic | ortho-atomic | norm-atomic | wf | pseudo + paramType(1) label(1)-manifold(1) paramValue(1) + . . . + paramType(n) label(n)-manifold(n) paramValue(n) + + ///////////////////////////////////////// + + + * ELSE IF DFT+U+V : + + ///////////////////////////////////////// + // Syntax: // + ///////////////////////////////////////// + + HUBBARD atomic | ortho-atomic | norm-atomic | wf | pseudo + U label(I)-manifold(I) u_val(I) + [ J0 label(I)-manifold(I) j0_val(I) ] + V label(I)-manifold(I) label(J)-manifold(J) I J v_val(I,J) + . . . + U label(N)-manifold(N) u_val(N) + [ J0 label(N)-manifold(N) j0_val(N) ] + V label(N)-manifold(N) label(M)-manifold(M) N M v_val(N,M) + + ///////////////////////////////////////// + + + ENDIF + ________________________________________________________________________ + + DESCRIPTION OF ITEMS: + + +-------------------------------------------------------------------- + Card's flags: atomic | ortho-atomic | norm-atomic | wf | pseudo + + Description: + HUBBARD options are: + + atomic : + use atomic orbitals (read from pseudopotential) to build the + Hubbard projectors + + ortho-atomic : + use Lowdin orthogonalized atomic orbitals. This option is + recommended to be used whenever possible instead of atomic + because it allows to avoid applying Hubbard corrections twice + in the orbital overlap regions. + + norm-atomic : + Lowdin normalization of atomic orbitals. Keep in mind: + atomic orbitals are not orthogonalized in this case. + This is a "quick and dirty" trick to be used when + atomic orbitals from the pseudopotential are not + normalized (and thus produce occupation whose + value exceeds unity). + + wf : + use Wannier functions to built Hubbard projectors. + The information about the Wannier functionas are read + from file "prefix".hub that must be generated using pmw.x + (see PP/src/poormanwannier.f90 for details). + Note: these are not maximally localized Wannier functions. + (see PP/examples/example05) + + pseudo : + use the pseudopotential projectors. The charge density + outside the atomic core radii is excluded. + N.B.: for atoms with +U, a pseudopotential with the + all-electron atomic orbitals are required (i.e., + as generated by ld1.x with lsave_wfc flag). + + NB: forces and stress are currently implemented only for the + 'atomic', 'ortho-atomic', and 'pseudo' Hubbard projectors. + + Check Doc/Hubbard_input.pdf to see how to specify Hubbard parameters + U, J0, J, B, E2, E3, V in the HUBBARD card. + +-------------------------------------------------------------------- + + + +-------------------------------------------------------------------- + Variables: label(1)-manifold(1), u_val(1) + + Type: CHARACTER-LITERAL, CHARACTER, REAL + Description: Syntax: + U label-manifold u_val + + Where: + U = string constant "U"; indicates the specs for the U parameter will be given + label = label of the atom (as defined in "ATOMIC_SPECIES") + manifold = specs of the manifold (e.g., 3d, 2p...) + u_val = value of the U parameter (in eV) + + Example: + HUBBARD (ortho-atomic) + U Mn-3d 5.0 + U Ni-3d 6.0 + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: label(1)-manifold(1), j0_val(1) + + Type: CHARACTER-LITERAL, CHARACTER, REAL + Description: Remark: specs of J0 parameters are optional + + Syntax: + J0 label-manifold j0_val + + Where: + J0 = string constant "J0"; indicates the specs for the J0 parameter will be given + label = label of the atom (as defined in "ATOMIC_SPECIES") + manifold = specs of the manifold (e.g., 3d, 2p...) + j0_val = value of the J0 parameter (in eV) + + Example: + HUBBARD (ortho-atomic) + U Mn-3d 5.0 + J0 Mn-3d 1.0 + U Ni-3d 6.0 + J0 Ni-3d 1.2 + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: paramType(1), label(1)-manifold(1), paramValue(1) + + Type: CHARACTER, CHARACTER, REAL + Description: Syntax of the line: + + paramType label-manifold paramValue + + Where: + paramType = character describing the type of Hubbard parameter + allowed values: U, J and either B (for d-orbitals) or E2 and E3 (for f-orbitals) + label = label of the atom (as defined in "ATOMIC_SPECIES") + manifold = specs of the manifold (e.g., 3d, 2p...) + paramValue = value of the parameter (in eV) + + Example: + HUBBARD (ortho-atomic) + U Mn-3d 5.0 + J Mn-3d 1.0 + B Mn-3d 1.1 + U Ni-3d 6.0 + J Ni-3d 1.2 + B Ni-3d 1.3 + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: label(I)-manifold(I), u_val(I) + + Type: CHARACTER, REAL + Description: Syntax of the line: + + U label-manifold u_val + + Where: + U = string constant "U"; indicates the specs for the U parameter will be given + label = label of the atom (as defined in "ATOMIC_SPECIES") + manifold = specs of the manifold (e.g., 3d, 2p...) + u_val = value of the U parameter (in eV) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: label(I)-manifold(I), j0_val(I) + + Type: CHARACTER, REAL + Description: Remark: specs of J0 parameters are optional + + Syntax of the line: + + J0 label(I)-manifold(I) j0_val(I) + + Where: + J0 = string constant "J0"; indicates the specs for the J0 parameter will be given + label = label of the atom (as defined in "ATOMIC_SPECIES") + manifold = specs of the manifold (e.g., 3d, 2p...) + j0_val = value of the J0 parameter (in eV) + +-------------------------------------------------------------------- + + +-------------------------------------------------------------------- + Variables: label(I)-manifold(I), label(J)-manifold(J), I, J, v_val(I,J) + + Type: CHARACTER, CHARACTER, INTEGER, INTEGER, REAL + Description: Syntax of the line: + + V label(I)-manifold(J) label(J)-manifold(J) I J v_val(I,J) + + Where: + V = string constant "V"; indicates the specs for the V parameter will be given + label(I) = label of the atom I (as defined in "ATOMIC_SPECIES") + manifold(I) = specs of the manifold for atom I (e.g., 3d, 2p...) + label(J) = label of the atom J (as defined in "ATOMIC_SPECIES") + manifold(J) = specs of the manifold for atom J (e.g., 3d, 2p...) + I = index of the atom I + J = index of the atom J + v_val(I,J) = value of the V parameter for the atom pair I,J (in eV) + + Example: + HUBBARD (ortho-atomic) + U Co-3d 7.70 + V Co-3d O-2p 1 19 0.75 + V Co-3d O-2p 1 46 0.75 + V Co-3d O-2p 1 43 0.75 + V Co-3d O-2p 1 54 0.75 + V Co-3d O-2p 1 11 0.75 + V Co-3d O-2p 1 22 0.75 + +-------------------------------------------------------------------- + +===END OF CARD========================================================== + + +This file has been created by helpdoc utility on Sat Mar 18 16:00:16 CET 2023 diff --git a/deps/asset_init.jl b/deps/asset_init.jl index 930a296f..c88e8700 100644 --- a/deps/asset_init.jl +++ b/deps/asset_init.jl @@ -247,6 +247,19 @@ open(joinpath(@__DIR__, "qeflags.jl"), "w") do wf return write(wf, "]") end +open(joinpath(@__DIR__, "qe7.2flags.jl"), "w") do wf + write(wf, "_QE7_2INPUTINFOS() = QECalculationInfo[\n") + calculation_files = searchdir(joinpath(@__DIR__, "..", "assets", "calculations", "qe"), + "INPUT") + filepaths = joinpath.(Ref(joinpath(@__DIR__, "..", "assets", "calculations", "qe")), + calculation_files) + for _f in filepaths + exec_name = join([lowercase(splitext(split(_f, "_")[end])[1]), ".x"], "") + write_QECalculationInfo(wf, _f, 1, exec_name) + end + return write(wf, "]") +end + open(joinpath(@__DIR__, "abinitflags.jl"), "w") do wf flaglines = split.(readlines(joinpath(@__DIR__, "..", "assets", "calculations", "abinit", "calculation_variables.txt"))) diff --git a/src/Calculations/Calculations.jl b/src/Calculations/Calculations.jl index 320fb8ba..767c008d 100644 --- a/src/Calculations/Calculations.jl +++ b/src/Calculations/Calculations.jl @@ -16,5 +16,5 @@ include("documentation.jl") include("julia.jl") export Calculation, InputData -export Wannier90, QE, Abinit, Elk, Julia, set_flags! +export Wannier90, QE, QE7_2, Abinit, Elk, Julia, set_flags! end diff --git a/src/Calculations/calculation.jl b/src/Calculations/calculation.jl index 912ab624..15e382a9 100644 --- a/src/Calculations/calculation.jl +++ b/src/Calculations/calculation.jl @@ -36,6 +36,7 @@ abstract type Package end struct NoPackage <: Package end struct Wannier90 <: Package end struct QE <: Package end +struct QE7_2 <: Package end struct Abinit <: Package end struct Elk <: Package end StructTypes.StructType(::Type{<:Package}) = StructTypes.Struct() @@ -293,7 +294,7 @@ function set_flags!(c::Calculation{T}, flags...; print = true) where {T} end old_data = haskey(c, flag) ? c[flag] : "" - if eltype(c) == QE + if eltype(c) == QE || eltype(c) == QE7_2 block, _ = qe_block_variable(c, flag) if block == :error error("""Block for flag $flag could not be found, please set it manually using .flags[][$flag] = $value""") @@ -441,117 +442,19 @@ function sanitize_flags!(cs::Vector{<:Calculation}, str::Structure, name, outdir end end end - - u_ats = unique(str.atoms) - isnc = Structures.isnoncolin(str) - flags_to_set = [] - if any(x -> x.dftu.U != 0 || - x.dftu.J0 != 0.0 || - sum(x.dftu.J) != 0 || - sum(x.dftu.α) != 0, u_ats) - Jmap = map(x -> copy(x.dftu.J), u_ats) - Jdim = maximum(length.(Jmap)) - Jarr = zeros(Jdim, length(u_ats)) - for (i, J) in enumerate(Jmap) - diff = Jdim - length(J) - if diff > 0 - for d in 1:diff - push!(J, zero(eltype(J))) - end - end - Jarr[:, i] .= J - end - append!(flags_to_set, - [:Hubbard_U => map(x -> x.dftu.U, u_ats), - :Hubbard_alpha => map(x -> x.dftu.α, u_ats), - :Hubbard_beta => map(x -> x.dftu.β, u_ats), :Hubbard_J => Jarr, - :Hubbard_J0 => map(x -> x.dftu.J0, u_ats)]) - end - if !isempty(flags_to_set) || any(x -> hasflag(x, :Hubbard_parameters), cs) - push!(flags_to_set, :lda_plus_u => true) - if isnc - push!(flags_to_set, :lda_plus_u_kind => 1) - end - end - if !isempty(flags_to_set) - for c in cs - set_flags!(c, flags_to_set...; print = false) - end - else - for c in cs - for f in - (:lda_plus_u, :lda_plus_u_kind, :Hubbard_U, :Hubbard_alpha, :Hubbard_beta, - :Hubbard_J, :Hubbard_J0, :U_projection_type) - pop!(c, f, nothing) - end - end - end - - flags_to_set = [] - mags = map(x -> x.magnetization, u_ats) - starts = Float64[] - θs = Float64[] - ϕs = Float64[] - ismagcalc = isnc ? true : Structures.ismagnetic(str) || any(x->haskey(x, :tot_magnetization), cs) - if ismagcalc - if isnc || any(x -> get(x, :noncolin, false), cs) - for m in mags - tm = normalize(m) - if norm(m) == 0 - push!.((starts, θs, ϕs), 0.0) - else - θ = acos(tm[3]) * 180 / π - ϕ = atan(tm[2], tm[1]) * 180 / π - start = norm(m) - push!(θs, θ) - push!(ϕs, ϕ) - push!(starts, start) - end - end - push!(flags_to_set, :noncolin => true) - else - for m in mags - push!.((θs, ϕs), 0.0) - if norm(m) == 0 - push!(starts, 0) - else - push!(starts, sign(sum(m)) * norm(m)) - end - end - end - append!(flags_to_set, [:starting_magnetization => starts, :angle1 => θs, :angle2 => ϕs, :nspin => 2]) - end for c in cs + set_flags!(c, :prefix => name, :outdir => outdir, print=false) try - set_flags!(c, :prefix => "$name", :outdir => "$outdir"; print = false) - if ispw(c) - set_flags!(c, flags_to_set...; print = false) - if isnc - pop!(c, :nspin, nothing) - end - if isvcrelax(c) - #this is to make sure &ions and &cell are there in the calculation - !hasflag(c, :ion_dynamics) && - set_flags!(c, :ion_dynamics => "bfgs"; print = false) - !hasflag(c, :cell_dynamics) && - set_flags!(c, :cell_dynamics => "bfgs"; print = false) - end - #TODO add all the required flags - @assert hasflag(c, :calculation) "Please set the flag for calculation with name: $(name(c))" - - set_flags!(c, :pseudo_dir => "."; print = false) - end convert_flags!(c) catch @warn "Something went wrong trying to sanitize the flags for calc $(c.name)" end end - return end rm_tmp_flags!(::Calculation) = nothing -function rm_tmp_flags!(c::Calculation{QE}) +function rm_tmp_flags!(c::Union{Calculation{QE}, Calculation{QE7_2}}) pop!(c, :prefix, nothing) pop!(c, :outdir, nothing) return pop!(c, :nspin, nothing) diff --git a/src/Calculations/documentation.jl b/src/Calculations/documentation.jl index c1985725..c54acf2f 100644 --- a/src/Calculations/documentation.jl +++ b/src/Calculations/documentation.jl @@ -10,7 +10,22 @@ Returns the documentation for a given flag. """ function documentation(::Type{QE}, searchstring::AbstractString) found = Pair{String,Vector{QEFlagInfo}}[] - for calculationinfo in QECalculationInfos + for calculationinfo in QECalculationInfos[] + foundflags = QEFlagInfo[] + for fi in allflags(calculationinfo) + if occursin(searchstring, fi.description) + push!(foundflags, fi) + end + end + if !isempty(foundflags) + push!(found, calculationinfo.exec => foundflags) + end + end + return found +end +function documentation(::Type{QE7_2}, searchstring::AbstractString) + found = Pair{String,Vector{QEFlagInfo}}[] + for calculationinfo in QE7_2CalculationInfos[] foundflags = QEFlagInfo[] for fi in allflags(calculationinfo) if occursin(searchstring, fi.description) diff --git a/src/Calculations/qe.jl b/src/Calculations/qe.jl index e2e02680..cf1672c1 100644 --- a/src/Calculations/qe.jl +++ b/src/Calculations/qe.jl @@ -1,3 +1,4 @@ +const QE_CALCULATION = Union{Calculation{QE}, Calculation{QE7_2}} #QE calls these flags struct QEFlagInfo{T} name::Symbol @@ -46,42 +47,93 @@ function allflags(info::QECalculationInfo) return vcat([[i.flags for i in info.control]; [i.flags for i in info.data]]...) end -include(joinpath(DEPS_DIR, "qeflags.jl")) -const QECalculationInfos = _QEINPUTINFOS() -push!(QECalculationInfos, - QECalculationInfo("pw2wannier90.x", - [QEControlBlockInfo(:inputpp, - [QEFlagInfo{String}(:outdir, - "location of temporary output files"), - QEFlagInfo{String}(:prefix, - "pwscf filename prefix"), - QEFlagInfo{String}(:seedname, - "wannier90 calculation/output filename prefix"), - QEFlagInfo{String}(:wan_mode, - "'standalone' or 'library'"), - QEFlagInfo{String}(:spin_component, - "'none', 'up' or 'down'"), - QEFlagInfo{Bool}(:write_spn, - "Write .spn matrix elements."), - QEFlagInfo{Bool}(:write_mmn, - "compute M_mn matrix"), - QEFlagInfo{Bool}(:write_amn, - "compute A_mn matrix"), - QEFlagInfo{Bool}(:write_unk, - "write wavefunctions to file"), - QEFlagInfo{Bool}(:write_uHu, - "write the hamiltonian elements between different k-values"), - QEFlagInfo{Bool}(:wvfn_formatted, - "formatted or unformatted output for wavefunctions"), - QEFlagInfo{Bool}(:reduce_unk, - "output wavefunctions on a coarse grid to save memory")])], - QEDataBlockInfo[])) +const QECalculationInfos = Ref(QECalculationInfo[]) + +function maybe_init_QECalculationInfos() + if isempty(QECalculationInfos[]) + include(joinpath(DEPS_DIR, "qeflags.jl")) + QECalculationInfos[] = Base.invokelatest(_QEINPUTINFOS,) + push!(QECalculationInfos[], + QECalculationInfo("pw2wannier90.x", + [QEControlBlockInfo(:inputpp, + [QEFlagInfo{String}(:outdir, + "location of temporary output files"), + QEFlagInfo{String}(:prefix, + "pwscf filename prefix"), + QEFlagInfo{String}(:seedname, + "wannier90 calculation/output filename prefix"), + QEFlagInfo{String}(:wan_mode, + "'standalone' or 'library'"), + QEFlagInfo{String}(:spin_component, + "'none', 'up' or 'down'"), + QEFlagInfo{Bool}(:write_spn, + "Write .spn matrix elements."), + QEFlagInfo{Bool}(:write_mmn, + "compute M_mn matrix"), + QEFlagInfo{Bool}(:write_amn, + "compute A_mn matrix"), + QEFlagInfo{Bool}(:write_unk, + "write wavefunctions to file"), + QEFlagInfo{Bool}(:write_uHu, + "write the hamiltonian elements between different k-values"), + QEFlagInfo{Bool}(:wvfn_formatted, + "formatted or unformatted output for wavefunctions"), + QEFlagInfo{Bool}(:reduce_unk, + "output wavefunctions on a coarse grid to save memory")])], + QEDataBlockInfo[])) + end +end + +const QE7_2CalculationInfos = Ref(QECalculationInfo[]) + +function maybe_init_QE7_2CalculationInfos() + if isempty(QECalculationInfos[]) + include(joinpath(DEPS_DIR, "qe7.2flags.jl")) + QECalculationInfos[] = Base.invokelatest(_QE7_2INPUTINFOS, ) + push!(QECalculationInfos[], + QECalculationInfo("pw2wannier90.x", + [QEControlBlockInfo(:inputpp, + [QEFlagInfo{String}(:outdir, + "location of temporary output files"), + QEFlagInfo{String}(:prefix, + "pwscf filename prefix"), + QEFlagInfo{String}(:seedname, + "wannier90 calculation/output filename prefix"), + QEFlagInfo{String}(:wan_mode, + "'standalone' or 'library'"), + QEFlagInfo{String}(:spin_component, + "'none', 'up' or 'down'"), + QEFlagInfo{Bool}(:write_spn, + "Write .spn matrix elements."), + QEFlagInfo{Bool}(:write_mmn, + "compute M_mn matrix"), + QEFlagInfo{Bool}(:write_amn, + "compute A_mn matrix"), + QEFlagInfo{Bool}(:write_unk, + "write wavefunctions to file"), + QEFlagInfo{Bool}(:write_uHu, + "write the hamiltonian elements between different k-values"), + QEFlagInfo{Bool}(:wvfn_formatted, + "formatted or unformatted output for wavefunctions"), + QEFlagInfo{Bool}(:reduce_unk, + "output wavefunctions on a coarse grid to save memory")])], + QEDataBlockInfo[])) + end +end function qe_calculation_info(calculation::Calculation{QE}) - return getfirst(x -> occursin(x.exec, exec(calculation.exec)), QECalculationInfos) + maybe_init_QECalculationInfos() + return getfirst(x -> occursin(x.exec, exec(calculation.exec)), QECalculationInfos[]) end + +function qe_calculation_info(calculation::Calculation{QE7_2}) + maybe_init_QE7_2CalculationInfos() + return getfirst(x -> occursin(x.exec, exec(calculation.exec)), QE7_2CalculationInfos[]) +end + function qe_calculation_info(exec::AbstractString) - return getfirst(x -> occursin(x.exec, exec), QECalculationInfos) + maybe_init_QECalculationInfos() + return getfirst(x -> occursin(x.exec, exec), QECalculationInfos[]) end qe_calculation_flags(exec::AbstractString) = allflags(qe_calculation_info(exec)) @@ -96,7 +148,8 @@ function qe_flaginfo(calculation_info::QECalculationInfo, variable_name::Symbol) end function qe_flaginfo(variable_name::Symbol) - for info in QECalculationInfos + maybe_init_QECalculationInfos() + for info in QECalculationInfos[] var = qe_flaginfo(info, variable_name) if eltype(var) != Nothing return var @@ -115,76 +168,94 @@ function qe_block_variable(calculation_info::QECalculationInfo, variable_name) return :error, QEFlagInfo() end -function qe_flaginfo(e::Exec, varname) - for calculation_info in QECalculationInfos - if occursin(calculation_info.exec, exec(e)) - return qe_flaginfo(calculation_info, varname) +function qe7_2_block_variable(exec::AbstractString, flagname) + maybe_init_QE7_2CalculationInfos() + for calculation_info in QE7_2CalculationInfos[] + if occursin(calculation_info.exec, exec) + return qe_block_variable(calculation_info, flagname) end end - return QEFlagInfo() + return :error, QEFlagInfo() end -function qe_block_info(block_name::Symbol) - for calculation_info in QECalculationInfos - for block in [calculation_info.control; calculation_info.data] - if block.name == block_name - return block - end +function qe_block_variable(calculation::Calculation{QE}, flagname) + e = exec(calculation.exec) + if !(e ∈ QE_EXECS) + error("Calculation $calculation does not have a valid QE executable, please set it first.") + end + + maybe_init_QECalculationInfos() + for calculation_info in QECalculationInfos[] + if occursin(calculation_info.exec, e) + return qe_block_variable(calculation_info, flagname) end end + return :error, QEFlagInfo() + end +function qe_block_variable(calculation::Calculation{QE7_2}, flagname) + e = exec(calculation.exec) -function qe_all_block_flags(calculation::Calculation{QE}, block_name) - return getfirst(x -> x.name == block_name, qe_calculation_info(calculation).control).flags -end -function qe_all_block_flags(exec::AbstractString, block_name) - return getfirst(x -> x.name == block_name, qe_calculation_info(exec).control).flags -end - -function qe_block_variable(exec::AbstractString, flagname) - for calculation_info in QECalculationInfos - if occursin(calculation_info.exec, exec) + if !(e ∈ QE_EXECS) + error("Calculation $calculation does not have a valid QE executable, please set it first.") + end + maybe_init_QE7_2CalculationInfos() + for calculation_info in QE7_2CalculationInfos[] + if occursin(calculation_info.exec, e) return qe_block_variable(calculation_info, flagname) end end return :error, QEFlagInfo() + end -function qe_exec(calculation::Calculation{QE}) - if !(exec(calculation.exec) ∈ QE_EXECS) +function flagtype(calculation::Calculation{QE}, flag) + e = exec(calculation.exec) + if !(e ∈ QE_EXECS) error("Calculation $calculation does not have a valid QE executable, please set it first.") end - return calculation.exec -end - -function qe_block_variable(calculation::Calculation, flagname) - return qe_block_variable(exec(qe_exec(calculation)), flagname) + maybe_init_QECalculationInfos() + for calculation_info in QECalculationInfos[] + if occursin(calculation_info.exec, e) + return eltype(qe_flaginfo(calculation_info, flag)) + end + end + return eltype(QEFlagInfo()) end -function flagtype(calculation::Calculation{QE}, flag) - return eltype(qe_flaginfo(qe_exec(calculation), flag)) +function flagtype(calculation::Calculation{QE7_2}, flag) + e = exec(calculation.exec) + if !(e ∈ QE_EXECS) + error("Calculation $calculation does not have a valid QE executable, please set it first.") + end + maybe_init_QE7_2CalculationInfos() + for calculation_info in QE7_2CalculationInfos[] + if occursin(calculation_info.exec, e) + return eltype(qe_flaginfo(calculation_info, flag)) + end + end + return eltype(QEFlagInfo()) end -flagtype(::Type{QE}, exec, flag) = eltype(qe_flaginfo(exec, flag)) -isbands(c::Calculation{QE}) = get(c, :calculation, nothing) == "bands" -isnscf(c::Calculation{QE}) = get(c, :calculation, nothing) == "nscf" -isscf(c::Calculation{QE}) = get(c, :calculation, nothing) == "scf" -isvcrelax(c::Calculation{QE}) = get(c, :calculation, nothing) == "vc-relax" -isrelax(c::Calculation{QE}) = get(c, :calculation, nothing) == "relax" -isprojwfc(c::Calculation{QE}) = exec(c.exec) == "projwfc.x" -ishp(c::Calculation{QE}) = exec(c.exec) == "hp.x" +isbands(c::QE_CALCULATION) = get(c, :calculation, nothing) == "bands" +isnscf(c::QE_CALCULATION) = get(c, :calculation, nothing) == "nscf" +isscf(c::QE_CALCULATION) = get(c, :calculation, nothing) == "scf" +isvcrelax(c::QE_CALCULATION) = get(c, :calculation, nothing) == "vc-relax" +isrelax(c::QE_CALCULATION) = get(c, :calculation, nothing) == "relax" +isprojwfc(c::QE_CALCULATION) = exec(c.exec) == "projwfc.x" +ishp(c::QE_CALCULATION) = exec(c.exec) == "hp.x" -function ispw(c::Calculation{QE}) +function ispw(c::QE_CALCULATION) return isbands(c) || isnscf(c) || isscf(c) || isvcrelax(c) || isrelax(c) end -issoc(c::Calculation{QE}) = get(c, :lspinorb, false) +issoc(c::QE_CALCULATION) = get(c, :lspinorb, false) -function ismagnetic(c::Calculation{QE}) +function ismagnetic(c::QE_CALCULATION) return get(c, :nspin, 0.0) > 0.0 || get(c, :total_magnetization, 0.0) end -function outfiles(c::Calculation{QE}) +function outfiles(c::QE_CALCULATION) files = [c.outfile] for (is, fuzzies) in zip(("projwfc.x", "hp.x", "pp.x"), (("pdos",), ("Hubbard_parameters",), ("filplot", "fileout"))) if c.exec.exec == is @@ -194,10 +265,10 @@ function outfiles(c::Calculation{QE}) return unique(files) end -ψ_cutoff_flag(::Calculation{QE}) = :ecutwfc -ρ_cutoff_flag(::Calculation{QE}) = :ecutrho +ψ_cutoff_flag(::QE_CALCULATION) = :ecutwfc +ρ_cutoff_flag(::QE_CALCULATION) = :ecutrho -function kgrid(na, nb, nc, ::Type{QE}) +function kgrid(na, nb, nc, ::Union{Type{QE}, Type{QE7_2}}) return reshape([(a, b, c, 1 / (na * nb * nc)) for a in collect(range(0; stop = 1, length = na + 1))[1:end-1], b in collect(range(0; stop = 1, length = nb + 1))[1:end-1], @@ -205,7 +276,7 @@ function kgrid(na, nb, nc, ::Type{QE}) (na * nb * nc)) end -function set_kpoints!(c::Calculation{QE}, k_grid::NTuple{3,Int}; print = true) #nscf +function set_kpoints!(c::QE_CALCULATION, k_grid::NTuple{3,Int}; print = true) #nscf print && !isnscf(c) && (@warn "Expected calculation to be 'nscf'.\nGot $c.") d = data(c, :k_points) if d !== nothing @@ -220,7 +291,7 @@ function set_kpoints!(c::Calculation{QE}, k_grid::NTuple{3,Int}; print = true) # return c end -function set_kpoints!(c::Calculation{QE}, k_grid::NTuple{6,Int}; print = true) #scf +function set_kpoints!(c::QE_CALCULATION, k_grid::NTuple{6,Int}; print = true) #scf print && !(isscf(c) || isvcrelax(c) || isrelax(c)) && (@warn "Expected calculation to be scf, vc-relax, relax.") @@ -237,7 +308,7 @@ function set_kpoints!(c::Calculation{QE}, k_grid::NTuple{6,Int}; print = true) # return c end -function set_kpoints!(c::Calculation{QE}, k_grid::Vector{<:NTuple{4}}; print = true, +function set_kpoints!(c::QE_CALCULATION, k_grid::Vector{<:NTuple{4}}; print = true, k_option = :crystal_b) print && isbands(c) != "bands" && @@ -268,60 +339,60 @@ function set_kpoints!(c::Calculation{QE}, k_grid::Vector{<:NTuple{4}}; print = t end """ - gencalc_scf(template::Calculation{QE}, kpoints::NTuple{6, Int}, newflags...; name="scf") + gencalc_scf(template::QE_CALCULATION, kpoints::NTuple{6, Int}, newflags...; name="scf") Uses the information from the template and `supplied` kpoints to generate an scf calculation. Extra flags can be supplied which will be set for the generated calculation. """ -function gencalc_scf(template::Calculation{QE}, kpoints::NTuple{6,Int}, newflags...; +function gencalc_scf(template::QE_CALCULATION, kpoints::NTuple{6,Int}, newflags...; name = "scf") return calculation_from_kpoints(template, name, kpoints, :calculation => "scf", newflags...) end """ - gencalc_vcrelax(template::Calculation{QE}, kpoints::NTuple{6, Int}, newflags...; name="scf") + gencalc_vcrelax(template::QE_CALCULATION, kpoints::NTuple{6, Int}, newflags...; name="scf") Uses the information from the template and supplied `kpoints` to generate a vcrelax calculation. Extra flags can be supplied which will be set for the generated calculation. """ -function gencalc_vcrelax(template::Calculation{QE}, kpoints::NTuple{6,Int}, newflags...; +function gencalc_vcrelax(template::QE_CALCULATION, kpoints::NTuple{6,Int}, newflags...; name = "vcrelax") return calculation_from_kpoints(template, name, kpoints, :calculation => "vc-relax", newflags...) end """ - gencalc_bands(template::Calculation{QE}, kpoints::Vector{NTuple{4}}, newflags...; name="bands") + gencalc_bands(template::QE_CALCULATION, kpoints::Vector{NTuple{4}}, newflags...; name="bands") Uses the information from the template and supplied `kpoints` to generate a bands calculation. Extra flags can be supplied which will be set for the generated calculation. """ -function gencalc_bands(template::Calculation{QE}, kpoints::Vector{<:NTuple{4}}, newflags...; +function gencalc_bands(template::QE_CALCULATION, kpoints::Vector{<:NTuple{4}}, newflags...; name = "bands") return calculation_from_kpoints(template, name, kpoints, :calculation => "bands", newflags...) end """ - gencalc_nscf(template::Calculation{QE}, kpoints::NTuple{3, Int}, newflags...; name="nscf") + gencalc_nscf(template::QE_CALCULATION, kpoints::NTuple{3, Int}, newflags...; name="nscf") Uses the information from the template and supplied `kpoints` to generate an nscf calculation. Extra flags can be supplied which will be set for the generated calculation. """ -function gencalc_nscf(template::Calculation{QE}, kpoints::NTuple{3,Int}, newflags...; +function gencalc_nscf(template::QE_CALCULATION, kpoints::NTuple{3,Int}, newflags...; name = "nscf") return calculation_from_kpoints(template, name, kpoints, :calculation => "nscf", newflags...) end """ - gencalc_projwfc(template::Calculation{QE}, Emin, Emax, DeltaE, newflags...; name="projwfc") + gencalc_projwfc(template::QE_CALCULATION, Emin, Emax, DeltaE, newflags...; name="projwfc") Uses the information from the template and supplied `kpoints` to generate a `projwfc.x` calculation. Extra flags can be supplied which will be set for the generated calculation. """ -function gencalc_projwfc(template::Calculation{QE}, Emin, Emax, DeltaE, extraflags...; +function gencalc_projwfc(template::QE_CALCULATION, Emin, Emax, DeltaE, extraflags...; name = "projwfc") occflag = get(template, :occupations, "fixed") ngauss = 0 diff --git a/src/Display/printing.jl b/src/Display/printing.jl index f1d01ec6..4f399af3 100644 --- a/src/Display/printing.jl +++ b/src/Display/printing.jl @@ -11,6 +11,8 @@ function Base.show(io::IO, ::MIME"text/plain", block::InputData) return end +Base.show(io::IO, band::Band) = print(io, "Band($(length(band.k_points_cart)) k_points: $(band.k_points_cart[1]) -> $(band.k_points_cart[end]), eigvals: $(band.eigvals[1]) -> $(band.eigvals[end]))") + function Base.show(io::IO, ::MIME"text/plain", band::Band) show_type(io, band) string = """ diff --git a/src/FileIO/qe.jl b/src/FileIO/qe.jl index e2237fff..472f7087 100644 --- a/src/FileIO/qe.jl +++ b/src/FileIO/qe.jl @@ -551,8 +551,9 @@ function qe_parse_pw_output(str; pseudo_data = InputData(:atomic_species, :none, out[:pseudos]) tmp_flags = Dict{Symbol,Any}(:ibrav => 0) tmp_flags[:A] = out[:in_alat] + # TODO: Hubbard out[:initial_structure] = extract_structure!(tmp_flags, cell_data, - out[:atsyms], atoms_data, pseudo_data) + out[:atsyms], atoms_data, pseudo_data, nothing) # Add starting mag and DFTU if haskey(out, :starting_magnetization) for (atsym, mag) in out[:starting_magnetization] @@ -584,8 +585,9 @@ function qe_parse_pw_output(str; end cell_data = InputData(:cell_parameters, :alat, out[:cell_parameters]) atoms_data = InputData(:atomic_positions, out[:pos_option], out[:atomic_positions]) + #TODO: Hubbard out[:final_structure] = extract_structure!(tmp_flags, cell_data, - out[:atsyms], atoms_data, pseudo_data) + out[:atsyms], atoms_data, pseudo_data, nothing) # Add starting mag and DFTU if haskey(out, :starting_magnetization) for (atsym, mag) in out[:starting_magnetization] @@ -961,30 +963,34 @@ function extract_cell!(flags, cell_block) end end -function qe_DFTU(speciesid::Int, parsed_flags::Dict{Symbol,Any}) - U = 0.0 - J0 = 0.0 - J = [0.0] - α = 0.0 - β = 0.0 - if haskey(parsed_flags, :Hubbard_U) && length(parsed_flags[:Hubbard_U]) >= speciesid - U = parsed_flags[:Hubbard_U][speciesid] - end - if haskey(parsed_flags, :Hubbard_J0) && length(parsed_flags[:Hubbard_J0]) >= speciesid - J0 = parsed_flags[:Hubbard_J0][speciesid] - end - if haskey(parsed_flags, :Hubbard_J) && length(parsed_flags[:Hubbard_J]) >= speciesid - J = Float64.(parsed_flags[:Hubbard_J][:, speciesid]) - end - if haskey(parsed_flags, :Hubbard_alpha) && - length(parsed_flags[:Hubbard_alpha]) >= speciesid - α = parsed_flags[:Hubbard_alpha][speciesid] - end - if haskey(parsed_flags, :Hubbard_beta) && - length(parsed_flags[:Hubbard_beta]) >= speciesid - β = parsed_flags[:Hubbard_beta][speciesid] +function qe_DFTU(speciesid::Int, parsed_flags::Dict{Symbol,Any}, hubbard_block) + if hubbard_block === nothing + U = 0.0 + J0 = 0.0 + J = [0.0] + α = 0.0 + β = 0.0 + if haskey(parsed_flags, :Hubbard_U) && length(parsed_flags[:Hubbard_U]) >= speciesid + U = parsed_flags[:Hubbard_U][speciesid] + end + if haskey(parsed_flags, :Hubbard_J0) && length(parsed_flags[:Hubbard_J0]) >= speciesid + J0 = parsed_flags[:Hubbard_J0][speciesid] + end + if haskey(parsed_flags, :Hubbard_J) && length(parsed_flags[:Hubbard_J]) >= speciesid + J = Float64.(parsed_flags[:Hubbard_J][:, speciesid]) + end + if haskey(parsed_flags, :Hubbard_alpha) && + length(parsed_flags[:Hubbard_alpha]) >= speciesid + α = parsed_flags[:Hubbard_alpha][speciesid] + end + if haskey(parsed_flags, :Hubbard_beta) && + length(parsed_flags[:Hubbard_beta]) >= speciesid + β = parsed_flags[:Hubbard_beta][speciesid] + end + return DFTU(; U = U, J0 = J0, α = α, β = β, J = sum(J) == 0 ? [0.0] : J) + else + error("needs implementing") end - return DFTU(; U = U, J0 = J0, α = α, β = β, J = sum(J) == 0 ? [0.0] : J) end degree2π(ang) = ang / 180 * π @@ -1007,7 +1013,7 @@ function qe_magnetization(atid::Int, parsed_flags::Dict{Symbol,Any}) end end -function extract_atoms!(parsed_flags, atsyms, atom_block, pseudo_block, cell::Mat3) +function extract_atoms!(parsed_flags, atsyms, atom_block, pseudo_block, hubbard_block, cell::Mat3) atoms = Atom[] option = atom_block.option @@ -1035,19 +1041,19 @@ function extract_atoms!(parsed_flags, atsyms, atom_block, pseudo_block, cell::Ma position_cart = primv * pos, position_cryst = UnitfulAtomic.ustrip.(inv(cell) * pos), pseudo = pseudo, magnetization = qe_magnetization(speciesid, parsed_flags), - dftu = qe_DFTU(speciesid, parsed_flags))) + dftu = qe_DFTU(speciesid, parsed_flags, hubbard_block))) end return atoms end function extract_structure!(parsed_flags, cell_block, atsyms, atom_block, - pseudo_block) + pseudo_block, hubbard_block) if atom_block == nothing return nothing end cell = extract_cell!(parsed_flags, cell_block) - atoms = extract_atoms!(parsed_flags, atsyms, atom_block, pseudo_block, cell) + atoms = extract_atoms!(parsed_flags, atsyms, atom_block, pseudo_block, hubbard_block, cell) return Structure(cell, atoms) end @@ -1138,6 +1144,8 @@ function qe_parse_calculation(file) contents = split(file, "\n") end + pre_7_2=true + lines = map(contents) do l id = findfirst(isequal('!'), l) if id !== nothing @@ -1222,8 +1230,17 @@ function qe_parse_calculation(file) end sysflags = qe_parse_flags(sysblock, nat) + + i_hubbard = findcard("hubbard") + + if i_hubbard !== nothing + pre_7_2=false + error("implement hubbard block parsing") + end + + structure = extract_structure!(sysflags, (option = cell_option, data=cell), atsyms, - (option = atoms_option, data=atoms), (data=pseudos,)) + (option = atoms_option, data=atoms), (data=pseudos,), nothing) delete!.((sysflags,), (:A, :celldm_1, :celldm, :ibrav, :nat, :ntyp)) delete!.((sysflags,), [:Hubbard_U, :Hubbard_J0, :Hubbard_alpha, :Hubbard_beta, :Hubbard_J]) @@ -1253,7 +1270,7 @@ function qe_parse_calculation(file) end push!(datablocks, InputData(:k_points, k_option, k_data)) end - return (flags = allflags, data = datablocks, structure = structure) + return (flags = allflags, data = datablocks, structure = structure, pre_7_2 = pre_7_2) end function qe_writeflag(f, flag, value) @@ -1283,21 +1300,146 @@ function qe_writeflag(f, flag, value) end end +function qe_handle_hubbard_flags!(c::Calculation{QE}, str::Structure) + u_ats = unique(str.atoms) + isnc = Structures.isnoncolin(str) + flags_to_set = [] + if any(x -> x.dftu.U != 0 || + x.dftu.J0 != 0.0 || + sum(x.dftu.J) != 0 || + sum(x.dftu.α) != 0, u_ats) + Jmap = map(x -> copy(x.dftu.J), u_ats) + Jdim = maximum(length.(Jmap)) + Jarr = zeros(Jdim, length(u_ats)) + for (i, J) in enumerate(Jmap) + diff = Jdim - length(J) + if diff > 0 + for d in 1:diff + push!(J, zero(eltype(J))) + end + end + Jarr[:, i] .= J + end + append!(flags_to_set, + [:Hubbard_U => map(x -> x.dftu.U, u_ats), + :Hubbard_alpha => map(x -> x.dftu.α, u_ats), + :Hubbard_beta => map(x -> x.dftu.β, u_ats), :Hubbard_J => Jarr, + :Hubbard_J0 => map(x -> x.dftu.J0, u_ats)]) + end + if !isempty(flags_to_set) || haskey(c, :Hubbard_parameters) + push!(flags_to_set, :lda_plus_u => true) + if isnc + push!(flags_to_set, :lda_plus_u_kind => 1) + end + end + if !isempty(flags_to_set) + set_flags!(c, flags_to_set...; print = false) + else + for f in + (:lda_plus_u, :lda_plus_u_kind, :Hubbard_U, :Hubbard_alpha, :Hubbard_beta, + :Hubbard_J, :Hubbard_J0, :U_projection_type) + pop!(c, f, nothing) + end + end +end + +function qe_handle_hubbard_flags!(c::Calculation{QE7_2}, str::Structure) + u_ats = unique(str.atoms) + isnc = Structures.isnoncolin(str) + if any(x -> x.dftu.U != 0 || + x.dftu.J0 != 0.0 || + sum(x.dftu.J) != 0 || + sum(x.dftu.α) != 0, u_ats) + + set_flags!(c, :lda_plus_u => true; print = false) + if isnc + set_flags!(c, :lda_plus_u_kind => 1; print = false) + end + else + for f in + (:lda_plus_u, :lda_plus_u_kind, :Hubbard_U, :Hubbard_alpha, :Hubbard_beta, + :Hubbard_J, :Hubbard_J0, :U_projection_type) + pop!(c, f, nothing) + end + end +end + +function qe_handle_magnetism_flags!(c::Calculation, str::Structure) + u_ats = unique(str.atoms) + isnc = Structures.isnoncolin(str) + + flags_to_set = [] + mags = map(x -> x.magnetization, u_ats) + starts = Float64[] + θs = Float64[] + ϕs = Float64[] + ismagcalc = isnc ? true : Structures.ismagnetic(str) + if ismagcalc + if isnc + for m in mags + tm = normalize(m) + if norm(m) == 0 + push!.((starts, θs, ϕs), 0.0) + else + θ = acos(tm[3]) * 180 / π + ϕ = atan(tm[2], tm[1]) * 180 / π + start = norm(m) + push!(θs, θ) + push!(ϕs, ϕ) + push!(starts, start) + end + end + push!(flags_to_set, :noncolin => true) + else + for m in mags + push!.((θs, ϕs), 0.0) + if norm(m) == 0 + push!(starts, 0) + else + push!(starts, sign(sum(m)) * norm(m)) + end + end + end + append!(flags_to_set, [:starting_magnetization => starts, :angle1 => θs, :angle2 => ϕs, :nspin => 2]) + end + + set_flags!(c, flags_to_set...; print = false) + if isnc + pop!(c, :nspin, nothing) + end +end + """ write(f, calculation::Calculation{QE}, structure) Writes a string represenation to `f`. """ -function Base.write(f::IO, calculation::Calculation{QE}, structure=nothing) +function Base.write(f::IO, calculation::Calculation{T}, structure=nothing) where {T <: Union{QE, QE7_2}} cursize = f isa IOBuffer ? f.size : 0 if Calculations.hasflag(calculation, :calculation) Calculations.set_flags!(calculation, :calculation => replace(calculation[:calculation], "_" => "-"); print = false) end + if exec(calculation.exec) == "ph.x" write(f, "--\n") end + if Calculations.ispw(calculation) && structure !== nothing + qe_handle_hubbard_flags!(calculation, structure) + qe_handle_magnetism_flags!(calculation, structure) + if Calculations.isvcrelax(calculation) + #this is to make sure &ions and &cell are there in the calculation + !haskey(calculation, :ion_dynamics) && + set_flags!(calculation, :ion_dynamics => "bfgs"; print = false) + !haskey(calculation, :cell_dynamics) && + set_flags!(calculation, :cell_dynamics => "bfgs"; print = false) + end + #TODO add all the required flags + @assert haskey(calculation, :calculation) "Please set the flag for calculation with name: $(calculation.name)" + set_flags!(calculation, :pseudo_dir => "."; print = false) + end + writeflag(flag_data) = qe_writeflag(f, flag_data[1], flag_data[2]) write_dat(data) = write_data(f, data) for name in unique([[:control, :system, :electrons, :ions, :cell]; keys(calculation.flags)...]) @@ -1313,11 +1455,6 @@ function Base.write(f::IO, calculation::Calculation{QE}, structure=nothing) # write(f," A = $A\n") write(f, " nat = $nat\n") write(f, " ntyp = $ntyp\n") - elseif name == :projwfc - prefix = calculation[:prefix] - outdir = calculation[:outdir] - write(f, " prefix = $prefix\n") - write(f, " outdir = $outdir\n") end map(writeflag, [(flag, data) for (flag, data) in flags]) @@ -1377,7 +1514,7 @@ function write_data(f, data) end end -function write_structure(f, calculation::Calculation{QE}, structure) +function write_positions_cell(f, calculation::Union{Calculation{QE}, Calculation{QE7_2}}, structure) unique_at = unique(structure.atoms) write(f, "ATOMIC_SPECIES\n") write(f, @@ -1393,10 +1530,40 @@ function write_structure(f, calculation::Calculation{QE}, structure) join(map(at -> "$(at.name) $(join(at.position_cryst, " "))", structure.atoms), "\n")) write(f, "\n\n") - return end -function qe_generate_pw2wancalculation(c::Calculation{Wannier90}, nscf::Calculation{QE}) +write_structure(f, calculation::Calculation{QE}, structure) = write_positions_cell(f, calculation, structure) +function write_structure(f, calculation::Calculation{QE7_2}, structure) + write_positions_cell(f, calculation, structure) + if haskey(calculation, :lda_plus_u) + u_proj = unique(map(x->x.dftu.projection_type, filter(y -> y.dftu.U != 0 || y.dftu.J0 != 0 || y.dftu.J[1] != 0, structure.atoms))) + if length(u_proj) > 1 + @warn "Found different U proj types for different atoms, this is not supported so we use the first one: $(u_proj[1])" + end + write(f, "HUBBARD ($(u_proj[1])) \n") + for at in structure.atoms + + atsym = at.element.symbol + if at.dftu.U != 0.0 + write(f, "U $(at.name)-$(ELEMENT_TO_N[atsym])$(ELEMENT_TO_L[atsym]) $(at.dftu.U)\n") + end + if at.dftu.J0 != 0.0 + write(f, "J0 $(at.name)-$(ELEMENT_TO_N[atsym])$(ELEMENT_TO_L[atsym]) $(at.dftu.J0)\n") + end + if at.dftu.J[1] != 0.0 + write(f, "J $(at.name)-$(ELEMENT_TO_N[atsym])$(ELEMENT_TO_L[atsym]) $(at.dftu.J[1])\n") + if length(at.dftu.J) == 2 + write(f, "B $(at.name)-$(ELEMENT_TO_N[atsym])$(ELEMENT_TO_L[atsym]) $(at.dftu.J[2])\n") + else + write(f, "E2 $(at.name)-$(ELEMENT_TO_N[atsym])$(ELEMENT_TO_L[atsym]) $(at.dftu.J[2])\n") + write(f, "E3 $(at.name)-$(ELEMENT_TO_N[atsym])$(ELEMENT_TO_L[atsym]) $(at.dftu.J[3])\n") + end + end + end + end +end + +function qe_generate_pw2wancalculation(c::Calculation{Wannier90}, nscf::Union{Calculation{QE}, Calculation{QE7_2}}) flags = Dict() if haskey(nscf, :prefix) flags[:prefix] = nscf[:prefix] @@ -1428,3 +1595,148 @@ function qe_generate_pw2wancalculation(c::Calculation{Wannier90}, nscf::Calculat Calculations.set_flags!(out, flags...; print=false) return out end + +# This is to automatically set the hubbard manifold based on pre 7.2 QE. +# TODO: allow for multiple DFTU manifolds +const ELEMENT_TO_L = Dict( + :H => "s", + :K => "s", + :C => "p", + :N => "p", + :O => "p", + :As => "p", + :Sb => "p", + :Se => "p", + :Ti => "d", + :V => "d", + :Cr => "d", + :Mn => "d", + :Fe => "d", + :Co => "d", + :Ni => "d", + :Cu => "d", + :Zn => "d", + :Zr => "d", + :Nb => "d", + :Mo => "d", + :Tc => "d", + :Ru => "d", + :Rh => "d", + :Pd => "d", + :Ag => "d", + :Cd => "d", + :Hf => "d", + :Ta => "d", + :W => "d", + :Re => "d", + :Os => "d", + :Ir => "d", + :Pt => "d", + :Au => "d", + :Hg => "d", + :Sc => "d", + :Y => "d", + :La => "d", + :Ga => "d", + :In => "d", + :Ce => "f", + :Pr => "f", + :Nd => "f", + :Pm => "f", + :Sm => "f", + :Eu => "f", + :Gd => "f", + :Tb => "f", + :Dy => "f", + :Ho => "f", + :Er => "f", + :Tm => "f", + :Yb => "f", + :Lu => "f", + :Th => "f", + :Pa => "f", + :U => "f", + :Np => "f", + :Pu => "f", + :Am => "f", + :Cm => "f", + :Bk => "f", + :Cf => "f", + :Es => "f", + :Fm => "f", + :Md => "f", + :No => "f", + :Lr => "f" +) + +const ELEMENT_TO_N = Dict( + :H => 1, + :C => 2, + :N => 2, + :O => 2, + :Ti => 3, + :V => 3, + :Cr => 3, + :Mn => 3, + :Fe => 3, + :Co => 3, + :Ni => 3, + :Cu => 3, + :Zn => 3, + :Sc => 3, + :Ga => 3, + :Se => 3, + :Zr => 4, + :Nb => 4, + :Mo => 4, + :Tc => 4, + :Ru => 4, + :Rh => 4, + :Pd => 4, + :Ag => 4, + :Cd => 4, + :K => 4, + :Y => 4, + :La => 4, + :Ce => 4, + :Pr => 4, + :Nd => 4, + :Pm => 4, + :Sm => 4, + :Eu => 4, + :Gd => 4, + :Tb => 4, + :Dy => 4, + :Ho => 4, + :Er => 4, + :Tm => 4, + :Yb => 4, + :Lu => 4, + :In => 4, + :As => 4, + :Sb => 4, + :Hf => 5, + :Ta => 5, + :W => 5, + :Re => 5, + :Os => 5, + :Ir => 5, + :Pt => 5, + :Au => 5, + :Hg => 5, + :Th => 5, + :Pa => 5, + :U => 5, + :Np => 5, + :Pu => 5, + :Am => 5, + :Cm => 5, + :Bk => 5, + :Cf => 5, + :Es => 5, + :Fm => 5, + :Md => 5, + :No => 5, + :Lr => 5, +) + diff --git a/src/Structures/atom.jl b/src/Structures/atom.jl index 65e00234..30f52e8d 100644 --- a/src/Structures/atom.jl +++ b/src/Structures/atom.jl @@ -16,6 +16,7 @@ Base.@kwdef mutable struct DFTU α::Float64 = 0.0 β::Float64 = 0.0 J::Vector{Float64} = [0.0] + projection_type::String = "ortho-atomic" end function DFTU(dict::JSON3.Object) return DFTU(;dict...) diff --git a/test/constant_tests.jl b/test/constant_tests.jl index 7b683f17..453e7b85 100644 --- a/test/constant_tests.jl +++ b/test/constant_tests.jl @@ -1,5 +1,4 @@ using DFControl, Test -@test eltype(Calculations.qe_flaginfo(Exec(; path = "projwfc.x"), :calculation)) == Nothing -@test eltype(Calculations.qe_flaginfo(Exec(; path = "pw.x"), :calculation)) == - eltype(Calculations.qe_flaginfo(:calculation)) +@test Calculations.flagtype(Calculation{QE}(name = "dfd", exec = Exec(; path = "projwfc.x")), :calculation) == Nothing +@test Calculations.flagtype(Calculation{QE}(name = "dfd", exec = Exec(; path = "pw.x")), :calculation) == String diff --git a/test/display_tests.jl b/test/display_tests.jl index 035bdaf2..86c73b66 100644 --- a/test/display_tests.jl +++ b/test/display_tests.jl @@ -4,15 +4,15 @@ testjobpath = joinpath(testdir, "testassets", "test_job") @testset "Basic printing" begin job = load(test_server, Job(testjobpath)) - show(job.calculations[1]) - show(job.calculations[1].data[1]) - show(outputdata(job)["scf"][:bands][1]) - show(job.structure) - show(job.structure.atoms[1]) - show(job.structure.atoms[1].element) - show(Projection("d")) - show(DFC.Calculations._ELK_CONTROLBLOCKS()[1]) - show(DFC.Calculations._ELK_CONTROLBLOCKS()[1].flags[1]) + display(job.calculations[1]) + display(job.calculations[1].data[1]) + display(outputdata(job)["scf"][:bands][1]) + display(job.structure) + display(job.structure.atoms[1]) + display(job.structure.atoms[1].element) + display(Projection("d")) + display(DFC.Calculations._ELK_CONTROLBLOCKS()[1]) + display(DFC.Calculations._ELK_CONTROLBLOCKS()[1].flags[1]) end # @testset "html printing" begin diff --git a/test/documentation_tests.jl b/test/documentation_tests.jl index d1778d9c..39e1b60e 100644 --- a/test/documentation_tests.jl +++ b/test/documentation_tests.jl @@ -1,3 +1,3 @@ foundflags = Calculations.documentation(QE, "noncollinear") -@test length(foundflags) == 3 +@test length(foundflags) == 2 @test eltype(Calculations.documentation(QE, :electron_maxstep)) == Int From dd6d0b56b17302e69dbded81632864efcc764bd2 Mon Sep 17 00:00:00 2001 From: louisponet Date: Sun, 3 Sep 2023 21:21:00 +0200 Subject: [PATCH 09/14] prettier bands printing --- src/Display/printing.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Display/printing.jl b/src/Display/printing.jl index 4f399af3..03ea4530 100644 --- a/src/Display/printing.jl +++ b/src/Display/printing.jl @@ -11,7 +11,7 @@ function Base.show(io::IO, ::MIME"text/plain", block::InputData) return end -Base.show(io::IO, band::Band) = print(io, "Band($(length(band.k_points_cart)) k_points: $(band.k_points_cart[1]) -> $(band.k_points_cart[end]), eigvals: $(band.eigvals[1]) -> $(band.eigvals[end]))") +Base.show(io::IO, band::Band) = print(io, "Band($(length(band.k_points_cart)) k_points, eigvals: $(band.eigvals[1]) eV -> $(band.eigvals[end]) eV)") function Base.show(io::IO, ::MIME"text/plain", band::Band) show_type(io, band) From b7db115cc8a584600f1235bc9529da54e55c9d7a Mon Sep 17 00:00:00 2001 From: louisponet Date: Sun, 3 Sep 2023 21:54:25 +0200 Subject: [PATCH 10/14] fix build --- .gitignore | 1 + deps/build.jl | 2 +- src/Calculations/calculation.jl | 9 +++++++-- src/Calculations/qe.jl | 6 +++--- src/FileIO/qe.jl | 6 ++++-- test/runtests.jl | 19 +++++++++++-------- 6 files changed, 27 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index 5eae5c6f..403b06ad 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,4 @@ deps/deps\.jl deps/spglib/ deps/elkflags\.jl +deps/qe7.2flags.jl diff --git a/deps/build.jl b/deps/build.jl index 75cf663f..71869410 100644 --- a/deps/build.jl +++ b/deps/build.jl @@ -76,6 +76,6 @@ if Sys.which("cif2cell") === nothing end end -if any(x->!ispath(joinpath(@__DIR__, x)), ("wannier90flags.jl", "qeflags.jl", "abinitflags.jl", "elkflags.jl")) +if any(x->!ispath(joinpath(@__DIR__, x)), ("wannier90flags.jl", "qeflags.jl", "abinitflags.jl", "elkflags.jl", "qe7.2flags.jl")) include("asset_init.jl") end diff --git a/src/Calculations/calculation.jl b/src/Calculations/calculation.jl index 15e382a9..f37b08da 100644 --- a/src/Calculations/calculation.jl +++ b/src/Calculations/calculation.jl @@ -90,13 +90,18 @@ function Calculation(name, flags, data, e, run, infile, return Calculation{p}(name, flags, data, e, run, infile, outfile) end -function Calculation(name, flags...; kwargs...) +function Calculation(name::String, flags::Pair{Symbol}...; kwargs...) out = Calculation(; name = name, kwargs...) set_flags!(out, flags...; print=false) return out end +function Calculation{p}(name::String, flags::Pair{Symbol}...; kwargs...) where {p} + out = Calculation{p}(; name = name, kwargs...) + set_flags!(out, flags...; print=false) + return out +end -function Calculation(template::Calculation, name, newflags...; +function Calculation(template::Calculation, name::String, newflags::Pair{Symbol}...; excs = deepcopy(template.exec), run = true, data = nothing) newflags = Dict(newflags...) diff --git a/src/Calculations/qe.jl b/src/Calculations/qe.jl index cf1672c1..440ec87e 100644 --- a/src/Calculations/qe.jl +++ b/src/Calculations/qe.jl @@ -87,10 +87,10 @@ end const QE7_2CalculationInfos = Ref(QECalculationInfo[]) function maybe_init_QE7_2CalculationInfos() - if isempty(QECalculationInfos[]) + if isempty(QE7_2CalculationInfos[]) include(joinpath(DEPS_DIR, "qe7.2flags.jl")) - QECalculationInfos[] = Base.invokelatest(_QE7_2INPUTINFOS, ) - push!(QECalculationInfos[], + QE7_2CalculationInfos[] = Base.invokelatest(_QE7_2INPUTINFOS, ) + push!(QE7_2CalculationInfos[], QECalculationInfo("pw2wannier90.x", [QEControlBlockInfo(:inputpp, [QEFlagInfo{String}(:outdir, diff --git a/src/FileIO/qe.jl b/src/FileIO/qe.jl index 472f7087..788d8a51 100644 --- a/src/FileIO/qe.jl +++ b/src/FileIO/qe.jl @@ -1536,12 +1536,13 @@ write_structure(f, calculation::Calculation{QE}, structure) = write_positions_ce function write_structure(f, calculation::Calculation{QE7_2}, structure) write_positions_cell(f, calculation, structure) if haskey(calculation, :lda_plus_u) - u_proj = unique(map(x->x.dftu.projection_type, filter(y -> y.dftu.U != 0 || y.dftu.J0 != 0 || y.dftu.J[1] != 0, structure.atoms))) + unique_at = unique(structure.atoms) + u_proj = unique(map(x->x.dftu.projection_type, filter(y -> y.dftu.U != 0 || y.dftu.J0 != 0 || y.dftu.J[1] != 0, unique_at))) if length(u_proj) > 1 @warn "Found different U proj types for different atoms, this is not supported so we use the first one: $(u_proj[1])" end write(f, "HUBBARD ($(u_proj[1])) \n") - for at in structure.atoms + for at in unique_at atsym = at.element.symbol if at.dftu.U != 0.0 @@ -1560,6 +1561,7 @@ function write_structure(f, calculation::Calculation{QE7_2}, structure) end end end + write(f, "\n\n") end end diff --git a/test/runtests.jl b/test/runtests.jl index 2b0d69ee..6dd0a96f 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -37,17 +37,20 @@ using UUIDs testdir = @__DIR__ test_server = local_server() @time begin - @testset "constants" begin - include("constant_tests.jl") - end - @testset "documenation" begin - include("documentation_tests.jl") - end + # @testset "constants" begin + # include("constant_tests.jl") + # end + # @testset "documenation" begin + # include("documentation_tests.jl") + # end @testset "Setting defaults" begin include("defaults_tests.jl") end - @testset "Job from CIF file" begin - include("jobfromcif_tests.jl") + # @testset "Job from CIF file" begin + # include("jobfromcif_tests.jl") + # end + @testset "Job from CIF file 7.2" begin + include("jobfromcif_tests_7.2.jl") end @testset "Display tests" begin include("display_tests.jl") From cffc94fe0e23dc6c17955e361c7af72f3732bf57 Mon Sep 17 00:00:00 2001 From: louisponet Date: Sun, 3 Sep 2023 21:54:39 +0200 Subject: [PATCH 11/14] added 7.2 test --- test/jobfromcif_tests_7.2.jl | 115 +++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 test/jobfromcif_tests_7.2.jl diff --git a/test/jobfromcif_tests_7.2.jl b/test/jobfromcif_tests_7.2.jl new file mode 100644 index 00000000..01bc02ac --- /dev/null +++ b/test/jobfromcif_tests_7.2.jl @@ -0,0 +1,115 @@ +using DFControl, Test, LinearAlgebra +using RemoteHPC: Exec, exec + +testdir = joinpath(dirname(dirname(pathof(DFControl))), "test") +testjobpath = joinpath(testdir, "testassets", "test_job") +@testset "initial creation" begin + if ispath(testjobpath) + rm(testjobpath, recursive=true) + end + + name = "Ni" + dir = testjobpath + bin_dir = joinpath(homedir(), "Software/qe/bin") + pw_exec = load(test_server, Exec("pw")) + pw_exec.flags["nk"] = 4 + @test !isempty(pw_exec.flags) + + str = Structure(joinpath(testdir, "testassets/Ni.cif")) + + calculations = [Calculation{QE7_2}("vcrelax", :calculation => "vc-relax", :verbosity => "high", :ion_dynamics => "bfgs", :cell_dynamics => "bfgs"; + exec = pw_exec, + data = [InputData(:k_points, :automatic, + [6, 6, 6, 1, 1, 1])]), + Calculation{QE7_2}(; name = "scf", exec = pw_exec, + flags = Dict(:control => Dict(:calculation => "scf", :verbosity => "high")), + data = [InputData(:k_points, :automatic, + [4, 4, 4, 1, 1, 1])])] + job = Job(name, str, calculations, :ecutwfc => 40.0, :occupations => "smearing", :degauss=>0.01, :conv_thr => 1e-6, :nbnd => 18; + #kwargs + dir = dir, server=test_server.name) + + + set_pseudos!(job, load(test_server, PseudoSet("test"))) + job.environment = "test" + + set_kpoints!(job["scf"], (6, 6, 6, 1, 1, 1)) + + job.structure[element(:Ni)][1].magnetization = Vec3(0,0,0.1) + job.structure[element(:Ni)][1].dftu.U = 4.0 + + push!(job, Calculations.gencalc_bands(job["scf"], Structures.high_symmetry_kpath(job.structure, 20))) + push!(job, Calculations.gencalc_nscf(job["scf"], (5,5,5))) + + push!(job, Calculations.gencalc_projwfc(job["nscf"], 2.0, 20.0, 0.1)) + + @test all(values(job[:ecutwfc]) .== 40.0) + for c in job.calculations + pop!(c, :ecutwfc, nothing) + end + + + save(job, fillexecs=false) + @test all(values(job[:ecutwfc]) .== 41.0) + @test all(values(job[:ecutrho]) .== 236.0) + @test job.version == 1 + @test length(job) == 5 + @test data(job["scf"], :k_points).data == [6,6,6,1,1,1] + @test job["nscf"].exec == pw_exec + @test exec(job["projwfc"].exec) == "projwfc.x" + @test dirname(job["projwfc"].exec.path) == dirname(pw_exec.path) + @test show(job) == nothing + job[:ecutwfc] = 40.0 + for c in job.calculations + pop!(c, :ecutrho, nothing) + end + @test all(values(job[:ecutwfc]) .== 40.0) + save(job, fillexecs=false) + job2 = load(test_server, Job(abspath(job))) + + for (c1, c2) in zip(job2.calculations, job.calculations) + @test c1 == c2 + end + @test job2.structure == job.structure +end + +refjobpath =joinpath(testdir, "testassets", "reference_job") + +@testset "reference comparison" begin + job = load(test_server, Job(testjobpath)) + + orig_job = deepcopy(job) + job.structure = Structures.create_supercell(job.structure, 1, 0, 0, make_afm = true) + + job2 = load(test_server, Job(refjobpath)) + @test job2.structure == job.structure + + for f in DFControl.Utils.searchdir(job2, ".out") + cp(f, joinpath(job, splitdir(f)[2]), force=true) + end + for f in DFControl.Utils.searchdir(job2, "dos") + cp(f, joinpath(job, splitdir(f)[2]), force=true) + end + + for a in job.structure.atoms + a.projections = [Projection("s"), Projection("p"), Projection("d")] + end + wanexec = Exec(name="wan", path=joinpath(homedir(), "Software/wannier90/wannier90.x"), parallel=false) + append!(job, Calculations.gencalc_wan(job, 0.000011, :wannier_plot => true, wanexec = wanexec)) + for (c1, c2) in zip(job2.calculations, job.calculations) + @test c1 == c2 + end + save(job, fillexecs=false) + job = load(test_server, Job(testjobpath)) + + for (c1, c2) in zip(job2.calculations, job.calculations) + @test c1 == c2 + end + save(orig_job, fillexecs=false) + for f in DFControl.Utils.searchdir(job2, ".out") + cp(f, joinpath(job, splitdir(f)[2]), force=true) + end + for f in DFControl.Utils.searchdir(job2, "dos") + cp(f, joinpath(job, splitdir(f)[2]), force=true) + end +end From d0151c2a438d84aaefe2246e563668f74d93d47b Mon Sep 17 00:00:00 2001 From: louisponet Date: Sun, 3 Sep 2023 22:39:32 +0200 Subject: [PATCH 12/14] fixed tests --- src/Display/printing.jl | 2 +- src/FileIO/qe.jl | 96 +++++++++++++++++++++++-------------- test/documentation_tests.jl | 2 +- test/runtests.jl | 18 +++---- 4 files changed, 72 insertions(+), 46 deletions(-) diff --git a/src/Display/printing.jl b/src/Display/printing.jl index 03ea4530..f0fcb715 100644 --- a/src/Display/printing.jl +++ b/src/Display/printing.jl @@ -278,5 +278,5 @@ function Base.show(io::IO, ::MIME"text/plain", proj::Projection) return println(io, crayon"red", "last index: ", crayon"reset", "$(proj.last)") end -Base.show(io::IO, dftu::DFTU) = print(io, "l=$(dftu.l), U=$(dftu.U), J0=$(dftu.J0), α=$(dftu.α), β=$(dftu.β), J=$(dftu.J)") +Base.show(io::IO, dftu::DFTU) = print(io, "l=$(dftu.l), U=$(dftu.U), J0=$(dftu.J0), α=$(dftu.α), β=$(dftu.β), J=$(dftu.J), projection=$(dftu.projection_type)") diff --git a/src/FileIO/qe.jl b/src/FileIO/qe.jl index 788d8a51..d5cfce95 100644 --- a/src/FileIO/qe.jl +++ b/src/FileIO/qe.jl @@ -11,7 +11,7 @@ function cardoption(line) if length(sline) < 2 && lowercase(sline[1]) == "k_points" return :tpiba else - return Symbol(match(r"((?:[a-z][a-z0-9_]*))", sline[2]).match) + return Symbol(match(r"((?:[a-z][a-z0-9_-]*))", sline[2]).match) end end @@ -963,34 +963,30 @@ function extract_cell!(flags, cell_block) end end -function qe_DFTU(speciesid::Int, parsed_flags::Dict{Symbol,Any}, hubbard_block) - if hubbard_block === nothing - U = 0.0 - J0 = 0.0 - J = [0.0] - α = 0.0 - β = 0.0 - if haskey(parsed_flags, :Hubbard_U) && length(parsed_flags[:Hubbard_U]) >= speciesid - U = parsed_flags[:Hubbard_U][speciesid] - end - if haskey(parsed_flags, :Hubbard_J0) && length(parsed_flags[:Hubbard_J0]) >= speciesid - J0 = parsed_flags[:Hubbard_J0][speciesid] - end - if haskey(parsed_flags, :Hubbard_J) && length(parsed_flags[:Hubbard_J]) >= speciesid - J = Float64.(parsed_flags[:Hubbard_J][:, speciesid]) - end - if haskey(parsed_flags, :Hubbard_alpha) && - length(parsed_flags[:Hubbard_alpha]) >= speciesid - α = parsed_flags[:Hubbard_alpha][speciesid] - end - if haskey(parsed_flags, :Hubbard_beta) && - length(parsed_flags[:Hubbard_beta]) >= speciesid - β = parsed_flags[:Hubbard_beta][speciesid] - end - return DFTU(; U = U, J0 = J0, α = α, β = β, J = sum(J) == 0 ? [0.0] : J) - else - error("needs implementing") +function qe_DFTU(speciesid::Int, parsed_flags::Dict{Symbol,Any},) + U = 0.0 + J0 = 0.0 + J = [0.0] + α = 0.0 + β = 0.0 + if haskey(parsed_flags, :Hubbard_U) && length(parsed_flags[:Hubbard_U]) >= speciesid + U = parsed_flags[:Hubbard_U][speciesid] + end + if haskey(parsed_flags, :Hubbard_J0) && length(parsed_flags[:Hubbard_J0]) >= speciesid + J0 = parsed_flags[:Hubbard_J0][speciesid] + end + if haskey(parsed_flags, :Hubbard_J) && length(parsed_flags[:Hubbard_J]) >= speciesid + J = Float64.(parsed_flags[:Hubbard_J][:, speciesid]) end + if haskey(parsed_flags, :Hubbard_alpha) && + length(parsed_flags[:Hubbard_alpha]) >= speciesid + α = parsed_flags[:Hubbard_alpha][speciesid] + end + if haskey(parsed_flags, :Hubbard_beta) && + length(parsed_flags[:Hubbard_beta]) >= speciesid + β = parsed_flags[:Hubbard_beta][speciesid] + end + return DFTU(; U = U, J0 = J0, α = α, β = β, J = sum(J) == 0 ? [0.0] : J) end degree2π(ang) = ang / 180 * π @@ -1041,7 +1037,7 @@ function extract_atoms!(parsed_flags, atsyms, atom_block, pseudo_block, hubbard_ position_cart = primv * pos, position_cryst = UnitfulAtomic.ustrip.(inv(cell) * pos), pseudo = pseudo, magnetization = qe_magnetization(speciesid, parsed_flags), - dftu = qe_DFTU(speciesid, parsed_flags, hubbard_block))) + dftu = hubbard_block === nothing ? qe_DFTU(speciesid, parsed_flags) : hubbard_block[atsym])) end return atoms @@ -1131,6 +1127,7 @@ function qe_parse_flags(inflags, nat::Int=0) return flags end + """ qe_parse_calculation(file) @@ -1234,13 +1231,42 @@ function qe_parse_calculation(file) i_hubbard = findcard("hubbard") if i_hubbard !== nothing - pre_7_2=false - error("implement hubbard block parsing") + pre_7_2 = false + projection_type = String(cardoption(lines[i_hubbard])) + push!(used_lineids, i_hubbard) + + dftus = Dict{Symbol, DFTU}() + for k in 1:ntyp + push!(used_lineids, i_hubbard + k) + + par, atsym_manifold, sval = split(lines[i_hubbard+k]) + val = parse(Float64, sval) + + atsym = Symbol(split(atsym_manifold, "-")[1]) + + dftu = get!(dftus, atsym, DFTU()) + dftu.projection_type = projection_type + + if par == "U" + dftu.U = val + elseif par == "J0" + dftu.J0 = val + elseif par == "J" + dftu.J[1] = val + elseif par == "B" || par == "E2" + dftu.J[2] = val + elseif par == "E3" + dftu.J[3] = val + end + end + structure = extract_structure!(sysflags, (option = cell_option, data=cell), atsyms, + (option = atoms_option, data=atoms), (data=pseudos,), dftus) + + else + structure = extract_structure!(sysflags, (option = cell_option, data=cell), atsyms, + (option = atoms_option, data=atoms), (data=pseudos,), nothing) end - - structure = extract_structure!(sysflags, (option = cell_option, data=cell), atsyms, - (option = atoms_option, data=atoms), (data=pseudos,), nothing) delete!.((sysflags,), (:A, :celldm_1, :celldm, :ibrav, :nat, :ntyp)) delete!.((sysflags,), [:Hubbard_U, :Hubbard_J0, :Hubbard_alpha, :Hubbard_beta, :Hubbard_J]) @@ -1561,7 +1587,7 @@ function write_structure(f, calculation::Calculation{QE7_2}, structure) end end end - write(f, "\n\n") + write(f, "\n") end end diff --git a/test/documentation_tests.jl b/test/documentation_tests.jl index 39e1b60e..d1778d9c 100644 --- a/test/documentation_tests.jl +++ b/test/documentation_tests.jl @@ -1,3 +1,3 @@ foundflags = Calculations.documentation(QE, "noncollinear") -@test length(foundflags) == 2 +@test length(foundflags) == 3 @test eltype(Calculations.documentation(QE, :electron_maxstep)) == Int diff --git a/test/runtests.jl b/test/runtests.jl index 6dd0a96f..92737326 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -37,18 +37,18 @@ using UUIDs testdir = @__DIR__ test_server = local_server() @time begin - # @testset "constants" begin - # include("constant_tests.jl") - # end - # @testset "documenation" begin - # include("documentation_tests.jl") - # end + @testset "constants" begin + include("constant_tests.jl") + end + @testset "documenation" begin + include("documentation_tests.jl") + end @testset "Setting defaults" begin include("defaults_tests.jl") end - # @testset "Job from CIF file" begin - # include("jobfromcif_tests.jl") - # end + @testset "Job from CIF file" begin + include("jobfromcif_tests.jl") + end @testset "Job from CIF file 7.2" begin include("jobfromcif_tests_7.2.jl") end From 81bda939faae887944e5e8ca75870371ec7f1bf3 Mon Sep 17 00:00:00 2001 From: louisponet Date: Mon, 4 Sep 2023 09:37:20 +0200 Subject: [PATCH 13/14] added AbstractQE package --- src/Calculations/Calculations.jl | 2 +- src/Calculations/calculation.jl | 5 +-- src/Calculations/qe.jl | 53 ++++++++++++++++---------------- src/Calculations/wannier.jl | 4 +-- src/Client/job.jl | 4 +-- src/FileIO/qe.jl | 14 ++++----- src/FileIO/wannier.jl | 2 +- 7 files changed, 42 insertions(+), 42 deletions(-) diff --git a/src/Calculations/Calculations.jl b/src/Calculations/Calculations.jl index 767c008d..222d8382 100644 --- a/src/Calculations/Calculations.jl +++ b/src/Calculations/Calculations.jl @@ -16,5 +16,5 @@ include("documentation.jl") include("julia.jl") export Calculation, InputData -export Wannier90, QE, QE7_2, Abinit, Elk, Julia, set_flags! +export Wannier90, AbstractQE, QE, QE7_2, Abinit, Elk, Julia, set_flags! end diff --git a/src/Calculations/calculation.jl b/src/Calculations/calculation.jl index f37b08da..202970ea 100644 --- a/src/Calculations/calculation.jl +++ b/src/Calculations/calculation.jl @@ -35,8 +35,9 @@ StructTypes.StructType(::Type{InputData}) = StructTypes.Struct() abstract type Package end struct NoPackage <: Package end struct Wannier90 <: Package end -struct QE <: Package end -struct QE7_2 <: Package end +abstract type AbstractQE <: Package end +struct QE <: AbstractQE end +struct QE7_2 <: AbstractQE end struct Abinit <: Package end struct Elk <: Package end StructTypes.StructType(::Type{<:Package}) = StructTypes.Struct() diff --git a/src/Calculations/qe.jl b/src/Calculations/qe.jl index 440ec87e..011d3bb4 100644 --- a/src/Calculations/qe.jl +++ b/src/Calculations/qe.jl @@ -1,4 +1,3 @@ -const QE_CALCULATION = Union{Calculation{QE}, Calculation{QE7_2}} #QE calls these flags struct QEFlagInfo{T} name::Symbol @@ -237,25 +236,25 @@ function flagtype(calculation::Calculation{QE7_2}, flag) return eltype(QEFlagInfo()) end -isbands(c::QE_CALCULATION) = get(c, :calculation, nothing) == "bands" -isnscf(c::QE_CALCULATION) = get(c, :calculation, nothing) == "nscf" -isscf(c::QE_CALCULATION) = get(c, :calculation, nothing) == "scf" -isvcrelax(c::QE_CALCULATION) = get(c, :calculation, nothing) == "vc-relax" -isrelax(c::QE_CALCULATION) = get(c, :calculation, nothing) == "relax" -isprojwfc(c::QE_CALCULATION) = exec(c.exec) == "projwfc.x" -ishp(c::QE_CALCULATION) = exec(c.exec) == "hp.x" +isbands(c::Calculation{<:AbstractQE}) = get(c, :calculation, nothing) == "bands" +isnscf(c::Calculation{<:AbstractQE}) = get(c, :calculation, nothing) == "nscf" +isscf(c::Calculation{<:AbstractQE}) = get(c, :calculation, nothing) == "scf" +isvcrelax(c::Calculation{<:AbstractQE}) = get(c, :calculation, nothing) == "vc-relax" +isrelax(c::Calculation{<:AbstractQE}) = get(c, :calculation, nothing) == "relax" +isprojwfc(c::Calculation{<:AbstractQE}) = exec(c.exec) == "projwfc.x" +ishp(c::Calculation{<:AbstractQE}) = exec(c.exec) == "hp.x" -function ispw(c::QE_CALCULATION) +function ispw(c::Calculation{<:AbstractQE}) return isbands(c) || isnscf(c) || isscf(c) || isvcrelax(c) || isrelax(c) end -issoc(c::QE_CALCULATION) = get(c, :lspinorb, false) +issoc(c::Calculation{<:AbstractQE}) = get(c, :lspinorb, false) -function ismagnetic(c::QE_CALCULATION) +function ismagnetic(c::Calculation{<:AbstractQE}) return get(c, :nspin, 0.0) > 0.0 || get(c, :total_magnetization, 0.0) end -function outfiles(c::QE_CALCULATION) +function outfiles(c::Calculation{<:AbstractQE}) files = [c.outfile] for (is, fuzzies) in zip(("projwfc.x", "hp.x", "pp.x"), (("pdos",), ("Hubbard_parameters",), ("filplot", "fileout"))) if c.exec.exec == is @@ -265,8 +264,8 @@ function outfiles(c::QE_CALCULATION) return unique(files) end -ψ_cutoff_flag(::QE_CALCULATION) = :ecutwfc -ρ_cutoff_flag(::QE_CALCULATION) = :ecutrho +ψ_cutoff_flag(::Calculation{<:AbstractQE}) = :ecutwfc +ρ_cutoff_flag(::Calculation{<:AbstractQE}) = :ecutrho function kgrid(na, nb, nc, ::Union{Type{QE}, Type{QE7_2}}) return reshape([(a, b, c, 1 / (na * nb * nc)) @@ -276,7 +275,7 @@ function kgrid(na, nb, nc, ::Union{Type{QE}, Type{QE7_2}}) (na * nb * nc)) end -function set_kpoints!(c::QE_CALCULATION, k_grid::NTuple{3,Int}; print = true) #nscf +function set_kpoints!(c::Calculation{<:AbstractQE}, k_grid::NTuple{3,Int}; print = true) #nscf print && !isnscf(c) && (@warn "Expected calculation to be 'nscf'.\nGot $c.") d = data(c, :k_points) if d !== nothing @@ -291,7 +290,7 @@ function set_kpoints!(c::QE_CALCULATION, k_grid::NTuple{3,Int}; print = true) #n return c end -function set_kpoints!(c::QE_CALCULATION, k_grid::NTuple{6,Int}; print = true) #scf +function set_kpoints!(c::Calculation{<:AbstractQE}, k_grid::NTuple{6,Int}; print = true) #scf print && !(isscf(c) || isvcrelax(c) || isrelax(c)) && (@warn "Expected calculation to be scf, vc-relax, relax.") @@ -308,7 +307,7 @@ function set_kpoints!(c::QE_CALCULATION, k_grid::NTuple{6,Int}; print = true) #s return c end -function set_kpoints!(c::QE_CALCULATION, k_grid::Vector{<:NTuple{4}}; print = true, +function set_kpoints!(c::Calculation{<:AbstractQE}, k_grid::Vector{<:NTuple{4}}; print = true, k_option = :crystal_b) print && isbands(c) != "bands" && @@ -339,60 +338,60 @@ function set_kpoints!(c::QE_CALCULATION, k_grid::Vector{<:NTuple{4}}; print = tr end """ - gencalc_scf(template::QE_CALCULATION, kpoints::NTuple{6, Int}, newflags...; name="scf") + gencalc_scf(template::Calculation{<:AbstractQE}, kpoints::NTuple{6, Int}, newflags...; name="scf") Uses the information from the template and `supplied` kpoints to generate an scf calculation. Extra flags can be supplied which will be set for the generated calculation. """ -function gencalc_scf(template::QE_CALCULATION, kpoints::NTuple{6,Int}, newflags...; +function gencalc_scf(template::Calculation{<:AbstractQE}, kpoints::NTuple{6,Int}, newflags...; name = "scf") return calculation_from_kpoints(template, name, kpoints, :calculation => "scf", newflags...) end """ - gencalc_vcrelax(template::QE_CALCULATION, kpoints::NTuple{6, Int}, newflags...; name="scf") + gencalc_vcrelax(template::Calculation{<:AbstractQE}, kpoints::NTuple{6, Int}, newflags...; name="scf") Uses the information from the template and supplied `kpoints` to generate a vcrelax calculation. Extra flags can be supplied which will be set for the generated calculation. """ -function gencalc_vcrelax(template::QE_CALCULATION, kpoints::NTuple{6,Int}, newflags...; +function gencalc_vcrelax(template::Calculation{<:AbstractQE}, kpoints::NTuple{6,Int}, newflags...; name = "vcrelax") return calculation_from_kpoints(template, name, kpoints, :calculation => "vc-relax", newflags...) end """ - gencalc_bands(template::QE_CALCULATION, kpoints::Vector{NTuple{4}}, newflags...; name="bands") + gencalc_bands(template::Calculation{<:AbstractQE}, kpoints::Vector{NTuple{4}}, newflags...; name="bands") Uses the information from the template and supplied `kpoints` to generate a bands calculation. Extra flags can be supplied which will be set for the generated calculation. """ -function gencalc_bands(template::QE_CALCULATION, kpoints::Vector{<:NTuple{4}}, newflags...; +function gencalc_bands(template::Calculation{<:AbstractQE}, kpoints::Vector{<:NTuple{4}}, newflags...; name = "bands") return calculation_from_kpoints(template, name, kpoints, :calculation => "bands", newflags...) end """ - gencalc_nscf(template::QE_CALCULATION, kpoints::NTuple{3, Int}, newflags...; name="nscf") + gencalc_nscf(template::Calculation{<:AbstractQE}, kpoints::NTuple{3, Int}, newflags...; name="nscf") Uses the information from the template and supplied `kpoints` to generate an nscf calculation. Extra flags can be supplied which will be set for the generated calculation. """ -function gencalc_nscf(template::QE_CALCULATION, kpoints::NTuple{3,Int}, newflags...; +function gencalc_nscf(template::Calculation{<:AbstractQE}, kpoints::NTuple{3,Int}, newflags...; name = "nscf") return calculation_from_kpoints(template, name, kpoints, :calculation => "nscf", newflags...) end """ - gencalc_projwfc(template::QE_CALCULATION, Emin, Emax, DeltaE, newflags...; name="projwfc") + gencalc_projwfc(template::Calculation{<:AbstractQE}, Emin, Emax, DeltaE, newflags...; name="projwfc") Uses the information from the template and supplied `kpoints` to generate a `projwfc.x` calculation. Extra flags can be supplied which will be set for the generated calculation. """ -function gencalc_projwfc(template::QE_CALCULATION, Emin, Emax, DeltaE, extraflags...; +function gencalc_projwfc(template::Calculation{<:AbstractQE}, Emin, Emax, DeltaE, extraflags...; name = "projwfc") occflag = get(template, :occupations, "fixed") ngauss = 0 diff --git a/src/Calculations/wannier.jl b/src/Calculations/wannier.jl index 8f6b147a..81f46139 100644 --- a/src/Calculations/wannier.jl +++ b/src/Calculations/wannier.jl @@ -12,7 +12,7 @@ flagtype(::Calculation{Wannier90}, flag) = flagtype(Wannier90, flag) Generates a Wannier90 calculation to follow on the supplied `nscf` calculation. It uses the projections defined in the `structure`, and starts counting the required amount of bands from `Emin`. The `nscf` needs to have a valid output since it will be used in conjunction with `Emin` to find the required amount of bands and energy window for the Wannier90 calculation. """ -function gencalc_wan(nscf::Calculation{QE}, structure::Structure, bands, Emin, wanflags...; Epad = 5.0, +function gencalc_wan(nscf::Calculation{<:AbstractQE}, structure::Structure, bands, Emin, wanflags...; Epad = 5.0, wanexec = Exec(; name="wannier90", path = "wannier90.x")) projs = vcat(map(structure.atoms) do x ps = x.projections @@ -178,7 +178,7 @@ function remote_calcs(job, _calculation::Calculation{Wannier90}) nscf = getfirst(x -> Calculations.isnscf(x), job.calculations) @assert nscf !== nothing "No NSCF found to generate pw2wannier90 from." - @assert eltype(nscf) == QE "Only QE based Wannier90 jobs are supported." + @assert eltype(nscf) <: AbstractQE "Only QE based Wannier90 jobs are supported." pw2wan_exec = Exec(name = "", path=joinpath(dirname(nscf.exec.path), "pw2wannier90.x"), modules=nscf.exec.modules) diff --git a/src/Client/job.jl b/src/Client/job.jl index d48bc075..ce7ac3e1 100644 --- a/src/Client/job.jl +++ b/src/Client/job.jl @@ -43,7 +43,7 @@ function RemoteHPC.load(server::Server, j::Job) if c.structure !== nothing push!(structures, c.structure) end - push!(outcalcs, Calculation(splitext(infile)[1], c.flags, c.data, e, calc.run, infile, outfile)) + push!(outcalcs, Calculation{c.package}(splitext(infile)[1], c.flags, c.data, e, calc.run, infile, outfile)) end end if !isempty(structures) @@ -107,7 +107,7 @@ function write_calculations(job::Job; fillexecs=true) nscf = getfirst(x->Calculations.isnscf(x), job.calculations) @assert nscf !== nothing "No NSCF found to generate pw2wannier90 from." - @assert eltype(nscf) == QE "Only QE based Wannier90 jobs are supported." + @assert eltype(nscf) <: AbstractQE "Only QE based Wannier90 jobs are supported." for c in wcalcs pwcalc = FileIO.qe_generate_pw2wancalculation(c, nscf) diff --git a/src/FileIO/qe.jl b/src/FileIO/qe.jl index d5cfce95..f50128bc 100644 --- a/src/FileIO/qe.jl +++ b/src/FileIO/qe.jl @@ -1,6 +1,6 @@ import Base: parse -function readoutput(c::Calculation{QE}, files...; kwargs...) +function readoutput(c::Calculation{<:AbstractQE}, files...; kwargs...) return qe_parse_output(c, files...; kwargs...) end @@ -35,7 +35,7 @@ function qe_parse_time(str::AbstractString) return t end -function qe_parse_output(c::Calculation{QE}, files...; kwargs...) +function qe_parse_output(c::Calculation{<:AbstractQE} , files...; kwargs...) if Calculations.isprojwfc(c) return qe_parse_projwfc_output(files...) elseif Calculations.ishp(c) @@ -1296,7 +1296,7 @@ function qe_parse_calculation(file) end push!(datablocks, InputData(:k_points, k_option, k_data)) end - return (flags = allflags, data = datablocks, structure = structure, pre_7_2 = pre_7_2) + return (flags = allflags, data = datablocks, structure = structure, package = pre_7_2 ? QE : QE7_2) end function qe_writeflag(f, flag, value) @@ -1440,7 +1440,7 @@ end Writes a string represenation to `f`. """ -function Base.write(f::IO, calculation::Calculation{T}, structure=nothing) where {T <: Union{QE, QE7_2}} +function Base.write(f::IO, calculation::Calculation{T}, structure=nothing) where {T <: AbstractQE} cursize = f isa IOBuffer ? f.size : 0 if Calculations.hasflag(calculation, :calculation) Calculations.set_flags!(calculation, @@ -1526,7 +1526,7 @@ end function write_data(f, data) if typeof(data) <: Matrix writedlm(f, data) - elseif typeof(data) <: Union{String,Symbol} + elseif typeof(data) <: AbstractQE write(f, "$data\n") elseif typeof(data) <: Vector && length(data[1]) == 1 write(f, join(string.(data), " ")) @@ -1540,7 +1540,7 @@ function write_data(f, data) end end -function write_positions_cell(f, calculation::Union{Calculation{QE}, Calculation{QE7_2}}, structure) +function write_positions_cell(f, calculation::Calculation{<:AbstractQE}, structure) unique_at = unique(structure.atoms) write(f, "ATOMIC_SPECIES\n") write(f, @@ -1591,7 +1591,7 @@ function write_structure(f, calculation::Calculation{QE7_2}, structure) end end -function qe_generate_pw2wancalculation(c::Calculation{Wannier90}, nscf::Union{Calculation{QE}, Calculation{QE7_2}}) +function qe_generate_pw2wancalculation(c::Calculation{Wannier90}, nscf::Calculation{<:AbstractQE}) flags = Dict() if haskey(nscf, :prefix) flags[:prefix] = nscf[:prefix] diff --git a/src/FileIO/wannier.jl b/src/FileIO/wannier.jl index bdcbf2b0..95019921 100644 --- a/src/FileIO/wannier.jl +++ b/src/FileIO/wannier.jl @@ -204,7 +204,7 @@ function wan_parse_calculation(file) end structure = extract_structure(cell_block, atoms_block, proj_block, get(flags, :spinors, false)) - return (flags=flags, data=data, structure = structure) + return (flags=flags, data=data, structure = structure, package=Wannier90) end function wan_parse_array_value(eltyp, value_str) From 28306e68576c7e627040495e413352c9f590f9f7 Mon Sep 17 00:00:00 2001 From: louisponet Date: Mon, 4 Sep 2023 09:41:02 +0200 Subject: [PATCH 14/14] upped version added convert to 7_2 --- Project.toml | 2 +- src/Calculations/Calculations.jl | 2 +- src/Calculations/calculation.jl | 2 -- src/Calculations/qe.jl | 2 ++ 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Project.toml b/Project.toml index bbd28af1..8bbb0a68 100644 --- a/Project.toml +++ b/Project.toml @@ -2,7 +2,7 @@ name = "DFControl" uuid = "1e31e15d-4957-550d-a244-318eced754ae" authors = ["Louis Ponet "] repo = "https://github.com/louisponet/DFControl.jl.git" -version = "0.5.32" +version = "0.6.1" [deps] ANSIColoredPrinters = "a4c015fc-c6ff-483c-b24f-f7ea428134e9" diff --git a/src/Calculations/Calculations.jl b/src/Calculations/Calculations.jl index 222d8382..c082496d 100644 --- a/src/Calculations/Calculations.jl +++ b/src/Calculations/Calculations.jl @@ -16,5 +16,5 @@ include("documentation.jl") include("julia.jl") export Calculation, InputData -export Wannier90, AbstractQE, QE, QE7_2, Abinit, Elk, Julia, set_flags! +export Wannier90, AbstractQE, QE, QE7_2, Abinit, Elk, Julia, set_flags!, convert_to_7_2 end diff --git a/src/Calculations/calculation.jl b/src/Calculations/calculation.jl index 202970ea..48347ebc 100644 --- a/src/Calculations/calculation.jl +++ b/src/Calculations/calculation.jl @@ -129,11 +129,9 @@ function Calculation(dict::JSON3.Object) Calculation(dict[:name], Dict(dict[:flags]), [InputData(t) for t in dict[:data]], Exec(dict[:exec]), dict[:run], dict[:infile], dict[:outfile]) end - # Calculation() = Calculation{NoPackage}(package=NoPackage()) StructTypes.StructType(::Type{<:Calculation}) = StructTypes.Struct() - # Interface Functions isbands(c::Calculation) = false isnscf(c::Calculation) = false diff --git a/src/Calculations/qe.jl b/src/Calculations/qe.jl index 011d3bb4..0ca6a7a2 100644 --- a/src/Calculations/qe.jl +++ b/src/Calculations/qe.jl @@ -421,3 +421,5 @@ function gencalc_projwfc(template::Calculation{<:AbstractQE}, Emin, Emax, DeltaE set_flags!(out, extraflags...) return out end + +convert_to_7_2(c::Calculation{QE}) = Calculation{QE7_2}(name = c.name, flags = c.flags, data = c.data, exec=c.exec, run = c.run, infile=c.infile, outfile=c.outfile)