10
0
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-12-22 20:34:58 +01:00
This commit is contained in:
Anthony Scemama 2021-05-31 19:03:15 +02:00
commit bb4ff7fbce

View File

@ -5,56 +5,45 @@
&BEGIN_PROVIDER [ integer, n_CSF]
&BEGIN_PROVIDER [ integer, maxDetDimPerBF]
implicit none
BEGIN_DOC
! Documentation for NSOMOMax
! The maximum number of SOMOs for the current calculation.
! required for the calculation of prototype arrays.
END_DOC
integer :: i,j,k,l
integer :: startdet,enddet
integer :: ncfg,ncfgprev
integer :: NSOMO
integer :: dimcsfpercfg
integer :: detDimperBF
real*8 :: coeff
integer :: MS
integer :: ncfgpersomo
double precision :: bin_1, bin_2
NSOMOMax = min(elec_num, cfg_nsomo_max + 2)
bin_1 = binom(NSOMOMax, (NSOMOMax+1)/2)
bin_2 = binom(NSOMOMax,((NSOMOMax+1)/2)+1)
! Note that here we need NSOMOMax + 2 sizes
NCSFMax = max(1,int(bin_1-bin_2))
NCSFMax = max(1,nint((binom(NSOMOMax,(NSOMOMax+1)/2)-binom(NSOMOMax,((NSOMOMax+1)/2)+1)))) ! TODO: NCSFs for MS=0
NBFMax = NCSFMax
maxDetDimPerBF = max(1,nint((binom(NSOMOMax,(NSOMOMax+1)/2))))
NMO = n_act_orb
integer i,j,k,l
integer startdet,enddet
integer ncfg,ncfgprev
integer NSOMO
integer dimcsfpercfg
integer detDimperBF
real*8 :: coeff
integer MS
integer ncfgpersomo
detDimperBF = 0
MS = elec_alpha_num-elec_beta_num
! number of cfgs = number of dets for 0 somos
n_CSF = cfg_seniority_index(0)-1
n_CSF = 0
ncfgprev = cfg_seniority_index(0)
do i = 0-iand(MS,1)+2, cfg_nsomo_max,2
if(cfg_seniority_index(i) == -1)then
do i = iand(MS,1), NSOMOMax-2,2
if(cfg_seniority_index(i+2) .EQ. -1) then
ncfgpersomo = N_configuration + 1
else
ncfgpersomo = cfg_seniority_index(i)
ncfgpersomo = cfg_seniority_index(i+2)
endif
ncfg = ncfgpersomo - ncfgprev
if (i > 2) then
bin_1 = binom(i-2, (i-2+1)/2)
bin_2 = binom(i-2,((i-2+1)/2)+1)
dimcsfpercfg = max(1,int(bin_1-bin_2))
if(iand(MS,1) .EQ. 0) then
dimcsfpercfg = max(1,nint((binom(i,i/2)-binom(i,i/2+1))))
else
dimcsfpercfg = 1
dimcsfpercfg = max(1,nint((binom(i,(i+1)/2)-binom(i,(i+3)/2))))
endif
n_CSF += ncfg * dimcsfpercfg
ncfgprev = cfg_seniority_index(i)
ncfgprev = cfg_seniority_index(i+2)
enddo
END_PROVIDER