An Overview on the Libxc Library of Density Functional Approximations

An Overview on the Libxc Library of Density Functional Approximations

An overview on the Libxc library of density functional approximations Susi Lehtola Molecular Sciences Software Institute at Virginia Tech 2 June 2021 Outline Why Libxc? Recap on DFT What is Libxc? Using Libxc A look under the hood Wrapup GPAW 2021: Users' and Developers' Meeting Susi Lehtola Why Libxc? 2/28 Why Libxc? There are many approximations for the exchange-correlation functional. But, most programs I ... only implement a handful (sometimes 5, typically 10-15) I ... and the implementations may be buggy / non-standard GPAW 2021: Users' and Developers' Meeting Susi Lehtola Why Libxc? 3/28 Why Libxc, cont'd This leads to issues with reproducibility I chemists and physicists do not traditionally use the same functionals! Outdated(?) stereotype: B3LYP vs PBE I how to reproduce a calculation performed with another code? GPAW 2021: Users' and Developers' Meeting Susi Lehtola Why Libxc? 4/28 Why Libxc, cont'd The issue is compounded by the need for backwards and forwards compatibility: how can one I reproduce old calculations from the literature done with a now-obsolete functional (possibly with a program that is proprietary / no longer available)? I use a newly developed functional in an old program? GPAW 2021: Users' and Developers' Meeting Susi Lehtola Why Libxc? 5/28 Why Libxc, cont'd A standard implementation is beneficial! I no need to keep reinventing (and rebuilding) the wheel I use same collection of density functionals in all programs I new functionals only need to be implemented in one place I broken/buggy functionals only need to be fixed in one place I same implementation can be used across numerical approaches, e.g. Gaussian basis set vs finite elements =) functionals in Libxc can be validated against data in original publications, regardless of which numerical method was used! E.g. Gaussian-basis calculations afford extremely sensitive verification I < 1µEh level agreement for total energies typically achievable between different codes when density functional implementations are equivalent GPAW 2021: Users' and Developers' Meeting Susi Lehtola Why Libxc? 6/28 Outline Why Libxc? Recap on DFT What is Libxc? Using Libxc A look under the hood Wrapup GPAW 2021: Users' and Developers' Meeting Susi Lehtola Recap on DFT 7/28 Brief recap on DFT Density functionals can be classified on Jacob's ladder. The first rung: local density approximation (LDA), for which the energy density per particle xc depends only on the local electron spin-density nσ(r) or Z Z 3 3 Exc = fxc(n"(r); n#(r))d r = n(r)xc(n"(r); n#(r))d r LDAs can be derived from the homogeneous electron gas. GPAW 2021: Users' and Developers' Meeting Susi Lehtola Recap on DFT 8/28 Brief recap on DFT, cont'd Meta-local density approximation (meta-LDA) functionals depend on nσ(r) and the local kinetic energy density τσ, and are still (almost) fully derivable from the homogeneous electron gas Z 3 Exc = n(r)xc(n"(r); n#(r); τ"(r); τ#(r))d r occupied 1 X τ = [r (r)]2 σ 2 iσ i [J. Chem. Theory Comput. 17, 943 (2021)] GPAW 2021: Users' and Developers' Meeting Susi Lehtola Recap on DFT 9/28 Brief recap on DFT, cont'd The next rungs are I generalized gradient approximation (GGA): dependence on nσ(r) and its gradient rnσ(r) I meta-GGA approximation: nσ(r); rnσ(r) and τσ(r) and/or 2 r nσ(r) which are still "pure" density functionals. Higher rungs contain non-density-functional contributions I global hybrids: include fraction of Hartree{Fock exchange I range-separated hybrids: include variable fraction of short-range vs long-range exact exchange (various kernels) I local hybrids: local exchange energy enters functional I double hybrids: include post-Hartree{Fock correlation, e.g. Møller–Plesset but still contain a density functional part. GPAW 2021: Users' and Developers' Meeting Susi Lehtola Recap on DFT 10/28 Outline Why Libxc? Recap on DFT What is Libxc? Using Libxc A look under the hood Wrapup GPAW 2021: Users' and Developers' Meeting Susi Lehtola What is Libxc? 11/28 What is Libxc? Libxc is a library that I evaluates the density functional contributions I provides the parameters to be used for non-local contributions e.g. exact exchange, VV10 non-local correlation, MP2 correlation energy etc that need to be evaluated by the calling program GPAW 2021: Users' and Developers' Meeting Susi Lehtola What is Libxc? 12/28 What is Libxc, cont'd Libxc currently implements 600+ density functionals xc (currently!). I last presentation on Libxc by M.A.L. Marques in 2012: "There are many approximations for the xc (probably of the order of 250{300)" Libxc supports I exchange, correlation, exchange-correlation, and kinetic energy functionals (for orbital-free DFT) I pure functionals, global hybrids, range-separated hybrids (various kernels: error function, Yukawa, etc) I up to 4th derivatives for (almost) all functionals I double hybrids in the upcoming major release and uses a permissible Mozilla Public License that allows its inclusion also in non-free/non-open-source programs. GPAW 2021: Users' and Developers' Meeting Susi Lehtola What is Libxc? 13/28 What is Libxc, cont'd Libxc is currently used in over 30 electronic structure programs differing in numerical approaches, size of developer community, as well as development model (free software vs open source vs proprietary/closed-source/commercial). I Abinit I entos I MRCC I ACE-Molecule I ERKALE I Octopus I ADF I exciting I ORCA APE FHI-AIMS I I I PROFESS I AtomPAW I GAMESS (US) I Psi4 I BAGEL I GPAW I PySCF I BigDFT I HelFEM I QuantumATK I CP2K I Horton Quantum Espresso I DFT-FE I JDFTx I I DP I MADNESS I Turbomole I Chronus Quantum I MOLGW I WIEN2k I Elk I Molpro I Yambo GPAW 2021: Users' and Developers' Meeting Susi Lehtola What is Libxc? 14/28 Side note: Libxc and GPAW GPAW was one of the early adopters of Libxc I Libxc started in 2004 I GPAW had an interface in 2007; from GPAW git log commit 2dc204a9aeb0adb5de21a22a714705e9881793f2 Author: Jens J?rgen Mortensen <[email protected]> Date: Mon Jul 16 12:31:53 2007 +0000 Remember libxc files when compiling gpaw−python My history is more recent I 2012: I started using (and patching) Libxc as a grad student I wrote ERKALE, the first(?) Gaussian-basis code to fully interface Libxc I 2014: I got commit rights to Libxc and became one of the main authors GPAW 2021: Users' and Developers' Meeting Susi Lehtola What is Libxc? 15/28 Outline Why Libxc? Recap on DFT What is Libxc? Using Libxc A look under the hood Wrapup GPAW 2021: Users' and Developers' Meeting Susi Lehtola Using Libxc 16/28 Libxc interface I Libxc has native interfaces to C, Fortran 2003, and Python; I will showcase the C interface given in xc.h I Before use, functional instance is constructed with xc func init; after use, it needs to be destroyed with xc func end /∗∗ Initializes a functional by id with nspin spin channels ∗/ i n t x c f u n c i n i t ( x c f u n c t y p e ∗p , i n t functional , i n t n s p i n ) ; /∗∗ Destructor for an initialized functional ∗/ v o i d x c f u n c e n d ( x c f u n c t y p e ∗p ) ; GPAW 2021: Users' and Developers' Meeting Susi Lehtola Using Libxc 17/28 External parameters Parameters need to be adjustable to e.g. tune the range-separation parameter for ionization potential tuning [Annu. Rev. Phys. Chem. 61, 85 (2010)] or triplet tuning [J. Chem. Theory Comput. 15, 1226 (2019)] I Parameters like µ and κ for PBE exchange can be set for many functionals with /∗∗ Sets all external parameters for a functional ∗/ v o i d x c f u n c s e t e x t p a r a m s ( x c f u n c t y p e ∗p , const double ∗ e x t p a r a m s ) ; /∗∗ Sets an external parameter by name for a functional ∗/ v o i d x c f u n c s e t e x t p a r a m s n a m e ( x c f u n c t y p e ∗p , const char ∗name , double par ) ; I N.B. in libxc <6.0.0 xc func set ext params name resets all other parameters to default values GPAW 2021: Users' and Developers' Meeting Susi Lehtola Using Libxc 18/28 Evaluation of functionals I Many routines exist for evaluating functionals; e.g. these for the energy and its 1st derivative /∗∗ Evaluates the energy density and its first derivative for an LDA functional ∗/ v o i d x c l d a e x c v x c ( const x c f u n c t y p e ∗p , s i z e t np , const double ∗rho , double ∗zk , double ∗ vrho ) ; /∗∗ Evaluates the energy density and its first derivative for a GGA functional ∗/ v o i d x c g g a e x c v x c ( const x c f u n c t y p e ∗p , s i z e t np , const double ∗rho , const double ∗sigma , double ∗zk , double ∗vrho , double ∗ vsigma ) ; /∗∗ Evaluates the energy density and its first derivative for a meta−GGA functional ∗/ v o i d x c m g g a e x c v x c ( const x c f u n c t y p e ∗p , s i z e t np , const double ∗rho , const double ∗sigma , const double ∗ l a p l , const double ∗tau , double ∗zk , double ∗vrho , double ∗vsigma , double ∗ v l a p l , double ∗ vtau ) ; I p is pointer to previously initialized instance I np is number of grid points I rho is electron density np−1 I spin-restricted i.e.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    28 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us