9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-07-27 21:07:23 +02:00

Revert CISD guess

This commit is contained in:
Anthony Scemama 2023-01-31 15:20:39 +01:00
parent 70562d6336
commit b26aa6280a

View File

@ -47,36 +47,35 @@ program cisd
PROVIDE N_states PROVIDE N_states
read_wf = .False. read_wf = .False.
SOFT_TOUCH read_wf SOFT_TOUCH read_wf
!
integer :: i,k ! integer :: i,k
!
if(pseudo_sym)then ! if(pseudo_sym)then
call H_apply_cisd_sym ! call H_apply_cisd_sym
else ! else
call H_apply_cisd ! call H_apply_cisd
endif ! endif
double precision :: r1, r2 ! double precision :: r1, r2
double precision, allocatable :: U_csf(:,:) ! double precision, allocatable :: U_csf(:,:)
!
allocate(U_csf(N_csf,N_states)) ! allocate(U_csf(N_csf,N_states))
U_csf = 0.d0 ! U_csf = 0.d0
U_csf(1,1) = 1.d0 ! do k=1,N_states
do k=2,N_states ! do i=1,N_csf
do i=1,N_csf ! call random_number(r1)
call random_number(r1) ! call random_number(r2)
call random_number(r2) ! r1 = dsqrt(-2.d0*dlog(r1))
r1 = dsqrt(-2.d0*dlog(r1)) ! r2 = dacos(-1.d0)*2.d0*r2
r2 = dacos(-1.d0)*2.d0*r2 ! U_csf(i,k) = r1*dcos(r2)
U_csf(i,k) = r1*dcos(r2) ! enddo
enddo ! U_csf(k,k) = U_csf(k,k) +10000.d0
U_csf(k,k) = U_csf(k,k) +100.d0 ! enddo
enddo ! do k=1,N_states
do k=1,N_states ! call normalize(U_csf(1,k),N_csf)
call normalize(U_csf(1,k),N_csf) ! enddo
enddo ! call convertWFfromCSFtoDET(N_states,U_csf(1,1),psi_coef(1,1))
call convertWFfromCSFtoDET(N_states,U_csf(1,1),psi_coef(1,1)) ! deallocate(U_csf)
deallocate(U_csf) ! SOFT_TOUCH psi_coef
SOFT_TOUCH psi_coef
call run call run
end end
@ -87,7 +86,13 @@ subroutine run
double precision :: cisdq(N_states), delta_e double precision :: cisdq(N_states), delta_e
double precision,external :: diag_h_mat_elem double precision,external :: diag_h_mat_elem
if(pseudo_sym)then
call H_apply_cisd_sym
else
call H_apply_cisd
endif
psi_coef = ci_eigenvectors psi_coef = ci_eigenvectors
SOFT_TOUCH psi_coef
call save_wavefunction_truncated(save_threshold) call save_wavefunction_truncated(save_threshold)
call ezfio_set_cisd_energy(CI_energy) call ezfio_set_cisd_energy(CI_energy)