libxc a library of exchange and correlation functionals

Download Libxc a library of exchange and correlation functionals

If you can't read please download the document

Upload: abderrahmane-reggad

Post on 18-Jan-2017

39 views

Category:

Science


3 download

TRANSCRIPT

  • Libxca library of exchange and correlation functionals

    Miguel A. L. Marques

    1LPMCN, Universite Claude Bernard Lyon 1 and CNRS, France2European Theoretical Spectroscopy Facility

    March 2009 ABINIT Workshop

    M. A. L. Marques Libxc

  • Why the need for libxc?

    The xc functional is at the heart of DFTThere are many approximations for the xc (probably of theorder of 150200)Most computer codes only include a very limited quantityof functionals, typically around 1015Chemist and Physicists do not use the same functionals!

    Difficult to reproduce older calculations with olderfunctionalsDifficult to reproduce calculations performed with othercodesDifficult to perform calculations with the newest functionals

    M. A. L. Marques Libxc

  • Why the need for libxc?

    The xc functional is at the heart of DFTThere are many approximations for the xc (probably of theorder of 150200)Most computer codes only include a very limited quantityof functionals, typically around 1015Chemist and Physicists do not use the same functionals!

    Difficult to reproduce older calculations with olderfunctionalsDifficult to reproduce calculations performed with othercodesDifficult to perform calculations with the newest functionals

    M. A. L. Marques Libxc

  • Why the need for libxc?

    The xc functional is at the heart of DFTThere are many approximations for the xc (probably of theorder of 150200)Most computer codes only include a very limited quantityof functionals, typically around 1015Chemist and Physicists do not use the same functionals!

    Difficult to reproduce older calculations with olderfunctionalsDifficult to reproduce calculations performed with othercodesDifficult to perform calculations with the newest functionals

    M. A. L. Marques Libxc

  • Why the need for libxc?

    The xc functional is at the heart of DFTThere are many approximations for the xc (probably of theorder of 150200)Most computer codes only include a very limited quantityof functionals, typically around 1015Chemist and Physicists do not use the same functionals!

    Difficult to reproduce older calculations with olderfunctionalsDifficult to reproduce calculations performed with othercodesDifficult to perform calculations with the newest functionals

    M. A. L. Marques Libxc

  • Why the need for libxc?

    The xc functional is at the heart of DFTThere are many approximations for the xc (probably of theorder of 150200)Most computer codes only include a very limited quantityof functionals, typically around 1015Chemist and Physicists do not use the same functionals!

    Difficult to reproduce older calculations with olderfunctionalsDifficult to reproduce calculations performed with othercodesDifficult to perform calculations with the newest functionals

    M. A. L. Marques Libxc

  • Why the need for libxc?

    The xc functional is at the heart of DFTThere are many approximations for the xc (probably of theorder of 150200)Most computer codes only include a very limited quantityof functionals, typically around 1015Chemist and Physicists do not use the same functionals!

    Difficult to reproduce older calculations with olderfunctionalsDifficult to reproduce calculations performed with othercodesDifficult to perform calculations with the newest functionals

    M. A. L. Marques Libxc

  • Why the need for libxc?

    The xc functional is at the heart of DFTThere are many approximations for the xc (probably of theorder of 150200)Most computer codes only include a very limited quantityof functionals, typically around 1015Chemist and Physicists do not use the same functionals!

    Difficult to reproduce older calculations with olderfunctionalsDifficult to reproduce calculations performed with othercodesDifficult to perform calculations with the newest functionals

    M. A. L. Marques Libxc

  • Kohn-Sham equations

    The main equations of DFT are the Kohn-Sham equations:[1

    22 + vext(r) + vH(r) + vxc(r)

    ]i(r) = ii(r)

    where the exchange-correlation potential is defined as

    vxc(r) =Excn(r)

    In any practical application of the theory, we have to use anapproximation to Exc, or vxc(r).

    M. A. L. Marques Libxc

  • Kohn-Sham equations

    The main equations of DFT are the Kohn-Sham equations:[1

    22 + vext(r) + vH(r) + vxc(r)

    ]i(r) = ii(r)

    where the exchange-correlation potential is defined as

    vxc(r) =Excn(r)

    In any practical application of the theory, we have to use anapproximation to Exc, or vxc(r).

    M. A. L. Marques Libxc

  • Jacobs ladder

    Local density approximation:

    ELDAxc (r) = ELDAxc [n]

    n=n(r)

    Generalized gradient approximation:

    EGGAxc (r) = EGGAxc [n,n]

    n=n(r)

    Meta-generalized gradient approximation:

    EmGGAxc (r) = EmGGAxc [n,n, ]

    n=n(r),=(r)

    And more: orbital functionals, hybrid functionals, hyper-GGAs,etc.

    M. A. L. Marques Libxc

  • Jacobs ladder

    Local density approximation:

    ELDAxc (r) = ELDAxc [n]

    n=n(r)

    Generalized gradient approximation:

    EGGAxc (r) = EGGAxc [n,n]

    n=n(r)

    Meta-generalized gradient approximation:

    EmGGAxc (r) = EmGGAxc [n,n, ]

    n=n(r),=(r)

    And more: orbital functionals, hybrid functionals, hyper-GGAs,etc.

    M. A. L. Marques Libxc

  • Jacobs ladder

    Local density approximation:

    ELDAxc (r) = ELDAxc [n]

    n=n(r)

    Generalized gradient approximation:

    EGGAxc (r) = EGGAxc [n,n]

    n=n(r)

    Meta-generalized gradient approximation:

    EmGGAxc (r) = EmGGAxc [n,n, ]

    n=n(r),=(r)

    And more: orbital functionals, hybrid functionals, hyper-GGAs,etc.

    M. A. L. Marques Libxc

  • Jacobs ladder

    Local density approximation:

    ELDAxc (r) = ELDAxc [n]

    n=n(r)

    Generalized gradient approximation:

    EGGAxc (r) = EGGAxc [n,n]

    n=n(r)

    Meta-generalized gradient approximation:

    EmGGAxc (r) = EmGGAxc [n,n, ]

    n=n(r),=(r)

    And more: orbital functionals, hybrid functionals, hyper-GGAs,etc.

    M. A. L. Marques Libxc

  • What do we need? - I

    The energy is usually written as:

    Exc =

    d3r exc(r) =

    d3r n(r)xc(r)

    The potential in the LDA is:

    vLDAxc (r) =ddn

    eLDAxc (n)n=n(r)

    In the GGA:

    vGGAxc (r) =

    neLDAxc (n,n)

    n=n(r)

    (n)

    eLDAxc (n,n)n=n(r)

    M. A. L. Marques Libxc

  • What do we need? - II

    For response properties we also need higher derivatives of exc

    1st-order response (polarizabilities, phonon frequencies,etc.):

    f LDAxc (r) =d2

    d2neLDAxc (n)

    n=n(r)

    2st-order response (hyperpolarizabilities, etc.):

    kLDAxc (r) =d3

    d3neLDAxc (n)

    n=n(r)

    And lets not forget spin...

    M. A. L. Marques Libxc

  • What do we need? - II

    For response properties we also need higher derivatives of exc

    1st-order response (polarizabilities, phonon frequencies,etc.):

    f LDAxc (r) =d2

    d2neLDAxc (n)

    n=n(r)

    2st-order response (hyperpolarizabilities, etc.):

    kLDAxc (r) =d3

    d3neLDAxc (n)

    n=n(r)

    And lets not forget spin...

    M. A. L. Marques Libxc

  • An example: Perdew & Wang 91 (an LDA)

    Perdew and Wang parametrized the correlation energy per unitparticle:

    ec(rs, ) = ec(rs,0) + c(rs)f ()f (0)

    (1 4) + [ec(rs,1) ec(rs,0)]f ()4

    The function f () is

    f () =[1 + ]4/3 + [1 ]4/3 2

    24/3 2,

    while its second derivative f (0) = 1.709921. The functions ec(rs,0),ec(rs,1), and c(rs) are all parametrized by the function

    g = 2A(1 + 1rs) log

    {1 +

    1

    2A(1r1/2s + 2rs + 3r

    3/2s + 4r2s )

    }

    M. A. L. Marques Libxc

  • Libxc

    Written in C from scratchBindings both in C and in FortranLesser GNU general public license (v. 3.0)Automatic testing of the functionalsContains at the moment 19 LDA functionals, 55 GGAfunctionals, 24 hybrids, and 7 mGGAsContains functionals for 1D, 2D, and 3D calculationsReturns xc, vxc, fxc, and kxcQuite mature: included in octopus, APE, GPAW, ABINIT,and in the GW code of Murilo Tiago

    M. A. L. Marques Libxc

  • Libxc

    Written in C from scratchBindings both in C and in FortranLesser GNU general public license (v. 3.0)Automatic testing of the functionalsContains at the moment 19 LDA functionals, 55 GGAfunctionals, 24 hybrids, and 7 mGGAsContains functionals for 1D, 2D, and 3D calculationsReturns xc, vxc, fxc, and kxcQuite mature: included in octopus, APE, GPAW, ABINIT,and in the GW code of Murilo Tiago

    M. A. L. Marques Libxc

  • Libxc

    Written in C from scratchBindings both in C and in FortranLesser GNU general public license (v. 3.0)Automatic testing of the functionalsContains at the moment 19 LDA functionals, 55 GGAfunctionals, 24 hybrids, and 7 mGGAsContains functionals for 1D, 2D, and 3D calculationsReturns xc, vxc, fxc, and kxcQuite mature: included in octopus, APE, GPAW, ABINIT,and in the GW code of Murilo Tiago

    M. A. L. Marques Libxc

  • Libxc

    Written in C from scratchBindings both in C and in FortranLesser GNU general public license (v. 3.0)Automatic testing of the functionalsContains at the moment 19 LDA functionals, 55 GGAfunctionals, 24 hybrids, and 7 mGGAsContains functionals for 1D, 2D, and 3D calculationsReturns xc, vxc, fxc, and kxcQuite mature: included in octopus, APE, GPAW, ABINIT,and in the GW code of Murilo Tiago

    M. A. L. Marques Libxc

  • Libxc

    Written in C from scratchBindings both in C and in FortranLesser GNU general public license (v. 3.0)Automatic testing of the functionalsContains at the moment 19 LDA functionals, 55 GGAfunctionals, 24 hybrids, and 7 mGGAsContains functionals for 1D, 2D, and 3D calculationsReturns xc, vxc, fxc, and kxcQuite mature: included in octopus, APE, GPAW, ABINIT,and in the GW code of Murilo Tiago

    M. A. L. Marques Libxc

  • Libxc

    Written in C from scratchBindings both in C and in FortranLesser GNU general public license (v. 3.0)Automatic testing of the functionalsContains at the moment 19 LDA functionals, 55 GGAfunctionals, 24 hybrids, and 7 mGGAsContains functionals for 1D, 2D, and 3D calculationsReturns xc, vxc, fxc, and kxcQuite mature: included in octopus, APE, GPAW, ABINIT,and in the GW code of Murilo Tiago

    M. A. L. Marques Libxc

  • Libxc

    Written in C from scratchBindings both in C and in FortranLesser GNU general public license (v. 3.0)Automatic testing of the functionalsContains at the moment 19 LDA functionals, 55 GGAfunctionals, 24 hybrids, and 7 mGGAsContains functionals for 1D, 2D, and 3D calculationsReturns xc, vxc, fxc, and kxcQuite mature: included in octopus, APE, GPAW, ABINIT,and in the GW code of Murilo Tiago

    M. A. L. Marques Libxc

  • Libxc

    Written in C from scratchBindings both in C and in FortranLesser GNU general public license (v. 3.0)Automatic testing of the functionalsContains at the moment 19 LDA functionals, 55 GGAfunctionals, 24 hybrids, and 7 mGGAsContains functionals for 1D, 2D, and 3D calculationsReturns xc, vxc, fxc, and kxcQuite mature: included in octopus, APE, GPAW, ABINIT,and in the GW code of Murilo Tiago

    M. A. L. Marques Libxc

  • What is working!

    xc vxc fxc kxc

    LDA OK OK OK OKGGA OK OK PARTIAL NOHYB GGA OK OK PARTIAL NOmGGA TEST TEST NO NO

    M. A. L. Marques Libxc

  • An example in C

    swi tch ( x c f a m i l y f r o m i d ( xc . f u n c t i o n a l ) ){case XC FAMILY LDA :

    i f ( xc . f u n c t i o n a l == XC LDA X )x c l d a x i n i t (& lda func , xc . nspin , 3 , 0 ) ;

    e lsex c l d a i n i t (& lda func , xc . f u n c t i o n a l , xc . nspin ) ;

    xc lda vxc (& lda func , xc . rho , &xc . zk , xc . vrho ) ;xc lda end (& lda func ) ;break ;

    case XC FAMILY GGA :x c g g a i n i t (& gga func , xc . f u n c t i o n a l , xc . nspin ) ;xc gga vxc (& gga func , xc . rho , xc . sigma , &xc . zk , xc . vrho , xc . vsigma ) ;xc gga end (& gga func ) ;break ;

    d e f a u l t :f p r i n t f ( s tde r r , "Functional %d not found\n" , xc . f u n c t i o n a l ) ;e x i t ( 1 ) ;

    }

    M. A. L. Marques Libxc

  • Another example in Fortran

    program l x c t e s tuse l i b x c

    i m p l i c i t none

    r e a l ( 8 ) : : rho , e c , v c

    TYPE( xc func ) : : xc c funcTYPE( x c i n f o ) : : x c c i n f o

    CALL x c f 9 0 l d a i n i t ( xc c func , x c c i n f o , &XC LDA C VWN, XC UNPOLARIZED)

    CALL x c f 90 l d a v xc ( xc c func , rho , e c , v c )CALL xc f90 lda end ( xc c func )

    end program l x c t e s t

    M. A. L. Marques Libxc

  • The info structure

    typedef s t r u c t {i n t number ; / i n d e n t i f i e r number /i n t k ind ; / XC EXCHANGE or XC CORRELATION /

    char name ; / name of the f u n c t i o n a l , e . g . PBE /i n t f a m i l y ; / type o f the f u n c t i o n a l , e . g . XC FAMILY GGA /char r e f s ; / re ferences /

    i n t prov ides ; / e . g . XC PROVIDES EXC | XC PROVIDES VXC /. . .

    } x c f u n c i n f o t y p e ;

    This is an example on how you can use it:

    xc gga type b88 ;

    x c g g a i n i t (&b88 , XC GGA X B88 , XC UNPOLARIZED ) ;p r i n t f ("The functional %s is defined in the reference(s):\n%s" ,

    b88 . i n fo>name, b88 . i n fo>r e f s ) ;xc gga end (&b88 ) ;

    M. A. L. Marques Libxc

  • The future

    More functionals!More derivatives!More codes using it!

    M. A. L. Marques Libxc

  • The future

    More functionals!More derivatives!More codes using it!

    M. A. L. Marques Libxc

  • The future

    More functionals!More derivatives!More codes using it!

    M. A. L. Marques Libxc

  • Where to find us!

    http://www.tddft.org/programs/octopus/wiki/index.php/Libxc

    Comput. Phys. Commun. 151, 6078 (2003)

    Phys. Stat. Sol. B 243, 24652488 (2006)

    M. A. L. Marques Libxc

    http://www.tddft.org/programs/octopus/wiki/index.php/Libxchttp://www.tddft.org/programs/octopus/wiki/index.php/Libxc