10
0
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-11-07 22:53:52 +01:00
QuantumPackage/src/two_body_rdm/act_2_rdm.irp.f

168 lines
6.4 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-04-27 11:31:24 +02:00
! 12 12
! 1 2 1 2 == <ij|kl>
! act_2_rdm_ab_mo(i,j,k,l,istate) = STATE SPECIFIC physicist notation for 2RDM of alpha/beta+beta/alpha 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}>
!
! + <Psi_{istate}| a^{\dagger}_{i \beta} a^{\dagger}_{j \alpha} a_{l \alpha} a_{k \beta} |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} * 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"
!
END_DOC
integer :: ispin
double precision :: wall_1, wall_2
2021-01-07 14:20:11 +01:00
character*(128) :: name_file
name_file = 'act_2_rdm_ab_mo'
2020-03-22 17:15:39 +01:00
! 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 ...'
2021-01-07 14:20:11 +01:00
call read_array_two_rdm(n_act_orb,N_states,act_2_rdm_ab_mo,name_file)
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 ...'
2021-01-07 14:20:11 +01:00
call write_array_two_rdm(n_act_orb,n_states,act_2_rdm_ab_mo,name_file)
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
act_2_rdm_ab_mo *= 2.d0
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)
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 '
2021-01-07 14:20:11 +01:00
character*(128) :: name_file
name_file = '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 ...'
2021-01-07 14:20:11 +01:00
call read_array_two_rdm(n_act_orb,N_states,act_2_rdm_aa_mo,name_file)
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 ...'
2021-01-07 14:20:11 +01:00
call write_array_two_rdm(n_act_orb,n_states,act_2_rdm_aa_mo,name_file)
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
act_2_rdm_aa_mo *= 2.d0
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)
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 '
2021-01-07 14:20:11 +01:00
character*(128) :: name_file
name_file = '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 ...'
2021-01-07 14:20:11 +01:00
call read_array_two_rdm(n_act_orb,N_states,act_2_rdm_bb_mo,name_file)
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 ...'
2021-01-07 14:20:11 +01:00
call write_array_two_rdm(n_act_orb,n_states,act_2_rdm_bb_mo,name_file)
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
act_2_rdm_bb_mo *= 2.d0
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)
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 '
2021-01-07 14:20:11 +01:00
character*(128) :: name_file
name_file = '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 ...'
2021-01-07 14:20:11 +01:00
call read_array_two_rdm(n_act_orb,N_states,act_2_rdm_spin_trace_mo,name_file)
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 ...'
2021-01-07 14:20:11 +01:00
call write_array_two_rdm(n_act_orb,n_states,act_2_rdm_spin_trace_mo,name_file)
call ezfio_set_two_body_rdm_io_two_body_rdm_spin_trace("Read")
endif
2020-03-22 17:15:39 +01:00
act_2_rdm_spin_trace_mo *= 2.d0
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