quantum-espresso/examples/EXX_example
marsamos 6846e02242 added example for HSE, now is nice first PBE0 then HSE
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@6340 c92efa57-630b-4861-b058-cf58834340f0
2010-02-02 14:15:59 +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 Obsolete statements removed, a few scripts updated (xc_type -> input_dft). 2009-07-10 13:19:48 +00:00
run_example added example for HSE, now is nice first PBE0 then HSE 2010-02-02 14:15:59 +00:00

README

 Hybrid Hartree-Fock-DFT functionals are an experimental feature in PWscf.
 Only few functionalities are implemented and it is possible (actually
 desirable, see later) that the implementation evolves in the future 
 therefore its stability cannot be garanteed.

 HOW TO COMPILE : 
  i) download the CVS version of QE and execute the ../configure step
  ii) edit file make.sys and add to variable DFLAGS the -DEXX option
  iii) issue "make pw" .
  Pay attention that ./configure re-creates make.sys so if the QE distributions
  is updated and ./configure run again also step ii) above has to be done again.

 WHICH FUNCTIONALS ARE IMPLEMENTED ?
  only a few hybrid functionals are implemented: Hartree-Fock, PBE0
  and B3LYP .  Their labels in QE are "HF", "PBE0" and "B3LYP" 
  (the latter can be written as "B3LP" as well, for compatibility
  with earlier implementations) .
  Usually in PWscf the functional to be used is read from the
  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. PBE or LDA) and force the
  use of the hybrid functional in the PWscf input.
  This is done using the variable input_dft in system namelist; for instance
  input_dft="pbe0" will force the use of pbe0 unrespective of the functional
  used in the pseudopotential generation.

 HOW DOES THE SCF SEARCH PROCEED ? 
  use of hybrid-functionals is VERY expensive (see later), moreover in
  more traditional DFT calculation the mixed quantity is the density while
  for HF of hybrid-functionals the density-matrix should be mixed which is
  not practical. The strategy used here is to consider (let's focus on HF
  for simplicity) an auxiliary set of wavefunctions psi in addition to the
  usual set phi and to minimize the auxiliary functional:
  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.
   1) a normal scf (with LDA or other scheme is performed) then
   2) hybrid functional is switched on and psi = phi (the current best wfcs)
   3) a new scf is performed w.r.t phi, keeping fixed Vx[psi] 
   4) dexx[phi,psi] is computed and if it exceeds the required tollerance 
      the proceedure is repeated from point 2)
  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 MUCH EXPENSIVE IS THE CALCULATION ?
  Very much.
  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 formualtion (without
  exploiting the locality of the KB projetors) cost NKB * (2 * NPW) where
  NKB is tipically 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
  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 test does not seem to be superior to option 2) ... it has not 
     been fully 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 can be better but this has not been explored.
     This option is currently not implemented but would be easy to resume it.

 OTHER LIMITATIONS 
  So far only NORM-CONSERVING pseudopotentials are implemented.
  there is no fundametal 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 only R-and-G parallelization has been implemented.
  This is what is 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, except when q-integration reduce to Gamma. 
  In this case it should work. 
  If the scratch area is common to all processors one could think about
  implementing it in general (one would needs a VERYBIG direct-access
  file that all processors can see) .. this feature is not implemented.

 WHAT PROPERTIES CAN I COMPUTE ?
  Energy and forces (thanks to Hellman-feynman theorem forces do not
  require extra calculations). In principle also stresses but the 
  corresponding formulas have not been coded yet. 
  So structural optimization is OK if the cell shape is kept fixed.
  Band structure ? yes and no. Obviously one compute wfc during the scf 
  cycle and their eigenvalues are printed in output.
  This can be enough to draw a band structure or a DOS, however the
  problem is when one wish non-scf calculations in k-points different
  from those computed during the scf cycle. At present it is not possible
  because it 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 nq,
  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 Stefano de Gironcoli
  (degironc@sissa.it) and keep in mind that this feature is still 
  experimetal..