10
0
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-11-14 18:13:51 +01:00

cleaner ao ortho canonical for kpts

This commit is contained in:
Kevin Gasperich 2020-03-17 10:30:34 -05:00
parent 70cfbbd631
commit 92294cf973

View File

@ -1,19 +1,69 @@
!todo: add kpts
BEGIN_PROVIDER [ integer, ao_cart_to_sphe_num_per_kpt ]
BEGIN_PROVIDER [ complex*16, ao_cart_to_sphe_coef_kpts, (ao_num_per_kpt,ao_num_per_kpt)]
&BEGIN_PROVIDER [ integer, ao_cart_to_sphe_num_per_kpt ]
implicit none
ao_cart_to_sphe_num_per_kpt = ao_cart_to_sphe_num / kpt_num
END_PROVIDER
BEGIN_DOC
! Coefficients to go from cartesian to spherical coordinates in the current
! basis set
END_DOC
integer :: i
integer, external :: ao_power_index
integer :: ibegin,j,k
integer :: prev
prev = 0
ao_cart_to_sphe_coefi_kpts(:,:) = (0.d0,0.d0)
! Assume order provided by ao_power_index
i = 1
ao_cart_to_sphe_num_per_kpt = 0
do while (i <= ao_num_per_kpt)
select case ( ao_l(i) )
case (0)
ao_cart_to_sphe_num_per_kpt += 1
ao_cart_to_sphe_coef_kpts(i,ao_cart_to_sphe_num_per_kpt) = (1.d0,0.d0)
i += 1
BEGIN_TEMPLATE
case ($SHELL)
if (ao_power(i,1) == $SHELL) then
do k=1,size(cart_to_sphe_$SHELL,2)
do j=1,size(cart_to_sphe_$SHELL,1)
ao_cart_to_sphe_coef_kpts(i+j-1,ao_cart_to_sphe_num_per_kpt+k) = dcmplx(cart_to_sphe_$SHELL(j,k),0.d0)
enddo
enddo
i += size(cart_to_sphe_$SHELL,1)
ao_cart_to_sphe_num_per_kpt += size(cart_to_sphe_$SHELL,2)
endif
SUBST [ SHELL ]
1;;
2;;
3;;
4;;
5;;
6;;
7;;
8;;
9;;
END_TEMPLATE
case default
stop 'Error in ao_cart_to_sphe_kpts : angular momentum too high'
end select
enddo
BEGIN_PROVIDER [ complex*16, ao_cart_to_sphe_coef_kpts, (ao_num_per_kpt,ao_cart_to_sphe_num_per_kpt) ]
implicit none
BEGIN_DOC
! complex version of ao_cart_to_sphe_coef for one k-point
END_DOC
call zlacp2('A',ao_num_per_kpt,ao_cart_to_sphe_num_per_kpt, &
ao_cart_to_sphe_coef,size(ao_cart_to_sphe_coef,1), &
ao_cart_to_sphe_coef_kpts,size(ao_cart_to_sphe_coef_kpts,1))
END_PROVIDER
!BEGIN_PROVIDER [ integer, ao_cart_to_sphe_num_per_kpt ]
! implicit none
! ao_cart_to_sphe_num_per_kpt = ao_cart_to_sphe_num / kpt_num
!END_PROVIDER
!
!BEGIN_PROVIDER [ complex*16, ao_cart_to_sphe_coef_kpts, (ao_num_per_kpt,ao_cart_to_sphe_num_per_kpt) ]
! implicit none
! BEGIN_DOC
! ! complex version of ao_cart_to_sphe_coef for one k-point
! END_DOC
! call zlacp2('A',ao_num_per_kpt,ao_cart_to_sphe_num_per_kpt, &
! ao_cart_to_sphe_coef,size(ao_cart_to_sphe_coef,1), &
! ao_cart_to_sphe_coef_kpts,size(ao_cart_to_sphe_coef_kpts,1))
!END_PROVIDER
BEGIN_PROVIDER [ complex*16, ao_cart_to_sphe_overlap_kpts, (ao_cart_to_sphe_num_per_kpt,ao_cart_to_sphe_num_per_kpt,kpt_num) ]
implicit none