MPQC  3.0.0-alpha
g12dkh_quartet_data.h
1 //
2 // g12dkh_quartet_data.h
3 //
4 // Copyright (C) 2005 Edward Valeev
5 //
6 // Author: Edward Valeev <evaleev@vt.edu>
7 // Maintainer: EV
8 //
9 // This file is part of the SC Toolkit.
10 //
11 // The SC Toolkit is free software; you can redistribute it and/or modify
12 // it under the terms of the GNU Library General Public License as published by
13 // the Free Software Foundation; either version 2, or (at your option)
14 // any later version.
15 //
16 // The SC Toolkit is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 // GNU Library General Public License for more details.
20 //
21 // You should have received a copy of the GNU Library General Public License
22 // along with the SC Toolkit; see the file COPYING.LIB. If not, write to
23 // the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
24 //
25 // The U.S. Government is granted a limited license as per AL 91-7.
26 //
27 
28 #ifndef _chemistry_qc_libint2_g12dkhquartetdata_h
29 #define _chemistry_qc_libint2_g12dkhquartetdata_h
30 
31 #include <util/misc/math.h>
32 #include <chemistry/qc/libint2/static.h>
33 #include <chemistry/qc/libint2/libint2_utils.h>
34 
35 namespace sc {
36 
37 /*--------------------------------------------------------------------------------
38  This function computes constants used in OSRR for a given quartet of primitives
39 
40  gamma is the exponent of the Gaussian geminal in the integral
41  --------------------------------------------------------------------------------*/
42 inline void G12DKHLibint2::g12dkh_quartet_data_(prim_data *Data, double scale, double gamma_bra, double gamma_ket)
43 {
44 #define STATIC_OO2NP1
45 #include "static.h"
46 
47  /*----------------
48  Local variables
49  ----------------*/
50  double P[3], Q[3], PQ[3], W[3];
51  const double small_T = 1E-15; /*--- Use only one term in Taylor expansion of Fj(T) if T < small_T ---*/
52 
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;
57 
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);
62 
63  prim_pair_t* pair12;
64  prim_pair_t* pair34;
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);
68  }
69  else {
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);
72  }
73 
74  //
75  // prefactors for (ab|-1|cd) are same as for OSRR, only (00|-1|00)^m are different
76  //
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;
88 
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;
93 
94 #if LIBINT2_DEFINED(g12,zeta_A)
95  Data->zeta_A[0] = a1;
96 #endif
97 #if LIBINT2_DEFINED(g12,zeta_B)
98  Data->zeta_B[0] = a2;
99 #endif
100 #if LIBINT2_DEFINED(g12,zeta_C)
101  Data->zeta_C[0] = a3;
102 #endif
103 #if LIBINT2_DEFINED(g12,zeta_D)
104  Data->zeta_D[0] = a4;
105 #endif
106 
107  P[0] = pair12->P[0];
108  P[1] = pair12->P[1];
109  P[2] = pair12->P[2];
110  Q[0] = pair34->P[0];
111  Q[1] = pair34->P[1];
112  Q[2] = pair34->P[2];
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;
116 
117  /* PA */
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];
121  /* QC */
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];
125  /* WP */
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];
129  /* WQ */
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];
133 
134  /* AC */
135 #if LIBINT2_DEFINED(g12,AC_x)
136  Data->AC_x[0] = quartet_info_.A[0] - quartet_info_.C[0];
137 #endif
138 #if LIBINT2_DEFINED(g12,AC_y)
139  Data->AC_y[0] = quartet_info_.A[1] - quartet_info_.C[1];
140 #endif
141 #if LIBINT2_DEFINED(g12,AC_z)
142  Data->AC_z[0] = quartet_info_.A[2] - quartet_info_.C[2];
143 #endif
144  /* BD */
145 #if LIBINT2_DEFINED(g12,BD_x)
146  Data->BD_x[0] = quartet_info_.B[0] - quartet_info_.D[0];
147 #endif
148 #if LIBINT2_DEFINED(g12,BD_y)
149  Data->BD_y[0] = quartet_info_.B[1] - quartet_info_.D[1];
150 #endif
151 #if LIBINT2_DEFINED(g12,BD_z)
152  Data->BD_z[0] = quartet_info_.B[2] - quartet_info_.D[2];
153 #endif
154 #if LIBINT2_DEFINED(g12,gamma_bra)
155  Data->gamma_bra[0] = gamma_bra;
156 #endif
157 #if LIBINT2_DEFINED(g12,gamma_ket)
158  Data->gamma_ket[0] = gamma_ket;
159 #endif
160 
161  PQ[0] = P[0] - Q[0];
162  PQ[1] = P[1] - Q[1];
163  PQ[2] = P[2] - Q[2];
164  const double PQ2 = PQ[0]*PQ[0] + PQ[1]*PQ[1] + PQ[2]*PQ[2];
165 
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;
172 
173  //
174  // (00|0|00), (00|2|00), and (00|4|00) need to start recursion for (ab|0|cd), (ab|2|cd), (ab|4|cd)
175  //
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;
182 
183  //
184  // prefactors for (a0|k|c0) (k!=-1) VRR
185  //
186  {
187  const double u0 = 0.5/(zeta*eta + gamma*(zeta+eta));
188 
189  {
190  const double t00 = a2*(eta + gamma);
191  const double t01 = gamma*a4;
192  const double t02 = gamma*eta;
193  double T[3];
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]));
198  }
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];
202  }
203  {
204  const double t00 = a4*(zeta + gamma);
205  const double t01 = gamma*a2;
206  const double t02 = gamma*zeta;
207  double T[3];
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]));
212  }
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];
216  }
217  {
218  Data->R12kG12_pfac1_0[0] = u0 * (eta + gamma);
219  Data->R12kG12_pfac1_1[0] = u0 * (zeta + gamma);
220  }
221  {
222  Data->R12kG12_pfac2[0] = u0 * gamma;
223  }
224  {
225  Data->R12kG12_pfac3_0[0] = eta*u0;
226  Data->R12kG12_pfac3_1[0] = zeta*u0;
227  }
228  {
229  double T[3];
230  for(int w=0;w<3; w++) {
231  T[w] = quartet_info_.A[w]-quartet_info_.C[w];
232  }
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];
239  }
240  }
241 
242  return;
243 }
244 
245 }
246 
247 #endif
248 
249 // Local Variables:
250 // mode: c++
251 // c-file-style: "CLJ"
252 // End:
sc
Contains all MPQC code up to version 3.
Definition: mpqcin.h:14

Generated at Sun Jan 26 2020 23:23:58 for MPQC 3.0.0-alpha using the documentation package Doxygen 1.8.16.