From e11d1a94dde9dd5cea16c15a5411eb489554a3f5 Mon Sep 17 00:00:00 2001 From: Pierre-Francois Loos Date: Mon, 6 Apr 2020 23:34:49 +0200 Subject: [PATCH] GIC functional working --- input/basis | 65 +++++++++++-------- input/dft | 8 +-- input/molecule | 5 +- input/molecule.xyz | 5 +- input/weight | 65 +++++++++++-------- ..._lda_exchange_derivative_discontinuity.f90 | 10 ++- 6 files changed, 96 insertions(+), 62 deletions(-) diff --git a/input/basis b/input/basis index f19a2d0..dc1936c 100644 --- a/input/basis +++ b/input/basis @@ -1,30 +1,43 @@ -1 6 -S 8 - 1 17880.0000000 0.0007380 - 2 2683.0000000 0.0056770 - 3 611.5000000 0.0288830 - 4 173.5000000 0.1085400 - 5 56.6400000 0.2909070 - 6 20.4200000 0.4483240 - 7 7.8100000 0.2580260 - 8 1.6530000 0.0150630 -S 8 - 1 17880.0000000 -0.0001720 - 2 2683.0000000 -0.0013570 - 3 611.5000000 -0.0067370 - 4 173.5000000 -0.0276630 - 5 56.6400000 -0.0762080 - 6 20.4200000 -0.1752270 - 7 7.8100000 -0.1070380 - 8 1.6530000 0.5670500 +1 9 +S 3 + 1 33.8700000 0.0060680 + 2 5.0950000 0.0453080 + 3 1.1590000 0.2028220 S 1 - 1 0.4869000 1.0000000 -P 3 - 1 28.3900000 0.0460870 - 2 6.2700000 0.2401810 - 3 1.6950000 0.5087440 + 1 0.3258000 1.0000000 +S 1 + 1 0.1027000 1.0000000 +S 1 + 1 0.0252600 1.0000000 P 1 - 1 0.4317000 1.0000000 + 1 1.4070000 1.0000000 +P 1 + 1 0.3880000 1.0000000 +P 1 + 1 0.1020000 1.0000000 D 1 - 1 2.2020000 1.0000000 + 1 1.0570000 1.0000000 +D 1 + 1 0.2470000 1.0000000 +2 9 +S 3 + 1 33.8700000 0.0060680 + 2 5.0950000 0.0453080 + 3 1.1590000 0.2028220 +S 1 + 1 0.3258000 1.0000000 +S 1 + 1 0.1027000 1.0000000 +S 1 + 1 0.0252600 1.0000000 +P 1 + 1 1.4070000 1.0000000 +P 1 + 1 0.3880000 1.0000000 +P 1 + 1 0.1020000 1.0000000 +D 1 + 1 1.0570000 1.0000000 +D 1 + 1 0.2470000 1.0000000 diff --git a/input/dft b/input/dft index 617161f..0129234 100644 --- a/input/dft +++ b/input/dft @@ -2,23 +2,23 @@ GOK-RKS # exchange rung: # Hartree = 0 -# LDA = 1: RS51,RMFL20,RGIC +# LDA = 1: RS51,RMFL20 # GGA = 2: RB88 # Hybrid = 4 # Hartree-Fock = 666 - 2 RB88 + 1 RGIC # correlation rung: # Hartree = 0 # LDA = 1: RVWN5,RMFL20 # GGA = 2: # Hybrid = 4: # Hartree-Fock = 666 - 1 RVWN5 + 0 H # quadrature grid SG-n 1 # Number of states in ensemble (nEns) 2 # Ensemble weights: wEns(1),...,wEns(nEns-1) - 0.0 + 0.625 # GOK-DFT: maxSCF thresh DIIS n_diis guess_type ortho_type 32 0.00001 T 5 1 1 diff --git a/input/molecule b/input/molecule index edeba31..8076140 100644 --- a/input/molecule +++ b/input/molecule @@ -1,4 +1,5 @@ # nAt nEla nElb nCore nRyd - 1 5 5 0 0 + 2 1 1 0 0 # Znuc x y z - Ne 0.0 0.0 0.0 + H 0.0 0.0 0.0 + H 0.0 0.0 1.4 diff --git a/input/molecule.xyz b/input/molecule.xyz index 1c70680..6edc99d 100644 --- a/input/molecule.xyz +++ b/input/molecule.xyz @@ -1,3 +1,4 @@ - 1 + 2 - Ne 0.0000000000 0.0000000000 0.0000000000 + H 0.0000000000 0.0000000000 0.0000000000 + H 0.0000000000 0.0000000000 0.7408481486 diff --git a/input/weight b/input/weight index f19a2d0..dc1936c 100644 --- a/input/weight +++ b/input/weight @@ -1,30 +1,43 @@ -1 6 -S 8 - 1 17880.0000000 0.0007380 - 2 2683.0000000 0.0056770 - 3 611.5000000 0.0288830 - 4 173.5000000 0.1085400 - 5 56.6400000 0.2909070 - 6 20.4200000 0.4483240 - 7 7.8100000 0.2580260 - 8 1.6530000 0.0150630 -S 8 - 1 17880.0000000 -0.0001720 - 2 2683.0000000 -0.0013570 - 3 611.5000000 -0.0067370 - 4 173.5000000 -0.0276630 - 5 56.6400000 -0.0762080 - 6 20.4200000 -0.1752270 - 7 7.8100000 -0.1070380 - 8 1.6530000 0.5670500 +1 9 +S 3 + 1 33.8700000 0.0060680 + 2 5.0950000 0.0453080 + 3 1.1590000 0.2028220 S 1 - 1 0.4869000 1.0000000 -P 3 - 1 28.3900000 0.0460870 - 2 6.2700000 0.2401810 - 3 1.6950000 0.5087440 + 1 0.3258000 1.0000000 +S 1 + 1 0.1027000 1.0000000 +S 1 + 1 0.0252600 1.0000000 P 1 - 1 0.4317000 1.0000000 + 1 1.4070000 1.0000000 +P 1 + 1 0.3880000 1.0000000 +P 1 + 1 0.1020000 1.0000000 D 1 - 1 2.2020000 1.0000000 + 1 1.0570000 1.0000000 +D 1 + 1 0.2470000 1.0000000 +2 9 +S 3 + 1 33.8700000 0.0060680 + 2 5.0950000 0.0453080 + 3 1.1590000 0.2028220 +S 1 + 1 0.3258000 1.0000000 +S 1 + 1 0.1027000 1.0000000 +S 1 + 1 0.0252600 1.0000000 +P 1 + 1 1.4070000 1.0000000 +P 1 + 1 0.3880000 1.0000000 +P 1 + 1 0.1020000 1.0000000 +D 1 + 1 1.0570000 1.0000000 +D 1 + 1 0.2470000 1.0000000 diff --git a/src/eDFT/RGIC_lda_exchange_derivative_discontinuity.f90 b/src/eDFT/RGIC_lda_exchange_derivative_discontinuity.f90 index 3f27dd2..00eda1f 100644 --- a/src/eDFT/RGIC_lda_exchange_derivative_discontinuity.f90 +++ b/src/eDFT/RGIC_lda_exchange_derivative_discontinuity.f90 @@ -18,7 +18,7 @@ subroutine RGIC_lda_exchange_derivative_discontinuity(nEns,wEns,nGrid,weight,rho integer :: iEns,jEns integer :: iG double precision :: r - double precision :: dExdw(nEns) + double precision,allocatable :: dExdw(:) double precision,external :: Kronecker_delta double precision :: a,b,c,w @@ -28,6 +28,10 @@ subroutine RGIC_lda_exchange_derivative_discontinuity(nEns,wEns,nGrid,weight,rho double precision,intent(out) :: ExDD(nEns) +! Memory allocation + + allocate(dExdw(nEns)) + ! Compute correlation energy for ground- and doubly-excited states a = + 0.5751782560799208d0 @@ -35,7 +39,7 @@ subroutine RGIC_lda_exchange_derivative_discontinuity(nEns,wEns,nGrid,weight,rho c = - 0.36718902716347124d0 w = wEns(2) - dCxGICdw = (0.5d0*b + (2d0*a + 0.5d0*c)*(w - 0.5d0) - (1d0 - w)*w*(3d0*b + 4d0*c*(w - 0.5d0))) + dCxGICdw = - (0.5d0*b + (2d0*a + 0.5d0*c)*(w - 0.5d0) - (1d0 - w)*w*(3d0*b + 4d0*c*(w - 0.5d0))) dCxGICdw = CxLDA*dCxGICdw dExdw(:) = 0d0 @@ -53,6 +57,8 @@ subroutine RGIC_lda_exchange_derivative_discontinuity(nEns,wEns,nGrid,weight,rho end do + ExDD(:) = 0d0 + do iEns=1,nEns do jEns=2,nEns