forces for electronic excited states: an implementation of td … · 2013. 10. 3. · forces for...

20
Forces for Electronic Excited States: An Implementation of TD-DFT in CASTEP ESDG Cambridge 2 nd October 2013 Dominik Jochym STFC Rutherford Appleton Laboratory [email protected]

Upload: others

Post on 30-Jan-2021

4 views

Category:

Documents


0 download

TRANSCRIPT

  • Forces for Electronic Excited States: An Implementation of TD-DFT in CASTEP

    ESDG Cambridge 2nd October 2013

    Dominik Jochym STFC Rutherford Appleton Laboratory

    [email protected]

  • Polyfluorene

  • Time-Dependent DFT •  One-to-one correspondence between time-

    dependent one-body densities and time-dependent one-body potentials.

    •  Time dependent Kohn-Sham equations

    n(r, t) $ vext

    (r, t)

    i@�j(r, t)

    @t=

    �r

    2

    2+ vks[n](r, t)

    ��j(r, t)

  • TD Linear Response •  Response to a harmonic perturbation

    •  Coupled Sternheimer equations

    ⇣H(0) � "i

    ⌘ ����(±)iE+ Pc[�V

    (±) + �Vscf(±!)]����(0)i

    E= ⌥!

    ����(±)iE

    �Vext

    (r, t) = �V (+)(r)ei!t + �V (�)(r)e�i!t

  • Direct Calculation of Excitations

    •  Tamm-Dancoff approximation

    where

    non-Hermitian eigenvalue equation, which gives the excitation energies directly✓

    A BB⇤ A⇤

    ◆ ✓XY

    ◆= !

    ✓1 00 �1

    ◆ ✓XY

    ◆. (3)

    In the Tamm-Danco↵ approximation, the B matrices are set to zero, which leadsto a Hermitian eigenvalue problem AX = !X. It is this Hermitian eigenvalueproblem that will be implemented for the “Hutter solver”.

    In the context of a plane-wave code, the vectors X and Y are the plane-wavecoe�cients of electronic wavefunctions, i.e. |�(±)i i from above. In CASTEP,these are four-dimensional arrays, the dimensions being G-vectors (plane-waves),k-points, bands and spin. For a TDDFT calculation, one typically has ⇠105 � 106 G-vectors, ⇠ 100 � 1000 bands, a single k-point and spin of 1 or 2dpending on whether the system is being treated as spin-degenerate. Of course,storing and diagonalising a matrix of this size is innapropriate, especially as oneis only interested in the lowest few excited states. Instead we turn to iterativemethods, where only the result of the operator on a vector is required.

    Hutter defines this operator in equation 35 of his paper, where he chooses toseparate it into two components, such that A = A + B. The first contributionis from Kohn-Sham orbital energy di↵erences

    A����(�)i

    E= (H(0) � ✏i)

    ����(�)iE

    . (4)

    The action of this operator was already implemented for DFPT in CASTEP.The second contribution is

    B����(�)i

    E= Pc�V

    scf

    [n(�)]����(0)i

    E, (5)

    where �Vscf

    [n(�)] is the self-consistent reponse potential for a change in electrondensity

    n(�)(r) =NX

    i=1

    �(0)⇤i (r)�(�)i (r), (6)

    and�V

    scf

    [n(�)] =Z

    dr0⇢

    1|r� r0| +

    �2Exc

    �n(r)�n(r0)

    �n(r0), (7)

    which is the same as used in DFPT, but for a factor of 2 in the response density.Given the e↵ect of the A operator on a given wavefunction, an ‘o↵-the-

    shelf’ iterative eigensolver with a reverse communication interface can be used.By using a library routine, we can thoroughly test our implementation of theoperator. We used two di↵erent solvers, namely ARPACK3 and EA19, the latterbeing from the HSL (formerly the Harwell Subroutine Library)4. ARPACK iswritten in Fortran77 and implements the Arnoldi process. HSL-EA19 is writtenin F95 + TR 15581 and implements a Jacobi-conjugate preconditioned gradientsscheme.

    3http://www.caam.rice.edu/software/ARPACK/4http://www.hsl.rl.ac.uk

    3

    AX = !X

    X = {X1 . . . Xi} Xi =unoccX

    a

    xai�a

  • TDDFT in CASTEP •  Based on Hutter’s formulation

    J. Chem. Phys. 118, 3928 (2003)

    •  Self-consistent response

    •  Response density n(1)(r) =

    occX

    i

    �⇤(0)i (r)�(1)

    i (r)

    �Vscf

    [n(1)](r) =

    Zdr0

    ⇢1

    |r� r0| +�E

    xc

    �n(r)�n(r0)

    ����n=n(0)

    �n(1)(r0)

    ⇣H(0) � "i

    ⌘ ����(1)iE+ Pc�Vscf[n

    (1)]����(0)i

    E= !

    ����(1)iE

  • Hartree-Fock Contribution •  Contribution to excitation energy

    •  Require the gradient w.r.t. response wavefunction

    •  http://www.hector.ac.uk/cse/distributedcse/reports/castep02/

    !hf = �chfoccX

    i

    occX

    j

    ZZdrdr0

    �⇤(1)i (r)�(1)

    j (r)�(0)

    j (r0)�(0)i (r

    0)

    |r� r0|

    �!hf

    ��⇤(1)i (r)= �chf

    occX

    j

    �(1)j (r)

    Zdr0

    �(0)i (r0)�⇤(0)j (r

    0)

    |r� r0|

  • Validation Tests •  Comparisons with CPMD

    3.1 Results

    At the end of section 2, we calculated the first excitation energy of methane tobe 9.10 eV by scanning through frequency. Calculating the lowest eigenvaluedirectly on the same system, we get a value of 9.08 eV. Table 2 compares theeigenvalues for a selection of molecules calculated using CASTEP and CPMD5,where Hutter’s method was originally implemented.

    Molecule State CASTEP CPMDN

    2

    1 9.282 9.2832 9.282 9.2833 9.692 9.6924 10.259 10.2515 10.270 10.2696 10.270 10.2697 11.495 11.4888 11.495 11.488

    H2

    1 9.988 9.9972 10.840 10.8313 11.024 11.0144 11.024 11.0145 11.403 11.392

    Table 1: Eigenvalue comparison

    4 Implementation of parallel distribution solverfor true HPC use on HECToR

    Milestone 3 - Port of code to HECToR. More extensive testing, debugging andbenchmarking against previous calculations. Demo calculations on larger sys-tems than feasible in stage 2. This work comprises stages 6 and 7 of the workplan.

    While using stock serial eigensolvers was invaluable while developing thecode for the operator, a parallel solver is required. HSL-EA19 currently has noparallel version available. ARPACK does have a parallel version, but it is not onethat can be used with the existing parallel distribution schemes in CASTEP. Wechose to implement two algorithms, a state-by-state conjugate gradients solverand a block Davidson solver, with help from Phil Hasnip (University of Yorkand member of the CASTEP Development Group).

    Hutter’s formulation assumes that the special k-point � is used.6 This meansthat the real-space representation of the wavefunctions can always be real (asopposed to complex). CASTEP already has �-point optimisations and we cantake advantage of these also. Using a single k-point restricts our choice of

    5http://www.cpmd.org6It is reasonably straightforward to extend Hutter’s derivation to a single arbitrary k-

    point. The complex representation of the response density in equation 6 (above) allows forthis extension. The equations for multiple k-points are not trivial and would require furtherresearch, and is therefore beyond the scope of this dCSE.

    4

  • Response Densities

  • Response Densities

  • Response Densities

  • Response Densities

  • Characterisation of States •  Singlet or Triplet •  Projection onto unoccupied Kohn-Sham bands

    •  “Spurious” states

    –  Heßelmann and Görling PRL 102, 233003 (2009)

    ⇣H(0) � "i

    ⌘ ����(1)iE+ Pc�Vscf[n

    (1)]����(0)i

    E= !

    ����(1)iE

    D�(1)i

    ����(0)aE

  • C60

  • Parallel Scaling •  Performance on HECToR (Phase 2b)

  • TD-DFT Forces •  Three contributions:

    F IGS

    =occX

    i

    ⌧�(0)i

    ����@H(0)

    @RI

    �����(0)

    i

    F IZ =occX

    i

    ⌧Zi

    ����@H(0)

    @RI

    �����(1)

    i

    �+

    ⌧�(1)i

    ����@H(0)

    @RI

    ����Zi�

    F IX =occX

    i

    ⌧�(1)i

    ����@H(0)

    @RI

    �����(1)

    i

    ��

    occX

    i

    ⌧�(0)i

    ����@H(0)

    @RI

    ����

    0

    @occX

    j

    D�(1)i

    ����(1)jE ����(0)j

    E1

    A

  • Handy-Schaefer Z vector •  Need to take into account the how the TDDFT

    response wavefunction changes as the ground state is perturbed

    •  Requires the solution of a self-consistent Sternheimer equation to obtain the Handy-Schaefer Z vector

    •  http://www.hector.ac.uk/cse/distributedcse/reports/castep03/

    (H(0) � "i) |Z⇤i i+ Pc�Vscf[n(z)]����(0)i

    E= |uii

    n(z)(r) =occX

    i

    Zi(r)�(0)

    i (r)

  • State Crossings

  • Summary •  TDDFT in CASTEP

    –  Electronic excitation energies –  Characterisation of TDDFT states as KS orbitals –  Optical matrix elements (transition intensities) –  Compatible with OptaDOS –  For a selected TDDFT state - Forces

    •  Structure optimisation •  Molecular dynamics •  (Phonons)

    •  Available in CASTEP 7.0