bigdft les ondelettes, une base flexible permettant un ... 2014/deutsch.pdfbigdft introduction...
TRANSCRIPT
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Journees Horizon-Maths
Les mathematiques se devoilent aux industriels
IFPEN, RUEIL-MALMAISON
Les ondelettes, une base flexible permettantun controle fin de la precision et la mise aupoint des methode ordre N pour le calcul de
la structure electronique via BigDFT
Thierry Deutsch
CEA Grenoble, INAC
December 15, 2014Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
A basis for nanosciences: the BigDFT project
STREP European project: BigDFT(2005-2008)Four partners, 15 contributors:CEA-INAC Grenoble, U. Basel, U. Louvain-la-Neuve, U. Kiel
Aim: To develop an ab-initio DFT code basedon Daubechies Wavelets, to be integrated inABINIT, distributed freely (GNU-GPL license)
“Daubechies wavelets as a basis set for density functionalpseudopotential calculations”,L. Genovese, A. Neelov, S. Goedecker, T. Deutsch, et al., J. Chem. Phys. 129, 014109 (2008)
“Daubechies wavelets for linear scaling density functional theory”,S. Mohr, L. Genovese, , T. Deutsch, S. Goedecker, et al., J. Chem. Phys. 140, 204110 (2014)
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Goal
Waveletsan ideal basis for electronicstructure calculations – flexible,systematic etc.
(Linear-scaling) DFTallows us to access very largesystem sizes via the use of alocalized minimal basis set
we want to combine the two...
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Goal
Massively parallel architectures... and run calculations on large, realistic systems, using massivelyparallel machines
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Configuration space of the cage-like boron clusters
Stabilize the buckyball configuration of B80 systemsPRB 83, 081403(R) (2011)
-2
-1.5
-1
-0.5
0
0.5
-2
-1.5
-1
-0.5
0
0.5
B @B12
B 80
14:6
68
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Configuration space of the cage-like boron clusters
Stabilize the buckyball configuration of B80 systemsPRB 83, 081403(R) (2011)
-2
-1.5
-1
-0.5
0
0.5
-2
-1.5
-1
-0.5
0
0.5
-12.76 eV
-13.55 eV on B @B
12 68
@ B 80
8:12
Sc 3N
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
http://bigdft.org version 1.7.x
• Isolated, surfaces and 3D-periodic boundary conditions(k-points, symmetries)
• All XC functionals of the ABINIT package (libXC library)
• Hybrid functionals, Fock exchange operator
• Direct Minimisation and Mixing routines (metals)
• Local geometry optimizations (with constraints)
• External electric fields (surfaces BC)
• Born-Oppenheimer MD
• Vibrations
• Unoccupied states
• Empirical van der Waals interactions
• Saddle point searches (NEB, Granot & Bear)
• All these functionalities are GPU-compatible
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Kohn-Sham formalism in DFT
H-K theorem: E is an unknown functional of the densityE = E[ρ]→ Density Functional Theory
Kohn-Sham approachMapping of an interacting many-electron system into a system withN independent particles moving into an effective potential.
Find a set of orthonormal orbitals ψi(r) that minimizes:
E =−12
N
∑i=1
∫ψ∗i (r)∇
2ψi (r)dr +
12
∫ρ(r)VH(r)dr
+ Exc[ρ(r)] +∫
Vext (r)ρ(r)dr
ρ(r) =N
∑i=1
ψ∗i (r)ψi (r) ∇
2VH(r) =−4πρ(r)
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Kohn-Sham formalism in DFT
H-K theorem: E is an unknown functional of the densityE = E[ρ]→ Density Functional Theory
Kohn-Sham approachMapping of an interacting many-electron system into a system withN independent particles moving into an effective potential.
Find a set of orthonormal orbitals ψi(r) that minimizes:
E =−12
N
∑i=1
∫ψ∗i (r)∇
2ψi (r)dr +
12
∫ρ(r)VH(r)dr
+ Exc[ρ(r)] +∫
Vext (r)ρ(r)dr
ρ(r) =N
∑i=1
ψ∗i (r)ψi (r) ∇
2VH(r) =−4πρ(r)
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Kohn-Sham formalism in DFT
H-K theorem: E is an unknown functional of the densityE = E[ρ]→ Density Functional Theory
Kohn-Sham approachMapping of an interacting many-electron system into a system withN independent particles moving into an effective potential.
Find a set of orthonormal orbitals ψi(r) that minimizes:
E =−12
N
∑i=1
∫ψ∗i (r)∇
2ψi (r)dr +
12
∫ρ(r)VH(r)dr
+ Exc[ρ(r)] +∫
Vext (r)ρ(r)dr
ρ(r) =N
∑i=1
ψ∗i (r)ψi (r) ∇
2VH(r) =−4πρ(r)
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Kohn-Sham Equations: Computing Energies
Calculate different integrals
E[ρ] = K [ρ] + U[ρ]
K [ρ] =−12~2
me
N
∑i
∫V
drψ∗i ∇
2ψi
U[ρ] =∫
VdrVext (r)ρ(r) +
12
∫V
drdr′ρ(r)ρ(r ′)|r− r′|︸ ︷︷ ︸
Hartree
+ Exc[ρ]︸ ︷︷ ︸exchange−correlation
We minimise the total energy along the orbitals ψi (r) with the
constraint∫
Vdrρ(r) = Nel and 〈ψi |ψj〉= δij
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Kohn-Sham Equations in Density Functional Theory
Apply different operators
Having a one-electron hamiltonian in an effective potentiel Veff [ρ]
[−1
2∇
2 + Veff [ρ] (r)
]ψi (r) = εi ψi (r)
Veff [ρ] (r) = Vext (r) +∫
V
ρ(r ′)|r − r ′|
dr ′+ µxc [ρ] (r)
The electronic density ρ(r) can be expressed by the N occupiedorthonormalized orbitals ψi (r) i.e. 〈ψi |ψj〉= δij .
ρ(r) =N
∑i|ψi (r)|2
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Kohn-Sham Equations: Self-Consistent Field
Set of self-consistent equations:{−1
2~2
me∇
2 + Veff
}ψi = εi ψi
with an effective potential:
Veff [ρ] (r) = Vext (r)+∫
Vdr ′
ρ(r ′)|r − r ′|︸ ︷︷ ︸
Hartree
+ µxc [ρ]︸ ︷︷ ︸exchange−correlation
and: ρ(r) = ∑Ni |ψi (r)|2
Poisson Equation: ∆VHartree = ρ (Laplacian: ∆ = ∂2
∂x2 + ∂2
∂y2 + ∂2
∂z2 )
Real Mesh (1003 = 106): 106×106 = 1012 evaluations !
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Kohn-Sham Equations: Self-Consistent Field
Set of self-consistent equations:{−1
2~2
me∇
2 + Veff
}ψi = εi ψi
with an effective potential:
Veff [ρ] (r) = Vext (r)+∫
Vdr ′
ρ(r ′)|r − r ′|︸ ︷︷ ︸
Hartree
+ µxc [ρ]︸ ︷︷ ︸exchange−correlation
and: ρ(r) = ∑Ni |ψi (r)|2
Poisson Equation: ∆VHartree = ρ (Laplacian: ∆ = ∂2
∂x2 + ∂2
∂y2 + ∂2
∂z2 )
Real Mesh (1003 = 106): 106×106 = 1012 evaluations !
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Kohn-Sham Equations: Self-Consistent Field
Set of self-consistent equations:{−1
2~2
me∇
2 + Veff
}ψi = εi ψi
with an effective potential:
Veff [ρ] (r) = Vext (r)+∫
Vdr ′
ρ(r ′)|r − r ′|︸ ︷︷ ︸
Hartree
+ µxc [ρ]︸ ︷︷ ︸exchange−correlation
and: ρ(r) = ∑Ni |ψi (r)|2
Poisson Equation: ∆VHartree = ρ (Laplacian: ∆ = ∂2
∂x2 + ∂2
∂y2 + ∂2
∂z2 )
Real Mesh (1003 = 106): 106×106 = 1012 evaluations !
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Kohn-Sham Equations: Self-Consistent Field
Set of self-consistent equations:{−1
2~2
me∇
2 + Veff
}ψi = εi ψi
with an effective potential:
Veff [ρ] (r) = Vext (r)+∫
Vdr ′
ρ(r ′)|r − r ′|︸ ︷︷ ︸
Hartree
+ µxc [ρ]︸ ︷︷ ︸exchange−correlation
and: ρ(r) = ∑Ni |ψi (r)|2
Poisson Equation: ∆VHartree = ρ (Laplacian: ∆ = ∂2
∂x2 + ∂2
∂y2 + ∂2
∂z2 )
Real Mesh (1003 = 106): 106×106 = 1012 evaluations !
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Kohn-Sham Equations: Self-Consistent Field
Set of self-consistent equations:{−1
2~2
me∇
2 + Veff
}ψi = εi ψi
with an effective potential:
Veff [ρ] (r) = Vext (r)+∫
Vdr ′
ρ(r ′)|r − r ′|︸ ︷︷ ︸
Hartree
+ µxc [ρ]︸ ︷︷ ︸exchange−correlation
and: ρ(r) = ∑Ni |ψi (r)|2
Poisson Equation: ∆VHartree = ρ (Laplacian: ∆ = ∂2
∂x2 + ∂2
∂y2 + ∂2
∂z2 )
Real Mesh (1003 = 106): 106×106 = 1012 evaluations !
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Kohn-Sham Equations: Self-Consistent Field
Set of self-consistent equations:{−1
2~2
me∇
2 + Veff
}ψi = εi ψi
with an effective potential:
Veff [ρ] (r) = Vext (r)+∫
Vdr ′
ρ(r ′)|r − r ′|︸ ︷︷ ︸
Hartree
+ µxc [ρ]︸ ︷︷ ︸exchange−correlation
and: ρ(r) = ∑Ni |ψi (r)|2
Poisson Equation: ∆VHartree = ρ (Laplacian: ∆ = ∂2
∂x2 + ∂2
∂y2 + ∂2
∂z2 )
Real Mesh (1003 = 106): 106×106 = 1012 evaluations !
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Basis sets for electronic structure calculation
How can we express the Kohn-Sham wavefunctions?
Plane Waves4 Localization in Fourier space, efficient preconditioning
4 Systematic convergence properties
8 No localization in real space. Empty regions must be “filled”with PW. Non adaptive
Gaussians, Slater type Orbitals4 Real space localized, well suited for molecules and other open
structures
4 Small number of basis functions for moderate accuracy
8 Many different recipes for generating basis sets
8 Over-completeness before convergence.Non systematic basis set.
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Outline
1 IntroductionKohn-Sham formalism
2 The machinery of BigDFT (cubic scaling version)Mathematics of the waveletsMagic FilterSolver for the Poisson equation
3 O(N ) (linear scaling) BigDFT approachStrategyPerformance and AccuracyFragment approach
4 Perspectives
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Why do we use wavelets in BigDFT?
AdaptivityOne grid, two resolution levels in BigDFT:
• 1 scaling function (“coarse region”)
• 1 scaling function and 7 wavelets(“fine region”)
Ideal for big inhomogeneous systemsEfficient Poisson solver, capable ofhandling different boundary conditions –free, wire, surface, periodicExplicit treatment of charged systemsEstablished code with many capabilites
-1.5
-1
-0.5
0
0.5
1
1.5
-6 -4 -2 0 2 4 6 8
x
φ(x)
ψ(x)
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
A brief description of wavelet theory
Two kind of basis functions
A Multi-Resolution real space basisThe functions can be classified following the resolution level theyspan.
Scaling FunctionsThe functions of low resolution level are a linear combination ofhigh-resolution functions
= +
φ(x) =m
∑j=−m
hjφ(2x− j)
Centered on a resolution-dependent grid: φj = φ0(x− j).
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
A brief description of wavelet theory
WaveletsThey contain the DoF needed to complete the information which islacking due to the coarseness of the resolution.
= 12 + 1
2
φ(2x) =m
∑j=−m
hjφ(x− j) +m
∑j=−m
gjψ(x− j)
Increase the resolution without modifying grid spaceSF + W = same DoF of SF of higher resolution
ψ(x) =m
∑j=−m
gjφ(2x− j)
All functions have compact support, centered on grid points.
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Adaptivity of the mesh
Atomic positions (H2O)
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Adaptivity of the mesh
Fine grid (high resolution)
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Adaptivity of the mesh
Coarse grid (low resolution)
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Separability in 3D
The 3-dim scaling basis is a tensor product decomposition of 1-dimScaling Functions/ Wavelets.
φex ,ey ,ezjx ,jy ,jz (x ,y ,z) = φ
exjx (x)φ
eyjy (y)φ
ezjz (z)
With (jx , jy , jz) the node coordinates,
φ(0)j and φ
(1)j the SF and the W respectively.
Gaussians and waveletsThe separability of the basis allows us to save computational timewhen performing scalar products with separable functions (e.g.gaussians):
Initial wavefunctions (input guess)
Poisson solver
Non-local pseudopotentials
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Basis set features
Tensor product decomposition of the basisThe 3D basis is separable in 1D SF/ W.
φex ,ey ,ezjx ,jy ,jz (x ,y ,z) = φ
exjx (x)φ
eyjy (y)φ
ezjz (z)
(jx , jy , jz) are the grid points, φ(0)j and φ
(1)j the SF and the W.
Orthogonality, scaling relationDaubechies wavelets are orthogonal and multi-resolution∫
dxφk (x)φ`(x) = δk` φ(x) =1√2
m
∑j=−m
hjφ(2x− j)
Hamiltonian-related quantities can be calculated analytically
The accuracy is only limited by the basis set (O(h14grid)))
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
No integration error
Orthogonality, scaling relation∫dx φk (x)φj (x) = δkj φ(x) =
1√2
m
∑j=−m
hjφ(2x− j)
The hamiltonian-related quantities can be calculated up to machineprecision in the given basis.
The accuracy is only limited by the basis set (O(
h14grid
))
Exact evaluation of kinetic energyObtained by short convolution with filters:
f (x) = ∑`
c`φ`(x) , ∇2f (x) = ∑
`
c` φ`(x) ,
c` = ∑j
cj a`−j , a` ≡∫
φ0(x)∂2x φ`(x) ,
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Systematic basis set
Two parameters for tuning the basisThe grid spacing hgrid
The extension of the low resolution points crmult
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Wavelet families used in BigDFT code
Daubechies f (x) = ∑` c`φ`(x)
Orthogonal c` =∫
dx φ`(x)f (x)
-1.5
-1
-0.5
0
0.5
1
1.5
-6 -4 -2 0 2 4 6
LEAST ASYMMETRIC DAUBECHIES-16
waveletscaling function
Used for wavefunctions,scalar products
Interpolating f (x) = ∑j fj ϕj (x)
Dual to dirac deltas fj = f (j)
-1
-0.5
0
0.5
1
-4 -2 0 2 4
scaling functionwavelet
INTERPOLATING (DESLAURIERS-DUBUC)-8
Used for charge density, functionproducts
Magic Filter method (A. Neelov, S. Goedecker)The passage between the two basis sets can be performed withoutlosing accuracy
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Magic Filter for the density and the potential
Wavefunctions are expressed using Daubechies basis set.
Wavefunctions
Ψ(x) = ∑i
Ψiφi (x)
Examples of operations that must be performed:
Express the point values of the density
ρ(x) = ∑i|Ψi (x))|2
Calculate the potential energy matrix elements
Uij =∫
dxφ(x− i)V (x)φ(x− j)
with a fast and precise method.
These issues can be addressed with the Magic Filter method.
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Problem: Calculating the potential energy
Daubechies are not smooth enough for conventional integrationschemes.
The calculation of the potential energy matrix elements Uij :
Uij =∫
dxφ(x− i)V (x)φ(x− j)
can in principle be done by the following methods
Triple product method (Beylkin)
The collocation method
The “magic filter” method (A. Neelov, S. Goedecker)
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
The triple product method
We assume that the grid spacing h=1. If
V (x) = ∑i
ViφIP(x− i)
where for interpolating scaling functions
Vi = V (i)
andΨ(x) = ∑
iΨiφ(x− i)
with Daubechies scaling functions φ then
Epot =∫
Ψ(x)V (x)Ψ(x)dx = ∑i,j,k
ΨiVj Ψk Ii−j,k−j
where Ii,k is a short array
Ii,k =∫
φ(x− i)φIP(x)φ(x− k)dx
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
The triple product ∝ L4
ProblemThe amount of computation per grid point scales like L4 in 3DL is the dimension of the matrix Iij .In particular, for 2m = 8, L = 20 and L4 = 1.6∗105
On the other hand, the triple product method is very precise: Theonly source of error is the approximation of the potential.
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
The collocation method
U =∫
Ψ(x)V (x)Ψ(x)dx ≈∑i
Ψ(i)Vi Ψ(i)
where
Ψ(i) = ∑j
Ψjφ(i− j)
Computation per grid point
in 3D: ∝ 6m.For 2m = 8,this gives only 24.The scaling functions arenot very smooth, so thecollocation method is notsufficiently precise.
1e-14
1e-12
1e-10
1e-08
1e-06
1e-04
0.01
1
1 10 100
EN
ER
GY
ER
RO
R
1/h
|Evar −E0 ||Ec −E0 ||Ec −Evar |
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
The “magic filter” method
A. Neelov, S. Goedecker, J. Comp. Phys. (2006)
We do not calculate the values of the Ψ on grid points, but wecalculate values that represent best Ψ in a neighborhood aroundthe grid point
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
1.2
-6 -4 -2 0 2 4 6 8
φ(y)ωl
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
The “magic filter” method
We calculate the magic real space values Ψi by
Ψi = ∑j
Ψjωi−j , Epot = ∑i
ΨiVi Ψi
Ψi is the value at i of the polynomial P(x) of degree 2m−1∫dxP(x)φ(x− j) = Ψj
The magic filter ’restores’ the original smooth wavefunction Ψ thatgives rise to a certain expansion in a Daubechies basis set. If Ψ(x)is a polynomial of degree m−1 or lower, then Ψ(i) = Ψi .
Optimal accuracyIf the error in the wavefunction is O(hm), the error in the energy isO(h2m−2).
Used also for calculating the point-values of the density (themultipole moments are reproduced with error O(h2m))
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Kohn-Sham Equations: Self-Consistent Field
Set of self-consistent equations:{−1
2~2
me∇
2 + Veff
}ψi = εi ψi
with an effective potential:
Veff [ρ] (r) = Vext (r)+∫
Vdr ′
ρ(r ′)|r − r ′|︸ ︷︷ ︸
Hartree
+ µxc [ρ]︸ ︷︷ ︸exchange−correlation
and: ρ(r) = ∑Ni |ψi (r)|2
Poisson Equation: ∆VHartree = ρ (Laplacian: ∆ = ∂2
∂x2 + ∂2
∂y2 + ∂2
∂z2 )
Real Mesh (1003 = 106): 106×106 = 1012 evaluations !
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Methods for the solution of Poisson’s equation
Poisson’s equation establishes the relation between a chargedensity ρ and its resulting potential V
∇2V (r) =−4πρ(r)
For non-periodic systems such as atoms and molecules, free
boundary conditions where the potential vanishes at infinity are theappropriate ones. Formally the solution can then be written as
V (r) =∫
ρ(r′)|r− r′|
dr′
The numerical solution of Poisons equation is frequently based on
the differential form rather than the integral form.
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Plane wave techniques
ρ(r′) on an equally spaced real space grid.N 3-dim grid points, the cost of FFT: N log2(N).Fourier space representation of ρ
ρ(r) = ∑G
cG exp(iG · r)
the Fourier space representation of the potential is
V (r) = ∑G
4πcG
G2 exp(iG · r)
Under periodic boundary conditions it is necessary that the systemhas no net charge, i.e. that c0 = 0.
The real space values of the potential on the grid are obtained byusing a backward Fourier transformation.
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Plane wave techniques
ρ(r′) on an equally spaced real space grid.N 3-dim grid points, the cost of FFT: N log2(N).Fourier space representation of ρ
ρ(r) = ∑G
cG exp(iG · r)
the Fourier space representation of the potential is
V (r) = ∑G
4πcG
G2 exp(iG · r)
Under periodic boundary conditions it is necessary that the systemhas no net charge, i.e. that c0 = 0.
The real space values of the potential on the grid are obtained byusing a backward Fourier transformation.
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Poisson Solver based on plane waves
Isolated systems, surfaces, wires
Use FFT (zero padding technics)
Uniform mesh
Correct multipole interactions better as possible
R. Hockney (1970)
G. Makov, M. Payne (1995)
G. Martyna, M. Tuckerman (1999)
L. Fusti-Molnar, P. Pulay (2002)
Use large box: only the center has the correct behavior.
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Poisson using Green function
What is still missing is a method that can solve Poisson’s equationwith free boundary conditions for arbitrary charge densities.
V (r) =∫
ρ(r′)|r− r′|
dr′
Problem: Evaluation of the Green function in each point
Real Mesh (1003): 106 integral evaluations
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Poisson Solver using interpolating scaling function
The Hartree potential is calculated in the interpolating scalingfunction basis.
Poisson solver with interpolating scaling functions
From the density ρ(~j) on an uniform grid it calculates:
VH(~j) =∫
d~xρ(~x)
|~x−~j|
4 Very fast and accurate, optimal parallelization
4 Can be used independently from the DFT code
4 Integrated quantities (energies) are easy to extract
8 Non-adaptive, needs data uncompression
Explicitly free boundary conditionsNo need to subtract supercell interactions→ charged systems.
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Tensor decomposition of 1/r
Feasible if the 1/r kernel is made separable.Represent it as a sum of Gaussians. The representation is bestbased on the identity
1r
=2√π
∫∞
−∞
e−r2 exp(2s)+sds
Discretizing this integral we obtain
1r
= ∑k
ωk e−pk r2
With 89 well optimized values for ωk and pk it turns out that 1/rcan be represented in the interval from 10−9 to 1 with an relativeerror of 10−8.
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Tensor decomposition of 1/r
-11
-10.5
-10
-9.5
-9
-8.5
-8
-7.5
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Erreur sur la decomposition de 1/r
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Used of separability
The 3-dimensional integral becomes then a sum of 89 products of1-dimensional integrals.∫
dx∫
dy∫
dzφ(x− i1) φ(y− i2) φ(z− i3)√
(x− j1)2 + (y− j2)2 + (z− j3)2=
89
∑k
ωk
∫dx
∫dy
∫dz
φ(x− i1) φ(y− i2) φ(z− i3) e−pk ((x−j1)2+(y−j2)2+(z−j3)2) =
89
∑k
ωk
(∫dx φ(x− i1)e−pk (x−j1)2
)×(∫
dy φ(y− i2)e−pk (y−j2)2)(∫
dz φ(z− i3)e−pk (z−j3)2)
G. Beylkin et L. Monzon, On approximation of functions by exponential
sums, Applied and Computational Harmonic Analysis 19, p. 17 (2002)
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Poisson Solver for surface boundary conditions
This technology can be generalized for different BC.
A Poisson solver for surface problemsBased on a mixed reciprocal-direct space representation
Vpx ,py (z) =−4π
∫dz ′G(|~p|;z− z ′)ρpx ,py (z) ,
4 Can be applied both in real or reciprocal space codes
4 No supercell or screening functions
4 More precise than other existing approaches
8 Non-adaptive, needs data uncompression
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Poisson Solver for surface boundary conditions
A Poisson solver for surface problemsBased on a mixed reciprocal-direct space representation
Vpx ,py (z) =−4π
∫dz ′G(|~p|;z− z ′)ρpx ,py (z) ,
4 Can be applied both in real or reciprocal space codes
4 No supercell or screening functions
4 More precise than other existing approaches
Example of the plane capacitor:
Periodic
x
y
V
x
Hockney
x
y
V
x
Our approach
x
y
V
x
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Flexibility example: yet another Poisson Solver
(Screened) Poisson Equation for any BCWire-like periodicity, non-orthorhombic cells (surface BC):
(∇2−µ20)V (x ,y ,z) =−4πρ(x ,y ,z)
Very good accuracy J. Chem. Phys. 137, 13 (2012)
Toy examples for µ20 = {0,1,10,100} bohr−2
Future developmentsRange-separated Coulomb operator
1r
[erf r
r0+ erfc r
r0
]Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Performances of the Poisson Solvers
Elapsed Time on a Cray XT3, 1283 grid
#proc 1 2 4 8 16 32 64Free sec .92 .55 .27 .16 .11 .08 .09
Surface sec .43 .26 .16 .10 .07 .05 .04
More precise than other existing Poisson Solvers:
Free BC
1e-11
1e-10
1e-09
1e-08
1e-07
1e-06
1e-05
1e-04
0.001
0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6
Max
Err
or
Grid step
HockneyTuckerman
8th14th20th30th40th50th60th
100th
L.G. et al., J. Chem. Phys.125, 74105 (06)
Surfaces BC
1e-16
1e-14
1e-12
1e-10
1e-08
1e-06
1e-04
0.01
0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5
Abs
olut
e re
lativ
e er
ror
grid spacing
Mortensen8th
16th24th40th
h8 curve
L.G. et al., J. Chem. Phys.127, 54704 (07)
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
A versatile formalism
Flexible Boundary ConditionsIsolated (free) BC
Surfaces BC
Periodic (3D) BC
Wires BC (soon. . . )
Systematic approachOnly relevant degrees of freedom are taken into accountBoundary conditions can be implemented explicitly
-15
-10
-5
0
-6 -4 -2 0 2 4 6
avg.
V(z
) (e
V)
layer distance (Bohr)
E.g.: Surfaces BC2D Periodic + 1D isolatedOptimal to treat dipolar systemswithout corrections
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Order N method
Minimal basis set
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Outline
1 IntroductionKohn-Sham formalism
2 The machinery of BigDFT (cubic scaling version)Mathematics of the waveletsMagic FilterSolver for the Poisson equation
3 O(N ) (linear scaling) BigDFT approachStrategyPerformance and AccuracyFragment approach
4 Perspectives
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Direct Minimisation: Flowchart
{ψi = ∑
ac i
aφa
}Adaptive mesh (0, . . . ,Nφ) (N2)
Orthonormalized
ρ(r) =occ
∑i|ψi (r)|2 Fine non-adaptive mesh: < 8Nφ
inv FWT + Magic Filter (N2)
VH (r) =∫
G(.)ρ Veffective (N2)Vxc [ρ(r)] VNL({ψi})
Poisson solver
− 12 ∇2 Kinetic Term (N2)
δc ia =− ∂Etotal
∂c∗i (a)+∑
jΛij c
ja
Λij = 〈ψi |H|ψj〉 (N3)
FWT
FWT
cnew ,ia = c i
a + hstepδc ia
Steepest Descent,DIIS (N2)
preconditioningStop when δc ia small
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Direct Minimisation: Flowchart
{ψi = ∑
ac i
aφa
}Adaptive mesh (0, . . . ,Nφ) (N2)
Orthonormalized
ρ(r) =occ
∑i|ψi (r)|2 Fine non-adaptive mesh: < 8Nφ
inv FWT + Magic Filter (N2)
VH (r) =∫
G(.)ρ Veffective (N2)Vxc [ρ(r)] VNL({ψi})
Poisson solver
− 12 ∇2 Kinetic Term (N2)
δc ia =− ∂Etotal
∂c∗i (a)+∑
jΛij c
ja
Λij = 〈ψi |H|ψj〉 (N3)
FWT
FWT
cnew ,ia = c i
a + hstepδc ia
Steepest Descent,DIIS (N2)
preconditioningStop when δc ia small
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Direct Minimisation: Flowchart
{ψi = ∑
ac i
aφa
}Adaptive mesh (0, . . . ,Nφ) (N2)
Orthonormalized
ρ(r) =occ
∑i|ψi (r)|2 Fine non-adaptive mesh: < 8Nφ
inv FWT + Magic Filter (N2)
VH (r) =∫
G(.)ρ Veffective (N2)Vxc [ρ(r)] VNL({ψi})
Poisson solver
− 12 ∇2 Kinetic Term (N2)
δc ia =− ∂Etotal
∂c∗i (a)+∑
jΛij c
ja
Λij = 〈ψi |H|ψj〉 (N3)
FWT
FWT
cnew ,ia = c i
a + hstepδc ia
Steepest Descent,DIIS (N2)
preconditioningStop when δc ia small
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Direct Minimisation: Flowchart
{ψi = ∑
ac i
aφa
}Adaptive mesh (0, . . . ,Nφ) (N2)
Orthonormalized
ρ(r) =occ
∑i|ψi (r)|2 Fine non-adaptive mesh: < 8Nφ
inv FWT + Magic Filter (N2)
VH (r) =∫
G(.)ρ Veffective (N2)Vxc [ρ(r)] VNL({ψi})
Poisson solver
− 12 ∇2 Kinetic Term (N2)
δc ia =− ∂Etotal
∂c∗i (a)+∑
jΛij c
ja
Λij = 〈ψi |H|ψj〉 (N3)
FWT
FWT
cnew ,ia = c i
a + hstepδc ia
Steepest Descent,DIIS (N2)
preconditioningStop when δc ia small
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Direct Minimisation: Flowchart
{ψi = ∑
ac i
aφa
}Adaptive mesh (0, . . . ,Nφ) (N2)
Orthonormalized
ρ(r) =occ
∑i|ψi (r)|2 Fine non-adaptive mesh: < 8Nφ
inv FWT + Magic Filter (N2)
VH (r) =∫
G(.)ρ Veffective (N2)Vxc [ρ(r)] VNL({ψi})
Poisson solver
− 12 ∇2 Kinetic Term (N2)
δc ia =− ∂Etotal
∂c∗i (a)+∑
jΛij c
ja
Λij = 〈ψi |H|ψj〉 (N3)
FWT
FWT
cnew ,ia = c i
a + hstepδc ia
Steepest Descent,DIIS (N2)
preconditioningStop when δc ia small
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Direct Minimisation: Flowchart
{ψi = ∑
ac i
aφa
}Adaptive mesh (0, . . . ,Nφ) (N2)
Orthonormalized
ρ(r) =occ
∑i|ψi (r)|2 Fine non-adaptive mesh: < 8Nφ
inv FWT + Magic Filter (N2)
VH (r) =∫
G(.)ρ Veffective (N2)Vxc [ρ(r)] VNL({ψi})
Poisson solver
− 12 ∇2 Kinetic Term (N2)
δc ia =− ∂Etotal
∂c∗i (a)+∑
jΛij c
ja
Λij = 〈ψi |H|ψj〉 (N3)
FWT
FWT
cnew ,ia = c i
a + hstepδc ia
Steepest Descent,DIIS (N2)
preconditioning
Stop when δc ia small
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Direct Minimisation: Flowchart
{ψi = ∑
ac i
aφa
}Adaptive mesh (0, . . . ,Nφ) (N2)
Orthonormalized
ρ(r) =occ
∑i|ψi (r)|2 Fine non-adaptive mesh: < 8Nφ
inv FWT + Magic Filter (N2)
VH (r) =∫
G(.)ρ Veffective (N2)Vxc [ρ(r)] VNL({ψi})
Poisson solver
− 12 ∇2 Kinetic Term (N2)
δc ia =− ∂Etotal
∂c∗i (a)+∑
jΛij c
ja
Λij = 〈ψi |H|ψj〉 (N3)
FWT
FWT
cnew ,ia = c i
a + hstepδc ia
Steepest Descent,DIIS (N2)
preconditioningStop when δc ia small
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Cubic-scaling operations
Application of the Hamiltonian: H ψi(r)
ψi(r) overall system (N) for N orbitals: N2
Overlap matrix: Λij =∫
ψi(r)ψ∗j (r)dr
N2 terms over the whole system (N): N3
Orthogonalization:
ψi(r) = ψi(r)−∑j<i
Λijψj(r)
ScalingN(N−1)
2∗N
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Cubic-scaling operations
Application of the Hamiltonian: H ψi(r)
ψi(r) overall system (N) for N orbitals: N2
Overlap matrix: Λij =∫
ψi(r)ψ∗j (r)dr
N2 terms over the whole system (N): N3
Orthogonalization:
ψi(r) = ψi(r)−∑j<i
Λijψj(r)
ScalingN(N−1)
2∗N
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Cubic-scaling operations
Application of the Hamiltonian: H ψi(r)
ψi(r) overall system (N) for N orbitals: N2
Overlap matrix: Λij =∫
ψi(r)ψ∗j (r)dr
N2 terms over the whole system (N): N3
Orthogonalization:
ψi(r) = ψi(r)−∑j<i
Λijψj(r)
ScalingN(N−1)
2∗N
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Cubic-scaling behavior
0
20
40
60
80
100
1 5 8 17 32 65 128 257 512 1025 0.1
1
10
100
1000
Per
cent
Sec
onds
(lo
g. s
cale
)
Number of atoms
LinAlgsumrhoPSolverHamAppPrecondOtherComm (%)Time (sec)
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Defining localized functions: Localization region
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Revisit cubic-scaling operations
Application of the Hamiltonian: H ψi(r)ψi (r) in a region of localization (κ) for N orbitals: κN
Overlap matrix: Λij =∫
ψi(r)ψ∗j (r)drOverlap matrix between neighbor orbitals (M): κMN
Orthogonalization (Cholesky)
ψi(r) = ψi(r)−∑j<i
Λijψj(r)
Orthogonalization with neighbor orbital(M): κMN
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Revisit cubic-scaling operations
Application of the Hamiltonian: H ψi(r)ψi (r) in a region of localization (κ) for N orbitals: κN
Overlap matrix: Λij =∫
ψi(r)ψ∗j (r)drOverlap matrix between neighbor orbitals (M): κMN
Orthogonalization (Cholesky)
ψi(r) = ψi(r)−∑j<i
Λijψj(r)
Orthogonalization with neighbor orbital(M): κMN
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Revisit cubic-scaling operations
Application of the Hamiltonian: H ψi(r)ψi (r) in a region of localization (κ) for N orbitals: κN
Overlap matrix: Λij =∫
ψi(r)ψ∗j (r)drOverlap matrix between neighbor orbitals (M): κMN
Orthogonalization (Cholesky)
ψi(r) = ψi(r)−∑j<i
Λijψj(r)
Orthogonalization with neighbor orbital(M): κMN
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Localization of the basis functions
The grid for a small molecule. We see the global box (coarse andfine) and the localization region (coarse and fine).
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Creation of the basis functions
Take the standard DFT Hamiltonian and add a confining potentialto it:
H i = H DFT + ci (r−Ri )4
where Ri is the position of the center of the localisation region i .
This confining potential ensures that the basis functions are welllocalized, but close to their center they feel the “correct”Hamiltonian and should therefore be of excellent quality.
DFT potentialconfining potentialeffective potential
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Creation of the basis functions
Since the Hamiltonian is different for each localisation region, wecan not search for eigenfunctions to determine the basis functionsφj .
Instead we have to minimize the “trace” of the Hamiltonian, i.e. ourbasis functions are given by the condition
minφi
∑i〈φi |Hi |φi〉 with 〈φi |φj〉= δij
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
The expansion coefficients
Once we have determined the basis functions φj , we can calculatethe Hamiltonian matrix in this basis, i.e.
HDFTjk = 〈φj |H DFT |φk〉
Diagonalizing this matrix to get the eigenvectors
HDFT ci = εici
provides us with the expansion coefficients for the physical
orbitals, i.e.Ψi = ∑cijφj
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Λij Overlap matrix (before N3)
To calculate the overlap matrix, we need to communicate betweenthe processes handling two overlapping basis functions. Only thatoverlap will be communicated.
In this way each process calculates a small part of the matrix.Using a collective communication call brings the entire matrix to allprocesses.
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Calculation of charge density (before N2)
To calculate the charge density each process will do the job for oneslice. No additional communication is required later, since thePoisson solver uses the same slices distribution.
Therefore each process has to gather all orbitals extending into itsslice. Only the part in the range of that slice will be communicated.
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Minimal basis and density kernel
Write the KS orbitals as linearcombinations of minimal basisset φα(r):
Ψi (r) = ∑α
cαi φα(r)
• localized
• atom-centred
• expanded in wavelets
Define the density matrix ρ(r, r′)and kernel K αβ:
ρ(r, r′) = ∑i
∣∣Ψi (r)〉〈Ψi (r′)∣∣
= ∑α,β
∣∣∣φα(r)〉K αβ〈φβ(r′)∣∣∣
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
The algorithm
Minimal basis set• Initialized to atomic orbitals, optimized
using a quartic confining potential subjectto an orthogonality constraint
• Minimize the ‘trace’, band structureenergy or a combination at fixed potential
• SD or DIIS with k.e. preconditioning
Density kernelThree methods for self-consistent optimization:
• Diagonalization
• Direct minimization
• Fermi operator expansion (linear-scaling)
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Scaling (alcanes)
0
10
20
30
40
50
60
0 1000 2000 3000 4000 5000 6000 7000 8000
Tim
e/itera
tion
(s)
Number of atoms
ax3
+ bx2
+ cx:1.0e+00; 3.0e+03; 1.5e+06
4.6e-02; 2.2e+02; 1.4e+06
7.6e-03; 4.3e-03; 1.4e+06
CubicDminFOE
Improved time and memory scaling• 301 MPI, 8 OpenMP for above results
• ∼ O (N ) for FOE
• need sparse matrix algebra for directminimisation→ O (N )
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Standard case: DNA
Use 3 000 cores (MPI+OpenMP)
20 min for 18 000 atoms (single point calculation)
0
200
400
600
800
1000
1200
1400
1600
1800
5000 10000 15000 20000 25000
time
(sec
onds
)
number of atoms
total runtimelinear extrapolation, reference 5720 atoms
0
1
2
3
4
5
6
7
8
9
10
11
5000 10000 15000 20000 25000m
emor
y pe
ak (
GB
)
number of atoms
memory peak MPI masterlinear extrapolation, reference 5720 atoms
Need sparse linear algebra (10-15%)
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Performance for many systems
cubic linear dif erence
energy force norm energy force norm energy force normhartree hartree/ bohr hartree hartree/ bohr meV/ atom hartree/ bohr
Vitamin B12 −926.78 2.13 · 10− 3 −926.71 1.93 · 10− 2 11.43 1.72 · 10− 2
Chlorophyll −476.70 3.05 · 10− 3 −476.64 1.24 · 10− 2 12.33 9.38 · 10− 3
C60 −341.06 2.69 · 10− 4 −341.02 7.36 · 10− 3 17.23 7.09 · 10− 3
Si87H76 −386.79 7.80 · 10− 4 −386.69 1.01 · 10− 2 17.20 9.27 · 10− 3
(H2O)100 −1722.99 5.23 · 10− 1 −1722.87 5.26 · 10− 1 10.89 2.80 · 10− 3
DNA −4483.12 5.60 · 10− 1 −4482.84 5.63 · 10− 1 10.69 2.40 · 10− 3
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Fragment approach• By dividing a system into fragments,
we can avoid optimizing the supportfunctions entirely for large systems
• Substantially reduces the cost(need an efficient reformatting)
• Many useful applications, including theexplicit treatment of solvents
• A necessary first step towards atight-binding like approach, with eachatom as a fragment
Reformatting the minimal basis set in the same grid
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Applications: Transfer integrals for OLEDs (I)
We want to consider environment effects in realistic ‘host-guest’morphologies: 6192 atoms, 100 molecules
Host molecule
Guest molecule
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Transfer integrals and site energies
0.00
0.20
0.40
0.60
0.80
1.00
0 30 60 90
Ene
rgy
(eV
)
Rotation angle
DZ J12 LUMOTZP J12 LUMOTMB J12 LUMO
0.00
0.20
0.40
0.60
0.80
1.00
0 30 60 90
Ene
rgy
(eV
)
Rotation angle
DZ J12 HOMOTZP J12 HOMOTMB J12 HOMO
−4.00
−3.50
−3.00
−2.50
−2.00
−1.50
0 30 60 90
Ene
rgy
(eV
)
Rotation angle
DZ e1,2 LUMOTZP e1,2 LUMOTMB e1,2 LUMO
−6.00
−5.50
−5.00
−4.50
−4.00
0 30 60 90E
nerg
y (e
V)
Rotation angle
DZ e1,2 HOMOTZP e1,2 HOMOTMB e1,2 HOMO
BigDFT compared to ADF fragment approach• support functions from molecules reused in dimers
• Application to OLED (Organic Light-Emitting Diode)
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Transfer integrals for OLEDs (II)
Transfer integrals (left) and site energies (right) calculated with(bottom) and without (top) constrained DFT
-0.06 -0.04 -0.02 0 0.02 0.04 0.06Energy (eV)
all
host-host
guest-guest
host-guest-5.5 -5.4 -5.3 -5.2 -5.1 -5 -4.9 -4.8 -4.7 -4.6 -4.5
-7.3 -7.2 -7.1 -7 -6.9 -6.8 -6.7 -6.6 -6.5 -6.4 -6.3
Energy (eV)
hostguest
Generate good statistics.Then use of Markus model to calculate the efficiency of OLEDS.
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Outline
1 IntroductionKohn-Sham formalism
2 The machinery of BigDFT (cubic scaling version)Mathematics of the waveletsMagic FilterSolver for the Poisson equation
3 O(N ) (linear scaling) BigDFT approachStrategyPerformance and AccuracyFragment approach
4 Perspectives
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Perspectives of linear scaling
Combination of wavelets and localized basis functions• Highly accurate (energies and forces) and efficient
• Linear scaling – Thousands of atoms
• Ideal for massively parallel calculations
• Flexible e.g. reuse of support functions to accelerategeometry optimizations and for charged systems
Fragment approach• Accurate reformatting scheme – can accelerate calculations
on large systems e.g. explicit treatment of solvents
• Wide range of applications: constrained DFT, transfer integrals
• Crucial for future developments e.g. tight-binding, embeddedsystems (QM/QM)
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
QM/QM embedding in solids
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Conclusions
Wavelets: Powerful formalism• Linear scaling – Thousands of atoms
• Accurate reformatting scheme – can accelerate calculationson large systems e.g. explicit treatment of solvents
• Wide range of applications: constrained DFT, transfer integrals
• Towards multi-scale approach (embedded systems)
• Numerical stable scheme: multipole preserving (large gridstep)
Beyond DFT• Resonant states are the way to describe fully a system
• Give a compact description (few states) of the systems
• Linear-response, TD-DFT, ...
• Many-body perturbation theory (GW, ...)
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch
BigDFT
Introduction
Kohn-Sham
BigDFT
Wavelets
Magic Filter
Poisson
O(N )
Strategy
Performance
Fragment
Perspectives
Acknowledgments
Main maintainer Luigi Genovese
Group of Stefan Goedecker A. Ghazemi, A. Willand, S. De,A. Sadeghi, N. Dugan (Basel University)
Link with ABINIT and bindings Damien Caliste (CEA-Grenoble)
Order N methods Stefan Mohr, Laura Ratcliff, Paul Boulanger
Exploring the PES N. Mousseau (Montreal University)
Resonant states A. Cerioni, A. Mirone (ESRF, Grenoble),I. Duchemin (CEA), M. Moriniere (CEA)
Optimized convolutions Brice Videau, Jean-Francois Mehaut (LIG,computer scientist, Grenoble)
Applications P. Pochet, D. Timerkaevai, E. Zvereva(CEA-Grenoble)
Laboratoire de Simulation Atomistique http://inac.cea.fr/L Sim Thierry Deutsch