10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-12-25 13:53:49 +01:00
quantum_package/plugins/Hartree_Fock_SlaterDressed/LinearSystem.irp.f

64 lines
1.6 KiB
Fortran
Raw Normal View History

2017-06-08 10:24:24 +02:00
BEGIN_PROVIDER [ double precision, cusp_A, (nucl_num, nucl_num) ]
implicit none
BEGIN_DOC
! Equations to solve : A.X = B
END_DOC
integer :: mu, A, B
2017-06-08 22:15:42 +02:00
cusp_A = 0.d0
do A=1,nucl_num
cusp_A(A,A) = slater_expo(A)/nucl_charge(A) * slater_value_at_nucl(A,A)
do B=1,nucl_num
cusp_A(A,B) -= slater_value_at_nucl(B,A)
2017-06-16 15:35:52 +02:00
! Projector
2017-06-12 16:31:34 +02:00
do mu=1,mo_tot_num
2017-06-19 20:38:28 +02:00
cusp_A(A,B) += AO_orthoSlaOverlap_matrix(mu,B) * ao_ortho_value_at_nucl(mu,A)
2017-06-08 22:15:42 +02:00
enddo
enddo
2017-06-08 10:24:24 +02:00
enddo
END_PROVIDER
2017-06-08 22:15:42 +02:00
BEGIN_PROVIDER [ double precision, cusp_B, (nucl_num, mo_tot_num) ]
2017-06-08 10:24:24 +02:00
implicit none
BEGIN_DOC
! Equations to solve : A.C = B
END_DOC
integer :: i, A, info
do i=1,mo_tot_num
do A=1,nucl_num
2017-06-08 22:15:42 +02:00
cusp_B(A,i) = mo_value_at_nucl(i,A)
2017-06-08 10:24:24 +02:00
enddo
enddo
2017-06-08 22:15:42 +02:00
END_PROVIDER
2017-06-08 10:24:24 +02:00
2017-06-08 22:15:42 +02:00
BEGIN_PROVIDER [ double precision, cusp_C, (nucl_num, mo_tot_num) ]
2017-06-19 20:38:28 +02:00
implicit none
BEGIN_DOC
! Equations to solve : A.C = B
END_DOC
integer :: info
integer :: ipiv(nucl_num)
double precision, allocatable :: AF(:,:)
allocate ( AF(nucl_num,nucl_num) )
cusp_C(1:nucl_num,1:mo_tot_num) = cusp_B(1:nucl_num,1:mo_tot_num)
AF(1:nucl_num,1:nucl_num) = cusp_A(1:nucl_num,1:nucl_num)
call dgetrf(nucl_num,nucl_num,AF,size(AF,1),ipiv,info)
if (info /= 0) then
print *, info
stop 'dgetrf failed'
endif
call dgetrs('N',nucl_num,mo_tot_num,AF,size(AF,1),ipiv,cusp_C,size(cusp_C,1),info)
if (info /= 0) then
print *, info
stop 'dgetrs failed'
endif
2017-06-08 10:24:24 +02:00
END_PROVIDER