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_G12DKH
00046 #ifndef _chemistry_qc_libint2_g12dkh_h
00047 #define _chemistry_qc_libint2_g12dkh_h
00048
00049 namespace sc {
00050
00051 class Integral;
00052
00058 class G12DKHLibint2: public Int2eLibint2 {
00059 private:
00061 static const int num_te_types_ = TwoBodyIntDescrG12DKH::num_intsets;
00062
00063 typedef IntParamsG12::PrimitiveGeminal PrimitiveGeminal;
00064 typedef IntParamsG12::ContractedGeminal ContractedGeminal;
00065
00066 ContractedGeminal geminal_bra_;
00067
00068 ContractedGeminal geminal_ket_;
00069
00070
00071 double *target_ints_buffer_[num_te_types_];
00072
00073
00074 double *cart_ints_[num_te_types_];
00075 double *sphharm_ints_;
00076 double *perm_ints_;
00077
00078
00079 double *prim_ints_[num_te_types_];
00080 double *contr_quartets_[num_te_types_];
00081 double *shell_quartet_[num_te_types_];
00082
00083
00084 Ref<ShellPairsLibint2> shell_pairs12_;
00085 Ref<ShellPairsLibint2> shell_pairs34_;
00086
00087
00088 struct {
00089 int p12, p34, p13p24;
00090 ShellPairLibint2 *shell_pair12, *shell_pair34;
00091
00092 int *op1, *op2, *op3, *op4;
00094 double A[3], B[3], C[3], D[3];
00095 double AB2, CD2;
00096 int gc1, gc2, gc3, gc4;
00097 int p1, p2, p3, p4;
00098 int am;
00099 } quartet_info_;
00100 typedef Libint_t prim_data;
00101 void g12dkh_quartet_data_(prim_data *Data, double scale, double gamma_bra, double gamma_ket);
00102
00103 Libint_t Libint_;
00104 Ref<Fjt> Fm_Eval_;
00105
00106 class ExpensiveMath {
00107 public:
00108 ExpensiveMath();
00109 double fac[4*LIBINT2_MAX_AM_G12DKH+1];
00110 double bc[4*LIBINT2_MAX_AM_G12DKH+1][4*LIBINT2_MAX_AM_G12DKH+1];
00111 };
00112 ExpensiveMath ExpMath_;
00113
00114 public:
00116 G12DKHLibint2(Integral *,
00117 const Ref<GaussianBasisSet>&,
00118 const Ref<GaussianBasisSet>&,
00119 const Ref<GaussianBasisSet>&,
00120 const Ref<GaussianBasisSet>&,
00121 size_t storage,
00122 const ContractedGeminal& gbra
00123 );
00124 ~G12DKHLibint2();
00125
00126 double *buffer(unsigned int t) const {
00127 return target_ints_buffer_[t];
00128 }
00129
00130 static size_t storage_required(const Ref<GaussianBasisSet>& b1,
00131 const Ref<GaussianBasisSet>& b2 = 0,
00132 const Ref<GaussianBasisSet>& b3 = 0,
00133 const Ref<GaussianBasisSet>& b4 = 0);
00134
00135
00136 void compute_quartet(int*, int*, int*, int*);
00137 };
00138
00139 }
00140
00141 #include <chemistry/qc/libint2/g12dkh_quartet_data.h>
00142
00143 #endif // header guard
00144 #endif // if LIBINT2_SUPPORT_G12DKH
00145
00146
00147
00148
00149