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 #ifdef __GNUG__
00029 #pragma interface
00030 #endif
00031
00032 #include <limits.h>
00033 #include <stdexcept>
00034
00035 #include <util/ref/ref.h>
00036 #include <util/class/scexception.h>
00037 #include <chemistry/qc/basis/basis.h>
00038 #include <chemistry/qc/basis/intparams.h>
00039 #include <chemistry/qc/basis/intdescr.h>
00040 #include <chemistry/qc/libint2/shellpairs.h>
00041 #include <chemistry/qc/basis/fjt.h>
00042 #include <chemistry/qc/libint2/int2e.h>
00043 #include <libint2/libint2.h>
00044
00045 #if LIBINT2_SUPPORT_G12
00046 #ifndef _chemistry_qc_libint2_g12_h
00047 #define _chemistry_qc_libint2_g12_h
00048
00049 namespace sc {
00050
00051 class Integral;
00052
00065 class G12Libint2: public Int2eLibint2 {
00066 private:
00068 static const int num_te_types_ = TwoBodyIntDescrG12::num_intsets;
00069
00070 typedef IntParamsG12::PrimitiveGeminal PrimitiveGeminal;
00071 typedef IntParamsG12::ContractedGeminal ContractedGeminal;
00072
00073 ContractedGeminal geminal_bra_;
00074
00075 ContractedGeminal geminal_ket_;
00076
00077
00078 double *target_ints_buffer_[num_te_types_];
00079
00080
00081 double *cart_ints_[num_te_types_];
00082 double *sphharm_ints_;
00083 double *perm_ints_;
00084
00085
00086 double *prim_ints_[num_te_types_];
00087 double *contr_quartets_[num_te_types_];
00088 double *shell_quartet_[num_te_types_];
00089
00090
00091 Ref<ShellPairsLibint2> shell_pairs12_;
00092 Ref<ShellPairsLibint2> shell_pairs34_;
00093
00094
00095 struct {
00096 int p12, p34, p13p24;
00097 ShellPairLibint2 *shell_pair12, *shell_pair34;
00098
00099 int *op1, *op2, *op3, *op4;
00101 double A[3], B[3], C[3], D[3];
00102 double AB2, CD2;
00103 int gc1, gc2, gc3, gc4;
00104 int p1, p2, p3, p4;
00105 int am;
00106 } quartet_info_;
00107 typedef Libint_t prim_data;
00108 void g12_quartet_data_(prim_data *Data, double scale, double gamma,
00109 bool eri_only = false);
00110
00111 Libint_t Libint_;
00112 Ref<Fjt> Fm_Eval_;
00113
00114 class ExpensiveMath {
00115 public:
00116 ExpensiveMath();
00117 double fac[4*LIBINT2_MAX_AM_R12kG12+1];
00118 double bc[4*LIBINT2_MAX_AM_R12kG12+1][4*LIBINT2_MAX_AM_R12kG12+1];
00119 };
00120 ExpensiveMath ExpMath_;
00121
00122 public:
00124 G12Libint2(Integral *,
00125 const Ref<GaussianBasisSet>&,
00126 const Ref<GaussianBasisSet>&,
00127 const Ref<GaussianBasisSet>&,
00128 const Ref<GaussianBasisSet>&,
00129 size_t storage,
00130 const ContractedGeminal& gbra,
00131 const ContractedGeminal& gket
00132 );
00133 ~G12Libint2();
00134
00135 double *buffer(unsigned int t) const {
00136 return target_ints_buffer_[t];
00137 }
00138
00139 static size_t storage_required(const Ref<GaussianBasisSet>& b1,
00140 const Ref<GaussianBasisSet>& b2 = 0,
00141 const Ref<GaussianBasisSet>& b3 = 0,
00142 const Ref<GaussianBasisSet>& b4 = 0);
00143
00144
00145 void compute_quartet(int*, int*, int*, int*);
00146 };
00147
00148 }
00149
00150 #include <chemistry/qc/libint2/g12_quartet_data.h>
00151
00152 #endif // header guard
00153 #endif // if LIBINT2_SUPPORT_G12
00154
00155
00156
00157
00158