29
Density functional theory in solution: Implementing an implicit solvent model for CASTEP and ONETEP James C. Womack University of Southampton, Southampton, UK University of York, November 2016

Density functional theory in solution

  • Upload
    others

  • View
    14

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Density functional theory in solution

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

James C. Womack

University of Southampton, Southampton, UK

University of York, November 2016

Page 2: Density functional theory in solution

24 Nov 16 University of York 2

Overview

Background

– Density functional theory

– Why (implicit) solvation?

– Essential components of an implicit solvation model

The model

– Theoretical design

– Implementation details

– Performance of the model

Project road map

– Where are we now?

– What's next?

Extending the model

– Software (re)engineering

– Boundary conditions

– Implementation in CASTEP

Page 3: Density functional theory in solution

24 Nov 16 University of York 3

Density functional theory

● Incredibly successful and widely used method

– Relatively low computational cost

– Includes electron correlation in a SCF model

– Facilitated by

● Modern parallel computer hardware● Efficient theoretical methods / approximations

conventional

linear-scaling

Page 4: Density functional theory in solution

24 Nov 16 University of York 4

The need for solvation

Image: "Acid & base test using vinegar", courtesy of Carolina Biological Supply Company (www.flickr.com/carolinabio)

● Theorists like to think matter exists in a vacuum

– No environment to consider

– Theoretical simplifications possible

● But many natural and artificial systems exist in solution

– The environment can significantly affect the behaviour of molecules and their reactions

● Simulations which account for solvent effects allow us to address new questions, e.g.

– How is the activity of my catalyst impacted by the solvent used?

– How does the cell environment affect the folding of this protein?

– How will this pharmaceutical behave when dissolved in the stomach?

Page 5: Density functional theory in solution

24 Nov 16 University of York 5

Approaches to solvation

Solute interacts with individual solvent molecules

+ Detailed description of solute-solvent interactions

+ Can describe solvent structural effects, e.g. H-bonding

- Significant increase in system size, N, and thus computational cost

- Many solvent degrees of freedom which need to be statistically averaged

- Solvent-solvent interactions must be treated

Solute interacts with implicit representation of solvent

+ Do not increase system size, N, compared to solute.

+ Solvent degrees of freedom are implicitly averaged in model

+ Explicit treatment of solvent-solvent interactions is avoided

- Solvent structural effects are generally not described

- Specific interactions between solute and solvent not accounted for

- Typically require empirical parameterization

Explicit solvent Implicit solvent

Page 6: Density functional theory in solution

24 Nov 16 University of York 6

Approaches to solvation

Explicit solvent Implicit solvent

QM

MM

Continuum

Explicit and implicit approaches can be combined, e.g.

Many possible approaches, e.g.

● Solvent-accessible surface area

● Solvent exclusion by solute volume

● Dielectric screening by solvent

● Reference interaction site model (RISM)

● Continuum dielectric

Focus of this work

Reviews on implicit solvation:1 M. Feig and C.L. Brooks III, Curr. Opin. Struct. Biol. 14, 217 (2004).2 J. Tomasi, B. Mennucci, and R. Cammi, Chem. Rev. 105, 2999 (2005).

Page 7: Density functional theory in solution

24 Nov 16 University of York 7

Continuum dielectric model

Potential due to charge density

Solution to homogeneous Poisson equation

For periodic boundary conditions, can be solved in reciprocal space:

Without continuum dielectric

Page 8: Density functional theory in solution

24 Nov 16 University of York 8

Continuum dielectric model

Potential due to solute charge

Potential due to dielectric medium

Solution to homogeneous Poisson equation

P is the polarization density

With continuum dielectric

“Solvent reaction potential”Hartree potential

As described in:J.-L. Fattebert and F. Gygi, Int. J. Quantum Chem. 93, 139 (2003).

Page 9: Density functional theory in solution

24 Nov 16 University of York 9

Free energy of solvation

● What do we mean by “solvation”?

– Change in internal energy due to the environment is not the full story:

● Physically meaningful results must account for entropy, temperature.● These are included in the thermodynamic free energy.

– We are typically interested in the “free energy of solvation”

● “the reversible work required to transfer the solute in a fixed configuration from vacuum to solution”1

Electrostatic Non-electrostatic● Interaction of solute with dielectric medium ● Cost of creating cavity in solvent

● Solute/solvent dispersion-repulsion interactions

1 J. Chen, C.L. Brooks III, and J. Khandogin, Curr. Opin. Struct. Biol. 18, 140 (2008).

Page 10: Density functional theory in solution

24 Nov 16 University of York 10

Building an implicit solvation model

● The essential components

– Solute cavity

– Solute charge representation

– Model for non-electrostatic components of free energy change

● Many possibilities!

