9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-11-09 06:53:38 +01:00
qp2/src/two_body_rdm/act_2_rdm.irp.f

157 lines
6.0 KiB
Fortran
Raw Normal View History

2020-03-22 17:15:39 +01:00
2020-03-22 17:21:49 +01:00
BEGIN_PROVIDER [double precision, act_2_rdm_ab_mo, (n_act_orb,n_act_orb,n_act_orb,n_act_orb,N_states)]
2020-03-22 17:15:39 +01:00
implicit none
BEGIN_DOC
2020-03-22 17:21:49 +01:00
! act_2_rdm_ab_mo(i,j,k,l,istate) = STATE SPECIFIC physicist notation for 2RDM of alpha/beta electrons
2020-03-22 17:15:39 +01:00
!
! <Psi_{istate}| a^{\dagger}_{i \alpha} a^{\dagger}_{j \beta} a_{l \beta} a_{k \alpha} |Psi_{istate}>
!
! WHERE ALL ORBITALS (i,j,k,l) BELONGS TO AN ACTIVE SPACE DEFINED BY "list_act"
!
! THE NORMALIZATION (i.e. sum of diagonal elements) IS SET TO N_{\alpha}^{act} * N_{\beta}^{act}
2020-03-22 17:15:39 +01:00
!
! !!!!! WARNING !!!!! ALL SLATER DETERMINANTS IN PSI_DET MUST BELONG TO AN ACTIVE SPACE DEFINED BY "list_act"
!
! !!!!! WARNING !!!!! For efficiency reasons, electron 1 is alpha, electron 2 is beta
!
2020-03-22 17:21:49 +01:00
! act_2_rdm_ab_mo(i,j,k,l,istate) = i:alpha, j:beta, j:alpha, l:beta
2020-03-22 17:15:39 +01:00
!
! Therefore you don't necessary have symmetry between electron 1 and 2
2020-03-22 17:15:39 +01:00
END_DOC
integer :: ispin
double precision :: wall_1, wall_2
! condition for alpha/beta spin
print*,''
2020-03-22 17:21:49 +01:00
print*,'Providing act_2_rdm_ab_mo '
2020-03-22 17:15:39 +01:00
ispin = 3
2020-03-22 17:21:49 +01:00
act_2_rdm_ab_mo = 0.d0
2020-04-21 15:08:10 +02:00
provide mo_two_e_integrals_in_map
2020-03-22 17:15:39 +01:00
call wall_time(wall_1)
if(read_two_body_rdm_ab)then
print*,'Reading act_2_rdm_ab_mo from disk ...'
call ezfio_get_two_body_rdm_two_rdm_ab_disk(act_2_rdm_ab_mo)
else
call orb_range_2_rdm_openmp(act_2_rdm_ab_mo,n_act_orb,n_act_orb,list_act,ispin,psi_coef,size(psi_coef,2),size(psi_coef,1))
endif
if(write_two_body_rdm_ab)then
print*,'Writing act_2_rdm_ab_mo on disk ...'
call ezfio_set_two_body_rdm_two_rdm_ab_disk(act_2_rdm_ab_mo)
call ezfio_set_two_body_rdm_io_two_body_rdm_ab("Read")
endif
2020-03-22 17:15:39 +01:00
call wall_time(wall_2)
2020-03-22 17:21:49 +01:00
print*,'Wall time to provide act_2_rdm_ab_mo',wall_2 - wall_1
2020-03-22 17:15:39 +01:00
END_PROVIDER
2020-03-22 17:21:49 +01:00
BEGIN_PROVIDER [double precision, act_2_rdm_aa_mo, (n_act_orb,n_act_orb,n_act_orb,n_act_orb,N_states)]
2020-03-22 17:15:39 +01:00
implicit none
BEGIN_DOC
! act_2_rdm_aa_mo(i,j,k,l,istate) = STATE SPECIFIC physicist notation for 2RDM of ALPHA/ALPHA electrons
2020-03-22 17:15:39 +01:00
!
! <Psi_{istate}| a^{\dagger}_{i \alpha} a^{\dagger}_{j \alpha} a_{l \alpha} a_{k \alpha} |Psi_{istate}>
2020-03-22 17:15:39 +01:00
!
! WHERE ALL ORBITALS (i,j,k,l) BELONGS TO AN ACTIVE SPACE DEFINED BY "list_act"
2020-03-22 17:15:39 +01:00
!
! THE NORMALIZATION (i.e. sum of diagonal elements) IS SET TO N_{\alpha}^{act} * (N_{\alpha}^{act} - 1)/2
2020-03-22 17:15:39 +01:00
!
! !!!!! WARNING !!!!! ALL SLATER DETERMINANTS IN PSI_DET MUST BELONG TO AN ACTIVE SPACE DEFINED BY "list_act"
2020-03-22 17:15:39 +01:00
END_DOC
integer :: ispin
double precision :: wall_1, wall_2
! condition for alpha/beta spin
print*,''
2020-03-22 17:21:49 +01:00
print*,'Providing act_2_rdm_aa_mo '
2020-03-22 17:15:39 +01:00
ispin = 1
2020-03-22 17:21:49 +01:00
act_2_rdm_aa_mo = 0.d0
2020-03-22 17:15:39 +01:00
call wall_time(wall_1)
if(read_two_body_rdm_aa)then
print*,'Reading act_2_rdm_aa_mo from disk ...'
call ezfio_get_two_body_rdm_two_rdm_aa_disk(act_2_rdm_aa_mo)
else
call orb_range_2_rdm_openmp(act_2_rdm_aa_mo,n_act_orb,n_act_orb,list_act,ispin,psi_coef,size(psi_coef,2),size(psi_coef,1))
endif
if(write_two_body_rdm_aa)then
print*,'Writing act_2_rdm_aa_mo on disk ...'
call ezfio_set_two_body_rdm_two_rdm_aa_disk(act_2_rdm_aa_mo)
call ezfio_set_two_body_rdm_io_two_body_rdm_aa("Read")
endif
2020-03-22 17:15:39 +01:00
call wall_time(wall_2)
2020-03-22 17:21:49 +01:00
print*,'Wall time to provide act_2_rdm_aa_mo',wall_2 - wall_1
2020-03-22 17:15:39 +01:00
END_PROVIDER
2020-03-22 17:21:49 +01:00
BEGIN_PROVIDER [double precision, act_2_rdm_bb_mo, (n_act_orb,n_act_orb,n_act_orb,n_act_orb,N_states)]
2020-03-22 17:15:39 +01:00
implicit none
BEGIN_DOC
! act_2_rdm_bb_mo(i,j,k,l,istate) = STATE SPECIFIC physicist notation for 2RDM of BETA/BETA electrons
2020-03-22 17:15:39 +01:00
!
! <Psi_{istate}| a^{\dagger}_{i \beta} a^{\dagger}_{j \beta} a_{l \beta} a_{k \beta} |Psi_{istate}>
2020-03-22 17:15:39 +01:00
!
! WHERE ALL ORBITALS (i,j,k,l) BELONGS TO AN ACTIVE SPACE DEFINED BY "list_act"
2020-03-22 17:15:39 +01:00
!
! THE NORMALIZATION (i.e. sum of diagonal elements) IS SET TO N_{\beta}^{act} * (N_{\beta}^{act} - 1)/2
2020-03-22 17:15:39 +01:00
!
! !!!!! WARNING !!!!! ALL SLATER DETERMINANTS IN PSI_DET MUST BELONG TO AN ACTIVE SPACE DEFINED BY "list_act"
2020-03-22 17:15:39 +01:00
END_DOC
integer :: ispin
double precision :: wall_1, wall_2
! condition for beta/beta spin
print*,''
2020-03-22 17:21:49 +01:00
print*,'Providing act_2_rdm_bb_mo '
2020-03-22 17:15:39 +01:00
ispin = 2
2020-03-22 17:21:49 +01:00
act_2_rdm_bb_mo = 0.d0
2020-03-22 17:15:39 +01:00
call wall_time(wall_1)
if(read_two_body_rdm_bb)then
print*,'Reading act_2_rdm_bb_mo from disk ...'
call ezfio_get_two_body_rdm_two_rdm_bb_disk(act_2_rdm_bb_mo)
else
call orb_range_2_rdm_openmp(act_2_rdm_bb_mo,n_act_orb,n_act_orb,list_act,ispin,psi_coef,size(psi_coef,2),size(psi_coef,1))
endif
if(write_two_body_rdm_bb)then
print*,'Writing act_2_rdm_bb_mo on disk ...'
call ezfio_set_two_body_rdm_two_rdm_bb_disk(act_2_rdm_bb_mo)
call ezfio_set_two_body_rdm_io_two_body_rdm_bb("Read")
endif
2020-03-22 17:15:39 +01:00
call wall_time(wall_2)
2020-03-22 17:21:49 +01:00
print*,'Wall time to provide act_2_rdm_bb_mo',wall_2 - wall_1
2020-03-22 17:15:39 +01:00
END_PROVIDER
2020-03-22 17:21:49 +01:00
BEGIN_PROVIDER [double precision, act_2_rdm_spin_trace_mo, (n_act_orb,n_act_orb,n_act_orb,n_act_orb,N_states)]
2020-03-22 17:15:39 +01:00
implicit none
BEGIN_DOC
! act_2_rdm_spin_trace_mo(i,j,k,l,istate) = STATE SPECIFIC physicist notation for 2RDM
2020-03-22 17:15:39 +01:00
!
! \sum_{\sigma,\sigma'}<Psi_{istate}| a^{\dagger}_{i \sigma} a^{\dagger}_{j \sigma'} a_{l \sigma'} a_{k \sigma} |Psi_{istate}>
2020-03-22 17:15:39 +01:00
!
! WHERE ALL ORBITALS (i,j,k,l) BELONGS TO AN ACTIVE SPACE DEFINED BY "list_act"
2020-03-22 17:15:39 +01:00
!
! THE NORMALIZATION (i.e. sum of diagonal elements) IS SET TO N_{elec}^{act} * (N_{elec}^{act} - 1)/2
2020-03-22 17:15:39 +01:00
!
! !!!!! WARNING !!!!! ALL SLATER DETERMINANTS IN PSI_DET MUST BELONG TO AN ACTIVE SPACE DEFINED BY "list_act"
2020-03-22 17:15:39 +01:00
END_DOC
integer :: ispin
double precision :: wall_1, wall_2
! condition for beta/beta spin
print*,''
2020-03-22 17:21:49 +01:00
print*,'Providing act_2_rdm_spin_trace_mo '
2020-03-22 17:15:39 +01:00
ispin = 4
2020-03-22 17:21:49 +01:00
act_2_rdm_spin_trace_mo = 0.d0
2020-03-22 17:15:39 +01:00
call wall_time(wall_1)
if(read_two_body_rdm_spin_trace)then
print*,'Reading act_2_rdm_spin_trace_mo from disk ...'
call ezfio_get_two_body_rdm_two_rdm_spin_trace_disk(act_2_rdm_spin_trace_mo)
else
call orb_range_2_rdm_openmp(act_2_rdm_spin_trace_mo,n_act_orb,n_act_orb,list_act,ispin,psi_coef,size(psi_coef,2),size(psi_coef,1))
endif
if(write_two_body_rdm_spin_trace)then
print*,'Writing act_2_rdm_spin_trace_mo on disk ...'
call ezfio_set_two_body_rdm_two_rdm_spin_trace_disk(act_2_rdm_spin_trace_mo)
call ezfio_set_two_body_rdm_io_two_body_rdm_spin_trace("Read")
endif
2020-03-22 17:15:39 +01:00
call wall_time(wall_2)
2020-03-22 17:21:49 +01:00
print*,'Wall time to provide act_2_rdm_spin_trace_mo',wall_2 - wall_1
2020-03-22 17:15:39 +01:00
END_PROVIDER