A Computational Viewpoint on Classical DensityFunctional Theory
Matthew Knepley and Dirk Gillespie
Computation InstituteUniversity of Chicago
Department of Molecular Biology and PhysiologyRush University Medical Center
Geometric Modeling in Biomolecular SystemsSIAM Life Sciences 14, Charlotte, NC August 6, 2014
M. Knepley (UC) DFT LS ’14 1 / 31
CDFT Intro
Outline
1 CDFT Intro
2 Model
3 Verification
M. Knepley (UC) DFT LS ’14 3 / 31
CDFT Intro
What is CDFT?
A fast, accurate theoretical toolto understand the fundamentalphysics of inhomogeneous fluids
M. Knepley (UC) DFT LS ’14 4 / 31
CDFT Intro
What is CDFT?
For concentration ρi(~x) of species i ,solve
minρi(~x)
Ω[ρi(~x)]
where Ω is the free energy.
M. Knepley (UC) DFT LS ’14 4 / 31
CDFT Intro
What is CDFT?
For concentration ρi(~x) of species i ,solve
δΩ
δρi(~x)= 0
which are the Euler-Lagrangeequations.
M. Knepley (UC) DFT LS ’14 4 / 31
CDFT Intro
What is CDFT?DFT
Computes ensemble-averaged quantities directly
Can have physical resolution in time (µs) and space (Å)
Requires an accurate Ω
Requires sophisticated solver technology
Can predict experimental results!
For example,
D. Gillespie, L. Xu, Y. Wang, and G. Meissner,J. Phys. Chem. B 109, 15598, 2005
M. Knepley (UC) DFT LS ’14 4 / 31
Model
Outline
1 CDFT Intro
2 ModelHard Sphere RepulsionBulk Fluid ElectrostaticsReference Fluid Density Electrostatics
3 Verification
M. Knepley (UC) DFT LS ’14 5 / 31
Model
Equilibrium
ρi(~x) = exp(µbath
i − µexti (~x)− µex
i (~x)
kT
)where
µexi (~x) = µHS
i (~x) + µESi (~x)
= µHSi (~x) + µSC
i (~x) + zieφ(~x)
and
−ε∆φ(~x) = e∑
i
ρi(~x)
M. Knepley (UC) DFT LS ’14 6 / 31
Model
Details
The theory and implementation are detailed in
Knepley, Karpeev, Davidovits, Eisenberg, Gillespie,An Efficient Algorithm for Classical Density FunctionalTheory in Three Dimensions: Ionic Solutions,JCP, 2012.
M. Knepley (UC) DFT LS ’14 7 / 31
Model Hard Sphere Repulsion
Outline
2 ModelHard Sphere RepulsionBulk Fluid ElectrostaticsReference Fluid Density Electrostatics
M. Knepley (UC) DFT LS ’14 8 / 31
Model Hard Sphere Repulsion
Hard Spheres (Rosenfeld)
µHSi (~x) = kT
∑α
∫∂ΦHS
∂nα(nα(~x ′))ωαi (~x − ~x ′) d3x ′
where
ΦHS(nα(~x ′)) = −n0 ln(1− n3) +n1n2 − ~nV1 · ~nV2
1− n3
+n3
224π(1− n3)2
(1−
~nV2 · ~nV2
n22
)3
M. Knepley (UC) DFT LS ’14 9 / 31
Model Hard Sphere Repulsion
Hard Sphere Basis
nα(~x) =∑
i
∫ρi(~x ′)ωαi (~x − ~x ′) d3x ′
where
ω0i (~r) =
ω2i (~r)
4πR2i
ω1i (~r) =
ω2i (~r)
4πRi
ω2i (~r) = δ(|~r | − Ri) ω3
i (~r) = θ(|~r | − Ri)
~ωV1i (~r) =
~ωV2i (~r)
4πRi~ωV2
i (~r) =~r|~r |δ(|~r | − Ri)
M. Knepley (UC) DFT LS ’14 10 / 31
Model Hard Sphere Repulsion
Hard Sphere Basis
All nα integrals may be cast as convolutions:
nα(~x) =∑
i
∫ρi(~x ′)ωαi (~x ′ − ~x)d3x ′
=∑
i
F−1 (F (ρi) · F (ωαi ))
=∑
i
F−1 (ρi · ωαi)
and similarly
µHSi (~x) = kT
∑α
F−1
(ˆ∂ΦHS
∂nα· ωαi
)
M. Knepley (UC) DFT LS ’14 11 / 31
Model Hard Sphere Repulsion
Hard Sphere BasisSpectral Quadrature
There is a fly in the ointment:standard quadrature for ωα is very inaccurate (O(1) errors),
and destroys conservation properties, e.g. total mass
We can use spectral quadrature for accurate evaluation,combining FFT of density, ρi ,
with analytic FT of weight functions.
M. Knepley (UC) DFT LS ’14 12 / 31
Model Hard Sphere Repulsion
Hard Sphere BasisSpectral Quadrature
There is a fly in the ointment:standard quadrature for ωα is very inaccurate (O(1) errors),
and destroys conservation properties, e.g. total mass
We can use spectral quadrature for accurate evaluation,combining FFT of density, ρi ,
with analytic FT of weight functions.
M. Knepley (UC) DFT LS ’14 12 / 31
Model Hard Sphere Repulsion
Hard Sphere BasisSpectral Quadrature
ω0i (~k) =
ω2i (~k)
4πR2i
ω1i (~k) =
ω2i (~k)
4πRi
ω2i (~k) =
4πRi sin(Ri |~k |)|~k |
ω3i (~k) =
4π
|~k |3(
sin(Ri |~k |)− Ri |~k | cos(Ri |~k |))
ωV1i (~k) =
ωV2i (~k)
4πRiωV2
i (~k) =−4πı
|~k |2
(sin(Ri |~k |)− Ri |~k | cos(Ri |~k |)
)k
M. Knepley (UC) DFT LS ’14 13 / 31
Model Hard Sphere Repulsion
Hard Sphere BasisNumerical Stability
Recall that
ΦHS(nα(~x ′)) = . . .+n3
224π(1− n3)2
(1−
~nV2 · ~nV2
n22
)3
and note that we have analytically∣∣nV2(x)∣∣2∣∣n2(x)∣∣2 ≤ 1.
However, discretization errors in ρi near sharp geometric features canproduce large values for this term, which prevent convergence of thenonlinear solver. Thus we explicitly enforce this bound.
M. Knepley (UC) DFT LS ’14 14 / 31
Model Bulk Fluid Electrostatics
Outline
2 ModelHard Sphere RepulsionBulk Fluid ElectrostaticsReference Fluid Density Electrostatics
M. Knepley (UC) DFT LS ’14 15 / 31
Model Bulk Fluid Electrostatics
Bulk Fluid (BF) Electrostatics
µSCi = µES,bath
i −∑
j
∫|~x−~x ′|≤Rij
(c(2)
ij (~x , ~x ′) + ψij(~x , ~x ′))
∆ρj(~x ′) d3x ′
Using λk = Rk + 12Γ , where Γ is the MSA screening parameter, we have
c(2)ij
(~x , ~x ′
)+ ψij
(~x , ~x ′
)=
zizje2
8πε
(|~x − ~x ′|2λiλj
−λi + λj
λiλj+
1|~x − ~x ′|
((λi − λj
)2
2λiλj+ 2
))
M. Knepley (UC) DFT LS ’14 16 / 31
Model Bulk Fluid Electrostatics
Bulk Fluid (BF) Electrostatics
µSCi = µES,bath
i −∑
j
∫|~x−~x ′|≤Rij
(c(2)
ij (~x , ~x ′) + ψij(~x , ~x ′))
∆ρj(~x ′) d3x ′
It’s a convolution too!
M. Knepley (UC) DFT LS ’14 16 / 31
Model Bulk Fluid Electrostatics
Bulk Fluid (BF) Electrostatics
µSCi = µES,bath
i −∑
j
∫|~x−~x ′|≤Rij
(c(2)
ij (~x , ~x ′) + ψij(~x , ~x ′))
∆ρj(~x ′) d3x ′
F(∆ρj
)= F
(ρj − ρbath
)= F
(ρj)−F (ρbath)
F(ρj)
was already calculatedF (ρbath) is constant
F(
c(2)ij
(~x , ~x ′
)+ ψij
(~x , ~x ′
))is constant
so we only calculate the inverse transform on each iteration.
M. Knepley (UC) DFT LS ’14 16 / 31
Model Bulk Fluid Electrostatics
Bulk Fluid (BF) Electrostatics
µSCi = µES,bath
i −∑
j
∫|~x−~x ′|≤Rij
(c(2)
ij (~x , ~x ′) + ψij(~x , ~x ′))
∆ρj(~x ′) d3x ′
FFT is also inaccurate!
M. Knepley (UC) DFT LS ’14 16 / 31
Model Bulk Fluid Electrostatics
Bulk Fluid (BF) Electrostatics
µSCi = µES,bath
i −∑
j
∫|~x−~x ′|≤Rij
(c(2)
ij (~x , ~x ′) + ψij(~x , ~x ′))
∆ρj(~x ′) d3x ′
c(2)ij + ψij =
zizje2
ε|~k |
(1
2λiλjI1 −
λi + λj
λiλjI0 +
((λi − λj
)2
2λiλj+ 2
)I−1
)
where
I−1 =1
|~k |
(1− cos(|~k |R)
)I0 = − R
|~k |cos(|~k |R) +
1
|~k |2sin(|~k |R)
I1 = −R2
|~k |cos(|~k |R) + 2
R
|~k |2sin(|~k |R)− 2
|~k |3(
1− cos(|~k |R))
M. Knepley (UC) DFT LS ’14 16 / 31
Model Reference Fluid Density Electrostatics
Outline
2 ModelHard Sphere RepulsionBulk Fluid ElectrostaticsReference Fluid Density Electrostatics
M. Knepley (UC) DFT LS ’14 17 / 31
Model Reference Fluid Density Electrostatics
Reference Fluid Density (RFD) Electrostatics
Expand around ρrefi
(~x), an inhomogeneous reference density profile:
µSCi[ρk(~y)]≈ µSC
i[ρref
k(~y)]
− kT∑
i
∫c(1)
i
[ρref
k(~y)
;~x]
∆ρi(~x)
d3x
− kT2
∑i,j
∫∫c(2)
ij
[ρref
k(~y)
;~x , ~x ′]
∆ρi(~x)
∆ρj(~x ′)
d3x d3x ′
with
∆ρi(~x)
= ρi(~x)− ρref
i(~x)
M. Knepley (UC) DFT LS ’14 18 / 31
Model Reference Fluid Density Electrostatics
Reference Fluid Density (RFD) Electrostatics
ρrefi[ρk(~x ′)
;~x]
=3
4πR3SC
(~x) ∫|~x ′−~x|≤RSC(~x)
αi(~x ′)ρi(~x ′)
d3x ′
Choose αi so that the reference density ischarge neutral, andhas the same ionic strength as ρi
This can model gradient flow
M. Knepley (UC) DFT LS ’14 19 / 31
Model Reference Fluid Density Electrostatics
Reference Fluid Density (RFD) Electrostatics
ρrefi[ρk(~x ′)
;~x]
=3
4πR3SC
(~x) ∫|~x ′−~x|≤RSC(~x)
αi(~x ′)ρi(~x ′)
d3x ′
Choose αi so that the reference density ischarge neutral, andhas the same ionic strength as ρi
This can model gradient flow
M. Knepley (UC) DFT LS ’14 19 / 31
Model Reference Fluid Density Electrostatics
Reference Fluid Density (RFD) Electrostatics
ρrefi[ρk(~x ′)
;~x]
=3
4πR3SC
(~x) ∫|~x ′−~x|≤RSC(~x)
αi(~x ′)ρi(~x ′)
d3x ′
Choose αi so that the reference density ischarge neutral, andhas the same ionic strength as ρi
This can model gradient flow
M. Knepley (UC) DFT LS ’14 19 / 31
Model Reference Fluid Density Electrostatics
Reference Fluid Density (RFD) Electrostatics
We can rewrite this expression as an averaging operation:
ρref (~x) =
∫ρ(~x ′)
θ(|~x ′ − ~x | − RSC(~x)
)4π3 R3
SC(~x)dx ′
where
RSC(~x) =
∑i ρi(~x)Ri∑
i ρi(~x)+
12Γ(~x)
We close the system using
ΓSC [ρ] (~x) = ΓMSA[ρref(ρ)
](~x).
M. Knepley (UC) DFT LS ’14 20 / 31
Model Reference Fluid Density Electrostatics
Reference Fluid Density (RFD) Electrostatics
We can rewrite this expression as an averaging operation:
ρref (~x) =
∫ρ(~x ′)
θ(|~x ′ − ~x | − RSC(~x)
)4π3 R3
SC(~x)dx ′
where
RSC(~x) =
∑i ρi(~x)Ri∑
i ρi(~x)+
12Γ(~x)
We close the system using
ΓSC [ρ] (~x) = ΓMSA[ρref(ρ)
](~x).
M. Knepley (UC) DFT LS ’14 20 / 31
Verification
Outline
1 CDFT Intro
2 Model
3 Verification
M. Knepley (UC) DFT LS ’14 21 / 31
Verification
Consistency checks
Check nα of constant density against analytics
Check that n3 is the combined volume fraction
Check that wall solution has only 1D variation
M. Knepley (UC) DFT LS ’14 22 / 31
Verification
Sum Rule VerificationHard Spheres
βPHSbath =
∑i
ρi(Ri)
where
PHSbath =
6kTπ
(ξ0
∆+
3ξ1ξ2
∆2 +3ξ3
2∆3
)
using auxiliary variables
ξn =π
6
∑j
ρbathj σn
j n ∈ 0, . . . ,3
∆ = 1− ξ3
M. Knepley (UC) DFT LS ’14 23 / 31
Verification
Sum Rule VerificationHard Spheres
Relative accuracy and Simulation time for R = 0.1nm
M. Knepley (UC) DFT LS ’14 24 / 31
Verification
Sum Rule VerificationHard Spheres
Volume fraction ranges from 10−5 to 0.4 (very difficult for MC/MD)
M. Knepley (UC) DFT LS ’14 24 / 31
Verification
Ionic Fluid VerificationCharged Hard Spheres
Rcation 0.1nmRanion 0.2125nmConcentration 1MDomain 2× 2× 6 nm3 and periodicUncharged hard wall z = 0Grid 21× 21× 161
M. Knepley (UC) DFT LS ’14 25 / 31
Verification
Ionic Fluid VerificationCharged Hard Spheres
Rcation 0.1nmRanion 0.2125nmConcentration 1MDomain 2× 2× 6 nm3 and periodicUncharged hard wall z = 0Grid 21× 21× 161
M. Knepley (UC) DFT LS ’14 25 / 31
Verification
Ionic Fluid VerificationCharged Hard Spheres
Cation Concentrations for 1M concentration
M. Knepley (UC) DFT LS ’14 26 / 31
Verification
Ionic Fluid VerificationCharged Hard Spheres
Anion Concentrations for 1M concentration
M. Knepley (UC) DFT LS ’14 27 / 31
Verification
Ionic Fluid VerificationCharged Hard Spheres
Mean Electrostatic Potential for 1M concentration
M. Knepley (UC) DFT LS ’14 28 / 31
Verification
Ionic Fluid VerificationCharged Hard Spheres
These results were first reported in 1D inDensity functional theory of the electrical doublelayer: the RFD functional,J. Phys.: Condens. Matter 17, 6609, 2005.
M. Knepley (UC) DFT LS ’14 29 / 31
Verification
Main Points
Real Space vs. Fourier SpaceO(N2) vs. O(N lg N)
Accurate quadrature only available in Fourier spaceElectrostatics
Bulk Fluid (BF) model can be qualitatively wrongReference Fluid Density (RFD) model demands complex algorithm
Solver convergencePicard was more robustNewton rarely entered the quadratic regimeStill no multilevel alternative (interpolation?)
M. Knepley (UC) DFT LS ’14 30 / 31
Verification
Main Points
Real Space vs. Fourier SpaceO(N2) vs. O(N lg N)
Accurate quadrature only available in Fourier spaceElectrostatics
Bulk Fluid (BF) model can be qualitatively wrongReference Fluid Density (RFD) model demands complex algorithm
Solver convergencePicard was more robustNewton rarely entered the quadratic regimeStill no multilevel alternative (interpolation?)
M. Knepley (UC) DFT LS ’14 30 / 31
Verification
Main Points
Real Space vs. Fourier SpaceO(N2) vs. O(N lg N)
Accurate quadrature only available in Fourier spaceElectrostatics
Bulk Fluid (BF) model can be qualitatively wrongReference Fluid Density (RFD) model demands complex algorithm
Solver convergencePicard was more robustNewton rarely entered the quadratic regimeStill no multilevel alternative (interpolation?)
M. Knepley (UC) DFT LS ’14 30 / 31
Verification
Conclusion
The theory and implementation are detailed inAn Efficient Algorithm for Classical Density Functional Theory in ThreeDimensions: Ionic Solutions, JCP, 2012.
M. Knepley (UC) DFT LS ’14 31 / 31
Verification
Conclusion
The theory and implementation are detailed inAn Efficient Algorithm for Classical Density Functional Theory in ThreeDimensions: Ionic Solutions, JCP, 2012.
M. Knepley (UC) DFT LS ’14 31 / 31
Top Related