ael.c File Reference

Enter brief description of file here. More...

#include <stdio.h>
#include <libqt/qt.h>
#include <psifiles.h>
#include "globals.h"
#include <math.h>

Go to the source code of this file.

Functions

void ael (struct RHO_Params *rho_params)


Detailed Description

Enter brief description of file here.

Definition in file ael.c.


Function Documentation

void ael ( struct RHO_Params *  rho_params  ) 

AEL() computes the approximate excitation level according to Stanton and Bartlett, JCP, 98, 1993, 7034. Trace [rho(excited) - rho(ground)] = AEL where both densities are expressed in the basis that diagonalizes the ground-state CCSD density. I was never able to get these results to agree with those of JFS or the current ACES2 so I'm not going to use this right now. --RAK

Definition at line 21 of file ael.c.

References block_matrix(), C_DGEMM(), init_array(), psio_open(), psio_read_entry(), and sq_rsp().

00022 {
00023   int dim,i,j,k;
00024   double **rho_g, *evals, **evects, **tmat, **rho_x, ael, **rho_diff, trace;
00025 
00026   dim = moinfo.nmo - moinfo.nfzv;
00027   rho_g = block_matrix(dim,dim);
00028   rho_x = block_matrix(dim,dim);
00029   rho_diff = block_matrix(dim,dim);
00030   evals = init_array(dim);
00031   evects = block_matrix(dim,dim);
00032   tmat = block_matrix(dim,dim);
00033 
00034   /* read and diagonalize the ground-state rho */
00035   psio_open(PSIF_MO_OPDM, PSIO_OPEN_OLD);
00036   psio_read_entry(PSIF_MO_OPDM, rho_params[0].opdm_lbl, (char *) &(rho_g[0][0]), sizeof(double)*dim*dim);
00037   psio_close(PSIF_MO_OPDM, 1);
00038 
00039   sq_rsp(dim, dim, rho_g, evals, 3, evects, 1.0E-14);
00040   C_DGEMM('t', 'n', dim, dim, dim, 1.0, &(evects[0][0]), dim, &(rho_g[0][0]), dim, 0.0, &(tmat[0][0]), dim);
00041   C_DGEMM('n', 'n', dim, dim, dim, 1.0,   &(tmat[0][0]), dim, &(evects[0][0]), dim, 0.0, &(rho_g[0][0]), dim);
00042 
00043   for (i=1; i<params.nstates; ++i) {
00044     /* read in the excited state density */
00045     psio_open(PSIF_MO_OPDM, PSIO_OPEN_OLD);
00046     psio_read_entry(PSIF_MO_OPDM, rho_params[i].opdm_lbl, (char *) &(rho_x[0][0]),
00047                      sizeof(double)*dim*dim);
00048     psio_close(PSIF_MO_OPDM, 1);
00049 
00050     /* transform the excited-state density */
00051     C_DGEMM('t', 'n', dim, dim, dim, 1.0, &(evects[0][0]), dim, &(rho_x[0][0]), dim, 0.0, &(tmat[0][0]), dim);
00052     C_DGEMM('n', 'n', dim, dim, dim, 1.0,   &(tmat[0][0]), dim, &(evects[0][0]), dim, 0.0, &(rho_x[0][0]), dim);
00053 
00054     /* compute the ith AEL */
00055     ael = 0.0;
00056     for (j=0; j<dim; ++j) {
00057       ael += 0.5 * fabs( rho_x[j][k] - rho_g[j][k] );
00058     }
00059     fprintf(outfile, "\tAEL %d: %10.7lf\n", i, ael);
00060   }
00061 
00062   free(evals);
00063   free_block(evects);
00064   free_block(tmat);
00065   free_block(rho_g);
00066   free_block(rho_x);
00067   free_block(rho_diff);
00068   return;
00069 }


Generated on Wed Feb 13 16:35:56 2008 for PSI by  doxygen 1.5.4