10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-06-25 22:52:15 +02:00

Fixed bugs

This commit is contained in:
Anthony Scemama 2015-05-06 18:26:36 +02:00
parent 8ee7b87954
commit 0a1ba724aa
6 changed files with 36 additions and 30 deletions

View File

@ -1,6 +1,7 @@
program full_ci
implicit none
integer :: i,k
integer :: N_det_old
double precision, allocatable :: pt2(:), norm_pert(:), H_pert_diag(:)
@ -9,6 +10,7 @@ program full_ci
allocate (pt2(N_st), norm_pert(N_st),H_pert_diag(N_st))
character*(64) :: perturbation
N_det_old = 0
pt2 = 1.d0
diag_algorithm = "Lapack"
if (N_det > n_det_max_cas_sd) then
@ -29,6 +31,7 @@ program full_ci
endif
do while (N_det < n_det_max_cas_sd.and.maxval(abs(pt2(1:N_st))) > pt2_max)
N_det_old = N_det
call H_apply_CAS_SD(pt2, norm_pert, H_pert_diag, N_st)
PROVIDE psi_coef
@ -53,10 +56,11 @@ program full_ci
if (abort_all) then
exit
endif
if (N_det == N_det_old) then
exit
endif
enddo
! Check that it is a CAS-SD
logical :: in_cas
integer :: exc_max, degree_min
exc_max = 0
print *, 'CAS determinants : ', N_det_generators

View File

@ -50,14 +50,30 @@ program full_ci
print *, 'E = ', CI_energy
print *, 'E+PT2 = ', CI_energy+pt2
print *, '-----'
call ezfio_set_full_ci_energy(CI_energy)
call ezfio_set_cas_sd_energy(CI_energy(1))
if (abort_all) then
exit
endif
enddo
call diagonalize_CI
if(do_pt2_end)then
print*,'Last iteration only to compute the PT2'
threshold_selectors = 1.d0
threshold_generators = 0.999d0
call H_apply_CAS_SD_PT2(pt2, norm_pert, H_pert_diag, N_st)
print *, 'Final step'
print *, 'N_det = ', N_det
print *, 'N_states = ', N_states
print *, 'PT2 = ', pt2
print *, 'E = ', CI_energy
print *, 'E+PT2 = ', CI_energy+pt2
print *, '-----'
call ezfio_set_cas_sd_energy_pt2(CI_energy(1)+pt2(1))
endif
! Check that it is a CAS-SD
logical :: in_cas
integer :: exc_max, degree_min
exc_max = 0
print *, 'CAS determinants : ', N_det_cas
@ -70,18 +86,4 @@ program full_ci
print *, ''
enddo
print *, 'Max excitation degree in the CAS :', exc_max
do i=1,N_det
in_cas = .False.
degree_min = 1000
do k=1,N_det_cas
call get_excitation_degree(psi_cas(1,1,k),psi_det(1,1,i),degree,N_int)
degree_min = min(degree_min,degree)
enddo
if (degree_min > 2) then
print *, 'Error : This is not a CAS-SD : '
print *, 'Excited determinant:', degree_min
call debug_det(psi_det(1,1,k),N_int)
stop
endif
enddo
end

View File

@ -40,15 +40,11 @@ Documentation
.. Do not edit this section. It was auto-generated from the
.. NEEDED_MODULES file.
`copy_h_apply_buffer_to_wf <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/H_apply.irp.f#L100>`_
Copies the H_apply buffer to psi_coef. You need to touch psi_det, psi_coef and N_det
after calling this function.
`copy_h_apply_buffer_to_wf <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/H_apply.irp.f#L103>`_
Copies the H_apply buffer to psi_coef.
After calling this subroutine, N_det, psi_det and psi_coef need to be touched
`debug_unicity_of_determinants <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/H_apply.irp.f#L187>`_
This subroutine checks that there are no repetitions in the wave function
`fill_h_apply_buffer_no_selection <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/H_apply.irp.f#L222>`_
`fill_h_apply_buffer_no_selection <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/H_apply.irp.f#L258>`_
Fill the H_apply buffer with determiants for CISD
`h_apply_buffer_allocated <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/H_apply.irp.f#L15>`_
@ -59,8 +55,12 @@ Documentation
Buffer of determinants/coefficients/perturbative energy for H_apply.
Uninitialized. Filled by H_apply subroutines.
`remove_duplicates_in_psi_det <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/H_apply.irp.f#L190>`_
Removes duplicate determinants in the wave function.
`resize_h_apply_buffer <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/H_apply.irp.f#L48>`_
Undocumented
Resizes the H_apply buffer of proc iproc. The buffer lock should
be set before calling this function.
`cisd_sc2 <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/SC2.irp.f#L1>`_
CISD+SC2 method :: take off all the disconnected terms of a CISD (selected or not)

View File

@ -83,7 +83,7 @@ END_PROVIDER
endif
enddo
else
do j=1,N_det
do j=1,N_states_diag
call get_s2_u0(psi_det,eigenvectors(1,j),N_det,N_det,s2)
do i=1,N_det
CI_eigenvectors(i,j) = eigenvectors(i,j)

View File

@ -53,7 +53,7 @@
endif
enddo
else
do j=1,N_det
do j=1,N_states_diag
call get_s2_u0(psi_det,eigenvectors(1,j),N_det,N_det,s2)
if(dabs(eigenvectors(1,j)).gt.0.9d0)then
i_state += 1

View File

@ -126,7 +126,7 @@ END_PROVIDER
endif
enddo
else
do j=1,N_det
do j=1,N_states_diag
call get_s2_u0(psi_det,eigenvectors(1,j),N_det,N_det,s2)
i_state += 1
do i=1,N_det