The Elk Code
xc_vbh.f90
Go to the documentation of this file.
1 
2 ! Copyright (C) 2002-2005 F. Cricchio, J. K. Dewhurst and S. Sharma.
3 ! This file is distributed under the terms of the GNU Lesser General Public
4 ! License. See the file COPYING for license details.
5 
6 !BOP
7 ! !ROUTINE: xc_vbh
8 ! !INTERFACE:
9 subroutine xc_vbh(n,rhoup,rhodn,ex,ec,vxup,vxdn,vcup,vcdn)
10 ! !INPUT/OUTPUT PARAMETERS:
11 ! n : number of density points (in,integer)
12 ! rhoup : spin-up charge density (in,real(n))
13 ! rhodn : spin-down charge density (in,real(n))
14 ! ex : exchange energy density (out,real(n))
15 ! ec : correlation energy density (out,real(n))
16 ! vxup : spin-up exchange potential (out,real(n))
17 ! vxdn : spin-down exchange potential (out,real(n))
18 ! vcup : spin-up correlation potential (out,real(n))
19 ! vcdn : spin-down correlation potential (out,real(n))
20 ! !DESCRIPTION:
21 ! Spin-polarised exchange-correlation potential and energy functional of
22 ! von Barth and Hedin: {\it J. Phys. C} {\bf 5}, 1629 (1972). Note that the
23 ! implementation is in Rydbergs in order to follow the paper step by step, at
24 ! the end the potential and energy are converted to Hartree.
25 !
26 ! !REVISION HISTORY:
27 ! Created September 2007 (F. Cricchio)
28 !EOP
29 !BOC
30 implicit none
31 ! arguments
32 integer, intent(in) :: n
33 real(8), intent(in) :: rhoup(n),rhodn(n)
34 real(8), intent(out) :: ex(n),ec(n)
35 real(8), intent(out) :: vxup(n),vxdn(n)
36 real(8), intent(out) :: vcup(n),vcdn(n)
37 ! local variables
38 integer i
39 real(8), parameter :: pi=3.1415926535897932385d0
40 real(8), parameter :: cp=0.0504d0
41 real(8), parameter :: cf=0.0254d0
42 real(8), parameter :: rp=30.d0
43 real(8), parameter :: rf=75.d0
44 real(8) alpha0,eps0_x,a,gamma
45 real(8) rup,rdn,r,rs,x,zf,zp
46 real(8) fx,fp,ff,epsp_x,mup_x
47 real(8) epsp_c,epsf_c,mup_c,muf_c,vc,tau_c
48 alpha0=(4.d0/(9.d0*pi))**(1.d0/3.d0)
49 eps0_x=(3.d0/2.d0)/(pi*alpha0)
50 a=2.d0**(-1.d0/3.d0)
51 gamma=(4.d0/3.d0)*a/(1.d0-a)
52 do i=1,n
53  rup=rhoup(i); rdn=rhodn(i)
54 ! total density
55  r=rup+rdn
56  if ((rup >= 0.d0).and.(rdn >= 0.d0).and.(r > 1.d-12)) then
57 ! Wigner-Seitz radius in atomic units (a0=1)
58  rs=(3.d0/(4.d0*pi*r))**(1.d0/3.d0)
59  x=rup/r
60  fx=(1.d0/(1.d0-a))*(x**(4.d0/3.d0)+(1.d0-x)**(4.d0/3.d0)-a)
61  epsp_x=-eps0_x/rs
62  mup_x=(4.d0/3.d0)*epsp_x
63 ! exchange energy
64  ex(i)=epsp_x+(1.d0/gamma)*mup_x*fx
65  zp=rs/rp
66  fp=(1.d0+zp**3)*log(1.d0+1.d0/zp)+0.5d0*zp-zp**2-1.d0/3.d0
67  zf=rs/rf
68  ff=(1.d0+zf**3)*log(1.d0+1.d0/zf)+0.5d0*zf-zf**2-1.d0/3.d0
69  epsp_c=-cp*fp
70  epsf_c=-cf*ff
71  vc=gamma*(epsf_c-epsp_c)
72 ! correlation energy
73  ec(i)=epsp_c+(1.d0/gamma)*vc*fx
74  mup_c=-cp*log(1.d0+rp/rs)
75  muf_c=-cf*log(1.d0+rf/rs)
76  tau_c=muf_c-mup_c-(4.d0/3.d0)*(epsf_c-epsp_c)
77 ! exchange potential
78  vxup(i)=mup_x*(2.d0*x)**(1.d0/3.d0)
79  vxdn(i)=mup_x*(2.d0*(1.d0-x))**(1.d0/3.d0)
80 ! correlation potential
81  vcup(i)=vc*(2.d0*x)**(1.d0/3.d0)+mup_c-vc+tau_c*fx
82  vcdn(i)=vc*(2.d0*(1.d0-x))**(1.d0/3.d0)+mup_c-vc+tau_c*fx
83 ! convert from Rybergs to Hartree
84  ex(i)=0.5d0*ex(i)
85  ec(i)=0.5d0*ec(i)
86  vxup(i)=0.5d0*vxup(i)
87  vxdn(i)=0.5d0*vxdn(i)
88  vcup(i)=0.5d0*vcup(i)
89  vcdn(i)=0.5d0*vcdn(i)
90  else
91  ex(i)=0.d0
92  ec(i)=0.d0
93  vxup(i)=0.d0
94  vxdn(i)=0.d0
95  vcup(i)=0.d0
96  vcdn(i)=0.d0
97  end if
98 end do
99 end subroutine
100 !EOC
101 
subroutine xc_vbh(n, rhoup, rhodn, ex, ec, vxup, vxdn, vcup, vcdn)
Definition: xc_vbh.f90:10