From df90b9fe98bf384e2bca1bacc7e3e530be0fc2f3 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Mon, 30 Jul 2018 19:17:27 +0200 Subject: [PATCH] Fixed CISD --- plugins/CISD/H_apply.irp.f | 4 +++- plugins/CISD/cisd.irp.f | 16 +++++++++------- plugins/mrcepa0/save_mrcc_wavefunction.irp.f | 16 ++++++++-------- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/plugins/CISD/H_apply.irp.f b/plugins/CISD/H_apply.irp.f index a66c997d..8e565c8f 100644 --- a/plugins/CISD/H_apply.irp.f +++ b/plugins/CISD/H_apply.irp.f @@ -3,7 +3,9 @@ BEGIN_SHELL [ /usr/bin/env python2 ] from generate_h_apply import H_apply -H = H_apply("cisd") +H = H_apply("cisd",do_double_exc=True) +print H +H = H_apply("cis",do_double_exc=False) print H END_SHELL diff --git a/plugins/CISD/cisd.irp.f b/plugins/CISD/cisd.irp.f index 0d5a8f75..e85f0940 100644 --- a/plugins/CISD/cisd.irp.f +++ b/plugins/CISD/cisd.irp.f @@ -1,20 +1,22 @@ -program cisd +program cis + implicit none + read_wf = .False. + SOFT_TOUCH read_wf + call run +end + +subroutine run implicit none integer :: i - print *, 'HF = ', HF_energy - print *, 'N_states = ', N_states - N_det = 1 - touch psi_det psi_coef N_det call H_apply_cisd print *, 'N_det = ', N_det do i = 1,N_states print *, 'energy = ',CI_energy(i) print *, 'E_corr = ',CI_electronic_energy(i) - ref_bitmask_energy enddo - - call ezfio_set_cisd_energy(CI_energy(1)) psi_coef = ci_eigenvectors SOFT_TOUCH psi_coef call save_wavefunction + end diff --git a/plugins/mrcepa0/save_mrcc_wavefunction.irp.f b/plugins/mrcepa0/save_mrcc_wavefunction.irp.f index 9afa2b71..da52b56d 100644 --- a/plugins/mrcepa0/save_mrcc_wavefunction.irp.f +++ b/plugins/mrcepa0/save_mrcc_wavefunction.irp.f @@ -26,13 +26,13 @@ subroutine run1 !$OMP PARALLEL DO DEFAULT(SHARED) & !$OMP PRIVATE(k,c_alpha) SCHEDULE(static,64) do k=1,N_det - if (maxval(abs(psi_coef(k,1:N_states))) == 0.d0) then +! if (maxval(abs(psi_coef(k,1:N_states))) == 0.d0) then if (iand(k,1023) == 0) then print *, k, '/', N_det endif call get_cc_coef(psi_det(1,1,k), c_alpha) psi_coef(k,1:N_states) = c_alpha(1:N_states) - endif +! endif enddo !$OMP END PARALLEL DO SOFT_TOUCH psi_coef @@ -46,12 +46,12 @@ subroutine run2 psi_det(1:N_int,1:2,1:N_det) = psi_det_sorted(1:N_int,1:2,1:N_det) psi_coef(1:N_det,1:N_states) = psi_coef_sorted(1:N_det,1:N_states) - do k=N_det,1,-1 - if (maxval(abs(psi_coef(k,1:N_states))) > 0.d0) then - exit - endif - enddo - N_det = k +! do k=N_det,1,-1 +! if (maxval(abs(psi_coef(k,1:N_states))) > 0.d0) then +! exit +! endif +! enddo +! N_det = k SOFT_TOUCH N_det psi_coef psi_det call save_wavefunction end