9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-11-18 11:23:38 +01:00

complex mo guess

This commit is contained in:
Kevin Gasperich 2020-01-28 17:25:34 -06:00
parent aa23ecc6a6
commit 60ea669d06
4 changed files with 115 additions and 5 deletions

View File

@ -5,9 +5,19 @@ subroutine hcore_guess
implicit none implicit none
character*(64) :: label character*(64) :: label
label = "Guess" label = "Guess"
if (is_periodic) then
call mo_as_eigvectors_of_mo_matrix_complex(mo_one_e_integrals_complex, &
size(mo_one_e_integrals_complex,1), &
size(mo_one_e_integrals_complex,2),label,1,.false.)
call save_mos
!TODO: is this correct? decide how to handle separate real/imag parts of mo_coef
SOFT_TOUCH mo_coef_complex mo_label
else
call mo_as_eigvectors_of_mo_matrix(mo_one_e_integrals, & call mo_as_eigvectors_of_mo_matrix(mo_one_e_integrals, &
size(mo_one_e_integrals,1), & size(mo_one_e_integrals,1), &
size(mo_one_e_integrals,2),label,1,.false.) size(mo_one_e_integrals,2),label,1,.false.)
call save_mos call save_mos
SOFT_TOUCH mo_coef mo_label SOFT_TOUCH mo_coef mo_label
endif
end end

View File

@ -0,0 +1,48 @@
BEGIN_PROVIDER [complex*16, ao_ortho_lowdin_coef_complex, (ao_num,ao_num)]
implicit none
BEGIN_DOC
! matrix of the coefficients of the mos generated by the
! orthonormalization by the S^{-1/2} canonical transformation of the aos
! ao_ortho_lowdin_coef(i,j) = coefficient of the ith ao on the jth ao_ortho_lowdin orbital
END_DOC
integer :: i,j,k,l
complex*16, allocatable :: tmp_matrix(:,:)
allocate (tmp_matrix(ao_num,ao_num))
tmp_matrix(:,:) = (0.d0,0.d0)
do j=1, ao_num
tmp_matrix(j,j) = (1.d0,0.d0)
enddo
call ortho_lowdin_complex(ao_overlap_complex,ao_num,ao_num,tmp_matrix,ao_num,ao_num)
do i=1, ao_num
do j=1, ao_num
ao_ortho_lowdin_coef_complex(j,i) = tmp_matrix(i,j)
enddo
enddo
deallocate(tmp_matrix)
END_PROVIDER
BEGIN_PROVIDER [complex*16, ao_ortho_lowdin_overlap_complex, (ao_num,ao_num)]
implicit none
BEGIN_DOC
! overlap matrix of the ao_ortho_lowdin
! supposed to be the Identity
END_DOC
integer :: i,j,k,l
complex*16 :: c
do j=1, ao_num
do i=1, ao_num
ao_ortho_lowdin_overlap_complex(i,j) = (0.d0,0.d0)
enddo
enddo
do k=1, ao_num
do j=1, ao_num
c = (0.d0,0.d0)
do l=1, ao_num
c += dconjg(ao_ortho_lowdin_coef_complex(j,l)) * ao_overlap_complex(k,l)
enddo
do i=1, ao_num
ao_ortho_lowdin_overlap_complex(i,j) += ao_ortho_lowdin_coef_complex(i,k) * c
enddo
enddo
enddo
END_PROVIDER

View File

@ -23,3 +23,29 @@ BEGIN_PROVIDER [double precision, ao_ortho_canonical_nucl_elec_integrals, (mo_nu
!$OMP END PARALLEL DO !$OMP END PARALLEL DO
END_PROVIDER END_PROVIDER
BEGIN_PROVIDER [complex*16, ao_ortho_canonical_nucl_elec_integrals_complex, (mo_num,mo_num)]
implicit none
integer :: i1,j1,i,j
complex*16 :: c_i1,c_j1
ao_ortho_canonical_nucl_elec_integrals_complex = (0.d0,0.d0)
!$OMP PARALLEL DO DEFAULT(none) &
!$OMP PRIVATE(i,j,i1,j1,c_j1,c_i1) &
!$OMP SHARED(mo_num,ao_num,ao_ortho_canonical_coef_complex, &
!$OMP ao_ortho_canonical_nucl_elec_integrals_complex, ao_integrals_n_e_complex)
do i = 1, mo_num
do j = 1, mo_num
do i1 = 1,ao_num
c_i1 = ao_ortho_canonical_coef_complex(i1,i)
do j1 = 1,ao_num
c_j1 = c_i1*dconjg(ao_ortho_canonical_coef_complex(j1,j))
ao_ortho_canonical_nucl_elec_integrals_complex(j,i) = &
ao_ortho_canonical_nucl_elec_integrals_complex(j,i) + &
c_j1 * ao_integrals_n_e_complex(j1,i1)
enddo
enddo
enddo
enddo
!$OMP END PARALLEL DO
END_PROVIDER

View File

@ -23,3 +23,29 @@ BEGIN_PROVIDER [double precision, ao_ortho_lowdin_nucl_elec_integrals, (mo_num,m
!$OMP END PARALLEL DO !$OMP END PARALLEL DO
END_PROVIDER END_PROVIDER
BEGIN_PROVIDER [complex*16, ao_ortho_lowdin_nucl_elec_integrals_complex, (mo_num,mo_num)]
implicit none
integer :: i1,j1,i,j
complex*16 :: c_i1,c_j1
ao_ortho_lowdin_nucl_elec_integrals = (0.d0,0.d0)
!$OMP PARALLEL DO DEFAULT(none) &
!$OMP PRIVATE(i,j,i1,j1,c_j1,c_i1) &
!$OMP SHARED(mo_num,ao_num,ao_ortho_lowdin_coef_complex, &
!$OMP ao_ortho_lowdin_nucl_elec_integrals_complex, ao_integrals_n_e_complex)
do i = 1, mo_num
do j = 1, mo_num
do i1 = 1,ao_num
c_i1 = ao_ortho_lowdin_coef_complex(i1,i)
do j1 = 1,ao_num
c_j1 = c_i1*dconjg(ao_ortho_lowdin_coef_complex(j1,j))
ao_ortho_lowdin_nucl_elec_integrals_complex(j,i) = &
ao_ortho_lowdin_nucl_elec_integrals_complex(j,i) + &
c_j1 * ao_integrals_n_e_complex(j1,i1)
enddo
enddo
enddo
enddo
!$OMP END PARALLEL DO
END_PROVIDER