– But we are interested in just one combination today...

Cavity

Page 11: Density functional theory in solution

24 Nov 16 University of York 11

Minimal parameter implicit solvent model

“The ONETEP *TEP solvent model”

Cavity● Density dependent● Smoothly varying dielectric function

Solute charge● From density functional theory

Non-electrostatic part● From cavity surface area● Effective surface tension

● J.-L. Fattebert and F. Gygi, J. Comput. Chem. 23, 662 (2002). ● J.-L. Fattebert and F. Gygi, Int. J. Quantum Chem. 93, 139 (2003).● D.A. Scherlis, J.-L. Fattebert, F. Gygi, M. Cococcioni, and N. Marzari, J. Chem. Phys. 124, 74103 (2006). ● J. Dziedzic, H.H. Helal, C.-K. Skylaris, A.A. Mostofi, and M.C. Payne, EPL 95, 43001 (2011). ● J. Dziedzic, S.J. Fox, T. Fox, C.S. Tautermann, and C.-K. Skylaris, Int. J. Quantum Chem. 113, 771 (2013).

A refined “Fattebert-Gygi-Scherlis” (FGS) solvation model

Self-consistently solve KS equations subject to solvent● Electrostatic/non-electrostatic terms depend on density

Page 12: Density functional theory in solution

24 Nov 16 University of York 12

Minimal parameter implicit solvent model

Solute charge obtained from DFT

Cavity defined by smoothly varyingdensity-dependent dielectric function

Non-polar free energy contributionbased on cavity surface area

Page 13: Density functional theory in solution

24 Nov 16 University of York 13

Solving the NPE

● How to determine the reaction potential?

– Solve the non-homogeneous Poisson equation (NPE)

– Yields total electrostatic potential

● Subject to boundary conditions

– Current model uses approximate open BCs

– Assumes dielectric function is homogeneous

Page 14: Density functional theory in solution

24 Nov 16 University of York 14

SCRF method

● Self-consistent solution for the solute charge and reaction potential

– Solve for the solute charge and reaction potential due to the interaction of the solute with the dielectric medium.

Self-consistent reaction field

Solve KS equations Determine reaction potentialDetermine cavity surface area

Initial guess

Converged result

Page 15: Density functional theory in solution

24 Nov 16 University of York 15

Implementation highlights

Smeared ionic cores1,2

● Represent ionic core charge with Gaussians● Solve NPE for total molecular charge density● Avoids numerical issues with point-charges

Electrostatic energy is evaluated for total charge● Actual functional represents all electrostatic interactions● Functional is modified to correct for smeared cores

1 D.A. Scherlis, J.-L. Fattebert, F. Gygi, M. Cococcioni, and N. Marzari, J. Chem. Phys. 124, 74103 (2006).2 J. Dziedzic, S.J. Fox, T. Fox, C.S. Tautermann, and C.-K. Skylaris, Int. J. Quantum Chem. 113, 771 (2013).

Coarse-grained boundary conditions2

● Evaluation of BC integral is computationally costly● Replace integral with sum over point charges● Point charges represent summed charge of block of space

Page 16: Density functional theory in solution

24 Nov 16 University of York 16

Implementation highlights

Solve NPE using a multigrid solver (DL_MG)1

● Efficient real-space solution to second-order● Highly parallelised: MPI + OpenMP

1 L. Anton, J. Dziedzic, C.-K. Skylaris, and M. Probert, “Multigrid Solver Module for ONETEP, CASTEP and Other Codes” (dCSE, 2013).2 C.-K. Skylaris, P.D. Haynes, A.A. Mostofi, and M.C. Payne, J. Chem. Phys. 122, 84119 (2005).

DL_MG

Defect correction loop

Model currently available in ONETEP2

● Linear-scaling DFT code● Strictly localized orbitals (NGWFs)● Direct energy minimization approach● Capable of calculations on 1000s of atoms

● Higher-order accuracy obtained by “defect correction”● Input and output on real-space Cartesian grid

Page 17: Density functional theory in solution

24 Nov 16 University of York 17

How accurate is the model?

Approach XC functional Error (RMS)

Error (Max)

R

*TEPa PBE 3.8 8.3 0.83

*TEPb PBE 4.1 9.1 0.83

PCM PBE 10.9 23.3 0.53

SMD M05-2X 3.4 14.5 0.87

AMBER (classical) 5.1 19.9 0.77

Testing the model in ONETEP for 71 neutral molecules*

*Taken from blind tests in1 J. P. Guthrie, J. Phys. Chem. B 113, 4501 (2009).2 A. Nicholls et al., J. Med. Chem. 51, 769 (2008).Experimental energies of solvation from Minnesota solvation database.

