BigDFT Basics Max Webinar Thierry Deutsch

BigDFT code

Wavelets BigDFT Precision O(N) BigDFT

Motivations for BigDFT formalism; overview of Daubechies in DFT

Thierry Deutsch

Laboratoire de Simulation Atomistique - L_Sim

November 12, 2020

Virtual Room Outline BigDFT Basics Thierry Deutsch

BigDFT code

Wavelets Precision O(N) BigDFT

BigDFT code Properties of wavelets Precision of the description O(N) BigDFT Basis sets for DFT calculations BigDFT Basics Thierry Deutsch

BigDFT code

Wavelets Plane Waves Gaussians, Slater Orbitals Precision O(N) BigDFT ABINIT, CPMD, VASP, . . . CP2K,,AIMPRO, . . . Systematic convergence Real space localized  Accuracy increases  Small number of basis with the number of functions for moderate basis elements accuracy  Non-localised,  Well suited for optimal for periodic and other systems open structures  Non adaptive  Non systematic

FFT Analytic functions Robust, easy to Kinetic and overlap matrices are parallelise calculated analytically Origin of the BigDFT project BigDFT Basics Thierry Deutsch

BigDFT code STREP European project: BigDFT(2005-2008) Wavelets Precision (N) BigDFT In the beginning: Four partners, 15 people O Now: around 10 active developers, Grenoble, Basel, Barcelona, London, Uppsala, Kobe Used in production since twelve years.

Aim: To develop an ab-initio DFT code based on Daubechies Wavelets, to be integrated in ABINIT. BigDFT 1.0 −→ January 2008

Why have we done this?

• Test the potential advantages of a new formalism A lot of outcomes and interesting results • Future opportunities and ideas A DFT code based on Daubechies wavelets BigDFT Basics Thierry Deutsch

BigDFT code

Wavelets Wavelets Precision O(N) BigDFT A basis with optimal properties for expanding localised information

• Localised in real space • Smooth (localised in Fourier space) • Orthogonal basis • Daubechies Wavelets Multi-resolution basis 1.5 φ(x) • Adaptive 1 ψ(x) • Systematic 0.5 0

From early 80’s -0.5

-1 Applied in several domains -1.5 -6 -4 -2 0 2 4 6 8 Interesting properties for DFT x A brief description of theory BigDFT Basics Thierry Deutsch

BigDFT code

Wavelets A Multi-Resolution real space basis Precision O(N) BigDFT All functions w/ compact support, centered on grid points. In the wavelet theory we have two kind of basis functions.

Wavelets (W) Scaling Functions (SF) Contain the DoF needed to The functions of low resolution complete the information lacking level are a linear combination due to the coarseness of the of high-resolution functions. resolution. = + 1 1 = 2 + 2

Increase the resolution without modifying grid space SF + W = Degrees of Freedom of SF of higher resolution Wavelet properties: adaptivity BigDFT Basics Thierry Deutsch

BigDFT code

Wavelets Adaptivity Precision O(N) BigDFT Resolution can be refined following the grid point.

The grid is divided in Low (1 DoF) and High (8 DoF) resolution points. Points of different resolution belong to the same grid. Empty regions must not be “filled” with basis functions.

Localization property,real space description Optimal for big & inhomogeneous systems, highly flexible Basis set features BigDFT Basics Thierry Deutsch

BigDFT code Tensor product decomposition of the basis Wavelets Precision O(N) BigDFT The 3D basis is separable in 1D SF/ W. e ,e ,e e φ x y z (x,y,z) = φex (x)φ y (y)φez (z) jx ,jy ,jz jx jy jz

(0) (1) (jx ,jy ,jz ) are the grid points, φj and φj the SF and the W.

Orthogonality, scaling relation Daubechies wavelets are orthogonal and multi-resolution Z 1 m dxφk (x)φ`(x) = δk` φ(x) = √ ∑ hj φ(2x − j) 2 j=−m Hamiltonian-related quantities are calculated analytically

14 The accuracy is only limited by the basis set (O(hgrid))) Operator expressions, BigDFT Basics Thierry Deutsch

BigDFT code

