28 #ifndef _chemistry_qc_libint2_g12dkhquartetdata_h
29 #define _chemistry_qc_libint2_g12dkhquartetdata_h
31 #include <util/misc/math.h>
32 #include <chemistry/qc/libint2/static.h>
33 #include <chemistry/qc/libint2/libint2_utils.h>
42 inline void G12DKHLibint2::g12dkh_quartet_data_(prim_data *Data,
double scale,
double gamma_bra,
double gamma_ket)
50 double P[3], Q[3], PQ[3], W[3];
51 const double small_T = 1E-15;
53 const int p1 = quartet_info_.p1;
54 const int p2 = quartet_info_.p2;
55 const int p3 = quartet_info_.p3;
56 const int p4 = quartet_info_.p4;
58 const double a1 = int_shell1_->exponent(quartet_info_.p1);
59 const double a2 = int_shell2_->exponent(quartet_info_.p2);
60 const double a3 = int_shell3_->exponent(quartet_info_.p3);
61 const double a4 = int_shell4_->exponent(quartet_info_.p4);
65 if (!quartet_info_.p13p24) {
66 pair12 = quartet_info_.shell_pair12->prim_pair(*quartet_info_.op1,*quartet_info_.op2);
67 pair34 = quartet_info_.shell_pair34->prim_pair(*quartet_info_.op3,*quartet_info_.op4);
70 pair12 = quartet_info_.shell_pair34->prim_pair(*quartet_info_.op3,*quartet_info_.op4);
71 pair34 = quartet_info_.shell_pair12->prim_pair(*quartet_info_.op1,*quartet_info_.op2);
77 const double zeta = pair12->gamma;
78 const double eta = pair34->gamma;
79 const double ooz = 1.0/zeta;
80 const double ooe = 1.0/eta;
81 const double ooze = 1.0/(zeta+eta);
82 Data->roz[0] = eta*ooze;
83 const double rho = zeta*Data->roz[0];
84 const double gamma = gamma_bra + gamma_ket;
85 const double rhog = rho + gamma;
86 const double oorhog = 1.0/rhog;
87 const double rho2 = rho*rho;
89 Data->oo2ze[0] = 0.5*ooze;
90 Data->roe[0] = zeta*ooze;
91 Data->oo2z[0] = 0.5 * ooz;
92 Data->oo2e[0] = 0.5 * ooe;
94 #if LIBINT2_DEFINED(g12,zeta_A)
97 #if LIBINT2_DEFINED(g12,zeta_B)
100 #if LIBINT2_DEFINED(g12,zeta_C)
101 Data->zeta_C[0] = a3;
103 #if LIBINT2_DEFINED(g12,zeta_D)
104 Data->zeta_D[0] = a4;
113 W[0] = (zeta*P[0] + eta*Q[0])*ooze;
114 W[1] = (zeta*P[1] + eta*Q[1])*ooze;
115 W[2] = (zeta*P[2] + eta*Q[2])*ooze;
118 Data->PA_x[0] = P[0] - quartet_info_.A[0];
119 Data->PA_y[0] = P[1] - quartet_info_.A[1];
120 Data->PA_z[0] = P[2] - quartet_info_.A[2];
122 Data->QC_x[0] = Q[0] - quartet_info_.C[0];
123 Data->QC_y[0] = Q[1] - quartet_info_.C[1];
124 Data->QC_z[0] = Q[2] - quartet_info_.C[2];
126 Data->WP_x[0] = W[0] - P[0];
127 Data->WP_y[0] = W[1] - P[1];
128 Data->WP_z[0] = W[2] - P[2];
130 Data->WQ_x[0] = W[0] - Q[0];
131 Data->WQ_y[0] = W[1] - Q[1];
132 Data->WQ_z[0] = W[2] - Q[2];
135 #if LIBINT2_DEFINED(g12,AC_x)
136 Data->AC_x[0] = quartet_info_.A[0] - quartet_info_.C[0];
138 #if LIBINT2_DEFINED(g12,AC_y)
139 Data->AC_y[0] = quartet_info_.A[1] - quartet_info_.C[1];
141 #if LIBINT2_DEFINED(g12,AC_z)
142 Data->AC_z[0] = quartet_info_.A[2] - quartet_info_.C[2];
145 #if LIBINT2_DEFINED(g12,BD_x)
146 Data->BD_x[0] = quartet_info_.B[0] - quartet_info_.D[0];
148 #if LIBINT2_DEFINED(g12,BD_y)
149 Data->BD_y[0] = quartet_info_.B[1] - quartet_info_.D[1];
151 #if LIBINT2_DEFINED(g12,BD_z)
152 Data->BD_z[0] = quartet_info_.B[2] - quartet_info_.D[2];
154 #if LIBINT2_DEFINED(g12,gamma_bra)
155 Data->gamma_bra[0] = gamma_bra;
157 #if LIBINT2_DEFINED(g12,gamma_ket)
158 Data->gamma_ket[0] = gamma_ket;
164 const double PQ2 = PQ[0]*PQ[0] + PQ[1]*PQ[1] + PQ[2]*PQ[2];
166 const double pfac_norm = int_shell1_->coefficient_unnorm(quartet_info_.gc1,p1)*
167 int_shell2_->coefficient_unnorm(quartet_info_.gc2,p2)*
168 int_shell3_->coefficient_unnorm(quartet_info_.gc3,p3)*
169 int_shell4_->coefficient_unnorm(quartet_info_.gc4,p4);
170 const double pfac_normovlp = pfac_norm * pair12->ovlp * pair34->ovlp * scale;
171 const double T = rho2 * oorhog * PQ2;
176 const double rorg = rho * oorhog;
177 const double sqrt_rorg = sqrt(rorg);
178 Data->LIBINT_T_SS_K0G12_SS_0[0] = rorg * sqrt_rorg * exp(-gamma*rorg*PQ2) * pfac_normovlp;
179 const double ssss_o_rhog = Data->LIBINT_T_SS_K0G12_SS_0[0] * oorhog;
180 Data->LIBINT_T_SS_K2G12_SS_0[0] = (1.5 + T) * ssss_o_rhog;
181 Data->LIBINT_T_SS_K4G12_SS_0[0] = (15.0/4.0 + 5.0*T + T*T) * ssss_o_rhog * oorhog;
187 const double u0 = 0.5/(zeta*eta + gamma*(zeta+eta));
190 const double t00 = a2*(eta + gamma);
191 const double t01 = gamma*a4;
192 const double t02 = gamma*eta;
194 for(
int w=0;w<3; w++) {
195 T[w] = -2.0 * u0 * (t00*(quartet_info_.A[w]-quartet_info_.B[w]) +
196 t01*(quartet_info_.C[w]-quartet_info_.D[w]) +
197 t02*(quartet_info_.A[w]-quartet_info_.C[w]));
199 Data->R12kG12_pfac0_0_x[0] = T[0];
200 Data->R12kG12_pfac0_0_y[0] = T[1];
201 Data->R12kG12_pfac0_0_z[0] = T[2];
204 const double t00 = a4*(zeta + gamma);
205 const double t01 = gamma*a2;
206 const double t02 = gamma*zeta;
208 for(
int w=0;w<3; w++) {
209 T[w] = -2.0 * u0 * (t00*(quartet_info_.C[w]-quartet_info_.D[w]) +
210 t01*(quartet_info_.A[w]-quartet_info_.B[w]) +
211 t02*(quartet_info_.C[w]-quartet_info_.A[w]));
213 Data->R12kG12_pfac0_1_x[0] = T[0];
214 Data->R12kG12_pfac0_1_y[0] = T[1];
215 Data->R12kG12_pfac0_1_z[0] = T[2];
218 Data->R12kG12_pfac1_0[0] = u0 * (eta + gamma);
219 Data->R12kG12_pfac1_1[0] = u0 * (zeta + gamma);
222 Data->R12kG12_pfac2[0] = u0 * gamma;
225 Data->R12kG12_pfac3_0[0] = eta*u0;
226 Data->R12kG12_pfac3_1[0] = zeta*u0;
230 for(
int w=0;w<3; w++) {
231 T[w] = quartet_info_.A[w]-quartet_info_.C[w];
233 Data->R12kG12_pfac4_0_x[0] = T[0];
234 Data->R12kG12_pfac4_0_y[0] = T[1];
235 Data->R12kG12_pfac4_0_z[0] = T[2];
236 Data->R12kG12_pfac4_1_x[0] = -T[0];
237 Data->R12kG12_pfac4_1_y[0] = -T[1];
238 Data->R12kG12_pfac4_1_z[0] = -T[2];