CONGEN  5.0
Configuration generation for SCATCI
congen_distribution Module Reference

Distribute electrons to available orbitals.

Functions/Subroutines

subroutine, private assign (nshl, ndist, nused, refcon, excon, qnstor, nx, nftw)
 Assign quantum numbers to real shells. More...
 
subroutine, private cgcoef (j1, j2, j3, m3, n, ms, c, intpfg)
 Clebsch-Gordan coefficients. More...
 
subroutine, private getsa (ne, l, is, isz, m, nc, c, iso)
 Form ne electrons in a shell coupled to (l,is). More...
 
subroutine, private getsm (ne, isz, nc, c, iso)
 Form ne electrons in a shell coupled to (l,is). More...
 
subroutine, private getso (ns, intpfg, nti, iqns, ci, nd, id, cd, last)
 ? More...
 
subroutine, private cplea (nncsf, nadel, x, nftw)
 Loop through (and fill) all allowed couplings for a given electron distribution into shells. More...
 
subroutine, private cplem (nncsf, nadel, x, nftw)
 ? More...
 
subroutine, public distrb (nelecp, nshlp, shlmx, occshl, nslsv, kdssv, loopf, ksss, pqn, occst, shlmx1, pqnst, mshl, mshlst, gushl, gushst, cup, cupst, ndprod, symtyp, confpf, sshl, sshlst, ncsf, nncsf, nadel, nndel, x, nftw)
 Distribute electrons to spin-orbitals. More...
 
subroutine, private packdet (iqn, ni, jqn, nj, ci, cj, nt)
 Copy determinant data. More...
 
subroutine, private print1 (qnstor)
 ? More...
 
subroutine, private print2 (iidis1)
 ? More...
 
subroutine, private print3 (iidis1, i13)
 ? More...
 
subroutine, private print4 (nd, x, ix)
 ? More...
 
subroutine, private print5 (nd, ndi)
 ? More...
 
subroutine, private state (ns, x, last, nd, confpf)
 ? More...
 
subroutine wfcple (nam, iqn, isz, icup, iqns, c, last, lc2, intpfg)
 ? More...
 
subroutine, private wfn (nncsf, nadel, iidist, iidis3, nodi, ndi, cdi, ndel, pqnshl, x, ix, nx)
 TODO... More...
 

Function/Subroutine Documentation

◆ assign()

subroutine, private congen_distribution::assign ( integer, intent(in)  nshl,
integer, intent(inout)  ndist,
integer, intent(out)  nused,
integer, dimension(nobt,max(ntcon,1)), intent(in)  refcon,
integer, dimension(nobt), intent(inout)  excon,
integer, dimension(*), intent(out)  qnstor,
integer, intent(in)  nx,
integer, intent(in)  nftw 
)
private
Parameters
nshlNumber of shells.
ndistNumber of distributions generated from a given set of shells.
nusedNumber of slots used for finally assigned shells.
refcon?
excon?
qnstorFinally assigned quantum numbers.
nxDimension of x overlayed with qnstor.
nftwText output file unit.

Definition at line 53 of file congen_distribution.f90.

References congen_data::ift, congen_data::nobi, congen_data::nobt, congen_data::nrcon, congen_data::nshsym, congen_data::nst, congen_data::ntcon, congen_data::occshl, congen_data::pqnst, congen_data::qnshlr, congen_data::sshlst, and congen_data::test.

Referenced by cplea(), and cplem().

Here is the caller graph for this function:

◆ cgcoef()

subroutine, private congen_distribution::cgcoef ( integer, intent(in)  j1,
integer, intent(in)  j2,
integer, intent(in)  j3,
integer, intent(in)  m3,
integer, intent(inout)  n,
integer, dimension(2,*), intent(inout)  ms,
real(kind=wp), dimension(*), intent(inout)  c,
integer, intent(in)  intpfg 
)
private

Evaluates all Clebsch-Gordan coefficients for given \( j_1, j_2, j_2 \) and \( m_3 \).

