From b0413b1d139550cd7de1742059716f5b16ccd0ae Mon Sep 17 00:00:00 2001 From: Pierre-Francois Loos Date: Wed, 24 Nov 2021 11:53:25 +0100 Subject: [PATCH] clean up CC-S51 functional --- ..._lda_exchange_derivative_discontinuity.f90 | 7 ++-- src/eDFT/UCC_lda_exchange_energy.f90 | 36 +++---------------- .../UCC_lda_exchange_individual_energy.f90 | 7 ++-- src/eDFT/UCC_lda_exchange_potential.f90 | 31 ++-------------- 4 files changed, 14 insertions(+), 67 deletions(-) diff --git a/src/eDFT/UCC_lda_exchange_derivative_discontinuity.f90 b/src/eDFT/UCC_lda_exchange_derivative_discontinuity.f90 index c8afe3c..a8b0d1a 100644 --- a/src/eDFT/UCC_lda_exchange_derivative_discontinuity.f90 +++ b/src/eDFT/UCC_lda_exchange_derivative_discontinuity.f90 @@ -44,14 +44,13 @@ subroutine UCC_lda_exchange_derivative_discontinuity(nEns,wEns,nCC,aCC,nGrid,wei allocate(dExdw(nEns)) -! Parameters for N -> N-1 +! Parameters for first state a1 = aCC(1,1) b1 = aCC(2,1) c1 = aCC(3,1) - -! Parameters for N -> N+1 +! Parameters for second state a2 = aCC(1,2) b2 = aCC(2,2) @@ -60,6 +59,7 @@ subroutine UCC_lda_exchange_derivative_discontinuity(nEns,wEns,nCC,aCC,nGrid,wei w1 = wEns(2) w2 = wEns(3) +! Defining enhancements factor for weight-dependent functionals if (doNcentered) then @@ -88,7 +88,6 @@ subroutine UCC_lda_exchange_derivative_discontinuity(nEns,wEns,nCC,aCC,nGrid,wei else - select case (Cx_choice) case(1) diff --git a/src/eDFT/UCC_lda_exchange_energy.f90 b/src/eDFT/UCC_lda_exchange_energy.f90 index 392a5e4..5bc917d 100644 --- a/src/eDFT/UCC_lda_exchange_energy.f90 +++ b/src/eDFT/UCC_lda_exchange_energy.f90 @@ -30,44 +30,19 @@ subroutine UCC_lda_exchange_energy(nEns,wEns,nCC,aCC,nGrid,weight,rho,Cx_choice, double precision :: Ex -! Single excitation parameter - -! a1 = 0.0d0 -! b1 = 0.0d0 -! c1 = 0.0d0 - -! Parameters for H2 at equilibrium - -! a2 = +0.5751782560799208d0 -! b2 = -0.021108186591137282d0 -! c2 = -0.36718902716347124d0 - -! Parameters for stretch H2 - -! a2 = + 0.01922622507087411d0 -! b2 = - 0.01799647558018601d0 -! c2 = - 0.022945430666782573d0 - -! Parameters for He - -! a2 = 1.9125735895875828d0 -! b2 = 2.715266992840757d0 -! c2 = 2.1634223380633086d0 - -! Parameters for He N -> N-1 +! Parameters for first state a1 = aCC(1,1) b1 = aCC(2,1) c1 = aCC(3,1) -! Parameters for He N -> N+1 +! Parameters for second state a2 = aCC(1,2) b2 = aCC(2,2) c2 = aCC(3,2) -! Fx1 for states N and N-1 -! Fx2 for states N and N+1 +! Defining enhancements factor for weight-dependent functionals if(doNcentered) then @@ -79,7 +54,6 @@ subroutine UCC_lda_exchange_energy(nEns,wEns,nCC,aCC,nGrid,weight,rho,Cx_choice, else - w1 = wEns(2) Fx1 = 1d0 - w1*(1d0 - w1)*(a1 + b1*(w1 - 0.5d0) + c1*(w1 - 0.5d0)**2) @@ -112,9 +86,7 @@ subroutine UCC_lda_exchange_energy(nEns,wEns,nCC,aCC,nGrid,weight,rho,Cx_choice, r = max(0d0,rho(iG)) - if(r > threshold) then - Ex = Ex + weight(iG)*Cx*r**(4d0/3d0) - endif + if(r > threshold) Ex = Ex + weight(iG)*Cx*r**(4d0/3d0) enddo diff --git a/src/eDFT/UCC_lda_exchange_individual_energy.f90 b/src/eDFT/UCC_lda_exchange_individual_energy.f90 index 7283a9c..cd0666e 100644 --- a/src/eDFT/UCC_lda_exchange_individual_energy.f90 +++ b/src/eDFT/UCC_lda_exchange_individual_energy.f90 @@ -39,18 +39,20 @@ subroutine UCC_lda_exchange_individual_energy(nEns,wEns,nCC,aCC,nGrid,weight,rho double precision,external :: electron_number -! Parameters for N -> N-1 +! Parameters for first state a1 = aCC(1,1) b1 = aCC(2,1) c1 = aCC(3,1) -! Parameters for N -> N+1 +! Parameters for second state a2 = aCC(1,2) b2 = aCC(2,2) c2 = aCC(3,2) +! Defining enhancements factor for weight-dependent functionals + if(doNcentered) then w1 = wEns(2) @@ -61,7 +63,6 @@ subroutine UCC_lda_exchange_individual_energy(nEns,wEns,nCC,aCC,nGrid,weight,rho else - w1 = wEns(2) Fx1 = 1d0 - w1*(1d0 - w1)*(a1 + b1*(w1 - 0.5d0) + c1*(w1 - 0.5d0)**2) diff --git a/src/eDFT/UCC_lda_exchange_potential.f90 b/src/eDFT/UCC_lda_exchange_potential.f90 index a90951f..114a204 100644 --- a/src/eDFT/UCC_lda_exchange_potential.f90 +++ b/src/eDFT/UCC_lda_exchange_potential.f90 @@ -32,44 +32,19 @@ subroutine UCC_lda_exchange_potential(nEns,wEns,nCC,aCC,nGrid,weight,nBas,AO,rho double precision,intent(out) :: Fx(nBas,nBas) -! Single excitation parameter - -! a1 = 0.0d0 -! b1 = 0.0d0 -! c1 = 0.0d0 - -! Parameters for H2 at equilibrium - -! a2 = +0.5751782560799208d0 -! b2 = -0.021108186591137282d0 -! c2 = -0.36718902716347124d0 - -! Parameters for stretch H2 - -! a2 = + 0.01922622507087411d0 -! b2 = - 0.01799647558018601d0 -! c2 = - 0.022945430666782573d0 - -! Parameters for He - -! a2 = 1.9125735895875828d0 -! b2 = 2.715266992840757d0 -! c2 = 2.1634223380633086d0 - -! Parameters for He N -> N-1 +! Parameters for first state a1 = aCC(1,1) b1 = aCC(2,1) c1 = aCC(3,1) -! Parameters for He N -> N+1 +! Parameters for second state a2 = aCC(1,2) b2 = aCC(2,2) c2 = aCC(3,2) -! Fx1 for states N and N-1 -! Fx2 for states N and N+1 +! Defining enhancements factor for weight-dependent functionals if(doNcentered) then