Main Page Class Hierarchy Compound List File List Compound Members Related Pages

# eri_quartet_data.h

    00001 //
    00002 // eri_quartet_data.h
    00003 //
    00004 // Copyright (C) 2001 Edward Valeev
    00005 //
    00006 // Author: Edward Valeev <edward.valeev@chemistry.gatech.edu>
    00007 // Maintainer: EV
    00008 //
    00009 // This file is part of the SC Toolkit.
    00010 //
    00011 // The SC Toolkit is free software; you can redistribute it and/or modify
    00012 // it under the terms of the GNU Library General Public License as published by
    00013 // the Free Software Foundation; either version 2, or (at your option)
    00014 // any later version.
    00015 //
    00016 // The SC Toolkit is distributed in the hope that it will be useful,
    00017 // but WITHOUT ANY WARRANTY; without even the implied warranty of
    00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00019 // GNU Library General Public License for more details.
    00020 //
    00021 // You should have received a copy of the GNU Library General Public License
    00022 // along with the SC Toolkit; see the file COPYING.LIB.  If not, write to
    00023 // the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
    00024 //
    00025 // The U.S. Government is granted a limited license as per AL 91-7.
    00026 //
    00027
    00028 #ifndef _chemistry_qc_cints_eriquartetdata_h
    00029 #define _chemistry_qc_cints_eriquartetdata_h
    00030
    00031 #include <math.h>
    00032
    00033 /*--------------------------------------------------------------------------------
    00034   This function computes constants used in OSRR for a given quartet of primitives
    00035  --------------------------------------------------------------------------------*/
    00036 inline void EriCints::eri_quartet_data_(prim_data *Data, double scale)
    00037 {
    00038 #define STATIC_OO2NP1
    00039 #include "static.h"
    00040
    00041   /*----------------
    00042     Local variables
    00043    ----------------*/
    00044   double P[3], Q[3], PQ[3], W[3];
    00045   double small_T = 1E-15;       /*--- Use only one term in Taylor expansion of Fj(T) if T < small_T ---*/
    00046
    00047   int p1 = quartet_info_.p1;
    00048   int p2 = quartet_info_.p2;
    00049   int p3 = quartet_info_.p3;
    00050   int p4 = quartet_info_.p4;
    00051
    00052   double a1 = int_shell1_->exponent(quartet_info_.p1);
    00053   double a2 = int_shell2_->exponent(quartet_info_.p2);
    00054   double a3 = int_shell3_->exponent(quartet_info_.p3);
    00055   double a4 = int_shell4_->exponent(quartet_info_.p4);
    00056
    00057   prim_pair_t* pair12;
    00058   prim_pair_t* pair34;
    00059   if (!quartet_info_.p13p24) {
    00060     pair12 = quartet_info_.shell_pair12->prim_pair(*quartet_info_.op1,*quartet_info_.op2);
    00061     pair34 = quartet_info_.shell_pair34->prim_pair(*quartet_info_.op3,*quartet_info_.op4);
    00062   }
    00063   else {
    00064     pair12 = quartet_info_.shell_pair34->prim_pair(*quartet_info_.op3,*quartet_info_.op4);
    00065     pair34 = quartet_info_.shell_pair12->prim_pair(*quartet_info_.op1,*quartet_info_.op2);
    00066   }
    00067
    00068   double zeta = pair12->gamma;
    00069   double eta = pair34->gamma;
    00070   double ooz = 1.0/zeta;
    00071   double oon = 1.0/eta;
    00072   double oozn = 1.0/(zeta+eta);
    00073   Data->poz = eta*oozn;
    00074   double rho = zeta*Data->poz;
    00075
    00076   double t1 = M_PI*ooz;
    00077   double t2 = M_PI*oon;
    00078   double pfac_norm = int_shell1_->coefficient_unnorm(quartet_info_.gc1,p1)*
    00079   int_shell2_->coefficient_unnorm(quartet_info_.gc2,p2)*
    00080   int_shell3_->coefficient_unnorm(quartet_info_.gc3,p3)*
    00081   int_shell4_->coefficient_unnorm(quartet_info_.gc4,p4);
    00082   double pfac = 2.0*sqrt(rho*M_1_PI)*scale*pair12->ovlp*pair34->ovlp*pfac_norm;
    00083
    00084   P[0] = pair12->P[0];
    00085   P[1] = pair12->P[1];
    00086   P[2] = pair12->P[2];
    00087   Q[0] = pair34->P[0];
    00088   Q[1] = pair34->P[1];
    00089   Q[2] = pair34->P[2];
    00090   PQ[0] = P[0] - Q[0];
    00091   PQ[1] = P[1] - Q[1];
    00092   PQ[2] = P[2] - Q[2];
    00093   double PQ2 = PQ[0]*PQ[0];
    00094   PQ2 += PQ[1]*PQ[1];
    00095   PQ2 += PQ[2]*PQ[2];
    00096   double T = rho*PQ2;
    00097
    00098   if (!quartet_info_.am) {
    00099     double *fjttable = Fm_Eval_->values(0,T);
    00100     Data->F[0] = fjttable[0]*pfac;
    00101   }
    00102   else {
    00103     Data->oo2zn = 0.5*oozn;
    00104     Data->pon = zeta*oozn;
    00105     Data->oo2z = 0.5/zeta;
    00106     Data->oo2n = 0.5/eta;
    00107     W[0] = (zeta*P[0] + eta*Q[0])*oozn;
    00108     W[1] = (zeta*P[1] + eta*Q[1])*oozn;
    00109     W[2] = (zeta*P[2] + eta*Q[2])*oozn;
    00110
    00111     if(T < small_T){
    00112       for(int i=0; i<=quartet_info_.am; i++)
    00113         Data->F[i] = oo2np1[i]*pfac;
    00114     }
    00115     else {
    00116       double *fjttable = Fm_Eval_->values(quartet_info_.am,T);
    00117       for(int i=0;i<=quartet_info_.am;i++)
    00118         Data->F[i] = fjttable[i]*pfac;
    00119     }
    00120
    00121     /* PA */
    00122     Data->U[0][0] = P[0] - quartet_info_.A[0];
    00123     Data->U[0][1] = P[1] - quartet_info_.A[1];
    00124     Data->U[0][2] = P[2] - quartet_info_.A[2];
    00125     /* QC */
    00126     Data->U[2][0] = Q[0] - quartet_info_.C[0];
    00127     Data->U[2][1] = Q[1] - quartet_info_.C[1];
    00128     Data->U[2][2] = Q[2] - quartet_info_.C[2];
    00129     /* WP */
    00130     Data->U[4][0] = W[0] - P[0];
    00131     Data->U[4][1] = W[1] - P[1];
    00132     Data->U[4][2] = W[2] - P[2];
    00133     /* WQ */
    00134     Data->U[5][0] = W[0] - Q[0];
    00135     Data->U[5][1] = W[1] - Q[1];
    00136     Data->U[5][2] = W[2] - Q[2];
    00137   }
    00138
    00139   return;
    00140 }
    00141
    00142 #endif
    00143
    00144 // Local Variables:
    00145 // mode: c++
    00146 // c-file-style: "CLJ"
    00147 // End: