4
1
mirror of https://github.com/pfloos/quack synced 2024-11-09 07:33:55 +01:00
quack/src/utils/level_shifting.f90

38 lines
834 B
Fortran
Raw Normal View History

2022-02-03 10:05:58 +01:00
subroutine level_shifting(level_shift,nBas,nO,S,c,F)
! Perform level-shifting on the Fock matrix
implicit none
! Input variables
2022-02-03 10:05:58 +01:00
double precision,intent(in) :: level_shift
integer,intent(in) :: nBas
integer,intent(in) :: nO
double precision,intent(in) :: S(nBas,nBas)
double precision,intent(in) :: c(nBas,nBas)
! Local variables
double precision,allocatable :: F_MO(:,:)
double precision,allocatable :: Sc(:,:)
integer :: a
! Output variables
double precision,intent(inout):: F(nBas,nBas)
allocate(F_MO(nBas,nBas),Sc(nBas,nBas))
F_MO(:,:) = matmul(transpose(c),matmul(F,c))
do a=nO+1,nBas
2022-02-03 10:05:58 +01:00
F_MO(a,a) = F_MO(a,a) + level_shift
end do
Sc(:,:) = matmul(S,c)
F(:,:) = matmul(Sc,matmul(F_MO,transpose(Sc)))
end subroutine level_shifting