Results provided by J. Dziedzic, also appear in:3 J. Dziedzic et al., EPL 95, 43001 (2011).

Free energies of solvation in kcal/molaSelf-consistent cavity, bFixed cavity

PCM, SMD and AMBER force field Poisson-Boltzmann are competing implicit solvent models.

See Ref 3 for more calculation details.

Page 18: Density functional theory in solution

24 Nov 16 University of York 18

Extending the model

ARCHER eCSE project“Implementation and optimisation of advanced solvent

modelling functionality in CASTEP and ONETEP”J. C. Womack, J. Dziedzic, C.-K. Skylaris, M. I. J. Probert

Existing implementation of minimal parameter solvent model in ONETEP

J. Dziedzic, H. H. Helal, C.-K. Skylaris, L. Anton, A. A. Mostofi, M. C. Payne.

Improvements to multigrid solver (DL_MG)

Extensions to solvent model in ONETEP

Implementation of solvent model in CASTEP

Poisson-Boltzmann equation

Import defect correction code from ONETEP into DL_MG

Alternative iterate change criteria for multigrid procedure

Add support for periodic and mixed boundary conditions(currently only open BCs are supported)

Periodic and mixed BCs for saline solvent model

Atomic forces terms for saline solvation energy terms

Page 19: Density functional theory in solution

24 Nov 16 University of York 19

ARCHER eCSE project“Implementation and optimisation of advanced solvent

modelling functionality in CASTEP and ONETEP”J. C. Womack, J. Dziedzic, C.-K. Skylaris, M. I. J. Probert

Existing implementation of minimal parameter solvent model in ONETEP

J. Dziedzic, H. H. Helal, C.-K. Skylaris, L. Anton, A. A. Mostofi, M. C. Payne.

Improvements to multigrid solver (DL_MG)

Extensions to solvent model in ONETEP

Implementation of solvent model in CASTEP

Extending the model

DL_MG interface● DL_MG-compatible parallel decomposition of charge density● Evaluation of real-space electrostatic potential using multigrid

(rather than in reciprocal space)

Supporting functionality● Real-space representation of ionic cores as Gaussian charge

distributions (“smeared ion representation”)● Support for open boundary conditions ● Local pseudopotentials in real-space

Solvent model● Evaluation of dielectric function● Electrostatic energy terms● Non-electrostatic (cavitation) energy terms● Integration of solvation terms into self-consistency scheme● Support for atomic forces evaluation with solvent terms● Steric potentials for saline solvent model

Software development● Modification of CASTEP build process to include DL_MG● New keywords for running simulations with solvent model● Documentation (source and user manual)

Page 20: Density functional theory in solution

24 Nov 16 University of York 20

Defect correction

● DL_MG solves the NPE to second order

– Typically yields insufficient accuracy in this context

● The “defect correction” can greatly improve accuracy

– Iteratively improve upon second order solution

– Uses higher-order finite differences outside of solver

DL_MG DL_MGONETEP

Definitions

See J. Dziedzic et al, Int. J. Quantum Chem. 113, 771 (2013), and references therein for further details.

Page 21: Density functional theory in solution

24 Nov 16 University of York 21

Defect correction

Why is it important? FD order Hartree energy in vacuum

2 113640.335

4 113558.656

6 113557.583

8 113557.502

10 113557.485

12 113557.48

MT 113557.47446894

CC 113557.47446894

Results provided by J. Dziedzic, also appear in:1 J. Dziedzic et al, Int. J. Quantum Chem. 113, 771 (2013).* Protein = T4 Lysozyme L99A/M102Q

MT: Martyna-TuckermanCC: Cutoff-Coulomb

Reference values for vacuumcalculations with open BCs

vacuum

solution

Phenol

Hartree energy of phenol in kcal/mol(electron density only)

“Coulombic component” is for total charge density:

Binding energy is for phenol/protein complex*

Page 22: Density functional theory in solution

24 Nov 16 University of York 22

Defect correction

DL_MG

● Migrate defect correction code into DL_MG

– Avoids need to re-implement in CASTEP or other codes

– DL_MG becomes more a capable package

● More complicated than it appears!

– Different data representations

– Different parallel data distributions (1-D vs. 3-D)

ONETEP

Page 23: Density functional theory in solution

24 Nov 16 University of York 23

Porting the model to CASTEP

Linear-scaling density-matrix DFT code Plane-wave pseudopotential DFT code

C.-K. Skylaris, P.D. Haynes, A.A. Mostofi, and M.C. Payne, J. Chem. Phys. 122, 84119 (2005).

S.J. Clark, M.D. Segall, C.J. Pickard, P.J. Hasnip, M.I.J. Probert, K. Refson, and M.C. Payne, Z. Kristallogr. 220, 567 (2005).

