@brief Back-transform a symmetric operator Fmo
expressed in
the MO basis V
to the AO basis
@detail compute the transformation:
Fao = S*V * Fmo * (SV)^T
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(out) | :: | fao(*) | |||
real(kind=dp), | intent(in) | :: | fmo(*) | |||
real(kind=dp), | intent(in) | :: | s(*) | |||
real(kind=dp), | intent(in) | :: | v(*) | |||
integer, | intent(in) | :: | nmo | |||
integer, | intent(in) | :: | nbf |
subroutine mo_to_ao(fao, fmo, s, v, nmo, nbf) use mathlib, only: pack_matrix, unpack_matrix use oqp_linalg implicit none real(kind=dp), intent(in) :: fmo(*), s(*), v(*) real(kind=dp), intent(out) :: fao(*) integer, intent(in) :: nmo, nbf integer :: nbf2 real(kind=dp), allocatable :: sv(:,:), ftmp(:,:), wrk(:,:) allocate(ftmp(nbf,nbf), sv(nbf,nmo), wrk(nbf,nbf)) call unpack_matrix(fmo, ftmp) call unpack_matrix(s, wrk) ! compute S*V call dsymm('l', 'u', nbf, nmo, & 1.0_dp, wrk, nbf, & v, nbf, & 0.0_dp, sv, nbf) ! compute (S * V) * Fmo call dsymm('r', 'u', nbf, nmo, & 1.0d0, ftmp, nbf, & sv, nbf, & 0.0d0, wrk, nbf) ! compute ((S * V) * Fmo) * (S * V)^T call dgemm('n', 't', nbf, nbf, nmo, & 1.0d0, wrk, nbf, & sv, nbf, & 0.0d0, ftmp, nbf) nbf2 = nbf*(nbf+1)/2 call pack_matrix(ftmp, fao(:nbf2)) end subroutine mo_to_ao