Parameters
j1Angular momentum 1.
j2Angular momentum 2.
j3Angular momentum 3.
m3Angular momentum projection 3.
nOn return, number of (m1, m2) pairs giving non-zero Clebsch-Gordan coefficients.
msOn return, pairs of projections m1, m2 for angular momenta j1 and j2.
cOn return, array of resulting n Clebsch-Gordan coefficients.
intpfgRequested text output intensity.

Definition at line 197 of file congen_distribution.f90.

References congen_data::binom, congen_data::ind, congen_data::nftw, and congen_data::thresh1.

Referenced by wfcple().

Here is the caller graph for this function:

◆ cplea()

subroutine, private congen_distribution::cplea ( integer  nncsf,
integer  nadel,
real(wp), dimension(*), target  x,
integer  nftw 
)
private
    CUPSET IS THE ENTRY TO SET LOCATIONS OF ARRAYS
        MSHL(NSHL)     SYMMETRY NUMBER FROM ZERO TO N-1 (MVALUE)
        QNSHL(3,2*NSHL-1)
                       1 -- MULT / 2 -- SYMMETRY / 3 -- +- (NOT USED)
        CUP(3,NSHL-1)
        QNTOT(3)       TOTAL QN'S
        SPNMIN(NSHL-1) TEMP STORAGE FOR LOWEST SPIN COUPLING
        X(NX)          WORK AREA (R*8)
        NSHL           NUMBER OF TRUE SHELLS OCCUPIED
        NSTATE         NUMBER OF COUPLINGS (COMPUTED)
        NTYPE          PROTO-TYPE NUMBER (INPUT)
        NDIST          NUMBER OF PQN ASSIGNMENTS
        NCSF           RUNNING CSF NUMBER
        SYMTYP         GE 2 FOR MOLECULE
        CONPF          PRINT FLAG

        GUSHELL(NSHL)  GU VALUE FOR EACH SHELL
        SHLMX(NSHL)    MAX OCCUPATION FOR A SHELL
        OCCSHL(NSHL)   COMPRESSED SHELL OCC'S / ALL ZEROS DELETED
                       AND PSEUDO SHELLS EXPANDED
        QNSHL(3,NSHL)  FIRST INDEX = 1 MULTIPLICITY FOR EACH COUPLING
                       FIRST INDEX = 2 M-VALUE FOR EACH COUPLING
                       FIRST INDEX = 3 +1 FOR (S+) -1 FOR (S-)
                                       OTHERWIZE ZERO
        CUP(3,NSHL)    COUPLING SCEME IN ORDER STATE A TO STATE B
                       GIVES STATE C
        QNTOT(3)       INPUT STATE TO BE SEARCHED FOR. ORDER: MULTI-
                       PLICITY,ANG.MOM., PLUS(+1) OR MINUS(-1)
        GUTOT          G(+1) OR U(-1) FOR INPUT STATE
        KSLIM(2,NSHL)  FIRST INDEX = 1  IS NUMBER OF STATES
                       ALREDY LOOPED OVER IN A SHELL
                       FIRST INDEX = 2 IS THE NUMBER OF STATES FOR
                       A SHELL
        MCLIM(2,NSHL)  FIRST INDEX = 1 IS THE NUMBER OF STATES
                       ALREADY LOOPED OVER IN A COUPLING
                       FIRST INDEX = 2 IS THE MAXIMUM NUMBER OF STATES
                       IN A COUPLING
        QNTMP(2,3,NSHL) FIRST INDEX POINTS ON + OR
        QNTMP(2,3,NSHL) FIRST INDEX POINTS ON +- AND M(2 AND 1 RESP.)
                       SECOND INDEX POINTS ON POSSIBLE COUPLINGS
                       (M+M,M-M,2*M,S+,S-) SAVE AREA DOWN THE LOOPS
        SPNMIN(NSHL)   MIN MULTIPLICITY FOR A COUPLING

Definition at line 574 of file congen_distribution.f90.

References assign(), congen_data::cdimx, congen_data::confpf, congen_data::cup, congen_data::gushl, congen_data::gutot, congen_data::icdi, congen_data::iexcon, congen_data::indi, congen_data::inodi, congen_data::iqnstr, congen_data::irfcon, congen_data::kslim, congen_data::lg, congen_data::mclim, congen_data::mshl, congen_data::ndel, congen_data::ndimx, congen_data::ndist, congen_data::next, congen_data::nndel, congen_data::nodimx, congen_data::nshl, congen_data::nstate, congen_data::nx, congen_data::occshl, print1(), print2(), print3(), congen_data::qnshl, congen_data::qntar, congen_data::qntot, congen_data::shlmx1, congen_data::spnmin, and wfn().

Referenced by distrb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cplem()

subroutine, private congen_distribution::cplem ( integer  nncsf,
integer  nadel,
real(wp), dimension(*), target  x,
integer  nftw 
)
private
Parameters
nncsfNumber of CSFs (total).
nadelNumber of processed configurations.
xReal workspace (or the free part of it).
nftwText output unit.

Definition at line 801 of file congen_distribution.f90.

References assign(), congen_data::confpf, congen_data::cup, congen_data::icdi, congen_data::iexcon, congen_data::indi, congen_data::inodi, congen_data::iqnstr, congen_data::irfcon, congen_data::lg, congen_data::mshl, congen_data::ndel, congen_data::ndist, congen_data::next, congen_data::nndel, congen_data::nshl, congen_data::nstate, congen_data::nx, congen_data::occshl, print1(), print2(), print3(), congen_data::qnshl, congen_data::qntar, congen_data::qntot, congen_data::shlmx1, congen_data::spnmin, and wfn().

Referenced by distrb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ distrb()

subroutine, public congen_distribution::distrb ( integer, dimension(*), intent(in)  nelecp,
integer, dimension(*), intent(in)  nshlp,
integer, dimension(*), intent(in)  shlmx,
integer, dimension(*), intent(inout)  occshl,
integer, dimension(*), intent(inout)  nslsv,
integer, dimension(*), intent(inout)  kdssv,
integer, dimension(*), intent(inout)  loopf,
integer, dimension(*), intent(inout)  ksss,
integer, dimension(3,*), intent(in)  pqn,
integer, dimension(*), intent(inout)  occst,
integer, dimension(*), intent(in)  shlmx1,
integer, dimension(3,*), intent(out)  pqnst,
integer, dimension(*), intent(in)  mshl,
integer, dimension(*), intent(out)  mshlst,
integer, dimension(*), intent(in)  gushl,
integer, dimension(*), intent(out)  gushst,
integer, dimension(3,*), intent(in)  cup,
integer, dimension(3,*), intent(inout)  cupst,
integer, intent(in)  ndprod,
integer, intent(in)  symtyp,
integer, intent(in)  confpf,
integer, dimension(*), intent(in)  sshl,
integer, dimension(*), intent(out)  sshlst,
integer, intent(in)  ncsf,
integer  nncsf,
integer  nadel,
integer, intent(in)  nndel,
real(kind=wp), dimension(*)  x,
integer  nftw 
)

This subroutine will generate all possible configuration state functions subject to setup and constraints set by the input namelist. All generated configurations are normally stored in the global arrays nodi, ndi and cdi, but if the storage is about to overflow (which is very likely for large molecules), it is flushed to the output file sooner (see congen_distribution::wfn), providing space for further configurations.

Parameters
nelecpNumber of electrons per set of orbitals.
nshlpNumber of shells in a set of orbitals.
shlmxMax occupation of a shell or a pseudoshell.
occshlOn return, occupation of shells / pseudoshells.
nslsvSave area for index, per shell.
kdssv?
loopfPointer for zero occup or pseudoshell, per shell.
ksssSave area for index, per shell.
pqnShell data (triplet per shell): 1st == 0 (pseudoshell) or /= 0 (real shell index), 2nd start index for pseudoshell, 3rd end index for pseudoshell.
occst?
shlmx1?
pqnst?
mshlQuantum number of a shell or of a pseudoshell, per shell.
mshlst?
gushlGerade/ungerade flag, per shell.
gushst?
cupCoupling scheme.
cupstExpanded shells with zeroes deleted.
ndprodNumber of sets of orbitals.
symtypSymmetry group flag (< 2 diatomic, >= 2 abelian).
confpf?
sshl?
sshlst?
ncsf?
nncsf?
nadel?
nndel?
xReal workspace.
nftwUnit for text output of the program.

Definition at line 994 of file congen_distribution.f90.

References congen_data::confpf, cplea(), cplem(), congen_data::ncsf, congen_data::ndist, congen_data::nshl, congen_data::nstate, and congen_data::ntyp.

Referenced by congen_driver::csfgen().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getsa()

subroutine, private congen_distribution::getsa ( integer, intent(in)  ne,
integer, intent(in)  l,
integer, intent(in)  is,
integer, intent(in)  isz,
integer, intent(in)  m,
integer, intent(out)  nc,
real(kind=wp), dimension(*), intent(out)  c,
integer, dimension(*), intent(inout)  iso 
)
private

This version is for linear molecules (Alchemy).

Parameters
neNumber of electrons.
lLambda of shell.
isSpin of coupled shell (is=2*s+1).
isz2*sz+1
mProjection of lambda of coupled shell.
ncNumber of determinants required for shell.
cCoefficient of determinant,
isoSpin-orbitals for determinants according to the following table
                  0    sa        0    l+a
                  1    sb        1    l+b
                                 2    l-a
                                 3    l-b

Definition at line 289 of file congen_distribution.f90.

References congen_data::root2.

Referenced by getso().

Here is the caller graph for this function:

◆ getsm()

subroutine, private congen_distribution::getsm ( integer, intent(in)  ne,
integer, intent(in)  isz,
integer, intent(out)  nc,
real(kind=wp), dimension(*), intent(out)  c,
integer, dimension(*), intent(out)  iso 
)
private

This version is for non-linear molecules (Molecule).

Parameters
neNumber of electrons
isz2*sz+1
ncNumber of determinants required for shell.
cCoefficient of determinant.
isoSpin-orbitals for determinants according to the following table:
                  0    sa        0    l+a
                  1    sb        1    l+b
                                 2    l-a
                                 3    l-b

Definition at line 374 of file congen_distribution.f90.

Referenced by getso().

Here is the caller graph for this function:

◆ getso()

subroutine, private congen_distribution::getso ( integer, intent(in)  ns,
integer, intent(in)  intpfg,
integer, intent(in)  nti,
integer, dimension(2,ns,*), intent(in)  iqns,
real(kind=wp), dimension(*), intent(in)  ci,
integer, intent(inout)  nd,
integer, dimension(*), intent(inout)  id,
real(kind=wp), dimension(*), intent(inout)  cd,
integer, intent(in)  last 
)
private
Parameters
ns?
intpfgPrint level flag.
nti?
iqns?
ci?
nd?
id?
cd?
last?

Definition at line 416 of file congen_distribution.f90.

References getsa(), getsm(), congen_data::mshl, congen_data::ne, congen_data::nftw, congen_data::nnlecg, congen_data::occshl, congen_data::qnshl, and congen_data::symtyp.

Referenced by state().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ packdet()

subroutine, private congen_distribution::packdet ( integer, dimension(2,ni,*), intent(in)  iqn,
integer, intent(in)  ni,
integer, dimension(2,nj,*), intent(out)  jqn,
integer, intent(in)  nj,
real(kind=wp), dimension(*), intent(in)  ci,
real(kind=wp), dimension(*), intent(out)  cj,
integer, intent(in)  nt 
)
private

Whatever was this function originally designed for, it just straghtforwardly copies arrays of data.

Parameters
iqnSource data for jqn.
niSecond rank of iqn.
jqnDestination for data from iqn.
njSecond rank of jqn.
ciSource data for cj.
cjDestination for data from ci.
ntMinimal dimension of of ci and cj and of the third rank of iqn and jqn.

Definition at line 1280 of file congen_distribution.f90.

Referenced by state().

Here is the caller graph for this function:

◆ print1()

◆ print2()

subroutine, private congen_distribution::print2 ( integer, intent(in)  iidis1)
private

◆ print3()

subroutine, private congen_distribution::print3 ( integer, intent(in)  iidis1,
integer, intent(in)  i13 
)
private

◆ print4()

