mirror of
https://github.com/QuantumPackage/qp2.git
synced 2024-10-30 10:18:07 +01:00
More stable SCF
This commit is contained in:
parent
ac35c8dbbb
commit
2d81db3911
@ -7,11 +7,11 @@ BEGIN_PROVIDER [ double precision, eigenvectors_Fock_matrix_mo, (ao_num,mo_num)
|
||||
integer :: i,j
|
||||
integer :: liwork, lwork, n, info
|
||||
integer, allocatable :: iwork(:)
|
||||
double precision, allocatable :: work(:), F(:,:), S(:,:)
|
||||
double precision, allocatable :: work(:), F(:,:), F_save(:,:)
|
||||
double precision, allocatable :: diag(:)
|
||||
|
||||
|
||||
allocate( F(mo_num,mo_num) )
|
||||
allocate( F(mo_num,mo_num), F_save(mo_num,mo_num) )
|
||||
allocate (diag(mo_num) )
|
||||
|
||||
do j=1,mo_num
|
||||
@ -51,6 +51,7 @@ BEGIN_PROVIDER [ double precision, eigenvectors_Fock_matrix_mo, (ao_num,mo_num)
|
||||
lwork = -1
|
||||
liwork = -1
|
||||
|
||||
F_save = F
|
||||
call dsyevd( 'V', 'U', mo_num, F, &
|
||||
size(F,1), diag, work, lwork, iwork, liwork, info)
|
||||
|
||||
@ -71,6 +72,7 @@ BEGIN_PROVIDER [ double precision, eigenvectors_Fock_matrix_mo, (ao_num,mo_num)
|
||||
|
||||
|
||||
if (info /= 0) then
|
||||
F = F_save
|
||||
call dsyev( 'V', 'L', mo_num, F, &
|
||||
size(F,1), diag, work, lwork, info)
|
||||
|
||||
|
@ -299,6 +299,7 @@ END_DOC
|
||||
Fock_matrix_AO_(i,j) = 0.d0
|
||||
enddo
|
||||
do k=1,dim_DIIS
|
||||
if (dabs(X_vector_DIIS(k)) < 1.d-10) cycle
|
||||
do i=1,ao_num
|
||||
Fock_matrix_AO_(i,j) = Fock_matrix_AO_(i,j) + &
|
||||
X_vector_DIIS(k)*Fock_matrix_DIIS(i,j,dim_DIIS-k+1)
|
||||
|
Loading…
Reference in New Issue
Block a user