Electronic energy optimisation in ONETEP

Similar documents
Density kernel optimisation in the ONETEP code

Self-consistent implementation of meta-gga exchange-correlation functionals within the ONETEP linear-scaling DFT code

CHEM6085: Density Functional Theory

Numerical construction of Wannier functions

Geometry Optimisation

Introducing ONETEP: Linear-scaling density functional simulations on parallel computers

Self-consistent implementation of meta-gga exchange-correlation functionals within the ONETEP linear-scaling DFT code

Self-averaging stochastic Kohn-Sham density functional theory

CHEM6085: Density Functional Theory Lecture 10

Peter David Haynes. Place of birth:abingdon, Oxon Status: Married. Sidney Sussex College, Cambridge Ramon Jenkins Senior Research Fellow in Physics.

Electronic structure theory: Fundamentals to frontiers. 1. Hartree-Fock theory

Basis sets for SIESTA. Emilio Artacho. Nanogune, Ikerbasque & DIPC, San Sebastian, Spain Cavendish Laboratory, University of Cambridge

Linear Solvers. Andrew Hazel

University of Zurich. Polarized atomic orbitals for linear scaling methods. Zurich Open Repository and Archive. Berghold, G; Parrinello, M; Hutter, J

Band Structure Calculations; Electronic and Optical Properties

Solid State Theory: Band Structure Methods

CHEM6085: Density Functional Theory

Handbook of Computational Quantum Chemistry. DAVID B. COOK The Department of Chemistry, University of Sheffield

Differentiation of functions of covariance

Direct optimization of the atomic-orbital density matrix using the conjugate-gradient method with a multilevel preconditioner

Introduction to first-principles modelling and CASTEP

Chapter 2 Linear-Scaling DFT + U for Large Strongly-Correlated Systems

DFT in practice. Sergey V. Levchenko. Fritz-Haber-Institut der MPG, Berlin, DE

CHEM3023: Spins, Atoms and Molecules

Lecture 16: DFT for Metallic Systems

Atomic orbitals of finite range as basis sets. Javier Junquera

The Gutzwiller Density Functional Theory

Chapter 3 Numerical Methods

Engineering Part IIB: Module 4F10 Statistical Pattern Processing Lecture 5: Single Layer Perceptrons & Estimating Linear Classifiers

Orbital Density Dependent Functionals

Density Functional Theory

Density Functional Theory

Image restoration: numerical optimisation

Handbook of Computational Quantum Chemistry

Applications of Large-Scale Density Functional Theory in Biology

Advanced Quantum Mechanics

A very efficient two-density approach to atomistic simulations and a proof of principle for small atoms and molecules

Proof that the maximally localized Wannier functions are real

Fast Eigenvalue Solutions

Chapter 3. The (L)APW+lo Method. 3.1 Choosing A Basis Set

Adaptive Filtering. Squares. Alexander D. Poularikas. Fundamentals of. Least Mean. with MATLABR. University of Alabama, Huntsville, AL.

Behind the "exciting" curtain: The (L)APW+lo method

Toward an O(N) method for the non-equilibrium Green's function calculation

Algorithms and Computational Aspects of DFT Calculations

Numerical optimization

Geometry Optimization

Exploring the energy landscape

MATHEMATICS FOR COMPUTER VISION WEEK 8 OPTIMISATION PART 2. Dr Fabio Cuzzolin MSc in Computer Vision Oxford Brookes University Year

Course Notes: Week 1

Numerical optimization. Numerical optimization. Longest Shortest where Maximal Minimal. Fastest. Largest. Optimization problems

Atomic orbitals of finite range as basis sets. Javier Junquera

Norm-conserving pseudopotentials and basis sets in electronic structure calculations. Javier Junquera. Universidad de Cantabria

Practical Guide to Density Functional Theory (DFT)

which implies that we can take solutions which are simultaneous eigen functions of

Band calculations: Theory and Applications

Supporting information for: Pressure-induced amorphisation and a new. high density amorphous metallic phase in. matrix-free Ge nanoparticles

The Plane-Wave Pseudopotential Method

Accurate kinetic energy evaluation in electronic structure calculations with localised functions on real space grids

The Overhauser Instability

Making Electronic Structure Theory work

3.024 Electrical, Optical, and Magnetic Properties of Materials Spring 2012 Recitation 1. Office Hours: MWF 9am-10am or by appointment

3: Density Functional Theory

Non-linear least squares

Fundamentals and applications of Density Functional Theory Astrid Marthinsen PhD candidate, Department of Materials Science and Engineering

