mirror of
https://github.com/LCPQ/quantum_package
synced 2024-11-03 20:54:00 +01:00
Bug corrected in saved wave function
This commit is contained in:
parent
fd5a6ce174
commit
5818f4f255
@ -4,10 +4,9 @@ program cisd
|
|||||||
|
|
||||||
print *, 'HF = ', HF_energy
|
print *, 'HF = ', HF_energy
|
||||||
print *, 'N_states = ', N_states
|
print *, 'N_states = ', N_states
|
||||||
|
N_det = 1
|
||||||
|
touch psi_det psi_coef N_det
|
||||||
call H_apply_cisd
|
call H_apply_cisd
|
||||||
! do i=1,N_det
|
|
||||||
! print '(100(X,O32))', det_connections(:,i)
|
|
||||||
! enddo
|
|
||||||
print *, 'N_det = ', N_det
|
print *, 'N_det = ', N_det
|
||||||
do i = 1,N_states
|
do i = 1,N_states
|
||||||
print *, 'energy = ',CI_energy(i)
|
print *, 'energy = ',CI_energy(i)
|
||||||
|
@ -381,7 +381,7 @@ subroutine $subroutine($params_main)
|
|||||||
integer :: ispin, k
|
integer :: ispin, k
|
||||||
|
|
||||||
PROVIDE H_apply_buffer_allocated mo_bielec_integrals_in_map N_det_selectors psi_generators
|
PROVIDE H_apply_buffer_allocated mo_bielec_integrals_in_map N_det_selectors psi_generators
|
||||||
PROVIDE psi_det_sorted_bit coef_hf_selector psi_det psi_coef H_apply_threshold
|
PROVIDE psi_det_sorted_bit coef_hf_selector psi_det psi_coef H_apply_threshold ref_bitmask_energy
|
||||||
|
|
||||||
nmax = ( N_det_generators/nproc ) *nproc
|
nmax = ( N_det_generators/nproc ) *nproc
|
||||||
call wall_time(wall_1)
|
call wall_time(wall_1)
|
||||||
|
@ -48,7 +48,7 @@ subroutine davidson_diag(dets_in,u_in,energies,dim_in,sze,N_st,Nint,iunit)
|
|||||||
ASSERT (sze > 0)
|
ASSERT (sze > 0)
|
||||||
ASSERT (Nint > 0)
|
ASSERT (Nint > 0)
|
||||||
ASSERT (Nint == N_int)
|
ASSERT (Nint == N_int)
|
||||||
PROVIDE ref_bitmask_energy
|
PROVIDE ref_bitmask_energy mo_bielec_integrals_in_map
|
||||||
allocate(H_jj(sze))
|
allocate(H_jj(sze))
|
||||||
|
|
||||||
!$OMP PARALLEL DEFAULT(NONE) &
|
!$OMP PARALLEL DEFAULT(NONE) &
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
determinants
|
determinants
|
||||||
n_int integer
|
n_int integer
|
||||||
bit_kind integer
|
bit_kind integer
|
||||||
|
mo_label character*(64)
|
||||||
n_det integer
|
n_det integer
|
||||||
n_states integer
|
n_states integer
|
||||||
psi_coef double precision (determinants_n_det,determinants_n_states)
|
psi_coef double precision (determinants_n_det,determinants_n_states)
|
||||||
@ -9,4 +10,3 @@ determinants
|
|||||||
n_det_max_jacobi integer
|
n_det_max_jacobi integer
|
||||||
threshold_generators double precision
|
threshold_generators double precision
|
||||||
threshold_selectors double precision
|
threshold_selectors double precision
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@ BEGIN_PROVIDER [ integer, N_states ]
|
|||||||
else
|
else
|
||||||
N_states = 1
|
N_states = 1
|
||||||
endif
|
endif
|
||||||
|
call write_int(output_dets,N_states,'Number of states')
|
||||||
ASSERT (N_states > 0)
|
ASSERT (N_states > 0)
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
@ -22,13 +23,24 @@ BEGIN_PROVIDER [ integer, N_det ]
|
|||||||
! Number of determinants in the wave function
|
! Number of determinants in the wave function
|
||||||
END_DOC
|
END_DOC
|
||||||
logical :: exists
|
logical :: exists
|
||||||
|
character*64 :: label
|
||||||
PROVIDE ezfio_filename
|
PROVIDE ezfio_filename
|
||||||
call ezfio_has_determinants_n_det(exists)
|
call ezfio_has_determinants_n_det(exists)
|
||||||
|
if (exists) then
|
||||||
|
if (exists) then
|
||||||
|
call ezfio_has_determinants_mo_label(exists)
|
||||||
|
if (exists) then
|
||||||
|
call ezfio_get_determinants_mo_label(label)
|
||||||
|
exists = (label == mo_label)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
if (exists) then
|
if (exists) then
|
||||||
call ezfio_get_determinants_n_det(N_det)
|
call ezfio_get_determinants_n_det(N_det)
|
||||||
else
|
else
|
||||||
N_det = 1
|
N_det = 1
|
||||||
endif
|
endif
|
||||||
|
call write_int(output_dets,N_det,'Number of determinants')
|
||||||
ASSERT (N_det > 0)
|
ASSERT (N_det > 0)
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
@ -46,6 +58,7 @@ BEGIN_PROVIDER [ integer, N_det_max_jacobi ]
|
|||||||
else
|
else
|
||||||
N_det_max_jacobi = 2000
|
N_det_max_jacobi = 2000
|
||||||
endif
|
endif
|
||||||
|
call write_int(output_dets,N_det_max_jacobi,'Lapack diagonalization up to')
|
||||||
ASSERT (N_det_max_jacobi > 0)
|
ASSERT (N_det_max_jacobi > 0)
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
@ -64,6 +77,7 @@ BEGIN_PROVIDER [ integer, psi_det_size ]
|
|||||||
psi_det_size = 1
|
psi_det_size = 1
|
||||||
endif
|
endif
|
||||||
psi_det_size = max(psi_det_size,10000)
|
psi_det_size = max(psi_det_size,10000)
|
||||||
|
call write_int(output_dets,psi_det_size,'Dimension of the psi arrays')
|
||||||
|
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
@ -75,6 +89,7 @@ BEGIN_PROVIDER [ integer(bit_kind), psi_det, (N_int,2,psi_det_size) ]
|
|||||||
END_DOC
|
END_DOC
|
||||||
integer :: i
|
integer :: i
|
||||||
logical :: exists
|
logical :: exists
|
||||||
|
character*64 :: label
|
||||||
|
|
||||||
call ezfio_has_determinants_N_int(exists)
|
call ezfio_has_determinants_N_int(exists)
|
||||||
if (exists) then
|
if (exists) then
|
||||||
@ -85,6 +100,13 @@ BEGIN_PROVIDER [ integer(bit_kind), psi_det, (N_int,2,psi_det_size) ]
|
|||||||
call ezfio_has_determinants_N_states(exists)
|
call ezfio_has_determinants_N_states(exists)
|
||||||
if (exists) then
|
if (exists) then
|
||||||
call ezfio_has_determinants_psi_det(exists)
|
call ezfio_has_determinants_psi_det(exists)
|
||||||
|
if (exists) then
|
||||||
|
call ezfio_has_determinants_mo_label(exists)
|
||||||
|
if (exists) then
|
||||||
|
call ezfio_get_determinants_mo_label(label)
|
||||||
|
exists = (label == mo_label)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
@ -156,8 +178,16 @@ BEGIN_PROVIDER [ double precision, psi_coef, (psi_det_size,N_states) ]
|
|||||||
integer :: i,k, N_int2
|
integer :: i,k, N_int2
|
||||||
logical :: exists
|
logical :: exists
|
||||||
double precision, allocatable :: psi_coef_read(:,:)
|
double precision, allocatable :: psi_coef_read(:,:)
|
||||||
|
character*(64) :: label
|
||||||
|
|
||||||
call ezfio_has_determinants_psi_coef(exists)
|
call ezfio_has_determinants_psi_coef(exists)
|
||||||
|
if (exists) then
|
||||||
|
call ezfio_has_determinants_mo_label(exists)
|
||||||
|
if (exists) then
|
||||||
|
call ezfio_get_determinants_mo_label(label)
|
||||||
|
exists = (label == mo_label)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
if (exists) then
|
if (exists) then
|
||||||
|
|
||||||
@ -303,6 +333,7 @@ subroutine save_wavefunction
|
|||||||
call ezfio_set_determinants_bit_kind(bit_kind)
|
call ezfio_set_determinants_bit_kind(bit_kind)
|
||||||
call ezfio_set_determinants_N_det(N_det)
|
call ezfio_set_determinants_N_det(N_det)
|
||||||
call ezfio_set_determinants_N_states(N_states)
|
call ezfio_set_determinants_N_states(N_states)
|
||||||
|
call ezfio_set_determinants_mo_label(mo_label)
|
||||||
|
|
||||||
N_int2 = (N_int*bit_kind)/8
|
N_int2 = (N_int*bit_kind)/8
|
||||||
allocate (psi_det_save(N_int2,2,N_det))
|
allocate (psi_det_save(N_int2,2,N_det))
|
||||||
@ -314,7 +345,7 @@ subroutine save_wavefunction
|
|||||||
psi_det_save(k,1,i) = det_8(k)
|
psi_det_save(k,1,i) = det_8(k)
|
||||||
enddo
|
enddo
|
||||||
do k=1,N_int
|
do k=1,N_int
|
||||||
det_bk(k) = psi_det(k,2,i)
|
det_bk(k) = psi_det_sorted(k,2,i)
|
||||||
enddo
|
enddo
|
||||||
do k=1,N_int2
|
do k=1,N_int2
|
||||||
psi_det_save(k,2,i) = det_8(k)
|
psi_det_save(k,2,i) = det_8(k)
|
||||||
@ -330,6 +361,7 @@ subroutine save_wavefunction
|
|||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
call ezfio_set_determinants_psi_coef(psi_coef_save)
|
call ezfio_set_determinants_psi_coef(psi_coef_save)
|
||||||
|
call write_int(output_dets,N_det,'Saved determinants')
|
||||||
deallocate (psi_coef_save)
|
deallocate (psi_coef_save)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ program cisd
|
|||||||
|
|
||||||
pt2 = 1.d0
|
pt2 = 1.d0
|
||||||
diag_algorithm = "Lapack"
|
diag_algorithm = "Lapack"
|
||||||
do while (maxval(abs(pt2(1:N_st))) > 1.d-3)
|
do while (maxval(abs(pt2(1:N_st))) > 1.d-4)
|
||||||
call H_apply_FCI(pt2, norm_pert, H_pert_diag, N_st)
|
call H_apply_FCI(pt2, norm_pert, H_pert_diag, N_st)
|
||||||
call diagonalize_CI
|
call diagonalize_CI
|
||||||
call save_wavefunction
|
call save_wavefunction
|
||||||
|
Loading…
Reference in New Issue
Block a user