10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-12-25 22:03:51 +01:00

truncate_wf_spin

This commit is contained in:
Anthony Scemama 2018-05-07 15:51:02 +02:00
parent af1c600a53
commit 8ee9f7ed9b
3 changed files with 44 additions and 43 deletions

View File

@ -53,7 +53,9 @@ subroutine dress_with_alpha_buffer(Nstates,Ndet,Nint,delta_ij_loc, i_gen, minili
do i_state=1,N_states do i_state=1,N_states
hdress = c_alpha(i_state) * i_h_alpha hdress = c_alpha(i_state) * i_h_alpha
sdress = c_alpha(i_state) * i_s_alpha sdress = c_alpha(i_state) * i_s_alpha
!$OMP ATOMIC
delta_ij_loc(i_state,j,1) = delta_ij_loc(i_state,j,1) + hdress delta_ij_loc(i_state,j,1) = delta_ij_loc(i_state,j,1) + hdress
!$OMP ATOMIC
delta_ij_loc(i_state,j,2) = delta_ij_loc(i_state,j,2) + sdress delta_ij_loc(i_state,j,2) = delta_ij_loc(i_state,j,2) + sdress
enddo enddo
enddo enddo

View File

@ -65,53 +65,52 @@ subroutine run
enddo enddo
!$OMP END PARALLEL DO !$OMP END PARALLEL DO
endif endif
if (ci_threshold > norm_sort(j)) then if (ci_threshold <= norm_sort(j)) then
cycle exit
endif endif
u_0(1:N_det,1:N_states) = psi_bilinear_matrix_values(1:N_det,1:N_states)
v_0(1:N_det,1:N_states) = 0.d0
u_t(1:N_states,1:N_det) = 0.d0
v_t(1:N_states,1:N_det) = 0.d0
s_t(1:N_states,1:N_det) = 0.d0
call dtranspose( &
u_0, &
size(u_0, 1), &
u_t, &
size(u_t, 1), &
N_det, N_states)
print *, 'Computing H|Psi> ...'
call H_S2_u_0_nstates_openmp_work(v_t,s_t,u_t,N_states,N_det,1,N_det,0,1)
print *, 'Done'
call dtranspose( &
v_t, &
size(v_t, 1), &
v_0, &
size(v_0, 1), &
N_states, N_det)
double precision, external :: u_dot_u, u_dot_v
do i=1,N_states
e_0(i) = u_dot_v(u_0(1,i),v_0(1,i),N_det)/u_dot_u(u_0(1,i),N_det)
print *, 'E = ', e_0(i) + nuclear_repulsion
enddo
m = 0
do k=1,n_det
if (sum(psi_bilinear_matrix_values(k,1:N_states)) /= 0.d0) then
m = m+1
endif
enddo
do k=1,N_states
E = E_0(k) + nuclear_repulsion
enddo
print *, 'Number of determinants:', m
exit
enddo enddo
m = 0
do k=1,n_det
if (sum(psi_bilinear_matrix_values(k,1:N_states)) /= 0.d0) then
m = m+1
endif
enddo
do k=1,N_states
E = E_0(k) + nuclear_repulsion
enddo
print *, 'Number of determinants:', m
call wf_of_psi_bilinear_matrix(.True.) call wf_of_psi_bilinear_matrix(.True.)
call save_wavefunction call save_wavefunction
u_0(1:N_det,1:N_states) = psi_bilinear_matrix_values(1:N_det,1:N_states)
v_0(1:N_det,1:N_states) = 0.d0
u_t(1:N_states,1:N_det) = 0.d0
v_t(1:N_states,1:N_det) = 0.d0
s_t(1:N_states,1:N_det) = 0.d0
call dtranspose( &
u_0, &
size(u_0, 1), &
u_t, &
size(u_t, 1), &
N_det, N_states)
print *, 'Computing H|Psi> ...'
call H_S2_u_0_nstates_openmp_work(v_t,s_t,u_t,N_states,N_det,1,N_det,0,1)
print *, 'Done'
call dtranspose( &
v_t, &
size(v_t, 1), &
v_0, &
size(v_0, 1), &
N_states, N_det)
double precision, external :: u_dot_u, u_dot_v
do i=1,N_states
e_0(i) = u_dot_v(u_0(1,i),v_0(1,i),N_det)/u_dot_u(u_0(1,i),N_det)
print *, 'E(',i,') = ', e_0(i) + nuclear_repulsion
enddo
deallocate (iorder, norm_sort) deallocate (iorder, norm_sort)
end end

View File

@ -369,7 +369,7 @@ end function
! gen_per_cp : number of generators per checkpoint ! gen_per_cp : number of generators per checkpoint
END_DOC END_DOC
comb_teeth = 64 comb_teeth = 64
N_cps_max = 64 N_cps_max = 256
gen_per_cp = (N_det_generators / N_cps_max) + 1 gen_per_cp = (N_det_generators / N_cps_max) + 1
END_PROVIDER END_PROVIDER