Order(N) methods in QMC Dario Alfè [[email protected]]
description
Transcript of Order(N) methods in QMC Dario Alfè [[email protected]]
Order(N) methods in QMC
Dario Alfè [[email protected]]
2007 Summer School on Computational Materials Science Quantum Monte Carlo: From Minerals and Materials to MoleculesJuly 9 –19, 2007 • University of Illinois at Urbana–Champaignhttp://www.mcc.uiuc.edu/summerschool/2007/qmc/
• Evaluation of multidimensional integrals:• Quadrature methods, error ~ M-4/d
• Monte Carlo methods, error ~ M-0.5
I = d ( ) g∫R R
I = lim
M→ ∞
1M
f (Rm)m=1
M
∑⎧⎨⎩
⎫⎬⎭≈
1M
f (Rm)m=1
M
∑
( ) 0; d ( )=1 ℘ ≥ ℘∫R R R
I = dRf (R)℘(R); f (R)=g(R) ℘(R) ∫
Monte Carlo methods
*
0*
ˆ( ) ( )
( ) ( )
T T
V
T T
H dE E
d
Ψ Ψ= ≥
Ψ Ψ∫∫
R R R
R R R
Variational Monte Carlo
2 1
2
ˆ( ) ( ) ( )
( )
T T T
V
T
H dE
d
−⎡ ⎤Ψ Ψ Ψ⎣ ⎦=Ψ
∫∫
R R R R
R R
℘(R) =ΨT (R)
2ΨT (R)
2dR∫
E
V≈
1M
EL(Rm)m=1
M
∑ ; EL(Rm) =ΨT (Rm)−1 HΨT (Rm)
( )( , ) ˆ ( , )T
tH E t
i t
∂Ψ− = − Ψ
∂
RR
Extracting the ground state: substitute = it
0, ( , ) ( )τ τ→ ∞ Ψ → ΦR R
Fixed nodes:
0, ( , ) ( )FNτ τ→ ∞ Ψ → ΦR R
ΨT (R) =exp[J (R)] cn
n∑ Dn
↑{φi (r j )}Dn↓{φi (r j )}
Diffusion Monte Carlo
• N electrons• N single particle orbitals i • ~ N basis functions for each i if
φi (r j ) = cG exp{−iG⋅r j}
G∑
Cost proportional to N3
ΨT (R) =exp[J (R)] cn
n∑ Dn
↑{φi (r j )}Dn↓{φi (r j )}
Cost of evaluating ΨT
Cost of total energy proportional to N4
Variance of E is proportional to N
HOWEVERVariance of E/atom is proportional to 1/N
Cost of energy/atom proportional to N2
(relevant to free energies in phase transitions, surface energies, ….)
Cost of evaluating Energy E
• N electrons• N single particle orbitals i • ~ N basis functions for each i if
φi (r j ) = cG exp{−iG⋅r j}
G∑
Cost proportional to N3
ΨT (R) =exp[J (R)] cn
n∑ Dn
↑{φi (r j )}Dn↓{φi (r j )}
Cost of evaluating ΨT
• N electrons• N single particle orbitals i
• ~ o(1) basis functions for each i if
Cost proportional to N2
ΨT (R) =exp[J (R)] cn
n∑ Dn
↑{φi (r j )}Dn↓{φi (r j )}
Cost of evaluating ΨT
φi (r j ) = cl fl (r j )
l∑ if fl(r) is
localised
Cost of total energy proportional to N3
Variance of E is proportional to N
HOWEVERVariance of E/atom is proportional to 1/N
Cost of energy/atom proportional to N
(relevant to free energies in phase transitions, surface energies, ….)
Cost of evaluating Energy E
B-splines: Localised functions sitting at the points of a uniform grid
( )
32
3
3 3( ) 1 0 1
2 41
2 1 24
f x x x x
x x
= − + ≤ ≤
= − ≤ ≤
E. Hernàndez, M. J. Gillan and C. M. Goringe, Phys. Rev. B, 20 (1997)
D. Alfè and M. J. Gillan, Phys. Rev. B, Rapid Comm., 70, 161101, (2004)
• N electrons• N single particle orbitals i
• ~ o(1) basis functions for each i if
Cost proportional to N2
ΨT (R) =exp[J (R)] cn
n∑ Dn
↑{φi (r j )}Dn↓{φi (r j )}
Cost of evaluating ΨT
φi (r j ) = cl fl (r j )
l∑
• N electrons• ~ o(1) single particle localised orbitals i,if i is localised• ~ o(1) basis functions for each i if
Cost proportional to N (Linear scaling)
ΨT (R) =exp[J (R)] cn
n∑ Dn
↑{φi (r j )}Dn↓{φi (r j )}
Cost of evaluating ΨT
φi (r j ) = cl fl (r j )
l∑
Cost of total energy proportional to N2
Variance of E is proportional to N
HOWEVERVariance of E/atom is proportional to 1/N
Cost of energy/atom independent on N !(relevant to free energies in phase transitions, surface energies, ….)
Cost of evaluating Energy E
( )
32
3
3 3( ) 1 0 1
2 41
2 1 24
f x x x x
x x
= − + ≤ ≤
= − ≤ ≤
Xi=ia
Θ(x−Xi ) = f ((x−Xi ) / a)Grid spacing a:
B-splines (blips)
Grid spacing 1:
• Defined on a uniform grid• Localised: f(x)=0 for |x|>2• Continuous with first and second derivative continuous
ψ n(r) = ani
i∑ Θ(r −R i )
Blips in three dimensions:
Θ(r −R i ) =Θ(x−Xi )Θ(y−Yi )Θ(z−Zi )
For each position r there are only 64 blip functions that are non zero, for any size and any grid spacing a. By contrast, in a plane wave representation the number of plane waves is proportional to the size of the system, and also depends on the plane wave cutoff:
Single-particle orbital representation:
ψ n(r) = cnG
G∑ eiG⋅r
For example, the number of plane waves in MgO is ~ 3000 per atom!(HF pseudopotentials, 100 Ha PW cutoff)
One dimension:L
/a L N
↑=
( ) ( )j x x jaΘ ≡Θ −^
χn(x) = Θ j (x)e
2π ijn/N
j=0
N−1
∑ − 12 N + 1 ≤ n ≤
12 N
max
2 /2 / ; /( ) n
n
ik xinx Lk n L k an x e eπ
π πφ = == =
Approximate equivalence between blips and plane waves
fµ(q) = f(x)e−iqxdx
−∞
+∞
∫ = f(x)e−iqxdx−2
+2
∫ =3q4 3−4cos(q) + cos(2q)[ ]
φn χ m = dx θ j (x)e2π ijm /Ne−ikn x =j=0
N −1
∑0
L
∫ kn =2π n
aN
= e2π i(m−n) j /N
j=0
N −1
∑ θ j (x)0
L
∫ e2π in( j−x /a)/Ndx = (use PBC) x − ja → x,Θ j → Θ0
= e2π i(m−n) j /N
j=0
N −1
∑Nδnm
1 244 34 4
θ0 (x)0
L
∫ e−2π inx /aNdx = Nδ nm f (x / a)0
L
∫ e−2π inx /aNdx =
=Nδ nma f (y)
0
L /a
∫ e−2π iny/Ndy = Lδ nm fµ(2π n / N )
Now consider:
αn =φn χ n
φn φn
2χ n χ n
2
If χn and n were proportional then αn = 1, and blip waves would be identical to plane waves. Let’s see what value of αn has for a few values on n.
n kn αn
0 0 1.00
1 π/6a 0.9986
3 π/2a 0.9858
6 π/a 0.6532
Take N=12, for example
kn= 2πn / Na
kmax
=π / a
Therefore if we replace n with χn we make a small error at low k but maybe a significant error for large values of k. Let’s do it anyway, then we will come back to the size of the error and how to reduce it.
ψ n(r) = cnG
G∑ eiG⋅r
Representing single particle orbitals in 3 d
χG (r) = Θ j (r)
j∑ eiG⋅R j
eiG⋅r ; γGχG (r)
ψ n(r) ; γG
G∑ cnGχG (r) = cnG
G∑ γG Θ j (r)e
iG⋅R j
j∑ = anj
j∑ Θ j (r)
a
nj= γGcnG
G∑ eiG⋅R j (note that in DA & MJG, PRB 70, 16101 (2004) γ
Gshould be 1/γ
G)
ψ n(r) = anj
j∑ Θ j (r)
max k
/aπ
max k
/aπmax
/a kπ=
max /a kπ<
Improving the quality of the B-spline representation
May not be good enoughReduce a and achieve better quality
Blips are systematically improvable
B splines PWn n
nB splines B splines PW PWn n n n
ψ ψα
ψ ψ ψ ψ
−
− −=
x y z .999977 .892597 .991164 .991164 .996006
.99999998 .995315 .999988 .999988 .999993
1 max( / )a kα π=
α1(a=π / 2kmax)
Example: Silicon in the ß-Sn structure, 16 atoms, 1st orbital
PW Blips (a=/kmax) Blips (a=/2kmax)
Ek (DFT) 43.863
Eloc(DFT) 15.057
Enl(DFT) 1.543
Ek(VMC) 43.864(3) 43.924(3) 43.862(3)
Eloc(VMC) 15.057(3) 15.063(3) 15.058(3)
Enl(VMC) 1.533(3) 1.525(3) 1.535(3)
Etot(VMC) -101.335(3) -101.277(3) -101.341(3)
(VMC) 4.50 4.74 4.55
T(s/step) 1.83 0.32 0.34
Etot(DMC) -105.714(4) -105.713(5) -105.716(5)
(VMC) 2.29 2.95 2.38
T(s/step) 2.28 0.21 0.25
Energies in QMC (eV/atom) (Silicon in ß-Sn structure, 16 atoms, 15 Ry PW cutoff)
PW Blips (a=/kmax) Blips (a=/2kmax)
Ek(VMC) 178.349(49) 178.360(22) 178.369(22)
Eloc(VMC) -225.191(50) -225.128(24) -225.177(23)
Enl(VMC) -17.955(25) -17.974(11) -17.976(11)
Etot(VMC) -227.677(8) -227.648(4) -227.669(4)
(VMC) 14 15 14.5
T(s/step) 7.8 5.6x10-2 7.1x10-2
Energies in QMC (eV/atom) (MgO in NaCl structure, 8 atoms, 200 Ry PW cutoff)
Blips and plane waves give identical results, blips are 2 orders of magnitude faster on 8 atoms, 3 and 4 order of magnitudes faster on 80 ad 800 atoms respectively (on 800 atoms: Blips 1 day, PW 38 years)
Ωω
Maximally localised Wannier functions (Marzari Vanderbilt) [Williamson et al., PRL, 87, 246406 (2001)]
φi (r) = cmiψm(
m=1
N
∑ r) Linear scaling obtained by truncating orbitals to zero outside their localisation region.
Unitary transformation:
And:
D{φi (r)} =D{ψm(r)}
Achieving linear scaling
ΨT (R) =exp[J (R)] cn
n∑ Dn
↑{ψ i (r j )}Dn↓{ψ i (r j )}
=exp[J (R)] cn
n∑ Dn
↑{φi (r j )}Dn↓{φi (r j )}
The VMC and DMC total energies are exactly invariant with respect to arbitrary (non singular) linear combinations of single-electron orbitals! Transformation does not have to be unitary.
φi (r) = cmiψm(
m=1
N
∑ r)
Arbitrary linear combination:
And:
D{φm(r)} =D{cij}D{ψ i (r)}
EL(R) =ΨT (R)−1 HΨT (R)
Provided D{c
ij}≠0
We have set of orbitals extending over region .( )nψ r Ω ΩωWant to make orbital
maximally localised in sub-region .
Maximise “localisation weight” P:
( ) ( )n nn
cφ ψ= ∑r r
ω∈Ω
( ) ( )22
P d dω
φ φΩ
= ∫ ∫r r r r
Express P as:, ,
m mn n m mn nm n m n
P c A c c A cω∗ ∗ Ω=∑ ∑where: , mn m n mn m nA d A dω
ω
ψ ψ ψ ψ∗ Ω ∗
Ω
= =∫ ∫r r
Weight P is maximal when cn eigenvector of mn n mn nn n
A c A cωαλ
Ω=∑ ∑associated with maximum eigenvalue , and maxλ maxP λ=
Linear scaling obtained by truncating localised orbitals to zero outside their localisation region . Then for given r number of non-zero orbitals is O(1).
ω
( )mφ r
Convergence oflocalisation weight Q=1-P in MgO. Squares: present method (D. Alfè and M. J. Gillan, J. Phys. Cond. Matter 16, L305-L311 (2004))
Diamonds: MLWF(Williamson et al. PRL, 87, 246406 (2001)
Localisation weight in MgO
Convergence oflocalisation weight Q=1-P in MgO. Squares: present method (D. Alfè and M. J. Gillan, J. Phys. Cond. Matter 16, L305-L311 (2004))
Diamonds: MLWF(Williamson et al. PRL, 87, 246406 (2001)
Localisation weight in MgO
Convergence of VMC energy.Squares: Non-orthogonal orbitals. Diamons: MLWF
Convergence of DMC energy, non-orthogonal orbitals
VMC and DMC energies in MgO
Convergence of VMC energy.Squares: Non-orthogonal orbitals. Diamons: MLWF
Convergence of DMC energy, non-orthogonal orbitals
VMC and DMC energies in MgO
Spherical cutoff at 6 a.u on a 7.8 a.u. cubic box (64 atoms): - WF evaluation 4 times faster- Memory occupancy 4 times smaller