subroutine, private congen_distribution::print4 ( integer, intent(in)  nd,
real(kind=wp), dimension(*), intent(in)  x,
integer, dimension(*), intent(in)  ix 
)
private

Definition at line 1507 of file congen_distribution.f90.

References congen_pagecontrol::addl(), congen_data::ne, congen_data::nftw, and congen_pagecontrol::space().

Referenced by wfn().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ print5()

subroutine, private congen_distribution::print5 ( integer, intent(in)  nd,
integer, dimension(*), intent(in)  ndi 
)
private

Definition at line 1551 of file congen_distribution.f90.

References congen_pagecontrol::addl(), congen_data::ncsf, and congen_data::nftw.

Referenced by wfn().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ state()

subroutine, private congen_distribution::state ( integer  ns,
real(kind=wp), dimension(*), intent(inout), target  x,
integer, intent(in)  last,
integer, intent(inout)  nd,
integer, intent(in)  confpf 
)
private
Parameters
nsActually, this is just reference to the global congen_data::nshl (number of shells in the set of orbitals currently being processed.)
xReal workspace (or the currently free part of it).
lastNumber of available elements in the workspace.
nd?
confpfPrint level flag.

Definition at line 1602 of file congen_distribution.f90.

References congen_data::cup, getso(), congen_data::lratio, congen_data::ne, congen_data::nisz, congen_data::nnlecg, packdet(), congen_data::qnshl, and wfcple().

Referenced by wfn().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ wfcple()

subroutine congen_distribution::wfcple ( integer, intent(in)  nam,
integer, dimension(3,*)  iqn,
integer, intent(in)  isz,
integer, dimension(3,lg), intent(in)  icup,
integer, dimension(2,nam,*), intent(inout)  iqns,
real(kind=wp), dimension(*), intent(inout)  c,
integer, intent(in)  last,
integer, intent(inout)  lc2,
integer  intpfg 
)

Definition at line 1667 of file congen_distribution.f90.

References cgcoef(), congen_data::lg, congen_data::nftw, and congen_data::root2.

Referenced by state().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ wfn()

subroutine, private congen_distribution::wfn ( integer, intent(inout)  nncsf,
integer, intent(inout)  nadel,
integer, intent(inout)  iidist,
integer, intent(out)  iidis3,
integer, dimension(*), intent(inout)  nodi,
integer, dimension(*), intent(inout)  ndi,
real(kind=wp), dimension(*), intent(inout)  cdi,
integer, dimension(*), intent(in)  ndel,
integer, dimension(*), intent(in)  pqnshl,
real(kind=wp), dimension(*)  x,
integer, dimension(*)  ix,
integer  nx 
)
private

One of interesting features of this subroutine is that it can detect if the storage for determinants is about to overflow. In such a case it will automatically flush the data to the output file (not waiting for the call to congen_driver::csfout), providing space for further calculation.

Parameters
nncsfNumber of CSFs (total).
nadelNumber of processed configurations.
iidist?
iidis3?
nodiNumber of determinants per CSF (1 ... noi).
ndiCompressed determinants (1 ... nid).
cdiDeterminant coefficients (1 ... nid).
ndelConfigurations read from input.
pqnshl?
xReal workspace, far enough after the chunk corresponding to pqnshl.
ixActually, the same address as x, so the same workspace (just cast to integer).
nxAvailable elements in the real workspace.

Definition at line 1814 of file congen_distribution.f90.

References congen_data::cdimx, congen_data::confpf, congen_data::exdet, congen_data::exref, congen_data::iidis2, congen_data::lcdi, congen_data::lndi, congen_data::lratio, congen_data::megul, congen_data::ncall, congen_data::ncsf, congen_data::ndimx, congen_data::ndist, congen_data::nftw, congen_data::ni, congen_data::nid, congen_data::nndel, congen_data::nnlecg, congen_data::nodimx, congen_data::noi, congen_data::nonew, congen_data::norep, congen_data::nshl, congen_data::nsoi, congen_data::ntso, congen_data::occshl, print4(), print5(), congen_data::shlmx1, congen_data::sshlst, and state().

Referenced by cplea(), and cplem().

Here is the call graph for this function:
Here is the caller graph for this function: