9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-12-21 19:13:29 +01:00

beginning to put openmp in all_states 2rdm

This commit is contained in:
Emmanuel Giner 2020-03-20 14:36:52 +01:00
parent d04774c435
commit 068c3fa027
3 changed files with 27 additions and 27 deletions

View File

@ -1,9 +1,9 @@
BEGIN_PROVIDER [double precision, state_av_act_two_rdm_openmp_alpha_alpha_mo, (n_act_orb,n_act_orb,n_act_orb,n_act_orb)] BEGIN_PROVIDER [double precision, state_av_act_two_rdm_alpha_alpha_mo, (n_act_orb,n_act_orb,n_act_orb,n_act_orb)]
implicit none implicit none
double precision, allocatable :: state_weights(:) double precision, allocatable :: state_weights(:)
BEGIN_DOC BEGIN_DOC
! state_av_act_two_rdm_openmp_alpha_alpha_mo(i,j,k,l) = state average physicist two-body rdm restricted to the ACTIVE indices for alpha-alpha electron pairs ! state_av_act_two_rdm_alpha_alpha_mo(i,j,k,l) = state average physicist two-body rdm restricted to the ACTIVE indices for alpha-alpha electron pairs
! = <Psi| a^{\dagger}_i a^{\dagger}_j a_l a_k |Psi> ! = <Psi| a^{\dagger}_i a^{\dagger}_j a_l a_k |Psi>
END_DOC END_DOC
allocate(state_weights(N_states)) allocate(state_weights(N_states))
@ -11,20 +11,20 @@
integer :: ispin integer :: ispin
! condition for alpha/beta spin ! condition for alpha/beta spin
ispin = 1 ispin = 1
state_av_act_two_rdm_openmp_alpha_alpha_mo = 0.D0 state_av_act_two_rdm_alpha_alpha_mo = 0.D0
call wall_time(wall_1) call wall_time(wall_1)
double precision :: wall_1, wall_2 double precision :: wall_1, wall_2
call orb_range_two_rdm_state_av_openmp(state_av_act_two_rdm_openmp_alpha_alpha_mo,n_act_orb,n_act_orb,list_act,state_weights,ispin,psi_coef,size(psi_coef,2),size(psi_coef,1)) call orb_range_two_rdm_state_av_openmp(state_av_act_two_rdm_alpha_alpha_mo,n_act_orb,n_act_orb,list_act,state_weights,ispin,psi_coef,size(psi_coef,2),size(psi_coef,1))
call wall_time(wall_2) call wall_time(wall_2)
print*,'Wall time to provide state_av_act_two_rdm_openmp_alpha_alpha_mo',wall_2 - wall_1 print*,'Wall time to provide state_av_act_two_rdm_alpha_alpha_mo',wall_2 - wall_1
END_PROVIDER END_PROVIDER
BEGIN_PROVIDER [double precision, state_av_act_two_rdm_openmp_beta_beta_mo, (n_act_orb,n_act_orb,n_act_orb,n_act_orb)] BEGIN_PROVIDER [double precision, state_av_act_two_rdm_beta_beta_mo, (n_act_orb,n_act_orb,n_act_orb,n_act_orb)]
implicit none implicit none
double precision, allocatable :: state_weights(:) double precision, allocatable :: state_weights(:)
BEGIN_DOC BEGIN_DOC
! state_av_act_two_rdm_openmp_beta_beta_mo(i,j,k,l) = state average physicist two-body rdm restricted to the ACTIVE indices for beta-beta electron pairs ! state_av_act_two_rdm_beta_beta_mo(i,j,k,l) = state average physicist two-body rdm restricted to the ACTIVE indices for beta-beta electron pairs
! = <Psi| a^{\dagger}_i a^{\dagger}_j a_l a_k |Psi> ! = <Psi| a^{\dagger}_i a^{\dagger}_j a_l a_k |Psi>
END_DOC END_DOC
allocate(state_weights(N_states)) allocate(state_weights(N_states))
@ -32,20 +32,20 @@
integer :: ispin integer :: ispin
! condition for alpha/beta spin ! condition for alpha/beta spin
ispin = 2 ispin = 2
state_av_act_two_rdm_openmp_beta_beta_mo = 0.d0 state_av_act_two_rdm_beta_beta_mo = 0.d0
call wall_time(wall_1) call wall_time(wall_1)
double precision :: wall_1, wall_2 double precision :: wall_1, wall_2
call orb_range_two_rdm_state_av_openmp(state_av_act_two_rdm_openmp_beta_beta_mo,n_act_orb,n_act_orb,list_act,state_weights,ispin,psi_coef,size(psi_coef,2),size(psi_coef,1)) call orb_range_two_rdm_state_av_openmp(state_av_act_two_rdm_beta_beta_mo,n_act_orb,n_act_orb,list_act,state_weights,ispin,psi_coef,size(psi_coef,2),size(psi_coef,1))
call wall_time(wall_2) call wall_time(wall_2)
print*,'Wall time to provide state_av_act_two_rdm_openmp_beta_beta_mo',wall_2 - wall_1 print*,'Wall time to provide state_av_act_two_rdm_beta_beta_mo',wall_2 - wall_1
END_PROVIDER END_PROVIDER
BEGIN_PROVIDER [double precision, state_av_act_two_rdm_openmp_alpha_beta_mo, (n_act_orb,n_act_orb,n_act_orb,n_act_orb)] BEGIN_PROVIDER [double precision, state_av_act_two_rdm_alpha_beta_mo, (n_act_orb,n_act_orb,n_act_orb,n_act_orb)]
implicit none implicit none
double precision, allocatable :: state_weights(:) double precision, allocatable :: state_weights(:)
BEGIN_DOC BEGIN_DOC
! state_av_act_two_rdm_openmp_alpha_beta_mo(i,j,k,l) = state average physicist two-body rdm restricted to the ACTIVE indices for alpha-beta electron pairs ! state_av_act_two_rdm_alpha_beta_mo(i,j,k,l) = state average physicist two-body rdm restricted to the ACTIVE indices for alpha-beta electron pairs
! = <Psi| a^{\dagger}_{i,alpha} a^{\dagger}_{j,beta} a_{l,beta} a_{k,alpha} |Psi> ! = <Psi| a^{\dagger}_{i,alpha} a^{\dagger}_{j,beta} a_{l,beta} a_{k,alpha} |Psi>
END_DOC END_DOC
allocate(state_weights(N_states)) allocate(state_weights(N_states))
@ -55,26 +55,26 @@
print*,'' print*,''
print*,'' print*,''
print*,'' print*,''
print*,'providint state_av_act_two_rdm_openmp_alpha_beta_mo ' print*,'providint state_av_act_two_rdm_alpha_beta_mo '
ispin = 3 ispin = 3
print*,'ispin = ',ispin print*,'ispin = ',ispin
state_av_act_two_rdm_openmp_alpha_beta_mo = 0.d0 state_av_act_two_rdm_alpha_beta_mo = 0.d0
call wall_time(wall_1) call wall_time(wall_1)
double precision :: wall_1, wall_2 double precision :: wall_1, wall_2
call orb_range_two_rdm_state_av_openmp(state_av_act_two_rdm_openmp_alpha_beta_mo,n_act_orb,n_act_orb,list_act,state_weights,ispin,psi_coef,size(psi_coef,2),size(psi_coef,1)) call orb_range_two_rdm_state_av_openmp(state_av_act_two_rdm_alpha_beta_mo,n_act_orb,n_act_orb,list_act,state_weights,ispin,psi_coef,size(psi_coef,2),size(psi_coef,1))
call wall_time(wall_2) call wall_time(wall_2)
print*,'Wall time to provide state_av_act_two_rdm_openmp_alpha_beta_mo',wall_2 - wall_1 print*,'Wall time to provide state_av_act_two_rdm_alpha_beta_mo',wall_2 - wall_1
END_PROVIDER END_PROVIDER
BEGIN_PROVIDER [double precision, state_av_act_two_rdm_openmp_spin_trace_mo, (n_act_orb,n_act_orb,n_act_orb,n_act_orb)] BEGIN_PROVIDER [double precision, state_av_act_two_rdm_spin_trace_mo, (n_act_orb,n_act_orb,n_act_orb,n_act_orb)]
implicit none implicit none
BEGIN_DOC BEGIN_DOC
! state_av_act_two_rdm_openmp_spin_trace_mo(i,j,k,l) = state average physicist spin trace two-body rdm restricted to the ACTIVE indices ! state_av_act_two_rdm_spin_trace_mo(i,j,k,l) = state average physicist spin trace two-body rdm restricted to the ACTIVE indices
! The active part of the two-electron energy can be computed as: ! The active part of the two-electron energy can be computed as:
! !
! \sum_{i,j,k,l = 1, n_act_orb} state_av_act_two_rdm_openmp_spin_trace_mo(i,j,k,l) * < ii jj | kk ll > ! \sum_{i,j,k,l = 1, n_act_orb} state_av_act_two_rdm_spin_trace_mo(i,j,k,l) * < ii jj | kk ll >
! !
! with ii = list_act(i), jj = list_act(j), kk = list_act(k), ll = list_act(l) ! with ii = list_act(i), jj = list_act(j), kk = list_act(k), ll = list_act(l)
END_DOC END_DOC
@ -84,14 +84,14 @@
integer :: ispin integer :: ispin
! condition for alpha/beta spin ! condition for alpha/beta spin
ispin = 4 ispin = 4
state_av_act_two_rdm_openmp_spin_trace_mo = 0.d0 state_av_act_two_rdm_spin_trace_mo = 0.d0
integer :: i integer :: i
call wall_time(wall_1) call wall_time(wall_1)
double precision :: wall_1, wall_2 double precision :: wall_1, wall_2
print*,'providing state_av_act_two_rdm_openmp_spin_trace_mo ' print*,'providing state_av_act_two_rdm_spin_trace_mo '
call orb_range_two_rdm_state_av_openmp(state_av_act_two_rdm_openmp_spin_trace_mo,n_act_orb,n_act_orb,list_act,state_weights,ispin,psi_coef,size(psi_coef,2),size(psi_coef,1)) call orb_range_two_rdm_state_av_openmp(state_av_act_two_rdm_spin_trace_mo,n_act_orb,n_act_orb,list_act,state_weights,ispin,psi_coef,size(psi_coef,2),size(psi_coef,1))
call wall_time(wall_2) call wall_time(wall_2)
print*,'Time to provide state_av_act_two_rdm_openmp_spin_trace_mo',wall_2 - wall_1 print*,'Time to provide state_av_act_two_rdm_spin_trace_mo',wall_2 - wall_1
END_PROVIDER END_PROVIDER

