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_g12ncquartetdata_h
00033 #define _chemistry_qc_libint2_g12ncquartetdata_h
00034
00035 namespace sc {
00036
00037
00038
00039
00040
00041
00042 inline void G12NCLibint2::g12nc_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 double zeta = pair12->gamma;
00078 double eta = pair34->gamma;
00079 double ooz = 1.0/zeta;
00080 double ooe = 1.0/eta;
00081 double ooze = 1.0/(zeta+eta);
00082 Data->roz[0] = eta*ooze;
00083 double rho = zeta*Data->roz[0];
00084 double rhog = rho + gamma;
00085 double oorhog = 1.0/rhog;
00086 double rho2 = rho*rho;
00087
00088 P[0] = pair12->P[0];
00089 P[1] = pair12->P[1];
00090 P[2] = pair12->P[2];
00091 Q[0] = pair34->P[0];
00092 Q[1] = pair34->P[1];
00093 Q[2] = pair34->P[2];
00094
00095 Data->oo2ze[0] = 0.5*ooze;
00096 Data->roe[0] = zeta*ooze;
00097 Data->oo2z[0] = 0.5 * ooz;
00098 Data->oo2e[0] = 0.5 * ooe;
00099 W[0] = (zeta*P[0] + eta*Q[0])*ooze;
00100 W[1] = (zeta*P[1] + eta*Q[1])*ooze;
00101 W[2] = (zeta*P[2] + eta*Q[2])*ooze;
00102
00103
00104 Data->PA_x[0] = P[0] - quartet_info_.A[0];
00105 Data->PA_y[0] = P[1] - quartet_info_.A[1];
00106 Data->PA_z[0] = P[2] - quartet_info_.A[2];
00107
00108 Data->QC_x[0] = Q[0] - quartet_info_.C[0];
00109 Data->QC_y[0] = Q[1] - quartet_info_.C[1];
00110 Data->QC_z[0] = Q[2] - quartet_info_.C[2];
00111
00112 Data->WP_x[0] = W[0] - P[0];
00113 Data->WP_y[0] = W[1] - P[1];
00114 Data->WP_z[0] = W[2] - P[2];
00115
00116 Data->WQ_x[0] = W[0] - Q[0];
00117 Data->WQ_y[0] = W[1] - Q[1];
00118 Data->WQ_z[0] = W[2] - Q[2];
00119
00120 PQ[0] = P[0] - Q[0];
00121 PQ[1] = P[1] - Q[1];
00122 PQ[2] = P[2] - Q[2];
00123 double PQ2 = PQ[0]*PQ[0];
00124 PQ2 += PQ[1]*PQ[1];
00125 PQ2 += PQ[2]*PQ[2];
00126
00127 const double pfac_norm = int_shell1_->coefficient_unnorm(quartet_info_.gc1,p1)*
00128 int_shell2_->coefficient_unnorm(quartet_info_.gc2,p2)*
00129 int_shell3_->coefficient_unnorm(quartet_info_.gc3,p3)*
00130 int_shell4_->coefficient_unnorm(quartet_info_.gc4,p4);
00131 const double pfac_normovlp = pfac_norm * pair12->ovlp * pair34->ovlp * scale;
00132
00133 if (eri_only) {
00134 double T = rho*PQ2;
00135 double pfac = 2.0*sqrt(rho*M_1_PI)*pfac_normovlp;
00136 if(T < small_T){
00137 assign_FjT(Data,quartet_info_.am,oo2np1,pfac);
00138 }
00139 else {
00140 double *fjttable = Fm_Eval_->values(quartet_info_.am,T);
00141 assign_FjT(Data,quartet_info_.am,fjttable,pfac);
00142 }
00143 return;
00144 }
00145
00146
00147 double T = rho2 * oorhog * PQ2;
00148
00149
00150
00151
00152 double rorg = rho * oorhog;
00153 double sqrt_rorg = sqrt(rorg);
00154 Data->LIBINT_T_SS_K0G12_SS_0[0] = rorg * sqrt_rorg * exp(-gamma*rorg*PQ2) * pfac_normovlp;
00155 Data->LIBINT_T_SS_K2G12_SS_0[0] = (1.5 + T) * Data->LIBINT_T_SS_K0G12_SS_0[0] * oorhog;
00156
00157
00158
00159
00160 double pfac = 2.0 * sqrt(rhog*M_1_PI) * Data->LIBINT_T_SS_K0G12_SS_0[0];
00161
00162 const double *F;
00163 if(T < small_T){
00164 F = oo2np1;
00165 }
00166 else {
00167 F = Fm_Eval_->values(quartet_info_.am,T);
00168 }
00169
00170 double ss_m1_ss[4*LIBINT2_MAX_AM_R12kG12+1];
00171 double g_i[4*LIBINT2_MAX_AM_R12kG12+1];
00172 double r_i[4*LIBINT2_MAX_AM_R12kG12+1];
00173 double oorhog_i[4*LIBINT2_MAX_AM_R12kG12+1];
00174 g_i[0] = 1.0;
00175 r_i[0] = 1.0;
00176 oorhog_i[0] = 1.0;
00177 for(int i=1; i<=quartet_info_.am; i++) {
00178 g_i[i] = g_i[i-1] * gamma;
00179 r_i[i] = r_i[i-1] * rho;
00180 oorhog_i[i] = oorhog_i[i-1] * oorhog;
00181 }
00182 for(int m=0; m<=quartet_info_.am; m++) {
00183 double ssss = 0.0;
00184 for(int k=0; k<=m; k++) {
00185 ssss += ExpMath_.bc[m][k] * r_i[k] * g_i[m-k] * F[k];
00186 }
00187 ss_m1_ss[m] = ssss * oorhog_i[m];
00188 }
00189
00190 assign_ss_r12m1g12_ss(Data,quartet_info_.am,ss_m1_ss,pfac);
00191
00192
00193
00194
00195
00196 {
00197 double u0 = 0.5/(zeta*eta + gamma*(zeta+eta));
00198
00199 {
00200 double t00 = a2*(eta + gamma);
00201 double t01 = gamma*a4;
00202 double t02 = gamma*eta;
00203 double T[3];
00204 for(int w=0;w<3; w++) {
00205 T[w] = -2.0 * u0 * (t00*(quartet_info_.A[w]-quartet_info_.B[w]) +
00206 t01*(quartet_info_.C[w]-quartet_info_.D[w]) +
00207 t02*(quartet_info_.A[w]-quartet_info_.C[w]));
00208 }
00209 Data->R12kG12_pfac0_0_x[0] = T[0];
00210 Data->R12kG12_pfac0_0_y[0] = T[1];
00211 Data->R12kG12_pfac0_0_z[0] = T[2];
00212 }
00213 {
00214 double t00 = a4*(zeta + gamma);
00215 double t01 = gamma*a2;
00216 double t02 = gamma*zeta;
00217 double T[3];
00218 for(int w=0;w<3; w++) {
00219 T[w] = -2.0 * u0 * (t00*(quartet_info_.C[w]-quartet_info_.D[w]) +
00220 t01*(quartet_info_.A[w]-quartet_info_.B[w]) +
00221 t02*(quartet_info_.C[w]-quartet_info_.A[w]));
00222 }
00223 Data->R12kG12_pfac0_1_x[0] = T[0];
00224 Data->R12kG12_pfac0_1_y[0] = T[1];
00225 Data->R12kG12_pfac0_1_z[0] = T[2];
00226 }
00227 {
00228 Data->R12kG12_pfac1_0[0] = u0 * (eta + gamma);
00229 Data->R12kG12_pfac1_1[0] = u0 * (zeta + gamma);
00230 }
00231 {
00232 Data->R12kG12_pfac2[0] = u0 * gamma;
00233 }
00234 {
00235 Data->R12kG12_pfac3_0[0] = eta*u0;
00236 Data->R12kG12_pfac3_1[0] = zeta*u0;
00237 }
00238 {
00239 double T[3];
00240 for(int w=0;w<3; w++) {
00241 T[w] = quartet_info_.A[w]-quartet_info_.C[w];
00242 }
00243 Data->R12kG12_pfac4_0_x[0] = T[0];
00244 Data->R12kG12_pfac4_0_y[0] = T[1];
00245 Data->R12kG12_pfac4_0_z[0] = T[2];
00246 Data->R12kG12_pfac4_1_x[0] = -T[0];
00247 Data->R12kG12_pfac4_1_y[0] = -T[1];
00248 Data->R12kG12_pfac4_1_z[0] = -T[2];
00249 }
00250 }
00251
00252 return;
00253 }
00254
00255 }
00256
00257 #endif
00258
00259
00260
00261
00262