Psi4
eri.h
Go to the documentation of this file.
1 /*
2  * @BEGIN LICENSE
3  *
4  * Psi4: an open-source quantum chemistry software package
5  *
6  * Copyright (c) 2007-2017 The Psi4 Developers.
7  *
8  * The copyrights for code used from other parties are included in
9  * the corresponding files.
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * This program 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 General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License along
22  * with this program; if not, write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24  *
25  * @END LICENSE
26  */
27 
28 #ifndef _psi_src_lib_libmints_eri_h
29 #define _psi_src_lib_libmints_eri_h
30 
31 #include <libint/libint.h>
32 #include <libint/libderiv.h>
33 #include "psi4/libmints/twobody.h"
34 
35 namespace psi {
36 
37 class BasisSet;
38 class GaussianShell;
39 class TwoBodyAOInt;
40 class IntegralFactory;
41 class SphericalTransform;
42 class Fjt;
43 class AOShellCombinationsIterator;
44 class CorrelationFactor;
45 
50 typedef struct ShellPair_typ {
52  int i, j;
54  double *** P;
56  double AB[3];
58  double *** PA;
60  double *** PB;
62  double * ai, * aj;
64  double ** gamma;
66  double * ci, * cj;
68  double ** overlap;
69 } ShellPair;
70 
76 {
77 protected:
79  Libint_t libint_;
81  Libderiv_t libderiv_;
82 
84  int max_cart_;
85 
88 
90  size_t compute_quartet(int, int, int, int);
91 
93  size_t compute_quartet_deriv1(int, int, int, int);
94 
96  size_t compute_quartet_deriv2(int, int, int, int);
97 
99  void init_shell_pairs12();
100  void init_shell_pairs34();
101 
103  void free_shell_pairs12();
104  void free_shell_pairs34();
105 
108 
110  double *stack12_, *stack34_;
111 
114 
116  size_t memory_to_store_shell_pairs(const std::shared_ptr<BasisSet>&, const std::shared_ptr<BasisSet>&);
117 
120 
122  bool p13p24_, p12_, p34_;
123 
124 
125 public:
127  TwoElectronInt(const IntegralFactory* integral, int deriv=0, bool use_shell_pairs=false);
128 
129  virtual ~TwoElectronInt();
130 
133 
135  virtual size_t compute_shell(int, int, int, int);
136 
138  virtual size_t compute_shell_deriv1(int, int, int, int);
139 
141  virtual size_t compute_shell_deriv2(int, int, int, int);
142 };
143 
144 class ERI : public TwoElectronInt
145 {
146 public:
147  ERI(const IntegralFactory* integral, int deriv=0, bool use_shell_pairs=false);
148  virtual ~ERI();
149 };
150 
151 class F12 : public TwoElectronInt
152 {
153 public:
154  F12(std::shared_ptr<CorrelationFactor> cf, const IntegralFactory* integral, int deriv=0, bool use_shell_pairs=false);
155  virtual ~F12();
156 };
157 
158 class F12Scaled : public TwoElectronInt
159 {
160 public:
161  F12Scaled(std::shared_ptr<CorrelationFactor> cf, const IntegralFactory* integral, int deriv=0, bool use_shell_pairs=false);
162  virtual ~F12Scaled();
163 };
164 
166 {
167 public:
168  F12Squared(std::shared_ptr<CorrelationFactor> cf, const IntegralFactory* integral, int deriv=0, bool use_shell_pairs=false);
169  virtual ~F12Squared();
170 };
171 
172 class F12G12 : public TwoElectronInt
173 {
174 public:
175  F12G12(std::shared_ptr<CorrelationFactor> cf, const IntegralFactory* integral, int deriv=0, bool use_shell_pairs=false);
176  virtual ~F12G12();
177 };
178 
180 {
181 public:
182  F12DoubleCommutator(std::shared_ptr<CorrelationFactor> cf, const IntegralFactory* integral, int deriv=0, bool use_shell_pairs=false);
183  virtual ~F12DoubleCommutator();
184 };
185 
186 class ErfERI : public TwoElectronInt
187 {
188 public:
189  ErfERI(double omega, const IntegralFactory* integral, int deriv=0, bool use_shell_pairs=false);
190  virtual ~ErfERI();
191 
192  void setOmega(double omega);
193 };
194 
196 {
197 public:
198  ErfComplementERI(double omega, const IntegralFactory* integral, int deriv=0, bool use_shell_pairs=false);
199  virtual ~ErfComplementERI();
200 
201  void setOmega(double omega);
202 };
203 
204 }
205 
206 #endif
ShellPair ** pairs34_
Definition: eri.h:113
Definition: eri.h:50
int osh3_
Definition: eri.h:119
Definition: eri.h:165
double * stack34_
Definition: eri.h:110
Definition: integral.h:228
void setOmega(double omega)
Definition: eri.cc:202
void init_shell_pairs12()
Form shell pair information. Must be smart enough to handle arbitrary basis sets. ...
Definition: eribase.cc:1908
F12Squared(std::shared_ptr< CorrelationFactor > cf, const IntegralFactory *integral, int deriv=0, bool use_shell_pairs=false)
Definition: eri.cc:99
double *** PB
Distance between P and shell j center.
Definition: eri.h:60
F12DoubleCommutator(std::shared_ptr< CorrelationFactor > cf, const IntegralFactory *integral, int deriv=0, bool use_shell_pairs=false)
Definition: eri.cc:139
const IntegralFactory * integral() const
Returns the integral factory used to create this object.
Definition: twobody.h:153
virtual size_t compute_shell_deriv2(int, int, int, int)
Compute ERI second derivatives between 4 sheels. Result is stored in buffer.
Definition: eribase.cc:2957
virtual ~F12DoubleCommutator()
Definition: eri.cc:150
F12G12(std::shared_ptr< CorrelationFactor > cf, const IntegralFactory *integral, int deriv=0, bool use_shell_pairs=false)
Definition: eri.cc:119
Definition: eri.h:186
virtual ~TwoElectronInt()
Definition: eribase.cc:1896
int osh2_
Definition: eri.h:119
Definition: twobody.h:60
struct psi::ShellPair_typ ShellPair
bool p13p24_
Were the indices permuted?
Definition: eri.h:122
bool p12_
Definition: eri.h:122
bool use_shell_pairs_
Should we use shell pair information?
Definition: eri.h:107
virtual ~ErfComplementERI()
Definition: eri.cc:197
bool p34_
Definition: eri.h:122
double * stack12_
Stack memory pointer, used in init_shell_pairs, freed in destructor.
Definition: eri.h:110
size_t compute_quartet_deriv1(int, int, int, int)
Computes the ERI derivatives between four shells.
Definition: eribase.cc:2748
Evaluates the Boys function F_j(T)
Definition: fjt.h:63
double ** gamma
Array of the gammas (ai + aj)
Definition: eri.h:64
ErfComplementERI(double omega, const IntegralFactory *integral, int deriv=0, bool use_shell_pairs=false)
Definition: eri.cc:185
virtual size_t compute_shell_deriv1(int, int, int, int)
Compute ERI derivatives between 4 shells. Result is stored in buffer.
Definition: eribase.cc:2611
F12Scaled(std::shared_ptr< CorrelationFactor > cf, const IntegralFactory *integral, int deriv=0, bool use_shell_pairs=false)
Definition: eri.cc:79
int max_cart_
Maximum cartesian class size.
Definition: eri.h:84
double * ai
Array of alphas for both centers.
Definition: eri.h:62
int i
Shells for this information.
Definition: eri.h:52
void free_shell_pairs34()
Definition: eribase.cc:2197
virtual ~ErfERI()
Definition: eri.cc:171
size_t memory_to_store_shell_pairs(const std::shared_ptr< BasisSet > &, const std::shared_ptr< BasisSet > &)
Evaluates how much memory (in doubles) is needed to store shell pair data.
Definition: eribase.cc:2201
Definition: eri.h:195
size_t compute_quartet(int, int, int, int)
Computes the ERIs between four shells.
Definition: eribase.cc:2374
Definition: eri.h:151
virtual ~ERI()
Definition: eri.cc:50
ErfERI(double omega, const IntegralFactory *integral, int deriv=0, bool use_shell_pairs=false)
Definition: eri.cc:159
Definition: eri.h:172
size_t compute_quartet_deriv2(int, int, int, int)
Computes the ERI second derivative between four shells.
Definition: eribase.cc:3087
Capable of computing two-electron repulsion integrals.
Definition: eri.h:144
double * cj
Definition: eri.h:66
int osh4_
Definition: eri.h:119
double ** overlap
Overlap between primitives on i and j.
Definition: eri.h:68
Definition: eri.h:158
Definition: integral.h:385
double AB[3]
Distance between shell i and shell j centers.
Definition: eri.h:56
Libderiv_t libderiv_
Libderiv object.
Definition: eri.h:81
double *** P
Matrix over primitives with x, y, z coordinate of average Gaussian.
Definition: eri.h:54
void free_shell_pairs12()
Free shell pair information.
Definition: eribase.cc:2156
Definition: eri.h:75
size_t compute_shell(const AOShellCombinationsIterator &)
Compute ERIs between 4 shells. Result is stored in buffer.
Definition: eribase.cc:2216
Fjt * fjt_
Computes the fundamental.
Definition: eri.h:87
ERI(const IntegralFactory *integral, int deriv=0, bool use_shell_pairs=false)
Definition: eri.cc:39
TwoElectronInt(const IntegralFactory *integral, int deriv=0, bool use_shell_pairs=false)
Constructor. Use an IntegralFactory to create this object.
Definition: eribase.cc:1792
virtual ~F12Scaled()
Definition: eri.cc:90
int j
Definition: eri.h:52
virtual ~F12()
Definition: eri.cc:70
virtual ~F12Squared()
Definition: eri.cc:110
int osh1_
Original shell index requested.
Definition: eri.h:119
int deriv() const
Returns the derivative level this object is setup for.
Definition: twobody.h:147
double * ci
Contraction coefficients.
Definition: eri.h:66
double *** PA
Distance between P and shell i center.
Definition: eri.h:58
void init_shell_pairs34()
Definition: eribase.cc:2038
double * aj
Definition: eri.h:62
Definition: eri.h:179
ShellPair ** pairs12_
Shell pair information.
Definition: eri.h:113
F12(std::shared_ptr< CorrelationFactor > cf, const IntegralFactory *integral, int deriv=0, bool use_shell_pairs=false)
Definition: eri.cc:59
Libint_t libint_
Libint object.
Definition: eri.h:79
void setOmega(double omega)
Definition: eri.cc:176
virtual ~F12G12()
Definition: eri.cc:130