mirror of
https://github.com/LCPQ/quantum_package
synced 2025-05-06 07:05:25 +02:00
Wall_0
This commit is contained in:
parent
275fe6aca8
commit
a282c8d4ae
@ -95,7 +95,7 @@ class H_apply(object):
|
|||||||
s["size_max"] = str(1024*128)
|
s["size_max"] = str(1024*128)
|
||||||
s["copy_buffer"] = "call copy_h_apply_buffer_to_wf"
|
s["copy_buffer"] = "call copy_h_apply_buffer_to_wf"
|
||||||
s["printout_now"] = """write(output_Dets,*) &
|
s["printout_now"] = """write(output_Dets,*) &
|
||||||
100.*float(i_generator)/float(N_det_generators), '% in ', wall_2-wall_1, 's'"""
|
100.*float(i_generator)/float(N_det_generators), '% in ', wall_1-wall_0, 's'"""
|
||||||
self.data = s
|
self.data = s
|
||||||
|
|
||||||
def __setitem__(self,key,value):
|
def __setitem__(self,key,value):
|
||||||
@ -194,7 +194,7 @@ class H_apply(object):
|
|||||||
write(output_Dets,'(I10, 4(2X, F9.6), 2X, F8.1)') &
|
write(output_Dets,'(I10, 4(2X, F9.6), 2X, F8.1)') &
|
||||||
i_generator, norm_psi(k), delta_pt2(k), pt2(k), &
|
i_generator, norm_psi(k), delta_pt2(k), pt2(k), &
|
||||||
pt2(k)/norm_psi(k), &
|
pt2(k)/norm_psi(k), &
|
||||||
wall_2-wall_1
|
wall_1-wall_0
|
||||||
pt2_old(k) = pt2(k)
|
pt2_old(k) = pt2(k)
|
||||||
enddo
|
enddo
|
||||||
"""
|
"""
|
||||||
|
@ -12,7 +12,13 @@ program cisd
|
|||||||
pt2 = 1.d0
|
pt2 = 1.d0
|
||||||
perturbation = "epstein_nesbet"
|
perturbation = "epstein_nesbet"
|
||||||
E_old(1) = HF_energy
|
E_old(1) = HF_energy
|
||||||
do while (maxval(abs(pt2(1:N_st))) > 1.d-6)
|
call diagonalize_CI
|
||||||
|
do i = 1, N_st
|
||||||
|
print*,'state ',i
|
||||||
|
print *, 'E = ', CI_energy(i)
|
||||||
|
enddo
|
||||||
|
E_old = CI_energy
|
||||||
|
do while (maxval(abs(pt2(1:N_st))) > 1.d-4)
|
||||||
print*,'----'
|
print*,'----'
|
||||||
print*,''
|
print*,''
|
||||||
call H_apply_cisd_selection(perturbation,pt2, norm_pert, H_pert_diag, N_st)
|
call H_apply_cisd_selection(perturbation,pt2, norm_pert, H_pert_diag, N_st)
|
||||||
|
@ -16,8 +16,8 @@ endif
|
|||||||
do i = 1,n_state_CIS
|
do i = 1,n_state_CIS
|
||||||
print*,''
|
print*,''
|
||||||
print*,'i = ',i
|
print*,'i = ',i
|
||||||
print*,'CIS = ',eigenvalues_CIS(i)
|
print*,'CIS = ',eigenvalues_CIS(i)+ nuclear_repulsion
|
||||||
print*,'CIS(DdT)= ',eigenvalues_CIS_dress_D_dt(i)
|
print*,'CIS(DdT)= ',eigenvalues_CIS_dress_D_dt(i)+ nuclear_repulsion
|
||||||
print*,'s2(DdT) = ',s_2_CIS_dress_D_dt(i)
|
print*,'s2(DdT) = ',s_2_CIS_dress_D_dt(i)
|
||||||
print*,'<x> = ',CIS_states_properties(1,i)
|
print*,'<x> = ',CIS_states_properties(1,i)
|
||||||
print*,'<y> = ',CIS_states_properties(2,i)
|
print*,'<y> = ',CIS_states_properties(2,i)
|
||||||
|
@ -211,7 +211,14 @@
|
|||||||
integer :: i_overlap,i,j,k
|
integer :: i_overlap,i,j,k
|
||||||
allocate (delta_H_matrix_doub(size_psi_CIS,size_psi_CIS))
|
allocate (delta_H_matrix_doub(size_psi_CIS,size_psi_CIS))
|
||||||
allocate(eigvalues(size_psi_CIS),eigvectors(size_psi_CIS,size_psi_CIS))
|
allocate(eigvalues(size_psi_CIS),eigvectors(size_psi_CIS,size_psi_CIS))
|
||||||
do i = 1,n_state_CIS
|
eigenvalues_CIS_dress_D_dt(1) = eigenvalues_cis(1) + dress_T_discon_array_CIS(1)
|
||||||
|
eigenvectors_CIS_dress_D_dt(1,1) = 1.d0
|
||||||
|
s_2_CIS_dress_D_dt = 0.d0
|
||||||
|
print*,'eigenvalues_CIS_dress_D_dt(i)= ',eigenvalues_CIS_dress_D_dt(1) + nuclear_repulsion
|
||||||
|
do i = 2, size_psi_CIS
|
||||||
|
eigenvectors_CIS_dress_D_dt(i,1) = 0.d0
|
||||||
|
enddo
|
||||||
|
do i = 2,n_state_CIS
|
||||||
call dress_by_doubles(eigenvalues_CIS(i),coefs_CIS(1,i),delta_H_matrix_doub,size_psi_CIS) !dressing of the Doubles
|
call dress_by_doubles(eigenvalues_CIS(i),coefs_CIS(1,i),delta_H_matrix_doub,size_psi_CIS) !dressing of the Doubles
|
||||||
! delta_H_matrix_doub = 0.d0
|
! delta_H_matrix_doub = 0.d0
|
||||||
|
|
||||||
@ -221,6 +228,9 @@
|
|||||||
enddo
|
enddo
|
||||||
delta_H_matrix_doub(j,j) += dress_T_discon_array_CIS(j)
|
delta_H_matrix_doub(j,j) += dress_T_discon_array_CIS(j)
|
||||||
enddo
|
enddo
|
||||||
|
do j = 2, size_psi_CIS
|
||||||
|
delta_H_matrix_doub(1,j) = 0.d0
|
||||||
|
enddo
|
||||||
|
|
||||||
double precision :: accu
|
double precision :: accu
|
||||||
accu = 0.d0
|
accu = 0.d0
|
||||||
@ -258,9 +268,9 @@
|
|||||||
call get_s2_u0(psi_CIS,eigenvectors_CIS_dress_D_dt(1,i),size_psi_CIS,size_psi_CIS,s2)
|
call get_s2_u0(psi_CIS,eigenvectors_CIS_dress_D_dt(1,i),size_psi_CIS,size_psi_CIS,s2)
|
||||||
s_2_CIS_dress_D_dt(i) = s2
|
s_2_CIS_dress_D_dt(i) = s2
|
||||||
eigenvalues_CIS_dress_D_dt(i) = eigvalues(i_overlap)
|
eigenvalues_CIS_dress_D_dt(i) = eigvalues(i_overlap)
|
||||||
print*,'eigenvalues_CIS_dress_D_dt(i)= ',eigenvalues_CIS_dress_D_dt(i)
|
print*,'eigenvalues_CIS_dress_D_dt(i)= ',eigenvalues_CIS_dress_D_dt(i) + nuclear_repulsion
|
||||||
print*,'accu = ',accu
|
print*,'Perturbative = ',accu+ nuclear_repulsion
|
||||||
print*,'eigenvalues_CIS = ',eigenvalues_CIS(i)
|
print*,'eigenvalues_CIS = ',eigenvalues_CIS(i)+ nuclear_repulsion
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
@ -23,7 +23,8 @@ BEGIN_PROVIDER [ logical, H_apply_buffer_allocated ]
|
|||||||
if (.not.associated(H_apply_buffer)) then
|
if (.not.associated(H_apply_buffer)) then
|
||||||
allocate(H_apply_buffer(0:nproc-1))
|
allocate(H_apply_buffer(0:nproc-1))
|
||||||
iproc = 0
|
iproc = 0
|
||||||
!$OMP PARALLEL PRIVATE(iproc) DEFAULT(SHARED)
|
!$OMP PARALLEL PRIVATE(iproc) DEFAULT(NONE)
|
||||||
|
!$OMP SHARED(H_apply_buffer,N_int,sze,N_states)
|
||||||
!$ iproc = omp_get_thread_num()
|
!$ iproc = omp_get_thread_num()
|
||||||
H_apply_buffer(iproc)%N_det = 0
|
H_apply_buffer(iproc)%N_det = 0
|
||||||
H_apply_buffer(iproc)%sze = sze
|
H_apply_buffer(iproc)%sze = sze
|
||||||
|
@ -375,7 +375,7 @@ subroutine $subroutine($params_main)
|
|||||||
$decls_main
|
$decls_main
|
||||||
|
|
||||||
integer :: i_generator, nmax
|
integer :: i_generator, nmax
|
||||||
double precision :: wall_0, wall_1, wall_2
|
double precision :: wall_0, wall_1
|
||||||
integer(omp_lock_kind) :: lck
|
integer(omp_lock_kind) :: lck
|
||||||
integer(bit_kind), allocatable :: mask(:,:,:)
|
integer(bit_kind), allocatable :: mask(:,:,:)
|
||||||
integer :: ispin, k
|
integer :: ispin, k
|
||||||
@ -384,13 +384,13 @@ subroutine $subroutine($params_main)
|
|||||||
PROVIDE psi_det_sorted_bit coef_hf_selector psi_det psi_coef H_apply_threshold ref_bitmask_energy
|
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_0)
|
||||||
|
|
||||||
|
|
||||||
!$ call omp_init_lock(lck)
|
!$ call omp_init_lock(lck)
|
||||||
IRP_IF I_LIKE_BUGS
|
IRP_IF I_LIKE_BUGS
|
||||||
!$OMP PARALLEL DEFAULT(SHARED) &
|
!$OMP PARALLEL DEFAULT(SHARED) &
|
||||||
!$OMP PRIVATE(i_generator,wall_2,ispin,k,mask)
|
!$OMP PRIVATE(i_generator,wall_1,ispin,k,mask)
|
||||||
allocate( mask(N_int,2,6) )
|
allocate( mask(N_int,2,6) )
|
||||||
!$OMP DO SCHEDULE(dynamic,4)
|
!$OMP DO SCHEDULE(dynamic,4)
|
||||||
do i_generator=1,nmax
|
do i_generator=1,nmax
|
||||||
@ -435,10 +435,10 @@ IRP_IF I_LIKE_BUGS
|
|||||||
i_generator $params_post)
|
i_generator $params_post)
|
||||||
endif
|
endif
|
||||||
!$ call omp_set_lock(lck)
|
!$ call omp_set_lock(lck)
|
||||||
call wall_time(wall_2)
|
call wall_time(wall_1)
|
||||||
$printout_always
|
$printout_always
|
||||||
if (wall_2 - wall_0 > 2.d0) then
|
if (wall_1 - wall_0 > 2.d0) then
|
||||||
wall_0 = wall_2
|
wall_0 = wall_1
|
||||||
$printout_now
|
$printout_now
|
||||||
endif
|
endif
|
||||||
!$ call omp_unset_lock(lck)
|
!$ call omp_unset_lock(lck)
|
||||||
@ -496,10 +496,10 @@ IRP_ENDIF
|
|||||||
mask(1,1,s_hole ), mask(1,1,s_part ), &
|
mask(1,1,s_hole ), mask(1,1,s_part ), &
|
||||||
i_generator $params_post)
|
i_generator $params_post)
|
||||||
endif
|
endif
|
||||||
call wall_time(wall_2)
|
call wall_time(wall_1)
|
||||||
$printout_always
|
$printout_always
|
||||||
if (wall_2 - wall_0 > 2.d0) then
|
if (wall_1 - wall_0 > 2.d0) then
|
||||||
wall_0 = wall_2
|
wall_0 = wall_1
|
||||||
$printout_now
|
$printout_now
|
||||||
endif
|
endif
|
||||||
enddo
|
enddo
|
||||||
|
@ -3,11 +3,11 @@ BEGIN_SHELL [ /usr/bin/env python ]
|
|||||||
from generate_h_apply import *
|
from generate_h_apply import *
|
||||||
|
|
||||||
s = H_apply("FCI")
|
s = H_apply("FCI")
|
||||||
s.set_selection_pt2("epstein_nesbet")
|
s.set_selection_pt2("epstein_nesbet_2x2")
|
||||||
print s
|
print s
|
||||||
|
|
||||||
s = H_apply("FCI_PT2")
|
s = H_apply("FCI_PT2")
|
||||||
s.set_perturbation("epstein_nesbet")
|
s.set_perturbation("epstein_nesbet_2x2")
|
||||||
print s
|
print s
|
||||||
|
|
||||||
END_SHELL
|
END_SHELL
|
||||||
|
@ -14,6 +14,10 @@ program cisd
|
|||||||
! do while (maxval(abs(pt2(1:N_st))) > 1.d-4)
|
! do while (maxval(abs(pt2(1:N_st))) > 1.d-4)
|
||||||
do while (N_det < n_det_max_fci.and.maxval(abs(pt2(1:N_st))) > pt2_max)
|
do while (N_det < n_det_max_fci.and.maxval(abs(pt2(1:N_st))) > pt2_max)
|
||||||
call H_apply_FCI(pt2, norm_pert, H_pert_diag, N_st)
|
call H_apply_FCI(pt2, norm_pert, H_pert_diag, N_st)
|
||||||
|
if (N_det > n_det_max_fci) then
|
||||||
|
N_det = n_det_max_fci
|
||||||
|
touch N_det
|
||||||
|
endif
|
||||||
call diagonalize_CI
|
call diagonalize_CI
|
||||||
call save_wavefunction
|
call save_wavefunction
|
||||||
print *, 'N_det = ', N_det
|
print *, 'N_det = ', N_det
|
||||||
@ -29,7 +33,7 @@ program cisd
|
|||||||
N_det = min(n_det_max_fci,N_det)
|
N_det = min(n_det_max_fci,N_det)
|
||||||
if(do_pt2_end)then
|
if(do_pt2_end)then
|
||||||
threshold_selectors = 1.d0
|
threshold_selectors = 1.d0
|
||||||
threshold_generators = 0.99d0
|
threshold_generators = 0.999d0
|
||||||
touch N_det psi_det psi_coef
|
touch N_det psi_det psi_coef
|
||||||
call diagonalize_CI
|
call diagonalize_CI
|
||||||
call H_apply_FCI_PT2(pt2, norm_pert, H_pert_diag, N_st)
|
call H_apply_FCI_PT2(pt2, norm_pert, H_pert_diag, N_st)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user