~ubuntu-branches/ubuntu/vivid/psicode/vivid

« back to all changes in this revision

Viewing changes to src/bin/cints/Tools/compute_scf_opdm.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Banck
  • Date: 2008-06-07 16:49:57 UTC
  • mfrom: (2.1.2 hardy)
  • Revision ID: james.westby@ubuntu.com-20080607164957-8pifvb133yjlkagn
Tags: 3.3.0-3
* debian/rules (DEB_MAKE_CHECK_TARGET): Do not abort test suite on
  failures.
* debian/rules (DEB_CONFIGURE_EXTRA_FLAGS): Set ${bindir} to /usr/lib/psi.
* debian/rules (install/psi3): Move psi3 file to /usr/bin.
* debian/patches/07_464867_move_executables.dpatch: New patch, add
  /usr/lib/psi to the $PATH, so that the moved executables are found.
  (closes: #464867)
* debian/patches/00list: Adjusted.

Show diffs side-by-side

added added

removed removed

Lines of Context:
224
224
      }
225
225
  }
226
226
 
227
 
  /*---------------------------------------------------
228
 
    Compute MO shell densities for UHF, ROHF and TCSCF
229
 
   ---------------------------------------------------*/
 
227
  /*----------------------------------------------
 
228
    Compute MO shell densities for ROHF and TCSCF
 
229
   ----------------------------------------------*/
230
230
  if (UserOptions.reftype == rohf || UserOptions.reftype == twocon) {
231
231
    ShDens = (double ***) malloc(sizeof(double **)*MOInfo.num_moshells);
232
232
    for(i=0;i<MOInfo.num_moshells;i++)
275
275
      }
276
276
    }
277
277
  }
278
 
  else if (UserOptions.reftype == uhf) {  /*--- UHF ---*/
279
 
    ShDens = (double ***) malloc(sizeof(double **)*2);
280
 
    for(i=0;i<2;i++)
281
 
      ShDens[i] = block_matrix(BasisSet.num_ao,BasisSet.num_ao);
282
 
    for(i=0;i<BasisSet.num_ao;i++)
283
 
      for(j=0;j<=i;j++) {
284
 
        for(k=0;k<Symmetry.nirreps;k++) {
285
 
          mo = symblk_offset[k];
286
 
          for(l=0; l < (MOInfo.clsdpi[k]+MOInfo.openpi[k]); l++) {
287
 
            ShDens[0][j][i] = (ShDens[0][i][j] +=
288
 
                               MOInfo.scf_evec[0][mo][i]*MOInfo.scf_evec[0][mo][j]);
289
 
            mo++;
290
 
          }
291
 
          mo = symblk_offset[k];
292
 
          for(l=0; l < (MOInfo.clsdpi[k]); l++) {
293
 
            ShDens[1][j][i] = (ShDens[1][i][j] +=
294
 
                               MOInfo.scf_evec[1][mo][i]*MOInfo.scf_evec[1][mo][j]);
295
 
            mo++;
296
 
          }
297
 
        }
298
 
      }
299
 
    /* Check if the total density is a sum of shell densities - REMOVE AFTER DONE TESTING */
300
 
    for(i=0;i<BasisSet.num_ao;i++)
301
 
      for(j=0;j<BasisSet.num_ao;j++) {
302
 
        tmp = 0.0;
303
 
        for(k=0;k<MOInfo.num_moshells;k++)
304
 
          tmp += ShDens[k][i][j];
305
 
        if (fabs(tmp - Dens[i][j]) > 1.0e-12)
306
 
          punt("Total density is not a sum of shell densities");
307
 
      }
308
 
  }
309
278
 
310
279
  print_opdm();
311
280