mirror of
https://github.com/LCPQ/quantum_package
synced 2024-08-25 05:51:46 +02:00
mv SC2.irp.f diagonalize_CI_SC2.irp.f
This commit is contained in:
parent
dc3d433d30
commit
9e76f5396b
@ -23,7 +23,7 @@ Needed Modules
|
||||
* `BiInts <http://github.com/LCPQ/quantum_package/tree/master/src/BiInts>`_
|
||||
* `Bitmask <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask>`_
|
||||
* `CISD <http://github.com/LCPQ/quantum_package/tree/master/src/CISD>`_
|
||||
* `CISD_SC2 <http://github.com/LCPQ/quantum_package/tree/master/src/CISD_SC2>`_
|
||||
* `SC2 <http://github.com/LCPQ/quantum_package/tree/master/src/SC2>`_
|
||||
* `CISD_selected <http://github.com/LCPQ/quantum_package/tree/master/src/CISD_selected>`_
|
||||
* `Dets <http://github.com/LCPQ/quantum_package/tree/master/src/Dets>`_
|
||||
* `Electrons <http://github.com/LCPQ/quantum_package/tree/master/src/Electrons>`_
|
||||
|
@ -8,7 +8,7 @@ Documentation
|
||||
.. Do not edit this section. It was auto-generated from the
|
||||
.. NEEDED_MODULES file.
|
||||
|
||||
`cisd_sc2 <http://github.com/LCPQ/quantum_package/tree/master/src/CISD_SC2/SC2.irp.f#L1>`_
|
||||
`cisd_sc2 <http://github.com/LCPQ/quantum_package/tree/master/src/SC2/SC2.irp.f#L1>`_
|
||||
CISD+SC2 method :: take off all the disconnected terms of a CISD (selected or not)
|
||||
.br
|
||||
dets_in : bitmasks corresponding to determinants
|
||||
@ -24,25 +24,51 @@ Documentation
|
||||
.br
|
||||
Initial guess vectors are not necessarily orthonormal
|
||||
|
||||
`repeat_excitation <http://github.com/LCPQ/quantum_package/tree/master/src/CISD_SC2/SC2.irp.f#L169>`_
|
||||
`repeat_excitation <http://github.com/LCPQ/quantum_package/tree/master/src/SC2/SC2.irp.f#L169>`_
|
||||
Undocumented
|
||||
|
||||
`cisd <http://github.com/LCPQ/quantum_package/tree/master/src/CISD_SC2/cisd_SC2.irp.f#L1>`_
|
||||
`cisd <http://github.com/LCPQ/quantum_package/tree/master/src/SC2/cisd_SC2.irp.f#L1>`_
|
||||
Undocumented
|
||||
|
||||
`ci_sc2_eigenvectors <http://github.com/LCPQ/quantum_package/tree/master/src/CISD_SC2/diagonalize_CI_SC2.irp.f#L19>`_
|
||||
`ci_sc2_eigenvectors <http://github.com/LCPQ/quantum_package/tree/master/src/SC2/diagonalize_CI_SC2.irp.f#L19>`_
|
||||
Eigenvectors/values of the CI matrix
|
||||
|
||||
`ci_sc2_electronic_energy <http://github.com/LCPQ/quantum_package/tree/master/src/CISD_SC2/diagonalize_CI_SC2.irp.f#L18>`_
|
||||
`ci_sc2_electronic_energy <http://github.com/LCPQ/quantum_package/tree/master/src/SC2/diagonalize_CI_SC2.irp.f#L18>`_
|
||||
Eigenvectors/values of the CI matrix
|
||||
|
||||
`ci_sc2_energy <http://github.com/LCPQ/quantum_package/tree/master/src/CISD_SC2/diagonalize_CI_SC2.irp.f#L1>`_
|
||||
`ci_sc2_energy <http://github.com/LCPQ/quantum_package/tree/master/src/SC2/diagonalize_CI_SC2.irp.f#L1>`_
|
||||
N_states lowest eigenvalues of the CI matrix
|
||||
|
||||
`diagonalize_ci_sc2 <http://github.com/LCPQ/quantum_package/tree/master/src/CISD_SC2/diagonalize_CI_SC2.irp.f#L38>`_
|
||||
`diagonalize_ci_sc2 <http://github.com/LCPQ/quantum_package/tree/master/src/SC2/diagonalize_CI_SC2.irp.f#L38>`_
|
||||
Replace the coefficients of the CI states by the coefficients of the
|
||||
eigenstates of the CI matrix
|
||||
|
||||
`pt2_epstein_nesbet_sc2_projected <http://github.com/LCPQ/quantum_package/tree/master/src/SC2/pert_sc2.irp.f#L2>`_
|
||||
compute the Epstein-Nesbet perturbative first order coefficient and second order energetic contribution
|
||||
.br
|
||||
for the various N_st states,
|
||||
.br
|
||||
but with the correction in the denominator
|
||||
.br
|
||||
comming from the interaction of that determinant with all the others determinants
|
||||
.br
|
||||
that can be repeated by repeating all the double excitations
|
||||
.br
|
||||
: you repeat all the correlation energy already taken into account in CI_electronic_energy(1)
|
||||
.br
|
||||
that could be repeated to this determinant.
|
||||
.br
|
||||
In addition, for the perturbative energetic contribution you have the standard second order
|
||||
.br
|
||||
e_2_pert = <psi_i|H|det_pert>^2/(Delta_E)
|
||||
.br
|
||||
and also the purely projected contribution
|
||||
.br
|
||||
H_pert_diag = <HF|H|det_pert> c_pert
|
||||
|
||||
`repeat_all_e_corr <http://github.com/LCPQ/quantum_package/tree/master/src/SC2/pert_sc2.irp.f#L82>`_
|
||||
Undocumented
|
||||
|
||||
|
||||
|
||||
Needed Modules
|
||||
|
@ -1,109 +0,0 @@
|
||||
|
||||
subroutine pt2_epstein_nesbet_SC2_projected(det_pert,c_pert,e_2_pert,H_pert_diag,Nint,ndet,N_st)
|
||||
use bitmasks
|
||||
implicit none
|
||||
integer, intent(in) :: Nint,ndet,N_st
|
||||
integer(bit_kind), intent(in) :: det_pert(Nint,2)
|
||||
double precision , intent(out) :: c_pert(N_st),e_2_pert(N_st),H_pert_diag(N_st)
|
||||
double precision :: i_H_psi_array(N_st)
|
||||
integer :: idx_repeat(0:ndet)
|
||||
|
||||
BEGIN_DOC
|
||||
! compute the Epstein-Nesbet perturbative first order coefficient and second order energetic contribution
|
||||
!
|
||||
! for the various N_st states,
|
||||
!
|
||||
! but with the correction in the denominator
|
||||
!
|
||||
! comming from the interaction of that determinant with all the others determinants
|
||||
!
|
||||
! that can be repeated by repeating all the double excitations
|
||||
!
|
||||
! : you repeat all the correlation energy already taken into account in CI_electronic_energy(1)
|
||||
!
|
||||
! that could be repeated to this determinant.
|
||||
!
|
||||
! In addition, for the perturbative energetic contribution you have the standard second order
|
||||
!
|
||||
! e_2_pert = <psi_i|H|det_pert>^2/(Delta_E)
|
||||
!
|
||||
! and also the purely projected contribution
|
||||
!
|
||||
! H_pert_diag = <HF|H|det_pert> c_pert
|
||||
END_DOC
|
||||
|
||||
integer :: i,j,degree
|
||||
double precision :: diag_H_mat_elem,accu_e_corr,hij,h0j,h,delta_E
|
||||
double precision :: repeat_all_e_corr,accu_e_corr_tmp,e_2_pert_fonda
|
||||
ASSERT (Nint == N_int)
|
||||
ASSERT (Nint > 0)
|
||||
call i_H_psi_SC2(det_pert,psi_selectors,psi_selectors_coef,Nint,N_det_selectors,psi_selectors_size,N_st,i_H_psi_array,idx_repeat)
|
||||
accu_e_corr = 0.d0
|
||||
call i_H_j(ref_bitmask,det_pert,Nint,h0j)
|
||||
do i = 1, idx_repeat(0)
|
||||
accu_e_corr = accu_e_corr + E_corr_per_selectors(idx_repeat(i))
|
||||
enddo
|
||||
h = diag_H_mat_elem(det_pert,Nint) + accu_e_corr
|
||||
|
||||
delta_E = (CI_SC2_electronic_energy(1) - h)
|
||||
delta_E = 1.d0/delta_E
|
||||
|
||||
c_pert(1) = i_H_psi_array(1) * delta_E
|
||||
e_2_pert(1) = i_H_psi_array(1) * c_pert(1)
|
||||
H_pert_diag(1) = c_pert(1) * h0j/coef_hf_selector
|
||||
e_2_pert_fonda = H_pert_diag(1)
|
||||
|
||||
do i =2,N_st
|
||||
H_pert_diag(i) = h
|
||||
if(CI_SC2_electronic_energy(i)>h.and.CI_SC2_electronic_energy(i).ne.0.d0)then
|
||||
c_pert(i) = -1.d0
|
||||
e_2_pert(i) = -2.d0
|
||||
else if (dabs(CI_SC2_electronic_energy(i) - h) > 1.d-6) then
|
||||
c_pert(i) = i_H_psi_array(i) / (CI_SC2_electronic_energy(i) - h)
|
||||
e_2_pert(i) = c_pert(i) * i_H_psi_array(i)
|
||||
else
|
||||
c_pert(i) = -1.d0
|
||||
e_2_pert(i) = -dabs(i_H_psi_array(i))
|
||||
endif
|
||||
enddo
|
||||
|
||||
call get_excitation_degree(ref_bitmask,det_pert,degree,Nint)
|
||||
if(degree==2)then
|
||||
! <psi|delta_H|psi>
|
||||
do i = 1, N_st
|
||||
do j = 1, idx_repeat(0)
|
||||
e_2_pert(i) += e_2_pert_fonda * psi_selectors_coef(idx_repeat(j),i) * psi_selectors_coef(idx_repeat(j),i)
|
||||
enddo
|
||||
enddo
|
||||
endif
|
||||
|
||||
end
|
||||
|
||||
double precision function repeat_all_e_corr(key_in)
|
||||
implicit none
|
||||
integer(bit_kind), intent(in) :: key_in(N_int,2)
|
||||
integer :: i,degree
|
||||
double precision :: accu
|
||||
use bitmasks
|
||||
accu = 0.d0
|
||||
call get_excitation_degree(key_in,ref_bitmask,degree,N_int)
|
||||
if(degree==2)then
|
||||
do i = 1, N_det_selectors
|
||||
call get_excitation_degree(ref_bitmask,psi_selectors(1,1,i),degree,N_int)
|
||||
if(degree.ne.2)cycle
|
||||
call get_excitation_degree(key_in,psi_selectors(1,1,i),degree,N_int)
|
||||
if (degree<=3)cycle
|
||||
accu += E_corr_per_selectors(i)
|
||||
enddo
|
||||
elseif(degree==1)then
|
||||
do i = 1, N_det_selectors
|
||||
call get_excitation_degree(ref_bitmask,psi_selectors(1,1,i),degree,N_int)
|
||||
if(degree.ne.2)cycle
|
||||
call get_excitation_degree(key_in,psi_selectors(1,1,i),degree,N_int)
|
||||
if (degree<=2)cycle
|
||||
accu += E_corr_per_selectors(i)
|
||||
enddo
|
||||
endif
|
||||
repeat_all_e_corr = accu
|
||||
|
||||
end
|
Loading…
Reference in New Issue
Block a user