2 ! Copyright (C) 2007-2008 J. K. Dewhurst, S. Sharma and E. K. U. Gross.
3 ! This file is distributed under the terms of the GNU General Public License.
4 ! See the file COPYING for license details.
6 subroutine rdmdexcdn(dedn
)
7 ! calculates derivative of exchange-correlation energy w.r.t. occupation numbers
11 real(8), intent(inout
) :: dedn(nstsv
,nkpt
)
14 integer ist1
,ist2
,iv(3)
15 ! parameter for calculating the functional derivatives
16 real(8), parameter :: eps
=1.d
-12
21 if (rdmxctype
.eq
.0) return
23 ! calculate the pre-factor
24 if (rdmxctype
.eq
.1) then
26 else if (rdmxctype
.eq
.2) then
30 t1
=2.d0
*rdmalpha
*(0.25d0)**rdmalpha
34 write(*,'("Error(rdmdexcdn): rdmxctype not defined : ",I8)') rdmxctype
42 ! find the equivalent reduced k-point
44 ik3
=ikmap(iv(1),iv(2),iv(3))
46 ! Hartree-Fock functional
47 if (rdmxctype
.eq
.1) then
50 else if (rdmxctype
.eq
.2) then
51 t3
=max(occsv(ist1
,ik1
),eps
)
52 t4
=max(occsv(ist2
,ik3
),eps
)
53 t2
=t1
*(t4
**rdmalpha
)/(t3
**(1.d0
-rdmalpha
))
55 dedn(ist1
,ik1
)=dedn(ist1
,ik1
)+t2
*vnlrdm(ist1
,ik1
,ist2
,ik2
)