mirror of
https://github.com/LCPQ/quantum_package
synced 2024-06-29 16:34:50 +02:00
Fixed bugs
This commit is contained in:
parent
8ee7b87954
commit
0a1ba724aa
|
@ -1,6 +1,7 @@
|
||||||
program full_ci
|
program full_ci
|
||||||
implicit none
|
implicit none
|
||||||
integer :: i,k
|
integer :: i,k
|
||||||
|
integer :: N_det_old
|
||||||
|
|
||||||
|
|
||||||
double precision, allocatable :: pt2(:), norm_pert(:), H_pert_diag(:)
|
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))
|
allocate (pt2(N_st), norm_pert(N_st),H_pert_diag(N_st))
|
||||||
character*(64) :: perturbation
|
character*(64) :: perturbation
|
||||||
|
|
||||||
|
N_det_old = 0
|
||||||
pt2 = 1.d0
|
pt2 = 1.d0
|
||||||
diag_algorithm = "Lapack"
|
diag_algorithm = "Lapack"
|
||||||
if (N_det > n_det_max_cas_sd) then
|
if (N_det > n_det_max_cas_sd) then
|
||||||
|
@ -29,6 +31,7 @@ program full_ci
|
||||||
endif
|
endif
|
||||||
|
|
||||||
do while (N_det < n_det_max_cas_sd.and.maxval(abs(pt2(1:N_st))) > pt2_max)
|
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)
|
call H_apply_CAS_SD(pt2, norm_pert, H_pert_diag, N_st)
|
||||||
|
|
||||||
PROVIDE psi_coef
|
PROVIDE psi_coef
|
||||||
|
@ -53,10 +56,11 @@ program full_ci
|
||||||
if (abort_all) then
|
if (abort_all) then
|
||||||
exit
|
exit
|
||||||
endif
|
endif
|
||||||
|
if (N_det == N_det_old) then
|
||||||
|
exit
|
||||||
|
endif
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
! Check that it is a CAS-SD
|
|
||||||
logical :: in_cas
|
|
||||||
integer :: exc_max, degree_min
|
integer :: exc_max, degree_min
|
||||||
exc_max = 0
|
exc_max = 0
|
||||||
print *, 'CAS determinants : ', N_det_generators
|
print *, 'CAS determinants : ', N_det_generators
|
||||||
|
|
|
@ -50,14 +50,30 @@ program full_ci
|
||||||
print *, 'E = ', CI_energy
|
print *, 'E = ', CI_energy
|
||||||
print *, 'E+PT2 = ', CI_energy+pt2
|
print *, 'E+PT2 = ', CI_energy+pt2
|
||||||
print *, '-----'
|
print *, '-----'
|
||||||
call ezfio_set_full_ci_energy(CI_energy)
|
call ezfio_set_cas_sd_energy(CI_energy(1))
|
||||||
if (abort_all) then
|
if (abort_all) then
|
||||||
exit
|
exit
|
||||||
endif
|
endif
|
||||||
enddo
|
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
|
integer :: exc_max, degree_min
|
||||||
exc_max = 0
|
exc_max = 0
|
||||||
print *, 'CAS determinants : ', N_det_cas
|
print *, 'CAS determinants : ', N_det_cas
|
||||||
|
@ -70,18 +86,4 @@ program full_ci
|
||||||
print *, ''
|
print *, ''
|
||||||
enddo
|
enddo
|
||||||
print *, 'Max excitation degree in the CAS :', exc_max
|
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
|
end
|
||||||
|
|
|
@ -40,15 +40,11 @@ Documentation
|
||||||
.. Do not edit this section. It was auto-generated from the
|
.. Do not edit this section. It was auto-generated from the
|
||||||
.. NEEDED_MODULES file.
|
.. NEEDED_MODULES file.
|
||||||
|
|
||||||
`copy_h_apply_buffer_to_wf <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/H_apply.irp.f#L100>`_
|
`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. You need to touch psi_det, psi_coef and N_det
|
Copies the H_apply buffer to psi_coef.
|
||||||
after calling this function.
|
|
||||||
After calling this subroutine, N_det, psi_det and psi_coef need to be touched
|
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>`_
|
`fill_h_apply_buffer_no_selection <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/H_apply.irp.f#L258>`_
|
||||||
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 the H_apply buffer with determiants for CISD
|
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>`_
|
`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.
|
Buffer of determinants/coefficients/perturbative energy for H_apply.
|
||||||
Uninitialized. Filled by H_apply subroutines.
|
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>`_
|
`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 <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)
|
CISD+SC2 method :: take off all the disconnected terms of a CISD (selected or not)
|
||||||
|
|
|
@ -83,7 +83,7 @@ END_PROVIDER
|
||||||
endif
|
endif
|
||||||
enddo
|
enddo
|
||||||
else
|
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)
|
call get_s2_u0(psi_det,eigenvectors(1,j),N_det,N_det,s2)
|
||||||
do i=1,N_det
|
do i=1,N_det
|
||||||
CI_eigenvectors(i,j) = eigenvectors(i,j)
|
CI_eigenvectors(i,j) = eigenvectors(i,j)
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
endif
|
endif
|
||||||
enddo
|
enddo
|
||||||
else
|
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)
|
call get_s2_u0(psi_det,eigenvectors(1,j),N_det,N_det,s2)
|
||||||
if(dabs(eigenvectors(1,j)).gt.0.9d0)then
|
if(dabs(eigenvectors(1,j)).gt.0.9d0)then
|
||||||
i_state += 1
|
i_state += 1
|
||||||
|
|
|
@ -126,7 +126,7 @@ END_PROVIDER
|
||||||
endif
|
endif
|
||||||
enddo
|
enddo
|
||||||
else
|
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)
|
call get_s2_u0(psi_det,eigenvectors(1,j),N_det,N_det,s2)
|
||||||
i_state += 1
|
i_state += 1
|
||||||
do i=1,N_det
|
do i=1,N_det
|
||||||
|
|
Loading…
Reference in New Issue
Block a user