4
1
mirror of https://github.com/pfloos/quack synced 2024-12-23 04:43:53 +01:00

print energies

This commit is contained in:
Pierre-Francois Loos 2020-03-18 07:29:54 +01:00
parent a5163dbbcb
commit 2fdc2b2978
4 changed files with 41 additions and 15 deletions

View File

@ -19,6 +19,6 @@
# Number of states in ensemble (nEns)
2
# Ensemble weights: wEns(1),...,wEns(nEns-1)
0.00000 0.00000
0.50000 0.00000
# GOK-DFT: maxSCF thresh DIIS n_diis guess_type ortho_type
64 0.0000001 T 5 1 1

View File

@ -93,7 +93,7 @@ subroutine GOK_RKS(x_rung,x_DFA,c_rung,c_DFA,nEns,wEns,nGrid,weight,maxSCF,thres
write(*,*)
write(*,*) '*******************************************************************'
write(*,*) '* Exchange rung *'
write(*,*) '* EXCHANGE RUNG *'
write(*,*) '*******************************************************************'
call select_rung(x_rung,x_DFA)
@ -102,7 +102,7 @@ subroutine GOK_RKS(x_rung,x_DFA,c_rung,c_DFA,nEns,wEns,nGrid,weight,maxSCF,thres
write(*,*)
write(*,*) '*******************************************************************'
write(*,*) '* Correlation rung *'
write(*,*) '* CORRELATION RUNG *'
write(*,*) '*******************************************************************'
call select_rung(c_rung,c_DFA)
@ -326,6 +326,6 @@ subroutine GOK_RKS(x_rung,x_DFA,c_rung,c_DFA,nEns,wEns,nGrid,weight,maxSCF,thres
call restricted_individual_energy(x_rung,x_DFA,c_rung,c_DFA,nEns,wEns(:),nGrid,weight(:),nBas, &
AO(:,:),dAO(:,:,:),nO,nV,T(:,:),V(:,:),ERI(:,:,:,:),ENuc, &
Pw(:,:),rhow(:),drhow(:,:),J(:,:),Fx(:,:),FxHF(:,:), &
Fc(:,:),P(:,:,:),rho(:,:),drho(:,:,:),E(:),Om(:))
Fc(:,:),P(:,:,:),rho(:,:),drho(:,:,:),Ew,E(:),Om(:))
end subroutine GOK_RKS

View File

@ -1,4 +1,4 @@
subroutine print_restricted_individual_energy(nEns,ET,EV,EJ,Ex,Ec,Exc,ExDD,EcDD,ExcDD,E, &
subroutine print_restricted_individual_energy(nEns,Ew,EwGOC,ET,EV,EJ,Ex,Ec,Exc,ExDD,EcDD,ExcDD,E, &
Om,Omx,Omc,Omxc,OmxDD,OmcDD,OmxcDD)
! Print individual energies for eDFT calculation
@ -9,6 +9,8 @@ subroutine print_restricted_individual_energy(nEns,ET,EV,EJ,Ex,Ec,Exc,ExDD,EcDD,
! Input variables
integer,intent(in) :: nEns
double precision,intent(in) :: Ew
double precision,intent(in) :: EwGOC
double precision,intent(in) :: ET(nEns)
double precision,intent(in) :: EV(nEns)
double precision,intent(in) :: EJ(nEns)
@ -23,12 +25,24 @@ subroutine print_restricted_individual_energy(nEns,ET,EV,EJ,Ex,Ec,Exc,ExDD,EcDD,
integer :: iEns
!------------------------------------------------------------------------
! Ensemble energies
!------------------------------------------------------------------------
write(*,'(A60)') '-------------------------------------------------'
write(*,'(A60)') ' ENSEMBLE ENERGIES'
write(*,'(A60)') '-------------------------------------------------'
write(*,'(A44,F16.10,A3)') ' Ensemble energy: ',Ew, ' au'
write(*,'(A44,F16.10,A3)') ' GOC Ensemble energy: ',EwGOC,' au'
write(*,'(A60)') '-------------------------------------------------'
write(*,*)
!------------------------------------------------------------------------
! Kinetic energy
!------------------------------------------------------------------------
write(*,'(A60)') '-------------------------------------------------'
write(*,'(A50)') ' Individual kinetic energies'
write(*,'(A60)') ' INDIVIDUAL KINETIC ENERGIES'
write(*,'(A60)') '-------------------------------------------------'
do iEns=1,nEns
write(*,'(A40,I2,A2,F16.10,A3)') ' Kinetic energy state ',iEns,': ',ET(iEns),' au'
@ -41,7 +55,7 @@ subroutine print_restricted_individual_energy(nEns,ET,EV,EJ,Ex,Ec,Exc,ExDD,EcDD,
!------------------------------------------------------------------------
write(*,'(A60)') '-------------------------------------------------'
write(*,'(A50)') ' Individual potential energies'
write(*,'(A60)') ' INDIVIDUAL POTENTIAL ENERGIES'
write(*,'(A60)') '-------------------------------------------------'
do iEns=1,nEns
write(*,'(A40,I2,A2,F16.10,A3)') ' Potential energy state ',iEns,': ',EV(iEns),' au'
@ -54,7 +68,7 @@ subroutine print_restricted_individual_energy(nEns,ET,EV,EJ,Ex,Ec,Exc,ExDD,EcDD,
!------------------------------------------------------------------------
write(*,'(A60)') '-------------------------------------------------'
write(*,'(A50)') ' Individual Hartree energies'
write(*,'(A60)') ' INDIVIDUAL HARTREE ENERGIES'
write(*,'(A60)') '-------------------------------------------------'
do iEns=1,nEns
write(*,'(A40,I2,A2,F16.10,A3)') ' Hartree energy state ',iEns,': ',EJ(iEns),' au'
@ -67,7 +81,7 @@ subroutine print_restricted_individual_energy(nEns,ET,EV,EJ,Ex,Ec,Exc,ExDD,EcDD,
!------------------------------------------------------------------------
write(*,'(A60)') '-------------------------------------------------'
write(*,'(A50)') ' Individual exchange energies'
write(*,'(A60)') ' INDIVIDUAL EXCHANGE ENERGIES'
write(*,'(A60)') '-------------------------------------------------'
do iEns=1,nEns
write(*,'(A40,I2,A2,F16.10,A3)') ' Exchange energy state ',iEns,': ',Ex(iEns),' au'
@ -80,7 +94,7 @@ subroutine print_restricted_individual_energy(nEns,ET,EV,EJ,Ex,Ec,Exc,ExDD,EcDD,
!------------------------------------------------------------------------
write(*,'(A60)') '-------------------------------------------------'
write(*,'(A50)') ' Individual correlation energies'
write(*,'(A60)') ' INDIVIDUAL CORRELATION ENERGIES'
write(*,'(A60)') '-------------------------------------------------'
do iEns=1,nEns
write(*,'(A40,I2,A2,F16.10,A3)') ' Correlation energy state ',iEns,': ',Ec(iEns),' au'
@ -93,7 +107,7 @@ subroutine print_restricted_individual_energy(nEns,ET,EV,EJ,Ex,Ec,Exc,ExDD,EcDD,
!------------------------------------------------------------------------
write(*,'(A60)') '-------------------------------------------------'
write(*,'(A50)') ' Derivative discontinuities (DD) '
write(*,'(A60)') ' ENSEMBLE DERIVATIVE CONTRIBUTIONS'
write(*,'(A60)') '-------------------------------------------------'
do iEns=1,nEns
write(*,*)
@ -109,7 +123,7 @@ subroutine print_restricted_individual_energy(nEns,ET,EV,EJ,Ex,Ec,Exc,ExDD,EcDD,
!------------------------------------------------------------------------
write(*,'(A60)') '-------------------------------------------------'
write(*,'(A50)') ' Individual and excitation energies '
write(*,'(A60)') ' INDIVIDUAL AND EXCITATION ENERGIES'
write(*,'(A60)') '-------------------------------------------------'
do iEns=1,nEns
write(*,'(A40,I2,A2,F16.10,A3)') ' Individual energy state ',iEns,': ',E(iEns),' au'

View File

@ -1,5 +1,5 @@
subroutine restricted_individual_energy(x_rung,x_DFA,c_rung,c_DFA,nEns,wEns,nGrid,weight,nBas,AO,dAO, &
nO,nV,T,V,ERI,ENuc,Pw,rhow,drhow,J,Fx,FxHF,Fc,P,rho,drho,E,Om)
nO,nV,T,V,ERI,ENuc,Pw,rhow,drhow,J,Fx,FxHF,Fc,P,rho,drho,Ew,E,Om)
! Compute individual energies as well as excitation energies
@ -37,8 +37,11 @@ subroutine restricted_individual_energy(x_rung,x_DFA,c_rung,c_DFA,nEns,wEns,nGri
double precision,intent(in) :: FxHF(nBas,nBas)
double precision,intent(in) :: Fc(nBas,nBas)
double precision :: Ew
! Local variables
double precision :: EwGOC
double precision :: ET(nEns)
double precision :: EV(nEns)
double precision :: EJ(nEns)
@ -123,6 +126,15 @@ subroutine restricted_individual_energy(x_rung,x_DFA,c_rung,c_DFA,nEns,wEns,nGri
+ Ex(iEns) + Ec(iEns) + ExcDD(iEns)
end do
!------------------------------------------------------------------------
! Total energy with ghost-interaction correction
!------------------------------------------------------------------------
EwGOC = 0d0
do iEns=1,nEns
EwGOC = EwGOC + wEns(iEns)*E(iEns)
end do
!------------------------------------------------------------------------
! Excitation energies
!------------------------------------------------------------------------
@ -145,8 +157,8 @@ subroutine restricted_individual_energy(x_rung,x_DFA,c_rung,c_DFA,nEns,wEns,nGri
! Dump results
!------------------------------------------------------------------------
call print_restricted_individual_energy(nEns,ET(:),EV(:),EJ(:),Ex(:),Ec(:),Exc(:), &
ExDD(:),EcDD(:),ExcDD(:),E(:), &
call print_restricted_individual_energy(nEns,Ew,EwGOC,ET(:),EV(:),EJ(:),Ex(:),Ec(:),Exc(:), &
ExDD(:),EcDD(:),ExcDD(:),E(:), &
Om(:),Omx(:),Omc(:),Omxc(:),OmxDD(:),OmcDD(:),OmxcDD(:))
end subroutine restricted_individual_energy