Compressed representation of Kohn-Sham orbitals via selected columns of the density matrix

Self-consistent implementation of meta-gga functionals for the ONETEP linear-scaling electronic structure package

Ab initio Molecular Dynamics Born Oppenheimer and beyond

Key concepts in Density Functional Theory (II)

The Plane-wave Pseudopotential Method

LINEAR AND NONLINEAR PROGRAMMING

Block Iterative Eigensolvers for Sequences of Dense Correlated Eigenvalue Problems

Linear Algebra. Min Yan

Density Functional Theory. Martin Lüders Daresbury Laboratory

Line Search Methods for Unconstrained Optimisation

Conjugate Gradient (CG) Method

MATHEMATICS FOR ECONOMISTS. An Introductory Textbook. Third Edition. Malcolm Pemberton and Nicholas Rau. UNIVERSITY OF TORONTO PRESS Toronto Buffalo

Numerical Methods - Numerical Linear Algebra

Density matrix functional theory vis-á-vis density functional theory

EAD 115. Numerical Solution of Engineering and Scientific Problems. David M. Rocke Department of Applied Science

Algebraic Complexity Theory

CHEM3023: Spins, Atoms and Molecules

Density functional theory in solution: Implementing an implicit solvent model for CASTEP and ONETEP

22 Path Optimisation Methods

4 Post-Hartree Fock Methods: MPn and Configuration Interaction

The Conjugate Gradient Method

Localized Optimization: Exploiting non-orthogonality to efficiently minimize the Kohn-Sham Energy

Cheng Soon Ong & Christian Walder. Canberra February June 2018

DFT: Exchange-Correlation

The Abinit project. Coding is based on modern software engineering principles

On the adaptive finite element analysis of the Kohn-Sham equations

, b = 0. (2) 1 2 The eigenvectors of A corresponding to the eigenvalues λ 1 = 1, λ 2 = 3 are

Poisson Solver, Pseudopotentials, Atomic Forces in the BigDFT code

Tight-Binding Model of Electronic Structures

A Posteriori Error Estimates For Discontinuous Galerkin Methods Using Non-polynomial Basis Functions

Mobile Robotics 1. A Compact Course on Linear Algebra. Giorgio Grisetti

Iterative solvers for linear equations

Minimization of the Kohn-Sham Energy with a Localized, Projected Search Direction

Electronic structure calculations with GPAW. Jussi Enkovaara CSC IT Center for Science, Finland

Preconditioning. Noisy, Ill-Conditioned Linear Systems

In the derivation of Optimal Interpolation, we found the optimal weight matrix W that minimizes the total analysis error variance.

Transcription:

Electronic energy optimisation in ONETEP Chris-Kriton Skylaris cks@soton.ac.uk 1

Outline 1. Kohn-Sham calculations Direct energy minimisation versus density mixing 2. ONETEP scheme: optimise both the density kernel and NGWFs Conditions 3. Density matrix optimisation algorithms in ONETEP Penalty, purification, LNV Density kernel gradients, tensor properties 4. Optimisation of NGWFs NGWF gradients, preconditioning schemes The need for an orthogonal basis set 5. More detailed look at overall ONETEP scheme Initialisation Flowchart, input keywords 2

Electronic density Density Functional Theory (DFT) Hohenberg-Kohn Kohn-Sham Non-interacting electrons Density of interacting electrons 3

Density mixing Solve (diagonalise Hamiltonian) Direct energy minimisation Calculate energy Build density Increase p by 1 Vary orbitals So that Mix with previous densities Increase p by 1 Are within tolerance? No Are within tolerance? No Yes Yes finished Discontinuous changes Hamiltonian search (indirect) finished Direct search for well-defined minimum 4

Function minimisation Iterative procedures Need the value of the function and its gradient at each step Converge to local minima Moves always downhill Robust but may need very large number of iterations Converges in N steps for N- dimensional quadratic function In practice very efficient even for non-quadratic functions 5

1. Kohn-Sham calculations Direct energy minimisation versus density mixing 2. ONETEP scheme: optimise both the density kernel and NGWFs Conditions 3. Density matrix optimisation algorithms in ONETEP Penalty, purification, LVN Density kernel gradients, tensor properties 4. Optimisation of NGWFs NGWF gradients, preconditioning schemes The need for an orthogonal basis set 5. More detailed look at overall ONETEP scheme Initialisation Flowchart, input keywords 6

Kohn-Sham DFT calculations Minimise E w.r.t.: Orbitals Density matrix Computational bottlenecks Build E[n] > O(N 2 ) Orthogonality / solve Hamiltonian O(N 3 ) Idempotency O(N 3 ) 7