Wavelets Exact evaluation of kinetic energy Precision O(N) BigDFT Expressed analytically by a convolution: 2 f (x) = ∑c`φ`(x), ∇ f (x) = ∑˜c` φ`(x) , ` ` Z 2 ˜c` = ∑cj a`−j , a` ≡ φ0(x)∂x φ`(x) , j

From N3 to 3N calculations for separable objects We save computational time when performing scalar products with separable functions (e.g. gaussians). Z 2 Z 2 − 1 ( r ) − 1 ( x ) drψ(r)e 2 ra = ∑cijk di dj dk , di = φi (x)e 2 ra ijk

di coefficients can be calculated at machine precision. GTH-HGH: analytic and separable pseudopotentials Systematic basis set BigDFT Basics Thierry Deutsch

BigDFT code

The absolute accuracy of the calculation is directly proportional Wavelets Precision to the number of the basis functions O(N) BigDFT Two parameters for tuning the basis

• The grid spacing hgrid • The extension of the Low resolution points crmult Optimal for inhomogeneous systems BigDFT Basics Thierry Deutsch

Test case: cinchonidine (44 atoms) BigDFT code Wavelets 1 10 Precision Plane waves O(N) BigDFT

100 Wavelets Ec = 40 Ha

10-1

Ec = 90 Ha 10-2 h = 0.4bohr Ec = 125 Ha 10-3 Absolute energy precision (Ha) h = 0.3bohr 10-4

105 106 Number of degrees of freedom

Enables a systematic approach for molecules Considerably faster than Plane Waves codes. the above run :10 (5) times faster than ABINIT (CPMD) Charged systems can be treated explicitly with the same time All- precision with HGH PSP BigDFT Basics Thierry Deutsch

Non-linear core correction J. Chem. Phys. 138, 104109 (2013) BigDFT code Wavelets Precision • Simple analytic form (a single gaussian as ρc) O(N) BigDFT • Same hardness as HGH a systematic localized basis is fundamental

Precision considerably improved G2-1 test set (Atomization energies)

kcal/mol MAD RMSD MSD maxAD minAD Old HGH 6.85 9.13 -6.76 23.94 0.10 NLCC-HGH 0.51 0.63 0.16 1.50 0.03 PAW Paier 0.46 0.56 -0.43 1.13 0.01 ∆ AE (geopt) 0.29 0.70 -0.29 4.21 0.00

AE precision for quantities in different environments Bond lengths, Pressure (Bulk systems), Dispersion-corrected interaction energies, . . . Local orbitals and linear scaling BigDFT Basics Thierry Deutsch

BigDFT code KS orbitals Density Matrix Wavelets Precision (N) BigDFT Linear combinations of support Defined via the kernel K αβ in O functions φα(r): the φα(r) basis: Ψ (r) = cαφ (r) i ∑ i α 0 0 α ρ(r,r ) = ∑fi Ψi (r)Ψi (r ) • localized around atoms i αβ 0 • expanded in wavelets = ∑φα(r)K φβ(r ) α,β • optimized in-situ

Localization → sparse matrices → O (N) Overall scheme BigDFT Basics Thierry Deutsch

BigDFT code

Initial Guess: Wavelets Atomic Orbitals Precision Two-step optimization O(N) BigDFT scheme

Basis optimization: • The φα minimize the “trace” of a confining KS or hamiltionian • Coefficients minimize KS energy Kernel Optimization: Diagonalize Hamiltonian Update potential High quality results

• Good precision • No need of Pulay forces Forces: due to basis completeness! Derivative basis functions A flexible formalism BigDFT Basics Thierry Deutsch

BigDFT code Flexible Boundary Conditions Wavelets Precision O(N) BigDFT • Isolated (free) BC • Surfaces BC • Periodic (3D) BC • Wires BC

Systematic approach Only relevant degrees of freedom are taken into account Boundary conditions can be implemented explicitly

0 E.g.: Surfaces BC

-5 2D Periodic + 1D isolated -10 avg. V(z) (eV) Optimal to treat dipolar systems -15 without corrections -6 -4 -2 0 2 4 6 layer distance (Bohr)