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-2018 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 
74 class TwoElectronInt : public TwoBodyAOInt {
75  protected:
77  Libint_t libint_;
79  Libderiv_t libderiv_;
80 
82  int max_cart_;
83 
86 
88  size_t compute_quartet(int, int, int, int);
89 
91  size_t compute_quartet_deriv1(int, int, int, int);
92 
94  size_t compute_quartet_deriv2(int, int, int, int);
95 
97  void init_shell_pairs12();
98  void init_shell_pairs34();
99 
101  void free_shell_pairs12();
102  void free_shell_pairs34();
103 
106 
108  double *stack12_, *stack34_;
109 
112 
114  size_t memory_to_store_shell_pairs(const std::shared_ptr<BasisSet>&, const std::shared_ptr<BasisSet>&);
115 
118 
120  bool p13p24_, p12_, p34_;
121 
122  public:
124  TwoElectronInt(const IntegralFactory* integral, int deriv = 0, bool use_shell_pairs = false);
125 
126  virtual ~TwoElectronInt();
127 
130 
132  virtual size_t compute_shell(int, int, int, int);
133 
135  virtual size_t compute_shell_deriv1(int, int, int, int);
136 
138  virtual size_t compute_shell_deriv2(int, int, int, int);
139 };
140 
141 class ERI : public TwoElectronInt {
142  public:
143  ERI(const IntegralFactory* integral, int deriv = 0, bool use_shell_pairs = false);
144  virtual ~ERI();
145 };
146 
147 class F12 : public TwoElectronInt {
148  public:
149  F12(std::shared_ptr<CorrelationFactor> cf, const IntegralFactory* integral, int deriv = 0,
150  bool use_shell_pairs = false);
151  virtual ~F12();
152 };
153 
154 class F12Scaled : public TwoElectronInt {
155  public:
156  F12Scaled(std::shared_ptr<CorrelationFactor> cf, const IntegralFactory* integral, int deriv = 0,
157  bool use_shell_pairs = false);
158  virtual ~F12Scaled();
159 };
160 
161 class F12Squared : public TwoElectronInt {
162  public:
163  F12Squared(std::shared_ptr<CorrelationFactor> cf, const IntegralFactory* integral, int deriv = 0,
164  bool use_shell_pairs = false);
165  virtual ~F12Squared();
166 };
167 
168 class F12G12 : public TwoElectronInt {
169  public:
170  F12G12(std::shared_ptr<CorrelationFactor> cf, const IntegralFactory* integral, int deriv = 0,
171  bool use_shell_pairs = false);
172  virtual ~F12G12();
173 };
174 
176  public:
177  F12DoubleCommutator(std::shared_ptr<CorrelationFactor> cf, const IntegralFactory* integral, int deriv = 0,
178  bool use_shell_pairs = false);
179  virtual ~F12DoubleCommutator();
180 };
181 
182 class ErfERI : public TwoElectronInt {
183  public:
184  ErfERI(double omega, const IntegralFactory* integral, int deriv = 0, bool use_shell_pairs = false);
185  virtual ~ErfERI();
186 
187  void setOmega(double omega);
188 };
189 
191  public:
192  ErfComplementERI(double omega, const IntegralFactory* integral, int deriv = 0, bool use_shell_pairs = false);
193  virtual ~ErfComplementERI();
194 
195  void setOmega(double omega);
196 };
197 
198 } // namespace psi
199 
200 #endif
ShellPair ** pairs34_
Definition: eri.h:111
Definition: eri.h:49
int osh3_
Definition: eri.h:117
Definition: eri.h:161
double * stack34_
Definition: eri.h:108
Definition: integral.h:223
void setOmega(double omega)
Definition: eri.cc:140
void init_shell_pairs12()
Form shell pair information. Must be smart enough to handle arbitrary basis sets. ...
Definition: eribase.cc:1905
F12Squared(std::shared_ptr< CorrelationFactor > cf, const IntegralFactory *integral, int deriv=0, bool use_shell_pairs=false)
Definition: eri.cc:78
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:103
const IntegralFactory * integral() const
Returns the integral factory used to create this object.
Definition: twobody.h:150
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:2945
virtual ~F12DoubleCommutator()
Definition: eri.cc:110
F12G12(std::shared_ptr< CorrelationFactor > cf, const IntegralFactory *integral, int deriv=0, bool use_shell_pairs=false)
Definition: eri.cc:91
Definition: eri.h:182
virtual ~TwoElectronInt()
Definition: eribase.cc:1895
int osh2_
Definition: eri.h:117
Definition: twobody.h:60
struct psi::ShellPair_typ ShellPair
bool p13p24_
Were the indices permuted?
Definition: eri.h:120
bool p12_
Definition: eri.h:120
bool use_shell_pairs_
Should we use shell pair information?
Definition: eri.h:105
virtual ~ErfComplementERI()
Definition: eri.cc:138
bool p34_
Definition: eri.h:120
double * stack12_
Stack memory pointer, used in init_shell_pairs, freed in destructor.
Definition: eri.h:108
size_t compute_quartet_deriv1(int, int, int, int)
Computes the ERI derivatives between four shells.
Definition: eribase.cc:2729
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:131
virtual size_t compute_shell_deriv1(int, int, int, int)
Compute ERI derivatives between 4 shells. Result is stored in buffer.
Definition: eribase.cc:2593
F12Scaled(std::shared_ptr< CorrelationFactor > cf, const IntegralFactory *integral, int deriv=0, bool use_shell_pairs=false)
Definition: eri.cc:65
int max_cart_
Maximum cartesian class size.
Definition: eri.h:82
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:2185
virtual ~ErfERI()
Definition: eri.cc:123
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:2187
Definition: eri.h:190
size_t compute_quartet(int, int, int, int)
Computes the ERIs between four shells.
Definition: eribase.cc:2358
Definition: eri.h:147
virtual ~ERI()
Definition: eri.cc:47
ErfERI(double omega, const IntegralFactory *integral, int deriv=0, bool use_shell_pairs=false)
Definition: eri.cc:116
Definition: eri.h:168
size_t compute_quartet_deriv2(int, int, int, int)
Computes the ERI second derivative between four shells.
Definition: eribase.cc:3073
Capable of computing two-electron repulsion integrals.
Definition: eri.h:141
double * cj
Definition: eri.h:65
int osh4_
Definition: eri.h:117
double ** overlap
Overlap between primitives on i and j.
Definition: eri.h:67
Definition: eri.h:154
Definition: integral.h:374
double AB[3]
Distance between shell i and shell j centers.
Definition: eri.h:55
Libderiv_t libderiv_
Libderiv object.
Definition: eri.h:79
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:2150
Definition: eri.h:74
size_t compute_shell(const AOShellCombinationsIterator &)
Compute ERIs between 4 shells. Result is stored in buffer.
Definition: eribase.cc:2202
Fjt * fjt_
Computes the fundamental.
Definition: eri.h:85
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:1785
virtual ~F12Scaled()
Definition: eri.cc:72
int j
Definition: eri.h:51
virtual ~F12()
Definition: eri.cc:59
virtual ~F12Squared()
Definition: eri.cc:85
int osh1_
Original shell index requested.
Definition: eri.h:117
int deriv() const
Returns the derivative level this object is setup for.
Definition: twobody.h:144
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:2033
double * aj
Definition: eri.h:61
Definition: eri.h:175
ShellPair ** pairs12_
Shell pair information.
Definition: eri.h:111
F12(std::shared_ptr< CorrelationFactor > cf, const IntegralFactory *integral, int deriv=0, bool use_shell_pairs=false)
Definition: eri.cc:53
Libint_t libint_
Libint object.
Definition: eri.h:77
void setOmega(double omega)
Definition: eri.cc:125
virtual ~F12G12()
Definition: eri.cc:97