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_eriquartetdata_h
00033 #define _chemistry_qc_libint2_eriquartetdata_h
00034
00035 namespace sc {
00036
00037
00038
00039
00040 inline void EriLibint2::eri_quartet_data_(prim_data *Data, double scale)
00041 {
00042 #define STATIC_OO2NP1
00043 #include "static.h"
00044
00045
00046
00047
00048 double P[3], Q[3], PQ[3], W[3];
00049 double small_T = 1E-15;
00050
00051 int p1 = quartet_info_.p1;
00052 int p2 = quartet_info_.p2;
00053 int p3 = quartet_info_.p3;
00054 int p4 = quartet_info_.p4;
00055
00056 double a1 = int_shell1_->exponent(quartet_info_.p1);
00057 double a2 = int_shell2_->exponent(quartet_info_.p2);
00058 double a3 = int_shell3_->exponent(quartet_info_.p3);
00059 double a4 = int_shell4_->exponent(quartet_info_.p4);
00060
00061 prim_pair_t* pair12;
00062 prim_pair_t* pair34;
00063 if (!quartet_info_.p13p24) {
00064 pair12 = quartet_info_.shell_pair12->prim_pair(*quartet_info_.op1,*quartet_info_.op2);
00065 pair34 = quartet_info_.shell_pair34->prim_pair(*quartet_info_.op3,*quartet_info_.op4);
00066 }
00067 else {
00068 pair12 = quartet_info_.shell_pair34->prim_pair(*quartet_info_.op3,*quartet_info_.op4);
00069 pair34 = quartet_info_.shell_pair12->prim_pair(*quartet_info_.op1,*quartet_info_.op2);
00070 }
00071
00072 double zeta = pair12->gamma;
00073 double eta = pair34->gamma;
00074 double ooz = 1.0/zeta;
00075 double ooe = 1.0/eta;
00076 double ooze = 1.0/(zeta+eta);
00077 Data->roz[0] = eta*ooze;
00078 double rho = zeta*Data->roz[0];
00079
00080 double pfac_norm = int_shell1_->coefficient_unnorm(quartet_info_.gc1,p1)*
00081 int_shell2_->coefficient_unnorm(quartet_info_.gc2,p2)*
00082 int_shell3_->coefficient_unnorm(quartet_info_.gc3,p3)*
00083 int_shell4_->coefficient_unnorm(quartet_info_.gc4,p4);
00084 double pfac = 2.0*sqrt(rho*M_1_PI)*scale*pair12->ovlp*pair34->ovlp*pfac_norm;
00085
00086 P[0] = pair12->P[0];
00087 P[1] = pair12->P[1];
00088 P[2] = pair12->P[2];
00089 Q[0] = pair34->P[0];
00090 Q[1] = pair34->P[1];
00091 Q[2] = pair34->P[2];
00092 PQ[0] = P[0] - Q[0];
00093 PQ[1] = P[1] - Q[1];
00094 PQ[2] = P[2] - Q[2];
00095 double PQ2 = PQ[0]*PQ[0];
00096 PQ2 += PQ[1]*PQ[1];
00097 PQ2 += PQ[2]*PQ[2];
00098 double T = rho*PQ2;
00099
00100 if (!quartet_info_.am) {
00101 double *fjttable = Fm_Eval_->values(0,T);
00102 Data->LIBINT_T_SS_EREP_SS(0)[0] = fjttable[0]*pfac;
00103 }
00104 else {
00105 Data->oo2ze[0] = 0.5*ooze;
00106 Data->roe[0] = zeta*ooze;
00107 Data->oo2z[0] = 0.5/zeta;
00108 Data->oo2e[0] = 0.5/eta;
00109 W[0] = (zeta*P[0] + eta*Q[0])*ooze;
00110 W[1] = (zeta*P[1] + eta*Q[1])*ooze;
00111 W[2] = (zeta*P[2] + eta*Q[2])*ooze;
00112
00113 if(T < small_T){
00114 assign_FjT(Data,quartet_info_.am,oo2np1,pfac);
00115 }
00116 else {
00117 double *fjttable = Fm_Eval_->values(quartet_info_.am,T);
00118 assign_FjT(Data,quartet_info_.am,fjttable,pfac);
00119 }
00120
00121
00122 Data->PA_x[0] = P[0] - quartet_info_.A[0];
00123 Data->PA_y[0] = P[1] - quartet_info_.A[1];
00124 Data->PA_z[0] = P[2] - quartet_info_.A[2];
00125
00126 Data->QC_x[0] = Q[0] - quartet_info_.C[0];
00127 Data->QC_y[0] = Q[1] - quartet_info_.C[1];
00128 Data->QC_z[0] = Q[2] - quartet_info_.C[2];
00129
00130 Data->WP_x[0] = W[0] - P[0];
00131 Data->WP_y[0] = W[1] - P[1];
00132 Data->WP_z[0] = W[2] - P[2];
00133
00134 Data->WQ_x[0] = W[0] - Q[0];
00135 Data->WQ_y[0] = W[1] - Q[1];
00136 Data->WQ_z[0] = W[2] - Q[2];
00137 }
00138
00139 return;
00140 }
00141
00142 }
00143
00144 #endif
00145
00146
00147
00148
00149