detci: The Determinant CI code


Files

file  b2brepl.cc
 Contains code to do block-to-block single replacement lists.
file  calc_d.cc
 Enter brief description of file here.
file  calc_hd_block.cc
 Enter brief description of file here.
file  calc_pt_block.cc
 Enter brief description of file here.
file  detci/check_energy.cc
 Check the SCF energy.
file  ci_tol.h
 Enter brief description of file here.
file  civect.cc
 Code for the CI vector class.
file  civect.h
 Enter brief description of file here.
file  compute_cc.cc
 Arbitrary-order coupled-cluster code.
file  detci.cc
 Determinant-based CI program.
file  form_ov.cc
 Form OV arrays of Bendazzoli and Evangelisti, JCP 98, 3141 (1993).
file  detci/get_mo_info.cc
 Enter brief description of file here.
file  detci/globals.h
 Enter brief description of file here.
file  graphset.cc
 Routines needed to maintain the GraphSet Object.
file  h0block.cc
 Some code associated with the H0block structure, which does the preconditioning for the Olsen/Davidson procedure.
file  import_vector.cc
 Enter brief description of file here.
file  detci/ints.cc
 Enter brief description of file here.
file  detci/misc.cc
 Enter brief description of file here.
file  mitrush_iter.cc
 Mitrushenkov iterative scheme for RAS CI's.
file  mpn.cc
 Enter brief description of file here.
file  odometer.cc
 Enter brief description of file here.
file  odometer.h
 Enter brief description of file here.
file  og_addr.cc
 Enter brief description of file here.
file  olsengraph.cc
 Enter brief description of file here.
file  olsenupdt.cc
 Enter brief description of file here.
file  detci/opdm.cc
 Enter brief description of file here.
file  detci/params.cc
 Enter brief description of file here.
file  printing.cc
 Enter brief description of file here.
file  s1.cc
 Enter brief description of file here.
file  s1v.cc
 Enter brief description of file here.
file  s2.cc
 Enter brief description of file here.
file  s2v.cc
 Enter brief description of file here.
file  s3.cc
 Enter brief description of file here.
file  s3_block_bz.cc
 Enter brief description of file here.
file  s3v.cc
 Enter brief description of file here.
file  sem.cc
 Enter brief description of file here.
file  sem_test.cc
 Enter brief description of file here.
file  set_ciblks.cc
 Enter brief description of file here.
file  shift.cc
 Shifts SCF eigenvalues corresponding to SOCC orbitals for ZAPTn.
file  sigma.cc
 Routines to compute sigma = H * c.
file  slater.cc
 Some of the Slater determinant routines.
file  slaterd.cc
 Enter brief description of file here.
file  slaterd.h
 Enter brief description of file here.
file  ssq.cc
 Compute expectation value of S^2.
file  stringlist.cc
 Code to form the CI space as strings with all single replacements.
file  structs.h
 Enter brief description of file here.
file  time.cc
 DETCI-specific timing routines.
file  tpdm.cc
 Compute the two-particle density matrix (TPDM).
file  tpool.cc
 Thread pools.
file  tpool.h
 Enter brief description of file here.
file  vector.cc
 Contains C code for vector operations.

Functions

double psi::detci::check_energy (double *H, double *twoel_ints, int *docc, int *frozen_docc, int fzc_flag, double escf, double enuc, double efzc, int nirreps, int *reorder, int *opi, int print_lvl, FILE *outfile)
void psi::detci::scf_energy (double *H, double *TE, double *energy_1, double *energy_2, double *energy_e, int *docc, int *frozen_docc, int fzc_flag, int nirreps, int *reorder, int *opi)
void psi::detci::s1_block_fci (struct stringwr **alplist, struct stringwr **betlist, double **C, double **S, double *oei, double *tei, double *F, int nlists, int nas, int nbs, int sbc, int cbc, int cnbs)

Detailed Description


Function Documentation

double psi::detci::check_energy ( double *  H,
double *  twoel_ints,
int *  docc,
int *  frozen_docc,
int  fzc_flag,
double  escf,
double  enuc,
double  efzc,
int  nirreps,
int *  reorder,
int *  opi,
int  print_lvl,
FILE *  outfile 
)

check_energy(): check the SCF energy by calculating it from the two-electr. integrals in the MO basis

Parameters:
H = lwr tri of one-electron integrals matrix (MO basis)
twoel_ints = two electron integrals (lexically indexed, MO basis)
nocc = num occupied orbitals (assume closed shell case) and exclude frozen core
escf = scf energy to compare to
enuc = nuclear repulsion energy
efzc = frozen core energy
nirreps = number of irreps
reorder = reordering array for Pitzer->CI ordering
opi = orbs per irrep in Pitzer ordering
outfile = file to write output to
Returns: the computed SCF energy

