|
MPQC
3.0.0-alpha
|
00001 // 00002 // g12dkh_quartet_data.h 00003 // 00004 // Copyright (C) 2005 Edward Valeev 00005 // 00006 // Author: Edward Valeev <evaleev@vt.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_libint2_g12dkhquartetdata_h 00029 #define _chemistry_qc_libint2_g12dkhquartetdata_h 00030 00031 #include <util/misc/math.h> 00032 #include <chemistry/qc/libint2/static.h> 00033 #include <chemistry/qc/libint2/libint2_utils.h> 00034 00035 namespace sc { 00036 00037 /*-------------------------------------------------------------------------------- 00038 This function computes constants used in OSRR for a given quartet of primitives 00039 00040 gamma is the exponent of the Gaussian geminal in the integral 00041 --------------------------------------------------------------------------------*/ 00042 inline void G12DKHLibint2::g12dkh_quartet_data_(prim_data *Data, double scale, double gamma_bra, double gamma_ket) 00043 { 00044 #define STATIC_OO2NP1 00045 #include "static.h" 00046 00047 /*---------------- 00048 Local variables 00049 ----------------*/ 00050 double P[3], Q[3], PQ[3], W[3]; 00051 const double small_T = 1E-15; /*--- Use only one term in Taylor expansion of Fj(T) if T < small_T ---*/ 00052 00053 const int p1 = quartet_info_.p1; 00054 const int p2 = quartet_info_.p2; 00055 const int p3 = quartet_info_.p3; 00056 const int p4 = quartet_info_.p4; 00057 00058 const double a1 = int_shell1_->exponent(quartet_info_.p1); 00059 const double a2 = int_shell2_->exponent(quartet_info_.p2); 00060 const double a3 = int_shell3_->exponent(quartet_info_.p3); 00061 const double a4 = int_shell4_->exponent(quartet_info_.p4); 00062 00063 prim_pair_t* pair12; 00064 prim_pair_t* pair34; 00065 if (!quartet_info_.p13p24) { 00066 pair12 = quartet_info_.shell_pair12->prim_pair(*quartet_info_.op1,*quartet_info_.op2); 00067 pair34 = quartet_info_.shell_pair34->prim_pair(*quartet_info_.op3,*quartet_info_.op4); 00068 } 00069 else { 00070 pair12 = quartet_info_.shell_pair34->prim_pair(*quartet_info_.op3,*quartet_info_.op4); 00071 pair34 = quartet_info_.shell_pair12->prim_pair(*quartet_info_.op1,*quartet_info_.op2); 00072 } 00073 00074 // 00075 // prefactors for (ab|-1|cd) are same as for OSRR, only (00|-1|00)^m are different 00076 // 00077 const double zeta = pair12->gamma; 00078 const double eta = pair34->gamma; 00079 const double ooz = 1.0/zeta; 00080 const double ooe = 1.0/eta; 00081 const double ooze = 1.0/(zeta+eta); 00082 Data->roz[0] = eta*ooze; 00083 const double rho = zeta*Data->roz[0]; 00084 const double gamma = gamma_bra + gamma_ket; 00085 const double rhog = rho + gamma; 00086 const double oorhog = 1.0/rhog; 00087 const double rho2 = rho*rho; 00088 00089 Data->oo2ze[0] = 0.5*ooze; 00090 Data->roe[0] = zeta*ooze; 00091 Data->oo2z[0] = 0.5 * ooz; 00092 Data->oo2e[0] = 0.5 * ooe; 00093 00094 #if LIBINT2_DEFINED(g12,zeta_A) 00095 Data->zeta_A[0] = a1; 00096 #endif 00097 #if LIBINT2_DEFINED(g12,zeta_B) 00098 Data->zeta_B[0] = a2; 00099 #endif 00100 #if LIBINT2_DEFINED(g12,zeta_C) 00101 Data->zeta_C[0] = a3; 00102 #endif 00103 #if LIBINT2_DEFINED(g12,zeta_D) 00104 Data->zeta_D[0] = a4; 00105 #endif 00106 00107 P[0] = pair12->P[0]; 00108 P[1] = pair12->P[1]; 00109 P[2] = pair12->P[2]; 00110 Q[0] = pair34->P[0]; 00111 Q[1] = pair34->P[1]; 00112 Q[2] = pair34->P[2]; 00113 W[0] = (zeta*P[0] + eta*Q[0])*ooze; 00114 W[1] = (zeta*P[1] + eta*Q[1])*ooze; 00115 W[2] = (zeta*P[2] + eta*Q[2])*ooze; 00116 00117 /* PA */ 00118 Data->PA_x[0] = P[0] - quartet_info_.A[0]; 00119 Data->PA_y[0] = P[1] - quartet_info_.A[1]; 00120 Data->PA_z[0] = P[2] - quartet_info_.A[2]; 00121 /* QC */ 00122 Data->QC_x[0] = Q[0] - quartet_info_.C[0]; 00123 Data->QC_y[0] = Q[1] - quartet_info_.C[1]; 00124 Data->QC_z[0] = Q[2] - quartet_info_.C[2]; 00125 /* WP */ 00126 Data->WP_x[0] = W[0] - P[0]; 00127 Data->WP_y[0] = W[1] - P[1]; 00128 Data->WP_z[0] = W[2] - P[2]; 00129 /* WQ */ 00130 Data->WQ_x[0] = W[0] - Q[0]; 00131 Data->WQ_y[0] = W[1] - Q[1]; 00132 Data->WQ_z[0] = W[2] - Q[2]; 00133 00134 /* AC */ 00135 #if LIBINT2_DEFINED(g12,AC_x) 00136 Data->AC_x[0] = quartet_info_.A[0] - quartet_info_.C[0]; 00137 #endif 00138 #if LIBINT2_DEFINED(g12,AC_y) 00139 Data->AC_y[0] = quartet_info_.A[1] - quartet_info_.C[1]; 00140 #endif 00141 #if LIBINT2_DEFINED(g12,AC_z) 00142 Data->AC_z[0] = quartet_info_.A[2] - quartet_info_.C[2]; 00143 #endif 00144 /* BD */ 00145 #if LIBINT2_DEFINED(g12,BD_x) 00146 Data->BD_x[0] = quartet_info_.B[0] - quartet_info_.D[0]; 00147 #endif 00148 #if LIBINT2_DEFINED(g12,BD_y) 00149 Data->BD_y[0] = quartet_info_.B[1] - quartet_info_.D[1]; 00150 #endif 00151 #if LIBINT2_DEFINED(g12,BD_z) 00152 Data->BD_z[0] = quartet_info_.B[2] - quartet_info_.D[2]; 00153 #endif 00154 #if LIBINT2_DEFINED(g12,gamma_bra) 00155 Data->gamma_bra[0] = gamma_bra; 00156 #endif 00157 #if LIBINT2_DEFINED(g12,gamma_ket) 00158 Data->gamma_ket[0] = gamma_ket; 00159 #endif 00160 00161 PQ[0] = P[0] - Q[0]; 00162 PQ[1] = P[1] - Q[1]; 00163 PQ[2] = P[2] - Q[2]; 00164 const double PQ2 = PQ[0]*PQ[0] + PQ[1]*PQ[1] + PQ[2]*PQ[2]; 00165 00166 const double pfac_norm = int_shell1_->coefficient_unnorm(quartet_info_.gc1,p1)* 00167 int_shell2_->coefficient_unnorm(quartet_info_.gc2,p2)* 00168 int_shell3_->coefficient_unnorm(quartet_info_.gc3,p3)* 00169 int_shell4_->coefficient_unnorm(quartet_info_.gc4,p4); 00170 const double pfac_normovlp = pfac_norm * pair12->ovlp * pair34->ovlp * scale; 00171 const double T = rho2 * oorhog * PQ2; 00172 00173 // 00174 // (00|0|00), (00|2|00), and (00|4|00) need to start recursion for (ab|0|cd), (ab|2|cd), (ab|4|cd) 00175 // 00176 const double rorg = rho * oorhog; 00177 const double sqrt_rorg = sqrt(rorg); 00178 Data->LIBINT_T_SS_K0G12_SS_0[0] = rorg * sqrt_rorg * exp(-gamma*rorg*PQ2) * pfac_normovlp; 00179 const double ssss_o_rhog = Data->LIBINT_T_SS_K0G12_SS_0[0] * oorhog; 00180 Data->LIBINT_T_SS_K2G12_SS_0[0] = (1.5 + T) * ssss_o_rhog; 00181 Data->LIBINT_T_SS_K4G12_SS_0[0] = (15.0/4.0 + 5.0*T + T*T) * ssss_o_rhog * oorhog; 00182 00183 // 00184 // prefactors for (a0|k|c0) (k!=-1) VRR 00185 // 00186 { 00187 const double u0 = 0.5/(zeta*eta + gamma*(zeta+eta)); 00188 00189 { 00190 const double t00 = a2*(eta + gamma); 00191 const double t01 = gamma*a4; 00192 const double t02 = gamma*eta; 00193 double T[3]; 00194 for(int w=0;w<3; w++) { 00195 T[w] = -2.0 * u0 * (t00*(quartet_info_.A[w]-quartet_info_.B[w]) + 00196 t01*(quartet_info_.C[w]-quartet_info_.D[w]) + 00197 t02*(quartet_info_.A[w]-quartet_info_.C[w])); 00198 } 00199 Data->R12kG12_pfac0_0_x[0] = T[0]; 00200 Data->R12kG12_pfac0_0_y[0] = T[1]; 00201 Data->R12kG12_pfac0_0_z[0] = T[2]; 00202 } 00203 { 00204 const double t00 = a4*(zeta + gamma); 00205 const double t01 = gamma*a2; 00206 const double t02 = gamma*zeta; 00207 double T[3]; 00208 for(int w=0;w<3; w++) { 00209 T[w] = -2.0 * u0 * (t00*(quartet_info_.C[w]-quartet_info_.D[w]) + 00210 t01*(quartet_info_.A[w]-quartet_info_.B[w]) + 00211 t02*(quartet_info_.C[w]-quartet_info_.A[w])); 00212 } 00213 Data->R12kG12_pfac0_1_x[0] = T[0]; 00214 Data->R12kG12_pfac0_1_y[0] = T[1]; 00215 Data->R12kG12_pfac0_1_z[0] = T[2]; 00216 } 00217 { 00218 Data->R12kG12_pfac1_0[0] = u0 * (eta + gamma); 00219 Data->R12kG12_pfac1_1[0] = u0 * (zeta + gamma); 00220 } 00221 { 00222 Data->R12kG12_pfac2[0] = u0 * gamma; 00223 } 00224 { 00225 Data->R12kG12_pfac3_0[0] = eta*u0; 00226 Data->R12kG12_pfac3_1[0] = zeta*u0; 00227 } 00228 { 00229 double T[3]; 00230 for(int w=0;w<3; w++) { 00231 T[w] = quartet_info_.A[w]-quartet_info_.C[w]; 00232 } 00233 Data->R12kG12_pfac4_0_x[0] = T[0]; 00234 Data->R12kG12_pfac4_0_y[0] = T[1]; 00235 Data->R12kG12_pfac4_0_z[0] = T[2]; 00236 Data->R12kG12_pfac4_1_x[0] = -T[0]; 00237 Data->R12kG12_pfac4_1_y[0] = -T[1]; 00238 Data->R12kG12_pfac4_1_z[0] = -T[2]; 00239 } 00240 } 00241 00242 return; 00243 } 00244 00245 } 00246 00247 #endif 00248 00249 // Local Variables: 00250 // mode: c++ 00251 // c-file-style: "CLJ" 00252 // End: