10
0
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-12-23 04:43:45 +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, n_CSF]
&BEGIN_PROVIDER [ integer, maxDetDimPerBF] &BEGIN_PROVIDER [ integer, maxDetDimPerBF]
implicit none implicit none
BEGIN_DOC BEGIN_DOC
! Documentation for NSOMOMax
! The maximum number of SOMOs for the current calculation. ! The maximum number of SOMOs for the current calculation.
! required for the calculation of prototype arrays. ! required for the calculation of prototype arrays.
END_DOC 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) 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 ! 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 NBFMax = NCSFMax
maxDetDimPerBF = max(1,nint((binom(NSOMOMax,(NSOMOMax+1)/2)))) maxDetDimPerBF = max(1,nint((binom(NSOMOMax,(NSOMOMax+1)/2))))
NMO = n_act_orb 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 detDimperBF = 0
MS = elec_alpha_num-elec_beta_num MS = elec_alpha_num-elec_beta_num
! number of cfgs = number of dets for 0 somos ! number of cfgs = number of dets for 0 somos
n_CSF = cfg_seniority_index(0)-1 n_CSF = 0
ncfgprev = cfg_seniority_index(0) ncfgprev = cfg_seniority_index(0)
do i = 0-iand(MS,1)+2, cfg_nsomo_max,2 do i = iand(MS,1), NSOMOMax-2,2
if(cfg_seniority_index(i) == -1)then if(cfg_seniority_index(i+2) .EQ. -1) then
ncfgpersomo = N_configuration + 1 ncfgpersomo = N_configuration + 1
else else
ncfgpersomo = cfg_seniority_index(i) ncfgpersomo = cfg_seniority_index(i+2)
endif endif
ncfg = ncfgpersomo - ncfgprev ncfg = ncfgpersomo - ncfgprev
if (i > 2) then if(iand(MS,1) .EQ. 0) then
bin_1 = binom(i-2, (i-2+1)/2) dimcsfpercfg = max(1,nint((binom(i,i/2)-binom(i,i/2+1))))
bin_2 = binom(i-2,((i-2+1)/2)+1)
dimcsfpercfg = max(1,int(bin_1-bin_2))
else else
dimcsfpercfg = 1 dimcsfpercfg = max(1,nint((binom(i,(i+1)/2)-binom(i,(i+3)/2))))
endif endif
n_CSF += ncfg * dimcsfpercfg n_CSF += ncfg * dimcsfpercfg
ncfgprev = cfg_seniority_index(i) ncfgprev = cfg_seniority_index(i+2)
enddo enddo
END_PROVIDER END_PROVIDER