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

init shiftedbk

This commit is contained in:
Yann Garniron 2018-03-02 15:29:58 +01:00
parent 22b2870b9f
commit 1a0f36dfa5
7 changed files with 92 additions and 13 deletions

View File

@ -774,6 +774,7 @@ subroutine get_d2(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs)
if(tip == 3) then if(tip == 3) then
puti = p(1, mi) puti = p(1, mi)
if(bannedOrb(puti, mi)) return
do i = 1, 3 do i = 1, 3
putj = p(i, ma) putj = p(i, ma)
if(banned(putj,puti,bant)) cycle if(banned(putj,puti,bant)) cycle
@ -796,11 +797,12 @@ subroutine get_d2(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs)
h2 = h(1,2) h2 = h(1,2)
do j = 1,2 do j = 1,2
putj = p(j, 2) putj = p(j, 2)
if(bannedOrb(putj, 2)) cycle
p2 = p(turn2(j), 2) p2 = p(turn2(j), 2)
do i = 1,2 do i = 1,2
puti = p(i, 1) puti = p(i, 1)
if(banned(puti,putj,bant)) cycle if(banned(puti,putj,bant) .or. bannedOrb(puti,1)) cycle
p1 = p(turn2(i), 1) p1 = p(turn2(i), 1)
hij = mo_bielec_integral(p1, p2, h1, h2) * get_phase_bi(phasemask, 1, 2, h1, p1, h2, p2) hij = mo_bielec_integral(p1, p2, h1, h2) * get_phase_bi(phasemask, 1, 2, h1, p1, h2, p2)
@ -815,8 +817,10 @@ subroutine get_d2(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs)
h2 = h(2, ma) h2 = h(2, ma)
do i=1,3 do i=1,3
puti = p(i, ma) puti = p(i, ma)
if(bannedOrb(puti,ma)) cycle
do j=i+1,4 do j=i+1,4
putj = p(j, ma) putj = p(j, ma)
if(bannedOrb(putj,ma)) cycle
if(banned(puti,putj,1)) cycle if(banned(puti,putj,1)) cycle
i1 = turn2d(1, i, j) i1 = turn2d(1, i, j)
@ -833,7 +837,9 @@ subroutine get_d2(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs)
p1 = p(1, mi) p1 = p(1, mi)
do i=1,3 do i=1,3
puti = p(turn3(1,i), ma) puti = p(turn3(1,i), ma)
if(bannedOrb(puti,ma)) cycle
putj = p(turn3(2,i), ma) putj = p(turn3(2,i), ma)
if(bannedOrb(putj,ma)) cycle
if(banned(puti,putj,1)) cycle if(banned(puti,putj,1)) cycle
p2 = p(i, ma) p2 = p(i, ma)

View File

