mirror of
https://github.com/LCPQ/quantum_package
synced 2025-01-10 21:18:29 +01:00
Corrected memory access in MRCC
This commit is contained in:
parent
9ddb60fd2e
commit
77b5e99687
@ -274,11 +274,11 @@ BEGIN_PROVIDER [ double precision, CI_energy_dressed, (N_states_diag) ]
|
|||||||
integer :: j
|
integer :: j
|
||||||
character*(8) :: st
|
character*(8) :: st
|
||||||
call write_time(output_determinants)
|
call write_time(output_determinants)
|
||||||
do j=1,N_states_diag
|
do j=1,min(N_det,N_states_diag)
|
||||||
write(st,'(I4)') j
|
write(st,'(I4)') j
|
||||||
CI_energy_dressed(j) = CI_electronic_energy_dressed(j) + nuclear_repulsion
|
CI_energy_dressed(j) = CI_electronic_energy_dressed(j) + nuclear_repulsion
|
||||||
call write_double(output_determinants,CI_energy(j),'Energy of state '//trim(st))
|
call write_double(output_determinants,CI_energy_dressed(j),'Energy of state '//trim(st))
|
||||||
call write_double(output_determinants,CI_eigenvectors_s2(j),'S^2 of state '//trim(st))
|
call write_double(output_determinants,CI_eigenvectors_s2_dressed(j),'S^2 of state '//trim(st))
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
@ -346,7 +346,9 @@ logical function is_generable(det1, det2, Nint)
|
|||||||
else
|
else
|
||||||
tmp_array = (/s2, p2, s1, p1/)
|
tmp_array = (/s2, p2, s1, p1/)
|
||||||
end if
|
end if
|
||||||
|
if (f /= -1) then
|
||||||
f = searchExc(pp_exists(1,hh_shortcut(f)), tmp_array, hh_shortcut(f+1)-hh_shortcut(f))
|
f = searchExc(pp_exists(1,hh_shortcut(f)), tmp_array, hh_shortcut(f+1)-hh_shortcut(f))
|
||||||
|
endif
|
||||||
|
|
||||||
is_generable = (f /= -1)
|
is_generable = (f /= -1)
|
||||||
end function
|
end function
|
||||||
@ -667,12 +669,13 @@ END_PROVIDER
|
|||||||
N_col = 0
|
N_col = 0
|
||||||
col_shortcut = 0
|
col_shortcut = 0
|
||||||
|
|
||||||
!$OMP PARALLEL DO schedule(static,10) default(none) shared(psi_non_ref, hh_exists, pp_exists, N_int, A_val, A_ind)&
|
!$OMP PARALLEL default(none) shared(psi_non_ref, hh_exists, pp_exists, N_int, A_val, A_ind)&
|
||||||
!$OMP shared(s, hh_shortcut, psi_ref_coef, N_det_non_ref, psi_non_ref_sorted, psi_non_ref_sorted_idx, psi_ref, N_det_ref)&
|
!$OMP shared(s, hh_shortcut, psi_ref_coef, N_det_non_ref, psi_non_ref_sorted, psi_non_ref_sorted_idx, psi_ref, N_det_ref)&
|
||||||
!$OMP private(lref, pp, II, ok, myMask, myDet, ind, phase, wk)
|
!$OMP private(lref, pp, II, ok, myMask, myDet, ind, phase, wk)
|
||||||
|
allocate(lref(N_det_non_ref))
|
||||||
|
!$OMP DO schedule(static,10)
|
||||||
do hh = 1, hh_shortcut(0)
|
do hh = 1, hh_shortcut(0)
|
||||||
do pp = hh_shortcut(hh), hh_shortcut(hh+1)-1
|
do pp = hh_shortcut(hh), hh_shortcut(hh+1)-1
|
||||||
allocate(lref(N_det_non_ref))
|
|
||||||
lref = 0
|
lref = 0
|
||||||
do II = 1, N_det_ref
|
do II = 1, N_det_ref
|
||||||
call apply_hole_local(psi_ref(1,1,II), hh_exists(1, hh), myMask, ok, N_int)
|
call apply_hole_local(psi_ref(1,1,II), hh_exists(1, hh), myMask, ok, N_int)
|
||||||
@ -701,10 +704,11 @@ END_PROVIDER
|
|||||||
A_ind(wk, pp) = i
|
A_ind(wk, pp) = i
|
||||||
end if
|
end if
|
||||||
end do
|
end do
|
||||||
|
end do
|
||||||
|
end do
|
||||||
|
!$OMP END DO
|
||||||
deallocate(lref)
|
deallocate(lref)
|
||||||
end do
|
!$OMP END PARALLEL
|
||||||
end do
|
|
||||||
!$OMP END PARALLEL DO
|
|
||||||
|
|
||||||
AtB = 0d0
|
AtB = 0d0
|
||||||
AtA_size = 0
|
AtA_size = 0
|
||||||
|
@ -24,7 +24,7 @@ BEGIN_PROVIDER [ double precision, CI_energy, (N_states_diag) ]
|
|||||||
integer :: j
|
integer :: j
|
||||||
character*(8) :: st
|
character*(8) :: st
|
||||||
call write_time(output_determinants)
|
call write_time(output_determinants)
|
||||||
do j=1,N_states_diag
|
do j=1,min(N_det,N_states_diag)
|
||||||
CI_energy(j) = CI_electronic_energy(j) + nuclear_repulsion
|
CI_energy(j) = CI_electronic_energy(j) + nuclear_repulsion
|
||||||
write(st,'(I4)') j
|
write(st,'(I4)') j
|
||||||
call write_double(output_determinants,CI_energy(j),'Energy of state '//trim(st))
|
call write_double(output_determinants,CI_energy(j),'Energy of state '//trim(st))
|
||||||
|
@ -59,7 +59,6 @@ BEGIN_PROVIDER [ double precision, expected_s2]
|
|||||||
double precision :: S
|
double precision :: S
|
||||||
S = (elec_alpha_num-elec_beta_num)*0.5d0
|
S = (elec_alpha_num-elec_beta_num)*0.5d0
|
||||||
expected_s2 = S * (S+1.d0)
|
expected_s2 = S * (S+1.d0)
|
||||||
! expected_s2 = elec_alpha_num - elec_beta_num + 0.5d0 * ((elec_alpha_num - elec_beta_num)**2*0.5d0 - (elec_alpha_num-elec_beta_num))
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
Loading…
Reference in New Issue
Block a user