quantum-espresso/examples/EXX_example
degironc a42b22ad2e small changes, more informative prefixes in the input files
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@7145 c92efa57-630b-4861-b058-cf58834340f0
2010-10-15 13:44:13 +00:00
..
Pseudo pseudo for EXX example 2006-02-09 13:53:56 +00:00
reference added reference for HSE example 2010-02-02 14:15:08 +00:00
README Documentation for EXX updated - please verify 2010-03-10 19:36:35 +00:00
run_example small changes, more informative prefixes in the input files 2010-10-15 13:44:13 +00:00

README

 Hybrid Hartree-Fock+DFT functionals are a still evolving feature in PWscf.
 Only a few functionalities are implemented.

 HOW TO COMPILE : 
  i) if you have already compiled once PWscf, issue command "make clean"
  ii) edit file make.sys and add to variable DFLAGS the -DEXX option
  iii) "make pw" .

 WHICH FUNCTIONALS ARE IMPLEMENTED ?
  The following hybrid functionals are implemented: Hartree-Fock, PBE0,
  B3LYP, HSE (see Modules/functionals.f90 for updated info and more details). 
  Usually in PWscf the functional to be used is read from pseudopotential
  files but we do not have so far a pseudopotential generator for hybrid
  functionals so one needs to use pseudopotentials generated with some other
  functionals (eg. LDA, PBE, BLYP) and force the usage of a hybrid functional 
  using input variable "input_dft" in system namelist; for instance,
  input_dft="pbe0" will force the usage of PBE0 irrespective of the 
  functional used in the pseudopotential generation.

 HOW DOES SELF-CONSISTENCY WORK ? 
  The usage of hybrid functionals is VERY expensive (see later). Moreover
  self-consistency should be reached on the density-matrix, instead of the
  charge density as in traditional DFT. This is not feasible with plane waves.
  The strategy used here is to consider an auxiliary set of wavefunctions psi
  in addition to the usual set phi and to minimize the auxiliary functional
  (let us focus on HF for simplicity):
  E[phi,psi] = T[phi] + E_ext[phi] + E_Hartree[phi] + 
                        <phi|Vx[psi]|phi> - 0.5*<psi|Vx[psi]|psi>
  where Vx[psi] is the fock operator defined with the auxiliary function psi.
  Taking the functional derivatives w.r.t. phi it can be shown that the scf 
  condition for phi are the HF equation with fixed Fock operator, so Vx does 
  not enter in the scf procedure and one can mix density as usual. The 
  minimum condition w.r.t. psi is simply psi=phi so when both psi and phi 
  are minimized the standard HF energy is obtained.
  Actually one can show that the functional E[phi,psi] above is
  E[phi,psi]  = E_HF[phi] + dexx[phi,psi]
  where dexx is a positive definite addition to E_HF .
  The scf procedure goes as follow.
   0) a normal scf (with LDA or similar functionals) is performed
   1) hybrid functional is switched on and psi = phi (the current best wfcs)
   2) a new scf is performed w.r.t phi, keeping fixed Vx[psi] 
   3) dexx[phi,psi] is computed and if it exceeds the required tolerance 
      the proceedure is repeated from point 1)
  HF may require several phi-scf cycles to reach full convergence. B3LYP
  and PBE0, due to the smaller fraction of HF exchange included, require
  usually a smaller number of phi-scf cycles

 HOW EXPENSIVE IS THE CALCULATION ?
  Very expensive.
  Applying the Fock operator on a single vawefunction (phi_k,v) requires
  the calculation of an integral over the whole BZ and all psi bands.  
  For each needed pair psi_k+q,v' and phi_k,v an auxiliary charge density 
  rho(-q+G) is built in real space and then FFT to reciprocal space where 
  the corresponding Poisson equation is solved. This auxiliary potential is
  FFT back in real space where it is multiplied by psi_k+q,v' and added to 
  Vx[psi]phi...
  The cost of the operation is therefore roughly NBND * NQS * ( 2 * FFT + ... )
  where NQS is the number of q-points chosen to represent the BZ integration,
  and depends in general on the localization of the Wannier functions of the 
  system.
  For comparison non-local pseudopotentials in the KB formulation (without
  exploiting the locality of the KB projetors) cost NKB * (2 * NPW) where
  NKB is typically of the order of NBND but NPW cost at least an order
  of magnitude less than an FFT.
  Therefore even when one can take NQS=1 (for large non-metallic system
  this should be ok) hybrid functionals will require at least an order of
  magnitude more resources that a standard calculation.

 HOW CAN I CHOSE NQS IN INPUT ?
  In the system namelist there are three variables nqx1,nqx2,nqx3 that 
  define the regular q-grid in the BZ in a way similar to the automatic 
  k-points generation. Their value must be compatible with the k-points 
  used (that is k+q must be equivalent to some other k in the k-points list)
  Their default value are nqx1=1,nqx2=1,nqx3=1 (BZ integration is
  approximated by gamma point value only).

 DIVERGENCE AT q->0
  The BZ integral to be performed has a diverging kernel when (q+G)->0. 
  This is dealt with by adding and subtracting a term with the same
  divergence that can be integrated analytically and performing
  numerically the integration for the non divergent residue
  [Gygi-Baldereschi, PRB 34, 4405 (1986)].
  One problem is left: the now non divergent q=0 term is not easily determined
  since it is a 0/0 (non analytic) limit. Several options have been considered:
  1) just discard it ... this is not a good idea in general because it 
     induces an error proportional to 1/(NQS*Omega) in the total energy
     where Omega is the volume of the Wigner-Seitz cell of the crystal.
     As one wish to keep NQS as small as possible this may be large.
  2) exploit the fact that the term has the above dependence and extract
     it from a calculation with a given nqx1,nqx2,nqx3 and the one with
     a grid twice as coarse in each direction. One does not really need to
     perform  two calculations but can do it internally (even when nqx? are
     not even numbers...). This seems to work and it is set as the default. 
     In order to disable this feature [and get back to option 1)] set
     x_gamma_extrapolation = .false.
  3) perform calculations in q-grids that are shifted away from gamma so that
     the 0/0 term is not needed. This create some extra complication in the
     coding and cannot be used with Gamma-only k-point integration.
     In some tests it didn;t seem superior to option 2) ... it was never
     ully implemented and now it has been removed.
  4) use the value at small (q+G) to estimate the (q+G)->0 limit. This
     again has been tried and found to offer, for low order numerical
     differentiation, no better results that option 2). It is possible
     than higher-order formulas yield better results but this has not been 
     explored. This option is currently not implemented but it would be
     easy to re-implement it.

 OTHER LIMITATIONS 
  So far only NORM-CONSERVING pseudopotentials are implemented.
  there is no fundamental problem in defining HF for US pseudopotentials
  but since some density-like object is required one would need to operate
  on the dense charge-density FFT grid anyway with no computational gain.
  Maybe this is not true and one can find ways to perform this integrals 
  more efficently. So far I did not think to much to this point.

 PARALLEL IMPLEMENTATION ?
  yes (and no). 
  At present, R-and-G parallelization has been implemented. This is what
  is mostly needed for large systems ... 
  For metals k-point parallelization is often useful but the need
  in hybrid functionals for the BZ integration prevent its simple
  implementation (if the scratch area is common to all processors,
  it could be feasible, but one would need a VERY BIG direct-access
  file that all processors can see ... ). When the q-integration reduces
  to Gamma, however, the k-point parallelization should work. If it 
  doesn't, an experimental parallelization on the grid of q-points, 
  using "images" (pwx -nimage N), is available.

 WHAT PROPERTIES CAN I COMPUTE ?
  Energy and forces (thanks to Hellmann-Feynman theorem forces do not
  require extra calculations). In principle also stresses but the 
  corresponding formulas have not yet been coded. 
  So structural optimization is OK if the cell shape is kept fixed.
  Band structure ? yes and no. Obviously one computes wfc during the scf 
  cycle and their eigenvalues are printed in output.
  This can be sufficient to draw a band structure or a DOS, but the problem
  arises when one wishes non-scf calculations in k-points different from
  those computed during the scf cycle. At present it is not possible
  because this would require the knowledge of all bands at k+q that we do
  not have. I do not know how to by-pass this problem.

 ELECTRIC FIELD
  I did not dig into this issue but Paolo Umari is using EXX with
  electric field. For details it would be better to ask him directly.

 AN EXAMPLE
  run_example script in this directory performs two series of calculations:
  1) total energy of Silicon using different values for nqx,
  2) calculation of binding energy of o2,co,n2 from calculations in a
     12 au cubic box and gamma sampling.
  Running it will generate directory "results" to be compared with directory 
  "reference"

  Please report problems and suggestions to QE developers (in particolar:
  Stefano de Gironcoli <degironc@sissa.it>,
  Paolo Giannozzi <giannozz@democritos.it>,
  Layla Martin-Samos <marsamos@gmail.com>), 
  and keep in mind that this feature is still experimental.