Density matrix localisation Nearsightedness of electronic matter W. Kohn, Phys. Rev. Lett. 76, 3168 (1996); E. Prodan and W. Kohn, P.N.A.S. 102 11635 (2005) In systems with a band gap: Linear-scaling approaches: Truncate exponential tail, impose: Non-orthogonal localised functions sparse matrix K matrix made sparse by truncation S and H in terms of also sparse Optimise energy with respect to K 8

ONETEP aims for high accuracy Use only a minimal number of but also optimise these in situ, (in addition to K) Molecular orbitals (MOs) Non-orthogonal Generalised Wannier Functions (NGWFs) 9

Operator Density matrix Position representation NGWF representation 10

Conditions Self-consistency therefore When the operators commute Idempotency Normalisation (spin-unpolarised case) 11

Density matrix optimisation in ONETEP Inner loop: Self-consistently optimise total (interacting) energy E w.r.t K for fixed while imposing weak idempotency and normalisation constraints Outer loop: Self-consistently optimise total (interacting) energy E w.r.t. Equivalent to solving Kohn-Sham equations in psinc basis 12

1. Kohn-Sham calculations Direct energy minimisation versus density mixing 2. ONETEP scheme: optimise both the density kernel and NGWFs Conditions 3. Density matrix optimisation algorithms in ONETEP Penalty, purification, LVN Density kernel gradients, tensor properties 4. Optimisation of NGWFs NGWF gradients, preconditioning schemes The need for an orthogonal basis set 5. More detailed look at overall ONETEP scheme Initialisation Flowchart, input keywords P. D. Haynes, C.-K. Skylaris, A. A. Mostofi and M. C. Payne, J. Phys.: Condens. Matter 20, 294207 (2008) 13

Penalty functional Minimum (P=0) for idempotent density matrices Will always converge, regardless how non-idempotent the initial guess Constraints to preserve the total number of electrons are needed 14

Penalty functional derivatives Assume a steepest descents step to update f k If we apply a quadratic approximation (near the minimum): Purification transformation R. McWeeny, Rev. Mod. Phys. 32(2), 335(1960) 15

Purification transformation Improves the idempotency of a nearly idempotent density matrix Forces occupancies in interval [0,1] ( weak idempotency) Quadratic convergence. Example: f (1) = 1.1 f (2) = 3 1.1 3 2 1.1 2 = 0.968 f (3) = 3 0.968 3 2 0.968 2 = 0.997 Etc.. But, diverges if the initial occupancies are not within certain bounds 16

Energy with penalty functional P. D. Haynes and M. C. Payne, Phys. Rev. B 59, 12173 (1999) Balance between minimum energy and minimum penalty Near-idempotency, depending on value of a Correction expression available for the energy 17

Li-Nunes-Vanderbilt (LNV) functionals X.-P. Li., R. W. Nunes and D. Vanderbilt, Phys. Rev. B 47, 10891 (1993), M. S. Daw, Phys. Rev. B 47,10895 (1993) J. M. Millam and G. E. Scuseria, J. Chem. Phys. 106, 5569 (1997) Energy expressions containing a purification transformation of an auxiliary density matrix Implicitly enforce idempotency Break down if purification transformation breaks Minimisation of band structure energy (equivalent to diagonalisation) But H also depends on r: Self-consistency by density mixing 18

LNV functionals in ONETEP exact_lnv = F exact_lnv = T (default) No density mixing, just direct minimisation of interacting energy Purification never allowed to break down Occupancy maxima and minima tracked Restored by penalty functional if out of safe range Electron number conserved without need to know the chemical potential 19

Canonical purification One can approximate r as a polynomial expansion of H Can do this iteratively with a formula that resembles the purification transformation: A. H. Palser and D. E. Manolopoulos, Phys. Rev. B 58, 12704 (1998) Always converges No need to know m 20

Derivatives with respect to the density kernel Relationship between canonical Kohn-Sham orbitals and NGWFs When varying K: Occupancies change Kohn-Sham orbitals change NGWFs do not change 21

Example: Gradient of penalty functional with respect to K Differentiate with respect to the elements of K Tensor correction To obtain search directions (in steepest descents or conjugate gradients) a contravariant gradient is needed E. Artacho and L. M. del Bosch, Phys. Rev. A 43, 5770 (1991). C. A. White, P. Maslen, M. S. Lee and M. Head-Gordon, Chem. Phys. Lett. 276, 133 (1997). 22

