mirror of
https://github.com/QuantumPackage/qp2.git
synced 2024-12-25 13:03:28 +01:00
Optimizations, maybe wrong
This commit is contained in:
parent
8b5d4a5bb9
commit
46d9f3c847
@ -1,6 +1,6 @@
|
|||||||
use bitmasks
|
use bitmasks
|
||||||
|
|
||||||
BEGIN_PROVIDER [ integer(bit_kind), alphasIcfg_list , (N_int,2,N_configuration,mo_num*mo_num)]
|
BEGIN_PROVIDER [ integer(bit_kind), alphasIcfg_list , (N_int,2,N_configuration,elec_num)]
|
||||||
&BEGIN_PROVIDER [ integer, NalphaIcfg_list, (N_configuration) ]
|
&BEGIN_PROVIDER [ integer, NalphaIcfg_list, (N_configuration) ]
|
||||||
implicit none
|
implicit none
|
||||||
!use bitmasks
|
!use bitmasks
|
||||||
@ -10,41 +10,43 @@ use bitmasks
|
|||||||
! the input configuration Icfg.
|
! the input configuration Icfg.
|
||||||
END_DOC
|
END_DOC
|
||||||
|
|
||||||
integer :: idxI ! The id of the Ith CFG
|
integer :: idxI ! The id of the Ith CFG
|
||||||
integer(bit_kind) :: Icfg(N_int,2)
|
integer(bit_kind) :: Icfg(N_int,2)
|
||||||
integer :: NalphaIcfg
|
integer :: NalphaIcfg
|
||||||
logical,dimension(:,:),allocatable :: tableUniqueAlphas
|
logical,dimension(:,:),allocatable :: tableUniqueAlphas
|
||||||
integer :: listholes(mo_num)
|
integer :: listholes(mo_num)
|
||||||
integer :: holetype(mo_num) ! 1-> SOMO 2->DOMO
|
integer :: holetype(mo_num) ! 1-> SOMO 2->DOMO
|
||||||
integer :: nholes
|
integer :: nholes
|
||||||
integer :: nvmos
|
integer :: nvmos
|
||||||
integer :: listvmos(mo_num)
|
integer :: listvmos(mo_num)
|
||||||
integer :: vmotype(mo_num) ! 1 -> VMO 2 -> SOMO
|
integer :: vmotype(mo_num) ! 1 -> VMO 2 -> SOMO
|
||||||
integer*8 :: Idomo
|
integer*8 :: Idomo
|
||||||
integer*8 :: Isomo
|
integer*8 :: Isomo
|
||||||
integer*8 :: Jdomo
|
integer*8 :: Jdomo
|
||||||
integer*8 :: Jsomo
|
integer*8 :: Jsomo
|
||||||
integer*8 :: diffSOMO
|
integer*8 :: diffSOMO
|
||||||
integer*8 :: diffDOMO
|
integer*8 :: diffDOMO
|
||||||
integer*8 :: xordiffSOMODOMO
|
integer*8 :: xordiffSOMODOMO
|
||||||
integer :: ndiffSOMO
|
integer :: ndiffSOMO
|
||||||
integer :: ndiffDOMO
|
integer :: ndiffDOMO
|
||||||
integer :: nxordiffSOMODOMO
|
integer :: nxordiffSOMODOMO
|
||||||
integer :: ndiffAll
|
integer :: ndiffAll
|
||||||
integer :: i
|
integer :: i
|
||||||
integer :: j
|
integer :: j
|
||||||
integer :: k
|
integer :: k
|
||||||
integer :: kstart
|
integer :: kstart
|
||||||
integer :: kend
|
integer :: kend
|
||||||
integer :: Nsomo_I
|
integer :: Nsomo_I
|
||||||
integer :: hole
|
integer :: hole
|
||||||
integer :: p
|
integer :: p
|
||||||
integer :: q
|
integer :: q
|
||||||
integer :: countalphas
|
integer :: countalphas
|
||||||
logical :: pqAlreadyGenQ
|
logical :: pqAlreadyGenQ
|
||||||
logical :: pqExistsQ
|
logical :: pqExistsQ
|
||||||
logical :: ppExistsQ
|
logical :: ppExistsQ
|
||||||
|
|
||||||
|
double precision :: t0, t1
|
||||||
|
call wall_time(t0)
|
||||||
|
|
||||||
allocate(tableUniqueAlphas(mo_num,mo_num))
|
allocate(tableUniqueAlphas(mo_num,mo_num))
|
||||||
NalphaIcfg_list = 0
|
NalphaIcfg_list = 0
|
||||||
@ -60,19 +62,19 @@ use bitmasks
|
|||||||
nholes = 0
|
nholes = 0
|
||||||
! holes in SOMO
|
! holes in SOMO
|
||||||
do i = 1,mo_num
|
do i = 1,mo_num
|
||||||
if(POPCNT(IAND(Isomo,IBSET(0_8,i-1))) .EQ. 1) then
|
if(POPCNT(IAND(Isomo,IBSET(0_8,i-1))) .EQ. 1) then
|
||||||
nholes += 1
|
nholes += 1
|
||||||
listholes(nholes) = i
|
listholes(nholes) = i
|
||||||
holetype(nholes) = 1
|
holetype(nholes) = 1
|
||||||
endif
|
endif
|
||||||
end do
|
end do
|
||||||
! holes in DOMO
|
! holes in DOMO
|
||||||
do i = 1,mo_num
|
do i = 1,mo_num
|
||||||
if(POPCNT(IAND(Idomo,IBSET(0_8,i-1))) .EQ. 1) then
|
if(POPCNT(IAND(Idomo,IBSET(0_8,i-1))) .EQ. 1) then
|
||||||
nholes += 1
|
nholes += 1
|
||||||
listholes(nholes) = i
|
listholes(nholes) = i
|
||||||
holetype(nholes) = 2
|
holetype(nholes) = 2
|
||||||
endif
|
endif
|
||||||
end do
|
end do
|
||||||
|
|
||||||
! find vmos
|
! find vmos
|
||||||
@ -80,16 +82,17 @@ use bitmasks
|
|||||||
vmotype = -1
|
vmotype = -1
|
||||||
nvmos = 0
|
nvmos = 0
|
||||||
do i = 1,mo_num
|
do i = 1,mo_num
|
||||||
!print *,i,IBSET(0,i-1),POPCNT(IAND(Isomo,(IBSET(0_8,i-1)))), POPCNT(IAND(Idomo,(IBSET(0_8,i-1))))
|
if(IAND(Idomo,(IBSET(0_8,i-1))) .EQ. 0) then
|
||||||
if(POPCNT(IAND(Isomo,(IBSET(0_8,i-1)))) .EQ. 0 .AND. POPCNT(IAND(Idomo,(IBSET(0_8,i-1)))) .EQ. 0) then
|
if(IAND(Isomo,(IBSET(0_8,i-1))) .EQ. 0) then
|
||||||
nvmos += 1
|
nvmos += 1
|
||||||
listvmos(nvmos) = i
|
listvmos(nvmos) = i
|
||||||
vmotype(nvmos) = 1
|
vmotype(nvmos) = 1
|
||||||
else if(POPCNT(IAND(Isomo,(IBSET(0_8,i-1)))) .EQ. 1 .AND. POPCNT(IAND(Idomo,(IBSET(0_8,i-1)))) .EQ. 0 ) then
|
else if(POPCNT(IAND(Isomo,(IBSET(0_8,i-1)))) .EQ. 1) then
|
||||||
nvmos += 1
|
nvmos += 1
|
||||||
listvmos(nvmos) = i
|
listvmos(nvmos) = i
|
||||||
vmotype(nvmos) = 2
|
vmotype(nvmos) = 2
|
||||||
end if
|
end if
|
||||||
|
end if
|
||||||
end do
|
end do
|
||||||
|
|
||||||
tableUniqueAlphas = .FALSE.
|
tableUniqueAlphas = .FALSE.
|
||||||
@ -106,157 +109,161 @@ use bitmasks
|
|||||||
kend = idxI-1
|
kend = idxI-1
|
||||||
|
|
||||||
do i = 1,nholes
|
do i = 1,nholes
|
||||||
p = listholes(i)
|
p = listholes(i)
|
||||||
do j = 1,nvmos
|
do j = 1,nvmos
|
||||||
q = listvmos(j)
|
q = listvmos(j)
|
||||||
if(p .EQ. q) cycle
|
if(p .EQ. q) cycle
|
||||||
if(holetype(i) .EQ. 1 .AND. vmotype(j) .EQ. 1) then
|
if(holetype(i) .EQ. 1 .AND. vmotype(j) .EQ. 1) then
|
||||||
! SOMO -> VMO
|
! SOMO -> VMO
|
||||||
Jsomo = IBCLR(Isomo,p-1)
|
Jsomo = IBCLR(Isomo,p-1)
|
||||||
Jsomo = IBSET(Jsomo,q-1)
|
Jsomo = IBSET(Jsomo,q-1)
|
||||||
Jdomo = Idomo
|
Jdomo = Idomo
|
||||||
kstart = max(1,cfg_seniority_index(max(0,Nsomo_I-2)))
|
kstart = max(1,cfg_seniority_index(max(0,Nsomo_I-2)))
|
||||||
kend = idxI-1
|
kend = idxI-1
|
||||||
else if(holetype(i) .EQ. 1 .AND. vmotype(j) .EQ. 2) then
|
else if(holetype(i) .EQ. 1 .AND. vmotype(j) .EQ. 2) then
|
||||||
! SOMO -> SOMO
|
! SOMO -> SOMO
|
||||||
Jsomo = IBCLR(Isomo,p-1)
|
Jsomo = IBCLR(Isomo,p-1)
|
||||||
Jsomo = IBCLR(Jsomo,q-1)
|
Jsomo = IBCLR(Jsomo,q-1)
|
||||||
Jdomo = IBSET(Idomo,q-1)
|
Jdomo = IBSET(Idomo,q-1)
|
||||||
kstart = max(1,cfg_seniority_index(max(0,Nsomo_I-4)))
|
kstart = max(1,cfg_seniority_index(max(0,Nsomo_I-4)))
|
||||||
kend = idxI-1
|
kend = idxI-1
|
||||||
else if(holetype(i) .EQ. 2 .AND. vmotype(j) .EQ. 1) then
|
else if(holetype(i) .EQ. 2 .AND. vmotype(j) .EQ. 1) then
|
||||||
! DOMO -> VMO
|
! DOMO -> VMO
|
||||||
Jsomo = IBSET(Isomo,p-1)
|
Jsomo = IBSET(Isomo,p-1)
|
||||||
Jsomo = IBSET(Jsomo,q-1)
|
Jsomo = IBSET(Jsomo,q-1)
|
||||||
Jdomo = IBCLR(Idomo,p-1)
|
Jdomo = IBCLR(Idomo,p-1)
|
||||||
kstart = cfg_seniority_index(Nsomo_I)
|
kstart = cfg_seniority_index(Nsomo_I)
|
||||||
kend = idxI-1
|
kend = idxI-1
|
||||||
else if(holetype(i) .EQ. 2 .AND. vmotype(j) .EQ. 2) then
|
else if(holetype(i) .EQ. 2 .AND. vmotype(j) .EQ. 2) then
|
||||||
! DOMO -> SOMO
|
! DOMO -> SOMO
|
||||||
Jsomo = IBSET(Isomo,p-1)
|
Jsomo = IBSET(Isomo,p-1)
|
||||||
Jsomo = IBCLR(Jsomo,q-1)
|
Jsomo = IBCLR(Jsomo,q-1)
|
||||||
Jdomo = IBCLR(Idomo,p-1)
|
Jdomo = IBCLR(Idomo,p-1)
|
||||||
Jdomo = IBSET(Jdomo,q-1)
|
Jdomo = IBSET(Jdomo,q-1)
|
||||||
kstart = max(1,cfg_seniority_index(max(0,Nsomo_I-2)))
|
kstart = max(1,cfg_seniority_index(max(0,Nsomo_I-2)))
|
||||||
kend = idxI-1
|
kend = idxI-1
|
||||||
else
|
else
|
||||||
print*,"Something went wrong in obtain_associated_alphaI"
|
print*,"Something went wrong in obtain_associated_alphaI"
|
||||||
|
endif
|
||||||
|
|
||||||
|
! Again, we don't have to search from 1
|
||||||
|
! we just use seniority to find the
|
||||||
|
! first index with NSOMO - 2 to NSOMO + 2
|
||||||
|
! this is what is done in kstart, kend
|
||||||
|
|
||||||
|
pqAlreadyGenQ = .FALSE.
|
||||||
|
! First check if it can be generated before
|
||||||
|
do k = kstart, kend
|
||||||
|
diffSOMO = IEOR(Jsomo,iand(reunion_of_act_virt_bitmask(1,1),psi_configuration(1,1,k)))
|
||||||
|
ndiffSOMO = POPCNT(diffSOMO)
|
||||||
|
if((ndiffSOMO .NE. 0) .AND. (ndiffSOMO .NE. 2)) cycle
|
||||||
|
diffDOMO = IEOR(Jdomo,iand(reunion_of_act_virt_bitmask(1,1),psi_configuration(1,2,k)))
|
||||||
|
xordiffSOMODOMO = IEOR(diffSOMO,diffDOMO)
|
||||||
|
ndiffDOMO = POPCNT(diffDOMO)
|
||||||
|
nxordiffSOMODOMO = POPCNT(xordiffSOMODOMO)
|
||||||
|
nxordiffSOMODOMO += ndiffSOMO + ndiffDOMO
|
||||||
|
!if(POPCNT(IEOR(diffSOMO,diffDOMO)) .LE. 1 .AND. ndiffDOMO .LT. 3) then
|
||||||
|
if((ndiffSOMO+ndiffDOMO) .EQ. 0) then
|
||||||
|
pqAlreadyGenQ = .TRUE.
|
||||||
|
ppExistsQ = .TRUE.
|
||||||
|
EXIT
|
||||||
endif
|
endif
|
||||||
|
if((nxordiffSOMODOMO .EQ. 4) .AND. ndiffSOMO .EQ. 2) then
|
||||||
! Again, we don't have to search from 1
|
pqAlreadyGenQ = .TRUE.
|
||||||
! we just use seniorty to find the
|
EXIT
|
||||||
! first index with NSOMO - 2 to NSOMO + 2
|
|
||||||
! this is what is done in kstart, kend
|
|
||||||
|
|
||||||
pqAlreadyGenQ = .FALSE.
|
|
||||||
! First check if it can be generated before
|
|
||||||
do k = kstart, kend
|
|
||||||
diffSOMO = IEOR(Jsomo,iand(reunion_of_act_virt_bitmask(1,1),psi_configuration(1,1,k)))
|
|
||||||
ndiffSOMO = POPCNT(diffSOMO)
|
|
||||||
if((ndiffSOMO .NE. 0) .AND. (ndiffSOMO .NE. 2)) cycle
|
|
||||||
diffDOMO = IEOR(Jdomo,iand(reunion_of_act_virt_bitmask(1,1),psi_configuration(1,2,k)))
|
|
||||||
xordiffSOMODOMO = IEOR(diffSOMO,diffDOMO)
|
|
||||||
ndiffDOMO = POPCNT(diffDOMO)
|
|
||||||
nxordiffSOMODOMO = POPCNT(xordiffSOMODOMO)
|
|
||||||
nxordiffSOMODOMO += ndiffSOMO + ndiffDOMO
|
|
||||||
!if(POPCNT(IEOR(diffSOMO,diffDOMO)) .LE. 1 .AND. ndiffDOMO .LT. 3) then
|
|
||||||
if((ndiffSOMO+ndiffDOMO) .EQ. 0) then
|
|
||||||
pqAlreadyGenQ = .TRUE.
|
|
||||||
ppExistsQ = .TRUE.
|
|
||||||
EXIT
|
|
||||||
endif
|
|
||||||
if((nxordiffSOMODOMO .EQ. 4) .AND. ndiffSOMO .EQ. 2) then
|
|
||||||
pqAlreadyGenQ = .TRUE.
|
|
||||||
EXIT
|
|
||||||
endif
|
|
||||||
end do
|
|
||||||
|
|
||||||
if(pqAlreadyGenQ) cycle
|
|
||||||
|
|
||||||
pqExistsQ = .FALSE.
|
|
||||||
|
|
||||||
if(.NOT. pqExistsQ) then
|
|
||||||
tableUniqueAlphas(p,q) = .TRUE.
|
|
||||||
endif
|
endif
|
||||||
end do
|
end do
|
||||||
|
|
||||||
|
if(pqAlreadyGenQ) cycle
|
||||||
|
|
||||||
|
pqExistsQ = .FALSE.
|
||||||
|
|
||||||
|
if(.NOT. pqExistsQ) then
|
||||||
|
tableUniqueAlphas(p,q) = .TRUE.
|
||||||
|
endif
|
||||||
|
end do
|
||||||
end do
|
end do
|
||||||
|
|
||||||
!print *,tableUniqueAlphas(:,:)
|
!print *,tableUniqueAlphas(:,:)
|
||||||
|
|
||||||
! prune list of alphas
|
! prune list of alphas
|
||||||
Isomo = Icfg(1,1)
|
Isomo = Icfg(1,1)
|
||||||
Idomo = Icfg(1,2)
|
Idomo = Icfg(1,2)
|
||||||
Jsomo = Icfg(1,1)
|
Jsomo = Icfg(1,1)
|
||||||
Jdomo = Icfg(1,2)
|
Jdomo = Icfg(1,2)
|
||||||
NalphaIcfg = 0
|
NalphaIcfg = 0
|
||||||
do i = 1, nholes
|
do i = 1, nholes
|
||||||
p = listholes(i)
|
p = listholes(i)
|
||||||
do j = 1, nvmos
|
do j = 1, nvmos
|
||||||
q = listvmos(j)
|
q = listvmos(j)
|
||||||
if(p .EQ. q) cycle
|
if(p .EQ. q) cycle
|
||||||
if(tableUniqueAlphas(p,q)) then
|
if(tableUniqueAlphas(p,q)) then
|
||||||
if(holetype(i) .EQ. 1 .AND. vmotype(j) .EQ. 1) then
|
if(holetype(i) .EQ. 1 .AND. vmotype(j) .EQ. 1) then
|
||||||
! SOMO -> VMO
|
! SOMO -> VMO
|
||||||
Jsomo = IBCLR(Isomo,p-1)
|
Jsomo = IBCLR(Isomo,p-1)
|
||||||
Jsomo = IBSET(Jsomo,q-1)
|
Jsomo = IBSET(Jsomo,q-1)
|
||||||
Jdomo = Idomo
|
Jdomo = Idomo
|
||||||
else if(holetype(i) .EQ. 1 .AND. vmotype(j) .EQ. 2) then
|
else if(holetype(i) .EQ. 1 .AND. vmotype(j) .EQ. 2) then
|
||||||
! SOMO -> SOMO
|
! SOMO -> SOMO
|
||||||
Jsomo = IBCLR(Isomo,p-1)
|
Jsomo = IBCLR(Isomo,p-1)
|
||||||
Jsomo = IBCLR(Jsomo,q-1)
|
Jsomo = IBCLR(Jsomo,q-1)
|
||||||
Jdomo = IBSET(Idomo,q-1)
|
Jdomo = IBSET(Idomo,q-1)
|
||||||
else if(holetype(i) .EQ. 2 .AND. vmotype(j) .EQ. 1) then
|
else if(holetype(i) .EQ. 2 .AND. vmotype(j) .EQ. 1) then
|
||||||
! DOMO -> VMO
|
! DOMO -> VMO
|
||||||
Jsomo = IBSET(Isomo,p-1)
|
Jsomo = IBSET(Isomo,p-1)
|
||||||
Jsomo = IBSET(Jsomo,q-1)
|
Jsomo = IBSET(Jsomo,q-1)
|
||||||
Jdomo = IBCLR(Idomo,p-1)
|
Jdomo = IBCLR(Idomo,p-1)
|
||||||
else if(holetype(i) .EQ. 2 .AND. vmotype(j) .EQ. 2) then
|
else if(holetype(i) .EQ. 2 .AND. vmotype(j) .EQ. 2) then
|
||||||
! DOMO -> SOMO
|
! DOMO -> SOMO
|
||||||
Jsomo = IBSET(Isomo,p-1)
|
Jsomo = IBSET(Isomo,p-1)
|
||||||
Jsomo = IBCLR(Jsomo,q-1)
|
Jsomo = IBCLR(Jsomo,q-1)
|
||||||
Jdomo = IBCLR(Idomo,p-1)
|
Jdomo = IBCLR(Idomo,p-1)
|
||||||
Jdomo = IBSET(Jdomo,q-1)
|
Jdomo = IBSET(Jdomo,q-1)
|
||||||
else
|
else
|
||||||
print*,"Something went wrong in obtain_associated_alphaI"
|
print*,"Something went wrong in obtain_associated_alphaI"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
! SOMO
|
! SOMO
|
||||||
NalphaIcfg += 1
|
NalphaIcfg += 1
|
||||||
!print *,i,j,"|",NalphaIcfg
|
!print *,i,j,"|",NalphaIcfg
|
||||||
alphasIcfg_list(1,1,idxI,NalphaIcfg) = Jsomo
|
alphasIcfg_list(1,1,idxI,NalphaIcfg) = Jsomo
|
||||||
alphasIcfg_list(1,2,idxI,NalphaIcfg) = IOR(Jdomo,ISHFT(1_8,n_core_orb)-1)
|
alphasIcfg_list(1,2,idxI,NalphaIcfg) = IOR(Jdomo,ISHFT(1_8,n_core_orb)-1)
|
||||||
NalphaIcfg_list(idxI) = NalphaIcfg
|
NalphaIcfg_list(idxI) = NalphaIcfg
|
||||||
endif
|
endif
|
||||||
end do
|
end do
|
||||||
end do
|
end do
|
||||||
|
|
||||||
! Check if this Icfg has been previously generated as a mono
|
! Check if this Icfg has been previously generated as a mono
|
||||||
ppExistsQ = .False.
|
ppExistsQ = .False.
|
||||||
Isomo = iand(reunion_of_act_virt_bitmask(1,1),Icfg(1,1))
|
Isomo = iand(reunion_of_act_virt_bitmask(1,1),Icfg(1,1))
|
||||||
Idomo = iand(reunion_of_act_virt_bitmask(1,1),Icfg(1,2))
|
Idomo = iand(reunion_of_act_virt_bitmask(1,1),Icfg(1,2))
|
||||||
do k = 1, idxI-1
|
kstart = max(1,cfg_seniority_index(max(0,Nsomo_I-2)))
|
||||||
diffSOMO = IEOR(Isomo,iand(reunion_of_act_virt_bitmask(1,1),psi_configuration(1,1,k)))
|
do k = kstart, idxI-1
|
||||||
diffDOMO = IEOR(Idomo,iand(reunion_of_act_virt_bitmask(1,1),psi_configuration(1,2,k)))
|
diffSOMO = IEOR(Isomo,iand(reunion_of_act_virt_bitmask(1,1),psi_configuration(1,1,k)))
|
||||||
xordiffSOMODOMO = IEOR(diffSOMO,diffDOMO)
|
ndiffSOMO = POPCNT(diffSOMO)
|
||||||
ndiffSOMO = POPCNT(diffSOMO)
|
if (ndiffSOMO /= 2) cycle
|
||||||
ndiffDOMO = POPCNT(diffDOMO)
|
diffDOMO = IEOR(Idomo,iand(reunion_of_act_virt_bitmask(1,1),psi_configuration(1,2,k)))
|
||||||
nxordiffSOMODOMO = POPCNT(xordiffSOMODOMO)
|
xordiffSOMODOMO = IEOR(diffSOMO,diffDOMO)
|
||||||
if((ndiffSOMO+ndiffDOMO+nxordiffSOMODOMO .EQ. 4) .AND. ndiffSOMO .EQ. 2) then
|
ndiffDOMO = POPCNT(diffDOMO)
|
||||||
|
nxordiffSOMODOMO = POPCNT(xordiffSOMODOMO)
|
||||||
|
if((ndiffSOMO+ndiffDOMO+nxordiffSOMODOMO .EQ. 4)) then
|
||||||
ppExistsQ = .TRUE.
|
ppExistsQ = .TRUE.
|
||||||
EXIT
|
EXIT
|
||||||
endif
|
endif
|
||||||
end do
|
end do
|
||||||
! Diagonal part (pp,qq)
|
! Diagonal part (pp,qq)
|
||||||
if(nholes > 0 .AND. (.NOT. ppExistsQ))then
|
if(nholes > 0 .AND. (.NOT. ppExistsQ))then
|
||||||
! SOMO
|
! SOMO
|
||||||
NalphaIcfg += 1
|
NalphaIcfg += 1
|
||||||
alphasIcfg_list(1,1,idxI,NalphaIcfg) = Icfg(1,1)
|
alphasIcfg_list(1,1,idxI,NalphaIcfg) = Icfg(1,1)
|
||||||
alphasIcfg_list(1,2,idxI,NalphaIcfg) = Icfg(1,2)
|
alphasIcfg_list(1,2,idxI,NalphaIcfg) = Icfg(1,2)
|
||||||
NalphaIcfg_list(idxI) = NalphaIcfg
|
NalphaIcfg_list(idxI) = NalphaIcfg
|
||||||
endif
|
endif
|
||||||
|
|
||||||
NalphaIcfg = 0
|
NalphaIcfg = 0
|
||||||
enddo ! end loop idxI
|
enddo ! end loop idxI
|
||||||
|
call wall_time(t1)
|
||||||
|
print *, 'Preparation : ', t1 - t0
|
||||||
|
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
@ -416,7 +423,7 @@ END_PROVIDER
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
! Again, we don't have to search from 1
|
! Again, we don't have to search from 1
|
||||||
! we just use seniorty to find the
|
! we just use seniortiy to find the
|
||||||
! first index with NSOMO - 2 to NSOMO + 2
|
! first index with NSOMO - 2 to NSOMO + 2
|
||||||
! this is what is done in kstart, kend
|
! this is what is done in kstart, kend
|
||||||
|
|
||||||
|
@ -144,6 +144,7 @@ end subroutine get_phase_qp_to_cfg
|
|||||||
|
|
||||||
integer :: nt
|
integer :: nt
|
||||||
|
|
||||||
|
|
||||||
norm_det1 = 0.d0
|
norm_det1 = 0.d0
|
||||||
MS = elec_alpha_num - elec_beta_num
|
MS = elec_alpha_num - elec_beta_num
|
||||||
print *,"Maxbfdim=",NBFMax
|
print *,"Maxbfdim=",NBFMax
|
||||||
@ -444,7 +445,6 @@ end subroutine get_phase_qp_to_cfg
|
|||||||
print *,"Rowsmax=",rowsmax," Colsmax=",colsmax
|
print *,"Rowsmax=",rowsmax," Colsmax=",colsmax
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
!BEGIN_PROVIDER [ real*8, AIJpqContainer, (NSOMOMin:NSOMOMax,4,NSOMOMax+1,NSOMOMax+1,NBFMax,NBFMax)]
|
|
||||||
BEGIN_PROVIDER [ real*8, AIJpqContainer, (NBFMax,NBFmax,NSOMOMax+1,NSOMOMax+1,4,NSOMOMin:NSOMOMax)]
|
BEGIN_PROVIDER [ real*8, AIJpqContainer, (NBFMax,NBFmax,NSOMOMax+1,NSOMOMax+1,4,NSOMOMin:NSOMOMax)]
|
||||||
use cfunctions
|
use cfunctions
|
||||||
implicit none
|
implicit none
|
||||||
@ -476,79 +476,72 @@ end subroutine get_phase_qp_to_cfg
|
|||||||
cols = -1
|
cols = -1
|
||||||
integer*8 MS
|
integer*8 MS
|
||||||
MS = 0
|
MS = 0
|
||||||
touch AIJpqMatrixDimsList
|
|
||||||
real*8,dimension(:,:),allocatable :: meMatrix
|
real*8,dimension(:,:),allocatable :: meMatrix
|
||||||
integer maxdim
|
integer maxdim
|
||||||
!maxdim = max(rowsmax,colsmax)
|
|
||||||
! allocate matrix
|
|
||||||
!print *,"rowsmax =",rowsmax," colsmax=",colsmax
|
|
||||||
!print *,"NSOMOMax = ",NSOMOMax
|
|
||||||
! Type
|
! Type
|
||||||
! 1. SOMO -> SOMO
|
! 1. SOMO -> SOMO
|
||||||
!print *,"Doing SOMO -> SOMO"
|
AIJpqContainer = 0.d0
|
||||||
!AIJpqContainer(NSOMOMin,1,1,1,1,1) = 1.0d0
|
|
||||||
AIJpqContainer(1,1,1,1,1,NSOMOMin) = 1.0d0
|
AIJpqContainer(1,1,1,1,1,NSOMOMin) = 1.0d0
|
||||||
|
integer :: rows_old, cols_old
|
||||||
|
rows_old = -1
|
||||||
|
cols_old = -1
|
||||||
|
allocate(meMatrix(1,1))
|
||||||
do i = NSOMOMin+2, NSOMOMax, 2
|
do i = NSOMOMin+2, NSOMOMax, 2
|
||||||
Isomo = ISHFT(1_8,i)-1
|
Isomo = ISHFT(1_8,i)-1
|
||||||
do j = i-2,i-2, 2
|
j=i-2
|
||||||
if(j .GT. NSOMOMax .OR. j .LT. 0) cycle
|
if(j .GT. NSOMOMax .OR. j .LT. 0) cycle
|
||||||
!print *,"i,j=",i,j
|
nsomoi = i
|
||||||
do k = 1,i
|
do k = 1,i
|
||||||
do l = 1,i
|
orbp = k
|
||||||
|
do l = 1,i
|
||||||
|
|
||||||
! Define Jsomo
|
! Define Jsomo
|
||||||
if(k .NE. l) then
|
if(k .NE. l) then
|
||||||
Jsomo = IBCLR(Isomo, k-1)
|
Jsomo = IBCLR(Isomo, k-1)
|
||||||
Jsomo = IBCLR(Jsomo, l-1)
|
Jsomo = IBCLR(Jsomo, l-1)
|
||||||
nsomoi = i
|
nsomoj = j
|
||||||
nsomoj = j
|
else
|
||||||
else
|
Isomo = ISHFT(1_8,i)-1
|
||||||
Isomo = ISHFT(1_8,i)-1
|
Jsomo = ISHFT(1_8,i)-1
|
||||||
Jsomo = ISHFT(1_8,i)-1
|
nsomoj = i
|
||||||
nsomoi = i
|
endif
|
||||||
nsomoj = i
|
|
||||||
endif
|
|
||||||
|
|
||||||
!print *,"k,l=",k,l
|
call getApqIJMatrixDims(Isomo, &
|
||||||
!call debug_spindet(Jsomo,1)
|
Jsomo, &
|
||||||
!call debug_spindet(Isomo,1)
|
MS, &
|
||||||
|
rows, &
|
||||||
|
cols)
|
||||||
|
|
||||||
!AIJpqContainer(nsomoi,1,k,l,:,:) = 0.0d0
|
orbq = l
|
||||||
AIJpqContainer(:,:,k,l,1,nsomoi) = 0.0d0
|
if ((rows /= rows_old).or.(cols /= cols_old)) then
|
||||||
call getApqIJMatrixDims(Isomo, &
|
deallocate(meMatrix)
|
||||||
Jsomo, &
|
allocate(meMatrix(rows,cols))
|
||||||
MS, &
|
rows_old = rows
|
||||||
rows, &
|
cols_old = cols
|
||||||
cols)
|
endif
|
||||||
|
meMatrix = 0.0d0
|
||||||
orbp = k
|
! fill matrix
|
||||||
orbq = l
|
call getApqIJMatrixDriver(Isomo, &
|
||||||
allocate(meMatrix(rows,cols))
|
Jsomo, &
|
||||||
meMatrix = 0.0d0
|
orbp, &
|
||||||
! fill matrix
|
orbq, &
|
||||||
call getApqIJMatrixDriver(Isomo, &
|
MS, &
|
||||||
Jsomo, &
|
NMO, &
|
||||||
orbp, &
|
meMatrix, &
|
||||||
orbq, &
|
rows, &
|
||||||
MS, &
|
cols)
|
||||||
NMO, &
|
! i -> j
|
||||||
meMatrix, &
|
do ri = 1,rows
|
||||||
rows, &
|
do ci = 1,cols
|
||||||
cols)
|
AIJpqContainer(ri,ci,k,l,1,nsomoi) = meMatrix(ri, ci)
|
||||||
!print *, i,j,k,l,">",Isomo,Jsomo,">",rows, cols,">",rowsmax,colsmax
|
|
||||||
!call printMatrix(meMatrix,rows,cols)
|
|
||||||
! i -> j
|
|
||||||
do ri = 1,rows
|
|
||||||
do ci = 1,cols
|
|
||||||
!AIJpqContainer(nsomoi,1,k,l,ri,ci) = meMatrix(ri, ci)
|
|
||||||
AIJpqContainer(ri,ci,k,l,1,nsomoi) = meMatrix(ri, ci)
|
|
||||||
end do
|
|
||||||
end do
|
end do
|
||||||
deallocate(meMatrix)
|
|
||||||
end do
|
end do
|
||||||
end do
|
end do
|
||||||
end do
|
end do
|
||||||
end do
|
end do
|
||||||
|
deallocate(meMatrix)
|
||||||
|
|
||||||
! Type
|
! Type
|
||||||
! 2. DOMO -> VMO
|
! 2. DOMO -> VMO
|
||||||
!print *,"Doing DOMO -> VMO"
|
!print *,"Doing DOMO -> VMO"
|
||||||
|
Loading…
Reference in New Issue
Block a user