2023-11-10 17:22:51 +01:00
|
|
|
subroutine ROHF_fock_matrix(nBas,nOa,nOb,S,c,FaAO,FbAO,FAO)
|
2023-09-05 17:23:40 +02:00
|
|
|
|
2023-09-06 13:16:44 +02:00
|
|
|
! Construct the ROHF Fock matrix in the AO basis
|
|
|
|
! For open shells, the ROHF Fock matrix in the MO basis reads
|
|
|
|
!
|
|
|
|
! | F-K | F + K/2 | F |
|
|
|
|
! |---------------------------------|
|
|
|
|
! | F + K/2 | F | F - K/2 |
|
|
|
|
! |---------------------------------|
|
|
|
|
! | F | F - K/2 | F + K |
|
|
|
|
!
|
|
|
|
! with F = 1/2 (Fa + Fb) and K = Fb - Fa
|
|
|
|
!
|
2023-09-05 17:23:40 +02:00
|
|
|
|
|
|
|
implicit none
|
|
|
|
include 'parameters.h'
|
|
|
|
|
|
|
|
! Input variables
|
|
|
|
|
|
|
|
integer,intent(in) :: nBas
|
|
|
|
integer,intent(in) :: nOa
|
|
|
|
integer,intent(in) :: nOb
|
|
|
|
|
|
|
|
double precision,intent(in) :: S(nBas,nBas)
|
|
|
|
double precision,intent(in) :: c(nBas,nBas)
|
2023-11-10 17:22:51 +01:00
|
|
|
double precision,intent(inout):: FaAO(nBas,nBas)
|
|
|
|
double precision,intent(inout):: FbAO(nBas,nBas)
|
2023-09-05 17:23:40 +02:00
|
|
|
|
|
|
|
! Local variables
|
|
|
|
|
|
|
|
double precision :: aC,bC
|
|
|
|
double precision :: aO,bO
|
|
|
|
double precision :: aV,bV
|
|
|
|
|
|
|
|
integer :: nC
|
|
|
|
integer :: nO
|
|
|
|
integer :: nV
|
|
|
|
|
2023-11-10 17:22:51 +01:00
|
|
|
double precision,allocatable :: F(:,:)
|
|
|
|
double precision,allocatable :: Fa(:,:)
|
|
|
|
double precision,allocatable :: Fb(:,:)
|
|
|
|
|
2023-09-05 17:23:40 +02:00
|
|
|
! Output variables
|
|
|
|
|
2023-11-10 17:22:51 +01:00
|
|
|
double precision,intent(out) :: FAO(nBas,nBas)
|
|
|
|
|
|
|
|
! Memory allocation
|
|
|
|
|
|
|
|
allocate(F(nBas,nBas),Fa(nBas,nBas),Fb(nBas,nBas))
|
2023-09-05 17:23:40 +02:00
|
|
|
|
|
|
|
! Roothan canonicalization parameters
|
|
|
|
|
2023-09-06 13:16:44 +02:00
|
|
|
aC = +1.5d0
|
|
|
|
bC = -0.5d0
|
2023-09-05 17:23:40 +02:00
|
|
|
|
|
|
|
aO = +0.5d0
|
|
|
|
bO = +0.5d0
|
|
|
|
|
2023-09-06 13:16:44 +02:00
|
|
|
aV = -0.5d0
|
|
|
|
bV = +1.5d0
|
2023-09-05 17:23:40 +02:00
|
|
|
|
|
|
|
! Number of closed, open, and virtual orbitals
|
|
|
|
|
|
|
|
nC = min(nOa,nOb)
|
|
|
|
nO = abs(nOa - nOb)
|
|
|
|
nV = nBas - nC - nO
|
|
|
|
|
|
|
|
! Block-by-block Fock matrix
|
|
|
|
|
2023-11-10 17:22:51 +01:00
|
|
|
call AOtoMO(nBas,c,FaAO,Fa)
|
|
|
|
call AOtoMO(nBas,c,FbAO,Fb)
|
2023-09-05 17:23:40 +02:00
|
|
|
|
|
|
|
F(1:nC, 1:nC ) = aC*Fa(1:nC, 1:nC ) + bC*Fb(1:nC, 1:nC )
|
|
|
|
F(1:nC, nC+1:nC+nO ) = Fb(1:nC, nC+1:nC+nO )
|
|
|
|
F(1:nC,nO+nC+1:nC+nO+nV) = 0.5d0*Fa(1:nC,nO+nC+1:nC+nO+nV) + 0.5d0*Fb(1:nC,nO+nC+1:nC+nO+nV)
|
|
|
|
|
|
|
|
F(nC+1:nO+nC, 1:nC ) = Fb(nC+1:nO+nC, 1:nC )
|
2023-09-06 09:50:29 +02:00
|
|
|
F(nC+1:nO+nC, nC+1:nC+nO ) = aO*Fa(nC+1:nO+nC, nC+1:nC+nO ) + bO*Fb(nC+1:nO+nC,nC+1:nC+nO)
|
|
|
|
F(nC+1:nO+nC,nO+nC+1:nC+nO+nV) = Fa(nC+1:nO+nC,nO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