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

32 lines
641 B
Fortran
Raw Permalink Normal View History

2023-11-10 17:22:51 +01:00
subroutine MOtoAO(nBas,S,C,B,A)
2019-03-19 10:13:33 +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) :: nBas
2023-11-08 22:58:55 +01:00
double precision,intent(in) :: S(nBas,nBas)
2023-11-10 17:22:51 +01:00
double precision,intent(in) :: C(nBas,nBas)
2023-11-08 22:58:55 +01:00
double precision,intent(in) :: B(nBas,nBas)
2019-03-19 10:13:33 +01:00
! Local variables
2023-11-10 17:22:51 +01:00
double precision,allocatable :: SC(:,:),BSC(:,:)
2019-03-19 10:13:33 +01:00
! Output variables
2023-11-08 22:58:55 +01:00
double precision,intent(out) :: A(nBas,nBas)
2019-03-19 10:13:33 +01:00
! Memory allocation
2023-11-09 22:24:57 +01:00
2023-11-10 17:22:51 +01:00
allocate(SC(nBas,nBas),BSC(nBas,nBas))
2019-03-19 10:13:33 +01:00
2023-11-10 17:22:51 +01:00
SC = matmul(S,C)
BSC = matmul(B,transpose(SC))
A = matmul(SC,BSC)
2019-03-19 10:13:33 +01:00
end subroutine