Definition at line 38 of file detci/check_energy.cc.

References psi::detci::scf_energy().

00041 {
00042    double energy_1 ;     /* one-electron energy */
00043    double energy_2 ;     /* two-electron energy */
00044    double energy_e ;     /* total electronic energy */
00045 
00046    scf_energy(H, twoel_ints, &energy_1, &energy_2, &energy_e, docc,
00047       frozen_docc, fzc_flag, nirreps, reorder, opi);
00048 
00049    if (print_lvl) {
00050      fprintf(outfile,"\nCheck SCF Energy from 1- and 2-electron integrals\n\n");
00051      fprintf(outfile,"SCF Energy (ref):          %16.10lf\n", escf) ;
00052      fprintf(outfile,"Nuclear repulsion energy:  %16.10lf\n", enuc) ;
00053      fprintf(outfile,"One-electron energy:       %16.10lf\n", energy_1) ;
00054      fprintf(outfile,"Two-electron energy:       %16.10lf\n", energy_2) ;
00055      fprintf(outfile,"Frozen core energy:        %16.10lf\n", efzc) ;
00056      fprintf(outfile,"Total electronic energy:   %16.10lf\n", energy_e+efzc) ;
00057      fprintf(outfile,"Total SCF energy:          %16.10lf\n", enuc + 
00058         energy_e + efzc) ;
00059     
00060      if (fabs(enuc + efzc + energy_e - escf) > 0.00000001) {
00061         fprintf(outfile, 
00062            "\n*** Calculated Energy Differs from SCF Energy in CHKPT ! ***\n") ;
00063         }
00064    }
00065 
00066    return(enuc+efzc+energy_e); 
00067 }   

void psi::detci::s1_block_fci ( struct stringwr **  alplist,
struct stringwr **  betlist,
double **  C,
double **  S,
double *  oei,
double *  tei,
double *  F,
int  nlists,
int  nas,
int  nbs,
int  Ib_list,
int  Jb_list,
int  Jb_list_nbs 
)

S1_BLOCK_FCI():

Calculate the sigma_1 vector as described by equation (20) of RAS Paper (Olsen, Roos, Jorgensen, Aa. Jensen JCP 1988)

This sigma1 routine is for Full CI's only. currently assumes that (ij|ij)'s have not been halved!!

David Sherrill, 21 June 1995 Based on previous code by David Sherrill, 1994

Updated 3/27/94 to include g matrix for RAS Modified 4/8/94 to make C and s one-dimensional Modified 4/10/94 to make FCI-only (for now) and use new string structs Modified 6/21/95 for use in new RAS program

Definition at line 56 of file s1.cc.

References zero_arr().

00060 {
00061    struct stringwr *Ib, *Kb;
00062    unsigned int Ia_idx, Ib_idx, Kb_idx, Jb_idx;
00063    unsigned int Ibcnt, Kbcnt, Kb_list, Ib_ex, Kb_ex;
00064    unsigned int *Ibridx, *Kbridx;
00065    int nirreps, *Ibij, *Kbij;
00066    signed char *Ibsgn, *Kbsgn;
00067    int ij,kl,ijkl;
00068    double Kb_sgn, Jb_sgn;
00069    double tval;
00070 
00071    nirreps = CalcInfo.nirreps;
00072 
00073    /* loop over I_b */
00074    for (Ib=betlist[Ib_list], Ib_idx=0; Ib_idx < nbs; Ib_idx++, Ib++) {
00075       zero_arr(F, Jb_list_nbs);
00076 
00077       /* loop over excitations E^b_{kl} from |B(I_b)> */
00078       for (Kb_list=0; Kb_list < nlists; Kb_list++) {
00079          Ibcnt = Ib->cnt[Kb_list];
00080          Ibridx = Ib->ridx[Kb_list];
00081          Ibsgn = Ib->sgn[Kb_list];
00082          Ibij = Ib->ij[Kb_list];
00083          for (Ib_ex=0; Ib_ex < Ibcnt; Ib_ex++) {
00084             kl = *Ibij++;
00085             Kb_idx = *Ibridx++;
00086             Kb_sgn = (double) *Ibsgn++;
00087 
00088             /* B(K_b) = sgn(kl) * E^b_{kl} |B(I_b)> */
00089             Kb = betlist[Kb_list] + Kb_idx;
00090             if (Kb_list == Jb_list) F[Kb_idx] += Kb_sgn * oei[kl];
00091 
00092             /* loop over excitations E^b_{ij} from |B(K_b)> */
00093             /* Jb_list pre-determined because of C blocking */
00094             Kbcnt = Kb->cnt[Jb_list];
00095             Kbridx = Kb->ridx[Jb_list];
00096             Kbsgn = Kb->sgn[Jb_list];
00097             Kbij = Kb->ij[Jb_list];
00098             for (Kb_ex=0; Kb_ex < Kbcnt; Kb_ex++) {
00099                Jb_idx = *Kbridx++;
00100                Jb_sgn = (double) *Kbsgn++;
00101                ij = *Kbij++;
00102                ijkl = ioff[MAX0(ij,kl)] + MIN0(ij,kl) ;
00103                F[Jb_idx] += 0.5 * Kb_sgn * Jb_sgn * tei[ijkl] ;
00104                }
00105             } /* end loop over Ib excitations */
00106          } /* end loop over Kb_list */
00107 
00108       
00109       for (Ia_idx=0; Ia_idx < nas; Ia_idx++) {
00110          tval = 0.0;
00111          for (Jb_idx=0; Jb_idx < Jb_list_nbs; Jb_idx++) {
00112             tval += C[Ia_idx][Jb_idx] * F[Jb_idx];
00113             }
00114          S[Ia_idx][Ib_idx] += tval;
00115          }
00116       } /* end loop over Ib */
00117 
00118 }

