00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #include <util/misc/math.h>
00029 #include <chemistry/qc/libint2/static.h>
00030 #include <chemistry/qc/libint2/libint2_utils.h>
00031
00032 #ifndef _chemistry_qc_libint2_g12quartetdata_h
00033 #define _chemistry_qc_libint2_g12quartetdata_h
00034
00035 namespace sc {
00036
00037
00038
00039
00040
00041
00042 inline void G12Libint2::g12_quartet_data_(prim_data *Data, double scale, double gamma, bool eri_only)
00043 {
00044 #define STATIC_OO2NP1
00045 #include "static.h"
00046
00047
00048
00049
00050 double P[3], Q[3], PQ[3], W[3];
00051 double small_T = 1E-15;
00052
00053 int p1 = quartet_info_.p1;
00054 int p2 = quartet_info_.p2;
00055 int p3 = quartet_info_.p3;
00056 int p4 = quartet_info_.p4;
00057
00058 double a1 = int_shell1_->exponent(quartet_info_.p1);
00059 double a2 = int_shell2_->exponent(quartet_info_.p2);
00060 double a3 = int_shell3_->exponent(quartet_info_.p3);
00061 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
00076
00077 #if LIBINT2_DEFINED(g12,zeta_A)
00078 Data->zeta_A[0] = a1;
00079 #endif
00080 #if LIBINT2_DEFINED(g12,zeta_B)
00081 Data->zeta_B[0] = a2;
00082 #endif
00083 #if LIBINT2_DEFINED(g12,zeta_C)
00084 Data->zeta_C[0] = a3;
00085 #endif
00086 #if LIBINT2_DEFINED(g12,zeta_D)
00087 Data->zeta_D[0] = a4;
00088 #endif
00089 #if LIBINT2_DEFINED(g12,zeta_A_2)
00090 Data->zeta_A_2[0] = a1*a1;
00091 #endif
00092 #if LIBINT2_DEFINED(g12,zeta_B_2)
00093 Data->zeta_B_2[0] = a2*a2;
00094 #endif
00095 #if LIBINT2_DEFINED(g12,zeta_C_2)
00096 Data->zeta_C_2[0] = a3*a3;
00097 #endif
00098 #if LIBINT2_DEFINED(g12,zeta_D_2)
00099 Data->zeta_D_2[0] = a4*a4;
00100 #endif
00101 #if LIBINT2_DEFINED(g12,gamma)
00102 Data->gamma[0] = gamma;
00103 #endif
00104
00105
00106
00107
00108 double zeta = pair12->gamma;
00109 double eta = pair34->gamma;
00110 double ooz = 1.0/zeta;
00111 double ooe = 1.0/eta;
00112 double ooze = 1.0/(zeta+eta);
00113 Data->roz[0] = eta*ooze;
00114 double rho = zeta*Data->roz[0];
00115 double rhog = rho + gamma;
00116 double oorhog = 1.0/rhog;
00117 double rho2 = rho*rho;
00118
00119 P[0] = pair12->P[0];
00120 P[1] = pair12->P[1];
00121 P[2] = pair12->P[2];
00122 Q[0] = pair34->P[0];
00123 Q[1] = pair34->P[1];
00124 Q[2] = pair34->P[2];
00125
00126 Data->oo2ze[0] = 0.5*ooze;
00127 Data->roe[0] = zeta*ooze;
00128 Data->oo2z[0] = 0.5 * ooz;
00129 Data->oo2e[0] = 0.5 * ooe;
00130 W[0] = (zeta*P[0] + eta*Q[0])*ooze;
00131 W[1] = (zeta*P[1] + eta*Q[1])*ooze;
00132 W[2] = (zeta*P[2] + eta*Q[2])*ooze;
00133
00134
00135 Data->PA_x[0] = P[0] - quartet_info_.A[0];
00136 Data->PA_y[0] = P[1] - quartet_info_.A[1];
00137 Data->PA_z[0] = P[2] - quartet_info_.A[2];
00138
00139 Data->QC_x[0] = Q[0] - quartet_info_.C[0];
00140 Data->QC_y[0] = Q[1] - quartet_info_.C[1];
00141 Data->QC_z[0] = Q[2] - quartet_info_.C[2];
00142
00143 Data->WP_x[0] = W[0] - P[0];
00144 Data->WP_y[0] = W[1] - P[1];
00145 Data->WP_z[0] = W[2] - P[2];
00146
00147 Data->WQ_x[0] = W[0] - Q[0];
00148 Data->WQ_y[0] = W[1] - Q[1];
00149 Data->WQ_z[0] = W[2] - Q[2];
00150
00151
00152 #if LIBINT2_DEFINED(g12,AC_x)
00153 Data->AC_x[0] = quartet_info_.A[0] - quartet_info_.C[0];
00154 #endif
00155 #if LIBINT2_DEFINED(g12,AC_y)
00156 Data->AC_y[0] = quartet_info_.A[1] - quartet_info_.C[1];
00157 #endif
00158 #if LIBINT2_DEFINED(g12,AC_z)
00159 Data->AC_z[0] = quartet_info_.A[2] - quartet_info_.C[2];
00160 #endif
00161
00162 #if LIBINT2_DEFINED(g12,BD_x)
00163 Data->BD_x[0] = quartet_info_.B[0] - quartet_info_.D[0];
00164 #endif
00165 #if LIBINT2_DEFINED(g12,BD_y)
00166 Data->BD_y[0] = quartet_info_.B[1] - quartet_info_.D[1];
00167 #endif
00168 #if LIBINT2_DEFINED(g12,BD_z)
00169 Data->BD_z[0] = quartet_info_.B[2] - quartet_info_.D[2];
00170 #endif
00171
00172 PQ[0] = P[0] - Q[0];
00173 PQ[1] = P[1] - Q[1];
00174 PQ[2] = P[2] - Q[2];
00175 double PQ2 = PQ[0]*PQ[0];
00176 PQ2 += PQ[1]*PQ[1];
00177 PQ2 += PQ[2]*PQ[2];
00178
00179 const double pfac_norm = int_shell1_->coefficient_unnorm(quartet_info_.gc1,p1)*
00180 int_shell2_->coefficient_unnorm(quartet_info_.gc2,p2)*
00181 int_shell3_->coefficient_unnorm(quartet_info_.gc3,p3)*
00182 int_shell4_->coefficient_unnorm(quartet_info_.gc4,p4);
00183 const double pfac_normovlp = pfac_norm * pair12->ovlp * pair34->ovlp * scale;
00184
00185 if (eri_only) {
00186 double T = rho*PQ2;
00187 double pfac = 2.0*sqrt(rho*M_1_PI)*pfac_normovlp;
00188 if(T < small_T){
00189 assign_FjT(Data,quartet_info_.am,oo2np1,pfac);
00190 }
00191 else {
00192 double *fjttable = Fm_Eval_->values(quartet_info_.am,T);
00193 assign_FjT(Data,quartet_info_.am,fjttable,pfac);
00194 }
00195 return;
00196 }
00197
00198
00199 double T = rho2 * oorhog * PQ2;
00200
00201
00202
00203
00204 double rorg = rho * oorhog;
00205 double sqrt_rorg = sqrt(rorg);
00206 Data->LIBINT_T_SS_K0G12_SS_0[0] = rorg * sqrt_rorg * exp(-gamma*rorg*PQ2) * pfac_normovlp;
00207 Data->LIBINT_T_SS_K2G12_SS_0[0] = (1.5 + T) * Data->LIBINT_T_SS_K0G12_SS_0[0] * oorhog;
00208
00209
00210
00211
00212 double pfac = 2.0 * sqrt(rhog*M_1_PI) * Data->LIBINT_T_SS_K0G12_SS_0[0];
00213
00214 const double *F;
00215 if(T < small_T){
00216 F = oo2np1;
00217 }
00218 else {
00219 F = Fm_Eval_->values(quartet_info_.am,T);
00220 }
00221
00222 double ss_m1_ss[4*LIBINT2_MAX_AM_R12kG12+1];
00223 double g_i[4*LIBINT2_MAX_AM_R12kG12+1];
00224 double r_i[4*LIBINT2_MAX_AM_R12kG12+1];
00225 double oorhog_i[4*LIBINT2_MAX_AM_R12kG12+1];
00226 g_i[0] = 1.0;
00227 r_i[0] = 1.0;
00228 oorhog_i[0] = 1.0;
00229 for(int i=1; i<=quartet_info_.am; i++) {
00230 g_i[i] = g_i[i-1] * gamma;
00231 r_i[i] = r_i[i-1] * rho;
00232 oorhog_i[i] = oorhog_i[i-1] * oorhog;
00233 }
00234 for(int m=0; m<=quartet_info_.am; m++) {
00235 double ssss = 0.0;
00236 for(int k=0; k<=m; k++) {
00237 ssss += ExpMath_.bc[m][k] * r_i[k] * g_i[m-k] * F[k];
00238 }
00239 ss_m1_ss[m] = ssss * oorhog_i[m];
00240 }
00241
00242 assign_ss_r12m1g12_ss(Data,quartet_info_.am,ss_m1_ss,pfac);
00243
00244
00245
00246
00247
00248 {
00249 double u0 = 0.5/(zeta*eta + gamma*(zeta+eta));
00250
00251 {
00252 double t00 = a2*(eta + gamma);
00253 double t01 = gamma*a4;
00254 double t02 = gamma*eta;
00255 double T[3];
00256 for(int w=0;w<3; w++) {
00257 T[w] = -2.0 * u0 * (t00*(quartet_info_.A[w]-quartet_info_.B[w]) +
00258 t01*(quartet_info_.C[w]-quartet_info_.D[w]) +
00259 t02*(quartet_info_.A[w]-quartet_info_.C[w]));
00260 }
00261 Data->R12kG12_pfac0_0_x[0] = T[0];
00262 Data->R12kG12_pfac0_0_y[0] = T[1];
00263 Data->R12kG12_pfac0_0_z[0] = T[2];
00264 }
00265 {
00266 double t00 = a4*(zeta + gamma);
00267 double t01 = gamma*a2;
00268 double t02 = gamma*zeta;
00269 double T[3];
00270 for(int w=0;w<3; w++) {
00271 T[w] = -2.0 * u0 * (t00*(quartet_info_.C[w]-quartet_info_.D[w]) +
00272 t01*(quartet_info_.A[w]-quartet_info_.B[w]) +
00273 t02*(quartet_info_.C[w]-quartet_info_.A[w]));
00274 }
00275 Data->R12kG12_pfac0_1_x[0] = T[0];
00276 Data->R12kG12_pfac0_1_y[0] = T[1];
00277 Data->R12kG12_pfac0_1_z[0] = T[2];
00278 }
00279 {
00280 Data->R12kG12_pfac1_0[0] = u0 * (eta + gamma);
00281 Data->R12kG12_pfac1_1[0] = u0 * (zeta + gamma);
00282 }
00283 {
00284 Data->R12kG12_pfac2[0] = u0 * gamma;
00285 }
00286 {
00287 Data->R12kG12_pfac3_0[0] = eta*u0;
00288 Data->R12kG12_pfac3_1[0] = zeta*u0;
00289 }
00290 {
00291 double T[3];
00292 for(int w=0;w<3; w++) {
00293 T[w] = quartet_info_.A[w]-quartet_info_.C[w];
00294 }
00295 Data->R12kG12_pfac4_0_x[0] = T[0];
00296 Data->R12kG12_pfac4_0_y[0] = T[1];
00297 Data->R12kG12_pfac4_0_z[0] = T[2];
00298 Data->R12kG12_pfac4_1_x[0] = -T[0];
00299 Data->R12kG12_pfac4_1_y[0] = -T[1];
00300 Data->R12kG12_pfac4_1_z[0] = -T[2];
00301 }
00302 }
00303
00304 return;
00305 }
00306
00307 }
00308
00309 #endif
00310
00311
00312
00313
00314