User Tools

Site Tools


exercises:2015_pitt:hfx

This is an old revision of the document!


Hartree-Fock exchange

The purpose of this section is to explain how to compute hybrid functionals (or Hartree-Fock exchange, HFX) with CP2K in condensed phase systems. It is based on the developments described in 10.1021/ct900494g and 10.1063/1.2931945, and its efficient extension (ADMM) described in 10.1021/ct1002225.

Hartree-Fock exchange in CP2K is based on four center integrals, these are computed with an external library (libint). Do these exercises, CP2K must be linked to this library.

This approach has a computational cost that depends strongly on the nature of the basis, unless combined with ADMM (see below), do not use MOLOPT basis sets with HFX. We use basis sets from HFX_BASIS, which are suitable.

Truncated Coulomb operator

To enable HFX in the condensed phase (described at the Gamma point only), CP2K employs a truncated Coulomb operator for the exchange part. The physical picture is that we do not want to have 'self-exchange interactions' of an electron with its image in neighboring unit cells. As a rule of thumb, the maximum range (truncation radius) is L/2 where L is the smallest edge of the unit cell.

1st task : GGA restart wfn

using the water input from the previous exercise, we will perform a single point GGA calculation to generate an initial wavefunction (wfn) restart. HFX calculations benefit from this.

Change the input to:

  • RUN_TYPE ENERGY
  • IOLEVEL MEDIUM
  • RESTART ON
  • comment section &EXT_RESTART

Run the input and rename the generated wfn file (WATER-RESTART.wfn) to WATER-RESTART-GGA.wfn. Also make a note of the HOMO - LUMO gap [eV]

2nd task: PBE0-D3 water

To do a hybrid calculation, we just change the &XC section. Various examples can be found in the regtests, but here we employ a section equivalent to PBE0-D3.

Change the input to:

  • SCF_GUESS RESTART
  • WFN_RESTART_FILE_NAME WATER-RESTART-GGA.wfn

And employ the following &XC section:

    ! specify the exchange and correlation treatment
    &XC
      ! use a PBE0 functional 
      &XC_FUNCTIONAL
       &PBE
         ! 75% GGA exchange
         SCALE_X 0.75
         ! 100% GGA correlation
         SCALE_C 1.0
       &END PBE
      &END XC_FUNCTIONAL
      &HF
        ! 25 % HFX exchange
        FRACTION 0.25
        &SCREENING
          ! important parameter to get stable HFX calcs
          EPS_SCHWARZ 1.0E-6
          ! needs a good (GGA) initial guess 
          SCREEN_ON_INITIAL_P TRUE
        &END
        &INTERACTION_POTENTIAL
          ! for condensed phase systems
          POTENTIAL_TYPE TRUNCATED
          ! should be less than halve the cell
          CUTOFF_RADIUS 6.0
          ! data file needed with the truncated operator
          T_C_G_DATA ./t_c_g.dat
        &END
        &MEMORY
          ! In MB per MPI rank.. use as much as need to get in-core operation
          MAX_MEMORY 4000
          EPS_STORAGE_SCALING 0.1
        &END
      &END
      ! adding Grimme's D3 correction (by default without C9 terms) 
      &VDW_POTENTIAL
         POTENTIAL_TYPE PAIR_POTENTIAL
         &PAIR_POTENTIAL
            PARAMETER_FILE_NAME dftd3.dat
            TYPE DFTD3
            REFERENCE_FUNCTIONAL PBE0
            R_CUTOFF [angstrom] 16
         &END
      &END VDW_POTENTIAL
    &END XC

Topics:

  • EPS_SCHWARZ, EPS_PGF_ORB, SCREEN_ON_INITIAL_P : parameters to guarantee stable SCF.
  • Fraction of exchange (SCALE_X, FRACTION).

Run this input, it should lead to an output like:

  HFX_MEM_INFO| Number of cart. primitive ERI's calculated:          20780449251
  HFX_MEM_INFO| Number of sph. ERI's calculated:                      4626861713
  HFX_MEM_INFO| Number of sph. ERI's stored in-core:                  1440639962
  HFX_MEM_INFO| Number of sph. ERI's stored on disk:                           0
  HFX_MEM_INFO| Number of sph. ERI's calculated on the fly:                    0
  HFX_MEM_INFO| Total memory consumption ERI's RAM [MB's]:                  1368
  HFX_MEM_INFO| Whereof max-vals [MB's]:                                      78
  HFX_MEM_INFO| Total compression factor ERI's RAM:                         8.03
  HFX_MEM_INFO| Total memory consumption ERI's disk [MB's]:                    0
  HFX_MEM_INFO| Total compression factor ERI's disk:                        0.00
  HFX_MEM_INFO| Size of density/Fock matrix [MB's]:                           14
  HFX_MEM_INFO| Size of buffers [MB's]:                                        2
  HFX_MEM_INFO| Number of periodic image cells considered:                    27
  HFX_MEM_INFO| Est. max. program size after HFX  [MB's]:                    243

     1 OT DIIS     0.80E-01   68.5     0.00096341     -1102.1375916328 -1.10E+03

  Trace(PS):                                  512.0000000000
  Electronic density on regular grids:       -511.9999999886        0.0000000114
  Core density on regular grids:              511.9999999836       -0.0000000164
  Total charge density on r-space grids:       -0.0000000051
  Total charge density g-space grids:          -0.0000000051

     2 OT DIIS     0.80E-01    4.1     0.00064929     -1102.1607534171 -2.32E-02

Topics:

  • in-core operation.
  • How to detect instabilities due to too aggressive screening.

Truncated Coulomb operator with long range correction

Auxiliary Density Matrix Methods (ADMM)

Required files

exercises/2015_pitt/hfx.1425470533.txt.gz · Last modified: 2020/08/21 10:15 (external edit)