4
1
mirror of https://github.com/pfloos/quack synced 2024-06-02 11:25:28 +02:00
quack/src/AOtoMO/MOtoAO_GHF.f90

39 lines
869 B
Fortran
Raw Normal View History

2023-11-10 17:22:51 +01:00
subroutine MOtoAO_GHF(nBas2,nBas,S,Ca,Cb,B,A)
2023-11-08 22:59:13 +01:00
! Perform MO to AO transformation of a matrix A for a given metric S
! and coefficients c
implicit none
! Input variables
integer,intent(in) :: nBas2
integer,intent(in) :: nBas
double precision,intent(in) :: S(nBas,nBas)
double precision,intent(in) :: Ca(nBas,nBas2)
double precision,intent(in) :: Cb(nBas,nBas2)
double precision,intent(in) :: B(nBas2,nBas2)
! Local variables
2023-11-10 17:22:51 +01:00
double precision,allocatable :: SC(:,:)
double precision,allocatable :: BSC(:,:)
2023-11-08 22:59:13 +01:00
! Output variables
double precision,intent(inout):: A(nBas,nBas)
! Memory allocation
2023-11-10 17:22:51 +01:00
allocate(SC(nBas,nBas2),BSC(nBas2,nBas))
2023-11-08 22:59:13 +01:00
2023-11-10 17:22:51 +01:00
SC = matmul(S,Ca)
BSC = matmul(B,transpose(SC))
A = matmul(SC,BSC)
2023-11-08 22:59:13 +01:00
2023-11-10 17:22:51 +01:00
SC = matmul(S,Cb)
BSC = matmul(B,transpose(SC))
A = A + matmul(SC,BSc)
2023-11-08 22:59:13 +01:00
end subroutine