9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-11-07 14:03:37 +01:00

Added function to get # of SOMOs. #143

This commit is contained in:
v1j4y 2021-02-01 18:08:13 +01:00
parent 081f8a67ab
commit 0e50ff9149
2 changed files with 30 additions and 0 deletions

View File

@ -251,6 +251,8 @@ subroutine obtain_connected_I_foralpha(Ialpha, connectedI, nconnectedI, excitati
nconnectedI = 0 nconnectedI = 0
p = 0
q = 0
Isomo = Ialpha(1,1) Isomo = Ialpha(1,1)
Idomo = Ialpha(1,2) Idomo = Ialpha(1,2)
do i=1,N_configuration do i=1,N_configuration
@ -305,3 +307,14 @@ subroutine obtain_connected_I_foralpha(Ialpha, connectedI, nconnectedI, excitati
end subroutine obtain_connected_I_foralpha end subroutine obtain_connected_I_foralpha
function getNSOMO(Icfg) result(NSOMO)
implicit none
integer(bit_kind),intent(in) :: Icfg(N_int,2)
integer :: NSOMO
integer :: i
NSOMO = 0
do i = 1,N_int
NSOMO += POPCNT(Icfg(i,1))
enddo
end function getNSOMO

View File

@ -278,6 +278,8 @@ subroutine obtain_connected_I_foralpha(Ialpha, connectedI, nconnectedI, excitati
nconnectedI = 0 nconnectedI = 0
p = 0
q = 0
Isomo = Ialpha(1,1) Isomo = Ialpha(1,1)
Idomo = Ialpha(1,2) Idomo = Ialpha(1,2)
do i=1,N_configuration do i=1,N_configuration
@ -333,3 +335,18 @@ subroutine obtain_connected_I_foralpha(Ialpha, connectedI, nconnectedI, excitati
end subroutine obtain_connected_I_foralpha end subroutine obtain_connected_I_foralpha
#+end_src #+end_src
** Function to get the NSOMOs (seniority)
#+begin_src f90 :main no :tangle configuration_CI_sigma_helpers.irp.f
function getNSOMO(Icfg) result(NSOMO)
implicit none
integer(bit_kind),intent(in) :: Icfg(N_int,2)
integer :: NSOMO
integer :: i
NSOMO = 0
do i = 1,N_int
NSOMO += POPCNT(Icfg(i,1))
enddo
end function getNSOMO
#+end_src