2020-04-01 22:59:52 +02:00
|
|
|
subroutine LIM_RKS(x_rung,x_DFA,c_rung,c_DFA,LDA_centered,nEns,wEns,nGrid,weight, &
|
|
|
|
maxSCF,thresh,max_diis,guess_type,nBas,AO,dAO,nO,nV,S,T,V,Hc,ERI,X,ENuc,c)
|
2020-03-18 11:10:29 +01:00
|
|
|
|
|
|
|
! Perform restricted Kohn-Sham calculation for ensembles
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
include 'parameters.h'
|
|
|
|
|
|
|
|
! Input variables
|
|
|
|
|
|
|
|
integer,intent(in) :: x_rung,c_rung
|
|
|
|
character(len=12),intent(in) :: x_DFA,c_DFA
|
2020-04-01 22:59:52 +02:00
|
|
|
logical,intent(in) :: LDA_centered
|
2020-03-18 11:10:29 +01:00
|
|
|
integer,intent(in) :: nEns
|
|
|
|
double precision,intent(in) :: wEns(nEns)
|
|
|
|
integer,intent(in) :: nGrid
|
|
|
|
double precision,intent(in) :: weight(nGrid)
|
|
|
|
integer,intent(in) :: maxSCF,max_diis,guess_type
|
|
|
|
double precision,intent(in) :: thresh
|
|
|
|
integer,intent(in) :: nBas
|
|
|
|
double precision,intent(in) :: AO(nBas,nGrid)
|
|
|
|
double precision,intent(in) :: dAO(ncart,nBas,nGrid)
|
|
|
|
|
|
|
|
integer,intent(in) :: nO,nV
|
|
|
|
double precision,intent(in) :: S(nBas,nBas)
|
|
|
|
double precision,intent(in) :: T(nBas,nBas)
|
|
|
|
double precision,intent(in) :: V(nBas,nBas)
|
|
|
|
double precision,intent(in) :: Hc(nBas,nBas)
|
|
|
|
double precision,intent(in) :: X(nBas,nBas)
|
|
|
|
double precision,intent(in) :: ERI(nBas,nBas,nBas,nBas)
|
|
|
|
double precision,intent(in) :: ENuc
|
|
|
|
|
2020-03-31 23:33:48 +02:00
|
|
|
double precision,intent(out) :: c(nBas,nBas)
|
2020-03-18 16:06:29 +01:00
|
|
|
|
2020-03-18 11:10:29 +01:00
|
|
|
! Local variables
|
|
|
|
|
|
|
|
integer :: iEns
|
|
|
|
double precision :: EwZW,EwGICZW
|
|
|
|
double precision :: EwEW,EwGICEW
|
|
|
|
double precision :: wLIM(nEns)
|
|
|
|
double precision :: Om(nEns),OmGIC(nEns)
|
|
|
|
|
|
|
|
! Hello world
|
|
|
|
|
|
|
|
write(*,*)
|
|
|
|
write(*,*)'************************************************'
|
|
|
|
write(*,*)'* Linear-interpolation method *'
|
|
|
|
write(*,*)'* for excitation energies *'
|
|
|
|
write(*,*)'************************************************'
|
|
|
|
write(*,*)
|
|
|
|
|
|
|
|
!------------------------------------------------------------------------
|
|
|
|
! Zero-weight calculation
|
|
|
|
!------------------------------------------------------------------------
|
|
|
|
|
|
|
|
write(*,'(A40)') '*************************************************'
|
|
|
|
write(*,'(A40)') ' ZERO-WEIGHT CALCULATION '
|
|
|
|
write(*,'(A40)') '*************************************************'
|
|
|
|
|
|
|
|
wLIM(1) = 1d0
|
|
|
|
wLIM(2:nEns) = 0d0
|
|
|
|
|
|
|
|
do iEns=1,nEns
|
|
|
|
write(*,'(A20,I2,A2,F16.10)') ' Weight of state ',iEns,': ',wLIM(iEns)
|
|
|
|
end do
|
|
|
|
write(*,'(A40)') '*************************************************'
|
|
|
|
write(*,*)
|
|
|
|
|
2020-04-01 22:59:52 +02:00
|
|
|
call GOK_RKS(.false.,x_rung,x_DFA,c_rung,c_DFA,LDA_centered,nEns,wLIM,nGrid,weight,maxSCF,thresh, &
|
2020-03-31 23:33:48 +02:00
|
|
|
max_diis,guess_type,nBas,AO,dAO,nO,nV,S,T,V,Hc,ERI,X,ENuc,EwZW,EwGICZW,c)
|
2020-03-18 11:10:29 +01:00
|
|
|
|
|
|
|
!------------------------------------------------------------------------
|
|
|
|
! Equiensemble calculation
|
|
|
|
!------------------------------------------------------------------------
|
|
|
|
|
|
|
|
write(*,'(A40)') '*************************************************'
|
2020-03-28 22:52:45 +01:00
|
|
|
write(*,'(A40)') ' NON-ZERO-WEIGHT CALCULATION '
|
2020-03-18 11:10:29 +01:00
|
|
|
write(*,'(A40)') '*************************************************'
|
|
|
|
|
|
|
|
do iEns=1,nEns
|
2020-03-28 22:52:45 +01:00
|
|
|
write(*,'(A20,I2,A2,F16.10)') ' Weight of state ',iEns,': ',wEns(iEns)
|
2020-03-18 11:10:29 +01:00
|
|
|
end do
|
|
|
|
write(*,'(A40)') '*************************************************'
|
|
|
|
write(*,*)
|
|
|
|
|
2020-04-01 22:59:52 +02:00
|
|
|
call GOK_RKS(.true.,x_rung,x_DFA,c_rung,c_DFA,LDA_centered,nEns,wEns,nGrid,weight,maxSCF,thresh, &
|
2020-03-31 23:33:48 +02:00
|
|
|
max_diis,guess_type,nBas,AO,dAO,nO,nV,S,T,V,Hc,ERI,X,ENuc,EwEW,EwGICEW,c)
|
2020-03-18 11:10:29 +01:00
|
|
|
|
|
|
|
!------------------------------------------------------------------------
|
|
|
|
! LIM excitation energies
|
|
|
|
!------------------------------------------------------------------------
|
|
|
|
|
|
|
|
Om(1) = 0d0
|
|
|
|
OmGIC(1) = 0d0
|
2020-03-28 22:52:45 +01:00
|
|
|
|
|
|
|
Om(2) = 0d0
|
|
|
|
OmGIC(2) = 0d0
|
|
|
|
if(wEns(2) > 10d-3) then
|
|
|
|
Om(2) = (EwEW - EwZW)/wEns(2)
|
|
|
|
OmGIC(2) = (EwGICEW - EwGICZW)/wEns(2)
|
|
|
|
end if
|
2020-03-18 11:10:29 +01:00
|
|
|
|
|
|
|
write(*,'(A60)') '-------------------------------------------------'
|
|
|
|
write(*,'(A60)') ' LINEAR INTERPOLATION METHOD EXCITATION ENERGIES '
|
|
|
|
write(*,'(A60)') '-------------------------------------------------'
|
|
|
|
|
|
|
|
write(*,'(A44,F16.10,A3)') ' Zero-weight ensemble energy',EwZW, ' au'
|
|
|
|
write(*,'(A44,F16.10,A3)') ' Zero-weight GIC ensemble energy',EwGICZW,' au'
|
|
|
|
write(*,*)
|
|
|
|
write(*,'(A44,F16.10,A3)') ' Equi-weight ensemble energy',EwEW, ' au'
|
|
|
|
write(*,'(A44,F16.10,A3)') ' Equi-weight GIC ensemble energy',EwGICEW, ' au'
|
|
|
|
write(*,'(A60)') '-------------------------------------------------'
|
|
|
|
do iEns=2,nEns
|
|
|
|
write(*,'(A40,I2,A2,F16.10,A3)') ' Excitation energy 1 ->',iEns,': ',Om(iEns), ' au'
|
|
|
|
write(*,'(A40,I2,A2,F16.10,A3)') ' Excitation energy 1 ->',iEns,': ',Om(iEns)*HaToeV,' eV'
|
|
|
|
end do
|
|
|
|
write(*,*)
|
|
|
|
do iEns=2,nEns
|
|
|
|
write(*,'(A40,I2,A2,F16.10,A3)') ' GIC Excitation energy 1 ->',iEns,': ',OmGIC(iEns), ' au'
|
|
|
|
write(*,'(A40,I2,A2,F16.10,A3)') ' GIC Excitation energy 1 ->',iEns,': ',OmGIC(iEns)*HaToeV,' eV'
|
|
|
|
end do
|
|
|
|
write(*,'(A60)') '-------------------------------------------------'
|
|
|
|
|
|
|
|
|
|
|
|
end subroutine LIM_RKS
|