1. Kohn-Sham calculations Direct energy minimisation versus density mixing 2. ONETEP scheme: optimise both the density kernel and NGWFs Conditions 3. Density matrix optimisation algorithms in ONETEP Penalty, purification, LVN Density kernel gradients, tensor properties 4. Optimisation of NGWFs NGWF gradients, preconditioning schemes The need for an orthogonal basis set 5. More detailed look at overall ONETEP scheme Initialisation Flowchart, input keywords 23

Optimisation of NGWFs Gradient of LNV functional with respect to psinc expansin coefficents of NGWFs Tensor-corrected covariant gradient Linear-scaling calculation of gradient with: FFT box technique Sparse Hamiltonian and overlap matrices Sparse density kernel C.-K. Skylaris, A. A. Mostofi, P. D. Haynes, O. Dieguez and M. C. Payne, Phys. Rev. B 66, 035119 (2002) 24

Maintaining localisation: Advantages of orthogonal basis set Localisation by truncation of basis set expansion Steepest descents or conjugate gradients What happens with a non-orthogonal basis: f localisation sphere r i centre of D i (r) Iterative update contains gradients from outside of localisation region 25

Occupancy preconditioning Derivative of E w.r.t. K-S orbitals Relations between Kohn-Sham orbitals and NGWFs Derivative of E w.r.t. NGWFs Remove ill-conditioning of f n ~0 f n in [0,1] make all f n =1 occ_mix = 1.0 Use for search directions 26

Length scale ill-conditioning Convergence rate falls with increasing ratio of max/min eigenvalues of the Hamiltonian High energy eigenstates are dominated by kinetic energy Need to reduce the contribution of kinetic energy in the NGWF gradient Kinetic energy preconditioning Pre-multiply NGWF gradient in reciprocal space with a function that behaves as the inverse of the kinetic energy at high wave vectors and approaches 1 at low wavevectors: Example: k_zero A. A. Mostofi, P. D. Haynes, C.-K. Skylaris and M. C. Payne, J. Chem. Phys. 119, 8842 (2003) 27

Fast convergence True linear-scaling H-bond (7 atoms) Crystalline silicon (1000 atoms) ZSM5 zeolite (576 atoms) Protein (988 atoms) (20, 0) Nanotube (1280 atoms) C.-K. Skylaris, P. D. Haynes, A. A. Mostofi and M. C. Payne, Phys. Stat. Sol. (b) 243(5), 973 (2006) 28

Calculation of S -1 Inverse of Is a contravariant tensor, like the density kernel Can be iteratively generated with the Hotelling formula maxit_hotelling Similar to purification transformation Converges rapidly Can generate S -1 with linear-scaling cost from the beginning Can be used to update S -1 when NGWFs are updated with minimal computational effort Takes advantage of kernel truncation 29

1. Kohn-Sham calculations Direct energy minimisation versus density mixing 2. ONETEP scheme: optimise both the density kernel and NGWFs Conditions 3. Density matrix optimisation algorithms in ONETEP Penalty, purification, LVN Density kernel gradients, tensor properties 4. Optimisation of NGWFs NGWF gradients, preconditioning schemes The need for an orthogonal basis set 5. More detailed look at overall ONETEP scheme Initialisation Flowchart, input keywords 30

Initialisation of density kernel and NGWFs Guess {f} as Gaussians (AUTO) or local PAOs (.fbl file input) Guess charge density as sum of atomic densities Define psinc basis cutoff_energy Build Hamiltonian in {f} representation Generate K by canonical purification (maxit_palser_mano) Improve K by minimisation of energy with penalty functional (maxit_pen, pen_param) Proceed to K and {f} optimisation 31

NGWF and density kernel optimisation Start with initialised K and {f} Do LNV optimisation step for K lnv_threshold_orig, minit_lnv, maxit_lnv Converged? No Yes Do optimisation step for {f} ngwf_theshold_orig, maxit_ngwf_cg,k_zero Converged? No Yes Properties, geometry optimisation, etc. 32

Key points Direct energy minimisation, no density mixing All quantities (Hamiltonian, energy, gradients) built with linear-scaling cost NGWF localisation in real space, FFT-box technique in reciprocal space Sparse Hamiltonian and overlap matrixes Sparse density kernel (kernel_cutoff) Linear-scaling iterative algorithms using sparse-matrix algebra Matrix products preserve sparsity patterns, e.g. KSK is less sparse than K Tensorially correct gradients Preconditioned NGWF optimisation 33

The ONETEP program Wiki http://www2.tcm.phy.cam.ac.uk/onetep/ J. Chem. Phys. 122, 084119 (2005) 34