@ -376,7 +376,7 @@ subroutine generate_singles_and_doubles(delta_ij_loc, i_generator, bitmask_index
!print *, "IND1", indexes(1,:) !print *, "IND1", indexes(1,:)
!print *, "IND2", indexes_end(1,:) !print *, "IND2", indexes_end(1,:)
!stop !stop
call alpha_callback_mask(delta_ij_loc, sp, mask, bannedOrb, banned, indexes, indexes_end, abuf, siz, iproc) call alpha_callback_mask(delta_ij_loc, i_generator, sp, mask, bannedOrb, banned, indexes, indexes_end, abuf, siz, iproc)
!call dress_with_alpha_buffer(delta_ij_loc, minilist, interesting(0), abuf, n) !call dress_with_alpha_buffer(delta_ij_loc, minilist, interesting(0), abuf, n)
end if end if
@ -388,12 +388,12 @@ subroutine generate_singles_and_doubles(delta_ij_loc, i_generator, bitmask_index
end subroutine end subroutine
subroutine alpha_callback_mask(delta_ij_loc, sp, mask, bannedOrb, banned, indexes, indexes_end, rabuf, siz, iproc) subroutine alpha_callback_mask(delta_ij_loc, i_gen, sp, mask, bannedOrb, banned, indexes, indexes_end, rabuf, siz, iproc)
use bitmasks use bitmasks
implicit none implicit none
double precision,intent(inout) :: delta_ij_loc(N_states,N_det,2) double precision,intent(inout) :: delta_ij_loc(N_states,N_det,2)
integer, intent(in) :: sp, indexes(0:mo_tot_num, 0:mo_tot_num), siz, iproc integer, intent(in) :: sp, indexes(0:mo_tot_num, 0:mo_tot_num), siz, iproc, i_gen
integer, intent(in) :: indexes_end(0:mo_tot_num, 0:mo_tot_num), rabuf(*) integer, intent(in) :: indexes_end(0:mo_tot_num, 0:mo_tot_num), rabuf(*)
logical, intent(in) :: bannedOrb(mo_tot_num,2), banned(mo_tot_num, mo_tot_num) logical, intent(in) :: bannedOrb(mo_tot_num,2), banned(mo_tot_num, mo_tot_num)
integer(bit_kind), intent(in) :: mask(N_int, 2) integer(bit_kind), intent(in) :: mask(N_int, 2)
@ -491,7 +491,7 @@ subroutine alpha_callback_mask(delta_ij_loc, sp, mask, bannedOrb, banned, indexe
call apply_particles(mask, s1, i, s2, j, alpha, ok, N_int) call apply_particles(mask, s1, i, s2, j, alpha, ok, N_int)
!if(.not. ok) stop "non existing alpha......" !if(.not. ok) stop "non existing alpha......"
!print *, "willcall", st4-1, size(labuf) !print *, "willcall", st4-1, size(labuf)
call dress_with_alpha_buffer(delta_ij_loc, labuf, det_minilist, st4-1, alpha, iproc) call dress_with_alpha_buffer(delta_ij_loc, i_gen, labuf, det_minilist, st4-1, alpha, iproc)
!call dress_with_alpha_buffer(delta_ij_loc, abuf, siz, alpha, 1) !call dress_with_alpha_buffer(delta_ij_loc, abuf, siz, alpha, 1)
end if end if
end do end do

View File

@ -285,9 +285,9 @@ subroutine dress_collector(zmq_socket_pull, E, relative_error, delta, delta_s2,
call wall_time(time) call wall_time(time)
if ((dabs(eqt) < relative_error .and. cps_N(cur_cp) >= 30) .or. total_computed == N_det_generators) then if ((dabs(eqt) < relative_error .and. cps_N(cur_cp) >= 30) .or. total_computed == N_det_generators) then
! Termination ! Termination
print "" print *,""
print "(A10,I5,F15.7,E12.4,F10.2)", "grepme", cur_cp, E+E0+avg, eqt, time-time0 print "(A10,I5,F15.7,E12.4,F10.2)", "grepme", cur_cp, E+E0+avg, eqt, time-time0
print "" print *,""
if (zmq_abort(zmq_to_qp_run_socket) == -1) then if (zmq_abort(zmq_to_qp_run_socket) == -1) then
call sleep(1) call sleep(1)
if (zmq_abort(zmq_to_qp_run_socket) == -1) then if (zmq_abort(zmq_to_qp_run_socket) == -1) then
@ -297,9 +297,9 @@ subroutine dress_collector(zmq_socket_pull, E, relative_error, delta, delta_s2,
else else
if (cur_cp > old_cur_cp) then if (cur_cp > old_cur_cp) then
old_cur_cp = cur_cp old_cur_cp = cur_cp
print "" print *,""
print "(A10,I5,F15.7,E12.4,F10.2)", "grepme", cur_cp, E+E0+avg, eqt, time-time0 print "(A10,I5,F15.7,E12.4,F10.2)", "grepme", cur_cp, E+E0+avg, eqt, time-time0
print "" print *,""
endif endif
endif endif
end if end if

View File

@ -21,7 +21,7 @@ END_PROVIDER
subroutine dress_with_alpha_buffer(delta_ij_loc, minilist, det_minilist, n_minilist, alpha, iproc) subroutine dress_with_alpha_buffer(delta_ij_loc, i_gen, minilist, det_minilist, n_minilist, alpha, iproc)
use bitmasks use bitmasks
implicit none implicit none
BEGIN_DOC BEGIN_DOC
@ -32,7 +32,7 @@ subroutine dress_with_alpha_buffer(delta_ij_loc, minilist, det_minilist, n_minil
!alpha : alpha determinant !alpha : alpha determinant
END_DOC END_DOC
integer(bit_kind), intent(in) :: alpha(N_int,2), det_minilist(N_int, 2, n_minilist) integer(bit_kind), intent(in) :: alpha(N_int,2), det_minilist(N_int, 2, n_minilist)
integer,intent(in) :: minilist(n_minilist), n_minilist, iproc integer,intent(in) :: minilist(n_minilist), n_minilist, iproc, i_gen
double precision, intent(inout) :: delta_ij_loc(N_states,N_det,2) double precision, intent(inout) :: delta_ij_loc(N_states,N_det,2)
@ -190,9 +190,9 @@ subroutine dress_with_alpha_buffer(delta_ij_loc, minilist, det_minilist, n_minil
do i_state=1,N_states do i_state=1,N_states
hdress = dIa(i_state) * hla * psi_ref_coef(i_I,i_state) hdress = dIa(i_state) * hla * psi_ref_coef(i_I,i_state)
sdress = dIa(i_state) * sla * psi_ref_coef(i_I,i_state) sdress = dIa(i_state) * sla * psi_ref_coef(i_I,i_state)
!$OMP ATOMIC !!!$OMP ATOMIC
delta_ij_loc(i_state,k_sd,1) += hdress delta_ij_loc(i_state,k_sd,1) += hdress
!$OMP ATOMIC !!!$OMP ATOMIC
delta_ij_loc(i_state,k_sd,2) += sdress delta_ij_loc(i_state,k_sd,2) += sdress
enddo enddo
enddo enddo

View File

@ -0,0 +1 @@
dress_zmq

View File

@ -0,0 +1,12 @@
=========
shiftedbk
=========
Needed Modules
==============
.. Do not edit this section It was auto-generated
.. by the `update_README.py` script.
Documentation
=============
.. Do not edit this section It was auto-generated
.. by the `update_README.py` script.

View File

@ -0,0 +1,60 @@
program mrcc_sto
implicit none
BEGIN_DOC
! TODO
END_DOC
call dress_zmq()
end
! BEGIN_PROVIDER [ double precision, hij_cache_, (N_det,Nproc) ]
!&BEGIN_PROVIDER [ double precision, sij_cache_, (N_det,Nproc) ]
BEGIN_PROVIDER [ double precision, fock_diag_tmp_, (2,mo_tot_num+1,Nproc) ]
&BEGIN_PROVIDER [ integer, current_generator_, (Nproc) ]
implicit none
! allocate(fock_diag_tmp(2,mo_tot_num+1))
current_generator_(:) = 0
END_PROVIDER
subroutine dress_with_alpha_buffer(delta_ij_loc, i_gen, minilist, det_minilist, n_minilist, alpha, iproc)
use bitmasks
implicit none
BEGIN_DOC
!delta_ij_loc(:,:,1) : dressing column for H
!delta_ij_loc(:,:,2) : dressing column for S2
!minilist : indices of determinants connected to alpha ( in psi_det_sorted )
!n_minilist : size of minilist
!alpha : alpha determinant
END_DOC
integer(bit_kind), intent(in) :: alpha(N_int,2), det_minilist(N_int, 2, n_minilist)
integer,intent(in) :: minilist(n_minilist), n_minilist, iproc, i_gen
double precision, intent(inout) :: delta_ij_loc(N_states,N_det,2)
double precision :: hii, hij, sij, delta_e
double precision, external :: diag_H_mat_elem_fock
integer :: i,j,k,l,m, l_sd
if(current_generator_(iproc) /= i_gen) then
current_generator_(iproc) = i_gen
call build_fock_tmp(fock_diag_tmp_(1,1,iproc),psi_det_generators(1,1,i_gen),N_int)
end if
!return
hii = diag_H_mat_elem_fock(psi_det_generators(1,1,i_gen),alpha,fock_diag_tmp_(1,1,iproc),N_int)
do l_sd=1,n_minilist
call i_h_j_s2(alpha,det_minilist(1,1,l_sd),N_int,hij, sij)
do i=1,N_states
delta_ij_loc(i, minilist(l_sd), 1) += hij / hii * psi_coef(minilist(l_sd), i)
end do
end do
end subroutine