9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-12-21 11:03:29 +01:00

Orthogonalized PT2

This commit is contained in:
Anthony Scemama 2020-08-31 23:04:34 +02:00
parent 02a2695827
commit 13abddef2d
5 changed files with 22 additions and 6 deletions

View File

@ -37,3 +37,11 @@ BEGIN_PROVIDER [ double precision, pt2_E0_denominator, (N_states) ]
END_PROVIDER END_PROVIDER
BEGIN_PROVIDER [ double precision, pt2_overlap, (N_states, N_states) ]
implicit none
BEGIN_DOC
! Overlap between the perturbed wave functions
END_DOC
pt2_overlap(1:N_states,1:N_states) = 0.d0
END_PROVIDER

View File

@ -314,6 +314,12 @@ subroutine ZMQ_pt2(E, pt2_data, pt2_data_err, relative_error, N_in)
print '(A)', '========== ================= =========== =============== =============== =================' print '(A)', '========== ================= =========== =============== =============== ================='
pt2_overlap(:,pt2_stoch_istate) = pt2_data % overlap(:,pt2_stoch_istate)
print *, 'Overlap'
print *, pt2_overlap(:,pt2_stoch_istate)
print *, '-------'
SOFT_TOUCH pt2_overlap
enddo enddo
FREE pt2_stoch_istate FREE pt2_stoch_istate

View File

@ -787,11 +787,11 @@ subroutine fill_buffer_double(i_generator, sp, h1, h2, bannedOrb, banned, fock_d
enddo enddo
! Gram-Schmidt using input overlap matrix ! Gram-Schmidt using input overlap matrix
! do istate=1,N_states do istate=1,N_states
! do jstate=1,istate-1 do jstate=1,istate-1
! coef(istate) = coef(istate) - pt2_overlap(jstate,istate)/(pt2_overlap(jstate,jstate)) * coef(jstate) coef(istate) = coef(istate) - pt2_overlap(istate,jstate)/(1.d0+pt2_overlap(jstate,jstate)) * coef(jstate)
! enddo enddo
! enddo enddo
do istate=1,N_states do istate=1,N_states
alpha_h_psi = mat(istate, p1, p2) alpha_h_psi = mat(istate, p1, p2)

View File

@ -140,6 +140,8 @@ subroutine ZMQ_selection(N_in, pt2_data)
pt2_data % pt2(k)/(1.d0 + pt2_data % overlap(k,k)) pt2_data % pt2(k)/(1.d0 + pt2_data % overlap(k,k))
enddo enddo
pt2_overlap(:,:) = pt2_data % overlap(:,:)
SOFT_TOUCH pt2_overlap
call update_pt2_and_variance_weights(pt2_data, N_states) call update_pt2_and_variance_weights(pt2_data, N_states)
end subroutine end subroutine

View File

@ -186,10 +186,10 @@ END_DOC
implicit none implicit none
integer,intent(inout) :: dim_DIIS
double precision,intent(in) :: Fock_matrix_DIIS(ao_num,ao_num,dim_DIIS),error_matrix_DIIS(ao_num,ao_num,dim_DIIS) double precision,intent(in) :: Fock_matrix_DIIS(ao_num,ao_num,dim_DIIS),error_matrix_DIIS(ao_num,ao_num,dim_DIIS)
integer,intent(in) :: iteration_SCF, size_Fock_matrix_AO integer,intent(in) :: iteration_SCF, size_Fock_matrix_AO
double precision,intent(inout):: Fock_matrix_AO_(size_Fock_matrix_AO,ao_num) double precision,intent(inout):: Fock_matrix_AO_(size_Fock_matrix_AO,ao_num)
integer,intent(inout) :: dim_DIIS
double precision,allocatable :: B_matrix_DIIS(:,:),X_vector_DIIS(:) double precision,allocatable :: B_matrix_DIIS(:,:),X_vector_DIIS(:)
double precision,allocatable :: C_vector_DIIS(:) double precision,allocatable :: C_vector_DIIS(:)