Key relevant similarities:

+ Solute charge density on real space grid

+ Hartree (electrostatic) potential on real space grid

+ Nuclei & core electrons represented by pseudopotentials

+ Written in Fortran 2003 with modular design

+ MPI and OpenMP parallelism

ONETEP

Page 24: Density functional theory in solution

24 Nov 16 University of York 24

Porting the model to CASTEP

ONETEP

C.-K. Skylaris, P.D. Haynes, A.A. Mostofi, and M.C. Payne, J. Chem. Phys. 122, 84119 (2005).

S.J. Clark, M.D. Segall, C.J. Pickard, P.J. Hasnip, M.I.J. Probert, K. Refson, and M.C. Payne, Z. Kristallogr. 220, 567 (2005).

Key challenges:

- Currently no support for open BCs in CASTEP

- Need real-space local pseudopotentials

- Need to calculate BCs for electrostatic potential

- Currently no support for smeared ions in CASTEP

- Need smeared ions to calculate total electrostatic potential

- Different parallel data distributions (1-D vs. 3-D)

Linear-scaling density-matrix DFT code Plane-wave pseudopotential DFT code

Page 25: Density functional theory in solution

24 Nov 16 University of York 25

Boundary conditions

Adding periodic and mixed boundary conditions to model

● Currently only supports open BCs, i.e.

● We plan to implement periodic/mixed BCs, i.e.

Mixed: periodic along some directions, open along others

● This capability is useful for some types of material, e.g.

– Surfaces (periodic in 2-dimensions)

– Polymers (periodic in 1-dimension)

● Periodic/mixed BCs will affect electrostatics

– Pseudopotentials

– Pseudoion core interactionsWill require careful consideration...

Images: Polymer from G. Boschetto, Pt on graphene from L. Verga.

Page 26: Density functional theory in solution

24 Nov 16 University of York 26

Project roadmap

ARCHER eCSE project“Implementation and optimisation of advanced solvent

modelling functionality in CASTEP and ONETEP”J. C. Womack, J. Dziedzic, C.-K. Skylaris, M. I. J. Probert

Improvements to multigrid solver (DL_MG)

Extensions to solvent model in ONETEP

Implementation of solvent model in CASTEP

Imported defect correction code from ONETEP into DL_MG☑NB Only 1-D parallel decomposition, open BCs currently

Upcoming tasks● Periodic and mixed BCs for defect correction● Generalized 3-D parallel data decomposition

Already supported DL_MG's core second-order solver code, but need to be extended to the new defect correction component

Page 27: Density functional theory in solution

24 Nov 16 University of York 27

Project roadmap

ARCHER eCSE project“Implementation and optimisation of advanced solvent

modelling functionality in CASTEP and ONETEP”J. C. Womack, J. Dziedzic, C.-K. Skylaris, M. I. J. Probert

Improvements to multigrid solver (DL_MG)

Extensions to solvent model in ONETEP

Implementation of solvent model in CASTEP

DL_MG interfaced with CASTEP● Integrated into CASTEP build system● Evaluation of Hartree potential using multigrid

NB. Only zero BCs, single MPI process (with OpenMP)

Zero BCs:

Open BCs:

Upcoming tasks● Implement open BCs in CASTEP

– Calculation of potential on cell faces (boundary conditions)– Real-space local pseudopotentials

● DL_MG-compatible parallel decomposition of charge– Should be contiguous in x, y and z directions

Open question: How best to achieve this?● Gather data to 1 MPI process and run DL_MG here?● Gather data to 1 MPI process, rearrange and redistribute?

Page 28: Density functional theory in solution

24 Nov 16 University of York 28

Project roadmap

ARCHER eCSE project“Implementation and optimisation of advanced solvent

modelling functionality in CASTEP and ONETEP”J. C. Womack, J. Dziedzic, C.-K. Skylaris, M. I. J. Probert

Improvements to multigrid solver (DL_MG)

Extensions to solvent model in ONETEP

Implementation of solvent model in CASTEP

☐ Add support for periodic and mixed boundary conditions

● Requires periodic and mixed BCs in DL_MG– Currently not implemented in defect correction code

● Could implement in CASTEP & ONETEP simultaneously– More progress on CASTEP implementation necessary

Page 29: Density functional theory in solution

24 Nov 16 University of York 29

Acknowledgements

● eCSE project collaborators:

– Jacek Dziedzic (Southampton)

– Chris-Kriton Skylaris (Southampton)

– Lucian Anton (Cray Inc.)

– Matt Probert (York)

● Previous work on solvent model:

– Hatem H. Helal

– Arash A. Mostofi

– Mike C. Payne

– Jacek Dziedzic

– Chris-Kriton Skylaris

– Lucian Anton