MPQC  3.0.0-alpha
int1e.h
1 //
2 // int1e.h
3 //
4 // Copyright (C) 2001 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_int1e_h
29 #define _chemistry_qc_libint2_int1e_h
30 
31 #include <util/ref/ref.h>
32 #include <chemistry/qc/basis/basis.h>
33 #include <chemistry/qc/basis/obint.h>
34 #include <chemistry/qc/basis/fjt.h>
35 #include <libint2/boys.h>
36 #include <chemistry/qc/libint2/core_ints_engine.h>
37 
38 namespace sc {
39 
40 class Integral;
41 
44 class Int1eLibint2: public RefCount {
45  protected:
46  Integral *integral_;
47 
50 
51  Ref<IntParams> operset_params_;
52  Ref<EfieldDotVectorData> EdotV_origin_;
53  Ref<PointChargeData> Q_origin_;
54 
55  bool need_overlap_;
56  bool need_coulomb_;
57 
58  int ntypes_; // Number of integrals held together
59  // usually 1, 3 for dipole, 6 for quadrupole, etc.
60 
61  double *target_ints_buffer_; // buffer of integrals in a shell doublet
62  int max_doublet_size_;
63 
64  /*--- Internal scratch ---*/
65  double *cart_ints_; // buffer of cartesian integrals in by-contraction-doublets order
66  double *sphharm_ints_; // buffer of integrals over spherical harmonics in by-contraction-doublets order
67  double *tformbuf_; // temporary scratch used in cart.->sph.harm. transforms
68  int max_cart_doublet_size_;
69 
70  /*--- Pointers to scratch arrays (never used in new[] and delete[]) ---*/
71  double *prim_ints_; // this points to the appropriate location for raw integrals
72  double *contr_doublets_;
73  double *shell_doublet_;
74 
75  /*--- Internally used "interfaces" ---*/
76  GaussianShell *int_shell1_;
77  GaussianShell *int_shell2_;
78  struct {
79  double A[3], B[3];
80  double AB2;
81  int gc1, gc2;
82  int p1, p2;
83  int am;
84  } doublet_info_;
85  // Buffers for primitive overlap integrals over 1D Gaussians
86  double **OIX_, **OIY_, **OIZ_;
87  // Buffer for primitive nuclear attraction integrals
88  // Such buffer contains all integrals including intermediates
89  // These integrals are nonseparable, hence the first and second indices are composite
90  double ***AI0_;
91  double ***AIX_;
92  double ***AIY_;
93  double ***AIZ_;
94  double ***AIXX_;
95  double ***AIXY_;
96  double ***AIXZ_;
97  double ***AIYY_;
98  double ***AIYZ_;
99  double ***AIZZ_;
100  int indmax_; // that's the range of the first 2 indices of AI0
101  // Compute engines
102  // Order = 0 => potential
103  // Order = 1 => efield
104  // Order = 2 => efield gradient
105  template <int Order> void AI_OSrecurs_(double PA[3], double PB[3],
106  double PC[3], double gamma, int iang, int jang);
107  void OI_OSrecurs_(double **OIX, double **OIY, double **OIZ, double PA[3], double PB[3],
108  double gamma, int lmaxi, int lmaxj);
109  typedef ::libint2::FmEval_Taylor<double,7> _FmEvalType;
111  Ref<FmEvalType> Fm_Eval_;
112  double* Fm_table_;
113 
114  // tasks common to different types of integral evaluation
115  void compute_doublet_info_(int, int);
116  void zero_buffers_();
117  void transform_contrquartets_(double *, double *);
118  void sort_contrdoublets_to_shelldoublet_(double *, double *);
119  void norm_contrcart1_(double* data);
120  template <unsigned int ntypes> void norm_contrcart_(double* data);
121  // same tasks, but adapted for the case of several sets of integrals (multipole, etc.)
122  void zero_buffers_vec_(const int);
123  void transform_contrquartets_vec_(const int, double *, double *);
124  void sort_contrdoublets_to_shelldoublet_vec_(const int, double *, double *);
125  // specialized versions of compute routines
126  void overlap_full_general_();
127  void overlap_sameam_general_();
128  void kinetic_full_general_();
129  void kinetic_sameam_general_();
130  void nuclear_full_general_();
131  void nuclear_sameam_general_();
132  void hcore_full_general_();
133  void hcore_sameam_general_();
134  void edipole_full_general_();
135  void equadrupole_full_general_();
136  void efield_full_general_();
137  void efield_grad_full_general_();
138  void p4_full_general_();
139 
140  // Utility functions
141  double **init_block_(int, int); // Used to allocate OIXYZ
142  void free_block_(double **);
143  double ***init_box_(int, int, int); // Used to allocate AI0;
144  void free_box_(double ***);
145 
146  public:
148  const Ref<GaussianBasisSet>&,
149  const Ref<GaussianBasisSet>&,
150  int order, bool need_overlap, bool need_coulomb, int ntypes);
151  ~Int1eLibint2();
152 
153  void set_params(const Ref<IntParams>& p);
154  void set_EdotV_origin(const Ref<EfieldDotVectorData>&);
155  void set_Q_origin(const Ref<PointChargeData>&);
156  Ref<IntParams> params();
157  Ref<IntParamsOrigin> origin();
158  Ref<EfieldDotVectorData> EdotV_origin();
159  Ref<PointChargeData> Q_origin();
160 
161  double *buffer() { return target_ints_buffer_; }
162  Ref<GaussianBasisSet> basis() { if (bs1_==bs2_) return bs1_; return 0; }
163  Ref<GaussianBasisSet> basis1() { return bs1_; }
164  Ref<GaussianBasisSet> basis2() { return bs2_; }
165 
166  void kinetic(int ish, int jsh);
167  void nuclear(int ish, int jsh);
168  void overlap(int ish, int jsh);
169  void hcore(int ish, int jsh);
170  void edipole(int ish, int jsh);
171  void equadrupole(int ish, int jsh);
172  void efield(int ish, int jsh);
173  void efield_grad(int ish, int jsh);
174  void p4(int ish, int jsh);
175 };
176 
177 #include <chemistry/qc/libint2/obosrr.timpl.h>
178 
179 }
180 
181 #endif
182 
183 // Local Variables:
184 // mode: c++
185 // c-file-style: "CLJ"
186 // End:
sc::Ref
A template class that maintains references counts.
Definition: ref.h:361
sc::CoreIntsEngine::Engine
Definition: core_ints_engine.h:50
sc::Integral
The Integral abstract class acts as a factory to provide objects that compute one and two electron in...
Definition: integral.h:111
sc::RefCount
The base class for all reference counted objects.
Definition: ref.h:192
sc::Int1eLibint2
Int1eLibint2 is used by OneBodyIntLibint2 and OneBodyDerivIntLibint2 to implement IntegralLibint2.
Definition: int1e.h:44
sc
Contains all MPQC code up to version 3.
Definition: mpqcin.h:14
sc::GaussianShell
A shell of Gaussian functions.
Definition: gaussshell.h:51

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