28 #ifndef _mpqc_src_lib_chemistry_qc_libint2_tformtimpl_h
29 #define _mpqc_src_lib_chemistry_qc_libint2_tformtimpl_h
31 #include <chemistry/qc/libint2/int1e.h>
32 #include <chemistry/qc/libint2/int2e.h>
33 #include <chemistry/qc/libint2/gto.h>
37 template <
unsigned int ntypes>
void
38 Int1eLibint2::norm_contrcart_(
double *data)
40 const GaussianShell& sh1 = *int_shell1_;
41 const GaussianShell& sh2 = *int_shell2_;
44 if (!sh1.has_cartesian() && !sh2.has_cartesian())
47 const Ref<GTOInfo>& gto = GTOInfo::instance();
49 for (
int gc1=0; gc1<sh1.ncontraction(); gc1++) {
50 const unsigned int am1 = sh1.am(gc1);
51 const unsigned int n1 = sh1.nfunction(gc1);
52 const int is_pure1 = sh1.is_pure(gc1);
53 const double* ptr1 = is_pure1 ? gto->fp1() : gto->norm(am1);
55 for (
int gc2=0; gc2<sh2.ncontraction(); gc2++) {
56 const unsigned int am2 = sh2.am(gc2);
57 const unsigned int n2 = sh2.nfunction(gc2);
58 const int is_pure2 = sh2.is_pure(gc2);
59 if ( (am1 <= 1 && am2 <= 1) || (is_pure1 && is_pure2) ) {
63 const double* ptr2 = is_pure2 ? gto->fp1() : gto->norm(am2);
72 for (
unsigned ii = 0; ii < n1; ii++) {
73 const double norm_i = (is_pure1 ? 1.0 : ptr1[ii]);
74 for (
unsigned jj = 0; jj < n2; jj++) {
75 const double norm_ij = norm_i * (is_pure2 ? 1.0 : ptr2[jj]);
76 for (
unsigned int t = 0; t < ntypes; ++t)
85 template <
unsigned int ntypes>
87 Int2eLibint2::norm_contrcart_(
double *data)
89 const GaussianShell& sh1 = *int_shell1_;
90 const GaussianShell& sh2 = *int_shell2_;
91 const GaussianShell& sh3 = *int_shell3_;
92 const GaussianShell& sh4 = *int_shell4_;
94 const Ref<GTOInfo>& gto = GTOInfo::instance();
96 for (
int gc1=0; gc1<sh1.ncontraction(); gc1++) {
97 const unsigned int am1 = sh1.am(gc1);
98 const unsigned int n1 = sh1.nfunction(gc1);
99 const int is_pure1 = sh1.is_pure(gc1);
100 const double* ptr1 = is_pure1 ? gto->fp1() : gto->norm(am1);
102 for (
int gc2=0; gc2<sh2.ncontraction(); gc2++) {
103 const unsigned int am2 = sh2.am(gc2);
104 const unsigned int n2 = sh2.nfunction(gc2);
105 const int is_pure2 = sh2.is_pure(gc2);
106 const double* ptr2 = is_pure2 ? gto->fp1() : gto->norm(am2);
108 for (
int gc3=0; gc3<sh3.ncontraction(); gc3++) {
109 const unsigned int am3 = sh3.am(gc3);
110 const unsigned int n3 = sh3.nfunction(gc3);
111 const int is_pure3 = sh3.is_pure(gc3);
112 const double* ptr3 = is_pure3 ? gto->fp1() : gto->norm(am3);
114 for (
int gc4=0; gc4<sh4.ncontraction(); gc4++) {
115 const unsigned int am4 = sh4.am(gc4);
116 const unsigned int n4 = sh4.nfunction(gc4);
117 const int is_pure4 = sh4.is_pure(gc4);
118 const double* ptr4 = is_pure4 ? gto->fp1() : gto->norm(am4);
120 if (is_pure1 && is_pure2 && is_pure3 && is_pure4) {
121 data += n1*n2*n3*n4*ntypes;
132 for (
unsigned ii = 0; ii < n1; ii++) {
133 const double norm_i = is_pure1 ? 1.0 : ptr1[ii];
134 for (
unsigned jj = 0; jj < n2; jj++) {
135 const double norm_ij = norm_i * (is_pure2 ? 1.0 : ptr2[jj]);
136 for (
unsigned kk = 0; kk < n3; kk++) {
137 const double norm_ijk = norm_ij * (is_pure3 ? 1.0 : ptr3[kk]);
138 for (
unsigned ll = 0; ll < n4; ll++) {
139 const double norm_ijkl = norm_ijk * (is_pure4 ? 1.0 : ptr4[ll]);
140 for(
unsigned int t=0; t<ntypes; ++t)
141 *(data++) *= norm_ijkl;
153 #endif // end of header guard