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 file is part of Psi4.
12  *
13  * Psi4 is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU Lesser General Public License as published by
15  * the Free Software Foundation, version 3.
16  *
17  * Psi4 is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public License along
23  * with Psi4; if not, write to the Free Software Foundation, Inc.,
24  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25  *
26  * @END LICENSE
27  */
28 
29 #ifndef _psi_src_lib_libmints_eri_h
30 #define _psi_src_lib_libmints_eri_h
31 
32 #include <libint/libint.h>
33 #include <libint/libderiv.h>
34 #include "psi4/libmints/twobody.h"
35 
36 namespace psi {
37 
38 class BasisSet;
39 class TwoBodyAOInt;
40 class IntegralFactory;
41 class Fjt;
42 class AOShellCombinationsIterator;
43 class CorrelationFactor;
44 
49 typedef struct ShellPair_typ {
51  int i, j;
53  double *** P;
55  double AB[3];
57  double *** PA;
59  double *** PB;
61  double * ai, * aj;
63  double ** gamma;
65  double * ci, * cj;
67  double ** overlap;
68 } ShellPair;
69 
75 {
76 protected:
78  Libint_t libint_;
80  Libderiv_t libderiv_;
81 
83  int max_cart_;
84 
87 
89  size_t compute_quartet(int, int, int, int);
90 
92  size_t compute_quartet_deriv1(int, int, int, int);
93 
95  size_t compute_quartet_deriv2(int, int, int, int);
96 
98  void init_shell_pairs12();
99  void init_shell_pairs34();
100 
102  void free_shell_pairs12();
103  void free_shell_pairs34();
104 
107 
109  double *stack12_, *stack34_;
110 
113 
115  size_t memory_to_store_shell_pairs(const std::shared_ptr<BasisSet>&, const std::shared_ptr<BasisSet>&);
116 
119 
121  bool p13p24_, p12_, p34_;
122 
123 
124 public:
126  TwoElectronInt(const IntegralFactory* integral, int deriv=0, bool use_shell_pairs=false);
127 
128  virtual ~TwoElectronInt();
129 
132 
134  virtual size_t compute_shell(int, int, int, int);
135 
137  virtual size_t compute_shell_deriv1(int, int, int, int);
138 
140  virtual size_t compute_shell_deriv2(int, int, int, int);
141 };
142 
143 class ERI : public TwoElectronInt
144 {
145 public:
146  ERI(const IntegralFactory* integral, int deriv=0, bool use_shell_pairs=false);
147  virtual ~ERI();
148 };
149 
150 class F12 : public TwoElectronInt
151 {
152 public:
153  F12(std::shared_ptr<CorrelationFactor> cf, const IntegralFactory* integral, int deriv=0, bool use_shell_pairs=false);
154  virtual ~F12();
155 };
156 
157 class F12Scaled : public TwoElectronInt
158 {
159 public:
160  F12Scaled(std::shared_ptr<CorrelationFactor> cf, const IntegralFactory* integral, int deriv=0, bool use_shell_pairs=false);
161  virtual ~F12Scaled();
162 };
163 
165 {
166 public:
167  F12Squared(std::shared_ptr<CorrelationFactor> cf, const IntegralFactory* integral, int deriv=0, bool use_shell_pairs=false);
168  virtual ~F12Squared();
169 };
170 
171 class F12G12 : public TwoElectronInt
172 {
173 public:
174  F12G12(std::shared_ptr<CorrelationFactor> cf, const IntegralFactory* integral, int deriv=0, bool use_shell_pairs=false);
175  virtual ~F12G12();
176 };
177 
179 {
180 public:
181  F12DoubleCommutator(std::shared_ptr<CorrelationFactor> cf, const IntegralFactory* integral, int deriv=0, bool use_shell_pairs=false);
182  virtual ~F12DoubleCommutator();
183 };
184 
185 class ErfERI : public TwoElectronInt
186 {
187 public:
188  ErfERI(double omega, const IntegralFactory* integral, int deriv=0, bool use_shell_pairs=false);
189  virtual ~ErfERI();
190 
191  void setOmega(double omega);
192 };
193 
195 {
196 public:
197  ErfComplementERI(double omega, const IntegralFactory* integral, int deriv=0, bool use_shell_pairs=false);
198  virtual ~ErfComplementERI();
199 
200  void setOmega(double omega);
201 };
202 
203 }
204 
205 #endif
ShellPair ** pairs34_
Definition: eri.h:112
Definition: eri.h:49
int osh3_
Definition: eri.h:118
Definition: eri.h:164
double * stack34_
Definition: eri.h:109
Definition: integral.h:227
void setOmega(double omega)
Definition: eri.cc:203
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:100
double *** PB
Distance between P and shell j center.
Definition: eri.h:59
F12DoubleCommutator(std::shared_ptr< CorrelationFactor > cf, const IntegralFactory *integral, int deriv=0, bool use_shell_pairs=false)
Definition: eri.cc:140
const IntegralFactory * integral() const
Returns the integral factory used to create this object.
Definition: twobody.h:154
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:151
F12G12(std::shared_ptr< CorrelationFactor > cf, const IntegralFactory *integral, int deriv=0, bool use_shell_pairs=false)
Definition: eri.cc:120
Definition: eri.h:185
virtual ~TwoElectronInt()
Definition: eribase.cc:1896
int osh2_
Definition: eri.h:118
Definition: twobody.h:61
struct psi::ShellPair_typ ShellPair
bool p13p24_
Were the indices permuted?
Definition: eri.h:121
bool p12_
Definition: eri.h:121
bool use_shell_pairs_
Should we use shell pair information?
Definition: eri.h:106
virtual ~ErfComplementERI()
Definition: eri.cc:198
bool p34_
Definition: eri.h:121
double * stack12_
Stack memory pointer, used in init_shell_pairs, freed in destructor.
Definition: eri.h:109
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:64
double ** gamma
Array of the gammas (ai + aj)
Definition: eri.h:63
ErfComplementERI(double omega, const IntegralFactory *integral, int deriv=0, bool use_shell_pairs=false)
Definition: eri.cc:186
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:80
int max_cart_
Maximum cartesian class size.
Definition: eri.h:83
double * ai
Array of alphas for both centers.
Definition: eri.h:61
int i
Shells for this information.
Definition: eri.h:51
void free_shell_pairs34()
Definition: eribase.cc:2197
virtual ~ErfERI()
Definition: eri.cc:172
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:194
size_t compute_quartet(int, int, int, int)
Computes the ERIs between four shells.
Definition: eribase.cc:2374
Definition: eri.h:150
virtual ~ERI()
Definition: eri.cc:51
ErfERI(double omega, const IntegralFactory *integral, int deriv=0, bool use_shell_pairs=false)
Definition: eri.cc:160
Definition: eri.h:171
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:143
double * cj
Definition: eri.h:65
int osh4_
Definition: eri.h:118
double ** overlap
Overlap between primitives on i and j.
Definition: eri.h:67
Definition: eri.h:157
Definition: integral.h:384
double AB[3]
Distance between shell i and shell j centers.
Definition: eri.h:55
Libderiv_t libderiv_
Libderiv object.
Definition: eri.h:80
double *** P
Matrix over primitives with x, y, z coordinate of average Gaussian.
Definition: eri.h:53
void free_shell_pairs12()
Free shell pair information.
Definition: eribase.cc:2156
Definition: eri.h:74
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:86
ERI(const IntegralFactory *integral, int deriv=0, bool use_shell_pairs=false)
Definition: eri.cc:40
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:91
int j
Definition: eri.h:51
virtual ~F12()
Definition: eri.cc:71
virtual ~F12Squared()
Definition: eri.cc:111
int osh1_
Original shell index requested.
Definition: eri.h:118
int deriv() const
Returns the derivative level this object is setup for.
Definition: twobody.h:148
double * ci
Contraction coefficients.
Definition: eri.h:65
double *** PA
Distance between P and shell i center.
Definition: eri.h:57
void init_shell_pairs34()
Definition: eribase.cc:2038
double * aj
Definition: eri.h:61
Definition: eri.h:178
ShellPair ** pairs12_
Shell pair information.
Definition: eri.h:112
F12(std::shared_ptr< CorrelationFactor > cf, const IntegralFactory *integral, int deriv=0, bool use_shell_pairs=false)
Definition: eri.cc:60
Libint_t libint_
Libint object.
Definition: eri.h:78
void setOmega(double omega)
Definition: eri.cc:177
virtual ~F12G12()
Definition: eri.cc:131