void psi::detci::scf_energy ( double *  H,
double *  TE,
double *  energy_1,
double *  energy_2,
double *  energy_e,
int *  docc,
int *  frozen_docc,
int  fzc_flag,
int  nirreps,
int *  reorder,
int *  opi 
)

scf_energy(): Function calculates the SCF energy from the one- and two-electron integrals in MO form (closed-shell case).

David Sherrill, Sept 1993

Parameters:
H = Matrix of one-electron integrals in MO basis (lwr triangle)
TE = Two-electron integrals in MO basis, stored in ijkl-indexed array
energy_1 = pointer to hold one-electron energy
energy_2 = pointer to hold two-electron energy
energy_e = pointer to hold total electronic energy (sum of two terms above)
docc = array of doubly-occupied orbitals per irrep
frozen_docc = array of frozen doubly-occupied orbitals per irrep
fzc_flag = remove explicit consideration of frozen core orbitals ?
nirreps = number of irreps
reorder = reordering array Pitzer->CI order
opi = orbitals per irrep
Returns: none

Definition at line 95 of file detci/check_energy.cc.

Referenced by psi::detci::check_energy().

00098 {
00099    int irrep, irrep2, d, d2, offset, offset2, ndoc, ndoc2, nfzc, nfzc2, totfzc;
00100    int i, j;
00101    int ii, jj, iijj, ij, ijij, iiii;
00102 
00103    *energy_1 = *energy_2 = *energy_e = 0.0;
00104 
00105    totfzc=0;
00106    if (fzc_flag) {
00107      for (irrep=0; irrep<nirreps; irrep++) {
00108        totfzc += frozen_docc[irrep];
00109      }
00110    }
00111 
00112    for (irrep=0,offset=0; irrep<nirreps; irrep++) {
00113      if (irrep>0) offset += opi[irrep-1];
00114      ndoc = docc[irrep];
00115      if (fzc_flag) {
00116        nfzc = frozen_docc[irrep];
00117        ndoc -= nfzc;
00118      }
00119      else nfzc=0;
00120      for (d=offset+nfzc; d<ndoc+offset+nfzc; d++) {
00121        i = reorder[d]-totfzc;
00122        ii = ioff[i] + i;
00123        iiii = ioff[ii] + ii;
00124        *energy_1 += 2.0 * H[ii];
00125        *energy_2 += TE[iiii];
00126        
00127        for (irrep2=0,offset2=0; irrep2<=irrep; irrep2++) {
00128          if (irrep2>0) offset2 += opi[irrep2-1];
00129          ndoc2 = docc[irrep2];
00130          if (fzc_flag) {
00131            nfzc2 = frozen_docc[irrep2];
00132            ndoc2 -= nfzc2;
00133          }
00134          else nfzc2=0;
00135          
00136          for (d2=offset2+nfzc2; d2<ndoc2+offset2+nfzc2 && d2<d; d2++) {
00137            j = reorder[d2]-totfzc;
00138            jj = ioff[j] + j;
00139            iijj = INDEX(ii,jj);
00140            ij = INDEX(i,j);
00141            ijij = ioff[ij] + ij;
00142            *energy_2 += 4.0 * TE[iijj] - 2.0 * TE[ijij];
00143          }
00144        }
00145      }
00146    }
00147    
00148    *energy_e = *energy_1 + *energy_2;
00149 }


Generated on Wed Feb 13 16:36:15 2008 for PSI by  doxygen 1.5.4