13 REAL(
dp),
DIMENSION(4) :: occ, eig, weight, expected
15 eig = [-1.0_dp, -0.1_dp, 0.0_dp, 0.2_dp]
16 occ = [2.0_dp, 1.6_dp, 1.0_dp, 0.2_dp]
17 expected = [0.0_dp, 0.4_dp, 1.0_dp, 0.2_dp]
19 IF (maxval(abs(weight - expected)) > 1.0e-14_dp) error stop
"Restricted FOD weights"
20 weight =
fod_weights(0.5_dp*occ, eig, 0.0_dp, 1.0_dp)
21 IF (maxval(abs(2.0_dp*weight - expected)) > 1.0e-14_dp) error stop
"Unrestricted FOD weights"
24 eig = [0.1_dp, 0.2_dp, 0.3_dp, 0.4_dp]
25 occ = [0.4_dp, 0.3_dp, 0.2_dp, 0.1_dp]
27 IF (maxval(abs(weight - occ)) > 1.0e-14_dp) error stop
"FOD must use the chemical potential"
28 weight =
fod_weights(occ(4:1:-1), eig(4:1:-1), 0.0_dp, 1.0_dp)
29 IF (maxval(abs(weight - occ(4:1:-1))) > 1.0e-14_dp) error stop
"FOD orbital permutation"
32 eig = [-2.0_dp, -1.0_dp, 1.0_dp, 2.0_dp]
33 occ = [2.0_dp, 2.0_dp, 0.0_dp, 0.0_dp]
34 weight =
fod_weights(occ, eig + 3.0_dp, 3.0_dp, 2.0_dp)
35 IF (any(weight /= 0.0_dp)) error stop
"Integer occupations should have no FOD"
Defines the basic variable types.
integer, parameter, public dp
Fractional occupation number weighted density (Grimme and Hansen).
pure real(dp) function, dimension(size(occupation)), public fod_weights(occupation, eigenvalues, mu, maxocc)
Hole weights below the chemical potential, particle weights above it.