View File

@ -42,10 +42,10 @@ subroutine routine_active_only
vijkl = get_two_e_integral(lorb,korb,jorb,iorb,mo_integrals_map) vijkl = get_two_e_integral(lorb,korb,jorb,iorb,mo_integrals_map)
rdmab_omp = state_av_act_two_rdm_openmp_alpha_beta_mo(l,k,j,i) rdmab_omp = state_av_act_two_rdm_alpha_beta_mo(l,k,j,i)
rdmbb_omp = state_av_act_two_rdm_openmp_beta_beta_mo(l,k,j,i) rdmbb_omp = state_av_act_two_rdm_beta_beta_mo(l,k,j,i)
rdmaa_omp = state_av_act_two_rdm_openmp_alpha_alpha_mo(l,k,j,i) rdmaa_omp = state_av_act_two_rdm_alpha_alpha_mo(l,k,j,i)
rdmtot_omp = state_av_act_two_rdm_openmp_spin_trace_mo(l,k,j,i) rdmtot_omp = state_av_act_two_rdm_spin_trace_mo(l,k,j,i)
rdmaa = all_states_act_two_rdm_alpha_alpha_mo(l,k,j,i,istate) rdmaa = all_states_act_two_rdm_alpha_alpha_mo(l,k,j,i,istate)
rdmbb = all_states_act_two_rdm_beta_beta_mo(l,k,j,i,istate) rdmbb = all_states_act_two_rdm_beta_beta_mo(l,k,j,i,istate)